public override void Upgrade(SpecialComponent component) { var reduceArmor = component as ReduceArmorComponent; if (reduceArmor == null) { Debug.LogWarning("Invalid Component"); return; } reduceArmor.Amount.Value = PowerIncreaseType.Increase(reduceArmor.Amount.Value, PowerByAmount); float newChance = ChanceIncreaseType.Increase(reduceArmor.Chance, ChanceByAmount); if (reduceArmor.ChanceHasUpperLimit) { reduceArmor.Chance = Math.Min( newChance, reduceArmor.ChanceUpperLimit ); } else { reduceArmor.Chance = newChance; } }
public override void Upgrade(SpecialComponent component) { var splashComponent = component as SplashDamageComponent; if (splashComponent == null) { Debug.LogWarning("Invalid component"); return; } float newRadius = RadiusIncrease.Increase(splashComponent.SplashRadius, ValueToUse); if (splashComponent.HasUpperLimit) { splashComponent.SplashRadius = Math.Min( newRadius, splashComponent.UpperLimit); } else { splashComponent.SplashRadius = newRadius; } }
public StatChangeBuffData(EnemyInstance target, float amount, BaseIncreaseType amountType, float duration) : base(target, duration) { Amount = amount; AmountType = amountType; Power = 1f / AmountType.Increase(StatToChange, Amount); }
public float Apply(float from) => Type.Increase(@from, Amount);
public int Apply(int from) => Type.Increase(from, Amount);