It is currently 24 Apr 2024, 14:37
   
Text Size

Nether Shadow & friends

Discuss Upcoming Releases, Coding New Cards, Etc.
PLEASE DO NOT REPORT BUGS HERE!

Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins

Nether Shadow & friends

Postby Gargaroz » 27 Dec 2009, 18:18

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;
}
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
Gargaroz
Programmer
 
Posts: 7097
Joined: 06 Nov 2009, 11:11
Has thanked: 82 times
Been thanked: 595 times

Return to Development

Who is online

Users browsing this forum: No registered users and 8 guests


Who is online

In total there are 8 users online :: 0 registered, 0 hidden and 8 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 8 guests

Login Form