mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
[SPM] implement Alien Symbiosis
This commit is contained in:
parent
54a8e8ef31
commit
73205c4be2
4 changed files with 157 additions and 1 deletions
101
Mage.Sets/src/mage/cards/a/AlienSymbiosis.java
Normal file
101
Mage.Sets/src/mage/cards/a/AlienSymbiosis.java
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import mage.MageIdentifier;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.Costs;
|
||||
import mage.abilities.costs.CostsImpl;
|
||||
import mage.abilities.costs.common.DiscardCardCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.AsThoughEffectImpl;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.continuous.AddCardSubtypeAttachedEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.abilities.keyword.MenaceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jmlundeen
|
||||
*/
|
||||
public final class AlienSymbiosis extends CardImpl {
|
||||
|
||||
public AlienSymbiosis(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
|
||||
|
||||
this.subtype.add(SubType.AURA);
|
||||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||
this.addAbility(new EnchantAbility(auraTarget));
|
||||
|
||||
// Enchanted creature gets +1/+1, has menace, and is a Symbiote in addition to its other types.
|
||||
Ability ability = new SimpleStaticAbility(new BoostEnchantedEffect(1, 1));
|
||||
ability.addEffect(new GainAbilityAttachedEffect(new MenaceAbility(), null).concatBy(","));
|
||||
ability.addEffect(new AddCardSubtypeAttachedEffect(SubType.SYMBIOTE, AttachmentType.AURA).concatBy(",").setText("and is a Symbiote in addition to its other types"));
|
||||
this.addAbility(ability);
|
||||
|
||||
// You may cast this card from your graveyard by discarding a card in addition to paying its other costs.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.GRAVEYARD, new AlienSymbiosisGraveyardEffect()));
|
||||
}
|
||||
|
||||
private AlienSymbiosis(final AlienSymbiosis card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AlienSymbiosis copy() {
|
||||
return new AlienSymbiosis(this);
|
||||
}
|
||||
}
|
||||
class AlienSymbiosisGraveyardEffect extends AsThoughEffectImpl {
|
||||
|
||||
AlienSymbiosisGraveyardEffect() {
|
||||
super(AsThoughEffectType.CAST_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfGame, Outcome.PutCreatureInPlay);
|
||||
this.staticText = "You may cast this card from your graveyard by discarding a card in addition to paying its other costs.";
|
||||
}
|
||||
|
||||
private AlienSymbiosisGraveyardEffect(final AlienSymbiosisGraveyardEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AlienSymbiosisGraveyardEffect copy() {
|
||||
return new AlienSymbiosisGraveyardEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
if (!objectId.equals(source.getSourceId()) || !source.isControlledBy(affectedControllerId)
|
||||
|| game.getState().getZone(source.getSourceId()) != Zone.GRAVEYARD) {
|
||||
return false;
|
||||
}
|
||||
Player controller = game.getPlayer(affectedControllerId);
|
||||
if (controller != null) {
|
||||
Costs<Cost> costs = new CostsImpl<>();
|
||||
costs.add(new DiscardCardCost());
|
||||
controller.setCastSourceIdWithAlternateMana(objectId, new ManaCostsImpl<>("{1}{B}"), costs,
|
||||
MageIdentifier.AlienSymbiosisAlternateCast);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -26,6 +26,7 @@ public final class MarvelsSpiderMan extends ExpansionSet {
|
|||
|
||||
cards.add(new SetCardInfo("Agent Venom", 255, Rarity.RARE, mage.cards.a.AgentVenom.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Agent Venom", 49, Rarity.RARE, mage.cards.a.AgentVenom.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Alien Symbiosis", 50, Rarity.UNCOMMON, mage.cards.a.AlienSymbiosis.class));
|
||||
cards.add(new SetCardInfo("Amazing Acrobatics", 25, Rarity.COMMON, mage.cards.a.AmazingAcrobatics.class));
|
||||
cards.add(new SetCardInfo("Angry Rabble", 75, Rarity.COMMON, mage.cards.a.AngryRabble.class));
|
||||
cards.add(new SetCardInfo("Anti-Venom, Horrifying Healer", 1, Rarity.MYTHIC, mage.cards.a.AntiVenomHorrifyingHealer.class, NON_FULL_USE_VARIOUS));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
package org.mage.test.cards.single.spm;
|
||||
|
||||
import mage.abilities.keyword.MenaceAbility;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jmlundeen
|
||||
*/
|
||||
public class AlienSymbiosisTest extends CardTestPlayerBase {
|
||||
|
||||
/*
|
||||
Alien Symbiosis
|
||||
{1}{B}
|
||||
Enchantment - Aura
|
||||
Enchant creature
|
||||
Enchanted creature gets +1/+1, has menace, and is a Symbiote in addition to its other types.
|
||||
You may cast this card from your graveyard by discarding a card in addition to paying its other costs.
|
||||
*/
|
||||
private static final String alienSymbiosis = "Alien Symbiosis";
|
||||
|
||||
/*
|
||||
Bear Cub
|
||||
{1}{G}
|
||||
Creature - Bear
|
||||
|
||||
2/2
|
||||
*/
|
||||
private static final String bearCub = "Bear Cub";
|
||||
|
||||
@Test
|
||||
public void testAlienSymbiosisCastFromGrave() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.GRAVEYARD, playerA, alienSymbiosis);
|
||||
addCard(Zone.HAND, playerA, "Island");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
|
||||
addCard(Zone.BATTLEFIELD, playerA, bearCub);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, alienSymbiosis, bearCub);
|
||||
|
||||
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertPowerToughness(playerA, bearCub, 3, 3);
|
||||
assertAbilityCount(playerA, bearCub, MenaceAbility.class, 1);
|
||||
assertSubtype(bearCub, SubType.SYMBIOTE);
|
||||
}
|
||||
}
|
||||
|
|
@ -87,7 +87,8 @@ public enum MageIdentifier {
|
|||
ValgavothTerrorEaterAlternateCast,
|
||||
LightstallInquisitorAlternateCast,
|
||||
UndeadSprinterAlternateCast,
|
||||
GwenomRemorselessAlternateCast;
|
||||
GwenomRemorselessAlternateCast,
|
||||
AlienSymbiosisAlternateCast;
|
||||
|
||||
/**
|
||||
* Additional text if there is need to differentiate two very similar effects
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue