Merge branch 'Card-Forge:master' into formats/premodern

This commit is contained in:
Valerio Maggio
2023-05-14 09:09:05 +01:00
committed by GitHub
10 changed files with 57 additions and 20 deletions

View File

@@ -109,6 +109,10 @@ public abstract class AnimateEffectBase extends SpellAbilityEffect {
for (final String s : abilities) { for (final String s : abilities) {
SpellAbility sSA = AbilityFactory.getAbility(c, s, sa); SpellAbility sSA = AbilityFactory.getAbility(c, s, sa);
addedAbilities.add(sSA); addedAbilities.add(sSA);
if (sa.hasParam("TransferActivator")) {
sSA.getRestrictions().setActivator("Player.PlayerUID_" + sa.getActivatingPlayer().getId());
}
} }
// Grant triggers // Grant triggers

View File

@@ -1,5 +1,6 @@
package forge.game.ability.effects; package forge.game.ability.effects;
import forge.game.GameLogEntryType;
import forge.game.ability.AbilityUtils; import forge.game.ability.AbilityUtils;
import forge.game.ability.SpellAbilityEffect; import forge.game.ability.SpellAbilityEffect;
import forge.game.card.Card; import forge.game.card.Card;
@@ -57,8 +58,12 @@ public class ChoosePlayerEffect extends SpellAbilityEffect {
if (sa.hasParam("RememberChosen")) { if (sa.hasParam("RememberChosen")) {
card.addRemembered(chosen); 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 // SubAbility that only fires if a player is chosen
SpellAbility chosenSA = sa.getAdditionalAbility("ChooseSubAbility"); SpellAbility chosenSA = sa.getAdditionalAbility("ChooseSubAbility");
if (chosenSA != null) { if (chosenSA != null) {

View File

@@ -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")) { if (sa.hasParam("ImprintCards")) {
effectImprinted = sa.getParam("ImprintCards"); effectImprinted = sa.getParam("ImprintCards");
} }
@@ -202,7 +217,6 @@ public class EffectEffect extends SpellAbilityEffect {
// Remember Keywords // Remember Keywords
if (sa.hasParam("RememberKeywords")) { if (sa.hasParam("RememberKeywords")) {
rememberList = new FCollection<>();
List<String> effectKeywords = Arrays.asList(sa.getParam("RememberKeywords").split(",")); List<String> effectKeywords = Arrays.asList(sa.getParam("RememberKeywords").split(","));
if (sa.hasParam("SharedKeywordsZone")) { if (sa.hasParam("SharedKeywordsZone")) {
List<ZoneType> zones = ZoneType.listValueOf(sa.getParam("SharedKeywordsZone")); List<ZoneType> zones = ZoneType.listValueOf(sa.getParam("SharedKeywordsZone"));

View File

@@ -44,6 +44,7 @@ public class DialogData implements Serializable {
public String voiceFile; public String voiceFile;
static public class ActionData implements Serializable { static public class ActionData implements Serializable {
public static final long serialVersionUID = 2848523275822677205L;
static public class QuestFlag implements Serializable{ static public class QuestFlag implements Serializable{
public String key; public String key;
public int val; public int val;

View File

@@ -244,13 +244,11 @@ public class SettingsScene extends UIScene {
mode = "Crop"; mode = "Crop";
item[0] = mode; item[0] = mode;
//update preference for classic mode if needed //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.setPref(ForgePreferences.FPref.UI_ENABLE_BORDER_MASKING, mode); Preference.save();
Preference.save(); Forge.enableUIMask = Preference.getPref(ForgePreferences.FPref.UI_ENABLE_BORDER_MASKING);
Forge.enableUIMask = Preference.getPref(ForgePreferences.FPref.UI_ENABLE_BORDER_MASKING); ImageCache.clearGeneratedCards();
ImageCache.clearGeneratedCards(); ImageCache.disposeTextures();
ImageCache.disposeTextures();
}
return null; return null;
}); });
addLabel(Forge.getLocalizer().getMessage("lblBorderMaskOption")); addLabel(Forge.getLocalizer().getMessage("lblBorderMaskOption"));

View File

@@ -173,7 +173,7 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb
} }
switch (reward.type) { switch (reward.type) {
case Card: { case Card: {
if (ImageCache.imageKeyFileExists(reward.getCard().getImageKey(false))) { if (ImageCache.imageKeyFileExists(reward.getCard().getImageKey(false)) && !Forge.enableUIMask.equals("Art")) {
int count = 0; int count = 0;
PaperCard card = ImageUtil.getPaperCardFromImageKey(reward.getCard().getImageKey(false)); PaperCard card = ImageUtil.getPaperCardFromImageKey(reward.getCard().getImageKey(false));
File frontFace = ImageKeys.getImageFile(card.getCardImageKey()); 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); String imagePath = ImageUtil.getImageRelativePath(reward.getCard(), "", true, false);
File lookup = ImageKeys.hasSetLookup(imagePath) ? ImageKeys.setLookUpFile(imagePath, imagePath + "border") : null; File lookup = ImageKeys.hasSetLookup(imagePath) ? ImageKeys.setLookUpFile(imagePath, imagePath + "border") : null;
int count = 0; int count = 0;
if (lookup != null) { if (lookup != null && !Forge.enableUIMask.equals("Art")) {
try { try {
Texture replacement = Forge.getAssets().manager().get(lookup.getPath(), Texture.class, false); Texture replacement = Forge.getAssets().manager().get(lookup.getPath(), Texture.class, false);
if (replacement == null) { 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()); System.err.println("Failed to load image: " + lookup.getPath());
loaded = false; 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. //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. T = renderPlaceholder(new Graphics(), reward.getCard(), false); //Now we can render the card.
setCardImage(T); setCardImage(T);
loaded = false; 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 (reward.getCard().hasBackFace()) {
if (!ImageCache.imageKeyFileExists(reward.getCard().getImageKey(true))) { if (!ImageCache.imageKeyFileExists(reward.getCard().getImageKey(true))) {
fetcher.fetchImage(reward.getCard().getImageKey(true), null); fetcher.fetchImage(reward.getCard().getImageKey(true), null);

View File

@@ -4,8 +4,8 @@ Types:Creature Horror Wizard
PT:1/4 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$ 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. 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: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.IsRemembered | EffectZone$ Command | GainsAbilitiesOfDefined$ ImprintedLKI | GainsAbilitiesActivateIgnoreColor$ Blue->AnyColor SVar:STSteal:Mode$ Continuous | Affected$ Card.IsImprinted | EffectZone$ Command | GainsAbilitiesOfDefined$ RememberedLKI | GainsAbilitiesActivateIgnoreColor$ Blue->AnyColor
AI:RemoveDeck:All AI:RemoveDeck:All
DeckHints:Type$Horror 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. 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.

View File

@@ -1,8 +1,8 @@
Name:Martyrdom Name:Martyrdom
ManaCost:1 W W ManaCost:1 W W
Types:Instant 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. 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 | 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. 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: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 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. 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.

View File

@@ -3,7 +3,7 @@ ManaCost:3 U U
Types:Creature Elemental Types:Creature Elemental
PT:3/4 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. 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. 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 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. 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.

View File

@@ -7,7 +7,7 @@ T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.S
SVar:TrigEffects:DB$ RepeatEach | RepeatPlayers$ Player | RepeatSubAbility$ DBEffect SVar:TrigEffects:DB$ RepeatEach | RepeatPlayers$ Player | RepeatSubAbility$ DBEffect
SVar:DBEffect:DB$ Effect | EffectOwner$ Remembered | StaticAbilities$ STPlay | ReplacementEffects$ RDraw | Duration$ UntilHostLeavesPlay | ForgetOnMoved$ Exile 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: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: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. 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 AI:RemoveDeck:All