mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
[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:
parent
01ff7d6e1a
commit
429043d7b5
15 changed files with 150 additions and 37 deletions
|
|
@ -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;
|
||||
|
|
|
|||
29
Mage/src/main/java/mage/game/permanent/token/AlienToken.java
Normal file
29
Mage/src/main/java/mage/game/permanent/token/AlienToken.java
Normal 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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue