mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-11 16:26:22 +00:00
YMKM: roalesk_prime_specimen + support (#4903)
* roalesk_prime_specimen + support * allow added abilities to show on face-down cards
This commit is contained in:
@@ -103,6 +103,9 @@ public final class CardFacePredicates {
|
||||
if (!hasManaCost(input, manaCost)) {
|
||||
return false;
|
||||
}
|
||||
} else if (m.contains("cmcEQ")) {
|
||||
int i = Integer.parseInt(m.substring(5));
|
||||
if (!hasCMC(input, i)) return false;
|
||||
} else if (!hasProperty(input, m)) {
|
||||
return false;
|
||||
}
|
||||
@@ -122,6 +125,11 @@ public final class CardFacePredicates {
|
||||
return mC.equals(input.getManaCost().getShortString());
|
||||
}
|
||||
|
||||
static protected boolean hasCMC(ICardFace input, final int value) {
|
||||
ManaCost cost = input.getManaCost();
|
||||
return cost != null && cost.getCMC() == value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static Predicate<ICardFace> valid(final String val) {
|
||||
|
||||
@@ -253,6 +253,8 @@ public abstract class AnimateEffectBase extends SpellAbilityEffect {
|
||||
if (!"Permanent".equals(duration) && !perpetual) {
|
||||
if ("UntilControllerNextUntap".equals(duration)) {
|
||||
game.getUntap().addUntil(c.getController(), unanimate);
|
||||
} else if ("UntilAnimatedFaceup".equals(duration)) {
|
||||
c.addFaceupCommand(unanimate);
|
||||
} else {
|
||||
addUntilCommand(sa, unanimate);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import forge.game.spellability.SpellAbility;
|
||||
import forge.util.Aggregates;
|
||||
import forge.util.Lang;
|
||||
import forge.util.Localizer;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
public class ChooseCardNameEffect extends SpellAbilityEffect {
|
||||
|
||||
@@ -119,6 +120,10 @@ public class ChooseCardNameEffect extends SpellAbilityEffect {
|
||||
Predicate<ICardFace> cpp = Predicates.alwaysTrue();
|
||||
if (sa.hasParam("ValidCards")) {
|
||||
//Calculating/replacing this must happen before running valid in CardFacePredicates
|
||||
if (valid.contains("cmcEQ") && !StringUtils.isNumeric(valid.split("cmcEQ")[1])) {
|
||||
String s = valid.split("cmcEQ")[1];
|
||||
valid = valid.replace(s, String.valueOf(AbilityUtils.calculateAmount(host, s, sa)));
|
||||
}
|
||||
if (valid.contains("ManaCost=")) {
|
||||
if (valid.contains("ManaCost=Equipped")) {
|
||||
String s = host.getEquipping().getManaCost().getShortString();
|
||||
|
||||
@@ -2819,7 +2819,9 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
||||
addedManaStrings.add(sAbility);
|
||||
}
|
||||
|
||||
if (!sAbility.endsWith(state.getName() + "\r\n")) {
|
||||
boolean alwaysShow = false;
|
||||
if (!sa.isIntrinsic()) alwaysShow = true; // allows added abilities to show on face-down stuff (e.g. Morph,Cloaked)
|
||||
if (!sAbility.endsWith(state.getName() + "\r\n") || alwaysShow) {
|
||||
sb.append(sAbility);
|
||||
sb.append("\r\n");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
Name:Roalesk, Prime Specimen
|
||||
ManaCost:2 G U
|
||||
Types:Legendary Creature Human Mutant
|
||||
PT:4/5
|
||||
K:Flying
|
||||
T:Mode$ TurnFaceUp | ValidCard$ Card.Self,Permanent.Other+YouCtrl | Execute$ TrigRandom | TriggerZones$ Battlefield | TriggerDescription$ Whenever CARDNAME or another permanent you control is turned face up, you may pay {X}. If you do, if X is 1 or more, conjure a duplicate of a random creature card with mana value X into your hand. Cloak it. It gains "{G/U}: Turn this creature face up" for as long as it remains face down.
|
||||
SVar:TrigRandom:AB$ NameCard | Cost$ X | ConditionCheckSVar$ X | ValidCards$ Creature.cmcEQX | AtRandom$ True | SubAbility$ DBConjure
|
||||
SVar:DBConjure:DB$ MakeCard | Name$ ChosenName | Conjure$ True | ConditionCheckSVar$ X | Zone$ Hand | RememberMade$ True | SubAbility$ DBCloak
|
||||
SVar:DBCloak:DB$ Cloak | Defined$ Remembered | SubAbility$ DBAnimate
|
||||
SVar:DBAnimate:DB$ Animate | Defined$ Remembered | Duration$ UntilAnimatedFaceup | Abilities$ ABTurn | SubAbility$ DBCleanup
|
||||
SVar:ABTurn:AB$ SetState | Cost$ GU | Defined$ Self | Mode$ TurnFaceUp | SpellDescription$ Turn this creature face up.
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearNamedCard$ True | ClearRemembered$ True
|
||||
SVar:X:Count$xPaid
|
||||
K:Disguise:G U
|
||||
DeckHints:Keyword$Morph|Megamorph|Disguise
|
||||
Oracle:Flying\nWhenever Roalesk, Prime Specimen or another permanent you control is turned face up, you may pay {X}. If you do, if X is 1 or more, conjure a duplicate of a random creature card with mana value X into your hand. Cloak it. It gains "{G/U}: Turn this creature face up" for as long as it remains face down.\nDisguise {G}{U}
|
||||
Reference in New Issue
Block a user