Player player = game.getPlayer(this.getControllerId());
if (player != null) {
if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null) {
SpellAbility spellAbility = spell.getSpellAbility();
for (Target target : spellAbility.getTargets()) {
if (!target.isNotTarget()) {
for (UUID targetId : target.getTargets()) {
if (game.getBattlefield().containsPermanent(targetId)) {
returnValue = true;
targettedPermanents.add(targetId);
}
}
}
}
for (Effect effect : spellAbility.getEffects()) {
for (UUID targetId : effect.getTargetPointer().getTargets(game, spellAbility)) {
if (game.getBattlefield().containsPermanent(targetId)) {
returnValue = true;
targettedPermanents.add(targetId);
}