mirror of
https://github.com/correl/mage.git
synced 2025-01-12 11:08:01 +00:00
* Dragon Tempest - Fixed a problem if damage was redirected (e.g. with Spellskite) - (fixes #3887).
This commit is contained in:
parent
7e8dcef120
commit
cb15d4728d
2 changed files with 8 additions and 5 deletions
|
@ -46,7 +46,6 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreatureOrPlayer;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -74,7 +73,7 @@ public class DragonTempest extends CardImpl {
|
|||
new DragonTempestDamageEffect(),
|
||||
new FilterCreaturePermanent(SubType.DRAGON, "a Dragon"),
|
||||
false,
|
||||
SetTargetPointer.PERMANENT,
|
||||
SetTargetPointer.NONE,
|
||||
""
|
||||
);
|
||||
ability.addTarget(new TargetCreatureOrPlayer());
|
||||
|
@ -118,15 +117,16 @@ class DragonTempestDamageEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Permanent damageSource = (Permanent) getValue("permanentEnteringBattlefield");
|
||||
int amount = game.getBattlefield().countAll(dragonFilter, controller.getId(), game);
|
||||
if (amount > 0) {
|
||||
Permanent targetCreature = ((FixedTarget) getTargetPointer()).getTargetedPermanentOrLKIBattlefield(game);
|
||||
Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (targetCreature != null) {
|
||||
targetCreature.damage(amount, getTargetPointer().getFirst(game, source), game, false, true);
|
||||
targetCreature.damage(amount, damageSource.getId(), game, false, true);
|
||||
} else {
|
||||
Player player = game.getPlayer(source.getTargets().getFirstTarget());
|
||||
if (player != null) {
|
||||
player.damage(amount, getTargetPointer().getFirst(game, source), game, false, true);
|
||||
player.damage(amount, damageSource.getId(), game, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,6 +105,9 @@ public class EntersBattlefieldAllTriggeredAbility extends TriggeredAbilityImpl {
|
|||
UUID targetId = event.getTargetId();
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent != null && filter.match(permanent, getSourceId(), getControllerId(), game)) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setValue("permanentEnteringBattlefield", permanent);
|
||||
}
|
||||
if (setTargetPointer != SetTargetPointer.NONE) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
switch (setTargetPointer) {
|
||||
|
|
Loading…
Reference in a new issue