示例#1
0
文件: Switch.cs 项目: gyyfifafans/PBO
        public bool SendOut(Tile tile, bool debut, string log)
        {
            Player p       = Controller.GetPlayer(tile);
            int    origin  = GameSettings.Mode.GetPokemonIndex(tile.X);
            int    sendout = tile.WillSendOutPokemonIndex;

            if (CanSendOut(tile) && CanSendOut(p.GetPokemon(sendout)))
            {
                var pm = SendOutImplement(tile);
                p.SwitchPokemon(origin, sendout);
                pm.ShowLogPm(log);
                pm.OnboardPokemon.AddTurnCondition(Cs.Switched);
                ATs.Trace(pm);
                if (debut)
                {
                    ATs.AttachUnnerve(Controller);
                    pm.Debut();
                    if (pm.Hp != 0)
                    {
                        ATs.AttachWeatherObserver(pm);
                    }
                    ATs.WeatherChanged(Controller);
                }
                return(true);
            }
            return(false);
        }
示例#2
0
文件: Turn.cs 项目: gyyfifafans/PBO
        private void EndTurnSendOut()
        {
            if (Controller.TurnNumber == 0)
            {
                Controller.GameStartSendOut(Board[0]);
                Controller.GameStartSendOut(Board[1]);
                RefreshPokemons();
            }
            else
            {
                foreach (Tile t in Tiles)
                {
                    if (t.WillSendOutPokemonIndex != Tile.NOPM_INDEX)
                    {
                        Controller.SendOut(t, false);
                    }
                }
            }
            SortTiles();
            ATs.AttachUnnerve(Controller);
            var debut = new List <PokemonProxy>();

            foreach (Tile t in Tiles)
            {
                if (t.Pokemon != null && t.Pokemon.Action == PokemonAction.Debuting)
                {
                    t.Pokemon.Debut();
                    if (t.Pokemon != null)
                    {
                        debut.Add(t.Pokemon);
                    }
                }
            }
            foreach (var p in debut)
            {
                ATs.AttachWeatherObserver(p);
            }
            ATs.WeatherChanged(Controller);
            if (ReportBuilder.TurnNumber != 0)
            {
                current -= 2;
            }
        }