add scale to timer

This commit is contained in:
CaYpeN1
2024-03-24 13:06:51 +05:00
parent 39d749fb05
commit c5ffbf3fcf
2 changed files with 9 additions and 6 deletions

View File

@@ -53,7 +53,7 @@ public sealed class NarcoticEffect : EntitySystem
switch (Enum.GetValues(typeof(NarcoticEffects)).GetValue(index))
{
case NarcoticEffects.TremorAndShake when _statusEffectsSystem.HasStatusEffect(uid, "Drunk", statusEffectsComp):
Timer.SpawnRepeating(timer, () => _stamina.TakeStaminaDamage(uid, 15F), token);
Timer.SpawnRepeating(timer + component.TimerScale, () => _stamina.TakeStaminaDamage(uid, 15F), token);
_statusEffectsSystem.TryAddTime(uid, "Drunk", TimeSpan.FromSeconds(slur), statusEffectsComp);
break;
@@ -62,21 +62,21 @@ public sealed class NarcoticEffect : EntitySystem
break;
case NarcoticEffects.StunAndShake when _statusEffectsSystem.HasStatusEffect(uid, "Drunk", statusEffectsComp):
Timer.SpawnRepeating(timer, () => _standingStateSystem.TryLieDown(uid, standingComp), token);
Timer.SpawnRepeating(timer + component.TimerScale, () => _standingStateSystem.TryLieDown(uid, standingComp), token);
_statusEffectsSystem.TryAddTime(uid, "Drunk", TimeSpan.FromSeconds(slur), statusEffectsComp);
break;
case NarcoticEffects.Stun:
Timer.SpawnRepeating(timer, () => _standingStateSystem.TryLieDown(uid, standingComp), token);
Timer.SpawnRepeating(timer + component.TimerScale, () => _standingStateSystem.TryLieDown(uid, standingComp), token);
break;
case NarcoticEffects.TremorAndShake:
Timer.SpawnRepeating(timer, () => _stamina.TakeStaminaDamage(uid, 15F), token);
Timer.SpawnRepeating(timer + component.TimerScale, () => _stamina.TakeStaminaDamage(uid, 15F), token);
_statusEffectsSystem.TryAddStatusEffect<DrunkComponent>(uid, "Drunk", TimeSpan.FromSeconds(slur), true, statusEffectsComp);
break;
case NarcoticEffects.Tremor:
Timer.SpawnRepeating(timer, () => _stamina.TakeStaminaDamage(uid, 15F), token);
Timer.SpawnRepeating(timer + component.TimerScale, () => _stamina.TakeStaminaDamage(uid, 15F), token);
break;
case NarcoticEffects.Shake:
@@ -84,7 +84,7 @@ public sealed class NarcoticEffect : EntitySystem
break;
case NarcoticEffects.StunAndShake:
Timer.SpawnRepeating(timer, () => _standingStateSystem.TryLieDown(uid, standingComp), token);
Timer.SpawnRepeating(timer + component.TimerScale, () => _standingStateSystem.TryLieDown(uid, standingComp), token);
_statusEffectsSystem.TryAddStatusEffect<DrunkComponent>(uid, "Drunk", TimeSpan.FromSeconds(slur), true, statusEffectsComp);
break;
}

View File

@@ -17,6 +17,9 @@ public sealed partial class NarcoticEffectComponent : Component
[ViewVariables(VVAccess.ReadOnly), DataField]
public List<int> SlurTime = new() { 35, 60, 80, 90, 45 };
[ViewVariables(VVAccess.ReadOnly), DataField]
public int TimerScale = 6000;
}
[Serializable, NetSerializable]