mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
* Pay No Heed - Fixed that cannot prevent multi - target damage and combat damage
This commit is contained in:
parent
8660beca89
commit
7c6e9724ce
1 changed files with 125 additions and 125 deletions
|
@ -36,6 +36,7 @@ import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Rarity;
|
import mage.constants.Rarity;
|
||||||
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.target.TargetSource;
|
import mage.target.TargetSource;
|
||||||
|
|
||||||
|
@ -67,7 +68,6 @@ public class PayNoHeed extends CardImpl<PayNoHeed> {
|
||||||
}
|
}
|
||||||
|
|
||||||
class PayNoHeedEffect extends PreventionEffectImpl<PayNoHeedEffect> {
|
class PayNoHeedEffect extends PreventionEffectImpl<PayNoHeedEffect> {
|
||||||
|
|
||||||
private TargetSource target = new TargetSource();
|
private TargetSource target = new TargetSource();
|
||||||
|
|
||||||
public PayNoHeedEffect() {
|
public PayNoHeedEffect() {
|
||||||
|
@ -97,7 +97,7 @@ class PayNoHeedEffect extends PreventionEffectImpl<PayNoHeedEffect> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||||
if (event.getTargetId().equals(source.getControllerId()) && event.getSourceId().equals(target.getFirstTarget())) {
|
if (event.getSourceId().equals(target.getFirstTarget())) {
|
||||||
preventDamage(event, source, target.getFirstTarget(), game);
|
preventDamage(event, source, target.getFirstTarget(), game);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -115,8 +115,8 @@ class PayNoHeedEffect extends PreventionEffectImpl<PayNoHeedEffect> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
if (!this.used && super.applies(event, source, game)) {
|
if (event instanceof DamageEvent && super.applies(event, source, game)) {
|
||||||
if (event.getTargetId().equals(source.getControllerId()) && event.getSourceId().equals(target.getFirstTarget())) {
|
if (event.getSourceId().equals(target.getFirstTarget())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue