Ejemplo n.º 1
0
 public override void ExecuteMove(BattleManager.BattleManager battleManager, BattleMoveWithTarget move, Team ownTeam, Team enemyTeam, IOutput output)
 {
     if (move.Move is ShadeAbsorbingMove)
     {
         Shade target = move.Target as Shade;
         AbsorbShade(target);
     }
     else if (move.Move.MoveType == BattleMoveType.Special && move.Move.Description == "dark energy gather")
     {
         if (_malevolenceCounter < MaxMalevolenceLevel)
         {
             _malevolenceCounter++;
         }
     }
 }
Ejemplo n.º 2
0
        public override void ExecuteMove(BattleManager.BattleManager battleManager, BattleMoveWithTarget move, Team ownTeam, Team enemyTeam, IOutput output)
        {
            if (move.Move.Description == "cast eggs" && !CanCastEggs())
            {
                var newMove = SelectMove(ownTeam, enemyTeam);
                move = new BattleMoveWithTarget(newMove, move.Target, move.Owner);
            }

            switch (move.Move.Description)
            {
            case "lay 2 eggs":
                LayEgg(ownTeam, output);
                LayEgg(ownTeam, output);
                break;

            case "cast eggs":
                CastEggs(battleManager, ownTeam, enemyTeam, output);
                break;

            default:     //"lay egg" is assumed default move
                LayEgg(ownTeam, output);
                break;
            }
        }
Ejemplo n.º 3
0
        private void CastEggs(BattleManager.BattleManager battleManager, Team ownTeam, Team enemyTeam, IOutput output)
        {
            var types = new Dictionary <MagicType, int> {
                { MagicType.Fire, 0 }, { MagicType.Lightning, 0 }, { MagicType.Ice, 0 }
            };
            string spellName;

            for (var i = 0; i < 3; ++i)
            {
                var egg = _eggs[0];
                types[egg.MagicType] += 1;
                _eggs.Remove(egg);
                ownTeam.Remove(egg);
            }

            //all 3 match
            if (types[MagicType.Fire] == 3)
            {
                spellName = "inferno egg";
            }
            else if (types[MagicType.Fire] == 2)
            {
                spellName = "blaze egg";
            }
            else if (types[MagicType.Lightning] == 3)
            {
                spellName = "tempest egg";
            }
            else if (types[MagicType.Lightning] == 2)
            {
                spellName = "thunder egg";
            }
            else if (types[MagicType.Ice] == 3)
            {
                spellName = "blizzard egg";
            }
            else if (types[MagicType.Ice] == 2)
            {
                spellName = "frost egg";
            }
            else
            {
                spellName = "chaos egg";
            }

            output.WriteLine($"{DisplayName} draws in the power of its magic eggs, sacrificing them and casts {spellName}!");

            var spell = Spells.Single(s => s.Description == spellName);

            if (spellName != "chaos egg")
            {
                var target = _selectTarget(spell, ownTeam, enemyTeam);

                battleManager.ExecuteSpell(new BattleMoveWithTarget(spell, target, this), false);
            }
            else
            {
                foreach (var enemy in enemyTeam.Fighters.Where(f => f.IsAlive()))
                {
                    battleManager.ExecuteSpell(new BattleMoveWithTarget(spell, enemy, this), false);
                }

                battleManager.ExecuteSpell(new BattleMoveWithTarget(spell, this, this), false);
            }
        }
Ejemplo n.º 4
0
 public virtual void ExecuteMove(BattleManager.BattleManager battleManager, BattleMoveWithTarget move, Team ownTeam, Team enemyTeam, IOutput output)
 {
 }