private static void Debut(Condition hazard, PokemonProxy pm) { switch (hazard.Move.Id) { case Ms.SPIKES: if (HasEffect.IsGroundAffectable(pm, true, false)) { pm.EffectHurtByOneNth(hazard.Int, Ls.Spikes); } break; case Ms.TOXIC_SPIKES: if (HasEffect.IsGroundAffectable(pm, true, false)) { if (pm.OnboardPokemon.HasType(BattleType.Poison)) { De(pm.Controller.ReportBuilder, pm.Field, hazard.Move); } else if (pm.CanAddState(pm, AttachedState.PSN, false)) { pm.AddState(pm, AttachedState.PSN, false, hazard.Bool ? 15 : 0); } } break; case Ms.STEALTH_ROCK: int revise = BattleType.Rock.EffectRevise(pm.OnboardPokemon.Types); //羽栖有效无效都无所谓 int hp = (revise > 0 ? pm.Pokemon.MaxHp << revise : pm.Pokemon.MaxHp >> -revise) >> 3; pm.EffectHurt(hp, Ls.StealthRock); break; case Ms.STICKY_WEB: if (HasEffect.IsGroundAffectable(pm, true, false)) { pm.ShowLogPm("StickyWeb"); pm.ChangeLv7D(null, StatType.Speed, -1, false, false); } break; } }
public static Modifier Execute(DefContext def) { var der = def.Defender; var atk = def.AtkContext; var aer = atk.Attacker; var c = def.Defender.Controller; Modifier m = Abilities(def); m *= AttackerItem(atk); m *= Move(def); //If user used Charge the previous turn and move is Electric type. if (atk.Type == BattleType.Electric && atk.Attacker.OnboardPokemon.GetCondition <int>(Cs.Charge) == c.TurnNumber) { m *= 0x2000; } //If user has been the target of Helping Hand this turn. var hh = aer.OnboardPokemon.GetCondition <int>(Cs.HelpingHand); if (hh > 0) { m *= 0x1800; } if (hh > 1) { m *= 0x1800; } //If Water Sport was used by any Pokémon still on the field and move is Fire type. //If Mud Sport was used by any Pokémon still on the field and move is Electric type. if ((atk.Type == BattleType.Fire && c.Board.HasCondition(Cs.WaterSport)) || (atk.Type == BattleType.Electric && c.Board.HasCondition(Cs.MudSport))) { m *= 0x800; } if ((atk.Type == BattleType.Electric && c.Board.HasCondition(Cs.ElectricTerrain) || atk.Type == BattleType.Grass && c.Board.HasCondition(Cs.GrassyTerrain) || atk.Type == BattleType.Psychic && c.Board.HasCondition(Cs.PsychicTerrain)) && HasEffect.IsGroundAffectable(aer, true, false)) { m *= 0x1800; } else if (atk.Type == BattleType.Dragon && c.Board.HasCondition(Cs.MistyTerrain) && HasEffect.IsGroundAffectable(der, true, false)) { m *= 0x800; } return(m); }
//5.0 Fire Pledge + Grass Pledge damage //5.1 Shed Skin, Hydration, Healer //5.2 Leftovers, Black Sludge private static void PropertyChange(Controller c) { if (c.Board.HasCondition(Cs.GrassyTerrain)) //顺序未测 { foreach (var pm in c.OnboardPokemons) { if (HasEffect.IsGroundAffectable(pm, true, false)) { pm.HpRecoverByOneNth(16); } } } bool?hydration = null; foreach (var pm in c.OnboardPokemons.ToArray()) { if (pm.Field.HasCondition(Cs.FireSea) && !pm.OnboardPokemon.HasType(BattleType.Fire)) { pm.EffectHurtByOneNth(8, Ls.FireSea); } switch (pm.Ability) { case As.SHED_SKIN: if (pm.State != PokemonState.Normal && c.RandomHappen(30)) { pm.RaiseAbility(); pm.DeAbnormalState(); } break; case As.HYDRATION: if (pm.State != PokemonState.Normal) { if (hydration == null) { hydration = c.Weather == Weather.Rain; } if (hydration == true) { pm.RaiseAbility(); pm.DeAbnormalState(); } } break; case As.HEALER: var ps = new List <PokemonProxy>(); foreach (var p in pm.Field.Pokemons) { if (p != pm && p.State != PokemonState.Normal) { ps.Add(p); } } if (ps.Count != 0 && c.RandomHappen(30)) { pm.RaiseAbility(); ps[c.GetRandomInt(0, ps.Count - 1)].DeAbnormalState(); } break; } switch (pm.Item) { case Is.LEFTOVERS: pm.HpRecoverByOneNth(16, false, Ls.ItemHpRecover2, Is.LEFTOVERS); break; case Is.BLACK_SLUDGE: if (pm.OnboardPokemon.HasType(BattleType.Poison)) { if (pm.CanHpRecover()) { pm.HpRecoverByOneNth(16, false, Ls.ItemHpRecover2, Is.BLACK_SLUDGE); } } else { pm.EffectHurtByOneNth(8, Ls.ItemHurt, Is.BLACK_SLUDGE); } break; } pm.CheckFaint(); } }
public static bool Execute(DefContext def) { var der = def.Defender; var move = def.AtkContext.Move; switch (def.Defender.Ability) { case As.VOLT_ABSORB: //10 if (!NoEffectWithAbsorb(def, BattleType.Electric)) { return(false); } break; case As.WATER_ABSORB: //11 case As.DRY_SKIN: //87 if (!NoEffectWithAbsorb(def, BattleType.Water)) { return(false); } break; case As.OBLIVIOUS: //12 if (move.Id == Ms.CAPTIVATE || move.Id == Ms.TAUNT) //顺序已测 { der.RaiseAbility(); der.NoEffect(); return(false); } break; case As.FLASH_FIRE: //18 if (def.AtkContext.Type == BattleType.Fire) { der.OnboardPokemon.SetCondition(Cs.FlashFire); der.RaiseAbility(); der.ShowLogPm("FlashFire"); return(false); } break; case As.WONDER_GUARD: //25 if ((move.Move.Category != MoveCategory.Status || move.Id == Ms.THUNDER_WAVE) && def.AtkContext.Type.EffectRevise(der.OnboardPokemon.Types) <= 0) { der.RaiseAbility(); der.NoEffect(); return(false); } break; case As.LIGHTNINGROD: //31 if (!NoEffectWithLv7DUp(def, BattleType.Electric, StatType.SpAtk)) { return(false); } break; case As.MOTOR_DRIVE: //78 if (!NoEffectWithLv7DUp(def, BattleType.Electric, StatType.Speed)) { return(false); } break; case As.STORM_DRAIN: //114 if (!NoEffectWithLv7DUp(def, BattleType.Water, StatType.SpAtk)) { return(false); } break; case As.SAP_SIPPER: //157 if (!NoEffectWithLv7DUp(def, BattleType.Grass, StatType.Atk)) { return(false); } break; case As.SOUNDPROOF: //43 if (move.Sound) { der.RaiseAbility(); der.NoEffect(); return(false); } break; case As.STICKY_HOLD: //60 var m = move.Id; if (m == Ms.THIEF || m == Ms.TRICK || m == Ms.COVET || m == Ms.SWITCHEROO) { der.RaiseAbility(); der.NoEffect(); return(false); } break; case As.TELEPATHY: //140 if ((move.Move.Category != MoveCategory.Status || move.Id == Ms.THUNDER_WAVE) && def.AtkContext.Attacker.Pokemon.TeamId == der.Pokemon.TeamId) { der.RaiseAbility(); der.NoEffect(); return(false); } break; case As.BULLETPROOF: if (move.Bullet) { der.RaiseAbility(); der.NoEffect(); return(false); } break; case As.Queenly_Majesty: if (def.AtkContext.Attacker.Priority > 0) { der.RaiseAbility(); der.NoEffect(); return(false); } break; case As.OVERCOAT: if (move.Powder) { der.RaiseAbility(); der.NoEffect(); return(false); } break; } if (move.Mental) { foreach (var p in der.Field.Pokemons) { if (p.RaiseAbility(As.AROMA_VEIL)) { def.Defender.NoEffect(); return(false); } } } if (move.Powder && der.ItemE(Is.SAFETY_GOGGLES)) { def.Defender.ShowLogPm("SafetyGoggles"); return(false); } //gen7 if (def.AtkContext.Attacker.Priority > 0 && def.AtkContext.Attacker.Pokemon.TeamId != def.Defender.Pokemon.TeamId) { foreach (var p in der.Field.Pokemons) { if (p.RaiseAbility(As.Dazzling)) { def.Defender.NoEffect(); return(false); } } } if (def.AtkContext.Attacker.Priority > 0 && def.AtkContext.Controller.Board.HasCondition(Cs.PsychicTerrain) && HasEffect.IsGroundAffectable(der, true, false) && der != def.AtkContext.Attacker) { def.Defender.NoEffect(); return(false); } return(true); }