//------------------ // affecting players //------------------ public bool CanHenchmanAttackTargetPlayer(BoardSpaceEnum henchmanSpace, PlayerManager target) { HenchmanCard henchman = board[henchmanSpace]; if (henchman != null) { if (!henchman.HasActedThisTurn()) { if (henchman.GetController() != target) { return(true); } else { Debug.Log("Henchman can't attack a player because the player is its controller..."); } } else { Debug.Log("Henchman can't attack a player because it already acted this turn..."); } } else { Debug.Log("Henchman can't attack a player because it doesn't exist..."); } return(false); }
/* * This method is called whenever the player clicks a henchman in play. It will cause the * RoTStateMachine to move to the AttackingWithHenchmanState as long as the henchman is * controlled by the active player and can still attack this turn. * * NOTE: Any behaviors related to clicking a henchman that has attacked or a henchman * controlled by the opponent should be implemented in this method. */ private void HandleHenchmanInPlaySelected(HenchmanCard henchman) { if (henchman.GetController() == rsm.GetActivePlayer()) { if (!henchman.HasActedThisTurn()) { rsm.SetAttackingHenchman(henchman); rsm.ChangeState <AttackingWithHenchmanState>(); } } }
public bool CanHenchmenFight(BoardSpaceEnum playerSpace, BoardSpaceEnum opponentSpace) { bool onOpposingSides = OnOpposingSides(playerSpace, opponentSpace); if ((board[playerSpace] != null) && (board[opponentSpace] != null) && onOpposingSides) { //if both spaces are occupied by henchman and they're on opposing sides of the board, they could be able to fight HenchmanCard playerHenchman = board[playerSpace]; HenchmanCard opponentHenchman = board[opponentSpace]; if (!playerHenchman.HasActedThisTurn()) { //if the henchman hasn't already acted this turn, the henchmen could fight if (playerHenchman.IsEllusive() || (!playerHenchman.IsEllusive() && !opponentHenchman.IsEllusive())) { //if the attacking henchman is ellusive or neither henchman is ellusive, they can fight return(true); } else { Debug.Log("Henchmen wouldn've been able to fight, except one was ellusive and the other wasn't..."); return(false); } } else { Debug.Log("The henchman at playerSpace already moved this turn..."); return(false); } } else { if (board[playerSpace] == null) { Debug.Log("playerSpace passed to TryHaveHenchmanFight() didn't have a henchman in it..."); } if (board[opponentSpace] == null) { Debug.Log("opponentSpace passed to TryHaveHenchmanFight() didn't have a henchman in it..."); } if (!onOpposingSides) { Debug.Log("The two henchman trying to fight in TryHaveHenchmanFight() weren't on opposite sides of the board..."); } return(false); } }