Log in

Reserved fields in the targets array

In order to code previously unsupported abilities, the field "player" and "card" from the "targets[]" array are currently used, so if you're coding a new card, please avoid use values > 10 (Example : does not use "targets[13].player" to store your data). This is especially true for Creatures.
Here's a list of the currently used values :
targets[18].player = number of +1/+1 counters
targets[18].card = number of -1/-1 counters
targets[17].card = used by Pithing Needle, humility and to determine if a card was "played for free".
targets[16].player = used by the function dealt_damage_to_player.
targets[16].card = used to store non-standard abilities for creatures.
Currently used values are :
64 -> Wither
128 -> Lifelink
256 -> Flanking
512 -> Deathtouch
1024 -> Indestructible
2048 -> Used by the AI to determine if a creature is worth sacrificing.
4096 -> Inquisitor's Flail damage ability (doubles combat damage done and received)
targets[15].player = used by the cards that remove all other Subtypes and set a new Subtype (like Rise from the Grave).
targets[15].card = used by the cards that add a new Subtypes to a permanent (like Captivating Vampire).
targets[14].player = special infos, used by tokens or other creatures used for some tokens (Mitotic Slime). Check "tokens.c".
targets[14].card = special values checked by Planeswalkers in order to not lose counters if an effect prevent all combat damage dealt by a specific creature (use for the new code of Maze of Ith, for example).
targets[13].player = number of Auras enchanting the permanents. Used only by some creatures, needs the "check_for_auras_enchanting_me" or the "is_enchanted_legacy" function in order to work.
targets[12].card = used by "Face-down Creature", contains its "face-up" ID. If the ID is more than the actually available slots, then it's a creature played face-down by Illusionary Mask.
targets[11].player = used by the function count_graveyard_from_play, return 1 if a certain card is gone from play to graveyard.
targets[11].card = used by the function count_graveyard_from_play, return how many specific cards went from play to graveyard.