Persist weapon runtime state in checkpoints

This commit is contained in:
Meta Vens 2026-06-14 14:19:21 +01:00
commit f98f650ab5
10 changed files with 287 additions and 8 deletions

View file

@ -95,6 +95,8 @@ public class ChargedWeapon : InstantWeapon
{
get => _charge;
}
public bool Charging => _charging;
public bool Charged => _charged;
public ChargedWeapon(ChargedWeaponData data, EquippedItem item) : base(data, item)
{

View file

@ -35,6 +35,9 @@ public class ConstantWeapon : Weapon, IProgressBehavior, IEventBehavior
{
get => _ammo;
}
public float AmmoIntervalProgress => _ammoInterval;
public float ReloadProgress => _reload;
public bool Reloading => _reloading;
public float Progress
{
@ -147,4 +150,4 @@ public class ConstantWeapon : Weapon, IProgressBehavior, IEventBehavior
OnStopFiring?.Invoke();
}
}
}
}

View file

@ -59,6 +59,11 @@ public class InstantWeapon : Weapon, IProgressBehavior, IEventBehavior
{
get => _ammo;
}
public int BurstRemaining => _burstRemaining;
public float BurstTimer => _burstTimer;
public float BurstInterval => _burstInterval;
public float CooldownProgress => _cooldown;
public bool CoolingDown => _coolingDown;
public virtual float Progress => saturate(_cooldown);
public event Action OnReloadBegin;
@ -197,4 +202,4 @@ public class InstantWeapon : Weapon, IProgressBehavior, IEventBehavior
Trigger();
base.Activate();
}
}
}