public static bool has_exhausted_allies(EventArgs args, Card me) { GameArgs the_args = (GameArgs)args; LOTRPlayer the_player = the_args.relevant_player; foreach (var card in the_player.get_allies()) { if (card.is_exhausted()) //TODO: or engaged with another player { return(true); } } return(false); }
public static bool i_am_played(EventArgs args, Card me) { GameArgs the_args = (GameArgs)args; if (me != null) { //Debug.Log("CHECKING FOR ME " + me.get_name()); } LOTRPlayer the_player = the_args.relevant_player; List <LOTRHero> heroes = the_player.get_heroes(); List <PlayerCard> allies = the_player.get_allies(); foreach (var hero in heroes) { //Debug.Log("IS " + hero.get_name() + hero.get_uuid() + " ME " + me.get_name() + me.get_uuid()); if (hero == me) { return(true); } if (((PlayerCard)me).is_attachment()) { AttachmentCard attachment_me = (AttachmentCard)me; if (hero.has_attachment(attachment_me)) { return(true); } } } foreach (var ally in allies) { //Debug.Log("IS " + ally.get_name() + ally.get_uuid() + " ME " + me.get_name()+ me.get_uuid()); if (ally == me) { return(true); } if (((PlayerCard)me).is_attachment()) { AttachmentCard attachment_me = (AttachmentCard)me; if (ally.has_attachment(attachment_me)) { return(true); } } } return(false); }
public static bool has_at_least_one_character_committed(EventArgs args, Card me) { GameArgs the_args = (GameArgs)args; LOTRPlayer the_player = the_args.relevant_player; foreach (var card in the_player.get_heroes()) { if (card.is_committed()) //TODO: or engaged with another player { return(true); } } foreach (var card in the_player.get_allies()) { if (card.is_committed()) //TODO: or engaged with another player { return(true); } } return(false); }