Merge pull request #1531 from Northmoc/40k_squad

40K – Squad keyword and cards
This commit is contained in:
Anthony Calosa
2022-09-25 13:24:46 +08:00
committed by GitHub
11 changed files with 94 additions and 2 deletions

View File

@@ -635,6 +635,27 @@ public final class GameActionUtil {
tr.setSVar("ReplicateAmount", String.valueOf(v));
tr.getOverridingAbility().setSVar("ReplicateAmount", String.valueOf(v));
for (int i = 0; i < v; i++) {
if (result == null) {
result = sa.copy();
}
result.getPayCosts().add(cost);
reset = true;
}
}
} else if (o.startsWith("Squad")) {
Trigger tr = Iterables.getFirst(ki.getTriggers(), null);
if (tr != null) {
String costStr = o.split(":")[1];
final Cost cost = new Cost(costStr, false);
String str = "Choose amount for Squad: " + cost.toSimpleString();
int v = pc.chooseNumberForKeywordCost(sa, cost, ki, str, Integer.MAX_VALUE);
tr.setSVar("SquadAmount", String.valueOf(v));
tr.getOverridingAbility().setSVar("SquadAmount", String.valueOf(v));
for (int i = 0; i < v; i++) {
if (result == null) {
result = sa.copy();

View File

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

View File

@@ -1791,6 +1791,19 @@ public class CardFactoryUtil {
parsedTrigger.setOverridingAbility(sp);
inst.addTrigger(parsedTrigger);
} else if (keyword.startsWith("Squad")) {
final String trigScript = "Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | " +
"ValidCard$ Card.Self+wasCast | CheckSVar$ SquadAmount | Secondary$ True | " +
"TriggerDescription$ When this creature enters the battlefield, create that many tokens that " +
"are copies of it.";
final String abString = "DB$ CopyPermanent | Defined$ TriggeredCard | NumCopies$ SquadAmount";
final Trigger squadTrigger = TriggerHandler.parseTrigger(trigScript, card, intrinsic);
final SpellAbility squadAbility = AbilityFactory.getAbility(abString, card);
squadAbility.setSVar("SquadAmount", "0");
squadTrigger.setOverridingAbility(squadAbility);
squadTrigger.setSVar("SquadAmount", "0");
inst.addTrigger(squadTrigger);
} else if (keyword.equals("Storm")) {
final String actualTrigger = "Mode$ SpellCast | ValidCard$ Card.Self | TriggerZones$ Stack | Secondary$ True"
+ "| TriggerDescription$ Storm (" + inst.getReminderText() + ")";

View File

@@ -62,7 +62,7 @@ public final class CardUtil {
"Enchant", "Protection", "Cumulative upkeep", "Equip", "Buyback",
"Cycling", "Echo", "Kicker", "Flashback", "Madness", "Morph",
"Affinity", "Entwine", "Splice", "Ninjutsu", "Presence",
"Transmute", "Replicate", "Recover", "Suspend", "Aura swap",
"Transmute", "Replicate", "Recover", "Squad", "Suspend", "Aura swap",
"Fortify", "Transfigure", "Champion", "Evoke", "Prowl", "IfReach",
"Reinforce", "Unearth", "Level up", "Miracle", "Overload", "Cleave",
"Scavenge", "Encore", "Bestow", "Outlast", "Dash", "Surge", "Emerge", "Hexproof:",

View File

@@ -159,6 +159,7 @@ public enum Keyword {
SPECTACLE("Spectacle", KeywordWithCost.class, false, "You may cast this spell for its spectacle cost rather than its mana cost if an opponent lost life this turn."),
SPLICE("Splice", KeywordWithCostAndType.class, false, "As you cast an %2$s spell, you may reveal this card from your hand and pay its splice cost. If you do, add this card's effects to that spell."),
SPLIT_SECOND("Split second", SimpleKeyword.class, true, "As long as this spell is on the stack, players can't cast other spells or activate abilities that aren't mana abilities."),
SQUAD("Squad", KeywordWithCost.class, false, "As an additional cost to cast this spell, you may pay %s any number of times. When this creature enters the battlefield, create that many tokens that are copies of it."),
STARTING_INTENSITY("Starting intensity", KeywordWithAmount.class, true, null),
STORM("Storm", SimpleKeyword.class, false, "When you cast this spell, copy it for each other spell that was cast before it this turn. You may choose new targets for the copies."),
STRIVE("Strive", KeywordWithCost.class, false, "CARDNAME costs %s more to cast for each target beyond the first."),

View File

@@ -0,0 +1,9 @@
Name:Arco-Flagellant
ManaCost:2 B
Types:Creature Human
PT:3/1
K:Squad:2
K:CARDNAME can't block.
A:AB$ Pump | PrecostDesc$ Endurant — | Cost$ PayLife<3> | KW$ Indestructible | SpellDescription$ CARDNAME gains indestructible until end of turn.
DeckHas:Ability$Token
Oracle:Squad {2} (As an additional cost to cast this spell, you may pay {2} any number of times. When this creature enters the battlefield, create that many tokens that are copies of it.)\nArco-Flagellant can't block.\nEndurant — Pay 3 life: Arco-Flagellant gains indestructible until end of turn.

View File

@@ -0,0 +1,10 @@
Name:Sicarian Infiltrator
ManaCost:2 U
Types:Artifact Creature Human Soldier
PT:1/2
K:Flash
K:Squad:2
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDraw | TriggerDescription$ Benediction of the Omnissiah — When CARDNAME enters the battlefield, draw a card.
SVar:TrigDraw:DB$ Draw | NumCards$ 1
DeckHas:Ability$Token
Oracle:Flash\nSquad {2} (As an additional cost to cast this spell, you may pay {2} any number of times. When this creature enters the battlefield, create that many tokens that are copies of it.)\nBenediction of the Omnissiah — When Sicarian Infiltrator enters the battlefield, draw a card.

View File

@@ -0,0 +1,9 @@
Name:Space Marine Devastator
ManaCost:3 W
Types:Creature Astartes Warrior
PT:3/3
K:Squad:2
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDestroy | TriggerDescription$ Grav-cannon — When CARDNAME enters the battlefield, destroy up to one target artifact or enchantment.
SVar:TrigDestroy:DB$ Destroy | TargetMin$ 0 | TargetMax$ 1 | ValidTgts$ Artifact,Enchantment | TgtPrompt$ Select up to one target artifact or enchantment
DeckHas:Ability$Token
Oracle:Squad {2} (As an additional cost to cast this spell, you may pay {2} any number of times. When this creature enters the battlefield, create that many tokens that are copies of it.)\nGrav-cannon — When Space Marine Devastator enters the battlefield, destroy up to one target artifact or enchantment.

View File

@@ -0,0 +1,8 @@
Name:Ultramarines Honour Guard
ManaCost:3 W
Types:Creature Astartes Warrior
PT:2/2
K:Squad:2
S:Mode$ Continuous | Affected$ Creature.Other+YouCtrl | AddPower$ 1 | AddToughness$ 1 | Description$ Other creatures you control get +1/+1.
DeckHas:Ability$Token
Oracle:Squad {2} (As an additional cost to cast this spell, you may pay {2} any number of times. When this creature enters the battlefield, create that many tokens that are copies of it.)\nOther creatures you control get +1/+1.

View File

@@ -0,0 +1,10 @@
Name:Vanguard Suppressor
ManaCost:3 U
Types:Creature Astartes Warrior
PT:3/2
K:Squad:2
K:Flying
T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigDraw | TriggerDescription$ Suppressing Fire — Whenever CARDNAME deals combat damage to a player, draw a card.
SVar:TrigDraw:DB$ Draw
DeckHas:Ability$Token
Oracle:Squad {2} (As an additional cost to cast this spell, you may pay {2} any number of times. When this creature enters the battlefield, create that many tokens that are copies of it.)\nFlying\nSuppressing Fire — Whenever Vanguard Suppressor deals combat damage to a player, draw a card.

View File

@@ -0,0 +1,10 @@
Name:Zephyrim
ManaCost:3 W
Types:Creature Human Warrior
PT:3/3
K:Squad:2
K:Flying
K:Vigilance
K:Miracle:1 W
DeckHas:Ability$Token
Oracle:Squad {2} (As an additional cost to cast this spell, you may pay {2} any number of times. When this creature enters the battlefield, create that many tokens that are copies of it.)\nFlying, vigilance\nMiracle {1}{W} (You may cast this card for its miracle cost when you draw it if it's the first card you drew this turn.)