mirror of
https://github.com/correl/mage.git
synced 2024-11-16 03:00:12 +00:00
DealtDamageToCreatureBySourceDies replaces per-card effect
This commit is contained in:
parent
35052f806d
commit
81de9eb5c8
2 changed files with 0 additions and 90 deletions
|
@ -74,51 +74,3 @@ public class PillarOfFlame extends CardImpl {
|
||||||
return new PillarOfFlame(this);
|
return new PillarOfFlame(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class PillarOfFlameEffect extends ReplacementEffectImpl {
|
|
||||||
|
|
||||||
public PillarOfFlameEffect() {
|
|
||||||
super(Duration.EndOfTurn, Outcome.Exile);
|
|
||||||
staticText = "If a creature dealt damage this way would die this turn, exile it instead";
|
|
||||||
}
|
|
||||||
|
|
||||||
public PillarOfFlameEffect(final PillarOfFlameEffect effect) {
|
|
||||||
super(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PillarOfFlameEffect copy() {
|
|
||||||
return new PillarOfFlameEffect(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
|
||||||
Permanent permanent = ((ZoneChangeEvent) event).getTarget();
|
|
||||||
if (controller != null && permanent != null) {
|
|
||||||
return controller.moveCards(permanent, Zone.BATTLEFIELD, Zone.EXILED, source, game);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
|
||||||
return event.getType() == EventType.ZONE_CHANGE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
|
||||||
if (((ZoneChangeEvent) event).isDiesEvent()) {
|
|
||||||
DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId());
|
|
||||||
if (watcher != null) {
|
|
||||||
return watcher.wasDamaged(event.getTargetId(), game);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -77,45 +77,3 @@ public class YamabushisStorm extends CardImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class YamabushisStormEffect extends ReplacementEffectImpl {
|
|
||||||
|
|
||||||
public YamabushisStormEffect() {
|
|
||||||
super(Duration.EndOfTurn, Outcome.Exile);
|
|
||||||
staticText = "If a creature dealt damage this way would die this turn, exile it instead";
|
|
||||||
}
|
|
||||||
|
|
||||||
public YamabushisStormEffect(final YamabushisStormEffect effect) {
|
|
||||||
super(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public YamabushisStormEffect copy() {
|
|
||||||
return new YamabushisStormEffect(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
|
||||||
Permanent permanent = ((ZoneChangeEvent) event).getTarget();
|
|
||||||
if (controller != null && permanent != null) {
|
|
||||||
return controller.moveCardToExileWithInfo(permanent, null, "", source.getSourceId(), game, Zone.BATTLEFIELD, true);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
|
||||||
return event.getType() == EventType.ZONE_CHANGE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
|
||||||
if (((ZoneChangeEvent) event).isDiesEvent()) {
|
|
||||||
DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId());
|
|
||||||
return watcher != null && watcher.wasDamaged(event.getTargetId(), game);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue