Exemplo n.º 1
0
 public static void EffectHurtImplement(this PokemonProxy pm, int hp, string log = Ls.Hurt, int arg1 = 0, int arg2 = 0)
 {
     if (hp == 0)
     {
         hp = 1;
     }
     ShowLogPm(pm, log, arg1, arg2);
     pm.Hp -= hp;
     HpChanged.Execute(pm);
     pm.OnboardPokemon.SetTurnCondition(Cs.Assurance);
 }
Exemplo n.º 2
0
 public static void Attach(PokemonProxy pm)
 {
     if (pm.ItemE(Is.LEPPA_BERRY))
     {
         foreach (var m in pm.Moves)
         {
             if (m.PP == 0)
             {
                 m.PP += 10;
                 pm.ConsumeItem();
                 pm.ShowLogPm("ItemPPRecover", Is.LEPPA_BERRY, m.MoveE.Id);
                 return;
             }
         }
     }
     else
     {
         WhiteHerb(pm);
         HpChanged.Execute(pm);
         StateAdded.Execute(pm);
     }
 }
Exemplo n.º 3
0
        public static void EffectHurtImplement(this PokemonProxy pm, int hp, string log = Ls.Hurt, int arg1 = 0, int arg2 = 0)
        {
            if (hp == 0)
            {
                hp = 1;
            }
            ShowLogPm(pm, log, arg1, arg2);
            pm.Hp -= hp;
            HpChanged.Execute(pm);
            pm.OnboardPokemon.SetTurnCondition(Cs.Assurance);

            if (pm.Hp > 0 && (pm.Ability == As.Emergency_Exit || pm.Ability == As.Wimp_Out) && pm.Hp <= pm.Pokemon.MaxHp / 2 && pm.Hp + hp > pm.Pokemon.MaxHp / 2)
            {
                pm.AtkContext.SetCondition(Cs.EjectButton, pm.Tile);
                if (pm.Ability == As.Emergency_Exit)
                {
                    pm.Controller.Withdraw(pm, "EmergencyExit", 0, true);
                }
                else if (pm.Ability == As.Wimp_Out)
                {
                    pm.Controller.Withdraw(pm, "WimpOut", 0, true);
                }
            }
        }