예제 #1
0
 private static bool Sleeping(PokemonProxy pm)
 {
     if (pm.State == PokemonState.SLP)
     {
         pm.Pokemon.SLPTurn -= pm.AbilityE(As.EARLY_BIRD) ? 2 : 1;
         if (pm.Pokemon.SLPTurn <= 0 && !pm.AbilityE(As.Comatose))
         {
             pm.DeAbnormalState();
         }
         else
         {
             pm.ShowLogPm("SLP");
             return(pm.SelectedMove.MoveE.AvailableEvenSleeping || pm.AbilityE(As.Comatose));
         }
     }
     return(true);
 }
예제 #2
0
 private static bool Truant(PokemonProxy p)
 {
     if (p.AbilityE(As.TRUANT))
     {
         if (p.OnboardPokemon.GetCondition <int>(Cs.Truant) == p.Controller.TurnNumber)
         {
             p.RaiseAbility();
             p.ShowLogPm("Truant");
             return(false);
         }
         p.OnboardPokemon.SetCondition(Cs.Truant, p.Controller.TurnNumber + 1);
     }
     return(true);
 }
예제 #3
0
 public static bool MagicCoat(AtkContext atk, PokemonProxy der)
 {
     //atk.Move.AdvancedFlags.MagicCoat is already checked
     if (der.OnboardPokemon.HasCondition(Cs.MagicCoat) || atk.DefenderAbilityAvailable() && der.AbilityE(As.MAGIC_BOUNCE))
     {
         var o = atk.GetCondition <List <PokemonProxy> >(Cs.MagicCoat);
         if (o == null)
         {
             o = new List <PokemonProxy>();
             atk.SetCondition(Cs.MagicCoat, o);
         }
         o.Add(der);
         return(true);
     }
     return(false);
 }
예제 #4
0
        public static bool IsGroundAffectable(PokemonProxy pm, bool abilityAvailable, bool raiseAbility)
        {
            var o = pm.OnboardPokemon;

            return
                ((o.HasCondition(Cs.SmackDown) || o.HasCondition(Cs.Ingrain) || pm.Controller.Board.HasCondition(Cs.Gravity)) || pm.ItemE(Is.IRON_BALL) ||
                 !(o.HasType(BattleType.Flying) ||
                   o.HasCondition(Cs.MagnetRise) || o.HasCondition(Cs.Telekinesis) ||
                   pm.ItemE(Is.AIR_BALLOON) ||
                   (abilityAvailable && (raiseAbility ? pm.RaiseAbility(As.LEVITATE) : pm.AbilityE(As.LEVITATE)))));
        }