Nether Shadow & friends

Just finished writing and testing a new code for Nether Shadow, it seems to work nicely :
And here's a Shadow's fried, Ashen Ghoul :
- Code: Select all
int card_nshadow(int player, int card, event_t event){
haste(player, card);
if( event == EVENT_GRAVEYARD_ABILITY_UPKEEP ){
int position = 0;
int *graveyard = graveyard_ptr[player];
int victims = 0;
int count = count_graveyard(player) - 1;
while( count > -1 ){
if( cards_data[ graveyard[count] ].id == 171 ){
position = count;
}
count--;
}
count = count_graveyard(player) - 1;
while( count > position ){
if( (cards_data[ graveyard[count] ].type & TYPE_CREATURE) ){
victims++;
}
count--;
}
if( victims >= 3){
int choice = do_dialog(player, player, card, -1, -1," Return Nether Shadow\n Do not return Nether Shadow\n", 0);
if( choice == 0 ){
put_into_play(player, card);
return -1;
}
}
return -2;
}
return 0;
}
And here's a Shadow's fried, Ashen Ghoul :
- Code: Select all
int card_ashen_ghoul(int player, int card, event_t event){
haste(player, card);
if( event == EVENT_GRAVEYARD_ABILITY_UPKEEP ){
int position = 0;
int *graveyard = graveyard_ptr[player];
int victims = 0;
int count = count_graveyard(player) - 1;
while( count > -1 ){
if( cards_data[ graveyard[count] ].id == 750 ){
position = count;
}
count--;
}
count = count_graveyard(player) - 1;
while( count > position ){
if( (cards_data[ graveyard[count] ].type & TYPE_CREATURE) ){
victims++;
}
count--;
}
if( victims >= 3){
int choice = do_dialog(player, player, card, -1, -1," Return Ashen Ghoul\n Do not return Ashen Ghoul\n", 0);
if( choice == 0 ){
charge_mana_multi(player, 0, 1, 0, 0, 0, 0);
if( spell_fizzled != 1){
put_into_play(player, card);
return -1;
}
}
}
return -2;
}
return 0;
}