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); }
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; } }
public static void Execute(PokemonProxy pm, int ability) { switch (ability) { case As.ZEN_MODE: if (pm.CanChangeForm(555, 0)) { pm.ChangeForm(0, false, "DeZenMode"); } break; case As.Shields_Down: if (pm.CanChangeForm(774, 0)) { pm.ChangeForm(0, false, "DeShields_Down"); } break; case As.Schooling: if (pm.CanChangeForm(746, 0)) { pm.ChangeForm(0, false, "DeSchooling"); } break; case As.ILLUSION: ATs.DeIllusion(pm); break; case As.FLOWER_GIFT: WeatherObserver(pm, 421); break; case As.FORECAST: WeatherObserver(pm, 351); break; case As.PRIMORDIAL_SEA: ATs.DeSpWeather(pm, ability, Ls.DeHeavyRain); break; case As.DESOLATE_LAND: ATs.DeSpWeather(pm, ability, Ls.DeHarshSunlight); break; case As.DELTA_STREAM: ATs.DeSpWeather(pm, ability, Ls.DeMysteriousAirCurrent); break; } }
private static void Forewarn(PokemonProxy pm) { var moves = new List <KeyValuePair <PokemonProxy, MoveTypeE> >(); { int maxPower = 0; foreach (PokemonProxy p in pm.Controller.Board[1 - pm.Pokemon.TeamId].GetAdjacentPokemonsByOppositeX(pm.OnboardPokemon.X)) { foreach (MoveProxy m in p.Moves) { int power = m.MoveE.Move.Power; if (power == 1) { if (m.MoveE.Class == MoveClass.OHKO) { power = 160; } else { var mid = m.MoveE.Id; if (mid == 382) { power = 0; //先取 } else if (mid == 68 || mid == 243 || mid == 368) { power = 120; } } } if (power > maxPower) { moves.Clear(); maxPower = power; } if (power == maxPower) { moves.Add(new KeyValuePair <PokemonProxy, MoveTypeE>(p, m.MoveE)); } } } } if (moves.Count != 0) { var pair = moves[pm.Controller.GetRandomInt(0, moves.Count - 1)]; pm.RaiseAbility(); pm.Controller.ReportBuilder.ShowLog("ReadMove", pair.Key.Id, pair.Value.Id); } }
private static void Anticipation(PokemonProxy pm) { foreach (var p in pm.Controller.Board[1 - pm.Pokemon.TeamId].GetAdjacentPokemonsByOppositeX(pm.OnboardPokemon.X)) { foreach (var m in p.Moves) { if (m.MoveE.Class == MoveClass.OHKO || m.MoveE.Move.Type.EffectRevise(pm.OnboardPokemon.Types) > 0) { pm.RaiseAbility(); pm.ShowLogPm("Anticipation"); return; } } } }
private static bool Attract(PokemonProxy p) { var pm = p.OnboardPokemon.GetCondition <PokemonProxy>(Cs.Attract); if (pm != null) { p.ShowLogPm("Attract", pm.Id); if (p.Controller.RandomHappen(50)) { p.ShowLogPm("AttractWork"); return(false); } } return(true); }
private static void SpWeather(PokemonProxy pm, Weather weather, string log) { var c = pm.Controller; if (c.Board.GetCondition <int>(Cs.SpWeather) != pm.OnboardPokemon.Ability) { pm.RaiseAbility(); c.ReportBuilder.ShowLog(log); c.Board.SetCondition(Cs.SpWeather, pm.OnboardPokemon.Ability); var fw = c.Weather; if (c.Board.Weather != weather) { c.Weather = weather; } } }
public static bool CanExecuteMove(PokemonProxy pm, MoveTypeE move) { //重力 if (move.UnavailableWithGravity && pm.Controller.Board.HasCondition(Cs.Gravity)) { pm.ShowLogPm("GravityCantUseMove", move.Id); return(false); } //回复封印 if (move.Heal && pm.OnboardPokemon.HasCondition(Cs.HealBlock)) { pm.ShowLogPm("HealBlockCantUseMove", move.Id); return(false); } return(true); }
public static void Debut(PokemonProxy pm) //欢迎登场,口耐的精灵们(笑 { var hazards = GetHazards(pm.Field); if (hazards != null) { foreach (var eh in hazards.ToArray()) { Debut(eh, pm); if (pm.CheckFaint()) { return; } } } }
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); }
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); }
public static bool Execute(PokemonProxy pm) { return (Sleeping(pm) && Frozen(pm) && Disable(pm) && Truant(pm) && Imprison(pm) && HealBlock(pm) && Confuse(pm) && Flinch(pm) && Taunt(pm) && Gravity(pm) && Attract(pm) && Paralyzed(pm) && FocusPunch(pm)); }
public static void WillAct(PokemonProxy pm) { pm.OnboardPokemon.RemoveCondition(Cs.DestinyBond); pm.OnboardPokemon.RemoveCondition(Cs.Grudge); pm.OnboardPokemon.RemoveCondition(Cs.Rage); var i = pm.OnboardPokemon.GetCondition <int>(Cs.Taunt); if (i != 0) { pm.OnboardPokemon.SetCondition(Cs.Taunt, i - 1); } var o = pm.OnboardPokemon.GetCondition(Cs.Encore); if (o != null) { o.Turn--; } }
private static bool Shell_Trap(PokemonProxy p) { if (p.SelectedMove.MoveE.Id == Ms.Shell_Trap) { if (p.OnboardPokemon.HasCondition(Cs.PhysicalDamage)) { return(true); } else { p.ShowLogPm("DeShell_Trap"); return(false); } } else { return(true); } }
private static bool Frozen(PokemonProxy p) { if (p.State == PokemonState.FRZ) { if (p.SelectedMove.MoveE.SelfDeFrozen) { p.DeAbnormalState("DeFRZ2", p.SelectedMove.MoveE.Id); } else if (p.Controller.GetRandomInt(0, 3) == 0) { p.DeAbnormalState(); } else { p.ShowLogPm("FRZ"); return(false); } } return(true); }
private static bool Imprison(PokemonProxy p) { var move = p.SelectedMove.MoveE; foreach (PokemonProxy pm in p.Controller.Board[1 - p.Pokemon.TeamId].GetAdjacentPokemonsByOppositeX(p.OnboardPokemon.X)) { if (pm.OnboardPokemon.HasCondition(Cs.Imprison)) { foreach (MoveProxy m in pm.Moves) { if (m.MoveE == move) { p.ShowLogPm("Imprison", move.Id); return(false); } } } } return(true); }
private static void Frisk(PokemonProxy pm) { var pms = pm.Controller.GetOnboardPokemons(1 - pm.Pokemon.TeamId); var items = new List <int>(); foreach (var p in pms) { if (p.Pokemon.Item != 0) { items.Add(p.Pokemon.Item); } } if (items.Count == 0) { return; } int i = pm.Controller.GetRandomInt(0, items.Count - 1); pm.RaiseAbility(); pm.ShowLogPm("Frisk", items[i]); }
private static void Trace(PokemonProxy pm) { var pms = new List <PokemonProxy>(); foreach (var p in pm.Controller.Board[1 - pm.Pokemon.TeamId].GetAdjacentPokemonsByOppositeX(pm.OnboardPokemon.X)) { if (ATs.Trace(p.OnboardPokemon.Ability)) { pms.Add(p); } } var n = pms.Count; if (n != 0) { pm.RaiseAbility(); var target = pms[pm.Controller.GetRandomInt(0, n - 1)]; pm.ChangeAbility(target.OnboardPokemon.Ability); pm.Controller.ReportBuilder.ShowLog("Trace", target.Id, target.OnboardPokemon.Ability); } }
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 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); }
public static bool SetWeather(PokemonProxy pm, Weather weather, bool ability, bool showFail) { var c = pm.Controller; if (c.Board.Weather == weather) { if (showFail) { c.ReportBuilder.ShowLog(Ls.Fail0); } return(false); } if (ability) { pm.RaiseAbility(); } switch (c.Board.GetCondition <int>(Cs.SpWeather)) { case As.PRIMORDIAL_SEA: c.ReportBuilder.ShowLog(Ls.HeavyRain2); return(false); case As.DESOLATE_LAND: c.ReportBuilder.ShowLog(Ls.HarshSunlight2); return(false); case As.DELTA_STREAM: c.ReportBuilder.ShowLog(Ls.MysteriousAirCurrent2); return(false); default: c.ReportBuilder.ShowLog(weather == Weather.IntenseSunlight ? Ls.EnIntenseSunlight : weather == Weather.Rain ? Ls.EnRain : weather == Weather.Hailstorm ? Ls.EnHailstorm : Ls.EnSandstorm); c.Weather = weather; c.Board.SetCondition(Cs.Weather, (c.TurnNumber == 0 ? 1 : c.TurnNumber) + (pm.ItemE(weather.Item()) ? 7 : 4)); return(true); } }
private static void Terrain(PokemonProxy pm, Cs terrain) { var c = pm.Controller; var b = c.Board; int x = pm.Item == Is.Terrain_Extender ? 7 : 4; if (c.TurnNumber == 0) { x++; } if (b.AddCondition(terrain, c.TurnNumber + x)) { if (!(terrain != Cs.GrassyTerrain && b.RemoveCondition(Cs.GrassyTerrain) || terrain != Cs.ElectricTerrain && b.RemoveCondition(Cs.ElectricTerrain)) && terrain != Cs.MistyTerrain) { b.RemoveCondition(Cs.MistyTerrain); } if (terrain != Cs.PsychicTerrain) { b.RemoveCondition(Cs.PsychicTerrain); } pm.RaiseAbility(); c.ReportBuilder.ShowLog("En" + terrain); } }
private static void SimpleAttachRaise(PokemonProxy pm, string log) { pm.RaiseAbility(); pm.ShowLogPm(log); }
public static PokemonProxy HasAbilityExcept(this IEnumerable <PokemonProxy> pms, int ability, PokemonProxy except) { foreach (var p in pms) { if (p.AbilityE(ability) && p != except) { return(p); } } return(null); }
public static void SendingOut(PokemonProxy pm) { pm.Reset(); var o = pm.OnboardPokemon; if (pm.State == PokemonState.BadlyPSN) { o.SetCondition(Cs.BadlyPSN, pm.Controller.TurnNumber); } var pass = pm.Tile.GetCondition <OnboardPokemon>(Cs.BatonPass); if (pass != null) { o.SetLv7D(pass.Lv5D.Atk, pass.Lv5D.Def, pass.Lv5D.SpAtk, pass.Lv5D.SpDef, pass.Lv5D.Speed, pass.AccuracyLv, pass.EvasionLv); pm.Tile.RemoveCondition(Cs.BatonPass); object c; //混乱状态 c = pass.GetCondition <object>(Cs.Confuse); if (c != null) { o.SetCondition(Cs.Confuse, c); } //寄生种子状态 c = pass.GetCondition <object>(Cs.LeechSeed); if (c != null) { o.SetCondition(Cs.LeechSeed, c); } //扣押状态 c = pass.GetCondition <object>(Cs.Embargo); if (c != null) { o.SetCondition(Cs.Embargo, c); } //回复封印状态 c = pass.GetCondition <object>(Cs.HealBlock); if (c != null) { o.SetCondition(Cs.HealBlock, c); } //念动力状态 c = pass.GetCondition <object>(Cs.Telekinesis); if (c != null) { o.SetCondition(Cs.Telekinesis, c); } //胃液状态 if (pass.HasCondition(Cs.GastroAcid)) { o.SetCondition(Cs.GastroAcid); } //扎根状态 if (pass.HasCondition(Cs.Ingrain)) { o.SetCondition(Cs.Ingrain); } //液态圈状态 if (pass.HasCondition(Cs.AquaRing)) { o.SetCondition(Cs.AquaRing); } //蓄气状态 if (pass.HasCondition(Cs.FocusEnergy)) { o.SetCondition(Cs.FocusEnergy); } //替身状态 c = pass.GetCondition <object>(Cs.Substitute); if (c != null) { o.SetCondition(Cs.Substitute, c); } //电磁浮游状态 c = pass.GetCondition <object>(Cs.MagnetRise); if (c != null) { o.SetCondition(Cs.MagnetRise, c); } //灭亡之歌状态 c = pass.GetCondition <object>(Cs.PerishSong); if (c != null) { o.SetCondition(Cs.PerishSong, c); } } ATs.Illusion(pm);//幻影特性以交换前的队伍顺序决定 }
public static int Execute(PokemonProxy pm, PokemonProxy by, StatType stat, int change, bool showFail) { var a = pm.Ability; if (change < 0 && by != pm) { if (pm.Field.HasCondition(Cs.Mist)) //根据百科非技能似乎不该发动,但排除了一下这样写肯定是对的 { if (showFail) { pm.ShowLogPm("Mist"); } return(0); } if (by == null || pm.Pokemon.TeamId != by.Pokemon.TeamId) { switch (a) { case As.CLEAR_BODY: case As.WHITE_SMOKE: case As.Full_Metal_Body: if (showFail) { pm.RaiseAbility(); pm.ShowLogPm("7DLockAll"); } return(0); case As.KEEN_EYE: if (CantLvDown(pm, by, stat, change, showFail, StatType.Accuracy)) { return(0); } break; case As.HYPER_CUTTER: if (CantLvDown(pm, by, stat, change, showFail, StatType.Atk)) { return(0); } break; case As.BIG_PECKS: if (CantLvDown(pm, by, stat, change, showFail, StatType.Def)) { return(0); } break; } } if (pm.OnboardPokemon.HasType(BattleType.Grass)) { foreach (var p in pm.Field.Pokemons) { if (p.AbilityE(As.FLOWER_VEIL)) { if (showFail) { p.RaiseAbility(); pm.ShowLogPm("7DLock", (int)stat); } return(0); } } } } switch (a) { case As.SIMPLE: //86 change <<= 1; break; case As.CONTRARY: //126 change = 0 - change; break; } return(change); }
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; } }
private static void Disappear(PokemonProxy pm) { pm.Controller.ReportBuilder.DeSubstitute(pm); pm.OnboardPokemon.RemoveCondition(Cs.Substitute); }
public static void Execute(PokemonProxy pm) { switch (pm.Ability) { case As.DRIZZLE: //2 STs.SetWeather(pm, Weather.Rain, true, false); break; case As.DROUGHT: STs.SetWeather(pm, Weather.IntenseSunlight, true, false); break; case As.SAND_STREAM: STs.SetWeather(pm, Weather.Sandstorm, true, false); break; case As.SNOW_WARNING: STs.SetWeather(pm, Weather.Hailstorm, true, false); break; case As.PRIMORDIAL_SEA: SpWeather(pm, Weather.Rain, Ls.EnHeavyRain); break; case As.DESOLATE_LAND: SpWeather(pm, Weather.IntenseSunlight, Ls.EnHarshSunlight); break; case As.DELTA_STREAM: SpWeather(pm, Weather.Normal, Ls.EnMysteriousAirCurrent); break; case As.LIMBER: //7 CantAddState(pm, PokemonState.PAR); break; case As.INSOMNIA: //15 case As.VITAL_SPIRIT: //72 CantAddState(pm, PokemonState.SLP); break; case As.MAGMA_ARMOR: //40 CantAddState(pm, PokemonState.FRZ); break; case As.WATER_VEIL: //41 CantAddState(pm, PokemonState.BRN); break; case As.OBLIVIOUS: //12 if (pm.OnboardPokemon.RemoveCondition(Cs.Attract)) { pm.RaiseAbility(); pm.ShowLogPm("DeAttract"); } break; case As.IMMUNITY: //17 if (pm.State == PokemonState.PSN || pm.State == PokemonState.BadlyPSN) { pm.RaiseAbility(); pm.DeAbnormalState(); } break; case As.OWN_TEMPO: //20 if (pm.OnboardPokemon.RemoveCondition(Cs.Confuse)) { pm.RaiseAbility(); pm.ShowLogPm("DeConfuse"); } break; case As.IMPOSTER: Imposter(pm); break; case As.FRISK: Frisk(pm); break; case As.FLOWER_GIFT: WeatherObserver(pm, 421, pm.Controller.Weather == Weather.IntenseSunlight ? 1 : 0); break; case As.FORECAST: { var form = (int)pm.Controller.Weather; WeatherObserver(pm, 351, form > 3 ? 0 : form); } break; case As.FOREWARN: Forewarn(pm); break; case As.FLASH_FIRE: pm.OnboardPokemon.RemoveCondition(Cs.FlashFire); break; case As.AIR_LOCK: //总觉得多个天气锁的可能会有问题,未测 pm.RaiseAbility(); pm.Controller.ReportBuilder.ShowLog("AirLock"); if (pm.Controller.Board.Weather != Weather.Normal) { ATs.WeatherChanged(pm.Controller); } break; case As.INTIMIDATE: pm.RaiseAbility(); foreach (var p in pm.Controller.Board[1 - pm.Pokemon.TeamId].GetAdjacentPokemonsByOppositeX(pm.OnboardPokemon.X)) { if (p.OnboardPokemon.HasCondition(Cs.Substitute)) { p.ShowLogPm("NoEffect"); } else { p.ChangeLv7D(pm, StatType.Atk, -1, true); } } break; case As.TRACE: Trace(pm); break; case As.PRESSURE: SimpleAttachRaise(pm, "Pressure"); break; case As.MOLD_BREAKER: SimpleAttachRaise(pm, "MoldBreaker"); break; case As.TURBOBLAZE: SimpleAttachRaise(pm, "Turboblaze"); break; case As.TERAVOLT: SimpleAttachRaise(pm, "Teravolt"); break; case As.DOWNLOAD: Download(pm); break; case As.ANTICIPATION: Anticipation(pm); break; case As.SLOW_START: pm.OnboardPokemon.SetCondition(Cs.SlowStart, pm.Controller.TurnNumber + 5); pm.RaiseAbility(); pm.ShowLogPm("EnSlowStart"); break; } }
public static void Withdrawing(PokemonProxy pm, bool canPursuit) { if (canPursuit && pm.Hp != 0) { foreach (var p in pm.Controller.Board[1 - pm.Pokemon.TeamId].GetAdjacentPokemonsByOppositeX(pm.OnboardPokemon.X).ToArray()) { if (p.SelectedMove != null && p.SelectedMove.MoveE.Id == Ms.PURSUIT && p.CanMove) { p.OnboardPokemon.SetCondition(Cs.Pursuiting); p.Move(); p.OnboardPokemon.RemoveCondition(Cs.Pursuiting); if (pm.Hp == 0) { return; } } } } foreach (var p in pm.Controller.Board.Pokemons) { if (p != pm) { var op = p.OnboardPokemon; { var o = op.GetCondition(Cs.CanAttack); if (o != null && o.By == pm) { op.RemoveCondition(Cs.CanAttack); } } { if (op.GetCondition <PokemonProxy>(Cs.CantSelectWithdraw) == pm) { op.RemoveCondition(Cs.CantSelectWithdraw); } } { var o = op.GetCondition(Cs.HealBlock); if (o != null && o.By == pm) { op.RemoveCondition(Cs.HealBlock); } } { if (op.GetCondition <PokemonProxy>(Cs.Attract) == pm) { op.RemoveCondition(Cs.Attract); } } { if (op.GetCondition <PokemonProxy>(Cs.Torment) == pm) { op.RemoveCondition(Cs.Torment); } } { var o = op.GetCondition(Cs.Trap); if (o != null && o.By == pm) { op.RemoveCondition(Cs.Trap); } } } } }