diff --git a/forge-game/src/main/java/forge/game/ability/effects/AnimateEffectBase.java b/forge-game/src/main/java/forge/game/ability/effects/AnimateEffectBase.java index eb3db518755..7175295f158 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/AnimateEffectBase.java +++ b/forge-game/src/main/java/forge/game/ability/effects/AnimateEffectBase.java @@ -109,6 +109,10 @@ public abstract class AnimateEffectBase extends SpellAbilityEffect { for (final String s : abilities) { SpellAbility sSA = AbilityFactory.getAbility(c, s, sa); addedAbilities.add(sSA); + + if (sa.hasParam("TransferActivator")) { + sSA.getRestrictions().setActivator("Player.PlayerUID_" + sa.getActivatingPlayer().getId()); + } } // Grant triggers diff --git a/forge-game/src/main/java/forge/game/ability/effects/ChoosePlayerEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ChoosePlayerEffect.java index 3c2f21bd3b6..9f4601d97a7 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ChoosePlayerEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ChoosePlayerEffect.java @@ -1,5 +1,6 @@ package forge.game.ability.effects; +import forge.game.GameLogEntryType; import forge.game.ability.AbilityUtils; import forge.game.ability.SpellAbilityEffect; import forge.game.card.Card; @@ -57,8 +58,12 @@ public class ChoosePlayerEffect extends SpellAbilityEffect { if (sa.hasParam("RememberChosen")) { card.addRemembered(chosen); } - p.getGame().getAction().notifyOfValue(sa, p, Localizer.getInstance().getMessage("lblPlayerPickedChosen", sa.getActivatingPlayer(), chosen), null); - + if (sa.hasParam("DontNotify")) { //ie Shared Fate + //log the chosen player + p.getGame().getGameLog().add(GameLogEntryType.INFORMATION, Localizer.getInstance().getMessage("lblPlayerPickedChosen", sa.getActivatingPlayer(), chosen)); + } else { + p.getGame().getAction().notifyOfValue(sa, p, Localizer.getInstance().getMessage("lblPlayerPickedChosen", sa.getActivatingPlayer(), chosen), null); + } // SubAbility that only fires if a player is chosen SpellAbility chosenSA = sa.getAdditionalAbility("ChooseSubAbility"); if (chosenSA != null) { diff --git a/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java b/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java index 1a7f36c2dd1..e16ec8b9857 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java @@ -106,6 +106,21 @@ public class EffectEffect extends SpellAbilityEffect { } } + if (sa.hasParam("RememberLKI")) { + rememberList = new FCollection<>(); + for (final String rem : sa.getParam("RememberLKI").split(",")) { + CardCollection def = AbilityUtils.getDefinedCards(hostCard, rem, sa); + for (Card c : def) { + rememberList.add(CardUtil.getLKICopy(c)); + } + } + + // don't create Effect if there is no remembered Objects + if (rememberList.isEmpty() && (sa.hasParam("ForgetOnMoved") || sa.hasParam("ExileOnMoved"))) { + return; + } + } + if (sa.hasParam("ImprintCards")) { effectImprinted = sa.getParam("ImprintCards"); } @@ -202,7 +217,6 @@ public class EffectEffect extends SpellAbilityEffect { // Remember Keywords if (sa.hasParam("RememberKeywords")) { - rememberList = new FCollection<>(); List effectKeywords = Arrays.asList(sa.getParam("RememberKeywords").split(",")); if (sa.hasParam("SharedKeywordsZone")) { List zones = ZoneType.listValueOf(sa.getParam("SharedKeywordsZone")); diff --git a/forge-gui-mobile/src/forge/adventure/data/DialogData.java b/forge-gui-mobile/src/forge/adventure/data/DialogData.java index a4e702e7389..9648f7a11fe 100644 --- a/forge-gui-mobile/src/forge/adventure/data/DialogData.java +++ b/forge-gui-mobile/src/forge/adventure/data/DialogData.java @@ -44,6 +44,7 @@ public class DialogData implements Serializable { public String voiceFile; static public class ActionData implements Serializable { + public static final long serialVersionUID = 2848523275822677205L; static public class QuestFlag implements Serializable{ public String key; public int val; diff --git a/forge-gui-mobile/src/forge/adventure/scene/SettingsScene.java b/forge-gui-mobile/src/forge/adventure/scene/SettingsScene.java index cb21f1b1deb..7a03cf71c22 100644 --- a/forge-gui-mobile/src/forge/adventure/scene/SettingsScene.java +++ b/forge-gui-mobile/src/forge/adventure/scene/SettingsScene.java @@ -244,13 +244,11 @@ public class SettingsScene extends UIScene { mode = "Crop"; item[0] = mode; //update preference for classic mode if needed - if (Preference.getPref(ForgePreferences.FPref.UI_ENABLE_BORDER_MASKING).equals(mode)) { - Preference.setPref(ForgePreferences.FPref.UI_ENABLE_BORDER_MASKING, mode); - Preference.save(); - Forge.enableUIMask = Preference.getPref(ForgePreferences.FPref.UI_ENABLE_BORDER_MASKING); - ImageCache.clearGeneratedCards(); - ImageCache.disposeTextures(); - } + Preference.setPref(ForgePreferences.FPref.UI_ENABLE_BORDER_MASKING, mode); + Preference.save(); + Forge.enableUIMask = Preference.getPref(ForgePreferences.FPref.UI_ENABLE_BORDER_MASKING); + ImageCache.clearGeneratedCards(); + ImageCache.disposeTextures(); return null; }); addLabel(Forge.getLocalizer().getMessage("lblBorderMaskOption")); diff --git a/forge-gui-mobile/src/forge/adventure/util/RewardActor.java b/forge-gui-mobile/src/forge/adventure/util/RewardActor.java index c3f680d25b9..9bd3dd0cabc 100644 --- a/forge-gui-mobile/src/forge/adventure/util/RewardActor.java +++ b/forge-gui-mobile/src/forge/adventure/util/RewardActor.java @@ -173,7 +173,7 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb } switch (reward.type) { case Card: { - if (ImageCache.imageKeyFileExists(reward.getCard().getImageKey(false))) { + if (ImageCache.imageKeyFileExists(reward.getCard().getImageKey(false)) && !Forge.enableUIMask.equals("Art")) { int count = 0; PaperCard card = ImageUtil.getPaperCardFromImageKey(reward.getCard().getImageKey(false)); File frontFace = ImageKeys.getImageFile(card.getCardImageKey()); @@ -240,7 +240,7 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb String imagePath = ImageUtil.getImageRelativePath(reward.getCard(), "", true, false); File lookup = ImageKeys.hasSetLookup(imagePath) ? ImageKeys.setLookUpFile(imagePath, imagePath + "border") : null; int count = 0; - if (lookup != null) { + if (lookup != null && !Forge.enableUIMask.equals("Art")) { try { Texture replacement = Forge.getAssets().manager().get(lookup.getPath(), Texture.class, false); if (replacement == null) { @@ -259,12 +259,27 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb System.err.println("Failed to load image: " + lookup.getPath()); loaded = false; } - } else if (!ImageCache.imageKeyFileExists(reward.getCard().getImageKey(false))) { + } else { //Cannot find an image file, set up a rendered card until (if) a file is downloaded. + String imageRelativePath = ImageUtil.getImageRelativePath(reward.getCard(), "", true, false); + if (imageRelativePath != null) { + File file = ImageKeys.getImageFile(imagePath); + try { + if (file != null) { + Texture check = Forge.getAssets().manager().get(file.getPath(), Texture.class, false); + if (check == null) { + Forge.getAssets().manager().load(file.getPath(), Texture.class, Forge.getAssets().getTextureFilter()); + Forge.getAssets().manager().finishLoadingAsset(file.getPath()); + } + ImageCache.updateSynqCount(file, 1); + } + } catch (Exception e) {} + } T = renderPlaceholder(new Graphics(), reward.getCard(), false); //Now we can render the card. setCardImage(T); loaded = false; - fetcher.fetchImage(reward.getCard().getImageKey(false), this); + if (!ImageCache.imageKeyFileExists(reward.getCard().getImageKey(false))) + fetcher.fetchImage(reward.getCard().getImageKey(false), this); if (reward.getCard().hasBackFace()) { if (!ImageCache.imageKeyFileExists(reward.getCard().getImageKey(true))) { fetcher.fetchImage(reward.getCard().getImageKey(true), null); diff --git a/forge-gui/res/cardsfolder/g/grell_philosopher.txt b/forge-gui/res/cardsfolder/g/grell_philosopher.txt index c86941de95b..6b806d71fa5 100644 --- a/forge-gui/res/cardsfolder/g/grell_philosopher.txt +++ b/forge-gui/res/cardsfolder/g/grell_philosopher.txt @@ -4,8 +4,8 @@ Types:Creature Horror Wizard PT:1/4 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigEffect | TriggerDescription$ Aberrant Tinkering — When CARDNAME enters the battlefield and at the beginning of your upkeep, each Horror you control gains all activated abilities of target artifact an opponent controls until end of turn. You may spend blue mana as though it were mana of any color to pay the activation costs of CARDNAME's abilities. T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigEffect | TriggerZones$ Battlefield | Secondary$ True | TriggerDescription$ Aberrant Tinkering — When CARDNAME enters the battlefield and at the beginning of your upkeep, each Horror you control gains all activated abilities of target artifact an opponent controls until end of turn. You may spend blue mana as though it were mana of any color to pay the activation costs of CARDNAME's abilities. -SVar:TrigEffect:DB$ Effect | ValidTgts$ Card.Artifact+OppCtrl | TgtZone$ Battlefield | TgtPrompt$ Select target artifact an opponent controls | StaticAbilities$ STSteal | ImprintCards$ Targeted | RememberObjects$ Valid Creature.Horror+YouCtrl | ForgetOnMoved$ Battlefield -SVar:STSteal:Mode$ Continuous | Affected$ Card.IsRemembered | EffectZone$ Command | GainsAbilitiesOfDefined$ ImprintedLKI | GainsAbilitiesActivateIgnoreColor$ Blue->AnyColor +SVar:TrigEffect:DB$ Effect | ValidTgts$ Card.Artifact+OppCtrl | TgtZone$ Battlefield | TgtPrompt$ Select target artifact an opponent controls | StaticAbilities$ STSteal | RememberLKI$ Targeted | ImprintCards$ Valid Creature.Horror+YouCtrl | ForgetOnMoved$ Battlefield +SVar:STSteal:Mode$ Continuous | Affected$ Card.IsImprinted | EffectZone$ Command | GainsAbilitiesOfDefined$ RememberedLKI | GainsAbilitiesActivateIgnoreColor$ Blue->AnyColor AI:RemoveDeck:All DeckHints:Type$Horror Oracle:Aberrant Tinkering — When Grell Philosopher enters the battlefield and at the beginning of your upkeep, each Horror you control gains all activated abilities of target artifact an opponent controls until end of turn. You may spend blue mana as though it were mana of any color to activate those abilities. diff --git a/forge-gui/res/cardsfolder/m/martyrdom.txt b/forge-gui/res/cardsfolder/m/martyrdom.txt index 1b8eea08d2b..c74a2438940 100644 --- a/forge-gui/res/cardsfolder/m/martyrdom.txt +++ b/forge-gui/res/cardsfolder/m/martyrdom.txt @@ -1,8 +1,8 @@ Name:Martyrdom ManaCost:1 W W Types:Instant -A:SP$ Animate | Cost$ 1 W W | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control | Abilities$ Martyr | StackDescription$ Until end of turn, {c:Targeted} gains "{0}: The next 1 damage that would be dealt to target creature, planeswalker, or player this turn is dealt to this creature instead." | SpellDescription$ Until end of turn, target creature you control gains "{0}: The next 1 damage that would be dealt to target creature, planeswalker, or player this turn is dealt to this creature instead." Only you may activate this ability. -SVar:Martyr:AB$ Effect | Name$ Martyrdom Effect | Cost$ 0 | Activator$ Player.IsRemembered | ValidTgts$ Any | TgtPrompt$ Select any target to redirect damage from | Amount$ 1 | ReplacementEffects$ DamageEvent | Duration$ UntilHostLeavesPlayOrEOT | RememberObjects$ You,Targeted | ImprintCards$ Self | ExileOnMoved$ Battlefield | StackDescription$ The next 1 damage that would be dealt to {c:Targeted}{p:Targeted} this turn is dealt to {c:Self} instead. | SpellDescription$ The next 1 damage that would be dealt to target creature, planeswalker, or player this turn is dealt to CARDNAME instead. +A:SP$ Animate | Cost$ 1 W W | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control | Abilities$ Martyr | TransferActivator$ True | StackDescription$ Until end of turn, {c:Targeted} gains "{0}: The next 1 damage that would be dealt to target creature, planeswalker, or player this turn is dealt to this creature instead." | SpellDescription$ Until end of turn, target creature you control gains "{0}: The next 1 damage that would be dealt to target creature, planeswalker, or player this turn is dealt to this creature instead." Only you may activate this ability. +SVar:Martyr:AB$ Effect | Name$ Martyrdom Effect | Cost$ 0 | ValidTgts$ Any | TgtPrompt$ Select any target to redirect damage from | Amount$ 1 | ReplacementEffects$ DamageEvent | Duration$ UntilHostLeavesPlayOrEOT | RememberObjects$ Targeted | ImprintCards$ Self | ExileOnMoved$ Battlefield | StackDescription$ The next 1 damage that would be dealt to {c:Targeted}{p:Targeted} this turn is dealt to {c:Self} instead. | SpellDescription$ The next 1 damage that would be dealt to target creature, planeswalker, or player this turn is dealt to CARDNAME instead. SVar:DamageEvent:Event$ DamageDone | IsPresent$ Card.IsImprinted+Creature | ValidTarget$ Player.IsRemembered,Card.IsRemembered | ReplaceWith$ DamageEventDmg | DamageTarget$ Imprinted | Description$ The next 1 damage that would be dealt to this target this turn is dealt to EFFECTSOURCE instead. SVar:DamageEventDmg:DB$ ReplaceSplitDamage | DamageTarget$ Imprinted Oracle:Until end of turn, target creature you control gains "{0}: The next 1 damage that would be dealt to target creature, planeswalker, or player this turn is dealt to this creature instead." Only you may activate this ability. diff --git a/forge-gui/res/cardsfolder/q/quicksilver_elemental.txt b/forge-gui/res/cardsfolder/q/quicksilver_elemental.txt index 73a4a2a90c1..dd200b43381 100644 --- a/forge-gui/res/cardsfolder/q/quicksilver_elemental.txt +++ b/forge-gui/res/cardsfolder/q/quicksilver_elemental.txt @@ -3,7 +3,7 @@ ManaCost:3 U U Types:Creature Elemental PT:3/4 K:ManaConvert:Blue->AnyColor:You may spend blue mana as though it were mana of any color to pay the activation costs of CARDNAME's abilities. -A:AB$ Effect | Cost$ U | ValidTgts$ Creature | TgtZone$ Battlefield | TgtPrompt$ Select target creature card | StaticAbilities$ STSteal | RememberObjects$ Targeted | Duration$ UntilHostLeavesPlayOrEOT | SpellDescription$ CARDNAME gains all activated abilities of target creature until end of turn. +A:AB$ Effect | Cost$ U | ValidTgts$ Creature | TgtZone$ Battlefield | TgtPrompt$ Select target creature card | StaticAbilities$ STSteal | RememberLKI$ Targeted | Duration$ UntilHostLeavesPlayOrEOT | SpellDescription$ CARDNAME gains all activated abilities of target creature until end of turn. SVar:STSteal:Mode$ Continuous | Affected$ Card.EffectSource | EffectZone$ Command | GainsAbilitiesOfDefined$ RememberedLKI | Description$ Quicksilver Elemental gains all activated abilities of that card until end of turn. AI:RemoveDeck:All Oracle:{U}: Quicksilver Elemental gains all activated abilities of target creature until end of turn. (If any of the abilities use that creature's name, use this creature's name instead.)\nYou may spend blue mana as though it were mana of any color to pay the activation costs of Quicksilver Elemental's abilities. diff --git a/forge-gui/res/cardsfolder/s/shared_fate.txt b/forge-gui/res/cardsfolder/s/shared_fate.txt index 2a1817eb566..0651216cd0c 100644 --- a/forge-gui/res/cardsfolder/s/shared_fate.txt +++ b/forge-gui/res/cardsfolder/s/shared_fate.txt @@ -7,7 +7,7 @@ T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.S SVar:TrigEffects:DB$ RepeatEach | RepeatPlayers$ Player | RepeatSubAbility$ DBEffect SVar:DBEffect:DB$ Effect | EffectOwner$ Remembered | StaticAbilities$ STPlay | ReplacementEffects$ RDraw | Duration$ UntilHostLeavesPlay | ForgetOnMoved$ Exile SVar:RDraw:Event$ Draw | ActiveZones$ Command | ValidPlayer$ You | ReplaceWith$ DBChooseOpp | Description$ If you would draw a card, exile the top card of an opponent's library face down instead. -SVar:DBChooseOpp:DB$ ChoosePlayer | ChoiceTitle$ Choose an opponent whose top library card to exile | Choices$ Player.Opponent | AILogic$ Curse | SubAbility$ DBExile +SVar:DBChooseOpp:DB$ ChoosePlayer | ChoiceTitle$ Choose an opponent whose top library card to exile | Choices$ Player.Opponent | AILogic$ Curse | SubAbility$ DBExile | DontNotify$ True SVar:DBExile:DB$ Dig | DigNum$ 1 | ChangeNum$ All | DestinationZone$ Exile | ExileFaceDown$ True | Defined$ Player.Chosen | RememberChanged$ True SVar:STPlay:Mode$ Continuous | MayLookAt$ You | MayPlay$ True | EffectZone$ Command | Affected$ Card.IsRemembered | AffectedZone$ Exile | Description$ You may look at and play cards exiled with Shared Fate. AI:RemoveDeck:All