public void hero_resource_paid(LOTRPlayer player, LOTRHero hero) { //todo: put in check that player owns hero //TODO: check for neutral, cost of zero if (card_played != null) { if ((card_played.get_resource_type() == hero.get_resource_type()) || (card_played.get_resource_type() == SPHERE_OF_INFLUENCE.NEUTRAL)) { hero.pay_resource(); resources_paid += 1; } if (resources_paid == card_played.get_cost()) { if (card_played.is_attachment()) { Debug.Log("ATTACGHMENT PLAYED"); cur_state = GAMESTATE.CHOOSING_CHARACTER_TO_ATTACH_ATTACHMENT; } else { Debug.Log("CARD PLAYED"); card_has_been_played(player); } } } }
public void initialize_game() { this.game_event_handler = new LOTRGameEventHandler(this); response_is_yes_no = false; waiting_for_player_response = false; EnemyCardResponses.set_game(this); PlayerCardResponses.set_game(this); CardEnablers.set_game(this); cur_player = null; cur_location = null; players = new List <LOTRPlayer>(); staged_cards = new List <EnemyCard>(); encounter_discard_pile = new List <EnemyCard>(); enemy_deck = EnemyCard.PASSAGE_THROUGH_MIRWOOD_ENEMIES(); //Utils.Shuffle(enemy_deck); for (var i = 0; i < num_players; i++) { players.Add(new LOTRPlayer()); } players[0].add_hero(LOTRHero.ARAGORN()); players[0].add_hero(LOTRHero.GLOIN()); players[0].add_hero(LOTRHero.THEODRED()); player_done_engaging = new Dictionary <LOTRPlayer, bool>(); allowing_actions = false; forced_response_after_action = false; times_to_respond = 1; card_to_respond_to = null; times_responded = 0; num_options_to_display = -1; begin_game(); }
public void hero_chosen_to_take_undefended_damage(LOTRPlayer player, LOTRHero hero) { Action callback = () => { cur_player.enemy_attack_resolved(attacking_enemy); resolve_enemy_attacks(); }; card_takes_damage(hero, damage_to_be_dealt, callback); }
public static void aragorn(EventArgs args) { GameArgs game_args = (GameArgs)args; Card card_to_respond_to = game_args.relevant_card; Card character_committed = game_args.relevant_card; LOTRHero aragorn = (LOTRHero)character_committed; Action aragorns_action = () => { aragorn.pay_resource(); aragorn.unexhaust(); }; game.wait_for_response(card_to_respond_to: card_to_respond_to, if_yes: aragorns_action, response_is_yes_no: true, what_to_do_after_responding: game_args.what_to_do_after_event_or_if_no_response); }
public static void gloin(EventArgs args) { GameArgs game_args = (GameArgs)args; Card card_to_respond_to = game_args.relevant_card; Card character_damaged = game_args.relevant_card; int? amt_damaged = game_args.relevant_int; LOTRHero gloin = (LOTRHero)character_damaged; Action gloins_action = () => { gloin.add_resource_token(amt_damaged.Value); }; game.wait_for_response(card_to_respond_to: card_to_respond_to, if_yes: gloins_action, response_is_yes_no: true, what_to_do_after_responding: game_args.what_to_do_after_event_or_if_no_response); }
public static LOTRHero ARAGORN() { LOTRHero the_hero = new LOTRHero("Aragorn", LOTRGame.SPHERE_OF_INFLUENCE.LEADERSHIP, new List <LOTRGame.TRAITS>() { LOTRGame.TRAITS.DUNEDAIN, LOTRGame.TRAITS.NOBLE, LOTRGame.TRAITS.RANGER }, threat: 12, willpower: 200, attack: 3, defense: 2, hp: 5, ability: "sentinel. response after he commits to a quest, spend 1 resource from his resource poool to ready him", set: "??"); the_hero.respond_to_event(GameEvent.CARD_COMMITTED_KEY, PlayerCardResponses.action_maker(new List <Func <EventArgs, Card, bool> >() { CardEnablers.card_is_me }, PlayerCardResponses.aragorn, the_hero)); the_hero.respond_to_event(GameEvent.SHADOW_CARD_DEALT, PlayerCardResponses.action_maker(new List <Func <EventArgs, Card, bool> >() { }, PlayerCardResponses.shadow_card_test, the_hero, fires_on_other_cards: true)); return(the_hero); }
public static LOTRHero THEODRED() { LOTRHero the_hero = new LOTRHero("Theodred", LOTRGame.SPHERE_OF_INFLUENCE.LEADERSHIP, new List <LOTRGame.TRAITS>() { LOTRGame.TRAITS.NOBLE, LOTRGame.TRAITS.ROHAN, LOTRGame.TRAITS.WARRIOR }, threat: 8, willpower: 1, attack: 2, defense: 1, hp: 4, ability: "Response: After Théodred commits to a quest, choose a hero committed to that quest. Add 1 resource to that hero's resource pool.", set: "??"); the_hero.respond_to_event(GameEvent.CARD_COMMITTED_KEY, PlayerCardResponses.action_maker(new List <Func <EventArgs, Card, bool> >() { CardEnablers.card_is_me }, PlayerCardResponses.theodred, the_hero, valid_targets: CardEnablers.valid_targets_player_heroes)); the_hero.respond_to_event(GameEvent.SHADOW_CARD_DEALT, PlayerCardResponses.action_maker(new List <Func <EventArgs, Card, bool> >() { }, PlayerCardResponses.shadow_card_test, the_hero, fires_on_other_cards: true)); return(the_hero); }
public static LOTRHero GLOIN() { LOTRHero the_hero = new LOTRHero("Gloin", LOTRGame.SPHERE_OF_INFLUENCE.LEADERSHIP, new List <LOTRGame.TRAITS>() { LOTRGame.TRAITS.DWARF, LOTRGame.TRAITS.NOBLE }, threat: 9, willpower: 2, attack: 2, defense: 1, hp: 4, ability: "Response: After Glóin suffers damage, add 1 resource to his resource pool for each point of damage he just suffered.", set: "??"); the_hero.respond_to_event(GameEvent.CHARACTER_TOOK_DAMAGE, PlayerCardResponses.action_maker(new List <Func <EventArgs, Card, bool> >() { CardEnablers.card_is_me }, PlayerCardResponses.gloin, the_hero)); the_hero.respond_to_event(GameEvent.SHADOW_CARD_DEALT, PlayerCardResponses.action_maker(new List <Func <EventArgs, Card, bool> >() { }, PlayerCardResponses.shadow_card_test, the_hero, fires_on_other_cards: true)); return(the_hero); }
public void add_hero(LOTRHero hero) { heroes.Add(hero); hero.enters_the_game(); this.threat += hero.get_threat_level(); }