Making them invisible also makes them unclickable when they trigger - especially confusing when you run out of visible triggering cards to click on, if there were any in the first place - and pops up confusing "Opponent is processing: some effect card you can't see except in this dialog" dialogs.
Still can't get
Abyssal Gatekeeper to go crazy. His trigger doesn't actually fire, though, since TRIGGER_GRAVEYARD_FROM_PLAY is only sent after the card's fully left play.
If you delay creating the effects until they're actually going to trigger, though, you can eliminate all the boilerplate on the code side
and get a good playing interface - the effect cards will only be visible if there's more than one triggering at a time and so the player actually needs to see them (to choose the resolution order).
Shared support code:
- Code: Select all
static int effect_this_dies(int player, int card, event_t event){
card_instance_t* instance = get_card_instance(player, card);
if (trigger_condition == TRIGGER_GRAVEYARD_FROM_PLAY && player == reason_for_trigger_controller
&& affect_me(player, card) && instance->targets[11].card != -1){
if (event == EVENT_TRIGGER){
event_result |= instance->targets[11].player;
} else if (event == EVENT_RESOLVE_TRIGGER){
typedef int (*CardFunction)(int, int, event_t);
CardFunction fn = (CardFunction)instance->targets[11].card;
instance->targets[11].card = -1; // prevent reentrance
fn(player, card, EVENT_RESOLVE_THIS_DIES_TRIGGER); // new event
kill_card(player, card, KILL_REMOVE);
}
}
return 0;
}
int this_dies_trigger(int player, int card, event_t event, resolve_trigger_t trigger_mode){
card_instance_t* instance = get_card_instance(player, card);
if (event == EVENT_GRAVEYARD_FROM_PLAY && affect_me(player, card) && instance->kill_code != KILL_REMOVE){
int legacy = create_legacy_effect(player, card, effect_this_dies);
card_instance_t* leg = get_card_instance(player, legacy);
leg->targets[11].player = trigger_mode;
leg->targets[11].card = cards_data[instance->internal_card_id].code_pointer;
}
return event == EVENT_RESOLVE_THIS_DIES_TRIGGER;
}
and
Abyssal Gatekeeper itself reduces to:
- Code: Select all
int card_abyssal_gatekeeper(int player, int card, event_t event){
if (this_dies_trigger(player, card, event, RESOLVE_TRIGGER_MANDATORY)){
impose_sacrifice(player, card, player, 1, TYPE_CREATURE, 0, 0, 0, 0, 0, 0, 0, -1, 0);
impose_sacrifice(player, card, 1-player, 1, TYPE_CREATURE, 0, 0, 0, 0, 0, 0, 0, -1, 0);
}
return 0;
}