mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 14:32:06 -08:00
* Ashcloud Phoenix - Fixed that the dies triggered abilitiy worked if he died face down.
This commit is contained in:
parent
4a051612d1
commit
b382865e8d
5 changed files with 49 additions and 15 deletions
|
|
@ -895,14 +895,6 @@ public abstract class AbilityImpl implements Ability {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
// else if (object instanceof PermanentCard) {
|
||||
// this check prevents Flying to work if assigned to a face down creature
|
||||
// Why is this neccessary??
|
||||
// if (((PermanentCard)object).isFaceDown(game)&& !this.getWorksFaceDown()) {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
|
||||
// check against current state
|
||||
Zone test = game.getState().getZone(parameterSourceId);
|
||||
return test != null && zone.match(test);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,8 @@ public class TriggeredAbilities extends ConcurrentHashMap<String, TriggeredAbili
|
|||
continue;
|
||||
}
|
||||
// for effects like when leaves battlefield or destroyed use ShortLKI to check if permanent was in the correct zone before (e.g. Oblivion Ring or Karmic Justice)
|
||||
if (ability.isInUseableZone(game, null, event.getType().equals(EventType.ZONE_CHANGE) || event.getType().equals(EventType.DESTROYED_PERMANENT))) {
|
||||
if (ability.isInUseableZone(game, ability.getSourceObject(game), event.getType().equals(EventType.ZONE_CHANGE) || event.getType().equals(EventType.DESTROYED_PERMANENT))) {
|
||||
|
||||
if (!game.getContinuousEffects().preventedByRuleModification(event, ability, game, false)) {
|
||||
MageObject object = null;
|
||||
if (!ability.getZone().equals(Zone.COMMAND) && !game.getState().getZone(ability.getSourceId()).equals(ability.getZone())) {
|
||||
|
|
@ -82,6 +83,9 @@ public class TriggeredAbilities extends ConcurrentHashMap<String, TriggeredAbili
|
|||
|
||||
if (object != null) {
|
||||
if (object instanceof Permanent) {
|
||||
if (((Permanent)object).isFaceDown(game) && !ability.getWorksFaceDown()) {
|
||||
continue;
|
||||
}
|
||||
ability.setControllerId(((Permanent) object).getControllerId());
|
||||
}
|
||||
ability.setSourceObject(object);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import mage.abilities.effects.Effect;
|
|||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -56,7 +57,7 @@ public class DiesTriggeredAbility extends ZoneChangeTriggeredAbility {
|
|||
@Override
|
||||
public boolean isInUseableZone(Game game, MageObject source, boolean checkLKI) {
|
||||
// check it was previously on battlefield
|
||||
MageObject before = game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD);
|
||||
Permanent before = (Permanent) game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD);
|
||||
// check now it is in graveyard
|
||||
Zone after = game.getState().getZone(sourceId);
|
||||
return before != null && after != null && Zone.GRAVEYARD.match(after);
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ public class BecomesFaceDownCreatureEffect extends ContinuousEffectImpl implemen
|
|||
break;
|
||||
case AbilityAddingRemovingEffects_6:
|
||||
Card card = game.getCard(permanent.getId()); //
|
||||
List<Ability> abilities = new ArrayList<>();
|
||||
List<Ability> abilitiesToRemove = new ArrayList<>();
|
||||
for (Ability ability : permanent.getAbilities()) {
|
||||
if (card != null && !card.getAbilities().contains(ability)) {
|
||||
// gained abilities from other sources won't be removed
|
||||
|
|
@ -174,9 +174,9 @@ public class BecomesFaceDownCreatureEffect extends ContinuousEffectImpl implemen
|
|||
}
|
||||
}
|
||||
}
|
||||
abilities.add(ability);
|
||||
abilitiesToRemove.add(ability);
|
||||
}
|
||||
permanent.getAbilities().removeAll(abilities);
|
||||
permanent.getAbilities().removeAll(abilitiesToRemove);
|
||||
if (turnFaceUpAbility != null) {
|
||||
permanent.addAbility(turnFaceUpAbility, source.getSourceId(), game);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue