diff --git a/forge-adventure/src/main/java/forge/adventure/editor/RewardEdit.java b/forge-adventure/src/main/java/forge/adventure/editor/RewardEdit.java index 65cc3767bb0..0b2f521f707 100644 --- a/forge-adventure/src/main/java/forge/adventure/editor/RewardEdit.java +++ b/forge-adventure/src/main/java/forge/adventure/editor/RewardEdit.java @@ -15,7 +15,7 @@ import java.util.Arrays; public class RewardEdit extends FormPanel { RewardData currentData; - JComboBox typeField =new JComboBox(new String[] { "card", "gold", "life", "deckCard", "item","mana"}); + JComboBox typeField =new JComboBox(new String[] { "card", "gold", "life", "deckCard", "item","shards"}); JSpinner probability = new JSpinner(new SpinnerNumberModel(0f, 0, 1, 0.1f)); JSpinner count = new JSpinner(new SpinnerNumberModel(0, 0, 1000, 1)); JSpinner addMaxCount = new JSpinner(new SpinnerNumberModel(0, 0, 1000, 1)); diff --git a/forge-game/src/main/java/forge/game/player/Player.java b/forge-game/src/main/java/forge/game/player/Player.java index 83896843267..13759edaa84 100644 --- a/forge-game/src/main/java/forge/game/player/Player.java +++ b/forge-game/src/main/java/forge/game/player/Player.java @@ -2891,6 +2891,16 @@ public class Player extends GameEntity implements Comparable { com.add(conspire); } + // Adventure Mode items + Iterable adventureItemCards = registeredPlayer.getExtraCardsInCommandZone(); + if (adventureItemCards != null) { + for (final IPaperCard cp : adventureItemCards) { + Card c = Card.fromPaperCard(cp, this); + com.add(c); + c.setStartsGameInPlay(true); + } + } + for (final Card c : getCardsIn(ZoneType.Library)) { for (KeywordInterface inst : c.getKeywords()) { String kw = inst.getOriginal(); diff --git a/forge-game/src/main/java/forge/game/player/RegisteredPlayer.java b/forge-game/src/main/java/forge/game/player/RegisteredPlayer.java index 2607a62c6b0..6cb37ae0891 100644 --- a/forge-game/src/main/java/forge/game/player/RegisteredPlayer.java +++ b/forge-game/src/main/java/forge/game/player/RegisteredPlayer.java @@ -29,6 +29,7 @@ public class RegisteredPlayer { private int manaShards = 0; private Iterable cardsOnBattlefield = null; private Iterable extraCardsOnBattlefield = null; + private Iterable extraCardsInCommandZone = null; private Iterable schemes = null; private Iterable planes = null; private Iterable conspiracies = null; @@ -56,6 +57,10 @@ public class RegisteredPlayer { extraCardsOnBattlefield == null ? EmptyList : extraCardsOnBattlefield); } + public final Iterable getExtraCardsInCommandZone() { + return extraCardsInCommandZone == null ? EmptyList : extraCardsInCommandZone; + } + public final void setStartingLife(int startingLife) { this.startingLife = startingLife; } @@ -86,6 +91,13 @@ public class RegisteredPlayer { this.extraCardsOnBattlefield = Iterables.concat(this.extraCardsOnBattlefield, extraCardsonTable); } + public final void addExtraCardsInCommandZone(Iterable extraCardsInCommandZone) { + if (this.extraCardsInCommandZone == null) + this.extraCardsInCommandZone = extraCardsInCommandZone; + else + this.extraCardsInCommandZone = Iterables.concat(this.extraCardsInCommandZone, extraCardsInCommandZone); + } + public int getStartingHand() { return startingHand; } diff --git a/forge-gui-mobile/src/forge/adventure/data/EffectData.java b/forge-gui-mobile/src/forge/adventure/data/EffectData.java index 1b35fc83b49..9e2d43f8149 100644 --- a/forge-gui-mobile/src/forge/adventure/data/EffectData.java +++ b/forge-gui-mobile/src/forge/adventure/data/EffectData.java @@ -14,6 +14,7 @@ public class EffectData implements Serializable { public int lifeModifier = 0; //Amount to add to starting Life. public int changeStartCards = 0; //Amount to add to starting hand size. public String[] startBattleWithCard; //Cards that start in the Battlefield. + public String[] startBattleWithCardInCommandZone; //Cards that start in the Command Zone of the Battlefield. //Map only effects. public boolean colorView = false; //Allows to display enemy colors on the map. public float moveSpeed = 1.0f; //Change of movement speed. Map only. @@ -52,6 +53,23 @@ public class EffectData implements Serializable { return startCards; } + public Array startBattleWithCardsInCommandZone(){ + Array startCardsInCommandZone=new Array<>(); + if(startBattleWithCardInCommandZone != null) { + for (String name:startBattleWithCardInCommandZone) { + PaperCard C = FModel.getMagicDb().getCommonCards().getCard(name); + if(C != null) + startCardsInCommandZone.add(C); + else { + PaperToken T = FModel.getMagicDb().getAllTokens().getToken(name); + if (T != null) startCardsInCommandZone.add(T); + else System.err.print("Can not find card \"" + name + "\"\n"); + } + } + } + return startCardsInCommandZone; + } + public String cardNames() { StringBuilder ret = new StringBuilder(); Array array=startBattleWithCards(); diff --git a/forge-gui-mobile/src/forge/adventure/scene/DuelScene.java b/forge-gui-mobile/src/forge/adventure/scene/DuelScene.java index 5e2772a0070..5b0938613d6 100644 --- a/forge-gui-mobile/src/forge/adventure/scene/DuelScene.java +++ b/forge-gui-mobile/src/forge/adventure/scene/DuelScene.java @@ -20,6 +20,7 @@ import forge.assets.FBufferedImage; import forge.assets.FSkin; import forge.deck.Deck; import forge.deck.DeckProxy; +import forge.deck.DeckSection; import forge.game.GameRules; import forge.game.GameType; import forge.game.card.CounterEnumType; @@ -167,14 +168,19 @@ public class DuelScene extends ForgeScene { int changeStartCards = 0; int extraManaShards = 0; Array startCards = new Array<>(); + Array startCardsInCommandZone = new Array<>(); for (EffectData data : effects) { lifeMod += data.lifeModifier; changeStartCards += data.changeStartCards; startCards.addAll(data.startBattleWithCards()); + startCardsInCommandZone.addAll(data.startBattleWithCardsInCommandZone()); + extraManaShards += data.extraManaShards; } player.addExtraCardsOnBattlefield(startCards); + player.addExtraCardsInCommandZone(startCardsInCommandZone); + player.setStartingLife(Math.max(1, lifeMod + player.getStartingLife())); player.setStartingHand(player.getStartingHand() + changeStartCards); player.setManaShards((player.getManaShards() + extraManaShards)); diff --git a/forge-gui/res/adventure/Shandalar/custom_cards/cursed_treasure.txt b/forge-gui/res/adventure/Shandalar/custom_cards/cursed_treasure.txt index f230c847d32..24f958bb979 100644 --- a/forge-gui/res/adventure/Shandalar/custom_cards/cursed_treasure.txt +++ b/forge-gui/res/adventure/Shandalar/custom_cards/cursed_treasure.txt @@ -3,6 +3,7 @@ ManaCost:no cost Types:Artifact S:Mode$ Continuous | Description$ Provided by Cursed Treasure (Equipped Item - Right) StackDescription$ Create a Treasure token. You lose 2 life. | SpellDescription$ Create a Treasure token. You lose 2 life. -A:AB$ Token | Cost$ PayShards<1> Sac<1/CARDNAME> | TokenScript$ c_a_treasure_sac | SubAbility$ DBLoseLife2 | SpellDescription$ Create a Treasure token. +A:AB$ Token | Cost$ PayShards<1> T | ActivationZone$ Command | TokenScript$ c_a_treasure_sac | SubAbility$ DBLoseLife2 | SubAbility$ Eject | SpellDescription$ Create a Treasure token. SVar:DBLoseLife2:DB$ LoseLife | LifeAmount$ 2 | Defined$ You -Oracle: Provided by Cursed Treasure. Pay {M}, sacrifice Cursed Treasure: Create a Treasure token. You lose 2 life. \ No newline at end of file +Oracle:Pay {M}, exile Cursed Treasure: Create a Treasure token. You lose 2 life. +SVar:Eject:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile \ No newline at end of file diff --git a/forge-gui/res/adventure/Shandalar/custom_cards/farmers_tools.txt b/forge-gui/res/adventure/Shandalar/custom_cards/farmers_tools.txt index aaa555d121b..4431bb58be3 100644 --- a/forge-gui/res/adventure/Shandalar/custom_cards/farmers_tools.txt +++ b/forge-gui/res/adventure/Shandalar/custom_cards/farmers_tools.txt @@ -2,5 +2,6 @@ Name:Farmer's Tools ManaCost:no cost Types:Artifact S:Mode$ Continuous | Description$ Provided by Farmer's Tools (Equipped Item - Left) -A:AB$ ChangeZone | Cost$ PayShards<2> Sac<1/CARDNAME> | ExileOnMoved$ Battlefield | Optional$ True | Origin$ Hand | Destination$ Battlefield | ChangeType$ Land | DefinedPlayer$ Player | ChangeNum$ 1 | StackDescription$ Each player may put a land card from their hand onto the battlefield. -Oracle: Provided by Farmer's Tools. Pay {M}{M}, sacrifice Farmer's Tools: Starting with you, each player may place a land card from their hand onto the battlefield. \ No newline at end of file +A:AB$ ChangeZone | Cost$ PayShards<2> T | ActivationZone$ Command | SubAbility$ Eject | ExileOnMoved$ Battlefield | Optional$ True | Origin$ Hand | Destination$ Battlefield | ChangeType$ Land | DefinedPlayer$ Player | ChangeNum$ 1 | StackDescription$ Each player may put a land card from their hand onto the battlefield. +Oracle: Pay {M}{M}, exile Farmer's Tools: Starting with you, each player may place a land card from their hand onto the battlefield. +SVar:Eject:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile \ No newline at end of file diff --git a/forge-gui/res/adventure/Shandalar/custom_cards/hill_giant_club.txt b/forge-gui/res/adventure/Shandalar/custom_cards/hill_giant_club.txt index f01e05754ab..2cf9dee5890 100644 --- a/forge-gui/res/adventure/Shandalar/custom_cards/hill_giant_club.txt +++ b/forge-gui/res/adventure/Shandalar/custom_cards/hill_giant_club.txt @@ -2,9 +2,7 @@ Name:Hill Giant Club ManaCost:no cost Types:Artifact S:Mode$ Continuous | Description$ Provided by Hill Giant Club (Equipped Item - Right) -A:AB$ Effect | Cost$ PayShards<2> Sac<1/CARDNAME> | ValidTgts$ Creature | TgtPrompt$ Select target creature | ExileOnMoved$ Battlefield | StaticAbilities$ UnblockableLE2 | RememberObjects$ Targeted | StackDescription$ {c:Targeted} can't be blocked by creatures with power 2 or less this turn. | SpellDescription$ Targe creature can't be blocked by creatures with power 2 or less this turn. +A:AB$ Effect | Cost$ PayShards<2> T | ActivationZone$ Command | SubAbility$ Eject | ValidTgts$ Creature | TgtPrompt$ Select target creature | ExileOnMoved$ Battlefield | StaticAbilities$ UnblockableLE2 | RememberObjects$ Targeted | StackDescription$ {c:Targeted} can't be blocked by creatures with power 2 or less this turn. | SpellDescription$ Targe creature can't be blocked by creatures with power 2 or less this turn. SVar:UnblockableLE2:Mode$ CantBlockBy | ValidAttacker$ Card.IsRemembered | ValidBlocker$ Creature.powerLE2 | Description$ {c:Targeted} can't be blocked by creatures with power 2 or less this turn. -Oracle: Provided by Hill Giant Club. Pay {M}{M}, sacrifice Hill Giant Club: Target creature can't be blocked by creatures with power 2 or less this turn. - - - +Oracle: Pay {M}{M}, exile Hill Giant Club: Target creature can't be blocked by creatures with power 2 or less this turn. +SVar:Eject:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile \ No newline at end of file diff --git a/forge-gui/res/adventure/Shandalar/custom_cards/pipers_charm.txt b/forge-gui/res/adventure/Shandalar/custom_cards/pipers_charm.txt index 3cc5ab5c7fb..d8251b1ee60 100644 --- a/forge-gui/res/adventure/Shandalar/custom_cards/pipers_charm.txt +++ b/forge-gui/res/adventure/Shandalar/custom_cards/pipers_charm.txt @@ -2,6 +2,7 @@ Name:Piper's Charm ManaCost:no cost Types:Artifact S:Mode$ Continuous | Description$ Provided by Piper's Charm (Equipped Item - Neck) -A:AB$ Effect | Cost$ PayShards<3> Sac<1/CARDNAME> | ValidTgts$ Creature | ExileOnMoved$ Battlefield | StaticAbilities$ MustBlock | RememberObjects$ Targeted | StackDescription$ {c:Targeted} blocks this turn if able. | SpellDescription$ Target creature blocks this turn if able. +A:AB$ Effect | Cost$ PayShards<3> T | ActivationZone$ Command | SubAbility$ Eject | ValidTgts$ Creature | ExileOnMoved$ Battlefield | StaticAbilities$ MustBlock | RememberObjects$ Targeted | StackDescription$ {c:Targeted} blocks this turn if able. | SpellDescription$ Target creature blocks this turn if able. SVar:MustBlock:Mode$ MustBlock | ValidCreature$ Card.IsRemembered | Description$ This creature blocks this turn if able. -Oracle: Provided by Piper's Charm. Pay {M}{M}{M}, sacrifice Piper's Charm: Target creature blocks this turn if able. \ No newline at end of file +Oracle: Pay {M}{M}{M}, exile Piper's Charm: Target creature blocks this turn if able. +SVar:Eject:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile \ No newline at end of file diff --git a/forge-gui/res/adventure/Shandalar/custom_cards/sleep_wand.txt b/forge-gui/res/adventure/Shandalar/custom_cards/sleep_wand.txt index 3af0901add6..71d6869d5f7 100644 --- a/forge-gui/res/adventure/Shandalar/custom_cards/sleep_wand.txt +++ b/forge-gui/res/adventure/Shandalar/custom_cards/sleep_wand.txt @@ -2,5 +2,6 @@ Name:Sleep Wand ManaCost:no cost Types:Artifact S:Mode$ Continuous | Description$ Provided by Sleep Wand (Equipped Item - Left) -A:AB$ PutCounter | Cost$ PayShards<2> Sac<1/CARDNAME> | ValidTgts$ Creature | ExileOnMoved$ Battlefield ValidTgts$ Creature | TgtPrompt$ Select target creature | CounterType$ Stun | CounterNum$ 1 | StackDescription$ Put a stun counter on target creature. (If a permanent with a stun counter would become untapped, remove one from it instead.) -Oracle: Provided by Sleep Wand. Pay {M}, sacrifice Sleep Wand: Put a stun counter on target creature. \ No newline at end of file +A:AB$ PutCounter | Cost$ PayShards<2> T | ActivationZone$ Command | SubAbility$ Eject | ValidTgts$ Creature | ExileOnMoved$ Battlefield ValidTgts$ Creature | TgtPrompt$ Select target creature | CounterType$ Stun | CounterNum$ 1 | StackDescription$ Put a stun counter on target creature. (If a permanent with a stun counter would become untapped, remove one from it instead.) +Oracle: Pay {M}, exile Sleep Wand: Put a stun counter on target creature. +SVar:Eject:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile \ No newline at end of file diff --git a/forge-gui/res/adventure/Shandalar/maps/map/main_story/green_castle.tmx b/forge-gui/res/adventure/Shandalar/maps/map/main_story/green_castle.tmx index 4ba260e015a..78178402e21 100644 --- a/forge-gui/res/adventure/Shandalar/maps/map/main_story/green_castle.tmx +++ b/forge-gui/res/adventure/Shandalar/maps/map/main_story/green_castle.tmx @@ -29,7 +29,7 @@ - eJztmH0OwiAMxTnBNo3uIu4WXsePHUt3FS+kiyOZhNI3RsFkJelfkr5fhm0fdJUxnYaGhoaGhoaGYLSNMU8wzjt877HJw3/46EisvfJvgr+vjbkCcau/XBdw/73OX8vIOeX6rlvhR/vnMPE/tH8qv/KL83N1aetLmh/pD75a57j2mfiR/L6ziuVH5ys1n1Px91NOisfOdzd/7P+WykP5kzkb5TXGnBwPpYvONaqOEF1qj9UeZyY3L19V/LmH9nO6cza3ftfUZCr+GE3l/w/+pXcSKX7pu45PMyX/Gg/h63/2/SPkHST4W0cfuSeE9BHNlPwIi/L//ub2AOr9gfIhpfmpfEv01vCH/Fvom1Fzn7u/DwvOcu7fQr2T829S3p/7thwb6t9c75Z6hbSl/FuJldL/lFix/ifmfhh7vyz91mvP9CSso/xl+d+e+Pwi + eJztmH0OgjAMxXcCQKKchFt4HT84lnIVL6REluCyro+xbiZ0yfvLpf2F2fZtfWVMr1KpVCqVSiWorjHmCep8wPeemjz8x08eidUq/y74h9qYK6Bb/eW6gPvvdf5aRs4p13fdCz/aP8eZ/6H9U/mVX5yfq0tbX9L8SH/w1TrH1WbiR+L7ziqWH52v1HxOxT/MMSkeO9/d+LH/WyoO5U+WbJTXmGJyPFRedK5RdYTkpfbY3NPM5Oblq4o/99B+Lu+Sza3fLTWZij8mp/L/B//aO4kUv/Rdx5czJf8WD+Hrf/b9I+QdJPg7Jz9yTwjlR3Km5EdYlP/3N7cHUO8PlA8pzU/FW5NvC3/Iv4W+GTX3ufv7uOIsl/4t1Ds5/ybl/blvy7Gh/s31bqlXKLeUfyuxUvqfEivW/8TcD2Pvl6Xfev/1/VP50+oNNlL7xQ== diff --git a/forge-gui/res/adventure/Shandalar/maps/obj/collision.tx b/forge-gui/res/adventure/Shandalar/maps/obj/collision.tx new file mode 100644 index 00000000000..4a1d90320cb --- /dev/null +++ b/forge-gui/res/adventure/Shandalar/maps/obj/collision.tx @@ -0,0 +1,8 @@ + + diff --git a/forge-gui/res/adventure/Shandalar/maps/obj/manashards.tx b/forge-gui/res/adventure/Shandalar/maps/obj/manashards.tx new file mode 100644 index 00000000000..808056ba3bf --- /dev/null +++ b/forge-gui/res/adventure/Shandalar/maps/obj/manashards.tx @@ -0,0 +1,20 @@ + + diff --git a/forge-gui/res/adventure/Shandalar/maps/tileset/main.tsx b/forge-gui/res/adventure/Shandalar/maps/tileset/main.tsx index c2c7fa70f43..5cde5a2a859 100644 --- a/forge-gui/res/adventure/Shandalar/maps/tileset/main.tsx +++ b/forge-gui/res/adventure/Shandalar/maps/tileset/main.tsx @@ -3496,6 +3496,18 @@ + + + + + + + + + + + + diff --git a/forge-gui/res/adventure/Shandalar/sprites/manashards.atlas b/forge-gui/res/adventure/Shandalar/sprites/manashards.atlas new file mode 100644 index 00000000000..c2af9ee4520 --- /dev/null +++ b/forge-gui/res/adventure/Shandalar/sprites/manashards.atlas @@ -0,0 +1,17 @@ +treasure.png +size: 64,144 +format: RGBA8888 +filter: Nearest,Nearest +repeat: none +Idle + xy: 0, 128 + size: 16, 16 +Idle + xy: 16, 128 + size: 16, 16 +Idle + xy: 32, 128 + size: 16, 16 +Idle + xy: 48, 128 + size: 16, 16 diff --git a/forge-gui/res/adventure/Shandalar/sprites/treasure.png b/forge-gui/res/adventure/Shandalar/sprites/treasure.png index a25b381e9bf..da1337791ba 100644 Binary files a/forge-gui/res/adventure/Shandalar/sprites/treasure.png and b/forge-gui/res/adventure/Shandalar/sprites/treasure.png differ diff --git a/forge-gui/res/adventure/Shandalar/world/items.json b/forge-gui/res/adventure/Shandalar/world/items.json index e530cdd5fcd..e5f9996df05 100644 --- a/forge-gui/res/adventure/Shandalar/world/items.json +++ b/forge-gui/res/adventure/Shandalar/world/items.json @@ -4,7 +4,7 @@ "equipmentSlot": "Neck", "iconName": "PipersCharm", "effect": { - "startBattleWithCard": [ + "startBattleWithCardInCommandZone": [ "Piper's Charm" ] } @@ -13,7 +13,7 @@ "equipmentSlot": "Left", "iconName": "SleepWand", "effect": { - "startBattleWithCard": [ + "startBattleWithCardInCommandZone": [ "Sleep Wand" ] } @@ -22,7 +22,7 @@ "equipmentSlot": "Right", "iconName": "HillGiantClub", "effect": { - "startBattleWithCard": [ + "startBattleWithCardInCommandZone": [ "Hill Giant Club" ] } @@ -31,7 +31,7 @@ "equipmentSlot": "Right", "iconName": "CursedTreasure", "effect": { - "startBattleWithCard": [ + "startBattleWithCardInCommandZone": [ "Cursed Treasure" ] } @@ -40,7 +40,7 @@ "equipmentSlot": "Left", "iconName": "FarmersTools", "effect": { - "startBattleWithCard": [ + "startBattleWithCardInCommandZone": [ "Farmer's Tools" ] }