Restore constant weapon lifecycle
This commit is contained in:
parent
03a9f949b2
commit
3de83497bd
4 changed files with 342 additions and 2 deletions
|
|
@ -12,6 +12,7 @@ internal sealed class AetheriaDaemonYmirSmokeChecks
|
|||
{
|
||||
YmirMovesProjectileAndReportsStableContact();
|
||||
YmirBeamTraceReturnsFirstSpatialContact();
|
||||
ConstantWeaponRunsOnDaemonThroughYmirBeamContact();
|
||||
DaemonSimulationAppliesYmirHit();
|
||||
ProjectileDeathEmitsOnce();
|
||||
MissingPhysicsOwnerCannotAdvanceProjectiles();
|
||||
|
|
@ -64,6 +65,94 @@ internal sealed class AetheriaDaemonYmirSmokeChecks
|
|||
"beam trace must publish the physical impact distance");
|
||||
}
|
||||
|
||||
private static void ConstantWeaponRunsOnDaemonThroughYmirBeamContact()
|
||||
{
|
||||
var source = Entity(0, 0, "player");
|
||||
source.DirectionX = 1;
|
||||
source.DirectionY = 0;
|
||||
source.TargetEntityIndex = 2;
|
||||
source.WeaponGroups = [new[] { 0 }];
|
||||
source.Equipment = [new AetheriaRuntimeLoadoutItemSlotCommit
|
||||
{
|
||||
Item = new AetheriaRuntimeLoadoutItemCommit
|
||||
{ ItemKey = "test-beam", Quality = 1, Durability = 1, Enabled = true }
|
||||
}];
|
||||
source.BehaviorStates = [new AetheriaRuntimeBehaviorStateCommit
|
||||
{
|
||||
OwnerKind = "fixture", OwnerIndex = 0, BehaviorIndex = 0,
|
||||
BehaviorKind = "Capacitor", CapacitorCharge = 10, CapacitorCapacity = 10, CapacitorEfficiency = 1
|
||||
}];
|
||||
source.CargoContents = [Cargo(("beam-ammo", 1, 0, 0))];
|
||||
var blocker = Entity(1, 40, "neutral");
|
||||
var selectedTarget = Entity(2, 100, "raider");
|
||||
var zone = new AetheriaRuntimeZoneSnapshotCommit { ZoneIndex = 0, Entities = [source, blocker, selectedTarget] };
|
||||
var run = new AetheriaRuntimeRunCheckpointCommit
|
||||
{
|
||||
RunId = "constant-weapon-smoke", CurrentZoneIndex = 0,
|
||||
CurrentEntityKey = "zone.0.entity.0", Zones = [zone]
|
||||
};
|
||||
var payload = new AetheriaRuntimeBehaviorPayload(0, AetheriaRuntimeBehaviorKinds.ConstantWeapon, 0,
|
||||
[
|
||||
new AetheriaRuntimeBehaviorField(2, PerformanceStat(10)),
|
||||
new AetheriaRuntimeBehaviorField(6, PerformanceStat(150)),
|
||||
new AetheriaRuntimeBehaviorField(9, PerformanceStat(2)),
|
||||
new AetheriaRuntimeBehaviorField(10, PerformanceStat(3)),
|
||||
new AetheriaRuntimeBehaviorField(12, new AetheriaRuntimeBehaviorValue(
|
||||
"item-key", "", 0, false, "", "beam-ammo", [], [])),
|
||||
new AetheriaRuntimeBehaviorField(13, Number(3)),
|
||||
new AetheriaRuntimeBehaviorField(14, Number(0.3)),
|
||||
new AetheriaRuntimeBehaviorField(17, Number(0.15))
|
||||
]);
|
||||
var catalog = new AetheriaRuntimeCatalogSnapshot([CatalogItem("test-beam", payload)], [], []);
|
||||
var intents = new AetheriaRuntimeDaemonIntentState();
|
||||
intents.WeaponGroups.Add(new AetheriaRuntimeDaemonWeaponGroupIntent
|
||||
{
|
||||
ActorEntityKey = "zone.0.entity.0", WeaponGroup = 0, Fire = true, Active = true
|
||||
});
|
||||
for (var frame = 0; frame < 7; frame++)
|
||||
AetheriaRuntimeDaemonSimulation.Step(run, intents, 0.1,
|
||||
new AetheriaRuntimeDaemonSimulationSettings(), new AetheriaYmirProjectilePhysics(),
|
||||
new AetheriaYmirWorldPhysics(), catalog, frame, frame * 0.1);
|
||||
|
||||
var state = source.WeaponStates.Single(value => value.BehaviorKind == AetheriaRuntimeBehaviorKinds.ConstantWeapon);
|
||||
Require(run.GameEvents.Count(value => value.Kind == "weapon.firing.started") == 1,
|
||||
"held constant fire must publish one start transition");
|
||||
Require(run.GameEvents.Count(value => value.Kind == "weapon.reload.started") == 1 &&
|
||||
run.GameEvents.Count(value => value.Kind == "weapon.firing.stopped") == 1,
|
||||
"empty constant weapon magazine must start reload and stop the held effect once");
|
||||
Require(state.Reloading && !state.Firing,
|
||||
"constant weapon reload must remain authoritative persisted state");
|
||||
Require(Stat(blocker, "hull") < 100 && Math.Abs(Stat(selectedTarget, "hull") - 100) < 0.000001,
|
||||
"Ymir beam contact must damage the intervening body rather than the selected target");
|
||||
Require(run.GameEvents.Any(value => value.Kind == "weapon.beam.damage" &&
|
||||
value.TargetEntityIndex == blocker.EntityIndex && value.ItemKey == "test-beam"),
|
||||
"daemon must publish accepted continuous beam damage with authored weapon identity");
|
||||
Require(CargoQuantity(source, "beam-ammo") == 0,
|
||||
"constant weapon reload must consume its reserve cargo through the shared transaction");
|
||||
Require(source.BehaviorStates.Single(value => value.BehaviorKind == "Capacitor").CapacitorCharge < 10,
|
||||
"constant weapon must pay elapsed-time energy through canonical capacitor state");
|
||||
for (var frame = 7; frame < 11; frame++)
|
||||
AetheriaRuntimeDaemonSimulation.Step(run, intents, 0.1,
|
||||
new AetheriaRuntimeDaemonSimulationSettings(), new AetheriaYmirProjectilePhysics(),
|
||||
new AetheriaYmirWorldPhysics(), catalog, frame, frame * 0.1);
|
||||
AetheriaRuntimeDaemonSimulation.Step(run, new AetheriaRuntimeDaemonIntentState(), 0.1,
|
||||
new AetheriaRuntimeDaemonSimulationSettings(), new AetheriaYmirProjectilePhysics(),
|
||||
new AetheriaYmirWorldPhysics(), catalog, 11, 1.1);
|
||||
Require(!state.Firing && run.GameEvents.Count(value => value.Kind == "weapon.firing.stopped") == 2,
|
||||
"releasing held fire must stop the persisted constant weapon and publish its transition");
|
||||
var surface = AetheriaRuntimeDaemonGameSurfaceBuilder.Build(
|
||||
new AetheriaRuntimeDaemonFrameDocument { FrameId = 11, Run = run },
|
||||
new AetheriaRuntimeDaemonHealthDocument(),
|
||||
AetheriaRuntimeDaemonCommandBoundaryDocument.Create("daemon"));
|
||||
Require(Flatten(surface.Surface.Root).Any(node => node.Kind == "weapon.state" &&
|
||||
node.Props["behaviorKind"] == AetheriaRuntimeBehaviorKinds.ConstantWeapon &&
|
||||
node.Props["itemKey"] == "test-beam" && node.Props["firing"] == "false"),
|
||||
"Eve world entity must project recoverable generic ConstantWeapon state");
|
||||
Require(Flatten(surface.Surface.Root).Any(node => node.Kind == "feedback.event" &&
|
||||
node.Props["eventKind"] == "weapon.firing.started" && node.Props["itemKey"] == "test-beam"),
|
||||
"Eve feedback stream must project continuous weapon transition chronology");
|
||||
}
|
||||
|
||||
private static void AgentTowsStationIntoPersistentOrbit()
|
||||
{
|
||||
var tug = Entity(0, 0, "workers");
|
||||
|
|
|
|||
|
|
@ -650,7 +650,53 @@ namespace GameCult.Aetheria.State.Verse
|
|||
$"aetheria.daemon.game.world.entity.{entity.EntityIndex}",
|
||||
"world.entity3d",
|
||||
props,
|
||||
LoadoutGenerationItems(entity));
|
||||
LoadoutGenerationItems(entity).Concat(WeaponStateItems(entity, run, zone)).ToArray());
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeSurfaceComponent[] WeaponStateItems(
|
||||
AetheriaRuntimeEntitySnapshotCommit entity,
|
||||
AetheriaRuntimeRunCheckpointCommit run,
|
||||
AetheriaRuntimeZoneSnapshotCommit zone)
|
||||
{
|
||||
return (entity.WeaponStates ?? Array.Empty<AetheriaRuntimeWeaponStateCommit>())
|
||||
.Where(value => value != null)
|
||||
.Select(value =>
|
||||
{
|
||||
var itemKey = value.OwnerKind == AetheriaRuntimeBehaviorStateProjector.EquipmentOwnerKind &&
|
||||
value.OwnerIndex >= 0 && value.OwnerIndex < (entity.Equipment?.Count ?? 0)
|
||||
? entity.Equipment[value.OwnerIndex]?.Item?.ItemKey ?? ""
|
||||
: "";
|
||||
var targetEntityId = value.LockTargetEntityIndex < 0
|
||||
? ""
|
||||
: run.EntityRecordKey(zone.ZoneIndex, value.LockTargetEntityIndex);
|
||||
return Node(
|
||||
$"aetheria.daemon.game.world.entity.{entity.EntityIndex}.weapon.{SurfaceToken(value.OwnerKind)}.{value.OwnerIndex}.{value.BehaviorIndex}",
|
||||
"weapon.state",
|
||||
new[]
|
||||
{
|
||||
("ownerKind", value.OwnerKind),
|
||||
("ownerIndex", value.OwnerIndex.ToString(CultureInfo.InvariantCulture)),
|
||||
("behaviorIndex", value.BehaviorIndex.ToString(CultureInfo.InvariantCulture)),
|
||||
("behaviorKind", value.BehaviorKind),
|
||||
("itemKey", itemKey),
|
||||
("firing", value.Firing ? "true" : "false"),
|
||||
("ammo", value.Ammo.ToString(CultureInfo.InvariantCulture)),
|
||||
("ammoIntervalProgress", FormatNumber(value.AmmoIntervalProgress)),
|
||||
("burstRemaining", value.BurstRemaining.ToString(CultureInfo.InvariantCulture)),
|
||||
("burstProgress", FormatNumber(value.BurstTimer)),
|
||||
("cooldownProgress", FormatNumber(value.CooldownProgress)),
|
||||
("coolingDown", value.CoolingDown ? "true" : "false"),
|
||||
("charging", value.Charging ? "true" : "false"),
|
||||
("charged", value.Charged ? "true" : "false"),
|
||||
("charge", FormatNumber(value.Charge)),
|
||||
("reloading", value.Reloading ? "true" : "false"),
|
||||
("reloadProgress", FormatNumber(value.ReloadProgress)),
|
||||
("lockProgress", FormatNumber(value.LockProgress)),
|
||||
("targetEntityId", targetEntityId),
|
||||
("lastRefusalReason", value.LastRefusalReason)
|
||||
});
|
||||
})
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeSurfaceComponent[] LoadoutGenerationItems(
|
||||
|
|
|
|||
|
|
@ -240,6 +240,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
foreach (var attacker in entities)
|
||||
{
|
||||
var weaponGroup = ResolveFireGroup(run, zone, attacker, intents);
|
||||
StepConstantWeapons(run, zone, entities, byIndex, attacker, weaponGroup, deltaSeconds,
|
||||
settings, projectilePhysics, catalog, frameId);
|
||||
var weapons = ResolveWeapons(attacker, weaponGroup, catalog, settings);
|
||||
foreach (var weapon in weapons)
|
||||
{
|
||||
|
|
@ -360,6 +362,154 @@ namespace GameCult.Aetheria.State.Verse
|
|||
}
|
||||
}
|
||||
|
||||
private static void StepConstantWeapons(
|
||||
AetheriaRuntimeRunCheckpointCommit run,
|
||||
AetheriaRuntimeZoneSnapshotCommit zone,
|
||||
IReadOnlyList<AetheriaRuntimeEntitySnapshotCommit> entities,
|
||||
IReadOnlyDictionary<int, AetheriaRuntimeEntitySnapshotCommit> byIndex,
|
||||
AetheriaRuntimeEntitySnapshotCommit attacker,
|
||||
int weaponGroup,
|
||||
double deltaSeconds,
|
||||
AetheriaRuntimeDaemonSimulationSettings settings,
|
||||
IAetheriaRuntimeProjectilePhysics physics,
|
||||
AetheriaRuntimeCatalogSnapshot? catalog,
|
||||
long frameId)
|
||||
{
|
||||
foreach (var weapon in ResolveConstantWeapons(attacker, weaponGroup, catalog, settings))
|
||||
{
|
||||
if (weapon.State.Reloading)
|
||||
{
|
||||
weapon.State.ReloadProgress = Math.Max(0, weapon.State.ReloadProgress - deltaSeconds);
|
||||
if (weapon.State.ReloadProgress <= 0)
|
||||
{
|
||||
weapon.State.Reloading = false;
|
||||
weapon.State.Ammo = weapon.MagazineSize;
|
||||
AppendConstantWeaponEvent(run, zone, attacker, weapon, frameId, "weapon.reload.completed", "");
|
||||
}
|
||||
}
|
||||
|
||||
var validTarget = IsAlive(attacker) && weaponGroup >= 0 &&
|
||||
attacker.TargetEntityIndex >= 0 &&
|
||||
byIndex.TryGetValue(attacker.TargetEntityIndex, out var selectedTarget) &&
|
||||
IsAlive(selectedTarget) && Hostile(attacker, selectedTarget) &&
|
||||
DistanceSq(attacker, selectedTarget) <= weapon.Range * weapon.Range;
|
||||
var shouldFire = weapon.Selected && validTarget && !weapon.State.Reloading;
|
||||
if (!shouldFire)
|
||||
{
|
||||
StopConstantWeapon(run, zone, attacker, weapon, frameId,
|
||||
weapon.State.Reloading ? "reload" : "inactive");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!weapon.State.Firing)
|
||||
{
|
||||
weapon.State.Firing = true;
|
||||
weapon.State.LastRefusalReason = "";
|
||||
AppendConstantWeaponEvent(run, zone, attacker, weapon, frameId, "weapon.firing.started", "");
|
||||
}
|
||||
|
||||
var energy = weapon.Energy * deltaSeconds;
|
||||
if (!CanSupplyEnergy(attacker, energy))
|
||||
{
|
||||
PublishConstantWeaponRefusal(run, zone, attacker, weapon, frameId, "insufficient-energy");
|
||||
StopConstantWeapon(run, zone, attacker, weapon, frameId, "insufficient-energy");
|
||||
continue;
|
||||
}
|
||||
CommitEnergy(attacker, energy);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(weapon.AmmoItemKey))
|
||||
{
|
||||
weapon.State.AmmoIntervalProgress -= deltaSeconds / weapon.AmmoIntervalDuration;
|
||||
if (weapon.State.AmmoIntervalProgress < 0)
|
||||
{
|
||||
weapon.State.AmmoIntervalProgress = 1;
|
||||
if (weapon.MagazineSize > 1 && weapon.State.Ammo > 0)
|
||||
{
|
||||
weapon.State.Ammo--;
|
||||
}
|
||||
else if (!AetheriaRuntimeCargoTransactions.TryFind(attacker, weapon.AmmoItemKey,
|
||||
out var cargoIndex, out var x, out var y) ||
|
||||
!AetheriaRuntimeCargoTransactions.TryRemoveQuantity(
|
||||
attacker, cargoIndex, weapon.AmmoItemKey, x, y, 1, out _))
|
||||
{
|
||||
PublishConstantWeaponRefusal(run, zone, attacker, weapon, frameId, "no-ammunition");
|
||||
continue;
|
||||
}
|
||||
else if (weapon.MagazineSize > 1)
|
||||
{
|
||||
weapon.State.Reloading = true;
|
||||
weapon.State.ReloadProgress = weapon.ReloadTime;
|
||||
AppendConstantWeaponEvent(run, zone, attacker, weapon, frameId, "weapon.reload.started", "");
|
||||
StopConstantWeapon(run, zone, attacker, weapon, frameId, "reload");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
weapon.State.LastRefusalReason = "";
|
||||
AetheriaRuntimeThermalSimulation.AddHeat(attacker, weapon.Heat * deltaSeconds);
|
||||
var direction = Normalize(attacker.DirectionX, attacker.DirectionY);
|
||||
var hit = physics.TraceBeam(zone, entities, attacker.EntityIndex,
|
||||
attacker.PositionX, attacker.PositionZ, direction.X, direction.Y, weapon.Range, 0.1);
|
||||
if (hit == null || !byIndex.TryGetValue(hit.TargetEntityIndex, out var hitEntity) || !IsAlive(hitEntity))
|
||||
continue;
|
||||
|
||||
var damage = weapon.Damage * deltaSeconds;
|
||||
var aliveBefore = IsAlive(hitEntity);
|
||||
Damage(hitEntity, damage);
|
||||
AetheriaRuntimeGameEvents.Append(run, new AetheriaRuntimeGameEventCommit
|
||||
{
|
||||
EventId = $"frame:{frameId}:zone:{zone.ZoneIndex}:entity:{attacker.EntityIndex}:weapon:{weapon.State.OwnerIndex}:{weapon.State.BehaviorIndex}:beam:{hit.TargetEntityIndex}",
|
||||
Kind = "weapon.beam.damage", FrameId = frameId, ZoneIndex = zone.ZoneIndex,
|
||||
SourceEntityIndex = attacker.EntityIndex, TargetEntityIndex = hit.TargetEntityIndex,
|
||||
SubjectKey = hit.TargetBodyId, ItemKey = weapon.ItemKey, ScalarValue = damage,
|
||||
PositionX = hit.PointX, PositionZ = hit.PointZ
|
||||
});
|
||||
if (aliveBefore && !IsAlive(hitEntity))
|
||||
AetheriaRuntimeGameEvents.Append(run, new AetheriaRuntimeGameEventCommit
|
||||
{
|
||||
EventId = $"frame:{frameId}:zone:{zone.ZoneIndex}:entity:{attacker.EntityIndex}:weapon:{weapon.State.OwnerIndex}:{weapon.State.BehaviorIndex}:beam-destroyed:{hit.TargetEntityIndex}",
|
||||
Kind = "entity.destroyed", FrameId = frameId, ZoneIndex = zone.ZoneIndex,
|
||||
SourceEntityIndex = attacker.EntityIndex, TargetEntityIndex = hit.TargetEntityIndex,
|
||||
SubjectKey = weapon.ItemKey, PositionX = hit.PointX, PositionZ = hit.PointZ
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private static void StopConstantWeapon(
|
||||
AetheriaRuntimeRunCheckpointCommit run, AetheriaRuntimeZoneSnapshotCommit zone,
|
||||
AetheriaRuntimeEntitySnapshotCommit entity, ResolvedConstantWeapon weapon,
|
||||
long frameId, string reason)
|
||||
{
|
||||
if (!weapon.State.Firing) return;
|
||||
weapon.State.Firing = false;
|
||||
AppendConstantWeaponEvent(run, zone, entity, weapon, frameId, "weapon.firing.stopped", reason);
|
||||
}
|
||||
|
||||
private static void PublishConstantWeaponRefusal(
|
||||
AetheriaRuntimeRunCheckpointCommit run, AetheriaRuntimeZoneSnapshotCommit zone,
|
||||
AetheriaRuntimeEntitySnapshotCommit entity, ResolvedConstantWeapon weapon,
|
||||
long frameId, string reason)
|
||||
{
|
||||
if (string.Equals(weapon.State.LastRefusalReason, reason, StringComparison.Ordinal)) return;
|
||||
weapon.State.LastRefusalReason = reason;
|
||||
AppendConstantWeaponEvent(run, zone, entity, weapon, frameId, "weapon.fire.refused", reason);
|
||||
}
|
||||
|
||||
private static void AppendConstantWeaponEvent(
|
||||
AetheriaRuntimeRunCheckpointCommit run, AetheriaRuntimeZoneSnapshotCommit zone,
|
||||
AetheriaRuntimeEntitySnapshotCommit entity, ResolvedConstantWeapon weapon,
|
||||
long frameId, string kind, string subject)
|
||||
{
|
||||
AetheriaRuntimeGameEvents.Append(run, new AetheriaRuntimeGameEventCommit
|
||||
{
|
||||
EventId = $"frame:{frameId}:zone:{zone.ZoneIndex}:entity:{entity.EntityIndex}:weapon:{weapon.State.OwnerIndex}:{weapon.State.BehaviorIndex}:{kind}",
|
||||
Kind = kind, FrameId = frameId, ZoneIndex = zone.ZoneIndex,
|
||||
SourceEntityIndex = entity.EntityIndex, TargetEntityIndex = entity.TargetEntityIndex,
|
||||
SubjectKey = subject, ItemKey = weapon.ItemKey, ScalarValue = weapon.State.Ammo
|
||||
});
|
||||
}
|
||||
|
||||
private static void AppendWeaponEvent(
|
||||
AetheriaRuntimeRunCheckpointCommit run,
|
||||
AetheriaRuntimeZoneSnapshotCommit zone,
|
||||
|
|
@ -522,6 +672,36 @@ namespace GameCult.Aetheria.State.Verse
|
|||
AetheriaRuntimeRunCheckpointCommit.TryParseEntityKey(actorEntityKey, out var actorZoneIndex, out var actorEntityIndex) &&
|
||||
actorZoneIndex == zoneIndex && actorEntityIndex == entityIndex;
|
||||
|
||||
private static IReadOnlyList<ResolvedConstantWeapon> ResolveConstantWeapons(
|
||||
AetheriaRuntimeEntitySnapshotCommit entity,
|
||||
int weaponGroup,
|
||||
AetheriaRuntimeCatalogSnapshot? catalog,
|
||||
AetheriaRuntimeDaemonSimulationSettings settings)
|
||||
{
|
||||
var equipmentIndices = weaponGroup >= 0 && weaponGroup < (entity.WeaponGroups ?? Array.Empty<IReadOnlyList<int>>()).Count
|
||||
? entity.WeaponGroups[weaponGroup] ?? Array.Empty<int>()
|
||||
: Array.Empty<int>();
|
||||
return AetheriaRuntimeEquippedBehaviorQueries.Find(entity, catalog, AetheriaRuntimeBehaviorKinds.ConstantWeapon)
|
||||
.Select(behavior =>
|
||||
{
|
||||
var magazineSize = Math.Max(0, (int)Math.Round(ReadNumber(behavior.Payload, 13)));
|
||||
var state = EnsureWeaponState(entity, AetheriaRuntimeBehaviorStateProjector.EquipmentOwnerKind,
|
||||
behavior.EquipmentIndex, behavior.BehaviorIndex, behavior.Payload.Kind,
|
||||
magazineSize > 1 ? magazineSize : 1,
|
||||
settings);
|
||||
return new ResolvedConstantWeapon(
|
||||
state, behavior.Item.ItemKey, equipmentIndices.Contains(behavior.EquipmentIndex),
|
||||
Math.Max(0, behavior.EvaluateStat(2)),
|
||||
PositiveOr(behavior.EvaluateStat(6), 1),
|
||||
Math.Max(0, behavior.EvaluateStat(9)),
|
||||
Math.Max(0, behavior.EvaluateStat(10)),
|
||||
ReadItemKey(behavior.Payload, 12), magazineSize,
|
||||
PositiveOr(ReadNumber(behavior.Payload, 14), 1),
|
||||
PositiveOr(ReadNumber(behavior.Payload, 17), 1));
|
||||
})
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
private static IReadOnlyList<ResolvedWeapon> ResolveWeapons(
|
||||
AetheriaRuntimeEntitySnapshotCommit entity,
|
||||
int weaponGroup,
|
||||
|
|
@ -801,6 +981,31 @@ namespace GameCult.Aetheria.State.Verse
|
|||
public double LockDecayPerSecond { get; }
|
||||
}
|
||||
|
||||
private sealed class ResolvedConstantWeapon
|
||||
{
|
||||
public ResolvedConstantWeapon(AetheriaRuntimeWeaponStateCommit state, string itemKey,
|
||||
bool selected, double damage, double range, double energy, double heat, string ammoItemKey,
|
||||
int magazineSize, double reloadTime, double ammoIntervalDuration)
|
||||
{
|
||||
State = state; ItemKey = itemKey; Selected = selected; Damage = damage; Range = range;
|
||||
Energy = energy; Heat = heat; AmmoItemKey = ammoItemKey;
|
||||
MagazineSize = magazineSize; ReloadTime = reloadTime;
|
||||
AmmoIntervalDuration = ammoIntervalDuration;
|
||||
}
|
||||
|
||||
public AetheriaRuntimeWeaponStateCommit State { get; }
|
||||
public string ItemKey { get; }
|
||||
public bool Selected { get; }
|
||||
public double Damage { get; }
|
||||
public double Range { get; }
|
||||
public double Energy { get; }
|
||||
public double Heat { get; }
|
||||
public string AmmoItemKey { get; }
|
||||
public int MagazineSize { get; }
|
||||
public double ReloadTime { get; }
|
||||
public double AmmoIntervalDuration { get; }
|
||||
}
|
||||
|
||||
private static void RefreshContacts(
|
||||
IReadOnlyList<AetheriaRuntimeEntitySnapshotCommit> entities,
|
||||
AetheriaRuntimeDaemonSimulationSettings settings)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ validation proves contract shape, not wiring, exclusivity, lowering, or parity.
|
|||
| Projectile flight | weapon/projectile classes | Ymir | projectile entity/event projection | native projectile visual | Ymir.Core adapter wired for spawn/travel/contact/despawn; native presentation and broader weapon parity incomplete | prove every authored projectile family and runtime visual lifecycle |
|
||||
| Shield/hull damage | energy-funded shield, armor cells, equipment and hull | daemon | entity status + damage events | meters, impacts, damage VFX | synthetic scalar owner wired; not parity | typed absorption, penetration, item damage and death causes |
|
||||
| Thermal/energy | cell conduction and capacitor/reactor/radiator network | daemon | ship/equipment status and warnings | schematic/post effects | cell conduction/radiation wired; energy network and medical thresholds remain reference | capacitor/reactor/radiator ordering, shared energy and medical timelines |
|
||||
| Weapons | ServerShared behaviors + Unity effects | daemon + Ymir where spatial | action capability, weapon state, attack events | effects/audio/HUD | selected weapon groups resolve equipped typed-catalog instant weapons for damage, range, cooldown, projectile velocity, heat, lock, energy, magazine, reload, burst count/time and single-ammo-burst parameters; persistent burst timer/remaining state emits every due round while cooldown overlaps from trigger time; damage/heat/energy divide across rounds and resource payment occurs once per burst or once per round as authored; each committed transaction drains canonical capacitor/reactor state and magazine before Ymir launch; empty magazines consume reserve cargo through the shared cargo transaction and enter reload without firing; the physics port now exposes Ymir's ordered circle cast as an authoritative beam trace, proving first-contact occlusion and source exclusion for continuous weapons; ConstantWeapon field 17 is typed as `AmmoIntervalDuration` rather than an instant burst count | implement the distinct ConstantWeapon lifecycle over the beam trace, then charged/guided families, visibility/wear, penetration and damage curves |
|
||||
| Weapons | ServerShared behaviors + Unity effects | daemon + Ymir where spatial | action capability, weapon state, attack events | effects/audio/HUD | selected weapon groups resolve equipped typed-catalog instant weapons for authored burst behavior and ConstantWeapon through a separate continuous lifecycle; constant fire persists across ticks, pays elapsed-time energy and heat, advances the fossil ammunition interval, consumes canonical magazine/cargo state, interrupts for daemon-owned reload, and emits start/stop/refusal/reload edges; Ymir's ordered circle cast owns first-contact beam occlusion and the daemon applies accepted continuous damage to that body rather than the selected target; every `world.entity3d` now contains generic repeated `weapon.state` children with authored item/behavior identity and complete firing, ammunition, reload, cooldown, charge, lock, and refusal state | charged/guided families, visibility/wear, penetration and damage curves, plus Unity continuous-effect reconciliation from generic state |
|
||||
| Destruction/drops | entity death and pickup paths | daemon | death/drop events and world entities | effects and pickups | fragments wired; chronology and original drop transaction absent | exactly-once drops and cleanup |
|
||||
| Tractor/scoop | analog tractor and physical timed pickups | daemon + Ymir | tractor power, pickup body and receipt | beam/interaction feedback | fossil 2/s power ramp and authored forward radius/traction/distance feed pickup bodies into the shared Ymir world; shield contact collects exactly once when capacity permits or applies the fossil 25-unit rejection kick; 30s daemon lifetime; instant cargo teleport deleted | prove generic runtime beam, contact, success and rejection feedback |
|
||||
| Dock/undock | wormhole-first interact; first eligible bay; component prerequisites | daemon + Ymir placement | dock commands/context | camera/UI transition | daemon path wired/projected; Ymir placement and parity unproven | priority, eligibility, placement and reconnect |
|
||||
|
|
|
|||
Loading…
Reference in a new issue