From cc8753b5639e6ce08f5ef2f5c87f5956e3f88333 Mon Sep 17 00:00:00 2001 From: tool4EvEr Date: Tue, 8 Jun 2021 23:17:55 +0200 Subject: [PATCH] Small fixes --- .../forge/game/ability/effects/ReplaceManaEffect.java | 2 +- forge-game/src/main/java/forge/game/card/CardView.java | 2 +- .../java/forge/game/replacement/ReplaceProduceMana.java | 1 - .../forge/game/spellability/SpellAbilityRestriction.java | 1 - .../java/forge/game/spellability/TargetRestrictions.java | 1 - forge-gui/res/cardsfolder/s/saprazzan_breaker.txt | 2 +- forge-gui/res/cardsfolder/s/spectral_deluge.txt | 2 +- .../res/cardsfolder/upcoming/grist_the_hunger_tide.txt | 2 +- forge-gui/res/cardsfolder/upcoming/moderation.txt | 2 +- forge-gui/res/cardsfolder/upcoming/tide_shaper.txt | 3 +-- .../main/java/forge/gamemodes/match/AbstractGuiGame.java | 8 ++++---- 11 files changed, 11 insertions(+), 15 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/effects/ReplaceManaEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ReplaceManaEffect.java index 246a1857255..bc8158111d8 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ReplaceManaEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ReplaceManaEffect.java @@ -82,7 +82,7 @@ public class ReplaceManaEffect extends SpellAbilityEffect { // need to log Updated events there, or the log is wrong order String message = sa.getReplacementEffect().toString(); - if ( !StringUtils.isEmpty(message)) { + if (!StringUtils.isEmpty(message)) { message = TextUtil.fastReplace(message, "CARDNAME", card.getName()); game.getGameLog().add(GameLogEntryType.EFFECT_REPLACED, message); } diff --git a/forge-game/src/main/java/forge/game/card/CardView.java b/forge-game/src/main/java/forge/game/card/CardView.java index 2562e980e9f..8c143e87aac 100644 --- a/forge-game/src/main/java/forge/game/card/CardView.java +++ b/forge-game/src/main/java/forge/game/card/CardView.java @@ -1086,7 +1086,7 @@ public class CardView extends GameEntityView { } public CardTypeView getType() { - if (isFaceDown() && !isInZone(EnumSet.of(ZoneType.Battlefield, ZoneType.Stack))) { + if (getState() != CardStateName.Original && isFaceDown() && !isInZone(EnumSet.of(ZoneType.Battlefield, ZoneType.Stack))) { return CardType.EMPTY; } return get(TrackableProperty.Type); diff --git a/forge-game/src/main/java/forge/game/replacement/ReplaceProduceMana.java b/forge-game/src/main/java/forge/game/replacement/ReplaceProduceMana.java index b4a658c579c..46d5b1a838c 100644 --- a/forge-game/src/main/java/forge/game/replacement/ReplaceProduceMana.java +++ b/forge-game/src/main/java/forge/game/replacement/ReplaceProduceMana.java @@ -31,7 +31,6 @@ public class ReplaceProduceMana extends ReplacementEffect { */ @Override public boolean canReplace(Map runParams) { - if (!matchesValidParam("ValidCard", runParams.get(AbilityKey.Affected))) { return false; } diff --git a/forge-game/src/main/java/forge/game/spellability/SpellAbilityRestriction.java b/forge-game/src/main/java/forge/game/spellability/SpellAbilityRestriction.java index e9e04a53f37..82f46079998 100644 --- a/forge-game/src/main/java/forge/game/spellability/SpellAbilityRestriction.java +++ b/forge-game/src/main/java/forge/game/spellability/SpellAbilityRestriction.java @@ -195,7 +195,6 @@ public class SpellAbilityRestriction extends SpellAbilityVariables { * @return a boolean. */ public final boolean checkZoneRestrictions(final Card c, final SpellAbility sa) { - final Player activator = sa.getActivatingPlayer(); final Zone cardZone = c.getLastKnownZone(); Card cp = c; diff --git a/forge-game/src/main/java/forge/game/spellability/TargetRestrictions.java b/forge-game/src/main/java/forge/game/spellability/TargetRestrictions.java index fc6d7285222..610558ba84f 100644 --- a/forge-game/src/main/java/forge/game/spellability/TargetRestrictions.java +++ b/forge-game/src/main/java/forge/game/spellability/TargetRestrictions.java @@ -366,7 +366,6 @@ public class TargetRestrictions { return this.saValidTargeting; } - /** *

* canOnlyTgtOpponent. diff --git a/forge-gui/res/cardsfolder/s/saprazzan_breaker.txt b/forge-gui/res/cardsfolder/s/saprazzan_breaker.txt index 73261f0586f..ed8857748af 100644 --- a/forge-gui/res/cardsfolder/s/saprazzan_breaker.txt +++ b/forge-gui/res/cardsfolder/s/saprazzan_breaker.txt @@ -2,7 +2,7 @@ Name:Saprazzan Breaker ManaCost:4 U Types:Creature Beast PT:3/3 -A:AB$ Dig | Cost$ U | DigNum$ 1 | Reveal$ True | ChangeNum$ All | RememberRevealed$ True | DestinationZone$ Graveyard | SubAbility$ DBPump | SpellDescription$ Mill a card. If a land card was milled this way, CARDNAME can't be blocked this turn. +A:AB$ Mill | Cost$ U | Defined$ You | NumCards$ 1 | RememberMilled$ True | SubAbility$ DBPump | SpellDescription$ Mill a card. If a land card was milled this way, CARDNAME can't be blocked this turn. SVar:DBPump:DB$ Pump | Defined$ Self | KW$ HIDDEN Unblockable | ConditionDefined$ Remembered | ConditionPresent$ Card.Land | ConditionCompare$ EQ1 | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True AI:RemoveDeck:All diff --git a/forge-gui/res/cardsfolder/s/spectral_deluge.txt b/forge-gui/res/cardsfolder/s/spectral_deluge.txt index 063a256f830..040f8214429 100644 --- a/forge-gui/res/cardsfolder/s/spectral_deluge.txt +++ b/forge-gui/res/cardsfolder/s/spectral_deluge.txt @@ -1,7 +1,7 @@ Name:Spectral Deluge ManaCost:4 U U Types:Sorcery -A:SP$ ChangeZoneAll | Cost$ 4 U U | ChangeType$ Creature.toughnessLEX+OppCtrl | Origin$ Battlefield | Destination$ Hand | TriggerDescription$ Return each creature your opponents control with toughness X or less to its owner's hand, where X is the number of Islands you control. +A:SP$ ChangeZoneAll | Cost$ 4 U U | ChangeType$ Creature.toughnessLEX+OppCtrl | Origin$ Battlefield | Destination$ Hand | SpellDescription$ Return each creature your opponents control with toughness X or less to its owner's hand, where X is the number of Islands you control. SVar:X:Count$Valid Island.YouCtrl K:Foretell:1 U U Oracle:Return each creature your opponents control with toughness X or less to its owner's hand, where X is the number of Islands you control.\nForetell {1}{U}{U} (During your turn, you may pay {2} and exile this card from your hand face down. Cast it on a later turn for its foretell cost.) diff --git a/forge-gui/res/cardsfolder/upcoming/grist_the_hunger_tide.txt b/forge-gui/res/cardsfolder/upcoming/grist_the_hunger_tide.txt index aa084668b9f..1bca9e292f1 100644 --- a/forge-gui/res/cardsfolder/upcoming/grist_the_hunger_tide.txt +++ b/forge-gui/res/cardsfolder/upcoming/grist_the_hunger_tide.txt @@ -11,7 +11,7 @@ SVar:DBToken:DB$ Token | TokenAmount$ 1 | TokenScript$ bg_1_1_insect | TokenOwne SVar:DBMill:DB$ Mill | Defined$ You | NumCards$ 1 | RememberMilled$ True | SubAbility$ DBPutCounter SVar:DBPutCounter:DB$PutCounter | Defined$ Self | CounterType$ LOYALTY | CounterNum$ 1 | ConditionDefined$ Remembered | ConditionPresent$ Card.Insect | ConditionCompare$ EQ1 SVar:MaxRepeats:Count$InYourLibrary -SVar:MilledInsect:RememberedLKI$Valid Card.Insect +SVar:MilledInsect:Remembered$Valid Card.Insect SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True A:AB$ ImmediateTrigger | Cost$ SubCounter<2/LOYALTY> | Planeswalker$ True | Execute$ TrigDestroy | UnlessCost$ Sac<1/Creature> | UnlessPayer$ You | UnlessSwitched$ True | SpellDescription$ You may sacrifice a creature. When you do, destroy target creature or planeswalker. SVar:TrigDestroy:DB$ Destroy | ValidTgts$ Creature,Planeswalker | TgtPrompt$ Select target creature or planeswalker diff --git a/forge-gui/res/cardsfolder/upcoming/moderation.txt b/forge-gui/res/cardsfolder/upcoming/moderation.txt index 7c2f07bc1cc..eddb2866771 100644 --- a/forge-gui/res/cardsfolder/upcoming/moderation.txt +++ b/forge-gui/res/cardsfolder/upcoming/moderation.txt @@ -2,6 +2,6 @@ Name:Moderation ManaCost:1 W U Types:Enchantment S:Mode$ CantBeCast | ValidCard$ Card | Caster$ You | NumLimitEachTurn$ 1 | Description$ You can't cast more than one spell each turn. -T:Mode$ SpellCast | ValidActivatingPlayer$ You | Execute$ TrigDraw | TriggerDescription$ Whenever you cast a spell, draw a card. +T:Mode$ SpellCast | ValidActivatingPlayer$ You | Execute$ TrigDraw | TriggerZones$ Battlefield | TriggerDescription$ Whenever you cast a spell, draw a card. SVar:TrigDraw:DB$ Draw | NumCards$ 1 Oracle:You can't cast more than one spell each turn.\nWhenever you cast a spell, draw a card. diff --git a/forge-gui/res/cardsfolder/upcoming/tide_shaper.txt b/forge-gui/res/cardsfolder/upcoming/tide_shaper.txt index a8703cde1a8..e78b4e65a3c 100644 --- a/forge-gui/res/cardsfolder/upcoming/tide_shaper.txt +++ b/forge-gui/res/cardsfolder/upcoming/tide_shaper.txt @@ -4,7 +4,6 @@ Types:Creature Merfolk Wizard PT:1/1 K:Kicker:1 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self+kicked | Execute$ TrigAnimate | TriggerDescription$ When CARDNAME enters the battlefield, if it was kicked, target land becomes an Island for as long as CARDNAME remains on the battlefield. -S:Mode$ Continuous | Affected$ Card.Self | AddPower$ 1 | AddToughness$ 1 | CheckSVar$ X | SVarCompare$ GE1 | Description$ CARDNAME gets +1/+1 as long as an opponent controls an Island. -SVar:X:Count$Valid Island.OppCtrl +S:Mode$ Continuous | Affected$ Card.Self | AddPower$ 1 | AddToughness$ 1 | IsPresent$ Island.OppCtrl | Description$ CARDNAME gets +1/+1 as long as an opponent controls an Island. SVar:TrigAnimate:DB$ Animate | ValidTgts$ Land | AITgts$ Land.OppCtrl | Types$ Island | RemoveLandTypes$ True | Duration$ UntilHostLeavesPlay | IsCurse$ True Oracle:Kicker {1} (You may pay an additional {1} as you cast this spell.)\nWhen Tide Shaper enters the battlefield, if it was kicked, target land becomes an Island for as long as Tide Shaper remains on the battlefield.\nTide Shaper gets +1/+1 as long as an opponent controls an Island. diff --git a/forge-gui/src/main/java/forge/gamemodes/match/AbstractGuiGame.java b/forge-gui/src/main/java/forge/gamemodes/match/AbstractGuiGame.java index ea81de52bb2..5c2fb7f8f38 100644 --- a/forge-gui/src/main/java/forge/gamemodes/match/AbstractGuiGame.java +++ b/forge-gui/src/main/java/forge/gamemodes/match/AbstractGuiGame.java @@ -184,11 +184,11 @@ public abstract class AbstractGuiGame implements IGuiGame, IMayViewCards { if (!hasLocalPlayers()) { return true; //if not in game, card can be shown } - if(GuiBase.getInterface().isLibgdxPort()){ - if(gameView != null && gameView.isGameOver()) { + if (GuiBase.getInterface().isLibgdxPort()){ + if (gameView != null && gameView.isGameOver()) { return true; } - if(spectator!=null) { //workaround fix!! this is needed on above code or it will + if (spectator!=null) { //workaround fix!! this is needed on above code or it will for (Map.Entry e : gameControllers.entrySet()) { if (e.getValue().equals(spectator)) { gameControllers.remove(e.getKey()); @@ -197,7 +197,7 @@ public abstract class AbstractGuiGame implements IGuiGame, IMayViewCards { } return true; } - try{ + try { if (getGameController().mayLookAtAllCards()) { // when it bugged here, the game thinks the spectator (null) return true; // is the humancontroller here (maybe because there is an existing game thread???) }