mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
- Fixed Imminent Doom.
This commit is contained in:
parent
45d03370ec
commit
525652d41e
1 changed files with 11 additions and 7 deletions
|
@ -28,6 +28,7 @@
|
||||||
package mage.cards.i;
|
package mage.cards.i;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
import mage.abilities.common.EntersBattlefieldAbility;
|
import mage.abilities.common.EntersBattlefieldAbility;
|
||||||
|
@ -84,8 +85,8 @@ class ImminentDoomTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
super(Zone.BATTLEFIELD, new ImminentDoomEffect());
|
super(Zone.BATTLEFIELD, new ImminentDoomEffect());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImminentDoomTriggeredAbility(final ImminentDoomTriggeredAbility abiltity) {
|
public ImminentDoomTriggeredAbility(final ImminentDoomTriggeredAbility ability) {
|
||||||
super(abiltity);
|
super(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -103,10 +104,13 @@ class ImminentDoomTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
if (event.getPlayerId().equals(this.getControllerId())) {
|
if (event.getPlayerId().equals(this.getControllerId())) {
|
||||||
Permanent imminentDoom = game.getPermanent(getSourceId());
|
Permanent imminentDoom = game.getPermanent(getSourceId());
|
||||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||||
return (spell != null
|
if (spell != null
|
||||||
&& imminentDoom != null
|
&& imminentDoom != null
|
||||||
&& spell.getConvertedManaCost() == imminentDoom.getCounters(game).getCount(CounterType.DOOM));
|
&& spell.getConvertedManaCost() == imminentDoom.getCounters(game).getCount(CounterType.DOOM)) {
|
||||||
}
|
game.getState().setValue("ImminentDoomCount", imminentDoom.getCounters(game).getCount(CounterType.DOOM)); // store its current value
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,10 +139,10 @@ class ImminentDoomEffect extends OneShotEffect {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent imminentDoom = game.getPermanent(source.getSourceId());
|
Permanent imminentDoom = game.getPermanent(source.getSourceId());
|
||||||
if (imminentDoom != null) {
|
if (imminentDoom != null) {
|
||||||
int count = imminentDoom.getCounters(game).getCount(CounterType.DOOM);
|
Effect effect = new DamageTargetEffect((int) game.getState().getValue("ImminentDoomCount"));
|
||||||
Effect effect = new DamageTargetEffect(count);
|
|
||||||
effect.apply(game, source);
|
effect.apply(game, source);
|
||||||
imminentDoom.addCounters(CounterType.DOOM.createInstance(), source, game);
|
imminentDoom.addCounters(CounterType.DOOM.createInstance(), source, game);
|
||||||
|
game.getState().setValue("ImminentDoomCount", 0); // reset to 0 to avoid any silliness
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue