示例#1
0
        public void TargetSelfProperty <T>(int player) where T : Property, new()
        {
            PlayerController pc = playerControllers[player];

            PlayerViewStatus[] players = new PlayerViewStatus[playerViews.Length];
            players[player].droppable = !pc.HasProperty <T>();
            SetPlayersStatus(player, players);
        }
示例#2
0
 private void OnPlayersUpdated(SyncListPlayer.Operation op, int index, PlayerViewStatus oldValue, PlayerViewStatus newValue)
 {
     if (op != SyncListPlayer.Operation.OP_SET)
     {
         return;
     }
     GameController.Instance.SetPlayerView(index, newValue);
 }
示例#3
0
        public void TargetOthers(int player, Card c)
        {
            PlayerViewStatus[] players = new PlayerViewStatus[playerViews.Length];
            PlayerController   pc;

            for (int i = 0; i < playerControllers.Length; i++)
            {
                pc = playerControllers[i];
                PlayerViewStatus status = new PlayerViewStatus()
                {
                    droppable = pc.PlayerNumber != player && !pc.IsDead && !pc.Immune(c)
                };
                players[i] = status;
            }
            SetPlayersStatus(player, players);
        }
示例#4
0
        public void TargetPlayersRange(int player, int range, Card c)
        {
            PlayerViewStatus[] players        = new PlayerViewStatus[playerViews.Length];
            List <int>         playersInRange = PlayersInRange(player, range, false);
            PlayerController   pc;

            foreach (int i in playersInRange)
            {
                pc = playerControllers[i];
                PlayerViewStatus status = new PlayerViewStatus()
                {
                    droppable = !pc.IsDead && !pc.Immune(c)
                };
                players[i] = status;
            }
            SetPlayersStatus(player, players);
        }
示例#5
0
        public void TargetPrison(int player, Card c)
        {
            PlayerViewStatus[] players = new PlayerViewStatus[playerViews.Length];
            PlayerController   pc;
            bool droppable;

            for (int i = 0; i < playerControllers.Length; i++)
            {
                pc        = playerControllers[i];
                droppable = pc.PlayerNumber != player && pc.Role != Role.Sheriff && !pc.HasProperty <Jail>() && !pc.IsDead && !pc.Immune(c);
                PlayerViewStatus status = new PlayerViewStatus()
                {
                    droppable = droppable
                };
                players[i] = status;
            }
            SetPlayersStatus(player, players);
        }
示例#6
0
        public void TargetAllCards(int player, Card c)
        {
            PlayerViewStatus[] players = new PlayerViewStatus[playerViews.Length];
            PlayerController   pc;
            bool hand, weapon;

            for (int i = 0; i < playerControllers.Length; i++)
            {
                pc     = playerControllers[i];
                hand   = pc.HasCards;
                weapon = !pc.HasColt45;
                PlayerViewStatus status = new PlayerViewStatus()
                {
                    targetable = !pc.IsDead && !pc.Immune(c) && (hand || pc.HasProperties || weapon),
                    weapon     = weapon,
                    hand       = hand
                };
                players[i] = status;
            }
            SetPlayersStatus(player, players);
        }
示例#7
0
        public void TargetAllRangeCards(int player, int range, Card c)
        {
            PlayerViewStatus[] players        = new PlayerViewStatus[playerViews.Length];
            List <int>         playersInRange = PlayersInRange(player, range, true);
            PlayerController   pc;
            bool hand, weapon;

            foreach (int i in playersInRange)
            {
                pc     = playerControllers[i];
                hand   = pc.HasCards;
                weapon = !pc.HasColt45;
                PlayerViewStatus status = new PlayerViewStatus()
                {
                    targetable = !pc.IsDead && !pc.Immune(c) && (hand || pc.HasProperties || weapon),
                    weapon     = weapon,
                    hand       = hand
                };
                players[i] = status;
            }
            SetPlayersStatus(player, players);
        }
示例#8
0
 public void SetStatus(PlayerViewStatus status)
 {
     SetStealable(status.targetable, status.hand, status.weapon);
     SetDroppable(status.droppable);
     SetTargetable(status.droppable || status.targetable);
 }
示例#9
0
 public void StopTargeting(int player)
 {
     PlayerViewStatus[] players = new PlayerViewStatus[playerViews.Length];
     SetPlayersStatus(player, players);
     playerControllers[player].Actions.Thrash = false;
 }
示例#10
0
 public void TargetSelf(int player)
 {
     PlayerViewStatus[] players = new PlayerViewStatus[playerViews.Length];
     players[player].droppable = true;
     SetPlayersStatus(player, players);
 }
示例#11
0
 public void SetPlayerView(int index, PlayerViewStatus playerView)
 {
     playerControllers[index].PlayerView.SetStatus(playerView);
 }