Exemplo n.º 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;
            }
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 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);
 }
Exemplo n.º 4
0
 public float Apply(float from) => Type.Increase(@from, Amount);
Exemplo n.º 5
0
 public int Apply(int from) => Type.Increase(from, Amount);