internal void TryContinueGameLoop() { if (!InputController.NeedInput) { foreach (var t in Teams) { foreach (var p in t.Players) { if (p.GiveUp) { lose[t.Id] = true; break; } } } if (lose[0] || lose[1]) { SetGameEnd(); } else { ReportBuilder.TimeTick(); if (SingleSendOut != null) { SendOut(SingleSendOut); ReportBuilder.AddHorizontalLine(); SingleSendOut = null; } TurnController.StartGameLoop(); } } }
private void Mega() { var m = false; foreach (var p in ActingPokemons) { p.BeforeMegaSpeed = p.Speed; } foreach (var p in ActingPokemons) { if (p.Action == PokemonAction.MoveAttached && p.SelectMega) { if (p.Pokemon.Item == 0) { p.ShowLogPm(Ls.MegaPre384); } else { p.ShowLogPm("MegaPre", p.Pokemon.Item); } p.Pokemon.Mega = true; p.ChangeForm(ITs.MegaForm(p.Pokemon.Item), true, "Mega"); p.CalculatePriority(); p.BeforeMegaSpeed = p.Speed; //mega速度刷新只对自己有效 雨天下mega轻快会变快,正常天气mega降雨不会使轻快队友变快 m = true; } } if (m) { ReportBuilder.AddHorizontalLine(); ActingPokemons.Sort(MegaComparer); } }
private void Mega() { var m = false; foreach (var p in ActingPokemons) { if (p.Action == PokemonAction.MoveAttached && p.SelectMega) { if (p.Pokemon.Item == 0) { p.ShowLogPm(Ls.MegaPre384); } else { p.ShowLogPm("MegaPre", p.Pokemon.Item); } p.Pokemon.Mega = true; p.ChangeForm(ITs.MegaForm(p.Pokemon.Item), true, "Mega"); m = true; } } if (m) { ReportBuilder.AddHorizontalLine(); } }
private void EndTurnEffects() { if (Controller.TurnNumber != 0) { SortTiles(); EndTurn.Execute(Controller); ReportBuilder.AddHorizontalLine(); } }
private void Switch() { LOOP: foreach (var p in ActingPokemons) { if (p.Action == PokemonAction.WillSwitch) { p.Switch(); ReportBuilder.AddHorizontalLine(); goto LOOP; //ActingPokemons的顺序可能变化,重新查找第一个符合条件的精灵 } } }
private void Move() { LOOP: var pm = Board.GetCondition <PokemonProxy>(Cs.NextActingPokemon); if (pm == null || !pm.CanMove) { pm = null; foreach (var p in ActingPokemons) { if (p.CanMove && !p.OnboardPokemon.HasCondition(Cs.Quash)) { pm = p; break; } } } if (pm == null) { foreach (var p in ActingPokemons) { if (p.CanMove) { pm = p; break; } } } if (pm != null) { if (pm.OnboardPokemon.HasCondition(Cs.SkyDrop)) { pm.Action = PokemonAction.Done; } else { pm.Move(); if (Controller.CanContinue) { ReportBuilder.AddHorizontalLine(); } else { return; } } goto LOOP; } }