Inquisitor's Flail fix

This commit is contained in:
magenoxx 2012-05-20 17:42:05 +04:00
parent 41006a822a
commit 1208c7d359

View file

@ -37,6 +37,7 @@ import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.events.DamagedEvent;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
@ -93,13 +94,16 @@ class InquisitorsFlailEffect extends ReplacementEffectImpl<InquisitorsFlailEffec
case DAMAGE_CREATURE:
case DAMAGE_PLAYER:
case DAMAGE_PLANESWALKER:
Permanent equipment = game.getPermanent(source.getSourceId());
if (equipment != null && equipment.getAttachedTo() != null) {
UUID attachedTo = equipment.getAttachedTo();
if (event.getSourceId().equals(attachedTo)) {
event.setAmount(event.getAmount() * 2);
} else if (event.getTargetId().equals(attachedTo)) {
event.setAmount(event.getAmount() * 2);
if (((DamagedEvent) event).isCombatDamage()) {
Permanent equipment = game.getPermanent(source.getSourceId());
if (equipment != null && equipment.getAttachedTo() != null) {
UUID attachedTo = equipment.getAttachedTo();
if (event.getSourceId().equals(attachedTo)) {
event.setAmount(event.getAmount() * 2);
} else if (event.getTargetId().equals(attachedTo)) {
event.setAmount(event.getAmount() * 2);
}
return true;
}
}
}