Merge branch 'neo_recon' into 'master'

NEO: Initial Reconfigure keyword support and cards

See merge request core-developers/forge!6089
This commit is contained in:
Michael Kamensky
2022-01-30 04:40:57 +00:00
9 changed files with 74 additions and 4 deletions

View File

@@ -217,7 +217,8 @@ public abstract class GameEntity extends GameObject implements IIdentifiable {
}
public boolean canBeAttached(final Card attach, boolean checkSBA) {
// master mode
if (!attach.isAttachment() || attach.isCreature() || equals(attach)) {
if (!attach.isAttachment() || (attach.isCreature() && !attach.hasKeyword(Keyword.RECONFIGURE))
|| equals(attach)) {
return false;
}

View File

@@ -1948,7 +1948,8 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
sbLong.append(TextUtil.fastReplace(keyword, ":", " ")).append("\r\n");
} else if (keyword.startsWith("Morph") || keyword.startsWith("Megamorph")
|| keyword.startsWith("Escape") || keyword.startsWith("Foretell:")
|| keyword.startsWith("Disturb") || keyword.startsWith("Madness:")){
|| keyword.startsWith("Disturb") || keyword.startsWith("Madness:")
|| keyword.startsWith("Reconfigure")) {
String[] k = keyword.split(":");
sbLong.append(k[0]);
if (k.length > 1) {

View File

@@ -2773,8 +2773,8 @@ public class CardFactoryUtil {
String equipCost = k[1];
String valid = k.length > 2 && !k[2].isEmpty() ? k[2] : "Creature.YouCtrl";
String vstr = k.length > 3 && !k[3].isEmpty() ? k[3] : "creature";
String extra = k.length > 4 ? k[4] : "";
String extraDesc = k.length > 5 ? k[5] : "";
String extra = k.length > 4 ? k[4] : "";
String extraDesc = k.length > 5 ? k[5] : "";
// Create attach ability string
final StringBuilder abilityStr = new StringBuilder();
abilityStr.append("AB$ Attach | Cost$ ");
@@ -3111,6 +3111,27 @@ public class CardFactoryUtil {
newSA.setIntrinsic(intrinsic);
inst.addSpellAbility(newSA);
} else if (keyword.startsWith("Reconfigure")) {
if (!keyword.contains(":")) {
System.err.println("Malformed Reconfigure entry! - Card: " + card.toString());
return;
}
String[] k = keyword.split(":");
String bothStr = "| Cost$ " + k[1] + " | SorcerySpeed$ True | Reconfigure$ True | PrecostDesc$ Reconfigure ";
final StringBuilder attachStr = new StringBuilder();
attachStr.append("AB$ Attach | ValidTgts$ Creature.YouCtrl+Other | TgtPrompt$ Select target creature you ");
attachStr.append("control | AILogic$ Pump | Secondary$ True | SpellDescription$ Attach ").append(bothStr);
final StringBuilder unattachStr = new StringBuilder();
unattachStr.append("AB$ Unattach | Defined$ Self | SpellDescription$ Unattach | Secondary$ True ");
unattachStr.append(bothStr);
// instantiate attach ability
SpellAbility attachSA = AbilityFactory.getAbility(attachStr.toString(), card);
attachSA.setIntrinsic(intrinsic);
inst.addSpellAbility(attachSA);
// instantiate unattach ability
SpellAbility unattachSA = AbilityFactory.getAbility(unattachStr.toString(), card);
unattachSA.setIntrinsic(intrinsic);
inst.addSpellAbility(unattachSA);
} else if (keyword.startsWith("Reinforce")) {
final String[] k = keyword.split(":");
final String n = k[1];
@@ -3585,6 +3606,10 @@ public class CardFactoryUtil {
}
effect += " | Description$ " + desc;
inst.addStaticAbility(StaticAbility.create(effect, state.getCard(), state, intrinsic));
} else if (keyword.startsWith("Reconfigure")) {
String effect = "Mode$ Continuous | Affected$ Card.Self | IsPresent$ Card.Self+AttachedTo Creature | "
+ "RemoveType$ Creature | Secondary$ True | Description$ Reconfigure (" + inst.getReminderText() + ")";
inst.addStaticAbility(StaticAbility.create(effect, state.getCard(), state, intrinsic));
} else if (keyword.equals("Shroud")) {
String effect = "Mode$ CantTarget | Shroud$ True | ValidCard$ Card.Self | Secondary$ True"
+ " | Description$ Shroud (" + inst.getReminderText() + ")";

View File

@@ -135,6 +135,7 @@ public enum Keyword {
REACH("Reach", SimpleKeyword.class, true, "This creature can block creatures with flying."),
REBOUND("Rebound", SimpleKeyword.class, true, "If you cast this spell from your hand, exile it as it resolves. At the beginning of your next upkeep, you may cast this card from exile without paying its mana cost."),
RECOVER("Recover", KeywordWithCost.class, false, "When a creature is put into your graveyard from the battlefield, you may pay %s. If you do, return this card from your graveyard to your hand. Otherwise, exile this card."),
RECONFIGURE("Reconfigure", KeywordWithCost.class, false, "%s: Attach to target creature you control; or unattach from a creature. Reconfigure only as a sorcery. While attached, this isn't a creature."),
REFLECT("Reflect", KeywordWithCost.class, false, "As this enters the battlefield, each opponent may pay %s. When they do, they create a token copy of this except it lacks this ability."),
REINFORCE("Reinforce", KeywordWithCostAndAmount.class, false, "%s, Discard this card: Put {%d:+1/+1 counter} on target creature."),
RENOWN("Renown", KeywordWithAmount.class, false, "When this creature deals combat damage to a player, if it isn't renowned, put {%d:+1/+1 counter} on it and it becomes renowned."),

View File

@@ -0,0 +1,8 @@
Name:Bronzeplate Boar
ManaCost:2 R
Types:Artifact Creature Equipment Boar
PT:3/2
K:Trample
S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddPower$ 3 | AddToughness$ 2 | AddKeyword$ Trample | Description$ Equipped creature gets +3/+2 and has trample.
K:Reconfigure:5
Oracle:Trample\nEquipped creature gets +3/+2 and has trample.\nReconfigure {5} ({5}: Attach to target creature you control; or unattach from a creature. Reconfigure only as a sorcery. While attached, this isn't a creature.)

View File

@@ -0,0 +1,9 @@
Name:Leech Gauntlet
ManaCost:1 B
Types:Artifact Creature Equipment Leech
PT:2/2
K:Lifelink
S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddKeyword$ Lifelink | Description$ Equipped creature has lifelink.
K:Reconfigure:4
DeckHas:Ability$LifeGain
Oracle:Lifelink\nEquipped creature has lifelink.\nReconfigure {4} ({4}: Attach to target creature you control; or unattach from a creature. Reconfigure only as a sorcery. While attached, this isn't a creature.)

View File

@@ -0,0 +1,8 @@
Name:Lizard Blades
ManaCost:1 R
Types:Artifact Creature Equipment Lizard
PT:1/1
K:Double strike
S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddKeyword$ Double strike | Description$ Equipped creature has double strike.
K:Reconfigure:2
Oracle:Trample\nEquipped creature has double strike.\nReconfigure {2} ({2}: Attach to target creature you control; or unattach from a creature. Reconfigure only as a sorcery. While attached, this isn't a creature.)

View File

@@ -0,0 +1,9 @@
Name:Simian Sling
ManaCost:R
Types:Artifact Creature Equipment Monkey
PT:1/1
S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddPower$ 1 | AddToughness$ 1 | Description$ Equipped creature gets +1/+1.
T:Mode$ AttackerBlocked | ValidCard$ Card.Self,Creature.EquippedBy | Execute$ TrigDamage | TriggerDescription$ Whenever CARDNAME or equipped creature becomes blocked, it deals 1 damage to defending player.
SVar:TrigDamage:DB$ DealDamage | Defined$ TriggeredDefendingPlayer | NumDmg$ 1
K:Reconfigure:2
Oracle:Equipped creature gets +1/+1.\nWhenever Simian Sling or equipped creature becomes blocked, it deals 1 damage to defending player.\nReconfigure {2} ({2}: Attach to target creature you control; or unattach from a creature. Reconfigure only as a sorcery. While attached, this isn't a creature.)

View File

@@ -0,0 +1,8 @@
Name:The Reality Chip
ManaCost:1 U
Types:Legendary Artifact Creature Equipment Jellyfish
PT:0/4
S:Mode$ Continuous | Affected$ Card.TopLibrary+YouCtrl | AffectedZone$ Library | MayLookAt$ You | Description$ You may look at the top card of your library any time.
S:Mode$ Continuous | IsPresent$ Card.Self+AttachedTo Creature | Affected$ Card.TopLibrary+YouCtrl | AffectedZone$ Library | MayPlay$ True | Description$ As long as CARDNAME is attached to a creature, you may play lands and cast spells from the top of your library.
K:Reconfigure:2 U
Oracle:You may look at the top card of your library any time.\nAs long as The Reality Chip is attached to a creature, you may play lands and cast spells from the top of your library.\nReconfigure {2}{U} ({2}{U}: Attach to target creature you control; or unattach from a creature. Reconfigure only as a sorcery. While attached, this isn't a creature.)