Re: How to make "target creature other than enchanted creatu
Posted: 25 Feb 2021, 17:04
I can't make the "target creature other than enchanted" for Kjeldoran Pride.
- Code: Select all
static const char* not_the_enchanted(int who_chooses, int player, int card, int targeting_player, int targeting_card)
{
if ( ) // what?
return NULL;
else
return "can't be this enchanted creature.";
}
int card_kjeldoran_pride(int player, int card, event_t event){
/* CARD_ID_KJELDORAN_PRIDE 2306
Kjeldoran Pride |1|W
Enchantment - Aura
Enchant creature
Enchanted creature gets +1/+2.
|2|U: Attach ~ to target creature other than enchanted creature. */
if( get_card_instance(player, card)->damage_target_player > -1 ){
card_instance_t *instance = get_card_instance(player, card);
target_definition_t td;
default_target_definition(player, card, &td, TYPE_CREATURE);
td.preferred_controller = player;
td.special = TARGET_SPECIAL_EXTRA_FUNCTION;
td.extra = (int32_t)not_the_enchanted;
//td.special = TARGET_SPECIAL_NOT_ME; // not working as the aura is targeting.
if( event == EVENT_CAN_ACTIVATE || event == EVENT_ACTIVATE ){
return generic_activated_ability(player, card, event, GAA_CAN_TARGET | GAA_LITERAL_PROMPT, MANACOST_XU(2, 1), 0,
&td, "Select another target creature to attach this.");
}
if( event == EVENT_RESOLVE_ACTIVATION ){
if( valid_target(&td) ){
attach_aura_to_target(player, instance->parent_card, event, instance->targets[0].player, instance->targets[0].card);
}
}
}
if (event == EVENT_CHECK_PUMP) // will only be sent to this card if it has flash, e.g. for Mageta's Boon
return vanilla_instant_pump(player, card, event, ANYBODY, player, 1, 2, 0, 0);
if( ! IS_AURA_EVENT(player, card, event) ){
return 0;
}
return generic_aura(player, card, event, player, 1, 2, 0, 0, 0, 0, 0);
}