Example #1
0
        public virtual void SetEnemy(EnemyInstance enemy, ModifierController modifierController, System.Random random)
        {
            // import modifiers

            enemy.InitialHitpoints.Value = Utils.Utils.GetDeviatedValue(InitialHitpoints, HitpointsDeviation, random);
            enemy.InitialArmor.Value     = Utils.Utils.GetDeviatedValue(InitialArmor, ArmorDeviation, random);
            enemy.InitialSpeed.Value     = Utils.Utils.GetDeviatedValue(InitialSpeed, SpeedDeviation, random);

            enemy.IntLoot        = new List <ModifiedCurrency>();
            enemy.IntPunishments = new List <ModifiedCurrency>();

            foreach (var intLoot in IntLoots)
            {
                var modLoot = new ModifiedCurrency();
                modLoot.Currency = intLoot;
                // import modifiers
                modLoot.Amount.Value = intLoot.Amount;
                enemy.IntLoot.Add(modLoot);
            }

            foreach (var intPunishment in IntPunishments)
            {
                var modPunishment = new ModifiedCurrency();
                modPunishment.Currency = intPunishment;
                // import modifiers
                modPunishment.Amount.Value = intPunishment.Amount;
                enemy.IntPunishments.Add(modPunishment);
            }

            modifierController.ImportModifiers(enemy);
        }
Example #2
0
        private void Start()
        {
            ButtonImage.sprite = Spell.PreviewSprite;

            _spellRange = new FloatModifiableStat {
                Value = Spell.Range
            };
            _spellInitialCharge = new FloatModifiableStat {
                Value = Spell.InitialCharge
            };
            _spellChargeTime = new FloatModifiableStat {
                Value = Spell.ChargeTime
            };
            _spellCharges = new FloatModifiableStat {
                Value = Spell.Charges
            };

            ModifierController.ImportModifiers(this);

            _spellData = new CurrentSpellData(ProgressDisplay, AmountDisplay)
            {
                CurrentCharge        = _spellInitialCharge.Value,
                CurrentUsableCharges = Mathf.FloorToInt(_spellInitialCharge.Value),
                ActualChargeTime     = _spellChargeTime.Value,
                ActualMaxCharges     = _spellCharges.Value
            };
        }
Example #3
0
 private void Start()
 {
     SetUpModifiedPrice();
     ModifierController.ImportModifiers(this);
     MinDamage.Value       = BaseTowerData.MinDamage;
     MaxDamage.Value       = BaseTowerData.MaxDamage;
     FiringSpeed.Value     = BaseTowerData.FiringSpeed;
     Range.Value           = BaseTowerData.Range;
     NumberOfTargets.Value = BaseTowerData.NumberOfTargets;
 }