Пример #1
0
        protected override void ActiveEffect(CharacterStats player, Stats enemy)
        {
            Buff el = new ArmourBuff(buffName, buffArmour);

            el = Buff.AddBuff(el, player) as Buff;
            el.SetStacks();

            Console.WriteLine($"Using {Name} increaeses your Armour by {buffArmour}.\n");
        }
Пример #2
0
        protected override void ActiveEffect(CharacterStats player, Stats enemy)
        {
            Buff tal = new PoisonBuff(buffName, buffDamage, Constants.RuneBuffStacks, buffDuration);

            tal = Buff.AddBuff(tal, enemy);
            tal.SetStacks();

            Menu.Announce($"{Name} poisons {enemy.OwnerUnit.Name} over {buffDuration} turns.");
            tal.WriteEnemyStacks(enemy.OwnerUnit.Name);
        }
Пример #3
0
        protected override void ActiveEffect(CharacterStats player, Stats enemy)
        {
            Buff nef = new HasteBuff(buffName, buffHaste, buffDuration, Constants.RuneBuffStacks);

            nef = Buff.AddBuff(nef, enemy);
            nef.SetStacks();

            Menu.Announce($"Using {Name} reduces {enemy.OwnerUnit.Name}'s Haste by {Math.Abs(buffHaste)}");
            nef.WriteEnemyStacks(enemy.OwnerUnit.Name);
        }
Пример #4
0
        protected override void ActiveEffect(CharacterStats player, Stats enemy)
        {
            Buff eth = new ArmourBuff(buffName, buffArmour, buffDuration, Constants.RuneBuffStacks);

            eth = Buff.AddBuff(eth, enemy) as Buff;
            eth.SetStacks();

            Menu.Announce($"Using {Name} decreases {enemy.OwnerUnit.Name}'s Armour by {Math.Abs(buffArmour)} for {buffDuration} turns.");
            eth.WriteEnemyStacks(enemy.OwnerUnit.Name);
        }
Пример #5
0
        protected override void ActiveEffect(CharacterStats player, Stats enemy)
        {
            Buff ral = new Ral(minBurn, maxBurn);

            ral = Buff.AddBuff(ral, player);
            ral.SetStacks();

            Menu.Announce($"Using {Name} causes your skills to burn your enemy for additional damage");
            ral.WriteStacks();
        }
Пример #6
0
        protected override void ActiveEffect(CharacterStats player, Stats enemy)
        {
            Buff eld = new HasteBuff(buffName, buffHaste, buffDuration, Constants.RuneBuffStacks);

            eld = Buff.AddBuff(eld, player);
            eld.SetStacks();

            Menu.Announce($"Using {Name} increases your Haste by {buffHaste} for {buffDuration} turns.");
            eld.WriteStacks();
        }
Пример #7
0
        protected override void ActiveEffect(CharacterStats player, Stats enemy)
        {
            Buff ith = new AttackBuff(buffName, buffAttack, buffDuration, Constants.RuneBuffStacks);

            ith = Buff.AddBuff(ith, player);
            ith.SetStacks();

            Menu.Announce($"Using {Name} increases your attack by {buffAttack}");
            ith.WriteStacks();
        }
Пример #8
0
        protected override bool SkillHitEffect(CharacterStats player, Stats self, EffectValues skillEffectValues)
        {
            int attack = skillEffectValues.SourceSkill.Cost / 2;

            EnergySurge surge = new EnergySurge(attack);

            Buff.AddBuff(surge, self);
            surge.SetStacks();

            Menu.Announce($"Using your skill gives {Name} {surge.Name} gaining {attack} attack for its next turn");

            return(true);
        }
Пример #9
0
        private void upgrade(CharacterStats player, Stats enemy)
        {
            Stats target;

            if (random.Next(5) == 0)
            {
                target = enemy;
            }
            else
            {
                target = player;
            }

            int  sparePart = random.Next(0, spareParts.Length);
            Buff buff      = Buff.AddBuff(Activator.CreateInstance(spareParts[sparePart]) as Buff, target);

            buff.SetStacks();

            Menu.Announce($"{Name} gives {buff.Name} to {target.OwnerUnit.Name}");
        }
Пример #10
0
 public override void ApplyEntity(Entity iOrigin, Entity iSource, Entity iTarget)
 {
     if (_target == TARGET.RUNNER && iTarget is Runner)
     {
         Impact(iSource);
         if (iOrigin is Unit)
         {
             Unit iOriginUnit = iOrigin as Unit;
             Buff.AddBuff(iTarget, _buffPrototype, iOriginUnit);
         }
         else
         {
             Buff.AddBuff(iTarget, _buffPrototype, iTarget);
         }
     }
     else if (_target == TARGET.TOWER && iTarget is Tower)
     {
         Impact(iSource);
         if (iOrigin is Unit)
         {
             Unit iOriginUnit = iOrigin as Unit;
             Buff.AddBuff(iTarget, _buffPrototype, iOriginUnit);
         }
         else
         {
             Buff.AddBuff(iTarget, _buffPrototype, iTarget);
         }
     }
     else if (_target == TARGET.SELF)
     {
         Impact(iSource);
         Buff.AddBuff(iOrigin, _buffPrototype, iOrigin);
     }
     else
     {
         // Throw Error
     }
 }
Пример #11
0
    // Use this for initialization
    void Start()
    {
        // load the wave file
        zPosition = 0;
        waveList = new List<Wave>();
        JSONNode wavesData = JSON.Parse(waveFile.text);

        // set up global buff
        globalBuff.strengthAddon = wavesData ["options"] ["buff"] ["str"].AsInt;
        globalBuff.dexterityAddon = wavesData ["options"] ["buff"] ["dex"].AsInt;
        globalBuff.intelligenceAddon = wavesData ["options"] ["buff"] ["int"].AsInt;
        globalBuff.baseHealth = wavesData ["options"] ["buff"] ["health"].AsInt;
        globalBuff.baseMana = wavesData ["options"] ["buff"] ["mana"].AsInt;

        JSONArray wavesName = wavesData ["waves"].AsArray;
        for (int i = 0; i < wavesName.Count; i++) {
            JSONNode waveData = wavesData [wavesName [i]];
            int count = waveData ["count"].AsInt;
            JSONArray enemies = waveData ["enemies"].AsArray;

            Wave w = new Wave();
            for (int j = 0; j < enemies.Count; j++) {
                JSONNode enemyData = enemies [j];

                SpawnSet spawnSet = new SpawnSet (
                                        Resources.Load<GameObject> (enemyData ["enemy"]),
                                        enemyData ["count"].AsInt,
                                        enemyData ["mustBeKilled"].AsBool,
                                        enemyData ["interval"].AsFloat);

                // look for buff
                if (enemyData ["buff"].Count > 0) {
                    JSONClass buffJson = enemyData ["buff"].AsObject;
                    Buff buff = new Buff ();
                    buff.strengthAddon = buffJson ["str"].AsInt;
                    buff.dexterityAddon = buffJson ["dex"].AsInt;
                    buff.intelligenceAddon = buffJson ["int"].AsInt;
                    buff.baseHealth = buffJson ["health"].AsInt;
                    buff.baseMana = buffJson ["mana"].AsInt;
                    buff.level = j + 1;
                    buff.AddBuff (globalBuff);
                    spawnSet.SetBuff (buff);
                }

                w.AddEnemy (spawnSet);
            }
            waveList.Add (w);
        }
        Debug.Log (waveList.Count.ToString () + " waves loaded");
    }