Skip to content

Commit 8b164c7

Browse files
authored
Merge branch 'master' into animatesub
2 parents 8ecb285 + 2a8e66f commit 8b164c7

File tree

285 files changed

+703
-281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

285 files changed

+703
-281
lines changed

forge-game/src/main/java/forge/game/ForgeScript.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ public static boolean spellAbilityHasProperty(SpellAbility sa, String property,
240240
return sa.isEquip();
241241
} else if (property.equals("Boast")) {
242242
return sa.isBoast();
243+
} else if (property.equals("Exhaust")) {
244+
return sa.isExhaust();
243245
} else if (property.equals("Mutate")) {
244246
return sa.isMutate();
245247
} else if (property.equals("Ninjutsu")) {

forge-game/src/main/java/forge/game/ability/AbilityFactory.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,14 @@ else if (api == ApiType.PermanentCreature || api == ApiType.PermanentNoncreature
253253
spellAbility.putParam("PlayerTurn", "True");
254254
spellAbility.putParam("PrecostDesc", "Forecast — ");
255255
}
256-
if (mapParams.containsKey("Boast")) {
256+
if (spellAbility.isBoast()) {
257257
spellAbility.putParam("PresentDefined", "Self");
258258
spellAbility.putParam("IsPresent", "Card.attackedThisTurn");
259259
spellAbility.putParam("PrecostDesc", "Boast — ");
260260
}
261+
if (spellAbility.isExhaust()) {
262+
spellAbility.putParam("PrecostDesc", "Exhaust — ");
263+
}
261264

262265
// *********************************************
263266
// set universal properties of the SpellAbility

forge-game/src/main/java/forge/game/spellability/SpellAbility.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,9 @@ public boolean isBackup() {
587587
public boolean isBoast() {
588588
return this.hasParam("Boast");
589589
}
590+
public boolean isExhaust() {
591+
return this.hasParam("Exhaust");
592+
}
590593

591594
public boolean isNinjutsu() {
592595
return this.isKeyword(Keyword.NINJUTSU);

forge-game/src/main/java/forge/game/spellability/SpellAbilityRestriction.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import forge.game.phase.PhaseType;
3535
import forge.game.player.Player;
3636
import forge.game.staticability.StaticAbilityCastWithFlash;
37+
import forge.game.staticability.StaticAbilityExhaust;
3738
import forge.game.staticability.StaticAbilityNumLoyaltyAct;
3839
import forge.game.zone.Zone;
3940
import forge.game.zone.ZoneType;
@@ -542,6 +543,10 @@ public final boolean checkOtherRestrictions(final Card c, final SpellAbility sa,
542543
if (limit <= sa.getActivationsThisTurn()) {
543544
return false;
544545
}
546+
} else if (sa.isExhaust()) {
547+
if (sa.getActivationsThisGame() > 0 && !StaticAbilityExhaust.anyWithExhaust(activator)) {
548+
return false;
549+
}
545550
}
546551

547552
// Rule 605.3c about Mana Abilities
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package forge.game.staticability;
2+
3+
import forge.game.Game;
4+
import forge.game.card.Card;
5+
import forge.game.player.Player;
6+
import forge.game.zone.ZoneType;
7+
8+
public class StaticAbilityExhaust {
9+
10+
static String MODE = "CanExhaust";
11+
12+
public static boolean anyWithExhaust(final Player player) {
13+
final Game game = player.getGame();
14+
for (final Card ca : game.getCardsIn(ZoneType.STATIC_ABILITIES_SOURCE_ZONES)) {
15+
for (final StaticAbility stAb : ca.getStaticAbilities()) {
16+
if (!stAb.checkConditions(MODE)) {
17+
continue;
18+
}
19+
if (applyWithExhaust(stAb, player)) {
20+
return true;
21+
}
22+
}
23+
}
24+
return false;
25+
}
26+
27+
public static boolean applyWithExhaust(final StaticAbility stAb, final Player player) {
28+
if (!stAb.matchesValidParam("ValidPlayer", player)) {
29+
return false;
30+
}
31+
32+
return true;
33+
}
34+
}

forge-gui/res/adventure/common/config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@
7373
"UEIND23",
7474
"UEBAR23",
7575
"MB2",
76-
"UNF"
76+
"UNF",
77+
"DA1"
7778
],
7879
"difficulties": [
7980
{
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.txt text eol=lf
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Name:Abandon Reason
22
ManaCost:2 R
33
Types:Instant
4-
A:SP$ Pump | TargetMin$ 0 | TargetMax$ 2 | NumAtt$ +1 | KW$ First Strike | ValidTgts$ Creature | TgtPrompt$ Select target Creature | SpellDescription$ Up to two target creatures each get +1/+0 and gain first strike until end of turn.
4+
A:SP$ Pump | TargetMin$ 0 | TargetMax$ 2 | NumAtt$ +1 | KW$ First Strike | ValidTgts$ Creature | TgtPrompt$ Select up to two target creatures | SpellDescription$ Up to two target creatures each get +1/+0 and gain first strike until end of turn.
55
K:Madness:1 R
66
DeckHints:Ability$Discard
77
Oracle:Up to two target creatures each get +1/+0 and gain first strike until end of turn.\nMadness {1}{R} (If you discard this card, discard it into exile. When you do, cast it for its madness cost or put it into your graveyard.)

forge-gui/res/cardsfolder/a/admiral_brass_unsinkable.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ PT:3/3
55
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigMill | TriggerDescription$ When CARDNAME enters, mill four cards.
66
SVar:TrigMill:DB$ Mill | NumCards$ 4 | Defined$ You
77
T:Mode$ Phase | Phase$ BeginCombat | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigReturn | TriggerDescription$ At the beginning of combat on your turn, you may return target Pirate creature card from your graveyard to the battlefield with a finality counter on it. It has base power and toughness 4/4. It gains haste until end of turn. (If a creature with a finality counter on it would die, exile it instead.)
8-
SVar:TrigReturn:DB$ ChangeZone | Origin$ Graveyard | Destination$ Battlefield | WithCountersType$ FINALITY | ValidTgts$ Pirate.YouOwn | Optional$ True | TgtPrompt$ Select target pirate in your graveyard | SubAbility$ DBPump | RememberChanged$ True | StaticEffect$ Animate
8+
SVar:TrigReturn:DB$ ChangeZone | Origin$ Graveyard | Destination$ Battlefield | WithCountersType$ FINALITY | ValidTgts$ Pirate.YouOwn | Optional$ True | TgtPrompt$ Select target Pirate in your graveyard | SubAbility$ DBPump | RememberChanged$ True | StaticEffect$ Animate
99
SVar:Animate:Mode$ Continuous | Affected$ Card.IsRemembered | SetPower$ 4 | SetToughness$ 4
1010
SVar:DBPump:DB$ Pump | KW$ Haste | Defined$ Remembered | SubAbility$ DBCleanup
1111
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Name:Aegis of the Meek
22
ManaCost:3
33
Types:Artifact
4-
A:AB$ Pump | Cost$ 1 T | NumAtt$ 1 | NumDef$ 2 | ValidTgts$ Creature.powerEQ1+toughnessEQ1 | TgtPrompt$ Select target 1/1 Creature | SpellDescription$ Target 1/1 creature gets +1/+2 until end of turn.
4+
A:AB$ Pump | Cost$ 1 T | NumAtt$ 1 | NumDef$ 2 | ValidTgts$ Creature.powerEQ1+toughnessEQ1 | TgtPrompt$ Select target 1/1 creature | SpellDescription$ Target 1/1 creature gets +1/+2 until end of turn.
55
Oracle:{1}, {T}: Target 1/1 creature gets +1/+2 until end of turn.

0 commit comments

Comments
 (0)