cards/
Describe the Bug:Temporary special abilities coded as bits in targets[16].card - unblockable, hexproof, deathtouch, etc. - aren't properly removed at end of turn. They don't run their code, so simple cases still work, but other things that look for the bit will still see it.
Example:
- Give yourself a Prodigal Sorcerer and the AI a Wall of Air.
- Cast Serpent's Gift on the Prodigal Sorcerer and let the turn end.
- Next turn (so it should have lost deathtouch), ping the Wall of Air. It just takes the 1 damage like it's supposed to.
- Next turn (or untap the sorcerer), cast Lifelink on the Prodigal Sorcerer and ping the Wall of Air. It gets killed by the residual deathtouch bit. (Since lifelink() calls damage_effects(), which checks for SP_KEYWORD_DEATHTOUCH.)
Which card did behave improperly ?Serpent's Gift in the example above.
Which update are you using?(date,name)Which type(Duel,Gauntlet,Sealed Deck)PoDMN on top of CirothUngol. Solo duel/testing.
I have not yet tested with the Prophecy of Dragon's Maze Nemesis.What exactly should be the correct behavior/interaction ?It should lose the bits.
Are any other cards possibly affected by this bug ?Lots.
Analysis:legacy_effect_pump_ability_until_eot() for one of these abilities always first calls special_abilities(), which sets the bit; then, if it's being called at end of turn, removes the bit and rfgs the effect card. What seems to be happening is that the rfg is generating an EVENT_GRAVEYARD_FROM_PLAY for the effect card, which adds the ability bit back on. This fixes it for me:
- Code: Select all
diff --git a/src/functions/functions.c b/src/functions/functions.c
index 2c90c15..5bb951e 100644
--- a/src/functions/functions.c
+++ b/src/functions/functions.c
@@ -1477,7 +1477,9 @@ int legacy_effect_pump_ability_until_eot(int player, int card, event_t event ){
}
// fake keywords
- if( instance->targets[1].card > 0 ){
+ if( instance->targets[1].card > 0
+ && !(event == EVENT_GRAVEYARD_FROM_PLAY
+ && affect_me(player, card))){
special_abilities(instance->targets[0].player, instance->targets[0].card, event, instance->targets[1].card);
}