[CMM] rework Narci, Fable Singer (#10699)

* easy fix first

* use targetPointer in Narci effect.
This commit is contained in:
Susucre 2023-07-29 19:46:40 +02:00 committed by GitHub
parent ba9ede4d66
commit 263b01e702
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View file

@ -1,6 +1,7 @@
package mage.cards.n;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.FinalChapterAbilityResolvesTriggeredAbility;
import mage.abilities.common.SacrificePermanentTriggeredAbility;
@ -17,6 +18,7 @@ import mage.constants.SubType;
import mage.constants.SuperType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
@ -77,7 +79,17 @@ class NarciFableSingerEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
int value = (int) getValue("SAGA_MANACOST");
FixedTarget fixedTarget = targetPointer.getFixedTarget(game, source);
if (fixedTarget == null) {
return false;
}
MageObject saga = game.getObject(fixedTarget.getTarget());
if (saga == null) {
return false;
}
int value = saga.getManaValue();
if (value > 0) {
new LoseLifeOpponentsEffect(value).apply(game, source);
new GainLifeEffect(value).apply(game, source);

View file

@ -94,7 +94,6 @@ public class FinalChapterAbilityResolvesTriggeredAbility extends TriggeredAbilit
if (rememberSaga) {
getEffects().setTargetPointer(new FixedTarget(permanent.getId(), game));
getEffects().setValue("SAGA_MANACOST", permanent.getManaValue());
}
return true;
}