public override void Drain(float timeScale) { float multiplier = (GameLibOfMethods.isSleeping) ? 0.5f : 1; float drainAmount = data.drainPerHour * timeScale * multiplier; if (PlayerBuff.HasBuff <Suppression>()) { var statModifier = new StatDecreaseArgs(drainAmount); PlayerBuff.GetBuff <Suppression>()?.TakeEffect(statModifier); drainAmount = statModifier.Amount; } Add(drainAmount); }
private static float StatBuffModifier(Status.Type type, float amount) { switch (type) { case Status.Type.Mood when amount > 0 && PlayerBuff.HasBuff <Freedom>(): var statIncModifier = new StatIncreaseArgs(amount); PlayerBuff.GetBuff <Freedom>()?.TakeEffect(statIncModifier); amount = statIncModifier.Amount; break; case Status.Type.Health when PlayerBuff.HasBuff <Suppression>(): { var statDecModifier = new StatDecreaseArgs(amount); PlayerBuff.GetBuff <Suppression>()?.TakeEffect(statDecModifier); amount = statDecModifier.Amount; break; } } return(amount); }
private void UpdateStat(StatDecreaseArgs statsArgs) { statsArgs.DecreaseValue(percentDecrease); }