public static void necromancers_pass(EventArgs args) { GameArgs game_args = (GameArgs)args; Action the_action = () => { LOTRPlayer the_player = game_args.relevant_player; Random rnd = new Random(); the_player.discard_card_at_index(rnd.Next(the_player.get_cards_in_hand().Count)); the_player.discard_card_at_index(rnd.Next(the_player.get_cards_in_hand().Count)); }; game.execute_action(the_action); game_args.what_to_do_after_event_or_if_no_response(); }
public static LocationCard NECROMANCERS_PASS() { LocationCard the_card = new LocationCard("Necromancer's Pass", 3, 2, "Travel: The first player must discard 2 cards from his hand at random to travel here." , "ORC", new List <LOTRGame.TRAITS>() { LOTRGame.TRAITS.STRONGHOLD, LOTRGame.TRAITS.DOL_GULDUR }, "??"); Func <GameArgs, bool> criteria = (GameArgs args) => { LOTRPlayer first_player = args.relevant_player; return(first_player.get_cards_in_hand().Count >= 2); }; the_card.set_travel_criteria(criteria); List <Func <EventArgs, Card, bool> > card_played_criteria = new List <Func <EventArgs, Card, bool> >() { CardEnablers.card_is_me }; the_card.respond_to_event(GameEvent.LOCATION_TRAVELED, PlayerCardResponses.action_maker(card_played_criteria, EnemyCardResponses.necromancers_pass, the_card)); return(the_card); }
public static bool i_am_in_hand(EventArgs args, Card me) { GameArgs the_args = (GameArgs)args; LOTRPlayer the_player = the_args.relevant_player; foreach (var card in the_player.get_cards_in_hand()) { if (card == me) //TODO: or engaged with another player { return(true); } } return(false); }