Persist weapon runtime state in checkpoints
This commit is contained in:
parent
3c4fe6fd10
commit
f98f650ab5
10 changed files with 287 additions and 8 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue