mirror of
https://github.com/magefree/mage.git
synced 2026-01-19 09:49:54 -08:00
* Fixed some problems with transform triggering on the wrong card side.
This commit is contained in:
parent
6e5caa2539
commit
04ce4c85c0
1 changed files with 4 additions and 12 deletions
|
|
@ -892,20 +892,12 @@ public abstract class AbilityImpl implements Ability {
|
|||
}
|
||||
|
||||
if (object != null && !object.getAbilities().contains(this)) {
|
||||
boolean found = false;
|
||||
// unfortunately we need to handle double faced cards separately and only this way
|
||||
if (object instanceof PermanentCard) {
|
||||
if (((PermanentCard)object).canTransform()) {
|
||||
PermanentCard permanent = (PermanentCard)object;
|
||||
found = permanent.getSecondCardFace().getAbilities().contains(this) || permanent.getCard().getAbilities().contains(this);
|
||||
}
|
||||
} else {
|
||||
if (!(object instanceof Permanent)) {
|
||||
// check if it's an ability that is temporary gained to a card
|
||||
Abilities<Ability> otherAbilities = game.getState().getAllOtherAbilities(this.getSourceId());
|
||||
found = otherAbilities != null && otherAbilities.contains(this);
|
||||
}
|
||||
if (!found) {
|
||||
return false;
|
||||
if (otherAbilities == null || !otherAbilities.contains(this)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
// check against current state
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue