Merge branch 'master' into newmaster2

This commit is contained in:
Anthony Calosa
2024-06-09 18:35:14 +08:00
17 changed files with 81 additions and 24 deletions

View File

@@ -92,6 +92,7 @@ public final class CardRules implements ICardCharacteristics {
colorIdentity = newRules.colorIdentity;
meldWith = newRules.meldWith;
partnerWith = newRules.partnerWith;
tokens = newRules.tokens;
}
private static byte calculateColorIdentity(final ICardFace face) {
@@ -386,7 +387,7 @@ public final class CardRules implements ICardCharacteristics {
private int deltaHand;
private int deltaLife;
private List<String> tokens;
private List<String> tokens = Collections.emptyList();
public List<String> getTokens() {
return tokens;
@@ -484,7 +485,9 @@ public final class CardRules implements ICardCharacteristics {
result.setNormalizedName(this.normalizedName);
result.meldWith = this.meldWith;
result.partnerWith = this.partnerWith;
result.tokens = tokens.isEmpty() ? Collections.emptyList() : tokens;
if (!tokens.isEmpty()) {
result.tokens = tokens;
}
if (StringUtils.isNotBlank(handLife))
result.setVanguardProperties(handLife);
return result;
@@ -742,7 +745,10 @@ public final class CardRules implements ICardCharacteristics {
}
public boolean hasStartOfKeyword(final String k) {
for (final String inst : mainPart.getKeywords()) {
return hasStartOfKeyword(k, mainPart);
}
public boolean hasStartOfKeyword(final String k, ICardFace cf) {
for (final String inst : cf.getKeywords()) {
final String[] parts = inst.split(":");
if (parts[0].equals(k)) {
return true;

View File

@@ -8,6 +8,7 @@ import org.apache.commons.lang3.StringUtils;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import com.google.common.collect.Iterables;
import forge.util.CardTranslation;
import forge.util.ComparableOp;
@@ -186,7 +187,7 @@ public final class CardRulesPredicates {
return new Predicate<CardRules>() {
@Override
public boolean apply(final CardRules card) {
return card.hasStartOfKeyword(keyword);
return Iterables.any(card.getAllFaces(), cf -> cf != null && card.hasStartOfKeyword(keyword, cf));
}
};
}

View File

@@ -180,12 +180,8 @@ public class RepeatEachEffect extends SpellAbilityEffect {
}
}
for (final Player p : repeatPlayers) {
if (optional) {
if (!p.getController().confirmAction(repeat, null, sa.getParam("RepeatOptionalMessage"), null)) {
if (optional && !p.getController().confirmAction(repeat, null, sa.getParam("RepeatOptionalMessage"), null)) {
continue;
} else if (sa.hasParam("RememberDeciders")) {
source.addRemembered(p);
}
}
if (nextTurn) {
game.getCleanup().addUntil(p, new GameCommand() {

View File

@@ -3875,7 +3875,8 @@ public class CardFactoryUtil {
final String[] k = keyword.split(":");
sbDesc.append(" from ").append(k[2]);
sbValid.append("| ValidSource$ ").append(k[1]);
final String param = k[2].contains("abilities") ? "ValidSA$ " : "ValidSource$ ";
sbValid.append("| ").append(param).append(k[1]);
}
String effect = "Mode$ CantTarget | ValidCard$ Card.Self | Secondary$ True"

View File

@@ -1,6 +1,6 @@
Name:Atraxa, Grand Unifier
ManaCost:3 G W U B
Types:Legendary Creature Phyrexian Angel Horror
Types:Legendary Creature Phyrexian Angel
PT:7/7
K:Flying
K:Vigilance

View File

@@ -1,7 +1,7 @@
Name:Desecrate Reality
ManaCost:7
Types:Instant
A:SP$ ChangeZone | Origin$ Battlefield | Destination$ Exile | ValidTgts$ Permanent.nonLand+OppCtrl+cmcEven | TargetMin$ 0 | TargetMax$ OneEach | TargetsForEachPlayer$ True | TgtPrompt$ Select up to one target nonland permanent each opponent controls | SubAbility$ DBReturn | SpellDescription$ For each opponent, exile up to one target permanent that player controls with an even mana value. (Zero is even.)
A:SP$ ChangeZone | Origin$ Battlefield | Destination$ Exile | ValidTgts$ Permanent.OppCtrl+cmcEven | TargetMin$ 0 | TargetMax$ OneEach | TargetsForEachPlayer$ True | TgtPrompt$ Select up to one target permanent with an even mana value each opponent controls | SubAbility$ DBReturn | SpellDescription$ For each opponent, exile up to one target permanent that player controls with an even mana value. (Zero is even.)
SVar:DBReturn:DB$ ChangeZone | Origin$ Graveyard | Destination$ Battlefield | ChangeType$ Permanent.cmcOdd+YouOwn | Hidden$ True | Mandatory$ True | ChangeTypeDesc$ permanent card with an odd mana value | ChangeNum$ 1 | ConditionCheckSVar$ X | SpellDescription$ Adamant — If at least three colorless mana was spent to cast this spell, return a permanent card with an odd mana value from your graveyard to the battlefield.
SVar:X:Count$Adamant.Colorless.1.0
SVar:OneEach:PlayerCountOpponents$Amount

View File

@@ -7,7 +7,7 @@ T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.S
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigSac | Secondary$ True | TriggerDescription$ Whenever CARDNAME enters the battlefield or attacks, sacrifice another permanent.
SVar:TrigSac:DB$ Sacrifice | Defined$ You | SacValid$ Permanent.Other
SVar:NeedsToPlay:Permanent.YouCtrl+cmcLE2
T:Mode$ Sacrificed | ValidCard$ Permanent | ValidPlayer$ You | Execute$ TrigPutCounter | TriggerZones$ Battlefield | TriggerDescription$ Whenever you sacrifice a permanent, put a +1/+1 counter on CARDNAME and draw a card.
T:Mode$ Sacrificed | ValidCard$ Permanent | ValidPlayer$ You | Execute$ TrigPutCounter | TriggerZones$ Battlefield | TriggerDescription$ Whenever you sacrifice a permanent, put a +1/+1 counter on NICKNAME and draw a card.
SVar:TrigPutCounter:DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ 1 | SubAbility$ DBDraw
SVar:DBDraw:DB$ Draw | Defined$ You | NumCards$ 1
AI:RemoveDeck:Random

View File

@@ -2,10 +2,10 @@ Name:Tempting Contract
ManaCost:4
Types:Artifact
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ DBRepeat | SubAbility$ DBToken | TriggerDescription$ At the beginning of your upkeep, each opponent may create a Treasure token. For each opponent who does, you create a Treasure token.
SVar:DBRepeat:DB$ RepeatEach | RepeatSubAbility$ DBOppToken | RepeatPlayers$ Opponent | RepeatOptionalForEachPlayer$ True | RememberDeciders$ True | RepeatOptionalMessage$ Do you want to create a Treasure token? | ChangeZoneTable$ True | SubAbility$ DBToken
SVar:DBOppToken:DB$ Token | TokenScript$ c_a_treasure_sac | TokenOwner$ Player.IsRemembered
SVar:DBRepeat:DB$ RepeatEach | RepeatSubAbility$ DBOppToken | RepeatPlayers$ Opponent | RepeatOptionalForEachPlayer$ True | RepeatOptionalMessage$ Do you want to create a Treasure token? | ChangeZoneTable$ True | SubAbility$ DBToken
SVar:DBOppToken:DB$ Token | TokenScript$ c_a_treasure_sac | TokenOwner$ Player.IsRemembered | RememberTokens$ True
SVar:DBToken:DB$ Token | TokenAmount$ X | TokenScript$ c_a_treasure_sac | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:Count$RememberedSize
SVar:X:PlayerCountRememberedOwner$Amount
DeckHas:Ability$Token|Sacrifice
Oracle:At the beginning of your upkeep, each opponent may create a Treasure token. For each opponent who does, you create a Treasure token.

View File

@@ -0,0 +1,11 @@
Name:Aether Refinery
ManaCost:4 R R
Types:Artifact
R:Event$ AddCounter | ActiveZones$ Battlefield | ValidPlayer$ You | ValidCounterType$ ENERGY | ReplaceWith$ Twice | Description$ If you would get one or more {E}, you get twice that many {E} instead.
SVar:Twice:DB$ ReplaceCounter | ValidCounterType$ ENERGY | ChooseCounter$ True | Amount$ ReplaceCount$CounterNum/Twice
A:AB$ PutCounter | Cost$ T | Defined$ You | CounterType$ ENERGY | SubAbility$ DBChooseNumber | StackDescription$ SpellDescription | SpellDescription$ You get {E}, then you may pay one or more {E}.
SVar:DBChooseNumber:DB$ ChooseNumber | Max$ Count$YourCountersEnergy | ListTitle$ Choose amount for X | SubAbility$ DBToken | StackDescription$ None
SVar:DBToken:DB$ Token | ConditionCheckSVar$ X | UnlessCost$ Mandatory PayEnergy<X> | UnlessPayer$ You | UnlessSwitched$ True | TokenScript$ b_x_x_aetherborn | TokenPower$ X | TokenToughness$ X | StackDescription$ SpellDescription | SpellDescription$ If you do, create an X/X black Aetherborn creature token, where X is the amount of {E} paid this way.
SVar:X:Count$ChosenNumber
DeckHas:Ability$Token & Type$Aetherborn & Color$Black
Oracle:If you would get one or more {E}, you get twice that many {E} instead.\n{T}: You get {E}, then you may pay one or more {E}. If you do, create an X/X black Aetherborn creature token, where X is the amount of {E} paid this way.

View File

@@ -3,7 +3,7 @@ ManaCost:1 U
Types:Instant
A:SP$ Pump | TargetType$ Spell | TgtZone$ Stack | ValidTgts$ Card | SubAbility$ DBPutCounter | StackDescription$ {p:You} chooses {s:Targeted}. | SpellDescription$ Choose target spell.
SVar:DBPutCounter:DB$ PutCounter | Defined$ You | AILogic$ PayEnergy | CounterType$ ENERGY | CounterNum$ 2 | SubAbility$ DBChooseNumber | SpellDescription$ You get {E}{E} (two energy counters), then you may pay any amount of {E}.
SVar:DBChooseNumber:DB$ ChooseNumber | Max$ Max | ListTitle$ Pay Energy to counter targeted spell | SubAbility$ DBPay
SVar:DBChooseNumber:DB$ ChooseNumber | Max$ Max | ListTitle$ Pay Energy to counter targeted spell | SubAbility$ DBPay | StackDescription$ None
SVar:DBPay:DB$ Pump | UnlessCost$ Mandatory PayEnergy<N> | UnlessPayer$ You | UnlessSwitched$ True | StackDescription$ None | SubAbility$ DBCounter
SVar:DBCounter:DB$ Counter | Defined$ Targeted | UnlessCost$ N | UnlessPayer$ TargetedController | StackDescription$ SpellDescription | SpellDescription$ Counter that spell unless its controller pays {1} for each {E} paid this way.
SVar:Max:Count$YourCountersEnergy

View File

@@ -0,0 +1,11 @@
Name:Benthic Anomaly
ManaCost:6 U
Types:Creature Eldrazi Serpent
PT:7/8
K:Devoid
T:Mode$ SpellCast | ValidCard$ Card.Self | Execute$ TrigForEach | TriggerDescription$ When you cast this spell, for each opponent, choose a creature that player controls. Create a token that's a copy of one of those creatures, except its power is equal to the total power of those creatures, its toughness is equal to the total toughness of those creatures, and it's a colorless Eldrazi creature.
SVar:TrigForEach:DB$ RepeatEach | RepeatPlayers$ Opponent | RepeatSubAbility$ DBChoose | SubAbility$ DBCopy
SVar:DBChoose:DB$ ChooseCard | Choices$ Creature.RememberedPlayerCtrl | Mandatory$ True | Amount$ 1 | ChoiceTitle$ Choose a creature this player controls | ImprintChosen$ True
SVar:DBCopy:DB$ CopyPermanent | Choices$ Creature.IsImprinted | ChoiceTitle$ Choose one of those creatures to copy | SetPower$ Imprinted$CardPower | SetToughness$ Imprinted$CardToughness | SetColor$ Colorless | SetCreatureTypes$ Eldrazi | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearChosenCard$ True | ClearImprinted$ True
Oracle:Devoid\nWhen you cast this spell, for each opponent, choose a creature that player controls. Create a token that's a copy of one of those creatures, except its power is equal to the total power of those creatures, its toughness is equal to the total toughness of those creatures, and it's a colorless Eldrazi creature.

View File

@@ -0,0 +1,12 @@
Name:Blaster Hulk
ManaCost:6 R R
Types:Artifact Creature Pirate
PT:8/8
S:Mode$ ReduceCost | ValidCard$ Card.Self | Type$ Spell | Amount$ Count$CountersRemovedThisTurn ENERGY You | EffectZone$ All | Description$ This spell costs {1} less to cast for each {E} (energy counter) you've paid or lost this turn.
K:Haste
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigEnergy | TriggerDescription$ Whenever CARDNAME attacks, you get {E}{E}, then you may pay eight {E}. When you do, CARDNAME deals 8 damage divided as you choose among up to eight targets.
SVar:TrigEnergy:DB$ PutCounter | Defined$ You | CounterType$ ENERGY | CounterNum$ 2 | SubAbility$ DBTrigger
SVar:DBTrigger:DB$ ImmediateTrigger | UnlessCost$ PayEnergy<8> | UnlessPayer$ You | UnlessSwitched$ True | Execute$ TrigDamage | TriggerDescription$ When you do, CARDNAME deals 8 damage divided as you choose among up to eight targets.
SVar:TrigDamage:DB$ DealDamage | ValidTgts$ Any | TgtPrompt$ Select up to eight targets | NumDmg$ 8 | TargetMin$ 0 | TargetMax$ 8 | DividedAsYouChoose$ 8
SVar:HasAttackEffect:TRUE
Oracle:This spell costs {1} less to cast for each {E} (energy counter) you've paid or lost this turn.\nHaste\nWhenever Blaster Hulk attacks, you get {E}{E}, then you may pay eight {E}. When you do, Blaster Hulk deals 8 damage divided as you choose among up to eight targets.

View File

@@ -3,8 +3,8 @@ ManaCost:G
Types:Legendary Creature Insect
PT:1/2
K:Deathtouch
T:Mode$ ChangesZone | Origin$ Graveyard | Destination$ Battlefield | ValidCard$ Card.Self,Creature.YouCtrl | Execute$ TrigTransform | TriggerDescription$ When CARDNAME or another creature enters the battlefield under your control, if it entered from your graveyard or you cast it from your graveyard, you may pay {G}. If you do, exile NICKNAME, then return it to the battlefield transformed under its owner's control.
T:Mode$ ChangesZone | Destination$ Battlefield | ValidCard$ Card.Self+wasCastFromYourGraveyardByYou,Creature.YouCtrl+wasCastFromYourGraveyardByYou | Execute$ TrigTransform | Secondary$ True | TriggerDescription$ When CARDNAME enters the battlefield, if it entered from your graveyard or you cast it from your graveyard, you may pay {G}. If you do, exile NICKNAME, then return it to the battlefield transformed under its owner's control.
T:Mode$ ChangesZone | Origin$ Graveyard | Destination$ Battlefield | ValidCard$ Card.Self,Creature.YouCtrl | Execute$ TrigTransform | TriggerZones$ Battlefield | TriggerDescription$ When CARDNAME or another creature enters the battlefield under your control, if it entered from your graveyard or you cast it from your graveyard, you may pay {G}. If you do, exile NICKNAME, then return it to the battlefield transformed under its owner's control.
T:Mode$ ChangesZone | Destination$ Battlefield | ValidCard$ Card.Self+wasCastFromYourGraveyardByYou,Creature.YouCtrl+wasCastFromYourGraveyardByYou | Execute$ TrigTransform | TriggerZones$ Battlefield | Secondary$ True | TriggerDescription$ When CARDNAME enters the battlefield, if it entered from your graveyard or you cast it from your graveyard, you may pay {G}. If you do, exile NICKNAME, then return it to the battlefield transformed under its owner's control.
SVar:TrigTransform:AB$ ChangeZone | Cost$ G | Origin$ Battlefield | Destination$ Exile | RememberChanged$ True | SubAbility$ DBReturn
SVar:DBReturn:DB$ ChangeZone | Defined$ Remembered | Origin$ Exile | Destination$ Battlefield | Transformed$ True | ForgetOtherRemembered$ True | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True

View File

@@ -1,9 +1,9 @@
Name:Tempt with Mayhem
ManaCost:1 R R
Types:Instant
A:SP$ RepeatEach | ValidTgts$ Instant,Sorcery | TgtZone$ Stack | TgtPrompt$ Select target instant or sorcery spell | RepeatSubAbility$ DBCopy | RepeatPlayers$ Player.Opponent | SubAbility$ DBCopySelf | RepeatOptionalForEachPlayer$ True | RememberDeciders$ True | RepeatOptionalMessage$ Do you want to copy the targeted spell? | SpellDescription$ Tempting offer — Choose target instant or sorcery spell. Each opponent may copy that spell and may choose new targets for the copy they control. You copy that spell once plus an additional time for each opponent who copied the spell this way. You may choose new targets for the copies you control.
SVar:DBCopy:DB$ CopySpellAbility | Defined$ Targeted | Controller$ Remembered | Amount$ 1 | MayChooseTarget$ True
A:SP$ RepeatEach | ValidTgts$ Instant,Sorcery | TgtZone$ Stack | TgtPrompt$ Select target instant or sorcery spell | RepeatSubAbility$ DBCopy | RepeatPlayers$ Player.Opponent | SubAbility$ DBCopySelf | RepeatOptionalForEachPlayer$ True | RepeatOptionalMessage$ Do you want to copy the targeted spell? | SpellDescription$ Tempting offer — Choose target instant or sorcery spell. Each opponent may copy that spell and may choose new targets for the copy they control. You copy that spell once plus an additional time for each opponent who copied the spell this way. You may choose new targets for the copies you control.
SVar:DBCopy:DB$ CopySpellAbility | Defined$ Targeted | Controller$ Remembered | Amount$ 1 | MayChooseTarget$ True | RememberCopies$ True
SVar:DBCopySelf:DB$ CopySpellAbility | Defined$ Targeted | Amount$ X | MayChooseTarget$ True | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:Count$RememberedSize/Plus.1
SVar:X:PlayerCountRememberedController$Amount/Plus.1
Oracle:Tempting offer — Choose target instant or sorcery spell. Each opponent may copy that spell and may choose new targets for the copy they control. You copy that spell once plus an additional time for each opponent who copied the spell this way. You may choose new targets for the copies you control.

View File

@@ -0,0 +1,14 @@
Name:Volatile Stormdrake
ManaCost:1 U
Types:Creature Drake
PT:3/2
K:Flying
K:Hexproof:Activated,Triggered:activated and triggered abilities
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigExchange | TriggerDescription$ When CARDNAME enters the battlefield, exchange control of CARDNAME and target creature an opponent controls. If you do, you get {E}{E}{E}{E}, then sacrifice that creature unless you pay an amount of {E} equal to its mana value.
SVar:TrigExchange:DB$ ExchangeControl | Defined$ Self | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature an opponent controls | RememberExchanged$ True | SubAbility$ Energy
SVar:Energy:DB$ PutCounter | ConditionDefined$ Remembered | ConditionPresent$ Card | Defined$ You | CounterType$ ENERGY | CounterNum$ 4 | SubAbility$ Sacrifice
SVar:Sacrifice:DB$ SacrificeAll | ConditionDefined$ Remembered | ConditionPresent$ Card | Defined$ Targeted | UnlessCost$ PayEnergy<N> | UnlessPayer$ You | SubAbility$ Cleanup
SVar:Cleanup:DB$ Cleanup | ClearRemembered$ True
SVar:N:Targeted$CardManaCost
DeckHas:Ability$Sacrifice
Oracle:Flying, hexproof from activated and triggered abilities\nWhen Volatile Stormdrake enters the battlefield, exchange control of Volatile Stormdrake and target creature an opponent controls. If you do, you get {E}{E}{E}{E}, then sacrifice that creature unless you pay an amount of {E} equal to its mana value.

View File

@@ -0,0 +1,6 @@
Name:Aetherborn Token
ManaCost:no cost
Colors:black
Types:Creature Aetherborn
PT:*/*
Oracle:

View File

@@ -223,7 +223,6 @@ public class SFilterUtil {
}
};
}
public static Predicate<PaperCard> buildColorFilter(Map<SItemManagerUtil.StatTypes, ? extends IButton> buttonMap) {