mirror of
https://github.com/correl/mage.git
synced 2024-12-25 19:25:41 +00:00
* Acolyte's Reward - Fixed that the prevented damage was not dealt to second target.
This commit is contained in:
parent
15f0eb402f
commit
a5c0ae1b41
1 changed files with 18 additions and 3 deletions
|
@ -39,6 +39,7 @@ import mage.constants.Rarity;
|
||||||
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.players.Player;
|
||||||
import mage.target.common.TargetCreatureOrPlayer;
|
import mage.target.common.TargetCreatureOrPlayer;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
|
@ -116,10 +117,24 @@ class AcolytesRewardEffect extends PreventionEffectImpl<AcolytesRewardEffect> {
|
||||||
event.setAmount(0);
|
event.setAmount(0);
|
||||||
this.amount -= damage;
|
this.amount -= damage;
|
||||||
}
|
}
|
||||||
|
if (damage > 0) {
|
||||||
|
game.informPlayers(new StringBuilder("Acolyte's Reward ").append("prevented ").append(damage).append(" to ").append(targetCreature.getName()).toString());
|
||||||
|
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE,
|
||||||
|
source.getControllerId(), source.getSourceId(), source.getControllerId(), damage));
|
||||||
|
|
||||||
targetCreature.damage(damage, source.getSourceId(), game, true, false, event.getAppliedEffects());
|
Player targetPlayer = game.getPlayer(source.getTargets().get(1).getFirstTarget());
|
||||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE,
|
if (targetPlayer != null) {
|
||||||
source.getControllerId(), source.getSourceId(), source.getControllerId(), damage));
|
targetPlayer.damage(damage, source.getSourceId(), game, false, true);
|
||||||
|
game.informPlayers(new StringBuilder("Acolyte's Reward ").append("deals ").append(damage).append(" damge to ").append(targetPlayer.getName()).toString());
|
||||||
|
} else {
|
||||||
|
Permanent targetDamageCreature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||||
|
if (targetDamageCreature != null) {
|
||||||
|
targetDamageCreature.damage(damage, source.getSourceId(), game, true, false);
|
||||||
|
game.informPlayers(new StringBuilder("Acolyte's Reward ").append("deals ").append(damage).append(" damge to ").append(targetDamageCreature.getName()).toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue