mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-14 01:38:13 +00:00
Adventure updates
Adventure items can now spawn cards in command zone via startBattleWithCardInCommandZone - Updated Mana Shard based items to do so. Added new map objects: Mana Shard rewards, generic collision zone, intended for use in upcoming map updates. Fixed mismatched wall tile in green castle.
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -2891,6 +2891,16 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
com.add(conspire);
|
||||
}
|
||||
|
||||
// Adventure Mode items
|
||||
Iterable<? extends IPaperCard> 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();
|
||||
|
||||
@@ -29,6 +29,7 @@ public class RegisteredPlayer {
|
||||
private int manaShards = 0;
|
||||
private Iterable<IPaperCard> cardsOnBattlefield = null;
|
||||
private Iterable<IPaperCard> extraCardsOnBattlefield = null;
|
||||
private Iterable<IPaperCard> extraCardsInCommandZone = null;
|
||||
private Iterable<? extends IPaperCard> schemes = null;
|
||||
private Iterable<PaperCard> planes = null;
|
||||
private Iterable<PaperCard> conspiracies = null;
|
||||
@@ -56,6 +57,10 @@ public class RegisteredPlayer {
|
||||
extraCardsOnBattlefield == null ? EmptyList : extraCardsOnBattlefield);
|
||||
}
|
||||
|
||||
public final Iterable<? extends IPaperCard> 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<IPaperCard> extraCardsInCommandZone) {
|
||||
if (this.extraCardsInCommandZone == null)
|
||||
this.extraCardsInCommandZone = extraCardsInCommandZone;
|
||||
else
|
||||
this.extraCardsInCommandZone = Iterables.concat(this.extraCardsInCommandZone, extraCardsInCommandZone);
|
||||
}
|
||||
|
||||
public int getStartingHand() {
|
||||
return startingHand;
|
||||
}
|
||||
|
||||
@@ -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<IPaperCard> startBattleWithCardsInCommandZone(){
|
||||
Array<IPaperCard> 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<IPaperCard> array=startBattleWithCards();
|
||||
|
||||
@@ -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<IPaperCard> startCards = new Array<>();
|
||||
Array<IPaperCard> 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));
|
||||
|
||||
@@ -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.
|
||||
Oracle:Pay {M}, exile Cursed Treasure: Create a Treasure token. You lose 2 life.
|
||||
SVar:Eject:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile
|
||||
@@ -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.
|
||||
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
|
||||
@@ -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
|
||||
@@ -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.
|
||||
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
|
||||
@@ -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.
|
||||
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
|
||||
@@ -29,7 +29,7 @@
|
||||
<property name="spriteLayer" type="bool" value="true"/>
|
||||
</properties>
|
||||
<data encoding="base64" compression="zlib">
|
||||
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==
|
||||
</data>
|
||||
</layer>
|
||||
<layer id="5" name="AboveSprites" width="48" height="48">
|
||||
|
||||
8
forge-gui/res/adventure/Shandalar/maps/obj/collision.tx
Normal file
8
forge-gui/res/adventure/Shandalar/maps/obj/collision.tx
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<template>
|
||||
<object name="collsion" class="collision" width="21.5" height="290.5">
|
||||
<properties>
|
||||
<property name="type" value="collision"/>
|
||||
</properties>
|
||||
</object>
|
||||
</template>
|
||||
20
forge-gui/res/adventure/Shandalar/maps/obj/manashards.tx
Normal file
20
forge-gui/res/adventure/Shandalar/maps/obj/manashards.tx
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<template>
|
||||
<tileset firstgid="1" source="../tileset/main.tsx"/>
|
||||
<object name="Shards" class="reward" gid="3139" width="16" height="16">
|
||||
<properties>
|
||||
<property name="reward">[
|
||||
{
|
||||
"type": "shards",
|
||||
"count": 2,
|
||||
"addMaxCount": 5
|
||||
}
|
||||
]</property>
|
||||
<property name="spawn.Easy" type="bool" value="true"/>
|
||||
<property name="spawn.Hard" type="bool" value="true"/>
|
||||
<property name="spawn.Normal" type="bool" value="true"/>
|
||||
<property name="sprite" value="sprites/manashards.atlas"/>
|
||||
<property name="type" value="reward"/>
|
||||
</properties>
|
||||
</object>
|
||||
</template>
|
||||
@@ -3496,6 +3496,18 @@
|
||||
<object id="1" x="0" y="0" width="15" height="15"/>
|
||||
</objectgroup>
|
||||
</tile>
|
||||
<tile id="2343">
|
||||
<objectgroup draworder="index" id="2">
|
||||
<object id="1" x="0" y="12.9511" width="16" height="3.00638"/>
|
||||
<object id="2" x="0.0850611" y="0.0217969" width="16" height="1.90058"/>
|
||||
</objectgroup>
|
||||
</tile>
|
||||
<tile id="2344">
|
||||
<objectgroup draworder="index" id="2">
|
||||
<object id="3" x="-0.0839979" y="0" width="2.13291" height="16"/>
|
||||
<object id="4" x="14.1212" y="-0.0425306" width="1.83519" height="16"/>
|
||||
</objectgroup>
|
||||
</tile>
|
||||
<tile id="2345">
|
||||
<objectgroup draworder="index" id="2">
|
||||
<object id="1" x="2" y="0" width="14" height="15"/>
|
||||
|
||||
17
forge-gui/res/adventure/Shandalar/sprites/manashards.atlas
Normal file
17
forge-gui/res/adventure/Shandalar/sprites/manashards.atlas
Normal file
@@ -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
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 18 KiB |
@@ -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"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user