Skip to content

Commit 6f6c6a0

Browse files
tool4EvErtool4EvEr
authored andcommitted
Elvish Refueler regression
1 parent 7cc86f2 commit 6f6c6a0

5 files changed

Lines changed: 21 additions & 27 deletions

File tree

forge-game/src/main/java/forge/game/staticability/StaticAbilityAdditionalActivations.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ public static int getLimit(final Card card, final SpellAbility sa, Player activa
2525
continue;
2626
}
2727
if (stAb.hasParam("MinLimit")) {
28-
result = Math.max(result, AbilityUtils.calculateAmount(stAb.getHostCard(), stAb.getParam("MinLimit"), stAb));
28+
int min = AbilityUtils.calculateAmount(stAb.getHostCard(), stAb.getParam("MinLimit"), stAb);
29+
if (min == -1) {
30+
return Integer.MAX_VALUE;
31+
}
32+
result = Math.max(result, min);
2933
}
3034
if (stAb.hasParam("Additional")) {
3135
additional += AbilityUtils.calculateAmount(stAb.getHostCard(), stAb.getParam("Additional"), stAb);

forge-gui-desktop/src/main/java/forge/screens/match/menus/CardOverlaysMenu.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,18 @@ private ActionListener getShowOverlaysAction() {
6161
}
6262

6363
private void toggleCardOverlayDisplay(JMenuItem showMenu) {
64-
toggleShowOverlaySetting();
64+
toggleOverlaySetting(FPref.UI_SHOW_CARD_OVERLAYS);
6565
repaintCardOverlays();
6666
// Enable/disable overlay menu items based on state of "Show" menu.
6767
for (Component c : showMenu.getParent().getComponents()) {
68-
if (c instanceof JMenuItem) {
69-
JMenuItem m = (JMenuItem)c;
70-
if (m != showMenu) {
71-
m.setEnabled(prefs.getPrefBoolean(FPref.UI_SHOW_CARD_OVERLAYS));
68+
if (c instanceof JMenuItem jmu) {
69+
if (jmu != showMenu) {
70+
jmu.setEnabled(prefs.getPrefBoolean(FPref.UI_SHOW_CARD_OVERLAYS));
7271
}
7372
}
7473
}
7574
}
7675

77-
private static void toggleShowOverlaySetting() {
78-
boolean isOverlayEnabled = !prefs.getPrefBoolean(FPref.UI_SHOW_CARD_OVERLAYS);
79-
prefs.setPref(FPref.UI_SHOW_CARD_OVERLAYS, isOverlayEnabled);
80-
prefs.save();
81-
}
82-
8376
private ActionListener getCardOverlaysAction(final FPref overlaySetting) {
8477
return e -> {
8578
toggleOverlaySetting(overlaySetting);

forge-gui-mobile/src/forge/screens/match/views/VGameMenu.java

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,16 @@ public void handleEvent(FEvent e) {
5151
@Override
5252
public void setVisible(boolean b0) {
5353
super.setVisible(b0);
54-
if (!b0) {
55-
if (autoYieldsDisabled && !MatchController.instance.getGameController().getYieldController().getDisableAutoYields()) {
56-
//if re-enabling auto-yields, auto-yield to current ability on stack if applicable
57-
if (MatchController.instance.getGameView().peekStack() != null) {
58-
final String key = MatchController.instance.getGameView().peekStack().getKey();
59-
final boolean autoYield = MatchController.instance.getGameController().shouldAutoYield(key);
60-
boolean abilityScope = MatchController.instance.getGameController().getYieldController().isAbilityScope();
61-
MatchController.instance.getGameController().setShouldAutoYield(key, !autoYield, abilityScope);
62-
if (!autoYield && MatchController.instance.getGameController().shouldAutoYield(key)) {
63-
//auto-pass priority if ability is on top of stack
64-
MatchController.instance.getGameController().passPriority();
65-
}
66-
}
54+
if (!b0 && MatchController.instance.getGameView().peekStack() != null
55+
&& autoYieldsDisabled && !MatchController.instance.getGameController().getYieldController().getDisableAutoYields()) {
56+
//if re-enabling auto-yields, auto-yield to current ability on stack if applicable
57+
final String key = MatchController.instance.getGameView().peekStack().getKey();
58+
final boolean autoYield = MatchController.instance.getGameController().shouldAutoYield(key);
59+
boolean abilityScope = MatchController.instance.getGameController().getYieldController().isAbilityScope();
60+
MatchController.instance.getGameController().setShouldAutoYield(key, !autoYield, abilityScope);
61+
if (!autoYield && MatchController.instance.getGameController().shouldAutoYield(key)) {
62+
//auto-pass priority if ability is on top of stack
63+
MatchController.instance.getGameController().passPriority();
6764
}
6865
}
6966
}

forge-gui/res/cardsfolder/e/elvish_refueler.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Name:Elvish Refueler
22
ManaCost:2 G
33
Types:Creature Elf Druid
44
PT:2/3
5-
S:Mode$ Activations | ValidSA$ Activated.Exhaust | ValidPlayer$ You | MinLimit$ 2 | PlayerTurn$ You | CheckSVar$ X | SVarCompare$ LT1 | Description$ During your turn, as long as you haven't activated an exhaust ability this turn, you may activate exhaust abilities as though they haven't been activated.
5+
S:Mode$ Activations | ValidSA$ Activated.Exhaust | ValidPlayer$ You | MinLimit$ -1 | PlayerTurn$ You | CheckSVar$ X | SVarCompare$ LT1 | Description$ During your turn, as long as you haven't activated an exhaust ability this turn, you may activate exhaust abilities as though they haven't been activated.
66
SVar:X:Count$ThisTurnActivated_Activated.Exhaust+YouCtrl
77
A:AB$ PutCounter | Cost$ 1 G | CounterType$ P1P1 | CounterNum$ 1 | Exhaust$ True | SpellDescription$ Put a +1/+1 counter on this creature.
88
Oracle:During your turn, as long as you haven't activated an exhaust ability this turn, you may activate exhaust abilities as though they haven't been activated.\nExhaust — {1}{G}: Put a +1/+1 counter on this creature. (Activate each exhaust ability only once.)

forge-gui/res/cardsfolder/h/hydro_channeler.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Name:Hydro-Channeler
22
ManaCost:1 U
3-
Types:Creature Elf Merfolk Wizard
3+
Types:Creature Merfolk Wizard
44
PT:1/3
55
A:AB$ Mana | Cost$ T | Produced$ U | RestrictValid$ Spell.Instant,Spell.Sorcery | SpellDescription$ Add {U}. Spend this mana only to cast an instant or sorcery spell.
66
A:AB$ Mana | Cost$ 1 T | Produced$ Any | RestrictValid$ Spell.Instant,Spell.Sorcery | SpellDescription$ Add one mana of any color. Spend this mana only to cast an instant or sorcery spell.

0 commit comments

Comments
 (0)