Exemplo n.º 1
0
        public void MimicMove(Move mimicItself, BattlePokemon opponent)
        {
            Move moveToCopy = opponent.LastMoveUsed;

            if (moveToCopy == null) //failsafe for using mimic on first turn before a last move used is even initialized
            {
                moveToCopy = opponent.Move1;
            }

            OnMimic(moveToCopy, opponent);
            Move mimicedMove = MoveFactory.Create(moveToCopy.Index);

            int moveIndex = 0;

            if (Move1 == mimicItself)
            {
                moveIndex = 1;
            }
            else if (Move2 == mimicItself)
            {
                moveIndex = 2;
            }
            else if (Move3 == mimicItself)
            {
                moveIndex = 3;
            }
            else if (Move4 == mimicItself)
            {
                moveIndex = 4;
            }

            mimic.Activate(mimicedMove, moveIndex);
        }
        public sealed override void ExecuteAndUpdate(BattlePokemon user, BattlePokemon defender)
        {
            OnUsed();

            if (defender.MirrorMove != null &&
                defender.MirrorMove.Index != 119)
            {
                Move copy = MoveFactory.Create(defender.MirrorMove.Index);
                copy.ExecuteAndUpdate(user, defender);
            }
            else
            {
                OnFailed();
            }
            //MirrorMove does NOT set the last move and update mirror move,
            // it delegates those responsibilities to the move that it executes
            SubtractPP(1);
        }
Exemplo n.º 3
0
        public void Activate(BattlePokemon pokemonToTransformInto)
        {
            Active = true;

            Type1 = pokemonToTransformInto.Type1;
            Type2 = pokemonToTransformInto.Type2;

            Stats = new Stats(
                0f,
                pokemonToTransformInto.PokemonsAttackStat,
                pokemonToTransformInto.PokemonsDefenseStat,
                pokemonToTransformInto.PokemonsSpecialStat,
                pokemonToTransformInto.PokemonsSpeedStat);

            Move1 = MoveFactory.Create(pokemonToTransformInto.Move1.Index);
            Move2 = MoveFactory.Create(pokemonToTransformInto.Move2.Index);
            Move3 = MoveFactory.Create(pokemonToTransformInto.Move3.Index);
            Move4 = MoveFactory.Create(pokemonToTransformInto.Move4.Index);

            while (Move1.CurrentPP > 5)
            {
                Move1.SubtractPP(1);
            }
            while (Move2.CurrentPP > 5)
            {
                Move2.SubtractPP(1);
            }
            while (Move3.CurrentPP > 5)
            {
                Move3.SubtractPP(1);
            }
            while (Move4.CurrentPP > 5)
            {
                Move4.SubtractPP(1);
            }
        }
Exemplo n.º 4
0
 public ICommand Create(FileType fileType, string path)
 {
     return(_moveFactory.Create(fileType, path));
 }