DONE - Elvish Healer target opponent issue
Posted: 12 Nov 2020, 15:35
I have made Elvish Healer but not using the usual Manalink method to target the damage_card but went for the prevention shield way. The issue happens only if you target opponent. The prevention shield effect doesn't go to opponent's field like it does with other cards like Hold at Bay (shows as not owned by that player) doesn't have the point of damage on it, doesn't prevent damage and produces a rukh token at eot.
See this post for reason for and against prevention shield:
viewtopic.php?f=86&t=16985&p=194613&hilit=prevention+shield#p194626
I don't know if it is possible but if we could make prevention shield to work both ways like the regeneration shield does it would be the best solution. Although I fear that Korath didn't implement the function to use both ways because it is not possible. For me if it comes to choose one way although I like the manalink way, it produces more bugs than the shield one does, so I go for shield.
See this post for reason for and against prevention shield:
viewtopic.php?f=86&t=16985&p=194613&hilit=prevention+shield#p194626
I don't know if it is possible but if we could make prevention shield to work both ways like the regeneration shield does it would be the best solution. Although I fear that Korath didn't implement the function to use both ways because it is not possible. For me if it comes to choose one way although I like the manalink way, it produces more bugs than the shield one does, so I go for shield.
- Code: Select all
int card_elvish_healer(int player, int card, event_t event){
/* CARD_ID_ELVISH_HEALER 1912
Elvish Healer |2|W
Creature - Elf Cleric 1/2
|T: Prevent the next 1 damage that would be dealt to any target this turn. If it's a |Sgreen creature, prevent the next 2 damage instead.*/
if( ! IS_GAA_EVENT(event) ){
return 0;
}
target_definition_t td;
default_target_definition(player, card, &td, TYPE_CREATURE|TARGET_TYPE_PLANESWALKER);
td.preferred_controller = player;
td.zone = TARGET_ZONE_CREATURE_OR_PLAYER;
if (event == EVENT_CAN_ACTIVATE){
int gaa_pre = generic_activated_ability(player, card, event, GAA_CAN_TARGET | GAA_UNTAPPED, MANACOST0, 0, &td, NULL);
return ! gaa_pre ? 0 : (land_can_be_played & LCBP_DAMAGE_PREVENTION) ? 99 : 1; // so that it can work as a prevention shield and at manalink time.
}
if( event == EVENT_ACTIVATE ){
card_instance_t* instance = get_card_instance(player, card);
instance->number_of_targets = 0;
generic_activated_ability(player, card, event, GAA_CAN_TARGET | GAA_LITERAL_PROMPT | GAA_UNTAPPED, MANACOST0, 0,
&td, "Select any target to prevent next 1 damage or 2 for a green creature.");
}
if( event == EVENT_RESOLVE_ACTIVATION ){
if( valid_target(&td) ){
card_instance_t* instance = get_card_instance(player, card);
int targ_p = instance->targets[0].player;
int targ_c = instance->targets[0].card;
if( instance->targets[0].card >= 0 && (get_color(targ_p, targ_c) & get_sleighted_color_test(targ_p, targ_c, COLOR_TEST_GREEN)) ){
prevent_the_next_n_damage(player, card, targ_p, targ_c, 2, 0, 0, 0);
}
else{
prevent_the_next_n_damage(player, card, targ_p, targ_c, 1, 0, 0, 0);
}
}
}
return 0;
}