mirror of
https://github.com/correl/mage.git
synced 2024-11-29 03:00:12 +00:00
Fix handling of damage to permanents (WIP) (#7592)
* initial refactor of damage events * cleaned up some instances of classes that need to be removed * removed old damage event classes * removed outdated imports * temporarily refactor Everlasting Torment (this will need to be changed more) * updated damage handling to use new changes * some reworking of lethal/excess damage plus a test * updated damage marking to handle planeswalkers * updated implementation of Phyrexian Unlife * updated implementation of Everlasting Torment * added some more excess damage tests * small change to wither check
This commit is contained in:
parent
39f6b69391
commit
5390963d38
201 changed files with 1132 additions and 1187 deletions
|
@ -56,12 +56,7 @@ class AegarTheFreezingFlameTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
switch (event.getType()) {
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
case DAMAGED_CREATURE:
|
|
||||||
case DAMAGED_PLANESWALKER:
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -98,11 +93,7 @@ class AegarTheFreezingFlameWatcher extends Watcher {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void watch(GameEvent event, Game game) {
|
public void watch(GameEvent event, Game game) {
|
||||||
switch (event.getType()) {
|
if (event.getType() != GameEvent.EventType.DAMAGED_PERMANENT) {
|
||||||
case DAMAGED_CREATURE:
|
|
||||||
case DAMAGED_PLANESWALKER:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DamagedEvent dEvent = (DamagedEvent) event;
|
DamagedEvent dEvent = (DamagedEvent) event;
|
||||||
|
|
|
@ -83,8 +83,7 @@ class AngelOfDeliveranceDealsDamageTriggeredAbility extends TriggeredAbilityImpl
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_CREATURE
|
|| event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -64,8 +64,7 @@ class AngrathsMaraudersEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType().equals(EventType.DAMAGE_PLAYER)
|
return event.getType().equals(EventType.DAMAGE_PLAYER)
|
||||||
|| event.getType().equals(EventType.DAMAGE_CREATURE)
|
|| event.getType().equals(EventType.DAMAGE_PERMANENT);
|
||||||
|| event.getType().equals(EventType.DAMAGE_PLANESWALKER);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -69,9 +69,8 @@ class AnthemOfRakdosHellbentEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE
|
return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGE_PLAYER
|
|| event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -14,9 +14,8 @@ import mage.constants.Zone;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.permanent.BlockingPredicate;
|
import mage.filter.predicate.permanent.BlockingPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.DamagedCreatureEvent;
|
import mage.game.events.DamagedEvent;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.events.GameEvent.EventType;
|
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -73,14 +72,14 @@ class ArashinWarBeastTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE || event.getType() == GameEvent.EventType.COMBAT_DAMAGE_STEP_POST ;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT || event.getType() == GameEvent.EventType.COMBAT_DAMAGE_STEP_POST ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE &&
|
if (event.getType() == GameEvent.EventType.DAMAGED_PERMANENT &&
|
||||||
event.getSourceId().equals(this.sourceId) &&
|
event.getSourceId().equals(this.sourceId) &&
|
||||||
((DamagedCreatureEvent) event).isCombatDamage() &&
|
((DamagedEvent) event).isCombatDamage() &&
|
||||||
!usedForCombatDamageStep) {
|
!usedForCombatDamageStep) {
|
||||||
Permanent creature = game.getPermanentOrLKIBattlefield(event.getTargetId());
|
Permanent creature = game.getPermanentOrLKIBattlefield(event.getTargetId());
|
||||||
if (creature == null || !filter.match(creature, getSourceId(), getControllerId(), game)) {
|
if (creature == null || !filter.match(creature, getSourceId(), getControllerId(), game)) {
|
||||||
|
|
|
@ -85,7 +85,7 @@ class ArcbondDelayedTriggeredAbility extends DelayedTriggeredAbility {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -73,7 +73,7 @@ class ArchfiendOfSpiteAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -128,13 +128,13 @@ class AscentOfTheWorthyRedirectEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||||
return permanent != null && permanent.isControlledBy(source.getControllerId());
|
return permanent != null && permanent.isCreature() && permanent.isControlledBy(source.getControllerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -18,7 +18,6 @@ import mage.constants.Outcome;
|
||||||
import mage.constants.WatcherScope;
|
import mage.constants.WatcherScope;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.events.GameEvent.EventType;
|
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.game.stack.Spell;
|
import mage.game.stack.Spell;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
@ -177,23 +176,21 @@ class AureliasFuryDamagedByWatcher extends Watcher {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void watch(GameEvent event, Game game) {
|
public void watch(GameEvent event, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
|
|
||||||
MageObject obj = game.getObject(event.getSourceId());
|
MageObject obj = game.getObject(event.getSourceId());
|
||||||
if (obj instanceof Spell) {
|
if (!(obj instanceof Spell) || !sourceId.equals(((Spell) obj).getSourceId())) {
|
||||||
if (sourceId.equals(((Spell) obj).getSourceId())) {
|
return;
|
||||||
|
}
|
||||||
|
switch (event.getType()) {
|
||||||
|
case DAMAGED_PERMANENT:
|
||||||
|
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||||
|
if (permanent != null && permanent.isCreature()) {
|
||||||
damagedCreatures.add(event.getTargetId());
|
damagedCreatures.add(event.getTargetId());
|
||||||
}
|
}
|
||||||
}
|
return;
|
||||||
}
|
case DAMAGED_PLAYER:
|
||||||
if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
|
|
||||||
MageObject obj = game.getObject(event.getSourceId());
|
|
||||||
if (obj instanceof Spell) {
|
|
||||||
if (sourceId.equals(((Spell) obj).getSourceId())) {
|
|
||||||
damagedPlayers.add(event.getTargetId());
|
damagedPlayers.add(event.getTargetId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reset() {
|
public void reset() {
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.a;
|
package mage.cards.a;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
|
@ -24,8 +22,9 @@ import mage.players.Player;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
import mage.target.common.TargetPlayerOrPlaneswalker;
|
import mage.target.common.TargetPlayerOrPlaneswalker;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class AvacynGuardianAngel extends CardImpl {
|
public final class AvacynGuardianAngel extends CardImpl {
|
||||||
|
@ -80,7 +79,7 @@ class AvacynGuardianAngelPreventToCreatureEffect extends OneShotEffect {
|
||||||
this.staticText = "Prevent all damage that would be dealt to another target creature this turn by sources of the color of your choice";
|
this.staticText = "Prevent all damage that would be dealt to another target creature this turn by sources of the color of your choice";
|
||||||
}
|
}
|
||||||
|
|
||||||
AvacynGuardianAngelPreventToCreatureEffect(final AvacynGuardianAngelPreventToCreatureEffect effect) {
|
private AvacynGuardianAngelPreventToCreatureEffect(final AvacynGuardianAngelPreventToCreatureEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +111,7 @@ class AvacynGuardianAngelPreventToCreaturePreventionEffect extends PreventionEff
|
||||||
this.color = color;
|
this.color = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
AvacynGuardianAngelPreventToCreaturePreventionEffect(AvacynGuardianAngelPreventToCreaturePreventionEffect effect) {
|
private AvacynGuardianAngelPreventToCreaturePreventionEffect(AvacynGuardianAngelPreventToCreaturePreventionEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
this.color = effect.color;
|
this.color = effect.color;
|
||||||
}
|
}
|
||||||
|
@ -124,17 +123,14 @@ class AvacynGuardianAngelPreventToCreaturePreventionEffect extends PreventionEff
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
if (super.applies(event, source, game)) {
|
if (!super.applies(event, source, game)
|
||||||
if (event.getType() == GameEvent.EventType.DAMAGE_CREATURE
|
|| event.getType() != GameEvent.EventType.DAMAGE_PERMANENT
|
||||||
&& event.getTargetId().equals(getTargetPointer().getFirst(game, source))) {
|
|| !event.getTargetId().equals(getTargetPointer().getFirst(game, source))) {
|
||||||
MageObject sourceObject = game.getObject(event.getSourceId());
|
|
||||||
if (sourceObject != null && sourceObject.getColor(game).shares(this.color)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
MageObject sourceObject = game.getObject(event.getSourceId());
|
||||||
|
return sourceObject != null && sourceObject.getColor(game).shares(this.color);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AvacynGuardianAngelPreventToCreaturePreventionEffect copy() {
|
public AvacynGuardianAngelPreventToCreaturePreventionEffect copy() {
|
||||||
|
@ -149,7 +145,7 @@ class AvacynGuardianAngelPreventToPlayerEffect extends OneShotEffect {
|
||||||
this.staticText = "Prevent all damage that would be dealt to target player or planeswalker this turn by sources of the color of your choice";
|
this.staticText = "Prevent all damage that would be dealt to target player or planeswalker this turn by sources of the color of your choice";
|
||||||
}
|
}
|
||||||
|
|
||||||
AvacynGuardianAngelPreventToPlayerEffect(final AvacynGuardianAngelPreventToPlayerEffect effect) {
|
private AvacynGuardianAngelPreventToPlayerEffect(final AvacynGuardianAngelPreventToPlayerEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,7 +177,7 @@ class AvacynGuardianAngelPreventToPlayerPreventionEffect extends PreventionEffec
|
||||||
this.color = color;
|
this.color = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
AvacynGuardianAngelPreventToPlayerPreventionEffect(AvacynGuardianAngelPreventToPlayerPreventionEffect effect) {
|
private AvacynGuardianAngelPreventToPlayerPreventionEffect(AvacynGuardianAngelPreventToPlayerPreventionEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
this.color = effect.color;
|
this.color = effect.color;
|
||||||
}
|
}
|
||||||
|
@ -193,18 +189,12 @@ class AvacynGuardianAngelPreventToPlayerPreventionEffect extends PreventionEffec
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
if (super.applies(event, source, game)) {
|
if (!super.applies(event, source, game) || !event.getTargetId().equals(getTargetPointer().getFirst(game, source))) {
|
||||||
if ((event.getType() == GameEvent.EventType.DAMAGE_PLAYER
|
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER)
|
|
||||||
&& event.getTargetId().equals(getTargetPointer().getFirst(game, source))) {
|
|
||||||
MageObject sourceObject = game.getObject(event.getSourceId());
|
|
||||||
if (sourceObject != null && sourceObject.getColor(game).shares(this.color)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
MageObject sourceObject = game.getObject(event.getSourceId());
|
||||||
|
return sourceObject != null && sourceObject.getColor(game).shares(this.color);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AvacynGuardianAngelPreventToPlayerPreventionEffect copy() {
|
public AvacynGuardianAngelPreventToPlayerPreventionEffect copy() {
|
||||||
|
|
|
@ -73,8 +73,7 @@ class BansheesBladeAbility extends TriggeredAbilityImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_CREATURE
|
|| event.getType() == GameEvent.EventType.DAMAGED_PERMANENT
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER
|
|
||||||
|| event.getType() == GameEvent.EventType.COMBAT_DAMAGE_STEP_PRE;
|
|| event.getType() == GameEvent.EventType.COMBAT_DAMAGE_STEP_PRE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ class BelltowerSphinxEffect extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -76,7 +76,8 @@ class BenevolentUnicornEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE || event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER || event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
return event.getType() == EventType.DAMAGE_PERMANENT
|
||||||
|
|| event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -111,9 +111,8 @@ class BitterFeudEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
case DAMAGE_CREATURE:
|
case DAMAGE_PERMANENT:
|
||||||
case DAMAGE_PLAYER:
|
case DAMAGE_PLAYER:
|
||||||
case DAMAGE_PLANESWALKER:
|
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
@ -130,8 +129,7 @@ class BitterFeudEffect extends ReplacementEffectImpl {
|
||||||
case DAMAGE_PLAYER:
|
case DAMAGE_PLAYER:
|
||||||
targetPlayerId = event.getTargetId();
|
targetPlayerId = event.getTargetId();
|
||||||
break;
|
break;
|
||||||
case DAMAGE_CREATURE:
|
case DAMAGE_PERMANENT:
|
||||||
case DAMAGE_PLANESWALKER:
|
|
||||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
targetPlayerId = permanent.getControllerId();
|
targetPlayerId = permanent.getControllerId();
|
||||||
|
|
|
@ -84,7 +84,8 @@ class BlazeCommandoTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE || event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER || event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT
|
||||||
|
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -89,7 +89,7 @@ class BlazingEffigyWatcher extends Watcher {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void watch(GameEvent event, Game game) {
|
public void watch(GameEvent event, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
|
if (event.getType() == GameEvent.EventType.DAMAGED_PERMANENT) {
|
||||||
if (!event.getSourceId().equals(event.getTargetId())) {
|
if (!event.getSourceId().equals(event.getTargetId())) {
|
||||||
MageObjectReference damageSourceRef = new MageObjectReference(event.getSourceId(), game);
|
MageObjectReference damageSourceRef = new MageObjectReference(event.getSourceId(), game);
|
||||||
MageObjectReference damageTargetRef = new MageObjectReference(event.getTargetId(), game);
|
MageObjectReference damageTargetRef = new MageObjectReference(event.getTargetId(), game);
|
||||||
|
|
|
@ -72,7 +72,7 @@ class BlazingSunsteelTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -11,7 +11,7 @@ import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.filter.StaticFilters;
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.DamageCreatureEvent;
|
import mage.game.events.DamageEvent;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.util.CardUtil;
|
import mage.util.CardUtil;
|
||||||
|
@ -63,7 +63,7 @@ class FurnaceOfRathEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -71,7 +71,7 @@ class FurnaceOfRathEffect extends ReplacementEffectImpl {
|
||||||
Permanent permanent = game.getPermanent(event.getSourceId());
|
Permanent permanent = game.getPermanent(event.getSourceId());
|
||||||
return permanent != null
|
return permanent != null
|
||||||
&& permanent.isCreature()
|
&& permanent.isCreature()
|
||||||
&& ((DamageCreatureEvent) event).isCombatDamage();
|
&& ((DamageEvent) event).isCombatDamage();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ import mage.constants.Outcome;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.DamageEvent;
|
import mage.game.events.DamageEvent;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,7 +56,7 @@ class BloodOfTheMartyrEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -77,8 +78,11 @@ class BloodOfTheMartyrEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
|
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||||
DamageEvent damageEvent = (DamageEvent) event;
|
DamageEvent damageEvent = (DamageEvent) event;
|
||||||
return controller != null
|
return controller != null
|
||||||
&& controller.chooseUse(outcome, "Would you like to have " + damageEvent.getAmount() + " damage dealt to you instead of " + game.getPermanentOrLKIBattlefield(damageEvent.getTargetId()).getLogName() + "?", source, game);
|
&& permanent != null
|
||||||
|
&& permanent.isCreature()
|
||||||
|
&& controller.chooseUse(outcome, "Have " + damageEvent.getAmount() + " damage dealt to you instead of " + permanent.getLogName() + "?", source, game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,8 +72,7 @@ class CalamityBearerEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
case DAMAGE_CREATURE:
|
case DAMAGE_PERMANENT:
|
||||||
case DAMAGE_PLANESWALKER:
|
|
||||||
case DAMAGE_PLAYER:
|
case DAMAGE_PLAYER:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -15,8 +15,8 @@ import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.FilterPermanent;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
import mage.game.events.DamageEvent;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.events.DamageCreatureEvent;
|
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -73,8 +73,8 @@ class CamelEffect extends PreventionEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
if (super.applies(event, source, game) && event instanceof DamageCreatureEvent && event.getAmount() > 0) {
|
if (super.applies(event, source, game) && event instanceof DamageEvent && event.getAmount() > 0) {
|
||||||
DamageCreatureEvent damageEvent = (DamageCreatureEvent) event;
|
DamageEvent damageEvent = (DamageEvent) event;
|
||||||
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||||
if (sourcePermanent != null
|
if (sourcePermanent != null
|
||||||
&& sourcePermanent.isAttacking()
|
&& sourcePermanent.isAttacking()
|
||||||
|
|
|
@ -119,9 +119,8 @@ class CloakOfConfusionEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
case DAMAGE_CREATURE:
|
case DAMAGE_PERMANENT:
|
||||||
case DAMAGE_PLAYER:
|
case DAMAGE_PLAYER:
|
||||||
case DAMAGE_PLANESWALKER:
|
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -65,7 +65,7 @@ class CoverOfWinterEffect extends PreventionEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_PLAYER || event.getType() == GameEvent.EventType.DAMAGE_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGE_PLAYER || event.getType() == GameEvent.EventType.DAMAGE_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -86,9 +86,9 @@ class CoverOfWinterEffect extends PreventionEffectImpl {
|
||||||
return super.applies(event, source, game);
|
return super.applies(event, source, game);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.getType() == GameEvent.EventType.DAMAGE_CREATURE) {
|
if (event.getType() == GameEvent.EventType.DAMAGE_PERMANENT) {
|
||||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||||
if (permanent != null && permanent.isControlledBy(source.getControllerId())) {
|
if (permanent != null && permanent.isCreature() && permanent.isControlledBy(source.getControllerId())) {
|
||||||
return super.applies(event, source, game);
|
return super.applies(event, source, game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,7 +94,7 @@ public final class CragSaurian extends CardImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
|
@ -10,24 +8,25 @@ import mage.abilities.keyword.IndestructibleAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.DamagedCreatureEvent;
|
import mage.game.events.DamagedEvent;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.events.GameEvent.EventType;
|
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author nantuko
|
* @author nantuko
|
||||||
*/
|
*/
|
||||||
public final class CreepyDoll extends CardImpl {
|
public final class CreepyDoll extends CardImpl {
|
||||||
|
|
||||||
public CreepyDoll(UUID ownerId, CardSetInfo setInfo) {
|
public CreepyDoll(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{5}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}");
|
||||||
this.subtype.add(SubType.CONSTRUCT);
|
this.subtype.add(SubType.CONSTRUCT);
|
||||||
|
|
||||||
this.power = new MageInt(1);
|
this.power = new MageInt(1);
|
||||||
|
@ -67,13 +66,17 @@ class CreepyDollTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
if (((DamagedCreatureEvent) event).isCombatDamage() && event.getSourceId().equals(sourceId)) {
|
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||||
getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId()));
|
if (permanent != null
|
||||||
|
&& permanent.isCreature()
|
||||||
|
&& ((DamagedEvent) event).isCombatDamage()
|
||||||
|
&& event.getSourceId().equals(sourceId)) {
|
||||||
|
getEffects().setTargetPointer(new FixedTarget(event.getTargetId(), game));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -63,9 +63,9 @@ class DauntingDefenderEffect extends PreventionEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.DAMAGE_CREATURE) {
|
if (event.getType() == GameEvent.EventType.DAMAGE_PERMANENT) {
|
||||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||||
if (permanent != null && permanent.isControlledBy(source.getControllerId()) && permanent.hasSubtype(SubType.CLERIC, game)) {
|
if (permanent != null && permanent.isControlledBy(source.getControllerId()) && permanent.isCreature() && permanent.hasSubtype(SubType.CLERIC, game)) {
|
||||||
return super.applies(event, source, game);
|
return super.applies(event, source, game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.d;
|
package mage.cards.d;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
import mage.abilities.effects.Effect;
|
|
||||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
@ -11,16 +9,18 @@ import mage.constants.CardType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Plopman
|
* @author Plopman
|
||||||
*/
|
*/
|
||||||
public final class DeathPitsOfRath extends CardImpl {
|
public final class DeathPitsOfRath extends CardImpl {
|
||||||
|
|
||||||
public DeathPitsOfRath(UUID ownerId, CardSetInfo setInfo) {
|
public DeathPitsOfRath(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{B}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{B}");
|
||||||
|
|
||||||
// Whenever a creature is dealt damage, destroy it. It can't be regenerated.
|
// Whenever a creature is dealt damage, destroy it. It can't be regenerated.
|
||||||
this.addAbility(new DeathPitsOfRathTriggeredAbility());
|
this.addAbility(new DeathPitsOfRathTriggeredAbility());
|
||||||
|
@ -53,14 +53,16 @@ class DeathPitsOfRathTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
for (Effect effect : this.getEffects()) {
|
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
if (permanent == null || !permanent.isCreature()) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
getEffects().setTargetPointer(new FixedTarget(event.getTargetId(), game));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -139,9 +139,8 @@ class DelifsConePreventEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
case DAMAGE_CREATURE:
|
case DAMAGE_PERMANENT:
|
||||||
case DAMAGE_PLAYER:
|
case DAMAGE_PLAYER:
|
||||||
case DAMAGE_PLANESWALKER:
|
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -117,9 +117,8 @@ class DelifsCubePreventEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
case DAMAGE_CREATURE:
|
case DAMAGE_PERMANENT:
|
||||||
case DAMAGE_PLAYER:
|
case DAMAGE_PLAYER:
|
||||||
case DAMAGE_PLANESWALKER:
|
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -80,8 +80,7 @@ class DesperateGambitEffect extends PreventionEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE ||
|
return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT ||
|
||||||
event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER ||
|
|
||||||
event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,9 +64,8 @@ class DictateOfTheTwinGodsEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
case DAMAGE_CREATURE:
|
case DAMAGE_PERMANENT:
|
||||||
case DAMAGE_PLAYER:
|
case DAMAGE_PLAYER:
|
||||||
case DAMAGE_PLANESWALKER:
|
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1,18 +1,20 @@
|
||||||
|
|
||||||
package mage.cards.d;
|
package mage.cards.d;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
import mage.abilities.effects.common.*;
|
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.*;
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.SubType;
|
||||||
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author JayDi85
|
* @author JayDi85
|
||||||
*/
|
*/
|
||||||
|
@ -57,20 +59,21 @@ class DinosaurHunterAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
if (event.getSourceId().equals(getSourceId())) {
|
if (!event.getSourceId().equals(getSourceId())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
Permanent targetPermanent = game.getPermanentOrLKIBattlefield(event.getTargetId());
|
Permanent targetPermanent = game.getPermanentOrLKIBattlefield(event.getTargetId());
|
||||||
if (targetPermanent.hasSubtype(SubType.DINOSAUR, game)) {
|
if (targetPermanent == null || !targetPermanent.hasSubtype(SubType.DINOSAUR, game)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
getEffects().setTargetPointer(new FixedTarget(targetPermanent, game));
|
getEffects().setTargetPointer(new FixedTarget(targetPermanent, game));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRule() {
|
public String getRule() {
|
||||||
|
|
|
@ -56,9 +56,8 @@ class DivinePresenceEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
case DAMAGE_CREATURE:
|
case DAMAGE_PERMANENT:
|
||||||
case DAMAGE_PLAYER:
|
case DAMAGE_PLAYER:
|
||||||
case DAMAGE_PLANESWALKER:
|
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -84,9 +84,9 @@ class DjeruWithEyesOpenPreventEffect extends PreventionEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER) {
|
if (event.getType() == GameEvent.EventType.DAMAGE_PERMANENT) {
|
||||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||||
if (permanent != null && permanent.isControlledBy(source.getControllerId())) {
|
if (permanent != null && permanent.isPlaneswalker() && permanent.isControlledBy(source.getControllerId())) {
|
||||||
return super.applies(event, source, game);
|
return super.applies(event, source, game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ import mage.filter.FilterCard;
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.DamageCreatureEvent;
|
import mage.game.events.DamageEvent;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
|
||||||
|
@ -76,14 +76,14 @@ class DralnuLichLordReplacementEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||||
DamageCreatureEvent damageEvent = (DamageCreatureEvent) event;
|
DamageEvent damageEvent = (DamageEvent) event;
|
||||||
new SacrificeControllerEffect(new FilterPermanent(), damageEvent.getAmount(), "").apply(game, source);
|
new SacrificeControllerEffect(new FilterPermanent(), damageEvent.getAmount(), "").apply(game, source);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -63,8 +63,7 @@ class EmbermawHellionEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
switch(event.getType()) {
|
switch(event.getType()) {
|
||||||
case DAMAGE_CREATURE:
|
case DAMAGE_PERMANENT:
|
||||||
case DAMAGE_PLANESWALKER:
|
|
||||||
case DAMAGE_PLAYER:
|
case DAMAGE_PLAYER:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -72,9 +72,8 @@ class EmberwildeCaliphTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -57,9 +57,8 @@ class EqualTreatmentEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE
|
return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGE_PLAYER
|
|| event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -65,9 +65,8 @@ class DealsDamageAllTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.e;
|
package mage.cards.e;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.effects.ReplacementEffectImpl;
|
import mage.abilities.effects.ReplacementEffectImpl;
|
||||||
|
@ -12,32 +10,31 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.counters.Counter;
|
|
||||||
import mage.counters.CounterType;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
import mage.game.events.DamageEvent;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*/
|
*/
|
||||||
public final class EverlastingTorment extends CardImpl {
|
public final class EverlastingTorment extends CardImpl {
|
||||||
|
|
||||||
public EverlastingTorment(UUID ownerId, CardSetInfo setInfo) {
|
public EverlastingTorment(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{B/R}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B/R}");
|
||||||
|
|
||||||
// Players can't gain life.
|
// Players can't gain life.
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantGainLifeAllEffect()));
|
this.addAbility(new SimpleStaticAbility(new CantGainLifeAllEffect()));
|
||||||
|
|
||||||
// Damage can't be prevented.
|
// Damage can't be prevented.
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
|
this.addAbility(new SimpleStaticAbility(new DamageCantBePreventedEffect(
|
||||||
new DamageCantBePreventedEffect(Duration.WhileOnBattlefield, "Damage can't be prevented", true, false)));
|
Duration.WhileOnBattlefield, "Damage can't be prevented",
|
||||||
|
true, false
|
||||||
|
)));
|
||||||
|
|
||||||
// All damage is dealt as though its source had wither.
|
// All damage is dealt as though its source had wither.
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DamageDealtAsIfSourceHadWitherEffect()));
|
this.addAbility(new SimpleStaticAbility(new DamageDealtAsIfSourceHadWitherEffect()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private EverlastingTorment(final EverlastingTorment card) {
|
private EverlastingTorment(final EverlastingTorment card) {
|
||||||
|
@ -52,12 +49,12 @@ public final class EverlastingTorment extends CardImpl {
|
||||||
|
|
||||||
class DamageDealtAsIfSourceHadWitherEffect extends ReplacementEffectImpl {
|
class DamageDealtAsIfSourceHadWitherEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
public DamageDealtAsIfSourceHadWitherEffect() {
|
DamageDealtAsIfSourceHadWitherEffect() {
|
||||||
super(Duration.WhileOnBattlefield, Outcome.Neutral);
|
super(Duration.WhileOnBattlefield, Outcome.Neutral);
|
||||||
staticText = "All damage is dealt as though its source had wither";
|
staticText = "All damage is dealt as though its source had wither";
|
||||||
}
|
}
|
||||||
|
|
||||||
public DamageDealtAsIfSourceHadWitherEffect(final DamageDealtAsIfSourceHadWitherEffect effect) {
|
private DamageDealtAsIfSourceHadWitherEffect(final DamageDealtAsIfSourceHadWitherEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,23 +70,15 @@ class DamageDealtAsIfSourceHadWitherEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||||
int damageAmount = event.getAmount();
|
((DamageEvent) event).setAsThoughWither(true);
|
||||||
if (damageAmount > 0) {
|
return false;
|
||||||
Counter counter = CounterType.M1M1.createInstance(damageAmount);
|
|
||||||
Permanent creatureDamaged = game.getPermanent(event.getTargetId());
|
|
||||||
if (creatureDamaged != null) {
|
|
||||||
creatureDamaged.addCounters(counter, source.getControllerId(), source, game);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -173,9 +173,8 @@ class FarrelsMantleDamageEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
case DAMAGE_CREATURE:
|
case DAMAGE_PERMANENT:
|
||||||
case DAMAGE_PLAYER:
|
case DAMAGE_PLAYER:
|
||||||
case DAMAGE_PLANESWALKER:
|
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -56,8 +56,7 @@ class FieryEmancipationEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER)
|
return event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER)
|
||||||
|| event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE)
|
|| event.getType().equals(GameEvent.EventType.DAMAGE_PERMANENT);
|
||||||
|| event.getType().equals(GameEvent.EventType.DAMAGE_PLANESWALKER);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -60,7 +60,7 @@ class DealtDamageLoseLifeTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -65,8 +65,7 @@ class FireServantEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE ||
|
return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT ||
|
||||||
event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER ||
|
|
||||||
event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,16 +78,14 @@ class FiveAlarmFireTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER
|
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|
||||||
|| event.getType() == GameEvent.EventType.COMBAT_DAMAGE_STEP_PRE;
|
|| event.getType() == GameEvent.EventType.COMBAT_DAMAGE_STEP_PRE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE
|
if (event.getType() == GameEvent.EventType.DAMAGED_PERMANENT
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER
|
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
|
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
|
||||||
if (((DamagedEvent) event).isCombatDamage() && !triggeringCreatures.contains(event.getSourceId())) {
|
if (((DamagedEvent) event).isCombatDamage() && !triggeringCreatures.contains(event.getSourceId())) {
|
||||||
Permanent permanent = game.getPermanent(event.getSourceId());
|
Permanent permanent = game.getPermanent(event.getSourceId());
|
||||||
|
|
|
@ -3,7 +3,6 @@ package mage.cards.f;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.keyword.DeathtouchAbility;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
@ -15,8 +14,6 @@ import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import static mage.game.combat.CombatGroup.getLethalDamage;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author TheElk801
|
* @author TheElk801
|
||||||
*/
|
*/
|
||||||
|
@ -64,10 +61,7 @@ class FlameSpillEffect extends OneShotEffect {
|
||||||
if (permanent == null || sourceObject == null) {
|
if (permanent == null || sourceObject == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int lethal = getLethalDamage(permanent, game);
|
int lethal = permanent.getLethalDamage(source.getSourceId(), game);
|
||||||
if (sourceObject.getAbilities().containsKey(DeathtouchAbility.getInstance().getId())) {
|
|
||||||
lethal = Math.min(lethal, 1);
|
|
||||||
}
|
|
||||||
lethal = Math.min(lethal, 4);
|
lethal = Math.min(lethal, 4);
|
||||||
permanent.damage(lethal, source.getSourceId(), source, game);
|
permanent.damage(lethal, source.getSourceId(), source, game);
|
||||||
Player player = game.getPlayer(permanent.getControllerId());
|
Player player = game.getPlayer(permanent.getControllerId());
|
||||||
|
|
|
@ -63,8 +63,7 @@ class FlamebladeAngelTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER
|
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
|
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,9 +72,8 @@ class FlashConscriptionTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3,7 +3,6 @@ package mage.cards.f;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
import mage.abilities.effects.Effect;
|
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
@ -50,7 +49,7 @@ class FleshReaverTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
super(Zone.BATTLEFIELD, new FleshReaverEffect());
|
super(Zone.BATTLEFIELD, new FleshReaverEffect());
|
||||||
}
|
}
|
||||||
|
|
||||||
FleshReaverTriggeredAbility(final FleshReaverTriggeredAbility effect) {
|
private FleshReaverTriggeredAbility(final FleshReaverTriggeredAbility effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,24 +60,23 @@ class FleshReaverTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE || event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT
|
||||||
|
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
if (!event.getSourceId().equals(sourceId)) {
|
if (!event.getSourceId().equals(getSourceId())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
|
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||||
if (event.getTargetId().equals(controllerId)) {
|
if ((permanent != null && permanent.isCreature())
|
||||||
return false;
|
|| game.getOpponents(event.getTargetId()).contains(getControllerId())) {
|
||||||
}
|
this.getEffects().setValue("damage", event.getAmount());
|
||||||
}
|
|
||||||
for (Effect effect : this.getEffects()) {
|
|
||||||
effect.setValue("damage", event.getAmount());
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRule() {
|
public String getRule() {
|
||||||
|
@ -94,7 +92,7 @@ class FleshReaverEffect extends OneShotEffect {
|
||||||
this.staticText = "{this} deals that much damage to you.";
|
this.staticText = "{this} deals that much damage to you.";
|
||||||
}
|
}
|
||||||
|
|
||||||
FleshReaverEffect(final FleshReaverEffect effect) {
|
private FleshReaverEffect(final FleshReaverEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,10 +59,7 @@ class FurnaceOfRathEffect extends ReplacementEffectImpl {
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
case DAMAGE_PLAYER:
|
case DAMAGE_PLAYER:
|
||||||
return true;
|
case DAMAGE_PERMANENT:
|
||||||
case DAMAGE_CREATURE:
|
|
||||||
return true;
|
|
||||||
case DAMAGE_PLANESWALKER:
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -142,9 +142,8 @@ class GazeOfPainDamageEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
case DAMAGE_CREATURE:
|
case DAMAGE_PERMANENT:
|
||||||
case DAMAGE_PLAYER:
|
case DAMAGE_PLAYER:
|
||||||
case DAMAGE_PLANESWALKER:
|
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -61,9 +61,8 @@ class GhostsOfTheInnocentPreventDamageEffect extends ReplacementEffectImpl imple
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE
|
return event.getType() == GameEvent.EventType.DAMAGE_PLAYER
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGE_PLAYER
|
|| event.getType() == EventType.DAMAGE_PERMANENT;
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -11,7 +11,7 @@ import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.DamagedCreatureEvent;
|
import mage.game.events.DamagedEvent;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.game.permanent.token.FoodToken;
|
import mage.game.permanent.token.FoodToken;
|
||||||
|
@ -65,12 +65,12 @@ class GiantsSkewerTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
if (!((DamagedCreatureEvent) event).isCombatDamage()) {
|
if (!((DamagedEvent) event).isCombatDamage()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Permanent permanent = game.getPermanent(event.getSourceId());
|
Permanent permanent = game.getPermanent(event.getSourceId());
|
||||||
|
|
|
@ -135,9 +135,8 @@ class GideonsInterventionPreventAllDamageEffect extends PreventionEffectImpl {
|
||||||
MageObject object = game.getObject(event.getSourceId());
|
MageObject object = game.getObject(event.getSourceId());
|
||||||
Permanent targetPerm = game.getPermanent(event.getTargetId());
|
Permanent targetPerm = game.getPermanent(event.getTargetId());
|
||||||
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
||||||
if (object != null && (event.getType() == GameEvent.EventType.DAMAGE_PLAYER
|
if (object != null && (event.getType() == EventType.DAMAGE_PLAYER
|
||||||
|| targetPerm != null && (event.getType() == GameEvent.EventType.DAMAGE_CREATURE
|
|| targetPerm != null && event.getType() == EventType.DAMAGE_PERMANENT)) {
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER))) {
|
|
||||||
if (CardUtil.haveSameNames(object, cardName, game)
|
if (CardUtil.haveSameNames(object, cardName, game)
|
||||||
&& (event.getTargetId().equals(source.getControllerId())
|
&& (event.getTargetId().equals(source.getControllerId())
|
||||||
|| targetPerm != null && targetPerm.isControlledBy(source.getControllerId()))) {
|
|| targetPerm != null && targetPerm.isControlledBy(source.getControllerId()))) {
|
||||||
|
|
|
@ -107,9 +107,8 @@ class GideonsSacrificeEffectReplacementEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
case DAMAGE_CREATURE:
|
|
||||||
case DAMAGE_PLAYER:
|
case DAMAGE_PLAYER:
|
||||||
case DAMAGE_PLANESWALKER:
|
case DAMAGE_PERMANENT:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
@ -122,8 +121,7 @@ class GideonsSacrificeEffectReplacementEffect extends ReplacementEffectImpl {
|
||||||
&& event.getPlayerId().equals(source.getControllerId())) {
|
&& event.getPlayerId().equals(source.getControllerId())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (event.getType() == GameEvent.EventType.DAMAGE_CREATURE
|
if (event.getType() == GameEvent.EventType.DAMAGE_PERMANENT) {
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER) {
|
|
||||||
Permanent targetPermanent = game.getPermanent(event.getTargetId());
|
Permanent targetPermanent = game.getPermanent(event.getTargetId());
|
||||||
if (targetPermanent != null
|
if (targetPermanent != null
|
||||||
&& targetPermanent.isControlledBy(source.getControllerId())) {
|
&& targetPermanent.isControlledBy(source.getControllerId())) {
|
||||||
|
|
|
@ -72,9 +72,8 @@ class GiselaBladeOfGoldnightDoubleDamageEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
case DAMAGE_CREATURE:
|
|
||||||
case DAMAGE_PLAYER:
|
case DAMAGE_PLAYER:
|
||||||
case DAMAGE_PLANESWALKER:
|
case DAMAGE_PERMANENT:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -87,7 +87,7 @@ class GlarecasterEffect extends RedirectionEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE || event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
return event.getType() == EventType.DAMAGE_PERMANENT || event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -67,13 +67,13 @@ class GloomSurgeonEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
if (event.getTargetId().equals(source.getSourceId())) {
|
if (event.getTargetId().equals(source.getSourceId())) {
|
||||||
DamageCreatureEvent damageEvent = (DamageCreatureEvent) event;
|
DamageEvent damageEvent = (DamageEvent) event;
|
||||||
return damageEvent.isCombatDamage();
|
return damageEvent.isCombatDamage();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -15,9 +15,8 @@ import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
import mage.game.events.DamagedEvent;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.events.DamagedCreatureEvent;
|
|
||||||
import mage.game.events.GameEvent.EventType;
|
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
@ -70,13 +69,13 @@ class GlyphOfLifeTriggeredAbility extends DelayedTriggeredAbility {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
if (event.getTargetId().equals(this.getFirstTarget())) {
|
if (event.getTargetId().equals(this.getFirstTarget())) {
|
||||||
DamagedCreatureEvent damageEvent = (DamagedCreatureEvent) event;
|
DamagedEvent damageEvent = (DamagedEvent) event;
|
||||||
Permanent attackingCreature = game.getPermanentOrLKIBattlefield(damageEvent.getSourceId());
|
Permanent attackingCreature = game.getPermanentOrLKIBattlefield(damageEvent.getSourceId());
|
||||||
if (attackingCreature != null && attackingCreature.isCreature() && attackingCreature.isAttacking()) {
|
if (attackingCreature != null && attackingCreature.isCreature() && attackingCreature.isAttacking()) {
|
||||||
this.getEffects().get(0).setValue("damageAmount", event.getAmount());
|
this.getEffects().get(0).setValue("damageAmount", event.getAmount());
|
||||||
|
|
|
@ -66,9 +66,8 @@ class GoblinBowlingTeamEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
case DAMAGE_CREATURE:
|
|
||||||
case DAMAGE_PLAYER:
|
case DAMAGE_PLAYER:
|
||||||
case DAMAGE_PLANESWALKER:
|
case DAMAGE_PERMANENT:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -70,8 +70,7 @@ class GoblinPsychopathEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE
|
return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER
|
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
|| event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ class GoldnightCastigatorDoubleDamageEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE ||
|
return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT ||
|
||||||
event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ class GoldnightCastigatorDoubleDamageEffect extends ReplacementEffectImpl {
|
||||||
event.setAmount(CardUtil.overflowMultiply(event.getAmount(), 2));
|
event.setAmount(CardUtil.overflowMultiply(event.getAmount(), 2));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DAMAGE_CREATURE:
|
case DAMAGE_PERMANENT:
|
||||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
if (permanent.getId().equals(source.getSourceId())) {
|
if (permanent.getId().equals(source.getSourceId())) {
|
||||||
|
|
|
@ -58,9 +58,8 @@ class GratuitousViolenceReplacementEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
case DAMAGE_CREATURE:
|
|
||||||
case DAMAGE_PLAYER:
|
case DAMAGE_PLAYER:
|
||||||
case DAMAGE_PLANESWALKER:
|
case DAMAGE_PERMANENT:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -72,7 +72,7 @@ class GreatbowDoyenTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -176,12 +176,12 @@ class GrothamaAllDevouringWatcher extends Watcher {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void watch(GameEvent event, Game game) {
|
public void watch(GameEvent event, Game game) {
|
||||||
if (event.getType() != GameEvent.EventType.DAMAGED_CREATURE) {
|
if (event.getType() != GameEvent.EventType.DAMAGED_PERMANENT) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
UUID damageControllerId = game.getControllerId(event.getSourceId());
|
UUID damageControllerId = game.getControllerId(event.getSourceId());
|
||||||
Permanent damaged = game.getPermanentOrLKIBattlefield(event.getTargetId());
|
Permanent damaged = game.getPermanentOrLKIBattlefield(event.getTargetId());
|
||||||
if (damaged == null || damageControllerId == null) {
|
if (damaged == null || !damaged.isCreature() || damageControllerId == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MageObjectReference mor = new MageObjectReference(damaged, game);
|
MageObjectReference mor = new MageObjectReference(damaged, game);
|
||||||
|
|
|
@ -80,9 +80,8 @@ class HanSoloScrumratTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -88,9 +88,9 @@ class HedronFieldPuristsEffect extends PreventionEffectImpl {
|
||||||
return super.applies(event, source, game);
|
return super.applies(event, source, game);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.getType() == GameEvent.EventType.DAMAGE_CREATURE) {
|
if (event.getType() == GameEvent.EventType.DAMAGE_PERMANENT) {
|
||||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||||
if (permanent != null && permanent.isControlledBy(source.getControllerId())) {
|
if (permanent != null && permanent.isCreature() && permanent.isControlledBy(source.getControllerId())) {
|
||||||
return super.applies(event, source, game);
|
return super.applies(event, source, game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ class HighPriestOfPenanceTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -69,7 +69,7 @@ class HotSoupTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -13,7 +13,6 @@ import mage.constants.Outcome;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.DamagedEvent;
|
import mage.game.events.DamagedEvent;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.events.GameEvent.EventType;
|
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
|
|
||||||
|
@ -92,7 +91,7 @@ class HuntersInsightTriggeredAbility extends DelayedTriggeredAbility {
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER;
|
|| event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -101,6 +100,10 @@ class HuntersInsightTriggeredAbility extends DelayedTriggeredAbility {
|
||||||
|| !((DamagedEvent) event).isCombatDamage()) {
|
|| !((DamagedEvent) event).isCombatDamage()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||||
|
if (permanent != null && !permanent.isPlaneswalker()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
this.getEffects().clear();
|
this.getEffects().clear();
|
||||||
this.addEffect(new DrawCardSourceControllerEffect(event.getAmount()));
|
this.addEffect(new DrawCardSourceControllerEffect(event.getAmount()));
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -96,8 +96,7 @@ class GreatestAmountOfDamageWatcher extends Watcher {
|
||||||
@Override
|
@Override
|
||||||
public void watch(GameEvent event, Game game) {
|
public void watch(GameEvent event, Game game) {
|
||||||
switch(event.getType()) {
|
switch(event.getType()) {
|
||||||
case DAMAGED_CREATURE:
|
case DAMAGED_PERMANENT:
|
||||||
case DAMAGED_PLANESWALKER:
|
|
||||||
case DAMAGED_PLAYER:
|
case DAMAGED_PLAYER:
|
||||||
if (event.getAmount() > damageAmount) {
|
if (event.getAmount() > damageAmount) {
|
||||||
damageAmount = event.getAmount();
|
damageAmount = event.getAmount();
|
||||||
|
|
|
@ -68,8 +68,7 @@ class ImpulsiveManeuversEffect extends PreventionEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE ||
|
return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT ||
|
||||||
event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER ||
|
|
||||||
event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.i;
|
package mage.cards.i;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.costs.mana.GenericManaCost;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
|
@ -9,25 +8,22 @@ import mage.abilities.effects.ReplacementEffectImpl;
|
||||||
import mage.abilities.keyword.EquipAbility;
|
import mage.abilities.keyword.EquipAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.*;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Duration;
|
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.DamageCreatureEvent;
|
|
||||||
import mage.game.events.DamageEvent;
|
import mage.game.events.DamageEvent;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.util.CardUtil;
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author nantuko
|
* @author nantuko
|
||||||
*/
|
*/
|
||||||
public final class InquisitorsFlail extends CardImpl {
|
public final class InquisitorsFlail extends CardImpl {
|
||||||
|
|
||||||
public InquisitorsFlail(UUID ownerId, CardSetInfo setInfo) {
|
public InquisitorsFlail(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
|
||||||
this.subtype.add(SubType.EQUIPMENT);
|
this.subtype.add(SubType.EQUIPMENT);
|
||||||
|
|
||||||
// If equipped creature would deal combat damage, it deals double that damage instead.
|
// If equipped creature would deal combat damage, it deals double that damage instead.
|
||||||
|
@ -67,20 +63,13 @@ class InquisitorsFlailEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE ||
|
return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT ||
|
||||||
event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER ||
|
|
||||||
event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
boolean isCombat = false;
|
if (((DamageEvent) event).isCombatDamage()) {
|
||||||
if (event instanceof DamageCreatureEvent) {
|
|
||||||
isCombat = ((DamageCreatureEvent) event).isCombatDamage();
|
|
||||||
} else if (event instanceof DamageEvent) {
|
|
||||||
isCombat = ((DamageEvent) event).isCombatDamage();
|
|
||||||
}
|
|
||||||
if (isCombat) {
|
|
||||||
Permanent equipment = game.getPermanent(source.getSourceId());
|
Permanent equipment = game.getPermanent(source.getSourceId());
|
||||||
if (equipment != null && equipment.getAttachedTo() != null) {
|
if (equipment != null && equipment.getAttachedTo() != null) {
|
||||||
UUID attachedTo = equipment.getAttachedTo();
|
UUID attachedTo = equipment.getAttachedTo();
|
||||||
|
|
|
@ -72,9 +72,8 @@ class InsultDoubleDamageEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE
|
return event.getType() == GameEvent.EventType.DAMAGE_PLAYER
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGE_PLAYER
|
|| event.getType() == GameEvent.EventType.DAMAGE_PERMANENT;
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -93,15 +93,13 @@ class JadeMonolithRedirectionEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE;
|
return event.getType() == EventType.DAMAGE_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
if (event.getSourceId().equals(targetSource.getFirstTarget()) && event.getTargetId().equals(source.getFirstTarget())) {
|
return event.getSourceId().equals(targetSource.getFirstTarget())
|
||||||
return true;
|
&& event.getTargetId().equals(source.getFirstTarget());
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,8 +64,7 @@ class JayaVeneratedFiremageEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
case DAMAGE_CREATURE:
|
case DAMAGE_PERMANENT:
|
||||||
case DAMAGE_PLANESWALKER:
|
|
||||||
case DAMAGE_PLAYER:
|
case DAMAGE_PLAYER:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -67,9 +67,8 @@ class JusticeTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -68,7 +68,7 @@ class KamiOfTheHonoredDeadTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -75,22 +75,15 @@ class KazarovSengirPurebloodTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
if (event == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId());
|
Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId());
|
||||||
if (permanent == null) {
|
return permanent!=null
|
||||||
return false;
|
&& permanent.isCreature()
|
||||||
}
|
&& game.getOpponents(permanent.getControllerId()).contains(this.getControllerId());
|
||||||
if (permanent.isControlledBy(this.getControllerId())) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -72,7 +72,7 @@ class KillSuitCultistEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE;
|
return event.getType() == EventType.DAMAGE_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -2,6 +2,7 @@ package mage.cards.k;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
|
import mage.game.events.DamageEvent;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
|
@ -20,7 +21,6 @@ import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.DamageCreatureEvent;
|
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.TargetSource;
|
import mage.target.TargetSource;
|
||||||
|
@ -155,11 +155,11 @@ class KithkinArmorPreventionEffect extends PreventionEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
if (super.applies(event, source, game)
|
if (super.applies(event, source, game)
|
||||||
&& event instanceof DamageCreatureEvent
|
&& event instanceof DamageEvent
|
||||||
&& event.getAmount() > 0
|
&& event.getAmount() > 0
|
||||||
&& !this.used) {
|
&& !this.used) {
|
||||||
UUID enchantedCreatureId = (UUID) game.getState().getValue(source.getSourceId().toString() + "attachedToPermanent");
|
UUID enchantedCreatureId = (UUID) game.getState().getValue(source.getSourceId().toString() + "attachedToPermanent");
|
||||||
DamageCreatureEvent damageEvent = (DamageCreatureEvent) event;
|
DamageEvent damageEvent = (DamageEvent) event;
|
||||||
if (enchantedCreatureId != null
|
if (enchantedCreatureId != null
|
||||||
&& event.getTargetId().equals(enchantedCreatureId)
|
&& event.getTargetId().equals(enchantedCreatureId)
|
||||||
&& damageEvent.getSourceId().equals(source.getFirstTarget())) {
|
&& damageEvent.getSourceId().equals(source.getFirstTarget())) {
|
||||||
|
|
|
@ -89,8 +89,7 @@ class KiyomaroFirstToStandDealsDamageTriggeredAbility extends TriggeredAbilityIm
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_CREATURE
|
|| event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -76,7 +76,7 @@ class KorChantEffect extends RedirectionEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -76,7 +76,7 @@ class KorDirgeEffect extends RedirectionEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
package mage.cards.k;
|
package mage.cards.k;
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.DelayedTriggeredAbility;
|
import mage.abilities.DelayedTriggeredAbility;
|
||||||
|
@ -11,26 +8,22 @@ import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.*;
|
||||||
import mage.constants.Duration;
|
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.TargetController;
|
|
||||||
import mage.constants.WatcherScope;
|
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.events.GameEvent.EventType;
|
|
||||||
import mage.game.events.ZoneChangeEvent;
|
import mage.game.events.ZoneChangeEvent;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
import mage.watchers.Watcher;
|
import mage.watchers.Watcher;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*/
|
*/
|
||||||
public final class KrovikanVampire extends CardImpl {
|
public final class KrovikanVampire extends CardImpl {
|
||||||
|
@ -149,10 +142,15 @@ class KrovikanVampireCreaturesDamagedWatcher extends Watcher {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void watch(GameEvent event, Game game) {
|
public void watch(GameEvent event, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE
|
if (event.getType() != GameEvent.EventType.DAMAGED_PERMANENT
|
||||||
&& sourceId.equals(event.getSourceId())) {
|
|| !sourceId.equals(event.getSourceId())) {
|
||||||
damagedBySource.add(event.getTargetId());
|
return;
|
||||||
}
|
}
|
||||||
|
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||||
|
if (permanent == null || !permanent.isCreature()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
damagedBySource.add(event.getTargetId());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<UUID> getDamagedBySource() {
|
public Set<UUID> getDamagedBySource() {
|
||||||
|
|
|
@ -13,10 +13,8 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.*;
|
import mage.constants.*;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.events.GameEvent.EventType;
|
|
||||||
import mage.game.events.ZoneChangeEvent;
|
import mage.game.events.ZoneChangeEvent;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
import mage.watchers.Watcher;
|
import mage.watchers.Watcher;
|
||||||
|
@ -110,12 +108,14 @@ class DamagedByEnchantedWatcher extends Watcher {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void watch(GameEvent event, Game game) {
|
public void watch(GameEvent event, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
|
if (event.getType() == GameEvent.EventType.DAMAGED_PERMANENT) {
|
||||||
Permanent enchantment = game.getPermanent(this.getSourceId());
|
Permanent enchantment = game.getPermanent(this.getSourceId());
|
||||||
if (enchantment != null && enchantment.isAttachedTo(event.getSourceId())) {
|
if (enchantment != null && enchantment.isAttachedTo(event.getSourceId())) {
|
||||||
|
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||||
|
if (permanent != null && permanent.isCreature()) {
|
||||||
MageObjectReference mor = new MageObjectReference(event.getTargetId(), game);
|
MageObjectReference mor = new MageObjectReference(event.getTargetId(), game);
|
||||||
damagedCreatures.add(mor);
|
damagedCreatures.add(mor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ class KusariGamaAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -71,13 +71,13 @@ class LashknifeBarrierEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE;
|
return event.getType() == EventType.DAMAGE_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
Permanent creature = game.getPermanent(event.getTargetId());
|
Permanent creature = game.getPermanent(event.getTargetId());
|
||||||
return creature != null && creature.isControlledBy(source.getControllerId());
|
return creature != null && creature.isPlaneswalker() && creature.isControlledBy(source.getControllerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,8 @@ class LeylinePhantomTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE || event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER || event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT
|
||||||
|
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -18,7 +18,7 @@ import mage.constants.TargetController;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.DamageCreatureEvent;
|
import mage.game.events.DamageEvent;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ class LichenthropeEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||||
DamageCreatureEvent damageEvent = (DamageCreatureEvent) event;
|
DamageEvent damageEvent = (DamageEvent) event;
|
||||||
Permanent p = game.getPermanent(source.getSourceId());
|
Permanent p = game.getPermanent(source.getSourceId());
|
||||||
if (p != null) {
|
if (p != null) {
|
||||||
p.addCounters(CounterType.M1M1.createInstance(damageEvent.getAmount()), source.getControllerId(), source, game);
|
p.addCounters(CounterType.M1M1.createInstance(damageEvent.getAmount()), source.getControllerId(), source, game);
|
||||||
|
@ -76,7 +76,7 @@ class LichenthropeEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -54,9 +54,9 @@ class LightOfSanctionEffect extends PreventionEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.DAMAGE_CREATURE) {
|
if (event.getType() == GameEvent.EventType.DAMAGE_PERMANENT) {
|
||||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||||
if (permanent != null && permanent.isControlledBy(source.getControllerId())) {
|
if (permanent != null && permanent.isCreature() && permanent.isControlledBy(source.getControllerId())) {
|
||||||
MageObject damageSource = game.getObject(event.getSourceId());
|
MageObject damageSource = game.getObject(event.getSourceId());
|
||||||
if (damageSource instanceof Controllable) {
|
if (damageSource instanceof Controllable) {
|
||||||
return ((Controllable) damageSource).isControlledBy(source.getControllerId());
|
return ((Controllable) damageSource).isControlledBy(source.getControllerId());
|
||||||
|
|
|
@ -56,8 +56,7 @@ class LuminescePreventionEffect extends PreventionEffectImpl {
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
if (super.applies(event, source, game)) {
|
if (super.applies(event, source, game)) {
|
||||||
if (event.getType() == GameEvent.EventType.DAMAGE_PLAYER
|
if (event.getType() == GameEvent.EventType.DAMAGE_PLAYER
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGE_CREATURE
|
|| event.getType() == GameEvent.EventType.DAMAGE_PERMANENT) {
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER) {
|
|
||||||
MageObject sourceObject = game.getObject(event.getSourceId());
|
MageObject sourceObject = game.getObject(event.getSourceId());
|
||||||
if (sourceObject != null
|
if (sourceObject != null
|
||||||
&& (sourceObject.getColor(game).shares(ObjectColor.BLACK) || sourceObject.getColor(game).shares(ObjectColor.RED))) {
|
&& (sourceObject.getColor(game).shares(ObjectColor.BLACK) || sourceObject.getColor(game).shares(ObjectColor.RED))) {
|
||||||
|
|
|
@ -150,9 +150,8 @@ class MasterOfCrueltiesNoDamageEffect extends ContinuousRuleModifyingEffectImpl
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
case DAMAGE_CREATURE:
|
case DAMAGE_PERMANENT:
|
||||||
case DAMAGE_PLAYER:
|
case DAMAGE_PLAYER:
|
||||||
case DAMAGE_PLANESWALKER:
|
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -73,7 +73,7 @@ class MirrorwoodTreefolkEffect extends RedirectionEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -59,7 +59,7 @@ class NestedGhoulTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE;
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -156,8 +156,7 @@ class NikoArisDamageTriggeredAbility extends DelayedTriggeredAbility {
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
case DAMAGED_PLAYER:
|
case DAMAGED_PLAYER:
|
||||||
case DAMAGED_CREATURE:
|
case DAMAGED_PERMANENT:
|
||||||
case DAMAGED_PLANESWALKER:
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -55,9 +55,8 @@ class NoblePurposeTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE
|
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -88,8 +88,7 @@ class OboshThePreypiercerEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER)
|
return event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER)
|
||||||
|| event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE)
|
|| event.getType().equals(GameEvent.EventType.DAMAGED_PERMANENT);
|
||||||
|| event.getType().equals(GameEvent.EventType.DAMAGE_PLANESWALKER);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -83,8 +83,7 @@ class OpalEyeKondasYojimboRedirectionEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE ||
|
return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT ||
|
||||||
event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER ||
|
|
||||||
event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.DamageCreatureEvent;
|
import mage.game.events.DamageEvent;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.events.GameEvent.EventType;
|
import mage.game.events.GameEvent.EventType;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
@ -80,7 +80,7 @@ class OraclesAttendantsReplacementEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||||
DamageCreatureEvent damageEvent = (DamageCreatureEvent) event;
|
DamageEvent damageEvent = (DamageEvent) event;
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
permanent.damage(damageEvent.getAmount(), damageEvent.getSourceId(), source, game, damageEvent.isCombatDamage(), damageEvent.isPreventable());
|
permanent.damage(damageEvent.getAmount(), damageEvent.getSourceId(), source, game, damageEvent.isCombatDamage(), damageEvent.isPreventable());
|
||||||
return true;
|
return true;
|
||||||
|
@ -90,7 +90,7 @@ class OraclesAttendantsReplacementEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE;
|
return event.getType() == EventType.DAMAGE_PERMANENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue