Skip to content

Commit 0bd53c9

Browse files
authored
Some cleanup (#10278)
1 parent 9853f59 commit 0bd53c9

27 files changed

Lines changed: 77 additions & 153 deletions

docs/Adventure/GAMEPAD.md

Lines changed: 46 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -11,57 +11,52 @@ https://github.com/Ryochan7/DS4Windows/releases/
1111
HidHide latest:
1212
https://github.com/ViGEm/HidHide/releases
1313

14-
Other XInput Controller should work, XBox or DS4 Preferaably and other similar XInput Controller with comparable button layout. Custom Key Mapping is not yet supported.
14+
Other XInput Controller should work, XBox or DS4 preferably and other similar XInput Controller with comparable button layout. Custom Key Mapping is not yet supported.
1515

1616
Controls:
1717

18-
UIScenes
19-
20-
DPAD Up/Down/Left/Right - for selecting texboxes and textfield, Scroll Up or Down
21-
Button A - Ok, Show Context
22-
Button B - Cancel
23-
Button X - Increase Difficulty in NewGame Plus/Flip Backside Deck Editor
24-
Button Y - Decrease Difficulty in NewGame Plus/Zoom or Text Mode in Deck Editor
25-
Left/Right Shoulder Button - Scroll Up or Scroll Down on some UIScenes
26-
27-
RewardScene
28-
29-
DPAD Left/Right - Selector
30-
Button A - Confirm/Flip Reward
31-
Button B - Show Rewards/Done
32-
Button Y - Show/Hide Zoom Card
33-
34-
TextInput
35-
36-
DPAD Up/Down/Left/Right - Key Selector
37-
Left Shoulder Button - Shift Keys
38-
Right Shoulder Button - Backspace
39-
Button Start - Jump to Ok
40-
Button A - Confirm
41-
Button B - Cancel
42-
43-
World/Gamescene
44-
45-
DPAD Up/Down/Left/Right - Character Movement
46-
Left Analog - Character Movement
47-
Button A - Menu/Confirm
48-
Button B - Statistics/Edit
49-
Button X - Deck Select/Deck Edit
50-
Button Y - Inventory/Rename
51-
52-
Match/Battle
53-
54-
Left Trigger - Play/Draw/OK (Bottom Left Button)
55-
Right Trigger - Keep/Mulligan/Cancel/End Turn/Alpha Strike (Bottom Right Button)
56-
57-
(To select cards on the battlefield, close Zone tabs first (Button B), then use DPAD)
58-
59-
DPAD Up/Down/Left/Right - Selector
60-
Left Shoulder - Player Panel Selector
61-
Right Shoulder - Zone Selector/Show
62-
Left Analog Down - Select Player (current selected panel)
63-
64-
Button A - Confirm
65-
Button B - Cancel/Hide
66-
Button Y - Show Zoom
67-
Button Back - Show Menu Tabs
18+
- UIScenes
19+
- DPAD Up/Down/Left/Right - for selecting texboxes and textfield, Scroll Up or Down
20+
- Button A - Ok, Show Context
21+
- Button B - Cancel
22+
- Button X - Increase Difficulty in NewGame Plus/Flip Backside Deck Editor
23+
- Button Y - Decrease Difficulty in NewGame Plus/Zoom or Text Mode in Deck Editor
24+
- Left/Right Shoulder Button - Scroll Up or Scroll Down on some UIScenes
25+
26+
27+
- RewardScene
28+
- DPAD Left/Right - Selector
29+
- Button A - Confirm/Flip Reward
30+
- Button B - Show Rewards/Done
31+
- Button Y - Show/Hide Zoom Card
32+
33+
34+
- TextInput
35+
- DPAD Up/Down/Left/Right - Key Selector
36+
- Left Shoulder Button - Shift Keys
37+
- Right Shoulder Button - Backspace
38+
- Button Start - Jump to Ok
39+
- Button A - Confirm
40+
- Button B - Cancel
41+
42+
43+
- World/Gamescene
44+
- DPAD Up/Down/Left/Right - Character Movement
45+
- Left Analog - Character Movement
46+
- Button A - Menu/Confirm
47+
- Button B - Statistics/Edit
48+
- Button X - Deck Select/Deck Edit
49+
- Button Y - Inventory/Rename
50+
51+
52+
- Match/Battle
53+
- Left Trigger - Play/Draw/OK (Bottom Left Button)
54+
- Right Trigger - Keep/Mulligan/Cancel/End Turn/Alpha Strike (Bottom Right Button)
55+
- DPAD Up/Down/Left/Right - Selector (To select cards on the battlefield, close Zone tabs first (Button B))
56+
- Left Shoulder - Player Panel Selector
57+
- Right Shoulder - Zone Selector/Show
58+
- Left Analog Down - Select Player (current selected panel)
59+
- Button A - Confirm
60+
- Button B - Cancel/Hide
61+
- Button Y - Show Zoom
62+
- Button Back - Show Menu Tabs

forge-game/src/main/java/forge/game/ability/effects/RollDiceEffect.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ public DieRollResult(int naturalValue, int modifiedValue) {
4949
this.naturalValue = naturalValue;
5050
this.modifiedValue = modifiedValue;
5151
}
52-
// Getters
52+
5353
public int getNaturalValue() {
5454
return naturalValue;
5555
}
5656
public int getModifiedValue() {
5757
return modifiedValue;
5858
}
59-
// Setters
59+
6060
public void setNaturalValue(int naturalValue) {
6161
this.naturalValue = naturalValue;
6262
}

forge-game/src/main/java/forge/game/ability/effects/SacrificeEffect.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ public void resolve(SpellAbility sa) {
7676

7777
// Expand Sacrifice keyword here depending on what we need out of it.
7878
final int amount = AbilityUtils.calculateAmount(host, sa.getParamOrDefault("Amount", "1"), sa);
79-
final boolean devour = sa.isKeyword(Keyword.DEVOUR);
80-
final boolean exploit = sa.isKeyword(Keyword.EXPLOIT);
8179
final boolean sacEachValid = sa.hasParam("SacEachValid");
8280

8381
String valid = sa.getParamOrDefault("SacValid", "Self");
@@ -163,14 +161,13 @@ public void resolve(SpellAbility sa) {
163161
} else {
164162
for (Card sac : game.getAction().sacrifice(choosenToSacrifice, sa, true, params)) {
165163
Card lKICopy = zoneMovements.getLastStateBattlefield().get(sac);
166-
// Run Devour Trigger
167-
if (devour) {
164+
if (sa.isKeyword(Keyword.DEVOUR)) {
168165
host.addDevoured(lKICopy);
169166
final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
170167
runParams.put(AbilityKey.Devoured, lKICopy);
171168
game.getTriggerHandler().runTrigger(TriggerType.Devoured, runParams, false);
172169
}
173-
if (exploit) {
170+
if (sa.isKeyword(Keyword.EXPLOIT)) {
174171
host.addExploited(lKICopy);
175172
final Map<AbilityKey, Object> runParams = AbilityKey.mapFromCard(host);
176173
runParams.put(AbilityKey.Exploited, lKICopy);

forge-game/src/main/java/forge/game/card/CardFactoryUtil.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,6 @@ public static void addTriggerAbility(final KeywordInterface inst, final Card car
13491349
parsedTrigger.setOverridingAbility(AbilityFactory.getAbility(effect, card));
13501350

13511351
inst.addTrigger(parsedTrigger);
1352-
13531352
} else if (keyword.equals("Ingest")) {
13541353
final String trigStr = "Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | CombatDamage$ True"
13551354
+ "| Secondary$ True | TriggerZones$ Battlefield | TriggerDescription$ Ingest ("

forge-game/src/main/java/forge/game/card/CardProperty.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1527,7 +1527,7 @@ else if (property.startsWith("attacking")) {
15271527
}
15281528
}
15291529
if (property.startsWith("attacking ")) { // generic "attacking [DefinedGameEntity]"
1530-
FCollection<GameEntity> defined = AbilityUtils.getDefinedEntities(source, property.split(" ")[1], spellAbility);
1530+
FCollection<GameEntity> defined = AbilityUtils.getDefinedEntities(source, property.split(" ", 2)[1], spellAbility);
15311531
final GameEntity defender = combat.getDefenderByAttacker(card);
15321532
if (!defined.contains(defender)) {
15331533
return false;

forge-game/src/main/java/forge/util/EnumMapUtil.java

Lines changed: 0 additions & 18 deletions
This file was deleted.

forge-gui-mobile/src/forge/Forge.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,6 +1541,7 @@ public boolean buttonUp(Controller controller, int buttonIndex) {
15411541
public boolean axisMoved(Controller controller, int axisIndex, float value) {
15421542
//System.out.println(controller.getName()+"["+controller.getUniqueId()+"]: axis: "+axisIndex+" - "+value);
15431543
hasGamepad = true;
1544+
// Axis deadzone filters joystick drift from counting
15441545
if (Math.abs(value) > 0.25f) {
15451546
lastInputWasController = true;
15461547
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Types:Enchantment
44
T:Mode$ Phase | Phase$ End of Turn | CheckSVar$ X | SVarCompare$ GE2 | TriggerZones$ Battlefield | Execute$ TrigPutCounter | OptionalDecider$ You | TriggerDescription$ At the beginning of each end step, if you drew two or more cards this turn, you may put a quest counter on CARDNAME.
55
R:Event$ Draw | ActiveZones$ Battlefield | ValidPlayer$ You | ReplaceWith$ Tutor | IsPresent$ Card.Self+counters_GE6_QUEST | Optional$ True | Description$ As long as CARDNAME has six or more quest counters on it, if you would draw a card, you may instead search your library for a card, put that card into your hand, then shuffle.
66
SVar:TrigPutCounter:DB$ PutCounter | Defined$ Self | CounterType$ QUEST | CounterNum$ 1
7-
SVar:Tutor:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ValidCard$ Card.YouOwn
7+
SVar:Tutor:DB$ ChangeZone | Origin$ Library | Destination$ Hand
88
SVar:X:Count$YouDrewThisTurn
99
# TODO: improve AI tutoring logic
1010
AI:RemoveDeck:Random

forge-gui/res/cardsfolder/c/casey_raph_hotheads.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ PT:4/4
55
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigCharm | TriggerDescription$ When NICKNAME enter, ABILITY
66
SVar:TrigCharm:DB$ Charm | MinCharmNum$ 1 | CharmNum$ 2 | Choices$ DBExile,DBToken | AdditionalDescription$ . Each mode must target a different player.
77
SVar:DBExile:DB$ Dig | ValidTgts$ Player | DigNum$ 1 | ChangeNum$ All | DestinationZone$ Exile | RememberChanged$ True | SubAbility$ DBEffect | SpellDescription$ Target player exiles the top card of their library. Until that player's next end step, they may play that card without paying its mana cost.
8-
SVar:DBEffect:DB$ Effect | StaticAbilities$ CRPlay | Duration$ Permanent | ExileOnMoved$ Exile | RememberObjects$ Remembered & RememberedOwner | Triggers$ RemoveTrigger | SubAbility$ DBCleanup
9-
SVar:CRPlay:Mode$ Continuous | Affected$ Card.IsRemembered | MayPlay$ True | MayPlayWithoutManaCost$ True | MayPlayPlayer$ CardOwner | AffectedZone$ Exile | Description$ Until that player's next end step, they may play that card without paying its mana cost.
10-
SVar:RemoveTrigger:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ Player.IsRemembered | Static$ True | Execute$ TrigExile
11-
SVar:TrigExile:DB$ ChangeZone | Origin$ Command | Destination$ Exile | Defined$ Self
12-
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
8+
SVar:DBEffect:DB$ Effect | StaticAbilities$ CRPlay | EffectOwner$ RememberedOwner | Duration$ UntilYourNextEndStep | ExileOnMoved$ Exile | RememberObjects$ Remembered | SubAbility$ DBCleanup
9+
SVar:CRPlay:Mode$ Continuous | Affected$ Card.IsRemembered | MayPlay$ True | MayPlayWithoutManaCost$ True | AffectedZone$ Exile | Description$ Until that player's next end step, they may play that card without paying its mana cost.
1310
SVar:DBToken:DB$ Token | ValidTgts$ Player | TargetUnique$ True | TokenOwner$ ThisTargetedPlayer | TokenAmount$ 2 | TokenScript$ c_a_treasure_sac | SpellDescription$ Target player creates two Treasure tokens.
1411
Oracle:When Casey & Raph enter, choose one or both. Each mode must target a different player.\n• Target player exiles the top card of their library. Until that player's next end step, they may play that card without paying its mana cost.\n• Target player creates two Treasure tokens.

forge-gui/res/cardsfolder/d/dreadhorde_arcanist.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigPlay | TriggerDescription$
77
SVar:TrigPlay:DB$ Play | TgtZone$ Graveyard | ValidTgts$ Instant.YouCtrl+cmcLEX,Sorcery.YouCtrl+cmcLEX | TgtPrompt$ Choose target instant or sorcery card with mana value X or less from your graveyard | ValidSA$ Spell | WithoutManaCost$ True | Optional$ True | ReplaceGraveyard$ Exile | AILogic$ ReplaySpell
88
SVar:X:Count$CardPower
99
SVar:HasAttackEffect:TRUE
10-
OOracle:Trample\nWhenever Dreadhorde Arcanist attacks, you may cast target instant or sorcery card with mana value less than or equal to Dreadhorde Arcanist's power from your graveyard without paying its mana cost. If that spell would be put into your graveyard this turn, exile it instead.
10+
Oracle:Trample\nWhenever Dreadhorde Arcanist attacks, you may cast target instant or sorcery card with mana value less than or equal to Dreadhorde Arcanist's power from your graveyard without paying its mana cost. If that spell would be put into your graveyard this turn, exile it instead.

0 commit comments

Comments
 (0)