diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 1b405ae20..a450437ae 100644 Binary files a/.voidbot/state/aetheria.cc and b/.voidbot/state/aetheria.cc differ diff --git a/Assets/Scripts/ServerShared/Behaviors/TurretController.cs b/Assets/Scripts/ServerShared/Behaviors/TurretController.cs index 2a610344a..d83f87709 100644 --- a/Assets/Scripts/ServerShared/Behaviors/TurretController.cs +++ b/Assets/Scripts/ServerShared/Behaviors/TurretController.cs @@ -22,7 +22,6 @@ public class TurretControllerData : BehaviorData public class TurretController : Behavior, IInitializableBehavior { - private TurretControllerData _data; private List _weapons = new List(); private float _shotSpeed; private bool _predictShots; @@ -33,12 +32,10 @@ public class TurretController : Behavior, IInitializableBehavior public TurretController(TurretControllerData data, EquippedItem item) : base(data, item) { - _data = data; } public TurretController(TurretControllerData data, ConsumableItemEffect item) : base(data, item) { - _data = data; } public void Initialize() @@ -46,7 +43,7 @@ public class TurretController : Behavior, IInitializableBehavior foreach (var weapon in Entity.GetBehaviors()) { _weapons.Add(weapon); - var vel = weapon.Evaluate(weapon.WeaponData.Velocity); + var vel = weapon.EvaluateVelocity(); if (vel > .1f) { _predictShots = true; @@ -77,11 +74,10 @@ public class TurretController : Behavior, IInitializableBehavior foreach (var x in _weapons) { - var data = x.Data as WeaponData; var fire = dot( x.Direction, Entity.LookDirection) > .99f; - if (x.Evaluate(data.Range) > dist && fire) + if (x.EvaluateRange() > dist && fire) { x.Activate(); } diff --git a/Assets/Scripts/ServerShared/Behaviors/Weapon.cs b/Assets/Scripts/ServerShared/Behaviors/Weapon.cs index a780eacda..4d81c3691 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Weapon.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Weapon.cs @@ -126,4 +126,14 @@ public abstract class Weapon : Behavior, IActivatedBehavior { _firing = false; } + + public float EvaluateRange() + { + return Evaluate(_data.Range); + } + + public float EvaluateVelocity() + { + return Evaluate(_data.Velocity); + } } diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 7172e809a..f1aa5d5e7 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -838,6 +838,9 @@ First Aetheria surfaces to publish: and target-stat count. - Done: extend behavior state rows for TurretController initialized weapon count, shot speed, and predictive-aim flag. + - Done: move TurretController weapon range and shot-speed evaluation behind + `Weapon` runtime methods, so turret AI no longer casts weapon config DTOs + to decide firing range or predictive aim. - Done: cut live simulation grids out of `RuntimeEntityBlueprint`; loadout and construction templates no longer capture or restore temperature, armor, max-armor, or hull-conductivity state. @@ -994,6 +997,9 @@ First Aetheria surfaces to publish: config bridge onto `Behavior.Kind` and `Behavior.Group`, so state snapshots, weapon snapshots, progress rows, stat-modifier matching, and behavior grouping use runtime instance identity. + - Done: move TurretController's weapon range/velocity reads off + `WeaponData` casts and onto `Weapon.EvaluateRange`/`EvaluateVelocity`; + weapon config fields remain private inputs to the weapon runtime owner. - Done: delete the legacy `Behaviors` lists from `ConsumableItemData` and `EquippableItemData`; item DTOs can no longer carry behavior config state. - Done: move runtime blueprint price aggregation and conductivity restore