mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
Fixed targeting prevent effects
This commit is contained in:
parent
f3598fd4db
commit
0890d6e57f
2 changed files with 3 additions and 3 deletions
|
@ -30,13 +30,13 @@ package mage.abilities.effects.common;
|
||||||
|
|
||||||
import mage.Constants.Duration;
|
import mage.Constants.Duration;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.Mode;
|
||||||
import mage.abilities.effects.PreventionEffectImpl;
|
import mage.abilities.effects.PreventionEffectImpl;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Mode;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author nantuko
|
* @author nantuko
|
||||||
|
@ -94,7 +94,7 @@ public class PreventDamageFromTargetEffect extends PreventionEffectImpl<PreventD
|
||||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, target, source.getId(), source.getControllerId(), damage));
|
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, target, source.getId(), source.getControllerId(), damage));
|
||||||
} else {
|
} else {
|
||||||
if (event.getAmount() >= this.amount) {
|
if (event.getAmount() >= this.amount) {
|
||||||
int damage = event.getAmount();
|
int damage = amount;
|
||||||
event.setAmount(event.getAmount() - amount);
|
event.setAmount(event.getAmount() - amount);
|
||||||
this.used = true;
|
this.used = true;
|
||||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, target, source.getId(), source.getControllerId(), damage));
|
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, target, source.getId(), source.getControllerId(), damage));
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class PreventDamageTargetEffect extends PreventionEffectImpl<PreventDamag
|
||||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false);
|
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false);
|
||||||
if (!game.replaceEvent(preventEvent)) {
|
if (!game.replaceEvent(preventEvent)) {
|
||||||
if (event.getAmount() >= this.amount) {
|
if (event.getAmount() >= this.amount) {
|
||||||
int damage = event.getAmount();
|
int damage = amount;
|
||||||
event.setAmount(event.getAmount() - amount);
|
event.setAmount(event.getAmount() - amount);
|
||||||
this.used = true;
|
this.used = true;
|
||||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage));
|
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage));
|
||||||
|
|
Loading…
Reference in a new issue