implement [MH3] Arena of Glory and usage of ManaSpentDelayedTriggeredAbility (#12404)

This commit is contained in:
Susucre 2024-06-07 18:34:45 +02:00 committed by GitHub
parent 0cd2fda764
commit 3e18b58cac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 200 additions and 3 deletions

View file

@ -103,9 +103,10 @@ public class MageObjectReference implements Comparable<MageObjectReference>, Ser
}
@Override
public String toString(){
return "("+zoneChangeCounter+"|"+sourceId.toString().substring(0,3)+")";
public String toString() {
return "(" + zoneChangeCounter + "|" + sourceId.toString().substring(0, 3) + ")";
}
public UUID getSourceId() {
return sourceId;
}
@ -185,6 +186,14 @@ public class MageObjectReference implements Comparable<MageObjectReference>, Ser
return null;
}
public Spell getSpell(Game game) {
Spell spell = game.getSpell(sourceId);
if (spell != null && spell.getZoneChangeCounter(game) == zoneChangeCounter) {
return spell;
}
return null;
}
public boolean zoneCounterIsCurrent(Game game) {
return game.getState().getZoneChangeCounter(sourceId) == zoneChangeCounter;
}