Ejemplo n.º 1
0
    private void card_has_been_played(LOTRPlayer player)
    {
        player.play_card(card_played);
        //game_event_handler.register_cards(new List<PlayerCard>() {card_played});
        Debug.Log("CARD HAS BEEN PLAYED#(O$I()*%$U*(GJ$IOG");
        if (cur_phase == GAMEPHASE.PLANNING)
        {
            game_event_handler.fire_game_event(GameEvent.CARD_PLAYED_KEY, new GameArgs(c: card_played, a: () =>
            {
                Debug.Log("OK WHY");
                cur_state   = GAMESTATE.PLAYING_CARDS;
                card_played = null;
                allow_actions_to_be_played();
            }, p: get_cur_player(), game: this));
        }
        else //playing actions not in planning phase
        {
            Debug.Log(cur_state);
            // cur_state = GAMESTATE.WAITING_FOR_PLAYER_TO_DECIDE_IF_HE_WANTS_TO_USE_ACTIONS;
            game_event_handler.fire_game_event(GameEvent.CARD_PLAYED_KEY, new GameArgs(c: card_played, a: () =>
            {
                Debug.Log("Firing this game event CARD PLAYED CALLBACK");
                card_played = null;
                if (forced_response_after_action)
                {
                    done_responding();
                }

                cur_state = state_before_actions;
                //allow_actions_to_be_played();
            }, p: get_cur_player(), game: this));
        }
    }
Ejemplo n.º 2
0
    public static void sneak_attack(EventArgs args)
    {
        GameArgs      game_args          = (GameArgs)args;
        Card          card_to_respond_to = game_args.relevant_card;
        PlayerCard    the_card           = (PlayerCard)game_args.relevant_card;
        LOTRPlayer    the_player         = game_args.relevant_player;
        Action <Card> the_action         = (ally_chosen) =>
        {
            //put ally card in play. flag it with the phase.
            PlayerCard chosen_card = (PlayerCard)ally_chosen;
            chosen_card.add_flag(LOTRAbility.ABILITY_FLAGS.SNEAK_ATTACK);
            the_player.play_card(chosen_card);
        };

        game.wait_for_forced_response(card_to_respond_to: card_to_respond_to,
                                      after_responding_with_card: the_action, what_to_do_after_responding: game_args.what_to_do_after_event_or_if_no_response);
    }