[MKC] Implement Experiment Twelve, changes to TargetPermanentPowerCount (#11901)

This commit is contained in:
Cameron Merkel 2024-03-04 04:42:04 -06:00 committed by GitHub
parent 9893032a36
commit fc5ee90bf8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 64 additions and 8 deletions

View file

@ -0,0 +1,58 @@
package mage.cards.e;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.TurnedFaceUpAllTriggeredAbility;
import mage.abilities.dynamicvalue.common.TargetPermanentPowerCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.constants.SubType;
import mage.abilities.keyword.TrampleAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.keyword.DisguiseAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.counters.CounterType;
import mage.filter.FilterPermanentThisOrAnother;
import mage.filter.StaticFilters;
/**
* @author Cguy7777
*/
public final class ExperimentTwelve extends CardImpl {
private static final FilterPermanentThisOrAnother filter = new FilterPermanentThisOrAnother(StaticFilters.FILTER_CONTROLLED_CREATURE, true);
public ExperimentTwelve(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
this.subtype.add(SubType.ELF);
this.subtype.add(SubType.LIZARD);
this.subtype.add(SubType.WARRIOR);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Trample
this.addAbility(TrampleAbility.getInstance());
// Whenever Experiment Twelve or another creature you control is turned face up, put +1/+1 counters on that creature equal to its power.
Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(0), TargetPermanentPowerCount.instance)
.setText("put +1/+1 counters on that creature equal to its power");
this.addAbility(new TurnedFaceUpAllTriggeredAbility(effect, filter, true));
// Disguise {4}{G}
this.addAbility(new DisguiseAbility(this, new ManaCostsImpl<>("{4}{G}")));
}
private ExperimentTwelve(final ExperimentTwelve card) {
super(card);
}
@Override
public ExperimentTwelve copy() {
return new ExperimentTwelve(this);
}
}

View file

@ -12,7 +12,7 @@ import java.util.List;
*/
public final class MurdersAtKarlovManorCommander extends ExpansionSet {
private static final List<String> unfinished = Arrays.asList("Boltbender", "Experiment Twelve", "True Identity", "Ransom Note", "Unexplained Absence", "Veiled Ascension");
private static final List<String> unfinished = Arrays.asList("Boltbender", "True Identity", "Ransom Note", "Unexplained Absence", "Veiled Ascension");
private static final MurdersAtKarlovManorCommander instance = new MurdersAtKarlovManorCommander();
@ -103,6 +103,8 @@ public final class MurdersAtKarlovManorCommander extends ExpansionSet {
cards.add(new SetCardInfo("Everflowing Chalice", 227, Rarity.UNCOMMON, mage.cards.e.EverflowingChalice.class));
cards.add(new SetCardInfo("Exalted Angel", 63, Rarity.RARE, mage.cards.e.ExaltedAngel.class));
cards.add(new SetCardInfo("Exotic Orchard", 260, Rarity.RARE, mage.cards.e.ExoticOrchard.class));
cards.add(new SetCardInfo("Experiment Twelve", 37, Rarity.RARE, mage.cards.e.ExperimentTwelve.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Experiment Twelve", 347, Rarity.RARE, mage.cards.e.ExperimentTwelve.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Farewell", 64, Rarity.RARE, mage.cards.f.Farewell.class));
cards.add(new SetCardInfo("Fell the Mighty", 65, Rarity.RARE, mage.cards.f.FellTheMighty.class));
cards.add(new SetCardInfo("Fellwar Stone", 228, Rarity.UNCOMMON, mage.cards.f.FellwarStone.class));

View file

@ -4,7 +4,6 @@ package mage.abilities.dynamicvalue.common;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -16,12 +15,9 @@ public enum TargetPermanentPowerCount implements DynamicValue {
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
Permanent sourcePermanent = game.getPermanent(sourceAbility.getFirstTarget());
if (sourcePermanent == null) {
sourcePermanent = (Permanent) game.getLastKnownInformation(sourceAbility.getFirstTarget(), Zone.BATTLEFIELD);
}
if (sourcePermanent != null) {
return sourcePermanent.getPower().getValue();
Permanent targetPermanent = effect.getTargetPointer().getFirstTargetPermanentOrLKI(game, sourceAbility);
if (targetPermanent != null) {
return targetPermanent.getPower().getValue();
}
return 0;