Exemple #1
0
        public static void Execute(PokemonProxy pm)
        {
            switch (pm.Item)
            {
            case Is.MENTAL_HERB:
                MentalHerb(pm);
                break;

            case Is.CHERI_BERRY:
                DeStateBerry(pm, PokemonState.PAR);
                break;

            case Is.CHESTO_BERRY:
                DeStateBerry(pm, PokemonState.SLP);
                break;

            case Is.RAWST_BERRY:
                DeStateBerry(pm, PokemonState.BRN);
                break;

            case Is.ASPEAR_BERRY:
                DeStateBerry(pm, PokemonState.FRZ);
                break;

            case Is.PECHA_BERRY:
                if (pm.State == PokemonState.PSN || pm.State == PokemonState.BadlyPSN)
                {
                    var s = pm.State.ToString();
                    pm.DeAbnormalState("ItemDePSN", Is.PECHA_BERRY);
                    pm.ConsumeItem();
                }
                break;

            case Is.PERSIM_BERRY:
                if (pm.OnboardPokemon.RemoveCondition(Cs.Confuse))
                {
                    pm.ShowLogPm("ItemDeConfuse", Is.PERSIM_BERRY);
                    pm.ConsumeItem();
                }
                break;

            case Is.LUM_BERRY:
                if (pm.State != PokemonState.Normal)
                {
                    pm.DeAbnormalState("ItemDe" + pm.State.ToString(), Is.LUM_BERRY);
                    pm.ConsumeItem();
                }
                break;
            }
        }
Exemple #2
0
 private static void DeStateBerry(PokemonProxy pm, PokemonState state)
 {
     if (pm.State == state)
     {
         pm.DeAbnormalState("ItemDe" + state.ToString(), pm.Pokemon.Item);
         pm.ConsumeItem();
     }
 }
Exemple #3
0
        private static void MentalHerb(PokemonProxy pm)
        {
            var a = pm.OnboardPokemon.RemoveCondition(Cs.Attract);

            if (a)
            {
                pm.ShowLogPm("ItemDeAttract", pm.Pokemon.Item);
            }
            if (a | MentalHerb(pm, Cs.Encore) | MentalHerb(pm, Cs.Taunt) | MentalHerb(pm, Cs.Torment) | MentalHerb(pm, Cs.Disable))
            {
                pm.ConsumeItem();
            }
        }
 public static bool Remaining1HP(PokemonProxy pm, bool ability)
 {
     if (pm.OnboardPokemon.HasCondition(Cs.Endure))
     {
         pm.ShowLogPm("Endure");
         return(true);
     }
     if (ability && pm.Hp == pm.Pokemon.MaxHp && pm.RaiseAbility(As.STURDY))
     {
         pm.ShowLogPm("Endure");
         return(true);
     }
     if (pm.ItemE(Is.FOCUS_BAND) && pm.Controller.OneNth(10) || pm.ItemE(Is.FOCUS_SASH) && pm.Hp == pm.Pokemon.MaxHp)
     {
         pm.ShowLogPm("FocusItem", pm.Pokemon.Item);
         if (pm.Pokemon.Item == Is.FOCUS_SASH)
         {
             pm.ConsumeItem();
         }
         return(true);
     }
     return(false);
 }
Exemple #5
0
        public static void Execute(PokemonProxy pm)
        {
            switch (pm.Item)
            {
            case Is.ORAN_BERRY:     //135
                RecoverBerry(pm, 10);
                break;

            case Is.BERRY_JUICE:     //194
                RecoverBerry(pm, 20);
                break;

            case Is.SITRUS_BERRY:     //138
                if (pm.Hp << 1 < pm.Pokemon.MaxHp)
                {
                    pm.HpRecoverByOneNth(4, false, Ls.ItemHpRecover, Is.SITRUS_BERRY, true);
                }
                break;

            case Is.FIGY_BERRY:     //139
            case Is.WIKI_BERRY:     //140
            case Is.MAGO_BERRY:     //141
            case Is.AGUAV_BERRY:    //142
            case Is.IAPAPA_BERRY:   //143
                TastyBerry(pm);
                break;

            case Is.LIECHI_BERRY:     //181
                Up1Berry(pm, StatType.Atk);
                break;

            case Is.GANLON_BERRY:
                Up1Berry(pm, StatType.Def);
                break;

            case Is.SALAC_BERRY:
                Up1Berry(pm, StatType.Speed);
                break;

            case Is.PETAYA_BERRY:
                Up1Berry(pm, StatType.SpAtk);
                break;

            case Is.APICOT_BERRY:     //185
                Up1Berry(pm, StatType.SpDef);
                break;

            case Is.LANSAT_BERRY:     //186
                if (ATs.Gluttony(pm) && pm.OnboardPokemon.AddCondition(Cs.FocusEnergy))
                {
                    pm.ConsumeItem();
                    pm.ShowLogPm("ItemEnFocusEnergy", Is.LANSAT_BERRY);
                }
                break;

            case Is.STARF_BERRY:     //187
                StarfBerry(pm);
                break;

            case Is.MICLE_BERRY:     //189
                if (ATs.Gluttony(pm) && pm.OnboardPokemon.AddCondition(Cs.MicleBerry))
                {
                    pm.ConsumeItem();
                    pm.ShowLogPm("MicleBerry", Is.MICLE_BERRY);
                }
                break;
            }
        }