[WHO] Implement Adipose Offspring (#11570)

* EmergeAbility take a string instead of a ManaCosts object

* Save Emerge's sacrificed creature MOR in a costs tag

* Implement Adipose Offspring

* Fix costs tag clearing while permanent still on the battlefield

* improved version of game.getPermanentOrLKIBattlefield with MageObjectReference

* Use correct Alien token

* cleanup imports

* merge fix
This commit is contained in:
ssk97 2023-12-26 12:22:43 -08:00 committed by GitHub
parent 01ff7d6e1a
commit 429043d7b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 150 additions and 37 deletions

View file

@ -1,10 +1,12 @@
package mage.abilities.keyword;
import mage.ApprovingObject;
import mage.MageObjectReference;
import mage.Mana;
import mage.abilities.SpellAbility;
import mage.abilities.costs.mana.ManaCost;
import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.mana.ManaOptions;
import mage.cards.Card;
import mage.constants.Outcome;
@ -26,10 +28,11 @@ import java.util.UUID;
public class EmergeAbility extends SpellAbility {
private final ManaCosts<ManaCost> emergeCost;
public static final String EMERGE_ACTIVATION_CREATURE_REFERENCE = "emergeActivationMOR";
public EmergeAbility(Card card, ManaCosts<ManaCost> emergeCost) {
public EmergeAbility(Card card, String emergeString) {
super(card.getSpellAbility());
this.emergeCost = emergeCost.copy();
this.emergeCost = new ManaCostsImpl<>(emergeString);
this.newId(); // Set newId because cards spell ability is copied and needs own id
this.setCardName(card.getName() + " with emerge");
zone = Zone.HAND;
@ -94,7 +97,9 @@ public class EmergeAbility extends SpellAbility {
if (creature != null) {
CardUtil.reduceCost(this, creature.getManaValue());
if (super.activate(game, false)) {
MageObjectReference mor = new MageObjectReference(creature, game);
if (creature.sacrifice(this, game)) {
this.setCostsTag(EMERGE_ACTIVATION_CREATURE_REFERENCE, mor); //Can access with LKI afterwards
return true;
} else {
activated = false;

View file

@ -0,0 +1,29 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
/**
* @author notgreat
*/
public final class AlienToken extends TokenImpl {
public AlienToken() {
super("Alien Token", "2/2 white Alien creature token");
cardType.add(CardType.CREATURE);
color.setWhite(true);
subtype.add(SubType.ALIEN);
power = new MageInt(2);
toughness = new MageInt(2);
}
protected AlienToken(final AlienToken token) {
super(token);
}
public AlienToken copy() {
return new AlienToken(this);
}
}