[PIP] Implement Rad Counters mechanic (#12087)

This commit is contained in:
Susucre 2024-04-17 20:04:17 +02:00 committed by GitHub
parent 11373fd75d
commit 9d7bf27d38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 420 additions and 176 deletions

View file

@ -46,6 +46,7 @@ import mage.game.combat.CombatGroup;
import mage.game.command.*;
import mage.game.command.dungeons.UndercityDungeon;
import mage.game.command.emblems.EmblemOfCard;
import mage.game.command.emblems.RadiationEmblem;
import mage.game.command.emblems.TheRingEmblem;
import mage.game.events.*;
import mage.game.events.TableEvent.EventType;
@ -443,6 +444,11 @@ public abstract class GameImpl implements Game {
return designation;
}
}
for (Emblem emblem : state.getInherentEmblems()) {
if (emblem.getId().equals(objectId)) {
return emblem;
}
}
// can be an ability of a sacrificed Token trying to get it's source object
object = getLastKnownInformation(objectId, Zone.BATTLEFIELD);
}
@ -1366,6 +1372,14 @@ public abstract class GameImpl implements Game {
}
}
}
// Rad counter mechanic for every player
for (UUID playerId : state.getPlayerList(startingPlayerId)) {
// This is not a real emblem. Just a fake source for the
// inherent trigger ability related to Rad counters
// Faking a source just to display something on the stack ability.
state.addInherentEmblem(new RadiationEmblem(), playerId);
}
}
public void initGameDefaultWatchers() {