Page 1 of 1

Nether Shadow & friends

PostPosted: 27 Dec 2009, 18:18
by Gargaroz
Just finished writing and testing a new code for Nether Shadow, it seems to work nicely :

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;
}
This code is far from be perfect, but it actually work in the way Nether Shafow is meant to be.

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;
}