internal void Debut() { if (Action == PokemonAction.Debuting) { Tile.Debut(); if (!(OnboardPokemon.HasCondition(Cs.Substitute) || AbilityE(As.OVERCOAT))) { EHTs.Debut(this); } if (!PTs.CheckFaint(this)) { if (ItemE(Is.BLUE_ORB) && PTs.CanChangeForm(this, Ps.KYOGRE, 1) || ItemE(Is.RED_ORB) && PTs.CanChangeForm(this, Ps.GROUNDON, 1)) { PTs.ChangeForm(this, 1, true, Ls.Primal); } if (OnboardPokemon.Ability != As.FLOWER_GIFT && OnboardPokemon.Ability != As.FORECAST) { AbilityAttach.Execute(this); } if (!ITs.AirBalloon(this)) { ITs.Attach(this); } } Action = PokemonAction.Done; } }
/// <summary> /// check canwithdraw first, null log to show nothing /// </summary> /// <param name="pm"></param> /// <param name="ability"></param> /// <param name="log"></param> /// <param name="arg1"></param> /// <returns></returns> public static bool ForceSwitchImplement(PokemonProxy pm, bool ability) { if (ability && pm.RaiseAbility(As.SUCTION_CUPS)) { pm.ShowLogPm("SuctionCups"); return(false); } if (pm.OnboardPokemon.HasCondition(Cs.Ingrain)) { pm.ShowLogPm("IngrainCantMove"); return(false); } var c = pm.Controller; var sendouts = new List <int>(); { var pms = pm.Pokemon.Owner.Pokemons.ToArray(); for (int i = pm.Controller.GameSettings.Mode.OnboardPokemonsPerPlayer(); i < pms.Length; ++i) { if (c.CanSendOut(pms[i])) { sendouts.Add(i); } } } var tile = pm.Tile; ITs.Attach(pm); c.Withdraw(pm, Ls.forceWithdraw, 0, false); tile.WillSendOutPokemonIndex = sendouts[c.GetRandomInt(0, sendouts.Count - 1)]; c.SendOut(tile, true, "ForceSendOut"); return(true); }
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 void Withdrawn(PokemonProxy pm, int ability) { switch (ability) { case As.REGENERATOR: if (pm.Hp != 0) { pm.Pokemon.Hp += pm.Pokemon.MaxHp / 3; } break; case As.NATURAL_CURE: if (pm.Hp != 0) { pm.Pokemon.State = PokemonState.Normal; } break; case As.UNNERVE: foreach (var p in pm.Controller.GetOnboardPokemons(1 - pm.Pokemon.TeamId)) { ITs.Attach(p); } break; case As.PRIMORDIAL_SEA: DeSpWeather(pm, ability, Ls.DeHeavyRain); break; case As.DESOLATE_LAND: DeSpWeather(pm, ability, Ls.DeHarshSunlight); break; case As.DELTA_STREAM: DeSpWeather(pm, ability, Ls.DeMysteriousAirCurrent); break; } }