Merge origin/master (2403a5f3, gear-without-presence) into eureka/aetheria-release-retire-longinusx
Lands retire-longinusx on master after gear-without-presence. The catalog is regenerated from master's catalog with retire-longinusx apply (next commit). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # GameData/Aetheria.cc
This commit is contained in:
commit
284231f4c1
49 changed files with 2770 additions and 180 deletions
|
|
@ -341,6 +341,19 @@ public class ActionGameManager : MonoBehaviour
|
|||
foreach (var wormhole in ZoneRenderer.WormholeInstances.Keys)
|
||||
{
|
||||
if (!(length(wormhole.Position - CurrentEntity.Position.xz) < Settings.GameplaySettings.WormholeExitRadius)) continue;
|
||||
if (wormhole.Exit)
|
||||
{
|
||||
// The exit gate leads nowhere: RunGoal decides whether it is open, and an open one ends the run.
|
||||
if (RunGoal.ExitOpen(Zone)) Win();
|
||||
else
|
||||
{
|
||||
Dialog.Clear();
|
||||
Dialog.Title.text = $"The exit gate is sealed. {RunGoal.Boss(Zone)?.Name ?? "Its guardian"} holds it shut.";
|
||||
Dialog.Show();
|
||||
Dialog.MoveToCursor();
|
||||
}
|
||||
return;
|
||||
}
|
||||
EnterWormhole(wormhole);
|
||||
}
|
||||
Dock();
|
||||
|
|
@ -1185,9 +1198,9 @@ public class ActionGameManager : MonoBehaviour
|
|||
return float3(pose.x, Settings.PlanetSettings.AsteroidVerticalOffset, pose.y);
|
||||
}
|
||||
|
||||
private void Die(CauseOfDeath cause)
|
||||
// The one way a run ends, won or lost: the run is cleared and the main menu returns.
|
||||
private void EndRun()
|
||||
{
|
||||
var deathTime = Time.time;
|
||||
UnbindEntity();
|
||||
CurrentEntity = null;
|
||||
MainMenu.gameObject.SetActive(true);
|
||||
|
|
@ -1195,6 +1208,21 @@ public class ActionGameManager : MonoBehaviour
|
|||
CurrentGalaxy = null;
|
||||
RunSave.Clear(CultCache);
|
||||
SavePlayerSettings();
|
||||
}
|
||||
|
||||
private void Win()
|
||||
{
|
||||
EndRun();
|
||||
Dialog.Clear();
|
||||
Dialog.Title.text = "You have escaped the Terminus. This was the demo; the whole of it is yet to come.";
|
||||
Dialog.Show();
|
||||
Dialog.MoveToCursor();
|
||||
}
|
||||
|
||||
private void Die(CauseOfDeath cause)
|
||||
{
|
||||
var deathTime = Time.time;
|
||||
EndRun();
|
||||
Observable.EveryUpdate()
|
||||
.Where(_ => Time.time - deathTime < DeathPostTransitionTime)
|
||||
.Subscribe(_ =>
|
||||
|
|
@ -1395,7 +1423,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
: $"base {d.PBase:P1}";
|
||||
|
||||
DebugInfoText.text =
|
||||
$"FIRE CONTROL - {selectedItem.Data.Name}\n" +
|
||||
$"FIRE CONTROL - {ItemManager.Title(selectedItem.EquippableItem)}\n" +
|
||||
$"{gates}\n" +
|
||||
$"range {d.Range:F0} [{d.MinRange:F0}..{d.MaxRange:F0}]\n" +
|
||||
$"info {d.Info:F3}/{d.InfoDemandCeiling:F3} sensor {d.PSensor:F3}\n" +
|
||||
|
|
|
|||
|
|
@ -4,15 +4,14 @@ using UnityEngine;
|
|||
using CultMath;
|
||||
using static CultMath.math;
|
||||
|
||||
// Presentation only: the barrel follows the point its group's solution places (EntityInstance), which FireControl has
|
||||
// already clamped to the arc. This decides no arc; Speed and the pitch clamp are how the picture slews.
|
||||
public class ArticulationPoint : MonoBehaviour
|
||||
{
|
||||
public Transform Target;
|
||||
|
||||
public int Group;
|
||||
|
||||
public float YawMin;
|
||||
public float YawMax;
|
||||
|
||||
public float PitchMin;
|
||||
public float PitchMax;
|
||||
|
||||
|
|
@ -30,7 +29,7 @@ public class ArticulationPoint : MonoBehaviour
|
|||
var yaw = Vector2.SignedAngle(new Vector2(0, 1), new Vector2(targetLocal.x, targetLocal.z));
|
||||
var pitch = Vector2.SignedAngle(new Vector2(1, 0), new Vector2(targetLocal.z, targetLocal.y));
|
||||
|
||||
var targetYaw = clamp(_yaw - yaw, YawMin, YawMax);
|
||||
var targetYaw = _yaw - yaw;
|
||||
var targetPitch = clamp(_pitch - pitch, PitchMin, PitchMax);
|
||||
|
||||
if (abs(targetYaw - _yaw) < Speed * Time.deltaTime)
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ public class EntityInstance : MonoBehaviour
|
|||
public Dictionary<HardpointData, int> BarrelIndices { get; private set; }
|
||||
public Dictionary<Radiator, MeshRenderer> RadiatorMeshes { get; private set; }
|
||||
public Transform LookAtPoint { get; private set; }
|
||||
private Dictionary<int, Transform> _groupAims;
|
||||
public Entity Entity { get; private set; }
|
||||
public ZoneRenderer ZoneRenderer { get; private set; }
|
||||
public Transform LocalSpace { get; private set; }
|
||||
|
|
@ -186,7 +187,8 @@ public class EntityInstance : MonoBehaviour
|
|||
sensor.OnPingEnd += OnSensorPingEnd;
|
||||
}
|
||||
|
||||
if (behavior is InstantWeapon instantWeapon)
|
||||
// A mine layer's presentation is the mine it lays (MineInstance, drawn by ZoneRenderer from Zone.Mines).
|
||||
if (behavior is InstantWeapon instantWeapon && !FireControl.IsMineLayer(instantWeapon))
|
||||
{
|
||||
var data = (InstantWeaponData) instantWeapon.Data;
|
||||
if (!_instantWeaponManagers.ContainsKey(data))
|
||||
|
|
@ -276,10 +278,14 @@ public class EntityInstance : MonoBehaviour
|
|||
// HullColliders no longer publish Hit or a blast event at all (R8).
|
||||
|
||||
LookAtPoint = new GameObject($"{entity.Name} Look Point").transform;
|
||||
|
||||
|
||||
// One aim point per articulation group, placed each LateUpdate where the group's first weapon aims.
|
||||
_groupAims = new Dictionary<int, Transform>();
|
||||
foreach (var articulationPoint in ArticulationPoints)
|
||||
{
|
||||
articulationPoint.Target = LookAtPoint;
|
||||
if (!_groupAims.TryGetValue(articulationPoint.Group, out var aim))
|
||||
_groupAims[articulationPoint.Group] = aim = new GameObject($"{entity.Name} Aim {articulationPoint.Group}").transform;
|
||||
articulationPoint.Target = aim;
|
||||
}
|
||||
|
||||
_subscriptions.Add(Entity.HullDamage.Subscribe(_ =>
|
||||
|
|
@ -398,8 +404,18 @@ public class EntityInstance : MonoBehaviour
|
|||
x.Value.material.SetFloat("_Emission", Entity.ItemManager.GameplaySettings.TemperatureEmissionCurve.Evaluate(x.Key.RadiatorTemperature));
|
||||
}
|
||||
|
||||
LookAtPoint.position = transform.position + Entity.Aim.ToUnity() *
|
||||
(!Entity.Target.Value.IsNone ? max(Entity.TargetRange,Entity.ItemManager.GameplaySettings.ConvergenceMinimumDistance) : 10000);
|
||||
var aimDistance = !Entity.Target.Value.IsNone
|
||||
? max(Entity.TargetRange, Entity.ItemManager.GameplaySettings.ConvergenceMinimumDistance)
|
||||
: 10000;
|
||||
LookAtPoint.position = transform.position + Entity.Aim.ToUnity() * aimDistance;
|
||||
foreach (var group in _groupAims)
|
||||
{
|
||||
var weapon = group.Key >= 0 && group.Key < Entity.WeaponGroups.Length ? Entity.WeaponGroups[group.Key].weapons.FirstOrDefault() : null;
|
||||
if (weapon == null) { group.Value.position = LookAtPoint.position; continue; }
|
||||
var barrel = Barrels.TryGetValue(weapon.Item.Hardpoint, out var barrels) ? barrels[0].position : transform.position;
|
||||
var direction = FireControl.Solution(weapon, Entity, Entity.Target.Value).Direction;
|
||||
group.Value.position = barrel + new Vector3(direction.x, 0, direction.y) * aimDistance;
|
||||
}
|
||||
LocalSpace.localPosition = transform.position = Entity.Position.ToUnity();
|
||||
if (_influenceInstance)
|
||||
_influenceInstance.position = new Vector3(Entity.Position.x, 0, Entity.Position.z);
|
||||
|
|
|
|||
74
Assets/Scripts/Gameplay/MineInstance.cs
Normal file
74
Assets/Scripts/Gameplay/MineInstance.cs
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
using CultMath;
|
||||
using CultMath.UnityBridge;
|
||||
using UnityEngine;
|
||||
using static CultMath.math;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
// How one laid mine looks. Zone owns the mine's every fact (position, arming, trigger, end); this reads them and
|
||||
// draws, and writes nothing back. The pose is the latest sim body, spun for show; the pulse runs in real time
|
||||
// (rulings unity-presents-only-r3 and sim-speed-presentation).
|
||||
public class MineInstance : MonoBehaviour
|
||||
{
|
||||
public MeshRenderer MeshRenderer;
|
||||
public int EmissionSubmesh = 2;
|
||||
public AnimationCurve EmissionCurve;
|
||||
public float ActiveCycleDuration = 1f;
|
||||
public float ArmedCycleDuration = .25f;
|
||||
public float ActiveEmission = 100f;
|
||||
public float ArmedEmission = 1000f;
|
||||
public float RotationSpeed = 1f;
|
||||
public float GridOffset;
|
||||
// The blast's particles; the effect prefab destroys itself when its particle system stops.
|
||||
public GameObject HitEffect;
|
||||
public float HitEffectScale = 10f;
|
||||
|
||||
private Zone _zone;
|
||||
private Mine _mine;
|
||||
private Material _material;
|
||||
private float _timeOffset;
|
||||
private float _pulse;
|
||||
private float _emission;
|
||||
|
||||
public void Bind(Zone zone, Mine mine)
|
||||
{
|
||||
_zone = zone;
|
||||
_mine = mine;
|
||||
_material = MeshRenderer.materials[EmissionSubmesh];
|
||||
_timeOffset = Random.value * 100;
|
||||
Place();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
Place();
|
||||
transform.localRotation = Quaternion.Euler(
|
||||
sin(Time.time - _timeOffset * RotationSpeed) * 90, 0, cos(Time.time - _timeOffset * RotationSpeed) * 90);
|
||||
|
||||
// None before the mine arms, then slow while it waits and fast once its fuse is lit.
|
||||
var armed = _mine.Armed(_zone.Time);
|
||||
var counting = _mine.TriggeredAt != null;
|
||||
var target = !armed ? 0f : counting ? ArmedEmission : ActiveEmission;
|
||||
_emission = lerp(_emission, target, Time.deltaTime * 10);
|
||||
_pulse = (_pulse + Time.deltaTime / (counting ? ArmedCycleDuration : ActiveCycleDuration)) % 1;
|
||||
_material.SetFloat("_Emission", _emission * EmissionCurve.Evaluate(_pulse));
|
||||
}
|
||||
|
||||
private void Place()
|
||||
{
|
||||
var p = _mine.Body.Position;
|
||||
transform.position = new Vector3(p.x, _zone.GetHeight(p) + GridOffset, p.y);
|
||||
}
|
||||
|
||||
// The mine left Zone.Mines, which only its blast does: show it where it was drawn last.
|
||||
public void Blast()
|
||||
{
|
||||
var effect = Instantiate(HitEffect, transform.position, Quaternion.identity);
|
||||
effect.transform.localScale = Vector3.one * HitEffectScale;
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (_material) Destroy(_material);
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Gameplay/MineInstance.cs.meta
Normal file
2
Assets/Scripts/Gameplay/MineInstance.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 35c62f5e26769f645b1a1614a70422e1
|
||||
Loading…
Reference in a new issue