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); }
private void OnPlayersUpdated(SyncListPlayer.Operation op, int index, PlayerViewStatus oldValue, PlayerViewStatus newValue) { if (op != SyncListPlayer.Operation.OP_SET) { return; } GameController.Instance.SetPlayerView(index, newValue); }
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); }
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); }
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); }
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); }
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); }
public void SetStatus(PlayerViewStatus status) { SetStealable(status.targetable, status.hand, status.weapon); SetDroppable(status.droppable); SetTargetable(status.droppable || status.targetable); }
public void StopTargeting(int player) { PlayerViewStatus[] players = new PlayerViewStatus[playerViews.Length]; SetPlayersStatus(player, players); playerControllers[player].Actions.Thrash = false; }
public void TargetSelf(int player) { PlayerViewStatus[] players = new PlayerViewStatus[playerViews.Length]; players[player].droppable = true; SetPlayersStatus(player, players); }
public void SetPlayerView(int index, PlayerViewStatus playerView) { playerControllers[index].PlayerView.SetStatus(playerView); }