Exemple #1
0
 /// <summary>
 /// par, slp, psn, frz, brn
 /// </summary>
 /// <param name="pm"></param>
 /// <param name="by"></param>
 /// <param name="ability"></param>
 /// <param name="state"></param>
 /// <param name="showFail"></param>
 /// <returns></returns>
 public static bool CanAddXXX(PokemonProxy pm, PokemonProxy by, bool ability, AttachedState state, bool showFail)
 {
     if (state == AttachedState.SLP && pm.State == PokemonState.SLP)
     {
         if (showFail)
         {
             pm.Controller.ReportBuilder.ShowLog(Ls.Fail0);
         }
         return(false);
     }
     if (Safeguard(pm, by, showFail) ||
         MistyTerrain(pm, showFail) ||
         state == AttachedState.SLP && ETSV(pm, showFail) ||
         ability &&
         (pm.Controller.Weather == Weather.IntenseSunlight && CheckAbility(As.LEAF_GUARD, pm, by, state, showFail) ||
          pm.OnboardPokemon.Form == RomData.GetPokemon(774, 1) && CheckAbility(As.Shields_Down, pm, by, state, showFail) ||
          state == AttachedState.PAR && CheckAbility(As.LIMBER, pm, by, state, showFail) ||
          state == AttachedState.SLP && (CheckAbility(As.INSOMNIA, pm, by, state, showFail) || CheckAbility(As.VITAL_SPIRIT, pm, by, state, showFail)) ||
          state == AttachedState.PSN && CheckAbility(As.IMMUNITY, pm, by, state, showFail) ||
          state == AttachedState.FRZ && CheckAbility(As.MAGMA_ARMOR, pm, by, state, showFail) ||
          state == AttachedState.BRN && CheckAbility(As.Water_Bubble, pm, by, state, showFail) ||
          state == AttachedState.BRN && CheckAbility(As.WATER_VEIL, pm, by, state, showFail)))
     {
         return(false);
     }
     return(true);
 }
Exemple #2
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;
            }
        }