Aetheria/Assets/Scripts/ServerShared/Behaviors
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Meta Vens 95d6fd3b14 F4/F5: shield restore survives inactivity, and CanTakeHit stops mutating
F4: a hit that breaks the shield usually also cooks it (TakeHit's own
AddHeat), which can knock the item thermally offline in the same tick. The
reserve's recharge and its Broken-clearing check lived inside Execute, which
Entity.Update only runs while Item.Active is true -- so a shield broken by a
hit that also shuts it down could never come back, no matter how long
RestoreDuration allows for. That logic now lives in Shield.Update
(IAlwaysUpdatedBehavior), which Entity.Update calls every tick unconditionally
(Cooldown.cs already relies on the same interface for the same reason).

F5: CanTakeHit broke the shield and drained the reserve as a side effect of
the query itself, on the premise that every caller queries it exactly once
per hit. That premise was false: RaycastAll/SphereCastAll/OverlapSphere hand
every caller under Assets/Scripts/Gameplay/Weapons both the shield collider
and the hull collider for one shot, so the same shield's CanTakeHit was
queried twice per hit. CanTakeHit is now a pure read (Broken + the reserve's
own CanSpend); the mutation moved to a new Shield.Break(), idempotent, called
by each weapon file exactly where it already decided to route a hit past the
shield instead of absorbing it.

Pinned in tests/Aetheria.Shared.Tests/ShieldReserveTests.cs:
RestorationProceedsWhileTheItemIsInactive (F4),
CanTakeHitNeverMutatesRegardlessOfHowManyTimesItIsCalled and
BreakIsIdempotentAcrossRepeatedCalls (F5). Updated every existing test that
relied on CanTakeHit's old mutating side effect to call Break() explicitly,
matching the new caller pattern.

