.Amulet of Vigor already works properly; there's just no opportunity to respond.
Part of the problem is that the lands are bouncing the land as part of resolution instead of as a trigger, so the amulet never even gets a chance to untap them.
- This comes closer | Open
- Code: Select all
static int karoo(int player, int card, event_t event, int color1, int color2, int ai_card){
card_instance_t *instance = get_card_instance(player, card);
if(player == AI ){
int id = get_internal_card_id_from_csv_id(ai_card);
instance->internal_card_id = id;
return 0;
}
comes_into_play_tapped(player, card, event);
if (comes_into_play(player, card, event)){
target_definition_t td;
base_target_definition(player, card, &td, TYPE_LAND);
td.allowed_controller = player;
td.preferred_controller = player;
td.allow_cancel = 0;
select_target(player, card, &td, "Choose a land to bounce", NULL);
bounce_permanent(instance->targets[0].player, instance->targets[0].card);
}
return two_mana_land(player, card, event, color1, color2);
}
That still doesn't allow a response, though.
Maybe hack a chance to respond into Amulet of Vigor's EVENT_RESOLVE_TRIGGER handler. 0x436A20 is the function that gives players a chance to respond; the trick is to always stop even if the player doesn't have an instant to cast. Last time I was experimenting with this, the version I had closest to working was
- Code: Select all
int card_turntimber_ranger(int player, int card, event_t event)
{
if (ally_trigger(player, card, event))
{
int choice = do_dialog(player, player, card, -1, -1,
" Make a wolf\n Don't make a wolf", 0);
if (choice == 0)
{
put_card_or_activation_onto_stack(player, card,
EVENT_RESOLVE_ACTIVATION,
player, 0);
//TENTATIVE_raw_put_card_on_stack(not_a_mana_source)
EXE_FN(int, 0x436450, int)(1);
if (ai_is_speculating != 1)
EXE_FN(void, 0x436700, void)(); //set_stack_damage_targets()
//allow_response()
EXE_FN(int, 0x436a20, int, int, const char*, int)(-player-1, current_phase, "Resolving trigger", EVENT_ACTIVATE);
EXE_FN(void, 0x436740, void)(); //resolve_top_card_on_stack()
}
}
if (event == EVENT_RESOLVE_ACTIVATION)
{
card_instance_t* instance = get_card_instance(player, card);
add_1_1_counter(instance->parent_controller, instance->parent_card);
generate_token_by_id(player, CARD_ID_WOLF);
}
return 0;
}
There's an outline of how some of those functions work (at least as well as is known) in the comments inside event_activate_then_duplicate_into_stack() in functions/events.c.