Re: Card Development - talk about cards code here
Posted: 03 Apr 2023, 15:32
I tried to do Complicate and add it's clause "unless its controller pays |1." to counterspell_cycling() but I couldn't make the prompt to charge cost to appear. Below only the cards code, which works apart from this clause.
- Code: Select all
int counterspell_cycling(int player, int card, event_t event, int colorless, int black, int blue, int green, int red, int white);
int card_complicate(int player, int card, event_t event){
/* CARD_ID_COMPLICATE 6091 // remain in progress counters the card without clause "unless its controller pays |1."
Complicate |2|U
Instant
Counter target spell unless its controller pays |3.
Cycling |2|U (|2|U, Discard this card: Draw a card.)
When you cycle ~, you may counter target spell unless its controller pays |1. */
if( IS_ACTIVATING_FROM_HAND(event) ){
return counterspell_cycling(player, card, event, MANACOST_XU(2, 1));
}
if( ! IS_GS_EVENT(player, card, event) ){
return 0;
}
if( event == EVENT_RESOLVE_SPELL ){
counterspell_resolve_unless_pay_x(player, card, NULL, 0, 3);
kill_card(player, card, KILL_DESTROY);
}
return generic_spell(player, card, event, GS_COUNTERSPELL, NULL, NULL, 0, NULL);
}