Cannot compile-verify Assets/Scripts/Gameplay/Weapons/*.cs here (UnityEngine,
Unity batchmode unavailable in this environment) -- reviewed by hand for
brace/control-flow correctness; Self or a Unity batchmode pass should confirm.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 05:32:29 +02:00
..
AetherDrive.cs Cut 8: EquippedItem.ConditionRatio -- how healthy a behaviour actually is 2026-09-19 04:41:13 +02:00
AetherDrive.cs.meta Aetheric Drive 2021-04-14 03:29:14 +01:00
AutoWeapon.cs Swap Unity.Mathematics usings for CultMath 2026-09-14 17:39:12 +02:00
AutoWeapon.cs.meta Weapon Scripting Overhaul 2021-01-25 05:53:36 +00:00
Behaviors.cs Cut 5: priority tiers replace PowerBus's single shared GrantRatio 2026-09-19 02:58:38 +02:00
Behaviors.cs.meta Behavior Refactoring 2020-04-09 10:33:16 +01:00
Capacitor.cs Cut 3: PowerBus replaces TryConsumeEnergy/CanConsumeEnergy 2026-09-18 21:39:38 +02:00
Capacitor.cs.meta Energy & Heat 2020-12-27 22:18:22 +00:00
ChargedWeapon.cs Cut 4: input capacitors close the last direct capacitor spend 2026-09-18 22:52:15 +02:00
ChargedWeapon.cs.meta Weapon Scripting Overhaul 2021-01-25 05:53:36 +00:00
Cockpit.cs Swap Unity.Mathematics usings for CultMath 2026-09-14 17:39:12 +02:00
Cockpit.cs.meta Energy & Heat 2020-12-27 22:18:22 +00:00
ConstantWeapon.cs Cut 7: continuous consumers brown out instead of flicking off 2026-09-19 04:10:19 +02:00
ConstantWeapon.cs.meta GUNS GUNS GUNS 2021-01-05 02:56:17 +00:00
Cooldown.cs Move the ServerShared data model onto CultLib's CultCache 2026-09-14 19:00:42 +02:00
Cooldown.cs.meta Massive Item Behavior Refactoring 2020-05-12 01:42:13 +01:00
EnergyDraw.cs Cut 7: continuous consumers brown out instead of flicking off 2026-09-19 04:10:19 +02:00
EnergyDraw.cs.meta Mega Placement 2020-05-21 01:53:06 +01:00
Heat.cs Move the ServerShared data model onto CultLib's CultCache 2026-09-14 19:00:42 +02:00
Heat.cs.meta Massive Item Behavior Refactoring 2020-05-12 01:42:13 +01:00
HeatStorage.cs Swap Unity.Mathematics usings for CultMath 2026-09-14 17:39:12 +02:00
HeatStorage.cs.meta Wormholes 2021-03-05 14:31:18 +00:00
InputCapacitor.cs Cut 4: input capacitors close the last direct capacitor spend 2026-09-18 22:52:15 +02:00
InputCapacitor.cs.meta Cut 4: input capacitors close the last direct capacitor spend 2026-09-18 22:52:15 +02:00
InstantWeapon.cs Cut 5: priority tiers replace PowerBus's single shared GrantRatio 2026-09-19 02:58:38 +02:00
InstantWeapon.cs.meta Weapon Scripting Overhaul 2021-01-25 05:53:36 +00:00
ItemUsage.cs Move the ServerShared data model onto CultLib's CultCache 2026-09-14 19:00:42 +02:00
ItemUsage.cs.meta Behavior Canceling & Grouping 2020-05-11 01:17:10 +01:00
Launcher.cs Swap Unity.Mathematics usings for CultMath 2026-09-14 17:39:12 +02:00
Launcher.cs.meta Restore the stable legacy Unity project 2026-08-10 14:57:50 +01:00
LockWeapon.cs Gate weapon fire on the shooter's own stance, shared by player and AI 2026-09-17 14:00:59 +02:00
LockWeapon.cs.meta Weapon Scripting Overhaul 2021-01-25 05:53:36 +00:00
MiningTool.cs Move the ServerShared data model onto CultLib's CultCache 2026-09-14 19:00:42 +02:00
MiningTool.cs.meta Mining 2020-05-28 04:50:40 +01:00
Radiator.cs F1: power supply multiplies the resolved stat, it does not interpolate 2026-09-19 05:03:31 +02:00
Radiator.cs.meta Behavior Refactoring 2020-04-09 10:33:16 +01:00
Reactor.cs Cut 5: priority tiers replace PowerBus's single shared GrantRatio 2026-09-19 02:58:38 +02:00
Reactor.cs.meta Behavior Refactoring 2020-04-09 10:33:16 +01:00
Reflector.cs Swap Unity.Mathematics usings for CultMath 2026-09-14 17:39:12 +02:00
Reflector.cs.meta Behavior Refactoring 2020-04-09 10:33:16 +01:00
ResourceScanner.cs Move the ServerShared data model onto CultLib's CultCache 2026-09-14 19:00:42 +02:00
ResourceScanner.cs.meta Mega Placement 2020-05-21 01:53:06 +01:00
Sensor.cs Cut 5: priority tiers replace PowerBus's single shared GrantRatio 2026-09-19 02:58:38 +02:00
Sensor.cs.meta Behavior Refactoring 2020-04-09 10:33:16 +01:00
Shield.cs F4/F5: shield restore survives inactivity, and CanTakeHit stops mutating 2026-09-19 05:32:29 +02:00
Shield.cs.meta Behavior Refactoring 2020-04-09 10:33:16 +01:00
StatModifier.cs Cut 6: wire StatSource.PowerSupply and refuse a power request that reads it 2026-09-19 03:47:07 +02:00
StatModifier.cs.meta Massive Item Behavior Refactoring 2020-05-12 01:42:13 +01:00
Switch.cs Move the ServerShared data model onto CultLib's CultCache 2026-09-14 19:00:42 +02:00
Switch.cs.meta Massive Item Behavior Refactoring 2020-05-12 01:42:13 +01:00
Thermotoggle.cs Move the ServerShared data model onto CultLib's CultCache 2026-09-14 19:00:42 +02:00
Thermotoggle.cs.meta Entity Properties & Thermal Regulation 2020-05-26 01:12:06 +01:00
Thruster.cs Cut 8: EquippedItem.ConditionRatio -- how healthy a behaviour actually is 2026-09-19 04:41:13 +02:00
Thruster.cs.meta Behavior Refactoring 2020-04-09 10:33:16 +01:00
Trigger.cs Move the ServerShared data model onto CultLib's CultCache 2026-09-14 19:00:42 +02:00
Trigger.cs.meta Massive Item Behavior Refactoring 2020-05-12 01:42:13 +01:00
TurretController.cs Delete AetheriaMath in favour of CultMath 2026-09-14 18:02:41 +02:00
TurretController.cs.meta Murder Satellites 2021-01-06 14:56:39 +00:00
VelocityConversion.cs Delete AetheriaMath in favour of CultMath 2026-09-14 18:02:41 +02:00
VelocityConversion.cs.meta Behavior Refactoring 2020-04-09 10:33:16 +01:00
VelocityLimit.cs Move the ServerShared data model onto CultLib's CultCache 2026-09-14 19:00:42 +02:00
VelocityLimit.cs.meta Behavior Refactoring 2020-04-09 10:33:16 +01:00
Visibility.cs Restore the stable legacy Unity project 2026-08-10 14:57:50 +01:00
Visibility.cs.meta Massive Item Behavior Refactoring 2020-05-12 01:42:13 +01:00
Weapon.cs Switch engine asset references from Resources paths to Addressables GUIDs 2026-09-18 05:04:50 +02:00
Weapon.cs.meta Behavior Refactoring 2020-04-09 10:33:16 +01:00
Wear.cs Move the ServerShared data model onto CultLib's CultCache 2026-09-14 19:00:42 +02:00
Wear.cs.meta Heat Performance Curves + Wear & Tear 2021-03-04 03:58:46 +00:00