示例#1
0
 public LearnVM(PokemonEditorVM pm, int move)
 {
     pokemon    = pm;
     Move       = RomData.GetMove(move);
     _isLearned = pokemon.Model.HasMove(move);
     _methods   = new List <LearnMethod>();
 }
示例#2
0
 internal PokemonProxy(Pokemon pokemon)
 {
     Controller         = pokemon.Controller;
     Pokemon            = pokemon;
     NullOnboardPokemon = new OnboardPokemon(pokemon, -1);
     StruggleMove       = new MoveProxy(new Move(RomData.GetMove(Ms.STRUGGLE), 1), this);
     _moves             = new List <MoveProxy>(4);
 }
示例#3
0
 static MoveTypeE()
 {
     using (var sr = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("PokemonBattleOnline.Game.Host.dat.Moves.txt")))
     {
         Moves = new MoveTypeE[RomData.MOVES + 1];
         for (int i = 1; i <= RomData.MOVES; ++i)
         {
             Moves[i] = new MoveTypeE(RomData.GetMove(i), sr.ReadLine());
         }
     }
 }
示例#4
0
        private void QuickText_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                var text = QuickText.Text.Trim();
                int end;
LOOP:
                var r = GameString.Find(text, out end);
                if (end == 0)
                {
                    QuickText.Text = text;
                    return;
                }
                var n = int.Parse(r.Substring(1));
                switch (r[0])
                {
                case 'p':
                    VM.PokemonForm = RomData.GetPokemon(n / 100, n % 100);
                    break;

                case 'm':
                    VM.AddMove(RomData.GetMove(n));
                    break;

                case 'a':
                    VM.Model.Ability = n;
                    break;

                case 'i':
                    VM.HeldItem = n;
                    break;

                case 'n':
                    VM.Model.Nature = (PokemonNature)n;
                    break;
                }
                text = text.Substring(end);
                goto LOOP;
            }
        }
示例#5
0
        void AutoTeam(string text)
        {
            int end;

LOOP:
            var r = GameString.Find(text, out end);

            if (end == 0)
            {
                if (!string.IsNullOrWhiteSpace(text))
                {
                    Console.WriteLine(@"<ERROR> """ + text + @"""");
                }
                return;
            }
            var n = int.Parse(r.Substring(1));

            switch (r[0])
            {
            case 'p':
                Team.Add(new PokemonData(n / 100, n % 100));
                break;

            case 'm':
            {
                var pm = Team.LastOrDefault();
                if (pm == null)
                {
                    pm = new PokemonData(235, 0);
                    Team.Add(pm);
                }
                pm.AddMove(RomData.GetMove(n));
            }
            break;

            case 'a':
            {
                var pm = Team.LastOrDefault();
                if (pm == null || !pm.Form.Data.Abilities.Contains(n))
                {
                    foreach (var p in RomData.Pokemons)
                    {
                        if (p.Forms.First().Data.Abilities.Contains(n))
                        {
                            pm = new PokemonData(p.Number, 0);
                            Team.Add(pm);
                            break;
                        }
                    }
                }
                pm.Ability = n;
            }
            break;

            case 'i':
            {
                var pm = Team.LastOrDefault();
                if (pm == null || pm.Item != 0)
                {
                    pm = new PokemonData(235, 0);
                    Team.Add(pm);
                }
                pm.Item = n;
            }
            break;
            }
            text = text.Substring(end);
            goto LOOP;
        }
示例#6
0
 protected override object Convert(int value)
 {
     return(RomData.GetMove(value));
 }