mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
implement [MH3] Arena of Glory and usage of ManaSpentDelayedTriggeredAbility (#12404)
This commit is contained in:
parent
0cd2fda764
commit
3e18b58cac
6 changed files with 200 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public class ManaSpentDelayedTriggeredAbility extends DelayedTriggeredAbility {
|
|||
setTriggerPhrase("When you spend this mana to cast " + filter.getMessage() + ", ");
|
||||
}
|
||||
|
||||
private ManaSpentDelayedTriggeredAbility(final ManaSpentDelayedTriggeredAbility ability) {
|
||||
protected ManaSpentDelayedTriggeredAbility(final ManaSpentDelayedTriggeredAbility ability) {
|
||||
super(ability);
|
||||
this.filter = ability.filter;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ public class AddContinuousEffectToGame extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Effect effect : this.effects) {
|
||||
effect.setTargetPointer(this.getTargetPointer().copy());
|
||||
game.addEffect((ContinuousEffect) effect, source);
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue