Deadbox
The special card named "Deadbox" takes care of counting the number of permanents that goes in the graveyards from play each turn. It also store their owners, types and IDs.
For cards like Caller of the Claw or Second Sunrise, you need to enable the Deadbox. You could do that putting "14" in the "cc[2]" field in the Magic.exe part of the card editor.
For coding purposes, these are the main functions that you'll need
int get_dead_count(int player, int mode)
This returns a specific count of permanents gone in a specific player's graveyard this turn.
The "mode" value determines the type of count :
mode = 0 --> Creatures that went in player's graveyard from play this turn
mode = 1 --> Non-token creatures that went in player's graveyard from play this turn
mode = 2 --> Artifacts that went in player's graveyard from play this turn
mode = 3 --> Non-token artifacts that went in player's graveyard from play this turn
mode = 4 --> Enchantments that went in player's graveyard from play this turn
mode = 5 --> Non-token enchantments that went in player's graveyard from play this turn
mode = 6 --> Lands that went in player's graveyard from play this turn
mode = 7 --> Non-token lands that went in player's graveyard from play this turn
mode = 8 --> Global count of all non-token permanents that that went in player's graveyard from play this turn
void reanimate_all_dead_this_turn(int player, int selected_type)
This functions will return to play all the permanents of a specific player that went in his graveyard from play this turn.
The "selected_type" value is the type of permanent : TYPE_CREATURE, TYPE_ARTIFACT, TYPE_ENCHANTMENT and TYPE_LAND.
void return_all_dead_this_turn_to_hand(int player, int selected_type)
This functions will return to a player's hand all his permanents that went in his graveyard from play this turn.
The "selected_type" value work exactly as the previous function.
