예제 #1
0
        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;
            }
        }
예제 #2
0
        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;
            }
        }
예제 #3
0
 public StatChangeBuffData(EnemyInstance target, float amount, BaseIncreaseType amountType, float duration) : base(target, duration)
 {
     Amount     = amount;
     AmountType = amountType;
     Power      = 1f / AmountType.Increase(StatToChange, Amount);
 }
예제 #4
0
 public float Apply(float from) => Type.Increase(@from, Amount);
예제 #5
0
 public int Apply(int from) => Type.Increase(from, Amount);