mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 20:29:19 -08:00
* Spectral Prison - Fixed that it's ability also triigered for abilities and not only spells.
This commit is contained in:
parent
7f26dbea0d
commit
5248ef1b75
1 changed files with 9 additions and 4 deletions
|
|
@ -46,6 +46,8 @@ import mage.target.TargetPermanent;
|
|||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.game.stack.Spell;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -102,10 +104,13 @@ class SpectralPrisonAbility extends TriggeredAbilityImpl<SpectralPrisonAbility>
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.TARGETED) {
|
||||
Permanent enchantment = game.getPermanent(sourceId);
|
||||
if (enchantment != null && enchantment.getAttachedTo() != null) {
|
||||
if (event.getTargetId().equals(enchantment.getAttachedTo())) {
|
||||
return true;
|
||||
MageObject eventSourceObject = game.getObject(event.getSourceId());
|
||||
if (eventSourceObject != null && eventSourceObject instanceof Spell) {
|
||||
Permanent enchantment = game.getPermanent(sourceId);
|
||||
if (enchantment != null && enchantment.getAttachedTo() != null) {
|
||||
if (event.getTargetId().equals(enchantment.getAttachedTo())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue