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 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); }