Exemplo n.º 1
0
        internal SimOnboardPokemon(SimPokemon pokemon, PokemonOutward outward)
        {
            _pokemon = pokemon;
            Outward  = outward;
            X        = outward.Position.X;
            Moves    = new SimMove[4];
            for (int i = 0; i < pokemon.Moves.Length; ++i)
            {
                Moves[i] = new SimMove(pokemon.Moves[i]);
            }
            ZMoves = new SimMove[4];
            for (int i = 0; i < pokemon.Moves.Length; ++i)
            {
                var x = GameHelper.Zmove(pokemon.Moves[i], pokemon.Item, pokemon.Form.Species.Number, pokemon.Form.Index);
                if (x != null)
                {
                    ZMoves[i] = new SimMove(x);
                }
            }

            DetailOfMove  = new string[4];
            ZDetailOfMove = new string[4];
            for (int i = 0; i < pokemon.Moves.Length; ++i)
            {
                DetailOfMove[i] = detail(Moves[i], pokemon);
                if (ZMoves[i] != null)
                {
                    ZDetailOfMove[i] = detail(ZMoves[i], pokemon);
                }
            }
        }
Exemplo n.º 2
0
 public void Target()
 {
     if (move != null)
     {
         input.UseMove(CurrentI, move, mega);
         move = null;
         mega = false;
         NextPm();
     }
 }
Exemplo n.º 3
0
 public void Target(int team, int x)
 {
     if (move != null)
     {
         input.UseMove(CurrentI, move, mega, team, x);
         move = null;
         mega = false;
         NextPm();
     }
 }
Exemplo n.º 4
0
 public void ChangeMove(int from, int to)
 {
     for (int i = 0; i < 4; ++i)
     {
         if (Moves[i] != null && Moves[i].Type.Id == from)
         {
             Moves[i] = new SimMove(RomData.GetMove(to));
             break;
         }
     }
 }
 internal SimOnboardPokemon(SimPokemon pokemon, PokemonOutward outward)
 {
     _pokemon = pokemon;
     Outward  = outward;
     X        = outward.Position.X;
     Moves    = new SimMove[4];
     for (int i = 0; i < pokemon.Moves.Length; ++i)
     {
         Moves[i] = new SimMove(pokemon.Moves[i]);
     }
 }
Exemplo n.º 6
0
        internal void ChangeMoves(int[] moves)
        {
            int i = -1;

            while (++i < moves.Length)
            {
                Moves[i] = new SimMove(RomData.GetMove(moves[i]));
            }
            while (i < 4)
            {
                Moves[i++] = null;
            }
        }
Exemplo n.º 7
0
 public bool Move(SimMove move, bool mega)
 {
     if (Pms[CurrentI].Move(move))
     {
         if (NeedTarget)
         {
             MoveRange = move.Type.Id == Ms.CURSE && Pms[CurrentI].Curse ? MoveRange.SelectedTarget : move.Type.Range;
             this.move = move;
             this.mega = mega;
         }
         else
         {
             input.UseMove(CurrentI, move, mega);
             NextPm();
         }
         return(true);
     }
     error = Pms[CurrentI].GetErrorMessage();
     return(false);
 }
Exemplo n.º 8
0
        private string detail(SimMove move, SimPokemon pokemon)
        {
            int p = move.Type.Power;
            int a = move.Type.Accuracy;

            string power = p.ToString();
            string acc   = a.ToString();

            if (p == 0)
            {
                power = "--";
            }
            if (p == 1)
            {
                power = "不定";
            }
            if (a == 0)
            {
                acc = "--";
            }

            if (move.Type.Id == Ms.NATURAL_GIFT)
            {
                power = GameHelper.NaturalGiftPower(pokemon.Item).ToString();
            }
            if (move.Type.Id == Ms.FLING)
            {
                power = GameHelper.FlingPower(pokemon.Item).ToString();
            }
            if (move.Type.Id == Ms.RETURN)
            {
                power = (pokemon.Happiness * 4 / 10).ToString();
            }
            if (move.Type.Id == Ms.FRUSTRATION)
            {
                power = ((255 - pokemon.Happiness) * 4 / 10).ToString();
            }

            return("威力:" + power + " 命中率:" + acc + '\n' + GameString.Current.MoveD(move.Type.Id));
        }
Exemplo n.º 9
0
 /// <summary>
 /// 不判断PP数及技能是否存在
 /// </summary>
 /// <param name="move"></param>
 /// <returns></returns>
 public bool Move(SimMove move)
 {
     if (OnlyMove != 0 && OnlyMove != move.Type.Id)
     {
         SetErrorMessage(Only, GameString.Current.Move(RomData.GetMove(OnlyMove).Id), GameString.Current.Item(Pm.Pokemon.Item));
     }
     else
     if (Block != null)
     {
         for (int i = 0; i < Pm.Moves.Length; ++i)
         {
             if (move == Pm.Moves[i])
             {
                 if (Block[i] != null)
                 {
                     SetErrorMessage(Block[i], GameString.Current.Move(move.Type.Id), null);
                 }
                 break;
             }
         }
     }
     return(error == null);
 }
Exemplo n.º 10
0
 public static IInput UseMove(SimMove move, bool mega, bool zmove)
 {
     return(new IInput(move.Type.Id, mega, zmove, 0, 0, 0));
 }
Exemplo n.º 11
0
 public void UseMove(int i, SimMove move, bool mega, bool zmove)
 {
     Set(i, IInput.UseMove(move, mega, zmove));
 }
Exemplo n.º 12
0
 public void UseMove(int i, SimMove move, bool mega, bool zmove, int targetTeam, int targetX)
 {
     Set(i, IInput.UseMove(move, mega, zmove, targetTeam, targetX));
 }
Exemplo n.º 13
0
 public static IInput UseMove(SimMove move, bool mega, bool zmove, int targetTeam, int targetX)
 {
     return(new IInput(move.Type.Id, mega, zmove, targetTeam + 1, targetX + 1, 0));
 }