mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Merge branch 'presence' into 'master'
Presence fixes See merge request core-developers/forge!6103
This commit is contained in:
@@ -1849,12 +1849,15 @@ public class AbilityUtils {
|
||||
|
||||
if (sq[0].startsWith("LastStateBattlefield")) {
|
||||
final String[] k = l[0].split(" ");
|
||||
CardCollectionView list = null;
|
||||
if (sa.getLastStateBattlefield() != null) {
|
||||
list = sa.getLastStateBattlefield();
|
||||
} else { // LastState is Empty
|
||||
CardCollectionView list = sa.getLastStateBattlefield();
|
||||
if (list == null || list.isEmpty()) {
|
||||
// LastState is Empty
|
||||
if (sq[0].contains("WithFallback")) {
|
||||
list = game.getCardsIn(ZoneType.Battlefield);
|
||||
} else {
|
||||
return doXMath(0, expr, c, ctb);
|
||||
}
|
||||
}
|
||||
list = CardLists.getValidCards(list, k[1].split(","), sa.getActivatingPlayer(), c, sa);
|
||||
if (k[0].contains("TotalToughness")) {
|
||||
return doXMath(Aggregates.sum(list, CardPredicates.Accessors.fnGetNetToughness), expr, c, ctb);
|
||||
@@ -1864,12 +1867,15 @@ public class AbilityUtils {
|
||||
|
||||
if (sq[0].startsWith("LastStateGraveyard")) {
|
||||
final String[] k = l[0].split(" ");
|
||||
CardCollectionView list = null;
|
||||
if (sa.getLastStateGraveyard() != null) {
|
||||
list = sa.getLastStateGraveyard();
|
||||
} else { // LastState is Empty
|
||||
CardCollectionView list = sa.getLastStateGraveyard();
|
||||
if (sa.getLastStateGraveyard() == null || list.isEmpty()) {
|
||||
// LastState is Empty
|
||||
if (sq[0].contains("WithFallback")) {
|
||||
list = game.getCardsIn(ZoneType.Graveyard);
|
||||
} else {
|
||||
return doXMath(0, expr, c, ctb);
|
||||
}
|
||||
}
|
||||
list = CardLists.getValidCards(list, k[1].split(","), sa.getActivatingPlayer(), c, sa);
|
||||
return doXMath(list.size(), expr, c, ctb);
|
||||
}
|
||||
@@ -2125,7 +2131,7 @@ public class AbilityUtils {
|
||||
boolean found = false;
|
||||
if (c.getCastFrom() != null && c.getCastSA() != null) {
|
||||
int revealed = calculateAmount(c, "Revealed$Valid " + type, c.getCastSA());
|
||||
int ctrl = calculateAmount(c, "Count$Valid " + type + ".inZoneBattlefield+YouCtrl", c.getCastSA());
|
||||
int ctrl = calculateAmount(c, "Count$LastStateBattlefield " + type + ".YouCtrl", c.getCastSA());
|
||||
if (revealed + ctrl >= 1) {
|
||||
found = true;
|
||||
}
|
||||
|
||||
@@ -54,11 +54,13 @@ public class CardProperty {
|
||||
// by name can also have color names, so needs to happen before colors.
|
||||
if (property.startsWith("named")) {
|
||||
String name = TextUtil.fastReplace(property.substring(5), ";", ","); // workaround for card name with ","
|
||||
name = TextUtil.fastReplace(name, "_", " ");
|
||||
if (!card.sharesNameWith(name)) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("notnamed")) {
|
||||
String name = TextUtil.fastReplace(property.substring(8), ";", ","); // workaround for card name with ","
|
||||
name = TextUtil.fastReplace(name, "_", " ");
|
||||
if (card.sharesNameWith(name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ public class SpellAbilityCondition extends SpellAbilityVariables {
|
||||
final String type = this.getPresenceCondition();
|
||||
|
||||
int revealed = AbilityUtils.calculateAmount(host, "Revealed$Valid " + type, host.getCastSA());
|
||||
int ctrl = AbilityUtils.calculateAmount(host, "Count$Valid " + type + ".inZoneBattlefield+YouCtrl", host.getCastSA());
|
||||
int ctrl = AbilityUtils.calculateAmount(host, "Count$LastStateBattlefield " + type + ".YouCtrl", host.getCastSA());
|
||||
|
||||
if (revealed + ctrl == 0) {
|
||||
return false;
|
||||
|
||||
@@ -2,6 +2,6 @@ Name:Aether Burst
|
||||
ManaCost:1 U
|
||||
Types:Instant
|
||||
A:SP$ ChangeZone | Cost$ 1 U | ValidTgts$ Creature | TargetMin$ 0 | TargetMax$ X | TgtPrompt$ Select target creature | Origin$ Battlefield | Destination$ Hand | SpellDescription$ Return up to X target creatures to their owners' hands, where X is one plus the number of cards named Aether Burst in all graveyards as you cast CARDNAME.
|
||||
SVar:X:Count$NamedInAllYards.Aether Burst/Plus.1
|
||||
SVar:X:Count$LastStateGraveyardWithFallback Card.namedAether_Burst/Plus.1
|
||||
DeckHints:Name$Aether Burst
|
||||
Oracle:Return up to X target creatures to their owners' hands, where X is one plus the number of cards named Aether Burst in all graveyards as you cast this spell.
|
||||
|
||||
@@ -2,8 +2,6 @@ Name:Jaws of Stone
|
||||
ManaCost:5 R
|
||||
Types:Sorcery
|
||||
A:SP$ DealDamage | Cost$ 5 R | ValidTgts$ Creature,Player,Planeswalker | TgtPrompt$ Select any target to distribute damage to | NumDmg$ OrigMountains | TargetMin$ Min | TargetMax$ OrigMountains | DividedAsYouChoose$ OrigMountains | SpellDescription$ CARDNAME deals X damage divided as you choose among any number of targets, where X is the number of Mountains you control as you cast this spell.
|
||||
T:Mode$ SpellCast | ValidCard$ Card.Self | Static$ True | Execute$ CountMountainsAtCast
|
||||
SVar:CountMountainsAtCast:DB$ StoreSVar | SVar$ OrigMountains | Type$ Count | Expression$ Valid Mountain.YouCtrl
|
||||
SVar:OrigMountains:Count$Valid Mountain.YouCtrl
|
||||
SVar:Min:SVar$OrigMountains/LimitMax.1
|
||||
SVar:OrigMountains:Count$LastStateBattlefieldWithFallback Mountain.YouCtrl
|
||||
SVar:Min:Count$Valid Mountain.YouCtrl/LimitMax.1
|
||||
Oracle:Jaws of Stone deals X damage divided as you choose among any number of targets, where X is the number of Mountains you control as you cast this spell.
|
||||
|
||||
@@ -3,7 +3,7 @@ ManaCost:1 G
|
||||
Types:Instant
|
||||
A:SP$ Pump | Cost$ 1 G | TgtPrompt$ Select target Opponent | ValidTgts$ Opponent | SubAbility$ GraveReap | StackDescription$ Select target opponent. | SpellDescription$ Return up to X target cards from your graveyard to your hand, where X is the number of black permanents target opponent controls as you cast this spell.
|
||||
SVar:GraveReap:DB$ ChangeZone | Origin$ Graveyard | Destination$ Hand | TargetMin$ 0 | TargetMax$ NrBlackAtCasting | TgtPrompt$ Choose target card in your graveyard | ValidTgts$ Card.YouCtrl
|
||||
SVar:NrBlackAtCasting:Count$Valid Permanent.Black+TargetedPlayerCtrl
|
||||
SVar:NrBlackAtCasting:Count$LastStateBattlefieldWithFallback Permanent.Black+TargetedPlayerCtrl
|
||||
SVar:AIPlayForSub:True
|
||||
AI:RemoveDeck:Random
|
||||
Oracle:Return up to X target cards from your graveyard to your hand, where X is the number of black permanents target opponent controls as you cast this spell.
|
||||
|
||||
@@ -3,6 +3,6 @@ ManaCost:X B
|
||||
Types:Sorcery
|
||||
Text:X is the number of artifact and/or creature cards in an opponent's graveyard as you cast this spell.
|
||||
A:SP$ PutCounter | Cost$ X B | ValidTgts$ Creature | TgtPrompt$ Select target creature to distribute counters to | CounterType$ P1P1 | CounterNum$ X | TargetMin$ 1 | TargetMax$ X | DividedAsYouChoose$ X | SpellDescription$ Distribute X +1/+1 counters among any number of target creatures.
|
||||
SVar:X:Count$ValidGraveyard Creature.OppCtrl,Artifact.OppCtrl
|
||||
SVar:X:Count$LastStateBattlefieldWithFallback Creature.OppCtrl,Artifact.OppCtrl
|
||||
AI:RemoveDeck:All
|
||||
Oracle:X is the number of artifact and/or creature cards in an opponent's graveyard as you cast this spell.\nDistribute X +1/+1 counters among any number of target creatures.
|
||||
|
||||
@@ -2,6 +2,6 @@ Name:Lethal Exploit
|
||||
ManaCost:1 B
|
||||
Types:Instant
|
||||
A:SP$ Pump | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ -X | NumDef$ -X | IsCurse$ True | SpellDescription$ Target creature gets -2/-2 until end of turn. It gets an additional -1/-1 until end of turn for each modified creature you controlled as you cast this spell. (Equipment, Auras you control, and counters are modifications.)
|
||||
SVar:X:Count$Valid Creature.modified+YouCtrl/Plus.2
|
||||
SVar:X:Count$LastStateBattlefieldWithFallback Creature.modified+YouCtrl/Plus.2
|
||||
DeckHints:Type$Aura|Equipment & Ability$Counters
|
||||
Oracle:Target creature gets -2/-2 until end of turn. It gets an additional -1/-1 until end of turn for each modified creature you controlled as you cast this spell. (Equipment, Auras you control, and counters are modifications.)
|
||||
|
||||
@@ -2,5 +2,5 @@ Name:Volcanic Wind
|
||||
ManaCost:4 R R
|
||||
Types:Sorcery
|
||||
A:SP$ DealDamage | Cost$ 4 R R | ValidTgts$ Creature | TgtPrompt$ Select target creature to distribute damage to | NumDmg$ NumCreatures | TargetMin$ 1 | TargetMax$ NumCreatures | DividedAsYouChoose$ NumCreatures | SpellDescription$ CARDNAME deals X damage divided as you choose among any number of target creatures, where X is the number of creatures on the battlefield as you cast this spell.
|
||||
SVar:NumCreatures:Count$Valid Creature
|
||||
SVar:NumCreatures:Count$LastStateBattlefieldWithFallback Creature
|
||||
Oracle:Volcanic Wind deals X damage divided as you choose among any number of target creatures, where X is the number of creatures on the battlefield as you cast this spell.
|
||||
|
||||
Reference in New Issue
Block a user