public static void Pressure(AtkContext atk, MoveRange range) { var ts = atk.Move.Move.Range == MoveRange.Board || atk.Move.Move.Range == MoveRange.OpponentField ? atk.Attacker.Controller.Board[1 - atk.Attacker.Pokemon.TeamId].Pokemons : atk.Targets == null? Enumerable.Empty <PokemonProxy>() : null; if (ts == null) { foreach (var d in atk.Targets) { if (d.Defender.Pokemon.TeamId != atk.Attacker.Pokemon.TeamId && d.Defender.AbilityE(As.PRESSURE)) { atk.Pressure++; } } } else { foreach (var d in ts) { if (d.AbilityE(As.PRESSURE)) { atk.Pressure++; } } } }
public static void MoveEnding(AtkContext atk) { var aer = atk.Attacker; if (atk.Move.Id == Ms.SPIT_UP || atk.Move.Id == Ms.SWALLOW) { int i = aer.OnboardPokemon.GetCondition <int>(Cs.Stockpile); aer.ChangeLv7D(atk.Attacker, false, false, 0, -i, 0, -i); aer.OnboardPokemon.RemoveCondition(Cs.Stockpile); aer.ShowLogPm("DeStockpile"); } MagicCoat(atk); atk.SetAttackerAction(atk.Move.StiffOneTurn ? PokemonAction.Stiff : PokemonAction.Done); if (atk.Targets != null) { foreach (var d in atk.Targets) { ITs.Attach(d.Defender); ATs.RecoverAfterMoldBreaker(d.Defender); } } ITs.Attach(atk.Attacker); //先树果汁后PP果 var c = aer.Controller; { var o = atk.GetCondition(Cs.MultiTurn); if (o != null) { o.Turn--; if (o.Turn != 0) { atk.SetAttackerAction(PokemonAction.Moving); } else if (o.Bool) { aer.AddState(aer, AttachedState.Confuse, false, 0, "EnConfuse2"); } } } { var o = atk.GetCondition <Tile>(Cs.EjectButton); if (o != null) { c.PauseForSendOutInput(o); return; } } { var tile = aer.Tile; if (atk.Move.Switch && tile != null) { c.Withdraw(aer, "SelfWithdraw", 0, true); c.PauseForSendOutInput(tile); } } }
public static bool MustHit(AtkContext atk) { var m = atk.Move.Id; return (atk.Move.Move.Accuracy == 0 || atk.Attacker.AbilityE(As.NO_GUARD) || (m == Ms.THUNDER || m == Ms.HURRICANE) && atk.Controller.Weather == Weather.Rain || m == Ms.BLIZZARD && atk.Controller.Weather == Weather.Hailstorm || atk.Attacker.OnboardPokemon.HasType(BattleType.Poison) && m == Ms.TOXIC); }
public static void BuildDefContext(AtkContext atk, Tile select) { switch (atk.Move.Id) { case Ms.COUNTER: //68 Counter(atk, Cs.PhysicalDamage); break; case Ms.MIRROR_COAT: //243 Counter(atk, Cs.SpecialDamage); break; case Ms.METAL_BURST: //368 Counter(atk, Cs.Damage); break; case Ms.BIDE: if (atk.GetCondition(Cs.MultiTurn).Turn == 1) { var o = atk.GetCondition(Cs.Bide); var targets = new List <DefContext>(); if (o.By != null) { var t = GetRangeTiles(atk, MoveRange.SelectedTarget, o.By.Tile).FirstOrDefault(); if (t != null && t.Pokemon != null) { targets.Add(new DefContext(atk, t.Pokemon)); } } if (!targets.Any()) { atk.Attacker.ShowLogPm("UseMove", Ms.BIDE); //奇葩的战报 } atk.SetTargets(targets); } break; default: IEnumerable <Tile> ts = GetRangeTiles(atk, atk.Move.GetRange(atk.Attacker), select); if (ts != null) { var targets = new List <DefContext>(); foreach (Tile t in ts) { if (t.Pokemon != null) { targets.Add(new DefContext(atk, t.Pokemon)); } } atk.SetTargets(targets); } break; } }
internal void BuildAtkContext(MoveProxy move) { if (move.MoveE.Id == Ms.STRUGGLE) { _atkContext = new AtkContext(this); } else { _atkContext = new AtkContext(move); } }
internal void Reset() { _atkContext = null; SelectedMove = null; SelectedTarget = null; _moves.Clear(); foreach (var m in Pokemon.Moves) { _moves.Add(new MoveProxy(m, this)); } LastMoveTurn = 0; }
public static void AttackPostEffect(AtkContext atk) { var aer = atk.Attacker; var c = aer.Controller; if (!atk.IgnoreSwitchItem) { bool e = true, r = aer.Hp != 0 && aer.Controller.CanWithdraw(aer); foreach (var d in atk.Targets) { if (!d.HitSubstitute && d.Defender.Tile != null) { var der = d.Defender; var i = der.Item; if (e && i == Is.EJECT_BUTTON) { atk.SetCondition(Cs.EjectButton, der.Tile); der.ConsumeItem(); c.Withdraw(der, "EjectButton", 0, true); if (r == false) { break; } e = false; } else if (r && i == Is.RED_CARD) { der.ConsumeItem(); der.ShowLogPm("RedCard", aer.Id); r = !MoveE.ForceSwitchImplement(aer, true); if (e == false) { return; } } } } } if (aer.ItemE(Is.SHELL_BELL)) { if (atk.TotalDamage != 0) { aer.HpRecoverByOneNth(atk.TotalDamage >> 3, false, Ls.ItemHpRecover, Is.SHELL_BELL); } } else if (aer.ItemE(Is.LIFE_ORB) && aer.EffectHurtByOneNth(10, Ls.LifeOrb)) { aer.CheckFaint(); } }
private static void Counter(AtkContext atk, Cs condition) { var o = atk.Attacker.OnboardPokemon.GetCondition(condition); if (o != null) { var pm = o.By; if (pm.Tile != null && pm.Pokemon.TeamId != atk.Attacker.Pokemon.TeamId) { atk.SetTargets(new DefContext[] { new DefContext(atk, pm) }); return; } } atk.SetTargets(new DefContext[0]); }
public static void MagicCoat(AtkContext atk) { var list = atk.GetCondition <List <PokemonProxy> >(Cs.MagicCoat); if (list != null) { atk.RemoveCondition(Cs.MagicCoat); foreach (var d in list) { var a = new AtkContext(d); a.SetCondition(Cs.IgnoreMagicCoat); a.StartExecute(atk.Move, atk.Attacker.Tile, d.RaiseAbility(As.MAGIC_BOUNCE) ? "MagicBounce" : "MagicCoat"); if (atk.Target == null) { break; } } } }
public static bool DefenderAbilityAvailable(this AtkContext atk) { var pm = atk.Attacker; return(!(pm.AbilityE(As.MOLD_BREAKER) || pm.AbilityE(As.TURBOBLAZE) || pm.AbilityE(As.TERAVOLT))); }
public static void CheckGem(AtkContext atk) { int i = atk.Attacker.Item; BattleType t; switch (i) { case Is.FIRE_GEM: t = BattleType.Fire; break; case Is.WATER_GEM: t = BattleType.Water; break; case Is.ELECTRIC_GEM: t = BattleType.Electric; break; case Is.GRASS_GEM: t = BattleType.Grass; break; case Is.ICE_GEM: t = BattleType.Ice; break; case Is.FIGHTING_GEM: t = BattleType.Fighting; break; case Is.POISON_GEM: t = BattleType.Poison; break; case Is.GROUND_GEM: t = BattleType.Ground; break; case Is.FLYING_GEM: t = BattleType.Flying; break; case Is.PSYCHIC_GEM: t = BattleType.Psychic; break; case Is.BUG_GEM: t = BattleType.Bug; break; case Is.ROCK_GEM: t = BattleType.Rock; break; case Is.GHOST_GEM: t = BattleType.Ghost; break; case Is.DRAGON_GEM: t = BattleType.Dragon; break; case Is.DARK_GEM: t = BattleType.Dark; break; case Is.STEEL_GEM: t = BattleType.Steel; break; case Is.FAIRY_GEM: t = BattleType.Fairy; break; case Is.NORMAL_GEM: t = BattleType.Normal; break; default: return; } if (atk.Type == t) { atk.Controller.ReportBuilder.ShowLog("Gem", i, atk.Move.Id); atk.SetTurnCondition(Cs.Gem); atk.Attacker.ConsumeItem(); } }
internal void Move() { STs.FocusPunch(Controller); LastMoveTurn = Controller.TurnNumber; STs.WillAct(this); switch (Action) { case PokemonAction.Stiff: PTs.ShowLogPm(this, "Stiff"); Action = PokemonAction.Done; break; case PokemonAction.Moving: if (AtkContext.Move.Id == Ms.SKY_DROP) { CoordY = CoordY.Plate; if (AtkContext.Target.Defender.AliveOnboard) { AtkContext.Target.Defender.CoordY = CoordY.Plate; AtkContext.Target.Defender.OnboardPokemon.RemoveCondition(Cs.SkyDrop); } else { AtkContext.SetTargets(Enumerable.Empty <DefContext>()); } } if (CanExecute()) { if (AtkContext.Move.Id != Ms.BIDE) { PTs.ShowLogPm(this, "UseMove", AtkContext.Move.Id); } AtkContext.ContinueExecute(SelectedTarget); } else { Action = PokemonAction.Done; } break; case PokemonAction.MoveAttached: { var o = OnboardPokemon.GetCondition(Cs.Encore); if (o != null) { foreach (var m in Moves) { if (m.MoveE == o.Move) { SelectedMove = m; } } } } ATs.StanceChange(this); if (CanExecute() && SelectedMove.CanExecute()) { _atkContext = null; SelectedMove.Execute(); var o = OnboardPokemon.GetCondition(Cs.LastMove); if (o == null) { o = new Condition(); o.Move = AtkContext.Move; OnboardPokemon.SetCondition(Cs.LastMove, o); } else if (o.Move != AtkContext.Move) { o.Move = AtkContext.Move; o.Int = 0; } if (AtkContext.Fail) { o.Int = 0; } else { o.Int++; } Controller.Board.SetCondition(Cs.LastMove, o); } else { OnboardPokemon.RemoveCondition(Cs.LastMove); Action = PokemonAction.Done; } break; } //switch(Action) }
public static bool DefenderAbilityAvailable(this AtkContext atk) { var pm = atk.Attacker; return !(pm.AbilityE(As.MOLD_BREAKER) || pm.AbilityE(As.TURBOBLAZE) || pm.AbilityE(As.TERAVOLT) || atk.Move.Move.Id == Ms.Moongeist_Beam || atk.Move.Move.Id == Ms.Sunsteel_Strike ); }
public static IEnumerable <Tile> GetRangeTiles(AtkContext atk, MoveRange range, Tile select) { var aer = atk.Attacker; IEnumerable <Tile> targets = null; Board b = aer.Controller.Board; var remote = atk.Move.IsRemote; var team = aer.Pokemon.TeamId; var oTeam = 1 - team; var x = aer.OnboardPokemon.X; var ox = aer.Controller.GameSettings.Mode.XBound() - 1 - x; switch (range) { case MoveRange.TeamField: //do nothing case MoveRange.OpponentField: //do nothing case MoveRange.Board: //do nothing case MoveRange.TeamPokemons: //防音防不住治愈铃铛,所以这只是个摆设 break; case MoveRange.Adjacent: { var ts = new List <Tile>(); Tile t; t = b[team][x - 1]; if (t != null) { ts.Add(t); } t = b[team][x + 1]; if (t != null) { ts.Add(t); } t = b[oTeam][ox - 1]; if (t != null) { ts.Add(t); } ts.Add(b[oTeam][ox]); t = b[oTeam][ox + 1]; if (t != null) { ts.Add(t); } targets = ts; } break; case MoveRange.OpponentPokemons: { var ts = new List <Tile>(); Tile t; t = b[oTeam][ox - 1]; if (t != null) { ts.Add(t); } ts.Add(b[oTeam][ox]); t = b[oTeam][ox + 1]; if (t != null) { ts.Add(t); } targets = ts; } break; case MoveRange.All: targets = b.Tiles; break; case MoveRange.SelectedTeammate: if (select == null) { var pms = new List <PokemonProxy>(); foreach (var pm in remote ? b[team].Pokemons : b[team].GetAdjacentPokemonsByX(x)) { if (pm != aer) { pms.Add(pm); } } targets = pms.Any() ? new Tile[] { pms[aer.Controller.GetRandomInt(0, pms.Count - 1)].Tile } : Enumerable.Empty <Tile>(); } else { targets = new Tile[] { select } }; break; case MoveRange.RandomOpponentPokemon: { var pms = (List <PokemonProxy>)(remote? b[oTeam].Pokemons : b[oTeam].GetAdjacentPokemonsByX(ox)); targets = pms.Any() ? new Tile[] { pms[aer.Controller.GetRandomInt(0, pms.Count - 1)].Tile } : Enumerable.Empty <Tile>(); } break; case MoveRange.SelectedTarget: if (select == null || select.Field.Team == oTeam) { goto case MoveRange.SelectedOpponent; } targets = new Tile[] { select }; break; case MoveRange.SelectedOpponent: //非鬼系选诅咒后变诅咒随机对方一个精灵 if (select == null) { goto case MoveRange.RandomOpponentPokemon; } //因为移动或交换位置造成距离不足,技能失败 if (!(remote || ox - 1 <= select.X && select.X <= ox + 1)) { targets = Enumerable.Empty <Tile>(); } if (select.Pokemon != null) { targets = new Tile[] { select } } ; else if (b[oTeam][ox].Pokemon != null) { targets = new Tile[] { b[oTeam][ox] } } ; //据说正对面精灵优先 else { goto case MoveRange.RandomOpponentPokemon; } break; case MoveRange.Self: //done? targets = new Tile[] { aer.Tile }; break; case MoveRange.RandomTeamPokemon: { var pms = (List <PokemonProxy>)(remote ? b[team].Pokemons : b[team].GetAdjacentPokemonsByX(x)); targets = new Tile[] { pms[aer.Controller.GetRandomInt(0, pms.Count - 1)].Tile }; } break; } return(targets); }
public static void FilterDefContext(AtkContext atk) { if ((atk.Move.Id == Ms.FUTURE_SIGHT || atk.Move.Id == Ms.DOOM_DESIRE) && !atk.HasCondition(Cs.FSDD)) { return; } if (atk.Targets == null) { return; } var move = atk.Move; var aer = atk.Attacker; if (move.GetRange(aer) == MoveRange.SelectedTarget) { var all = atk.Move.IsRemote || aer.Controller.GameSettings.Mode != GameMode.Triple; PokemonProxy retarget = null; var rp = !(aer.OnboardPokemon.HasType(BattleType.Grass) || aer.AbilityE(As.OVERCOAT) || aer.ItemE(Is.SAFETY_GOGGLES)); foreach (var pm in atk.Controller.OnboardPokemons) { if (pm.Pokemon.TeamId != aer.Pokemon.TeamId && pm != atk.Target.Defender && (all || aer.OnboardPokemon.X == 1 || aer.OnboardPokemon.X != pm.OnboardPokemon.X)) { var fm = pm.OnboardPokemon.GetCondition <int>(Cs.FollowMe); if (fm != 0 && (rp || fm != Ms.RAGE_POWDER)) { retarget = pm; break; } } } if (retarget == null) { int ab = 0; if (atk.Type == BattleType.Electric) { ab = As.LIGHTNINGROD; } else if (atk.Type == BattleType.Water) { ab = As.STORM_DRAIN; } if (ab != 0) { foreach (var pm in atk.Controller.Board.Pokemons) { if (pm != aer && pm != atk.Target.Defender && (all || aer.OnboardPokemon.X == 1 || pm.OnboardPokemon.X == 1 || aer.Pokemon.TeamId != pm.Pokemon.TeamId && aer.OnboardPokemon.X != pm.OnboardPokemon.X) && pm.RaiseAbility(ab)) { retarget = pm; break; } } } } if (retarget != null) { retarget.ShowLogPm("ReTarget"); atk.SetTargets(new DefContext[] { new DefContext(atk, retarget) }); } } List <DefContext> targets = atk.Targets.ToList(); #region Check CoordY { var count = 0; foreach (DefContext def in targets.ToArray()) { ++count; if (!(def.Defender.CoordY == CoordY.Plate || def.NoGuard || IsYInRange(def))) { def.Defender.ShowLogPm(Ls.Miss); targets.Remove(def); } } if (count > 1) { atk.MultiTargets = true; } } #endregion #region Attack Move and Thunder Wave: Check for Immunity (or Levitate) on the Ally side, position 1, then position 3. Then check Opponent side, position 1, then 2, then 3, foreach (DefContext def in targets.ToArray()) { if (!HasEffect.Execute(def)) { targets.Remove(def); def.Defender.NoEffect(); } } #endregion #region WideGuard QuickGuard CraftyShield MatBlock if (move.Move.Category != MoveCategory.Status && move.Move.Range != MoveRange.SelectedTarget) { foreach (var def in targets.ToArray()) { if (def.Defender.Field.HasCondition(Cs.WideGuard)) { def.Defender.ShowLogPm("WideGuard"); targets.Remove(def); } } } if (aer.Priority > 0 && move.Id != Ms.FEINT) { foreach (var def in targets.ToArray()) { if (def.Defender.Field.HasCondition(Cs.QuickGuard)) { def.Defender.ShowLogPm("QuickGuard"); targets.Remove(def); } } } if (move.Move.Category == MoveCategory.Status) { foreach (var def in targets.ToArray()) { if (def.Defender.Field.HasCondition(Cs.CraftyShield)) { def.Defender.ShowLogPm("CraftyShield"); targets.Remove(def); } } } else { var d0 = targets.FirstOrDefault(); if (d0 != null && d0.Defender.Field.HasCondition(Cs.MatBlock)) { d0.Defender.Controller.ReportBuilder.ShowLog("MatBlock", move.Id); var td = d0.Defender.Pokemon.TeamId; foreach (var d in targets.ToArray()) { if (d.Defender.Pokemon.TeamId == td) { targets.Remove(d); } } d0 = targets.FirstOrDefault(); if (d0 != null && d0.Defender.Field.HasCondition(Cs.MatBlock)) { targets.Clear(); } } } #endregion #region Protect KingsShield SpikyShield if (move.Protectable) { foreach (DefContext d in targets.ToArray()) { if (d.Defender.OnboardPokemon.HasCondition(Cs.Protect)) { d.Defender.ShowLogPm("Protect"); targets.Remove(d); } } } if (move.Move.Category != MoveCategory.Status) { foreach (var d in targets.ToArray()) { if (d.Defender.OnboardPokemon.HasCondition(Cs.SpikyShield)) { d.Defender.ShowLogPm("Protect"); if (move.NeedTouch) { aer.EffectHurtByOneNth(8); } targets.Remove(d); } } foreach (var d in targets.ToArray()) { if (d.Defender.OnboardPokemon.HasCondition(Cs.KingsShield)) { d.Defender.ShowLogPm("Protect"); if (move.NeedTouch) { aer.ChangeLv7D(d.Defender, StatType.Atk, -2, false); } targets.Remove(d); } } } #endregion #region Check for Telepathy (and possibly other abilities) { var mc = move.MagicCoat && !atk.HasCondition(Cs.IgnoreMagicCoat); var ab = atk.DefenderAbilityAvailable(); foreach (DefContext def in targets.ToArray()) { if (def.Defender != atk.Attacker && (mc && STs.MagicCoat(atk, def.Defender) || ab && !CanImplement.Execute(def))) { targets.Remove(def); } } } #endregion if (move.Move.Category == MoveCategory.Status && !atk.IgnoreSubstitute()) { foreach (DefContext d in targets.ToArray()) { if (d.Defender != aer && d.Defender.OnboardPokemon.HasCondition(Cs.Substitute)) { d.Fail(); targets.Remove(d); } } } if (move.Id == Ms.SKY_DROP) { foreach (var d in targets.ToArray()) { if (d.Defender.OnboardPokemon.Weight >= 200) { d.Fail(); targets.Remove(d); } } } #region Check for misses if (!MustHit(atk)) { if (move.Class != MoveClass.OHKO) { atk.AccuracyModifier = STs.AccuracyModifier(atk); } foreach (DefContext def in targets.ToArray()) { if (!(MustHit(def) || CanHit(def))) { targets.Remove(def); def.Defender.ShowLogPm(Ls.Miss); } } } #endregion atk.SetTargets(targets); }
public static void AttackPostEffect(AtkContext atk) { var aer = atk.Attacker; var c = aer.Controller; bool e = true; if (!atk.IgnoreSwitchItem) { bool r = aer.Hp != 0 && aer.Controller.CanWithdraw(aer); foreach (var d in atk.Targets) { if (!d.HitSubstitute && d.Defender.Tile != null) { var der = d.Defender; var i = der.Item; if (e && i == Is.EJECT_BUTTON) { atk.SetCondition(Cs.EjectButton, der.Tile); der.ConsumeItem(); c.Withdraw(der, "EjectButton", 0, true); if (r == false) { break; } e = false; } else if (r && i == Is.RED_CARD) { der.ConsumeItem(); der.ShowLogPm("RedCard", aer.Id); r = !MoveE.ForceSwitchImplement(aer, true); if (e == false) { return; } } else if (e && (der.Ability == As.Emergency_Exit || der.Ability == As.Wimp_Out) && der.Hp <= der.Pokemon.MaxHp / 2 && atk.TotalDamage + der.Hp > der.Pokemon.MaxHp / 2) { atk.SetCondition(Cs.EjectButton, der.Tile); if (der.Ability == As.Emergency_Exit) { c.Withdraw(der, "EmergencyExit", 0, true); } else if (der.Ability == As.Wimp_Out) { c.Withdraw(der, "WimpOut", 0, true); } if (r == false) { break; } e = false; } } } } bool moreThanHalf = aer.Hp > aer.Pokemon.MaxHp / 2; if (aer.ItemE(Is.SHELL_BELL)) { if (atk.TotalDamage != 0) { aer.HpRecoverByOneNth(atk.TotalDamage, false, Ls.ItemHpRecover, Is.SHELL_BELL, false, true); } } else if (aer.ItemE(Is.LIFE_ORB) && aer.EffectHurtByOneNth(10, Ls.LifeOrb)) { aer.CheckFaint(); } }
internal void Move() { if (SelectZmove) { Pokemon.Zmove = true; } STs.FocusPunch(Controller); LastMoveTurn = Controller.TurnNumber; STs.WillAct(this); switch (Action) { case PokemonAction.Stiff: PTs.ShowLogPm(this, "Stiff"); Action = PokemonAction.Done; break; case PokemonAction.Moving: if (AtkContext.Move.Id == Ms.SKY_DROP) { CoordY = CoordY.Plate; if (AtkContext.Target.Defender.AliveOnboard) { AtkContext.Target.Defender.CoordY = CoordY.Plate; AtkContext.Target.Defender.OnboardPokemon.RemoveCondition(Cs.SkyDrop); } else { AtkContext.SetTargets(Enumerable.Empty <DefContext>()); } } if (CanExecute()) { if (AtkContext.Move.Id != Ms.BIDE) { PTs.ShowLogPm(this, "UseMove", AtkContext.Move.Id); } AtkContext.ContinueExecute(SelectedTarget); } else { Action = PokemonAction.Done; } break; case PokemonAction.MoveAttached: { var o = OnboardPokemon.GetCondition(Cs.Encore); if (o != null) { foreach (var m in Moves) { if (m.MoveE == o.Move) { SelectedMove = m; } } } } ATs.StanceChange(this); if (SelectZmove && SelectedMove.MoveE.Move.Category == MoveCategory.Status) { switch (GameHelper.ZStatus(SelectedMove.MoveE.Move.Id)) { case 0: break; case 1: this.ChangeLv7D(this, StatType.Atk, 1, false); break; case 2: this.ChangeLv7D(this, StatType.Atk, 2, false); break; case 3: this.ChangeLv7D(this, StatType.Atk, 3, false); break; case 4: this.ChangeLv7D(this, StatType.Def, 1, false); break; case 5: this.ChangeLv7D(this, StatType.SpAtk, 1, false); break; case 6: this.ChangeLv7D(this, StatType.SpAtk, 2, false); break; case 7: this.ChangeLv7D(this, StatType.SpDef, 1, false); break; case 8: this.ChangeLv7D(this, StatType.SpDef, 2, false); break; case 9: this.ChangeLv7D(this, StatType.Speed, 1, false); break; case 10: this.ChangeLv7D(this, StatType.Speed, 2, false); break; case 11: this.ChangeLv7D(this, StatType.Accuracy, 1, false); break; case 12: this.ChangeLv7D(this, StatType.Evasion, 1, false); break; case 13: this.ChangeLv7D(this, false, false, 1, 1, 1, 1, 1, 0, 0); break; case 14: if (OnboardPokemon.AddCondition(Cs.FocusEnergy)) { this.ShowLogPm("En" + Cs.FocusEnergy); } break; case 15: ITs.Reset7D(this); break; case 16: this.HpRecover(Pokemon.MaxHp); break; case 17: if (Pokemon.Owner.PmsAlive > Controller.GameSettings.Mode.OnboardPokemonsPerPlayer()) { Tile.SetTurnCondition(Cs.Zheal); } break; case 18: OnboardPokemon.AddTurnCondition(Cs.FollowMe, SelectedMove.MoveE.Move.Id); this.ShowLogPm(Ls.EnFollowMe); break; default: break; } if (SelectedMove.MoveE.Move.Id == Ms.CURSE) { if (OnboardPokemon.HasType(BattleType.Ghost)) { this.HpRecover(Pokemon.MaxHp); } else { this.ChangeLv7D(this, StatType.Atk, 1, false); } } } if (CanExecute() && SelectedMove.CanExecute()) { _atkContext = null; SelectedMove.Execute(); var o = OnboardPokemon.GetCondition(Cs.LastMove); if (o == null) { o = new Condition(); o.Move = AtkContext.Move; OnboardPokemon.SetCondition(Cs.LastMove, o); } else if (o.Move != AtkContext.Move) { o.Move = AtkContext.Move; o.Int = 0; } if (AtkContext.Fail) { o.Int = 0; } else { o.Int++; } Controller.Board.SetCondition(Cs.LastMove, o); } else { OnboardPokemon.RemoveCondition(Cs.LastMove); Action = PokemonAction.Done; } if (AtkContext != null && AtkContext.Move.Dance && AtkContext.Attacker.LastMoveTurn == Controller.TurnNumber) { foreach (var p in Controller.Board.Pokemons) { if (p != null && p.AbilityE(As.Dancer) && p != AtkContext.Attacker) { p.RaiseAbility(); AtkContext dance = new AtkContext(p); dance.StartExecute(AtkContext.Move, null, "UseMove", false); } } } break; } //switch(Action) }
public DefContext(AtkContext a, PokemonProxy pm) { AtkContext = a; Defender = pm; }