@@ -4,9 +4,7 @@ import java.util.ArrayDeque;
|
|||||||
import java.util.Deque;
|
import java.util.Deque;
|
||||||
|
|
||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.*;
|
||||||
import com.badlogic.gdx.graphics.GL20;
|
|
||||||
import com.badlogic.gdx.graphics.Texture;
|
|
||||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
import com.badlogic.gdx.graphics.glutils.ShaderProgram;
|
import com.badlogic.gdx.graphics.glutils.ShaderProgram;
|
||||||
@@ -44,6 +42,8 @@ public class Graphics {
|
|||||||
private final ShaderProgram shaderWarp = new ShaderProgram(Gdx.files.internal("shaders").child("grayscale.vert"), Gdx.files.internal("shaders").child("warp.frag"));
|
private final ShaderProgram shaderWarp = new ShaderProgram(Gdx.files.internal("shaders").child("grayscale.vert"), Gdx.files.internal("shaders").child("warp.frag"));
|
||||||
private final ShaderProgram shaderUnderwater = new ShaderProgram(Gdx.files.internal("shaders").child("grayscale.vert"), Gdx.files.internal("shaders").child("underwater.frag"));
|
private final ShaderProgram shaderUnderwater = new ShaderProgram(Gdx.files.internal("shaders").child("grayscale.vert"), Gdx.files.internal("shaders").child("underwater.frag"));
|
||||||
|
|
||||||
|
private Texture dummyTexture = null;
|
||||||
|
|
||||||
public Graphics() {
|
public Graphics() {
|
||||||
ShaderProgram.pedantic = false;
|
ShaderProgram.pedantic = false;
|
||||||
}
|
}
|
||||||
@@ -87,6 +87,7 @@ public class Graphics {
|
|||||||
shaderGrayscale.dispose();
|
shaderGrayscale.dispose();
|
||||||
shaderUnderwater.dispose();
|
shaderUnderwater.dispose();
|
||||||
shaderWarp.dispose();
|
shaderWarp.dispose();
|
||||||
|
if(dummyTexture != null) dummyTexture.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public SpriteBatch getBatch() {
|
public SpriteBatch getBatch() {
|
||||||
@@ -1124,4 +1125,14 @@ public class Graphics {
|
|||||||
int brightness = ((c_r * 299) + (c_g * 587) + (c_b * 114)) / 1000;
|
int brightness = ((c_r * 299) + (c_g * 587) + (c_b * 114)) / 1000;
|
||||||
return brightness > 155 ? Color.valueOf("#171717") : Color.valueOf("#fffffd");
|
return brightness > 155 ? Color.valueOf("#171717") : Color.valueOf("#fffffd");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Texture getDummyTexture(){
|
||||||
|
if (dummyTexture == null){
|
||||||
|
Pixmap P = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
|
||||||
|
P.setColor(1f,1f,1f,1f);
|
||||||
|
P.drawPixel(0, 0);
|
||||||
|
dummyTexture = new Texture(P);
|
||||||
|
}
|
||||||
|
return dummyTexture;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
package forge.adventure.character;
|
package forge.adventure.character;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.graphics.Color;
|
||||||
|
import com.badlogic.gdx.graphics.Texture;
|
||||||
|
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||||
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
import com.badlogic.gdx.math.Rectangle;
|
import com.badlogic.gdx.math.Rectangle;
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
import forge.Forge;
|
||||||
|
import forge.adventure.data.EffectData;
|
||||||
import forge.adventure.data.EnemyData;
|
import forge.adventure.data.EnemyData;
|
||||||
import forge.adventure.data.RewardData;
|
import forge.adventure.data.RewardData;
|
||||||
import forge.adventure.util.Current;
|
import forge.adventure.util.Current;
|
||||||
@@ -16,7 +22,10 @@ import forge.adventure.util.Reward;
|
|||||||
*/
|
*/
|
||||||
public class EnemySprite extends CharacterSprite {
|
public class EnemySprite extends CharacterSprite {
|
||||||
EnemyData data;
|
EnemyData data;
|
||||||
public MapDialog dialog;
|
public MapDialog dialog; //Dialog to show on contact. Overrides standard battle (can be started as an action)
|
||||||
|
public MapDialog defeatDialog; //Dialog to show on defeat. Overrides standard death (can be removed as an action)
|
||||||
|
public EffectData effect; //Battle effect for this enemy. Similar to a player's blessing.
|
||||||
|
public String nameOverride = ""; //Override name of this enemy in battles.
|
||||||
|
|
||||||
public EnemySprite(EnemyData enemyData) {
|
public EnemySprite(EnemyData enemyData) {
|
||||||
this(0,enemyData);
|
this(0,enemyData);
|
||||||
@@ -43,7 +52,6 @@ public class EnemySprite extends CharacterSprite {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Array<Reward> getRewards() {
|
public Array<Reward> getRewards() {
|
||||||
Array<Reward> ret=new Array<Reward>();
|
Array<Reward> ret=new Array<Reward>();
|
||||||
if(data.rewards == null)
|
if(data.rewards == null)
|
||||||
@@ -54,5 +62,62 @@ public class EnemySprite extends CharacterSprite {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void drawColorHints(Batch batch){
|
||||||
|
int size = Math.min(data.colors.length(), 6);
|
||||||
|
float DX = getX() - 2f;
|
||||||
|
float DY = getY();
|
||||||
|
|
||||||
|
for(int i = 0; i < size; i++){
|
||||||
|
char C = data.colors.toUpperCase().charAt(i);
|
||||||
|
switch (C) {
|
||||||
|
default: break;
|
||||||
|
case 'C': {
|
||||||
|
batch.setColor(Color.DARK_GRAY);
|
||||||
|
batch.draw(Forge.getGraphics().getDummyTexture(), DX, DY, 2, 2);
|
||||||
|
DY += 2; break;
|
||||||
|
}
|
||||||
|
case 'B': {
|
||||||
|
batch.setColor(Color.PURPLE);
|
||||||
|
batch.draw(Forge.getGraphics().getDummyTexture(), DX, DY, 2, 2);
|
||||||
|
DY += 2; break;
|
||||||
|
}
|
||||||
|
case 'G': {
|
||||||
|
batch.setColor(Color.GREEN);
|
||||||
|
batch.draw(Forge.getGraphics().getDummyTexture(), DX, DY, 2, 2);
|
||||||
|
DY += 2; break;
|
||||||
|
}
|
||||||
|
case 'R': {
|
||||||
|
batch.setColor(Color.RED);
|
||||||
|
batch.draw(Forge.getGraphics().getDummyTexture(), DX, DY, 2, 2);
|
||||||
|
DY += 2; break;
|
||||||
|
}
|
||||||
|
case 'U': {
|
||||||
|
batch.setColor(Color.BLUE);
|
||||||
|
batch.draw(Forge.getGraphics().getDummyTexture(), DX, DY, 2, 2);
|
||||||
|
DY += 2; break;
|
||||||
|
}
|
||||||
|
case 'W': {
|
||||||
|
batch.setColor(Color.WHITE);
|
||||||
|
batch.draw(Forge.getGraphics().getDummyTexture(), DX, DY, 2, 2);
|
||||||
|
DY += 2; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
batch.setColor(Color.WHITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void draw(Batch batch, float parentAlpha) {
|
||||||
|
super.draw(batch, parentAlpha);
|
||||||
|
if(Current.player().hasColorView() && !data.colors.isEmpty()) {
|
||||||
|
drawColorHints(batch);
|
||||||
|
}
|
||||||
|
if(dialog != null && dialog.canShow()){ //Draw a talk icon on top.
|
||||||
|
Texture T = Current.world().getGlobalTexture();
|
||||||
|
TextureRegion TR = new TextureRegion(T, 0, 0, 16, 16);
|
||||||
|
batch.draw(TR, getX(), getY() + 16, 16, 16);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,8 +25,9 @@ public class PlayerSprite extends CharacterSprite {
|
|||||||
PlayerSprite.this.updatePlayer();
|
PlayerSprite.this.updatePlayer();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
playerSpeed=Config.instance().getConfigData().playerBaseSpeed;
|
playerSpeed = Config.instance().getConfigData().playerBaseSpeed;
|
||||||
Current.player().onEquipmentChanged(() -> playerSpeedEquipmentModifier=Current.player().equipmentSpeed());
|
Current.player().onBlessing( () -> playerSpeedEquipmentModifier = Current.player().equipmentSpeed() );
|
||||||
|
Current.player().onEquipmentChanged( () -> playerSpeedEquipmentModifier=Current.player().equipmentSpeed() );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updatePlayer() {
|
private void updatePlayer() {
|
||||||
|
|||||||
@@ -2,9 +2,8 @@ package forge.adventure.character;
|
|||||||
|
|
||||||
import com.badlogic.gdx.math.Rectangle;
|
import com.badlogic.gdx.math.Rectangle;
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.Json;
|
|
||||||
import com.badlogic.gdx.utils.SerializationException;
|
|
||||||
import forge.adventure.data.RewardData;
|
import forge.adventure.data.RewardData;
|
||||||
|
import forge.adventure.util.JSONStringLoader;
|
||||||
import forge.adventure.util.Reward;
|
import forge.adventure.util.Reward;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -26,18 +25,11 @@ public class RewardSprite extends CharacterSprite {
|
|||||||
|
|
||||||
public RewardSprite(String data, String _sprite){
|
public RewardSprite(String data, String _sprite){
|
||||||
super(_sprite);
|
super(_sprite);
|
||||||
Json json = new Json();
|
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
try { rewards = json.fromJson(RewardData[].class, data); }
|
rewards = JSONStringLoader.parse(RewardData[].class, data, default_reward);
|
||||||
catch(SerializationException E){
|
|
||||||
//JSON parsing could fail. Since this an user written part, assume failure is possible (it happens).
|
|
||||||
System.err.printf("[%s] while loading JSON file for reward actor. JSON:\n%s\nUsing a default reward.", E.getMessage(), data);
|
|
||||||
rewards = json.fromJson(RewardData[].class, default_reward);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else { //Shouldn't happen, but make sure it doesn't fly by.
|
} else { //Shouldn't happen, but make sure it doesn't fly by.
|
||||||
System.err.printf("Reward data is null. Using a default reward.");
|
System.err.printf("Reward data is null. Using a default reward.");
|
||||||
rewards = json.fromJson(RewardData[].class, default_reward);
|
rewards = JSONStringLoader.parse(RewardData[].class, default_reward, default_reward);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ package forge.adventure.data;
|
|||||||
* Carries all text, branches and effects of dialogs.
|
* Carries all text, branches and effects of dialogs.
|
||||||
*/
|
*/
|
||||||
public class DialogData {
|
public class DialogData {
|
||||||
public EffectData[] effect; //List of effects to cause when the dialog shows.
|
public ActionData[] effect; //List of effects to cause when the dialog shows.
|
||||||
public ConditionData[] condition; //List of conditions for the action to show.
|
public ConditionData[] condition; //List of conditions for the action to show.
|
||||||
public String name; //Text to display when action is listed as a button.
|
public String name; //Text to display when action is listed as a button.
|
||||||
public String locname; //References a localized string for the button labels.
|
public String locname; //References a localized string for the button labels.
|
||||||
@@ -13,17 +13,41 @@ public class DialogData {
|
|||||||
public String loctext; //References a localized string for the text body.
|
public String loctext; //References a localized string for the text body.
|
||||||
public DialogData[] options; //
|
public DialogData[] options; //
|
||||||
|
|
||||||
static public class EffectData {
|
|
||||||
|
|
||||||
|
static public class ActionData {
|
||||||
|
static public class QuestFlag{
|
||||||
|
public String key;
|
||||||
|
public int val;
|
||||||
|
}
|
||||||
public String removeItem; //Remove item name from inventory.
|
public String removeItem; //Remove item name from inventory.
|
||||||
public String addItem; //Add item name to inventory.
|
public String addItem; //Add item name to inventory.
|
||||||
|
public int addLife = 0; //Gives the player X health. Negative to take.
|
||||||
|
public int addGold = 0; //Gives the player X gold. Negative to take.
|
||||||
public int deleteMapObject = 0; //Remove ID from the map. -1 for self.
|
public int deleteMapObject = 0; //Remove ID from the map. -1 for self.
|
||||||
public int battleWithActorID = 0; //Start a battle with enemy ID. -1 for self if possible.
|
public int battleWithActorID = 0; //Start a battle with enemy ID. -1 for self if possible.
|
||||||
|
public EffectData giveBlessing; //Give a blessing to the player.
|
||||||
|
public String setColorIdentity; //Change player's color identity.
|
||||||
|
public String advanceQuestFlag; //Increase given quest flag by 1.
|
||||||
|
public EffectData setEffect; //Set or replace current effects on current actor.
|
||||||
|
public QuestFlag setQuestFlag; //Set quest flag {flag ID, value}
|
||||||
}
|
}
|
||||||
|
|
||||||
static public class ConditionData {
|
static public class ConditionData {
|
||||||
|
static public class QueryQuestFlag{
|
||||||
|
public String key;
|
||||||
|
public String op;
|
||||||
|
public int val;
|
||||||
|
}
|
||||||
public String item;
|
public String item;
|
||||||
public int flag = 0; //Check for a local dungeon flag.
|
public int flag = 0; //Check for a local dungeon flag.
|
||||||
public int actorID = 0; //Check for an actor ID.
|
public int actorID = 0; //Check for an actor ID.
|
||||||
public boolean not = false; //Reverse the result of a condition ("actorID":"XX" + "not":true => true if XX is not in the map.)
|
public String hasBlessing = null; //Check for specific blessing, if named.
|
||||||
|
public int hasGold = 0; //Check for player gold. True if gold is equal or higher than X.
|
||||||
|
public int hasLife = 0; //Check for player life. True if life is equal or higher than X.
|
||||||
|
public String colorIdentity = null; //Check for player's current color identity.
|
||||||
|
public String checkQuestFlag = null; //Check if a quest flag is not 0. False if equals 0 (not started, not set).
|
||||||
|
public QueryQuestFlag getQuestFlag = null; //Check for value of a flag { <flagID>, <comparison>, <value> }
|
||||||
|
public boolean not = false; //Reverse the result of a condition ("actorID":"XX" + "not":true => true if XX is not in the map.)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,16 @@ import forge.item.PaperCard;
|
|||||||
import forge.item.PaperToken;
|
import forge.item.PaperToken;
|
||||||
import forge.model.FModel;
|
import forge.model.FModel;
|
||||||
|
|
||||||
public class EffectData {
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class EffectData implements Serializable {
|
||||||
|
public String name = null; //Effect name. Can be checked for.
|
||||||
//Duel effects.
|
//Duel effects.
|
||||||
public int lifeModifier = 0; //Amount to add to starting Life.
|
public int lifeModifier = 0; //Amount to add to starting Life.
|
||||||
public int changeStartCards = 0; //Amount to add to starting hand size.
|
public int changeStartCards = 0; //Amount to add to starting hand size.
|
||||||
public String[] startBattleWithCard; //Cards that start in the Battlefield.
|
public String[] startBattleWithCard; //Cards that start in the Battlefield.
|
||||||
//Map only effects.
|
//Map only effects.
|
||||||
|
public boolean colorView = false; //Allows to display enemy colors on the map (TODO)
|
||||||
public float moveSpeed = 1.0f; //Change of movement speed. Map only.
|
public float moveSpeed = 1.0f; //Change of movement speed. Map only.
|
||||||
//Opponent field.
|
//Opponent field.
|
||||||
public EffectData opponent; //Effects to be applied to the opponent's side.
|
public EffectData opponent; //Effects to be applied to the opponent's side.
|
||||||
@@ -45,6 +49,10 @@ public class EffectData {
|
|||||||
|
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
String description = "";
|
String description = "";
|
||||||
|
if(this.name != null && !this.name.isEmpty())
|
||||||
|
description += this.name + "\n";
|
||||||
|
if(this.colorView)
|
||||||
|
description += "Manasight.\n";
|
||||||
if(this.lifeModifier != 0)
|
if(this.lifeModifier != 0)
|
||||||
description += "Life: " + ((this.lifeModifier > 0) ? "+" : "") + this.lifeModifier + "\n";
|
description += "Life: " + ((this.lifeModifier > 0) ? "+" : "") + this.lifeModifier + "\n";
|
||||||
if(this.startBattleWithCard != null && this.startBattleWithCard.length != 0)
|
if(this.startBattleWithCard != null && this.startBattleWithCard.length != 0)
|
||||||
@@ -54,9 +62,9 @@ public class EffectData {
|
|||||||
if(this.changeStartCards != 0)
|
if(this.changeStartCards != 0)
|
||||||
description+="Starting hand: " + this.changeStartCards + "\n";
|
description+="Starting hand: " + this.changeStartCards + "\n";
|
||||||
if(this.opponent != null) {
|
if(this.opponent != null) {
|
||||||
String oppEffect=this.opponent.getDescription();
|
String oppEffect = this.opponent.getDescription();
|
||||||
if(oppEffect != "") {
|
description += "Gives Opponent:\n";
|
||||||
description += "Gives Opponent:\n";
|
if(!oppEffect.isEmpty()) {
|
||||||
description += oppEffect;
|
description += oppEffect;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,29 +19,25 @@ public class EnemyData {
|
|||||||
public int life;
|
public int life;
|
||||||
public RewardData[] rewards;
|
public RewardData[] rewards;
|
||||||
public String[] equipment;
|
public String[] equipment;
|
||||||
|
public String colors = "";
|
||||||
|
|
||||||
public EnemyData()
|
public EnemyData() { }
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
public EnemyData(EnemyData enemyData) {
|
public EnemyData(EnemyData enemyData) {
|
||||||
name =enemyData.name;
|
name = enemyData.name;
|
||||||
sprite =enemyData.sprite;
|
sprite = enemyData.sprite;
|
||||||
deck =enemyData.deck;
|
deck = enemyData.deck;
|
||||||
ai =enemyData.ai;
|
ai = enemyData.ai;
|
||||||
spawnRate =enemyData.spawnRate;
|
spawnRate = enemyData.spawnRate;
|
||||||
difficulty =enemyData.difficulty ;
|
difficulty = enemyData.difficulty;
|
||||||
speed =enemyData.speed;
|
speed = enemyData.speed;
|
||||||
life =enemyData.life;
|
life = enemyData.life;
|
||||||
equipment =enemyData.equipment;
|
equipment = enemyData.equipment;
|
||||||
if(enemyData.rewards==null)
|
colors = enemyData.colors;
|
||||||
{
|
if(enemyData.rewards == null) {
|
||||||
rewards=null;
|
rewards=null;
|
||||||
}
|
} else {
|
||||||
else
|
rewards = new RewardData[enemyData.rewards.length];
|
||||||
{
|
for(int i=0; i<rewards.length; i++)
|
||||||
rewards =new RewardData[enemyData.rewards.length];
|
|
||||||
for(int i=0;i<rewards.length;i++)
|
|
||||||
rewards[i]=new RewardData(enemyData.rewards[i]);
|
rewards[i]=new RewardData(enemyData.rewards[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,9 +51,7 @@ public class WorldData implements Serializable {
|
|||||||
if (allEnemies == null) {
|
if (allEnemies == null) {
|
||||||
Json json = new Json();
|
Json json = new Json();
|
||||||
FileHandle handle = Config.instance().getFile(Paths.ENEMIES);
|
FileHandle handle = Config.instance().getFile(Paths.ENEMIES);
|
||||||
if (handle.exists())
|
if (handle.exists()) {
|
||||||
{
|
|
||||||
|
|
||||||
Array readList = json.fromJson(Array.class, EnemyData.class, handle);
|
Array readList = json.fromJson(Array.class, EnemyData.class, handle);
|
||||||
allEnemies = readList;
|
allEnemies = readList;
|
||||||
}
|
}
|
||||||
@@ -62,8 +60,7 @@ public class WorldData implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static EnemyData getEnemy(String enemy) {
|
public static EnemyData getEnemy(String enemy) {
|
||||||
for(EnemyData data: new Array.ArrayIterator<>(getAllEnemies()))
|
for(EnemyData data: new Array.ArrayIterator<>(getAllEnemies())) {
|
||||||
{
|
|
||||||
if(data.name.equals(enemy))
|
if(data.name.equals(enemy))
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -89,5 +86,4 @@ public class WorldData implements Serializable {
|
|||||||
return biomes;
|
return biomes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3,10 +3,9 @@ package forge.adventure.player;
|
|||||||
import com.badlogic.gdx.files.FileHandle;
|
import com.badlogic.gdx.files.FileHandle;
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
import com.badlogic.gdx.utils.Null;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import forge.adventure.data.DifficultyData;
|
import forge.adventure.data.*;
|
||||||
import forge.adventure.data.HeroListData;
|
|
||||||
import forge.adventure.data.ItemData;
|
|
||||||
import forge.adventure.util.*;
|
import forge.adventure.util.*;
|
||||||
import forge.adventure.world.WorldSave;
|
import forge.adventure.world.WorldSave;
|
||||||
import forge.deck.CardPool;
|
import forge.deck.CardPool;
|
||||||
@@ -17,39 +16,38 @@ import forge.item.PaperCard;
|
|||||||
import forge.util.ItemPool;
|
import forge.util.ItemPool;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class that represents the player (not the player sprite)
|
* Class that represents the player (not the player sprite)
|
||||||
*/
|
*/
|
||||||
public class AdventurePlayer implements Serializable, SaveFileContent {
|
public class AdventurePlayer implements Serializable, SaveFileContent {
|
||||||
|
private enum ColorID { COLORLESS, WHITE, BLACK, BLUE, RED, GREEN }
|
||||||
public static final int NUMBER_OF_DECKS=10;
|
public static final int NUMBER_OF_DECKS=10;
|
||||||
private Deck deck;
|
|
||||||
private int avatarIndex;
|
private Deck deck;
|
||||||
private int heroRace;
|
private int avatarIndex;
|
||||||
private boolean isFemale;
|
private int heroRace;
|
||||||
|
private boolean isFemale;
|
||||||
private float worldPosX;
|
private float worldPosX;
|
||||||
private float worldPosY;
|
private float worldPosY;
|
||||||
private String name;
|
private String name;
|
||||||
|
private ColorID colorIdentity = ColorID.COLORLESS;
|
||||||
private int gold=0;
|
private int gold=0;
|
||||||
private int maxLife=20;
|
private int maxLife=20;
|
||||||
private int life=20;
|
private int life=20;
|
||||||
private int selectedDeckIndex=0;
|
private int selectedDeckIndex=0;
|
||||||
private PlayerStatistic statistic=new PlayerStatistic();
|
private Map<String, Byte> questFlags = new HashMap<>();
|
||||||
private Deck[] decks=new Deck[NUMBER_OF_DECKS];
|
private EffectData blessing; //Blessing to apply for next battle.
|
||||||
|
private PlayerStatistic statistic = new PlayerStatistic();
|
||||||
|
private Deck[] decks=new Deck[NUMBER_OF_DECKS];
|
||||||
private final DifficultyData difficultyData=new DifficultyData();
|
private final DifficultyData difficultyData=new DifficultyData();
|
||||||
|
|
||||||
private final Array<String> inventoryItems=new Array<>();
|
private final Array<String> inventoryItems=new Array<>();
|
||||||
private final HashMap<String,String> equippedItems=new HashMap<>();
|
private final HashMap<String,String> equippedItems=new HashMap<>();
|
||||||
|
|
||||||
public AdventurePlayer()
|
public AdventurePlayer() {
|
||||||
{
|
for(int i=0;i<NUMBER_OF_DECKS;i++) {
|
||||||
|
|
||||||
for(int i=0;i<NUMBER_OF_DECKS;i++)
|
|
||||||
{
|
|
||||||
decks[i]=new Deck("Empty Deck");
|
decks[i]=new Deck("Empty Deck");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63,7 +61,7 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
private final CardPool cards=new CardPool();
|
private final CardPool cards=new CardPool();
|
||||||
private final ItemPool<InventoryItem> newCards=new ItemPool<>(InventoryItem.class);
|
private final ItemPool<InventoryItem> newCards=new ItemPool<>(InventoryItem.class);
|
||||||
|
|
||||||
public void create(String n, Deck startingDeck, boolean male, int race, int avatar,DifficultyData difficultyData) {
|
public void create(String n, int startingColorIdentity, Deck startingDeck, boolean male, int race, int avatar,DifficultyData difficultyData) {
|
||||||
inventoryItems.clear();
|
inventoryItems.clear();
|
||||||
equippedItems.clear();
|
equippedItems.clear();
|
||||||
deck = startingDeck;
|
deck = startingDeck;
|
||||||
@@ -83,12 +81,14 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
heroRace = race;
|
heroRace = race;
|
||||||
isFemale = !male;
|
isFemale = !male;
|
||||||
name = n;
|
name = n;
|
||||||
|
setColorIdentity(startingColorIdentity + 1); //+1 because index 0 is colorless.
|
||||||
statistic.clear();
|
statistic.clear();
|
||||||
newCards.clear();
|
newCards.clear();
|
||||||
onGoldChangeList.emit();
|
onGoldChangeList.emit();
|
||||||
onLifeTotalChangeList.emit();
|
onLifeTotalChangeList.emit();
|
||||||
|
blessing = null;
|
||||||
inventoryItems.addAll(difficultyData.startItems);
|
inventoryItems.addAll(difficultyData.startItems);
|
||||||
|
questFlags.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSelectedDeckSlot(int slot) {
|
public void setSelectedDeckSlot(int slot) {
|
||||||
@@ -135,12 +135,41 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
this.worldPosY = worldPosY;
|
this.worldPosY = worldPosY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setColorIdentity(String C){
|
||||||
|
switch (C.toUpperCase()){
|
||||||
|
case "B": this.colorIdentity = ColorID.BLACK; break;
|
||||||
|
case "G": this.colorIdentity = ColorID.GREEN; break;
|
||||||
|
case "R": this.colorIdentity = ColorID.RED; break;
|
||||||
|
case "U": this.colorIdentity = ColorID.BLUE; break;
|
||||||
|
case "W": this.colorIdentity = ColorID.WHITE; break;
|
||||||
|
case "C": default: this.colorIdentity = ColorID.COLORLESS; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColorIdentity(int C){
|
||||||
|
switch (C){
|
||||||
|
case 2: this.colorIdentity = ColorID.BLACK; break;
|
||||||
|
case 5: this.colorIdentity = ColorID.GREEN; break;
|
||||||
|
case 4: this.colorIdentity = ColorID.RED; break;
|
||||||
|
case 3: this.colorIdentity = ColorID.BLUE; break;
|
||||||
|
case 1: this.colorIdentity = ColorID.WHITE; break;
|
||||||
|
case 0: default: this.colorIdentity = ColorID.COLORLESS; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getColorIdentity(){
|
||||||
|
switch (colorIdentity){
|
||||||
|
case BLUE : return "U";
|
||||||
|
case GREEN : return "G";
|
||||||
|
case RED : return "R";
|
||||||
|
case BLACK : return "B";
|
||||||
|
case WHITE : return "W";
|
||||||
|
case COLORLESS: default: return "C"; //You are either Ugin or an Eldrazi. Nice.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(SaveFileData data) {
|
public void load(SaveFileData data) {
|
||||||
|
|
||||||
|
|
||||||
this.statistic.load(data.readSubData("statistic"));
|
this.statistic.load(data.readSubData("statistic"));
|
||||||
this.difficultyData.startingLife=data.readInt("startingLife");
|
this.difficultyData.startingLife=data.readInt("startingLife");
|
||||||
this.difficultyData.staringMoney=data.readInt("staringMoney");
|
this.difficultyData.staringMoney=data.readInt("staringMoney");
|
||||||
@@ -151,7 +180,6 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
if(this.difficultyData.sellFactor==0)
|
if(this.difficultyData.sellFactor==0)
|
||||||
this.difficultyData.sellFactor=0.2f;
|
this.difficultyData.sellFactor=0.2f;
|
||||||
|
|
||||||
|
|
||||||
name = data.readString("name");
|
name = data.readString("name");
|
||||||
worldPosX = data.readFloat("worldPosX");
|
worldPosX = data.readFloat("worldPosX");
|
||||||
worldPosY = data.readFloat("worldPosY");
|
worldPosY = data.readFloat("worldPosY");
|
||||||
@@ -159,25 +187,26 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
avatarIndex = data.readInt("avatarIndex");
|
avatarIndex = data.readInt("avatarIndex");
|
||||||
heroRace = data.readInt("heroRace");
|
heroRace = data.readInt("heroRace");
|
||||||
isFemale = data.readBool("isFemale");
|
isFemale = data.readBool("isFemale");
|
||||||
|
colorIdentity = ColorID.COLORLESS;
|
||||||
|
if(data.containsKey("colorIdentity"))
|
||||||
|
setColorIdentity(data.readString("colorIdentity"));
|
||||||
gold = data.readInt("gold");
|
gold = data.readInt("gold");
|
||||||
life = data.readInt("life");
|
life = data.readInt("life");
|
||||||
maxLife = data.readInt("maxLife");
|
maxLife = data.readInt("maxLife");
|
||||||
|
blessing = null;
|
||||||
|
if(data.containsKey("blessing")) blessing = (EffectData)data.readObject("blessing");
|
||||||
inventoryItems.clear();
|
inventoryItems.clear();
|
||||||
equippedItems.clear();
|
equippedItems.clear();
|
||||||
if(data.containsKey("inventory"))
|
if(data.containsKey("inventory")) {
|
||||||
{
|
|
||||||
String[] inv=(String[])data.readObject("inventory");
|
String[] inv=(String[])data.readObject("inventory");
|
||||||
inventoryItems.addAll(inv);
|
inventoryItems.addAll(inv);
|
||||||
}
|
}
|
||||||
if(data.containsKey("equippedSlots")&&data.containsKey("equippedItems"))
|
if(data.containsKey("equippedSlots") && data.containsKey("equippedItems")) {
|
||||||
{
|
|
||||||
String[] slots=(String[])data.readObject("equippedSlots");
|
String[] slots=(String[])data.readObject("equippedSlots");
|
||||||
String[] items=(String[])data.readObject("equippedItems");
|
String[] items=(String[])data.readObject("equippedItems");
|
||||||
|
|
||||||
assert(slots.length==items.length);
|
assert(slots.length==items.length);
|
||||||
for(int i=0;i<slots.length;i++)
|
for(int i=0;i<slots.length;i++) {
|
||||||
{
|
|
||||||
equippedItems.put(slots[i],items[i]);
|
equippedItems.put(slots[i],items[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -186,10 +215,18 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
if(data.containsKey("sideBoardCards"))
|
if(data.containsKey("sideBoardCards"))
|
||||||
deck.getOrCreate(DeckSection.Sideboard).addAll(CardPool.fromCardList(Lists.newArrayList((String[])data.readObject("sideBoardCards"))));
|
deck.getOrCreate(DeckSection.Sideboard).addAll(CardPool.fromCardList(Lists.newArrayList((String[])data.readObject("sideBoardCards"))));
|
||||||
|
|
||||||
for(int i=0;i<NUMBER_OF_DECKS;i++)
|
questFlags.clear();
|
||||||
{
|
if(data.containsKey("questFlagsKey") && data.containsKey("questFlagsValue")){
|
||||||
if(!data.containsKey("deck_name_"+i))
|
String[] keys = (String[]) data.readObject("questFlagsKey");
|
||||||
{
|
Byte[] values = (Byte[]) data.readObject("questFlagsValue");
|
||||||
|
assert( keys.length == values.length );
|
||||||
|
for( int i = 0; i < keys.length; i++){
|
||||||
|
questFlags.put(keys[i], values[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i=0;i<NUMBER_OF_DECKS;i++) {
|
||||||
|
if(!data.containsKey("deck_name_"+i)) {
|
||||||
if(i==0)
|
if(i==0)
|
||||||
decks[i]=deck;
|
decks[i]=deck;
|
||||||
else
|
else
|
||||||
@@ -231,13 +268,14 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
data.store("avatarIndex",avatarIndex);
|
data.store("avatarIndex",avatarIndex);
|
||||||
data.store("heroRace",heroRace);
|
data.store("heroRace",heroRace);
|
||||||
data.store("isFemale",isFemale);
|
data.store("isFemale",isFemale);
|
||||||
|
data.store("colorIdentity", getColorIdentity());
|
||||||
data.store("gold",gold);
|
data.store("gold",gold);
|
||||||
data.store("life",life);
|
data.store("life",life);
|
||||||
data.store("maxLife",maxLife);
|
data.store("maxLife",maxLife);
|
||||||
data.store("deckName",deck.getName());
|
data.store("deckName",deck.getName());
|
||||||
|
|
||||||
data.storeObject("inventory",inventoryItems.toArray(String.class));
|
data.storeObject("inventory",inventoryItems.toArray(String.class));
|
||||||
|
data.storeObject("blessing", blessing);
|
||||||
|
|
||||||
ArrayList<String> slots=new ArrayList<>();
|
ArrayList<String> slots=new ArrayList<>();
|
||||||
ArrayList<String> items=new ArrayList<>();
|
ArrayList<String> items=new ArrayList<>();
|
||||||
@@ -248,6 +286,15 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
data.storeObject("equippedSlots",slots.toArray(new String[0]));
|
data.storeObject("equippedSlots",slots.toArray(new String[0]));
|
||||||
data.storeObject("equippedItems",items.toArray(new String[0]));
|
data.storeObject("equippedItems",items.toArray(new String[0]));
|
||||||
|
|
||||||
|
//Save quest flags.
|
||||||
|
ArrayList<String> questFlagsKey = new ArrayList<>();
|
||||||
|
ArrayList<Byte> questFlagsValue = new ArrayList<>();
|
||||||
|
for(Map.Entry<String, Byte> entry : questFlags.entrySet()){
|
||||||
|
questFlagsKey.add(entry.getKey());
|
||||||
|
questFlagsValue.add(entry.getValue());
|
||||||
|
}
|
||||||
|
data.storeObject("questFlagsKey", questFlagsKey.toArray(new String[0]));
|
||||||
|
data.storeObject("questFlagsValue", questFlagsValue.toArray(new Byte[0]));
|
||||||
|
|
||||||
data.storeObject("deckCards",deck.getMain().toCardList("\n").split("\n"));
|
data.storeObject("deckCards",deck.getMain().toCardList("\n").split("\n"));
|
||||||
if(deck.get(DeckSection.Sideboard)!=null)
|
if(deck.get(DeckSection.Sideboard)!=null)
|
||||||
@@ -266,8 +313,6 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String spriteName() {
|
public String spriteName() {
|
||||||
return HeroListData.getHero(heroRace, isFemale);
|
return HeroListData.getHero(heroRace, isFemale);
|
||||||
}
|
}
|
||||||
@@ -281,15 +326,12 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addCard(PaperCard card) {
|
public void addCard(PaperCard card) {
|
||||||
|
|
||||||
cards.add(card);
|
cards.add(card);
|
||||||
newCards.add(card);
|
newCards.add(card);
|
||||||
|
|
||||||
}
|
}
|
||||||
public void addReward(Reward reward) {
|
|
||||||
|
|
||||||
switch (reward.getType())
|
public void addReward(Reward reward) {
|
||||||
{
|
switch (reward.getType()) {
|
||||||
case Card:
|
case Card:
|
||||||
cards.add(reward.getCard());
|
cards.add(reward.getCard());
|
||||||
newCards.add(reward.getCard());
|
newCards.add(reward.getCard());
|
||||||
@@ -304,13 +346,13 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
addMaxLife(reward.getCount());
|
addMaxLife(reward.getCount());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SignalList onLifeTotalChangeList=new SignalList();
|
SignalList onLifeTotalChangeList=new SignalList();
|
||||||
SignalList onGoldChangeList=new SignalList();
|
SignalList onGoldChangeList=new SignalList();
|
||||||
SignalList onPlayerChangeList=new SignalList();
|
SignalList onPlayerChangeList=new SignalList();
|
||||||
SignalList onEquipmentChange=new SignalList();
|
SignalList onEquipmentChange=new SignalList();
|
||||||
|
SignalList onBlessing=new SignalList();
|
||||||
|
|
||||||
private void addGold(int goldCount) {
|
private void addGold(int goldCount) {
|
||||||
gold+=goldCount;
|
gold+=goldCount;
|
||||||
@@ -340,6 +382,11 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
o.run();
|
o.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onBlessing(Runnable o) {
|
||||||
|
onBlessing.add(o);
|
||||||
|
o.run();
|
||||||
|
}
|
||||||
|
|
||||||
public int getLife() {
|
public int getLife() {
|
||||||
return life;
|
return life;
|
||||||
}
|
}
|
||||||
@@ -348,8 +395,13 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
return maxLife;
|
return maxLife;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void heal() {
|
public void heal(int amount) {
|
||||||
life=maxLife;
|
life = Math.min(life + amount, maxLife);
|
||||||
|
onLifeTotalChangeList.emit();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void fullHeal() {
|
||||||
|
life = maxLife;
|
||||||
onLifeTotalChangeList.emit();
|
onLifeTotalChangeList.emit();
|
||||||
}
|
}
|
||||||
public void defeated() {
|
public void defeated() {
|
||||||
@@ -371,6 +423,37 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
onGoldChangeList.emit();
|
onGoldChangeList.emit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addBlessing(EffectData bless){
|
||||||
|
blessing = bless;
|
||||||
|
onBlessing.emit();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearBlessing() {
|
||||||
|
blessing = null;
|
||||||
|
onBlessing.emit();
|
||||||
|
}
|
||||||
|
|
||||||
|
public @Null EffectData getBlessing(){ return blessing; }
|
||||||
|
|
||||||
|
public boolean hasBlessing(String name){ //Checks for a named blessing.
|
||||||
|
//It is not necessary to name all blessings, only the ones you'd want to check for.
|
||||||
|
if(blessing == null) return false;
|
||||||
|
if(blessing.name.equals(name)) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasColorView() {
|
||||||
|
for(String name:equippedItems.values()) {
|
||||||
|
ItemData data=ItemData.getItem(name);
|
||||||
|
if(data != null && data.effect.colorView) return true;
|
||||||
|
}
|
||||||
|
if(blessing != null) {
|
||||||
|
if(blessing.colorView) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public DifficultyData getDifficulty() {
|
public DifficultyData getDifficulty() {
|
||||||
return difficultyData;
|
return difficultyData;
|
||||||
}
|
}
|
||||||
@@ -429,9 +512,12 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
float factor=1.0f;
|
float factor=1.0f;
|
||||||
for(String name:equippedItems.values()) {
|
for(String name:equippedItems.values()) {
|
||||||
ItemData data=ItemData.getItem(name);
|
ItemData data=ItemData.getItem(name);
|
||||||
if(data.effect.moveSpeed > 0.0) { //Avoid negative speeds. It would be silly.
|
if(data != null && data.effect.moveSpeed > 0.0) //Avoid negative speeds. It would be silly.
|
||||||
factor*=data.effect.moveSpeed;
|
factor*=data.effect.moveSpeed;
|
||||||
}
|
}
|
||||||
|
if(blessing != null) { //If a blessing gives speed, take it into account.
|
||||||
|
if(blessing.moveSpeed > 0.0)
|
||||||
|
factor *= blessing.moveSpeed;
|
||||||
}
|
}
|
||||||
return factor;
|
return factor;
|
||||||
}
|
}
|
||||||
@@ -447,4 +533,24 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
inventoryItems.add(name);
|
inventoryItems.add(name);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setQuestFlag(String key, int value){
|
||||||
|
questFlags.put(key, (byte) value);
|
||||||
|
}
|
||||||
|
public void advanceQuestFlag(String key){
|
||||||
|
if(questFlags.get(key) != null){
|
||||||
|
questFlags.put(key, (byte) (questFlags.get(key) + 1));
|
||||||
|
} else {
|
||||||
|
questFlags.put(key, (byte) 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public boolean checkQuestFlag(String key){
|
||||||
|
return questFlags.get(key) != null;
|
||||||
|
}
|
||||||
|
public int getQuestFlag(String key){
|
||||||
|
return (int) questFlags.getOrDefault(key, (byte) 0);
|
||||||
|
}
|
||||||
|
public void resetQuestFlags(){
|
||||||
|
questFlags.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,8 @@ public class DuelScene extends ForgeScene {
|
|||||||
|
|
||||||
public void GameEnd() {
|
public void GameEnd() {
|
||||||
boolean winner=humanPlayer == hostedMatch.getGame().getMatch().getWinner();
|
boolean winner=humanPlayer == hostedMatch.getGame().getMatch().getWinner();
|
||||||
String enemyName=enemy.getData().name;
|
String enemyName=(enemy.nameOverride.isEmpty() ? enemy.getData().name : enemy.nameOverride);
|
||||||
|
Current.player().clearBlessing();
|
||||||
Gdx.app.postRunnable(new Runnable() {
|
Gdx.app.postRunnable(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -97,6 +98,7 @@ public class DuelScene extends ForgeScene {
|
|||||||
public void enter() {
|
public void enter() {
|
||||||
Set<GameType> appliedVariants = new HashSet<>();
|
Set<GameType> appliedVariants = new HashSet<>();
|
||||||
appliedVariants.add(GameType.Constructed);
|
appliedVariants.add(GameType.Constructed);
|
||||||
|
AdventurePlayer advPlayer = Current.player();
|
||||||
|
|
||||||
List<RegisteredPlayer> players = new ArrayList<>();
|
List<RegisteredPlayer> players = new ArrayList<>();
|
||||||
Deck playerDeck=(Deck)AdventurePlayer.current().getSelectedDeck().copyTo("PlayerDeckCopy");
|
Deck playerDeck=(Deck)AdventurePlayer.current().getSelectedDeck().copyTo("PlayerDeckCopy");
|
||||||
@@ -105,27 +107,25 @@ public class DuelScene extends ForgeScene {
|
|||||||
playerDeck.getMain().add("Wastes",missingCards);
|
playerDeck.getMain().add("Wastes",missingCards);
|
||||||
humanPlayer = RegisteredPlayer.forVariants(2, appliedVariants,playerDeck, null, false, null, null);
|
humanPlayer = RegisteredPlayer.forVariants(2, appliedVariants,playerDeck, null, false, null, null);
|
||||||
LobbyPlayer playerObject = GamePlayerUtil.getGuiPlayer();
|
LobbyPlayer playerObject = GamePlayerUtil.getGuiPlayer();
|
||||||
FSkin.getAvatars().put(90001, Current.player().avatar());
|
FSkin.getAvatars().put(90001, advPlayer.avatar());
|
||||||
playerObject.setAvatarIndex(90001);
|
playerObject.setAvatarIndex(90001);
|
||||||
humanPlayer.setPlayer(playerObject);
|
humanPlayer.setPlayer(playerObject);
|
||||||
humanPlayer.setStartingLife(Current.player().getLife());
|
humanPlayer.setStartingLife(advPlayer.getLife());
|
||||||
Current.setLatestDeck(enemy.getData().generateDeck());
|
Current.setLatestDeck(enemy.getData().generateDeck());
|
||||||
RegisteredPlayer aiPlayer = RegisteredPlayer.forVariants(2, appliedVariants, Current.latestDeck(), null, false, null, null);
|
RegisteredPlayer aiPlayer = RegisteredPlayer.forVariants(2, appliedVariants, Current.latestDeck(), null, false, null, null);
|
||||||
LobbyPlayer enemyPlayer = GamePlayerUtil.createAiPlayer(this.enemy.getData().name, selectAI(this.enemy.getData().ai));
|
LobbyPlayer enemyPlayer = GamePlayerUtil.createAiPlayer(this.enemy.getData().name, selectAI(this.enemy.getData().ai));
|
||||||
|
if(!enemy.nameOverride.isEmpty()) enemyPlayer.setName(enemy.nameOverride); //Override name if defined in the map.
|
||||||
FSkin.getAvatars().put(90000, this.enemy.getAvatar());
|
FSkin.getAvatars().put(90000, this.enemy.getAvatar());
|
||||||
enemyPlayer.setAvatarIndex(90000);
|
enemyPlayer.setAvatarIndex(90000);
|
||||||
|
|
||||||
aiPlayer.setPlayer(enemyPlayer);
|
aiPlayer.setPlayer(enemyPlayer);
|
||||||
aiPlayer.setStartingLife(Math.round((float)enemy.getData().life*Current.player().getDifficulty().enemyLifeFactor));
|
aiPlayer.setStartingLife(Math.round((float)enemy.getData().life*advPlayer.getDifficulty().enemyLifeFactor));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Array<EffectData> playerEffects = new Array<>();
|
Array<EffectData> playerEffects = new Array<>();
|
||||||
Array<EffectData> oppEffects = new Array<>();
|
Array<EffectData> oppEffects = new Array<>();
|
||||||
|
|
||||||
//Collect and add items effects first.
|
//Collect and add items effects first.
|
||||||
for(String playerItem:Current.player().getEquippedItems()) {
|
for(String playerItem:advPlayer.getEquippedItems()) {
|
||||||
ItemData item=ItemData.getItem(playerItem);
|
ItemData item=ItemData.getItem(playerItem);
|
||||||
playerEffects.add(item.effect);
|
playerEffects.add(item.effect);
|
||||||
if(item.effect.opponent != null) oppEffects.add(item.effect.opponent);
|
if(item.effect.opponent != null) oppEffects.add(item.effect.opponent);
|
||||||
@@ -139,13 +139,22 @@ public class DuelScene extends ForgeScene {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Collect and add player blessings.
|
//Collect and add player blessings.
|
||||||
|
if(advPlayer.getBlessing() != null){
|
||||||
|
playerEffects.add(advPlayer.getBlessing());
|
||||||
|
if(advPlayer.getBlessing().opponent != null) oppEffects.add(advPlayer.getBlessing().opponent);
|
||||||
|
}
|
||||||
|
|
||||||
//Collect and add enemy effects (same as blessings but for individual enemies).
|
//Collect and add enemy effects (same as blessings but for individual enemies).
|
||||||
|
if(enemy.effect != null){
|
||||||
|
oppEffects.add(enemy.effect);
|
||||||
|
if(enemy.effect.opponent != null)
|
||||||
|
playerEffects.add(enemy.effect.opponent);
|
||||||
|
}
|
||||||
|
|
||||||
//Collect and add dungeon-wide effects.
|
//Collect and add dungeon-wide effects.
|
||||||
if(dungeonEffect != null) {
|
if(dungeonEffect != null) {
|
||||||
oppEffects.add(dungeonEffect);
|
oppEffects.add(dungeonEffect);
|
||||||
if (dungeonEffect.opponent != null)
|
if(dungeonEffect.opponent != null)
|
||||||
playerEffects.add(dungeonEffect.opponent);
|
playerEffects.add(dungeonEffect.opponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class InnScene extends UIScene {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void heal() {
|
public void heal() {
|
||||||
Current.player().heal();
|
Current.player().fullHeal();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -63,91 +63,92 @@ public class InventoryScene extends UIScene {
|
|||||||
@Override
|
@Override
|
||||||
public void resLoaded() {
|
public void resLoaded() {
|
||||||
super.resLoaded();
|
super.resLoaded();
|
||||||
equipOverlay = new Texture(Config.instance().getFile(Paths.ITEMS_EQUIP));
|
equipOverlay = new Texture(Config.instance().getFile(Paths.ITEMS_EQUIP));
|
||||||
ui.onButtonPress("return", () -> done());
|
ui.onButtonPress("return", () -> done());
|
||||||
leave = ui.findActor("return");
|
leave = ui.findActor("return");
|
||||||
ui.onButtonPress("delete", () -> confirm.show(stage));
|
ui.onButtonPress("delete", () -> confirm.show(stage));
|
||||||
ui.onButtonPress("equip", () -> equip());
|
ui.onButtonPress("equip", () -> equip());
|
||||||
equipButton = ui.findActor("equip");
|
equipButton = ui.findActor("equip");
|
||||||
deleteButton = ui.findActor("delete");
|
deleteButton = ui.findActor("delete");
|
||||||
itemDescription = ui.findActor("item_description");
|
itemDescription = ui.findActor("item_description");
|
||||||
leave.getLabel().setText(Forge.getLocalizer().getMessage("lblBack"));
|
itemDescription.setAlignment(Align.topLeft);
|
||||||
|
leave.getLabel().setText(Forge.getLocalizer().getMessage("lblBack"));
|
||||||
|
|
||||||
inventoryButtons=new Array<>();
|
inventoryButtons=new Array<>();
|
||||||
equipmentSlots=new HashMap<>();
|
equipmentSlots=new HashMap<>();
|
||||||
|
|
||||||
Array<Actor> children = ui.getChildren();
|
Array<Actor> children = ui.getChildren();
|
||||||
for (int i = 0, n = children.size; i < n; i++)
|
for (int i = 0, n = children.size; i < n; i++)
|
||||||
|
{
|
||||||
|
|
||||||
|
if(children.get(i).getName()!=null&&children.get(i).getName().startsWith("Equipment"))
|
||||||
{
|
{
|
||||||
|
String slotName=children.get(i).getName().split("_")[1];
|
||||||
if(children.get(i).getName()!=null&&children.get(i).getName().startsWith("Equipment"))
|
equipmentSlots.put(slotName, (Button) children.get(i));
|
||||||
{
|
Actor slot=children.get(i);
|
||||||
String slotName=children.get(i).getName().split("_")[1];
|
slot.addListener(new ChangeListener() {
|
||||||
equipmentSlots.put(slotName, (Button) children.get(i));
|
@Override
|
||||||
Actor slot=children.get(i);
|
public void changed(ChangeEvent event, Actor actor) {
|
||||||
slot.addListener(new ChangeListener() {
|
Button button=((Button) actor);
|
||||||
@Override
|
if(button.isChecked())
|
||||||
public void changed(ChangeEvent event, Actor actor) {
|
{
|
||||||
Button button=((Button) actor);
|
for(Button otherButton:equipmentSlots.values())
|
||||||
if(button.isChecked())
|
|
||||||
{
|
{
|
||||||
for(Button otherButton:equipmentSlots.values())
|
if(button!=otherButton&&otherButton.isChecked()){
|
||||||
{
|
otherButton.setChecked(false);
|
||||||
if(button!=otherButton&&otherButton.isChecked()){
|
|
||||||
otherButton.setChecked(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String item=Current.player().itemInSlot(slotName);
|
|
||||||
if(item!=null&&item!="")
|
|
||||||
{
|
|
||||||
Button changeButton=null;
|
|
||||||
for(Button invButton:inventoryButtons)
|
|
||||||
{
|
|
||||||
if(itemLocation.get(invButton)!=null&&itemLocation.get(invButton).equals(item))
|
|
||||||
{
|
|
||||||
changeButton=invButton;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(changeButton!=null)
|
|
||||||
changeButton.setChecked(true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
setSelected(null);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
String item=Current.player().itemInSlot(slotName);
|
||||||
|
if(item!=null&&item!="")
|
||||||
|
{
|
||||||
|
Button changeButton=null;
|
||||||
|
for(Button invButton:inventoryButtons)
|
||||||
|
{
|
||||||
|
if(itemLocation.get(invButton)!=null&&itemLocation.get(invButton).equals(item))
|
||||||
|
{
|
||||||
|
changeButton=invButton;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(changeButton!=null)
|
||||||
|
changeButton.setChecked(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setSelected(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
inventory = new Table(Controls.GetSkin());
|
}
|
||||||
ScrollPane scrollPane = ui.findActor("inventory");
|
inventory = new Table(Controls.GetSkin());
|
||||||
scrollPane.setScrollingDisabled(true,false);
|
ScrollPane scrollPane = ui.findActor("inventory");
|
||||||
scrollPane.setActor(inventory);
|
scrollPane.setScrollingDisabled(true,false);
|
||||||
columns= (int) (scrollPane.getWidth()/createInventorySlot().getWidth());
|
scrollPane.setActor(inventory);
|
||||||
columns-=1;
|
columns= (int) (scrollPane.getWidth()/createInventorySlot().getWidth());
|
||||||
if(columns<=0)columns=1;
|
columns-=1;
|
||||||
scrollPane.setActor(inventory);
|
if(columns<=0)columns=1;
|
||||||
confirm = new Dialog("\n "+Forge.getLocalizer().getMessage("lblDelete"), Controls.GetSkin())
|
scrollPane.setActor(inventory);
|
||||||
|
confirm = new Dialog("\n "+Forge.getLocalizer().getMessage("lblDelete"), Controls.GetSkin())
|
||||||
|
{
|
||||||
|
protected void result(Object object)
|
||||||
{
|
{
|
||||||
protected void result(Object object)
|
if(object!=null&&object.equals(true))
|
||||||
{
|
delete();
|
||||||
if(object!=null&&object.equals(true))
|
confirm.hide();
|
||||||
delete();
|
|
||||||
confirm.hide();
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
confirm.button(Forge.getLocalizer().getMessage("lblYes"), true);
|
confirm.button(Forge.getLocalizer().getMessage("lblYes"), true);
|
||||||
confirm.button(Forge.getLocalizer().getMessage("lblNo"), false);
|
confirm.button(Forge.getLocalizer().getMessage("lblNo"), false);
|
||||||
ui.addActor(confirm);
|
ui.addActor(confirm);
|
||||||
confirm.hide();
|
confirm.hide();
|
||||||
|
|
||||||
itemDescription.setWrap(true);
|
itemDescription.setWrap(true);
|
||||||
//makes confirm dialog hidden immediately when you open inventory first time..
|
//makes confirm dialog hidden immediately when you open inventory first time..
|
||||||
confirm.getColor().a = 0;
|
confirm.getColor().a = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setSelected(Button actor) {
|
private void setSelected(Button actor) {
|
||||||
@@ -198,17 +199,15 @@ public class InventoryScene extends UIScene {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateInventory()
|
private void updateInventory() {
|
||||||
{
|
|
||||||
inventoryButtons.clear();
|
inventoryButtons.clear();
|
||||||
inventory.clear();
|
inventory.clear();
|
||||||
for(int i=0;i<Current.player().getItems().size;i++)
|
for(int i=0;i<Current.player().getItems().size;i++) {
|
||||||
{
|
|
||||||
|
|
||||||
if(i%columns==0)
|
if(i%columns==0)
|
||||||
inventory.row();
|
inventory.row();
|
||||||
Button newActor=createInventorySlot();
|
Button newActor=createInventorySlot();
|
||||||
inventory.add(newActor).align(Align.left|Align.top).space(1);
|
inventory.add(newActor).top().left().space(1);
|
||||||
inventoryButtons.add(newActor);
|
inventoryButtons.add(newActor);
|
||||||
ItemData item=ItemData.getItem(Current.player().getItems().get(i));
|
ItemData item=ItemData.getItem(Current.player().getItems().get(i));
|
||||||
if(item==null)
|
if(item==null)
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package forge.adventure.scene;
|
package forge.adventure.scene;
|
||||||
|
|
||||||
import com.badlogic.gdx.Input;
|
import com.badlogic.gdx.Input;
|
||||||
|
import com.badlogic.gdx.graphics.Color;
|
||||||
|
import com.badlogic.gdx.graphics.Texture;
|
||||||
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Image;
|
import com.badlogic.gdx.scenes.scene2d.ui.Image;
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Label;
|
import com.badlogic.gdx.scenes.scene2d.ui.Label;
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane;
|
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane;
|
||||||
@@ -14,6 +17,7 @@ import forge.adventure.data.EnemyData;
|
|||||||
import forge.adventure.data.WorldData;
|
import forge.adventure.data.WorldData;
|
||||||
import forge.adventure.player.AdventurePlayer;
|
import forge.adventure.player.AdventurePlayer;
|
||||||
import forge.adventure.stage.GameHUD;
|
import forge.adventure.stage.GameHUD;
|
||||||
|
import forge.adventure.util.Config;
|
||||||
import forge.adventure.util.Controls;
|
import forge.adventure.util.Controls;
|
||||||
import forge.adventure.util.Current;
|
import forge.adventure.util.Current;
|
||||||
import forge.adventure.world.WorldSave;
|
import forge.adventure.world.WorldSave;
|
||||||
@@ -24,13 +28,16 @@ import java.util.Map;
|
|||||||
|
|
||||||
public class PlayerStatisticScene extends UIScene {
|
public class PlayerStatisticScene extends UIScene {
|
||||||
Image avatar, avatarBorder, lifeIcon, goldIcon;
|
Image avatar, avatarBorder, lifeIcon, goldIcon;
|
||||||
|
Image colorFrame;
|
||||||
Label money, life;
|
Label money, life;
|
||||||
Label wins, totalWins;
|
Label wins, totalWins;
|
||||||
Label loss, totalLoss;
|
Label loss, totalLoss;
|
||||||
Label winloss, lossWinRatio;
|
Label winloss, lossWinRatio;
|
||||||
Label playerName;
|
Label playerName;
|
||||||
TextButton back;
|
TextButton back;
|
||||||
|
Texture colorFrames;
|
||||||
private Table enemiesGroup;
|
private Table enemiesGroup;
|
||||||
|
Label blessingScroll;
|
||||||
|
|
||||||
public PlayerStatisticScene() {
|
public PlayerStatisticScene() {
|
||||||
super(Forge.isLandscapeMode() ? "ui/statistic.json" : "ui/statistic_portrait.json");
|
super(Forge.isLandscapeMode() ? "ui/statistic.json" : "ui/statistic_portrait.json");
|
||||||
@@ -39,6 +46,7 @@ public class PlayerStatisticScene extends UIScene {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
|
colorFrames.dispose(); //Get rid of the cached color ID texture.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -55,6 +63,20 @@ public class PlayerStatisticScene extends UIScene {
|
|||||||
Forge.switchToLast();
|
Forge.switchToLast();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
private TextureRegion getColorFrame(String C){
|
||||||
|
int x, y;
|
||||||
|
switch(C){
|
||||||
|
case "B": { x = 0 ; y = 0 ; break; }
|
||||||
|
case "G": { x = 64; y = 0 ; break; }
|
||||||
|
case "R": { x = 0 ; y = 32; break; }
|
||||||
|
case "U": { x = 32; y = 32; break; }
|
||||||
|
case "W": { x = 64; y = 32; break; }
|
||||||
|
default:
|
||||||
|
case "C": { x = 32; y = 0 ; break; }
|
||||||
|
}
|
||||||
|
TextureRegion result = new TextureRegion(colorFrames, x, y, 32, 32);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enter() {
|
public void enter() {
|
||||||
@@ -99,6 +121,16 @@ public class PlayerStatisticScene extends UIScene {
|
|||||||
if (lossWinRatio != null) {
|
if (lossWinRatio != null) {
|
||||||
lossWinRatio.setText(Float.toString(Current.player().getStatistic().winLossRatio()));
|
lossWinRatio.setText(Float.toString(Current.player().getStatistic().winLossRatio()));
|
||||||
}
|
}
|
||||||
|
if(colorFrame != null){
|
||||||
|
colorFrame.setDrawable(new TextureRegionDrawable(getColorFrame(Current.player().getColorIdentity())));
|
||||||
|
}
|
||||||
|
if(blessingScroll != null){
|
||||||
|
if(Current.player().getBlessing() != null) {
|
||||||
|
blessingScroll.setText(Current.player().getBlessing().getDescription());
|
||||||
|
} else {
|
||||||
|
blessingScroll.setText("No blessing.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (Map.Entry<String, Pair<Integer, Integer>> entry : Current.player().getStatistic().getWinLossRecord().entrySet()) {
|
for (Map.Entry<String, Pair<Integer, Integer>> entry : Current.player().getStatistic().getWinLossRecord().entrySet()) {
|
||||||
EnemyData data = WorldData.getEnemy(entry.getKey());
|
EnemyData data = WorldData.getEnemy(entry.getKey());
|
||||||
@@ -121,38 +153,47 @@ public class PlayerStatisticScene extends UIScene {
|
|||||||
@Override
|
@Override
|
||||||
public void resLoaded() {
|
public void resLoaded() {
|
||||||
super.resLoaded();
|
super.resLoaded();
|
||||||
enemiesGroup = new Table(Controls.GetSkin());
|
enemiesGroup = new Table(Controls.GetSkin());
|
||||||
enemiesGroup.row();
|
enemiesGroup.row();
|
||||||
ui.onButtonPress("return", new Runnable() {
|
blessingScroll = Controls.newLabel("");
|
||||||
@Override
|
blessingScroll.setStyle(new Label.LabelStyle(Controls.getBitmapFont("default"), Color.BLACK));
|
||||||
public void run() {
|
blessingScroll.setAlignment(Align.topLeft);
|
||||||
PlayerStatisticScene.this.back();
|
blessingScroll.setWrap(true);
|
||||||
}
|
ui.onButtonPress("return", new Runnable() {
|
||||||
});
|
@Override
|
||||||
avatar = ui.findActor("avatar");
|
public void run() {
|
||||||
avatarBorder = ui.findActor("avatarBorder");
|
PlayerStatisticScene.this.back();
|
||||||
playerName = ui.findActor("playerName");
|
}
|
||||||
life = ui.findActor("lifePoints");
|
});
|
||||||
money = ui.findActor("money");
|
|
||||||
lifeIcon = ui.findActor("lifeIcon");
|
avatar = ui.findActor("avatar");
|
||||||
goldIcon = ui.findActor("goldIcon");
|
avatarBorder = ui.findActor("avatarBorder");
|
||||||
wins = ui.findActor("wins");
|
playerName = ui.findActor("playerName");
|
||||||
wins.setText(Forge.getLocalizer().getMessage("lblWinProper")+":");
|
life = ui.findActor("lifePoints");
|
||||||
totalWins = ui.findActor("totalWins");
|
money = ui.findActor("money");
|
||||||
loss = ui.findActor("loss");
|
lifeIcon = ui.findActor("lifeIcon");
|
||||||
loss.setText(Forge.getLocalizer().getMessage("lblLossProper")+":");
|
goldIcon = ui.findActor("goldIcon");
|
||||||
totalLoss = ui.findActor("totalLoss");
|
wins = ui.findActor("wins");
|
||||||
winloss = ui.findActor("winloss");
|
colorFrame = ui.findActor("colorFrame");
|
||||||
winloss.setText(Forge.getLocalizer().getMessage("lblWinProper")+"/"+Forge.getLocalizer().getMessage("lblLossProper"));
|
wins.setText(Forge.getLocalizer().getMessage("lblWinProper")+":");
|
||||||
lossWinRatio = ui.findActor("lossWinRatio");
|
totalWins = ui.findActor("totalWins");
|
||||||
back = ui.findActor("return");
|
loss = ui.findActor("loss");
|
||||||
back.getLabel().setText(Forge.getLocalizer().getMessage("lblBack"));
|
loss.setText(Forge.getLocalizer().getMessage("lblLossProper")+":");
|
||||||
ScrollPane scrollPane = ui.findActor("enemies");
|
totalLoss = ui.findActor("totalLoss");
|
||||||
scrollPane.setActor(enemiesGroup);
|
winloss = ui.findActor("winloss");
|
||||||
|
winloss.setText(Forge.getLocalizer().getMessage("lblWinProper")+"/"+Forge.getLocalizer().getMessage("lblLossProper"));
|
||||||
|
lossWinRatio = ui.findActor("lossWinRatio");
|
||||||
|
back = ui.findActor("return");
|
||||||
|
back.getLabel().setText(Forge.getLocalizer().getMessage("lblBack"));
|
||||||
|
ScrollPane scrollPane = ui.findActor("enemies");
|
||||||
|
scrollPane.setActor(enemiesGroup);
|
||||||
|
colorFrames = new Texture(Config.instance().getFile("ui/color_frames.png"));
|
||||||
|
ScrollPane blessing = ui.findActor("blessingInfo");
|
||||||
|
blessing.setActor(blessingScroll);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void create() {
|
public void create() {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class RewardScene extends UIScene {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (wait) {
|
if (wait) {
|
||||||
flipCountDown = 3.0f;
|
flipCountDown = 1.5f;
|
||||||
doneClicked = true;
|
doneClicked = true;
|
||||||
} else {
|
} else {
|
||||||
Forge.switchToLast();
|
Forge.switchToLast();
|
||||||
|
|||||||
@@ -1,9 +1,17 @@
|
|||||||
package forge.adventure.stage;
|
package forge.adventure.stage;
|
||||||
|
|
||||||
|
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
import forge.StaticData;
|
import forge.StaticData;
|
||||||
|
import forge.adventure.data.EnemyData;
|
||||||
|
import forge.adventure.data.WorldData;
|
||||||
import forge.adventure.pointofintrest.PointOfInterest;
|
import forge.adventure.pointofintrest.PointOfInterest;
|
||||||
|
import forge.adventure.scene.SceneType;
|
||||||
import forge.adventure.util.Current;
|
import forge.adventure.util.Current;
|
||||||
|
import forge.card.ColorSet;
|
||||||
|
import forge.deck.Deck;
|
||||||
|
import forge.deck.DeckProxy;
|
||||||
|
import forge.game.GameType;
|
||||||
import forge.item.PaperCard;
|
import forge.item.PaperCard;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -161,10 +169,49 @@ public class ConsoleCommandInterpreter {
|
|||||||
return "Added item "+s[0];
|
return "Added item "+s[0];
|
||||||
return "can not find item "+s[0];
|
return "can not find item "+s[0];
|
||||||
});
|
});
|
||||||
registerCommand(new String[]{"heal"}, s -> {
|
registerCommand(new String[]{"fullHeal"}, s -> {
|
||||||
Current.player().heal();
|
Current.player().fullHeal();
|
||||||
return "Player life back to "+Current.player().getLife();
|
return "Player life back to "+Current.player().getLife();
|
||||||
});
|
});
|
||||||
|
registerCommand(new String[]{"setColorID"}, s -> {
|
||||||
|
if(s.length < 1) return "Please specify color ID: Valid choices: B, G, R, U, W, C. Example:\n\"setColorID G\"";
|
||||||
|
Current.player().setColorIdentity(s[0]);
|
||||||
|
return "Player color identity set to " + Current.player().getColorIdentity();
|
||||||
|
});
|
||||||
|
registerCommand(new String[]{"reloadScenes"}, s -> {
|
||||||
|
SceneType.InventoryScene.instance.resLoaded();
|
||||||
|
SceneType.PlayerStatisticScene.instance.resLoaded();
|
||||||
|
|
||||||
|
return "Force reload status scenes. Might be unstable.";
|
||||||
|
});
|
||||||
|
registerCommand(new String[]{"resetQuests"}, s -> {
|
||||||
|
Current.player().resetQuestFlags();
|
||||||
|
return "All global quest flags have been reset.";
|
||||||
|
});
|
||||||
|
registerCommand(new String[]{"dumpEnemyDeckColors"}, s -> {
|
||||||
|
for(EnemyData E : new Array.ArrayIterator<>(WorldData.getAllEnemies())){
|
||||||
|
Deck D = E.generateDeck();
|
||||||
|
DeckProxy DP = new DeckProxy(D, "Constructed", GameType.Constructed, null);
|
||||||
|
ColorSet colorSet = DP.getColor();
|
||||||
|
System.out.printf("%s: Colors: %s (%s%s%s%s%s%s)\n", D.getName(), DP.getColor(),
|
||||||
|
(colorSet.hasBlack() ? "B" : ""),
|
||||||
|
(colorSet.hasGreen() ? "G" : ""),
|
||||||
|
(colorSet.hasRed() ? "R" : ""),
|
||||||
|
(colorSet.hasBlue() ? "U" : ""),
|
||||||
|
(colorSet.hasWhite() ? "W" : ""),
|
||||||
|
(colorSet.isColorless() ? "C" : "")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return "Enemy deck color list dumped to stdout.";
|
||||||
|
});
|
||||||
|
registerCommand(new String[]{"heal", "amount"}, s -> {
|
||||||
|
if(s.length<1) return "Command needs 1 parameter";
|
||||||
|
int N = 0;
|
||||||
|
try { N = Integer.parseInt(s[0]); }
|
||||||
|
catch (Exception e) { return "Can not convert " + s[0] + " to integer"; }
|
||||||
|
Current.player().heal(N);
|
||||||
|
return "Player healed to " + Current.player().getLife() + "/" + Current.player().getMaxLife();
|
||||||
|
});
|
||||||
registerCommand(new String[]{"debug","on"}, s -> {
|
registerCommand(new String[]{"debug","on"}, s -> {
|
||||||
Current.setDebug(true);
|
Current.setDebug(true);
|
||||||
return "Debug mode on";
|
return "Debug mode on";
|
||||||
|
|||||||
@@ -15,10 +15,9 @@ import com.badlogic.gdx.math.Vector2;
|
|||||||
import com.badlogic.gdx.scenes.scene2d.Group;
|
import com.badlogic.gdx.scenes.scene2d.Group;
|
||||||
import com.badlogic.gdx.scenes.scene2d.Stage;
|
import com.badlogic.gdx.scenes.scene2d.Stage;
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Dialog;
|
import com.badlogic.gdx.scenes.scene2d.ui.Dialog;
|
||||||
|
import com.badlogic.gdx.scenes.scene2d.ui.Label;
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.Json;
|
|
||||||
import com.badlogic.gdx.utils.ScreenUtils;
|
import com.badlogic.gdx.utils.ScreenUtils;
|
||||||
import com.badlogic.gdx.utils.SerializationException;
|
|
||||||
import forge.Forge;
|
import forge.Forge;
|
||||||
import forge.adventure.character.*;
|
import forge.adventure.character.*;
|
||||||
import forge.adventure.data.*;
|
import forge.adventure.data.*;
|
||||||
@@ -64,7 +63,12 @@ public class MapStage extends GameStage {
|
|||||||
private Stage dialogStage;
|
private Stage dialogStage;
|
||||||
private boolean dialogOnlyInput;
|
private boolean dialogOnlyInput;
|
||||||
|
|
||||||
private EffectData effect;
|
|
||||||
|
//Map properties.
|
||||||
|
//These maps are defined as embedded properties within the Tiled maps.
|
||||||
|
private EffectData effect; //"Dungeon Effect": Character Effect applied to all adversaries within the map.
|
||||||
|
private boolean preventEscape = false; //Prevents player from escaping the dungeon by any means that aren't an exit.
|
||||||
|
|
||||||
|
|
||||||
public boolean getDialogOnlyInput() {
|
public boolean getDialogOnlyInput() {
|
||||||
return dialogOnlyInput;
|
return dialogOnlyInput;
|
||||||
@@ -73,16 +77,18 @@ public class MapStage extends GameStage {
|
|||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean canEscape() { return (preventEscape ? true : false); } //Check if escape is possible.
|
||||||
|
|
||||||
public void clearIsInMap() {
|
public void clearIsInMap() {
|
||||||
isInMap = false;
|
isInMap = false;
|
||||||
effect = null;
|
effect = null; //Reset effect so battles outside the dungeon don't use the last visited dungeon's effects.
|
||||||
|
preventEscape = false;
|
||||||
GameHUD.getInstance().showHideMap(true);
|
GameHUD.getInstance().showHideMap(true);
|
||||||
}
|
}
|
||||||
public void draw (Batch batch) {
|
public void draw (Batch batch) {
|
||||||
//Camera camera = getCamera() ;
|
//Camera camera = getCamera() ;
|
||||||
//camera.update();
|
//camera.update();
|
||||||
//update camera after all layers got drawn
|
//update camera after all layers got drawn
|
||||||
|
|
||||||
if (!getRoot().isVisible()) return;
|
if (!getRoot().isVisible()) return;
|
||||||
getRoot().draw(batch, 1);
|
getRoot().draw(batch, 1);
|
||||||
}
|
}
|
||||||
@@ -125,7 +131,6 @@ public class MapStage extends GameStage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final ArrayList<Rectangle> currentCollidingRectangles = new ArrayList<>();
|
final ArrayList<Rectangle> currentCollidingRectangles = new ArrayList<>();
|
||||||
@@ -185,8 +190,10 @@ public class MapStage extends GameStage {
|
|||||||
dialog.getButtonTable().clear();
|
dialog.getButtonTable().clear();
|
||||||
String text = "Strange magical energies flow within this place...\nAll opponents get:\n";
|
String text = "Strange magical energies flow within this place...\nAll opponents get:\n";
|
||||||
text += E.getDescription();
|
text += E.getDescription();
|
||||||
dialog.text(text);
|
Label L = Controls.newLabel(text);
|
||||||
dialog.getButtonTable().add(Controls.newTextButton("OK", this::hideDialog));
|
L.setWrap(true);
|
||||||
|
dialog.getContentTable().add(L).width(260f);
|
||||||
|
dialog.getButtonTable().add(Controls.newTextButton("OK", this::hideDialog)).width(260f);
|
||||||
dialog.setKeepWithinStage(true);
|
dialog.setKeepWithinStage(true);
|
||||||
showDialog();
|
showDialog();
|
||||||
}
|
}
|
||||||
@@ -199,8 +206,8 @@ public class MapStage extends GameStage {
|
|||||||
for (MapActor actor : new Array.ArrayIterator<>(actors)) {
|
for (MapActor actor : new Array.ArrayIterator<>(actors)) {
|
||||||
actor.remove();
|
actor.remove();
|
||||||
foregroundSprites.removeActor(actor);
|
foregroundSprites.removeActor(actor);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
actors = new Array<>();
|
actors = new Array<>();
|
||||||
width = Float.parseFloat(map.getProperties().get("width").toString());
|
width = Float.parseFloat(map.getProperties().get("width").toString());
|
||||||
height = Float.parseFloat(map.getProperties().get("height").toString());
|
height = Float.parseFloat(map.getProperties().get("height").toString());
|
||||||
@@ -210,16 +217,17 @@ public class MapStage extends GameStage {
|
|||||||
collision = new ArrayList[(int) width][(int) height];
|
collision = new ArrayList[(int) width][(int) height];
|
||||||
|
|
||||||
//Load dungeon effects.
|
//Load dungeon effects.
|
||||||
if( map.getProperties().get("dungeonEffect") != null && !map.getProperties().get("dungeonEffect").toString().isEmpty()){
|
MapProperties MP = map.getProperties();
|
||||||
Json json = new Json();
|
|
||||||
try { effect = json.fromJson(EffectData.class, map.getProperties().get("dungeonEffect").toString()); }
|
if( MP.get("dungeonEffect") != null && !MP.get("dungeonEffect").toString().isEmpty()){
|
||||||
catch(SerializationException E) {
|
JSONStringLoader J = new JSONStringLoader();
|
||||||
//JSON parsing could fail. Since this an user written part, assume failure is possible (it happens).
|
effect = J.parse(EffectData.class, map.getProperties().get("dungeonEffect").toString(), "");
|
||||||
System.err.printf("[%s] while loading JSON file for dialog actor. JSON:\n%s\nUsing a default dialog.", E.getMessage(), map.getProperties().get("dungeonEffect").toString());
|
|
||||||
effect = json.fromJson(EffectData.class, "");
|
|
||||||
}
|
|
||||||
effectDialog(effect);
|
effectDialog(effect);
|
||||||
}
|
}
|
||||||
|
if (MP.get("preventEscape") != null) preventEscape = (boolean)MP.get("preventEscape");
|
||||||
|
if (MP.get("music") != null && !MP.get("music").toString().isEmpty()){
|
||||||
|
//TODO: Add a way to play a music file directly without using a playlist.
|
||||||
|
}
|
||||||
|
|
||||||
GetPlayer().stop();
|
GetPlayer().stop();
|
||||||
|
|
||||||
@@ -258,7 +266,6 @@ public class MapStage extends GameStage {
|
|||||||
private void loadObjects(MapLayer layer, String sourceMap) {
|
private void loadObjects(MapLayer layer, String sourceMap) {
|
||||||
player.setMoveModifier(2);
|
player.setMoveModifier(2);
|
||||||
for (MapObject obj : layer.getObjects()) {
|
for (MapObject obj : layer.getObjects()) {
|
||||||
|
|
||||||
MapProperties prop = obj.getProperties();
|
MapProperties prop = obj.getProperties();
|
||||||
Object typeObject = prop.get("type");
|
Object typeObject = prop.get("type");
|
||||||
if (typeObject != null) {
|
if (typeObject != null) {
|
||||||
@@ -276,22 +283,52 @@ public class MapStage extends GameStage {
|
|||||||
addMapActor(obj, entry);
|
addMapActor(obj, entry);
|
||||||
break;
|
break;
|
||||||
case "reward":
|
case "reward":
|
||||||
if (prop.get("reward") != null) {
|
Object R = prop.get("reward");
|
||||||
RewardSprite R = new RewardSprite(id, prop.get("reward").toString(), prop.get("sprite").toString());
|
if(R != null && !R.toString().isEmpty()) {
|
||||||
addMapActor(obj, R);
|
Object S = prop.get("sprite");
|
||||||
|
String Sp = "sprites/treasure.atlas";
|
||||||
|
if(S != null && !S.toString().isEmpty()) Sp = S.toString();
|
||||||
|
else System.err.printf("No sprite defined for reward (ID:%s), defaulting to \"sprites/treasure.atlas\"", id);
|
||||||
|
RewardSprite RW = new RewardSprite(id, R.toString(), Sp);
|
||||||
|
addMapActor(obj, RW);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "enemy":
|
case "enemy":
|
||||||
EnemySprite mob = new EnemySprite(id, WorldData.getEnemy(prop.get("enemy").toString()));
|
Object E = prop.get("enemy");
|
||||||
addMapActor(obj, mob);
|
if(E != null && !E.toString().isEmpty()) {
|
||||||
if(prop.get("dialog") != null && !prop.get("dialog").toString().isEmpty()) {
|
EnemyData EN = WorldData.getEnemy(E.toString());
|
||||||
mob.dialog = new MapDialog(prop.get("dialog").toString(), this, mob.getId());
|
if(EN == null){
|
||||||
|
System.err.printf("Enemy \"%s\" not found.", E.toString());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
EnemySprite mob = new EnemySprite(id, EN);
|
||||||
|
Object D = prop.get("dialog"); //Check if the enemy has a dialogue attached to it.
|
||||||
|
if (D != null && !D.toString().isEmpty()) {
|
||||||
|
mob.dialog = new MapDialog(D.toString(), this, mob.getId());
|
||||||
|
}
|
||||||
|
D = prop.get("defeatDialog"); //Check if the enemy has a defeat dialogue attached to it.
|
||||||
|
if (D != null && !D.toString().isEmpty()) {
|
||||||
|
mob.defeatDialog = new MapDialog(D.toString(), this, mob.getId());
|
||||||
|
}
|
||||||
|
D = prop.get("name"); //Check for name override.
|
||||||
|
if (D != null && !D.toString().isEmpty()) {
|
||||||
|
mob.nameOverride = D.toString();
|
||||||
|
}
|
||||||
|
D = prop.get("effect"); //Check for special effects.
|
||||||
|
if (D != null && !D.toString().isEmpty()) {
|
||||||
|
mob.effect = JSONStringLoader.parse(EffectData.class, D.toString(), "");
|
||||||
|
}
|
||||||
|
//TODO: Additional rewards.
|
||||||
|
//TODO: Filter by difficulty. (Don't spawn if doesn't match)
|
||||||
|
addMapActor(obj, mob);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "dummy": //Does nothing. Mostly obstacles to be removed by ID by switches or such.
|
case "dummy": //Does nothing. Mostly obstacles to be removed by ID by switches or such.
|
||||||
TiledMapTileMapObject obj2 = (TiledMapTileMapObject) obj;
|
TiledMapTileMapObject obj2 = (TiledMapTileMapObject) obj;
|
||||||
DummySprite D = new DummySprite(id, obj2.getTextureRegion(), this);
|
DummySprite D = new DummySprite(id, obj2.getTextureRegion(), this);
|
||||||
addMapActor(obj, D);
|
addMapActor(obj, D);
|
||||||
|
//TODO: Ability to toggle their solid state.
|
||||||
|
//TODO: Ability to move them (using a sequence such as "UULU" for up, up, left, up).
|
||||||
break;
|
break;
|
||||||
case "inn":
|
case "inn":
|
||||||
addMapActor(obj, new OnCollide(new Runnable() {
|
addMapActor(obj, new OnCollide(new Runnable() {
|
||||||
@@ -407,7 +444,8 @@ public class MapStage extends GameStage {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean lookForID(int id){
|
public boolean lookForID(int id){ //Search actor by ID.
|
||||||
|
|
||||||
for(MapActor A : new Array.ArrayIterator<>(actors)){
|
for(MapActor A : new Array.ArrayIterator<>(actors)){
|
||||||
if(A.getId() == id)
|
if(A.getId() == id)
|
||||||
return true;
|
return true;
|
||||||
@@ -415,7 +453,7 @@ public class MapStage extends GameStage {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public EnemySprite getEnemyByID(int id) {
|
public EnemySprite getEnemyByID(int id) { //Search actor by ID, enemies only.
|
||||||
for(MapActor A : new Array.ArrayIterator<>(actors)){
|
for(MapActor A : new Array.ArrayIterator<>(actors)){
|
||||||
if(A instanceof EnemySprite && A.getId() == id)
|
if(A instanceof EnemySprite && A.getId() == id)
|
||||||
return ((EnemySprite) A);
|
return ((EnemySprite) A);
|
||||||
@@ -426,11 +464,17 @@ public class MapStage extends GameStage {
|
|||||||
protected void getReward() {
|
protected void getReward() {
|
||||||
isLoadingMatch = false;
|
isLoadingMatch = false;
|
||||||
((RewardScene) SceneType.RewardScene.instance).loadRewards(currentMob.getRewards(), RewardScene.Type.Loot, null);
|
((RewardScene) SceneType.RewardScene.instance).loadRewards(currentMob.getRewards(), RewardScene.Type.Loot, null);
|
||||||
currentMob.remove();
|
|
||||||
actors.removeValue(currentMob, true);
|
|
||||||
changes.deleteObject(currentMob.getId());
|
|
||||||
currentMob = null;
|
|
||||||
Forge.switchScene(SceneType.RewardScene.instance);
|
Forge.switchScene(SceneType.RewardScene.instance);
|
||||||
|
if(currentMob.defeatDialog == null) {
|
||||||
|
currentMob.remove();
|
||||||
|
actors.removeValue(currentMob, true);
|
||||||
|
changes.deleteObject(currentMob.getId());
|
||||||
|
} else {
|
||||||
|
currentMob.defeatDialog.activate();
|
||||||
|
player.setAnimation(CharacterSprite.AnimationTypes.Idle);
|
||||||
|
currentMob.setAnimation(CharacterSprite.AnimationTypes.Idle);
|
||||||
|
}
|
||||||
|
currentMob = null;
|
||||||
}
|
}
|
||||||
public void removeAllEnemies()
|
public void removeAllEnemies()
|
||||||
{
|
{
|
||||||
@@ -455,9 +499,8 @@ public class MapStage extends GameStage {
|
|||||||
if (actor instanceof EnemySprite) {
|
if (actor instanceof EnemySprite) {
|
||||||
EnemySprite mob = (EnemySprite) actor;
|
EnemySprite mob = (EnemySprite) actor;
|
||||||
currentMob = mob;
|
currentMob = mob;
|
||||||
if (mob.dialog != null){ //This enemy has something to say. Display a dialog like if it was a DialogActor.
|
resetPosition();
|
||||||
resetPosition();
|
if(mob.dialog != null && mob.dialog.canShow()){ //This enemy has something to say. Display a dialog like if it was a DialogActor but only if dialogue is possible.
|
||||||
showDialog();
|
|
||||||
mob.dialog.activate();
|
mob.dialog.activate();
|
||||||
} else { //Duel the enemy.
|
} else { //Duel the enemy.
|
||||||
beginDuel(mob);
|
beginDuel(mob);
|
||||||
@@ -499,7 +542,7 @@ public class MapStage extends GameStage {
|
|||||||
}
|
}
|
||||||
}, ScreenUtils.getFrameBufferTexture(), true, false));
|
}, ScreenUtils.getFrameBufferTexture(), true, false));
|
||||||
}
|
}
|
||||||
startPause(0.4f, new Runnable() {
|
startPause(0.3f, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
DuelScene S = ((DuelScene) SceneType.DuelScene.instance);
|
DuelScene S = ((DuelScene) SceneType.DuelScene.instance);
|
||||||
@@ -533,7 +576,6 @@ public class MapStage extends GameStage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void resetPosition() {
|
public void resetPosition() {
|
||||||
|
|
||||||
player.setPosition(oldPosition4);
|
player.setPosition(oldPosition4);
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public class WorldStage extends GameStage implements SaveFileContent {
|
|||||||
Forge.clearTransitionScreen();
|
Forge.clearTransitionScreen();
|
||||||
}
|
}
|
||||||
}, ScreenUtils.getFrameBufferTexture(), true, false));
|
}, ScreenUtils.getFrameBufferTexture(), true, false));
|
||||||
startPause(0.5f, new Runnable() {
|
startPause(0.3f, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
((DuelScene) SceneType.DuelScene.instance).setEnemy(currentMob);
|
((DuelScene) SceneType.DuelScene.instance).setEnemy(currentMob);
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package forge.adventure.util;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.utils.Json;
|
||||||
|
import com.badlogic.gdx.utils.Null;
|
||||||
|
import com.badlogic.gdx.utils.SerializationException;
|
||||||
|
/**
|
||||||
|
* JSONStringLoader
|
||||||
|
* Wrapper around Json functions for easier loading of arbitrary JSON strings without
|
||||||
|
* having to try/catch every time.
|
||||||
|
*/
|
||||||
|
public class JSONStringLoader {
|
||||||
|
private static final Json JSON = new Json();
|
||||||
|
public static @Null <T> T parse(Class<T> type, String json, String fallback){
|
||||||
|
return parse(type, null, json, fallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static @Null <T> T parse(Class<T> type, Class elementType, String json, String fallback){
|
||||||
|
if(json != null && !json.isEmpty()){
|
||||||
|
try { return JSON.fromJson(type, elementType, json); }
|
||||||
|
catch(SerializationException E) {
|
||||||
|
//JSON parsing could fail. Since this an user written part, assume failure is possible (it happens).
|
||||||
|
System.err.printf("Error loading JSON string:\n%s\nUsing fallback.", E.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return JSON.fromJson(type, elementType, fallback);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,10 +2,10 @@ package forge.adventure.util;
|
|||||||
|
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.*;
|
import com.badlogic.gdx.scenes.scene2d.ui.*;
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.Json;
|
|
||||||
import com.badlogic.gdx.utils.SerializationException;
|
|
||||||
import forge.Forge;
|
import forge.Forge;
|
||||||
|
import forge.adventure.character.EnemySprite;
|
||||||
import forge.adventure.data.DialogData;
|
import forge.adventure.data.DialogData;
|
||||||
|
import forge.adventure.player.AdventurePlayer;
|
||||||
import forge.adventure.stage.MapStage;
|
import forge.adventure.stage.MapStage;
|
||||||
import forge.util.Localizer;
|
import forge.util.Localizer;
|
||||||
|
|
||||||
@@ -32,21 +32,15 @@ public class MapDialog {
|
|||||||
"]";
|
"]";
|
||||||
|
|
||||||
|
|
||||||
public MapDialog(String S, MapStage ST, int parentID) {
|
public MapDialog(String S, MapStage stage, int parentID) {
|
||||||
this.stage = ST;
|
this.stage = stage;
|
||||||
this.parentID = parentID;
|
this.parentID = parentID;
|
||||||
Json json = new Json();
|
if (S.isEmpty()) {
|
||||||
if (S.isEmpty()){
|
|
||||||
System.err.print("Dialog error. Dialog property is empty.\n");
|
System.err.print("Dialog error. Dialog property is empty.\n");
|
||||||
this.data = json.fromJson(Array.class, DialogData.class, defaultJSON);
|
this.data = JSONStringLoader.parse(Array.class, DialogData.class, defaultJSON, defaultJSON);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try { data = json.fromJson(Array.class, DialogData.class, S); }
|
this.data = JSONStringLoader.parse(Array.class, DialogData.class, S, defaultJSON);
|
||||||
catch(SerializationException E){
|
|
||||||
//JSON parsing could fail. Since this an user written part, assume failure is possible (it happens).
|
|
||||||
System.err.printf("[%s] while loading JSON file for dialog actor. JSON:\n%s\nUsing a default dialog.", E.getMessage(), S);
|
|
||||||
this.data = json.fromJson(Array.class, DialogData.class, defaultJSON);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadDialog(DialogData dialog) { //Displays a dialog with dialogue and possible choices.
|
private void loadDialog(DialogData dialog) { //Displays a dialog with dialogue and possible choices.
|
||||||
@@ -69,6 +63,7 @@ public class MapDialog {
|
|||||||
TextButton B = Controls.newTextButton(name,() -> loadDialog(option));
|
TextButton B = Controls.newTextButton(name,() -> loadDialog(option));
|
||||||
B.getLabel().setWrap(true); //We want this to wrap in case it's a wordy choice.
|
B.getLabel().setWrap(true); //We want this to wrap in case it's a wordy choice.
|
||||||
D.getButtonTable().add(B).width(WIDTH - 10); //The button table also returns a Cell when adding.
|
D.getButtonTable().add(B).width(WIDTH - 10); //The button table also returns a Cell when adding.
|
||||||
|
//TODO: Reducing the space a tiny bit could help. But should be fine as long as there aren't more than 4-5 options.
|
||||||
D.getButtonTable().row(); //Add a row. Tried to allow a few per row but it was a bit erratic.
|
D.getButtonTable().row(); //Add a row. Tried to allow a few per row but it was a bit erratic.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -79,7 +74,7 @@ public class MapDialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void activate() {
|
public void activate() { //Method for actors to show their dialogues.
|
||||||
for(DialogData dialog:data) {
|
for(DialogData dialog:data) {
|
||||||
if(isConditionOk(dialog.condition)) {
|
if(isConditionOk(dialog.condition)) {
|
||||||
loadDialog(dialog);
|
loadDialog(dialog);
|
||||||
@@ -87,42 +82,122 @@ public class MapDialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setEffects(DialogData.EffectData[] data) {
|
void setEffects(DialogData.ActionData[] data) {
|
||||||
if(data==null) return;
|
if(data==null) return;
|
||||||
for(DialogData.EffectData E:data) {
|
for(DialogData.ActionData E:data) {
|
||||||
if (E.removeItem != null){ //Removes an item from the player's inventory.
|
if(E.removeItem != null){ //Removes an item from the player's inventory.
|
||||||
Current.player().removeItem(E.removeItem);
|
Current.player().removeItem(E.removeItem);
|
||||||
}
|
}
|
||||||
if (E.addItem != null){ //Gives an item to the player.
|
if(E.addItem != null){ //Gives an item to the player.
|
||||||
Current.player().addItem(E.addItem);
|
Current.player().addItem(E.addItem);
|
||||||
}
|
}
|
||||||
if (E.deleteMapObject != 0){ //Removes a dummy object from the map.
|
if(E.addLife != 0){ //Gives (positive or negative) life to the player. Cannot go over max health.
|
||||||
|
Current.player().heal(E.addLife);
|
||||||
|
}
|
||||||
|
if(E.addGold != 0){ //Gives (positive or negative) gold to the player.
|
||||||
|
if(E.addGold > 0) Current.player().giveGold(E.addGold);
|
||||||
|
else Current.player().takeGold(-E.addGold);
|
||||||
|
}
|
||||||
|
if(E.deleteMapObject != 0){ //Removes a dummy object from the map.
|
||||||
if(E.deleteMapObject < 0) stage.deleteObject(parentID);
|
if(E.deleteMapObject < 0) stage.deleteObject(parentID);
|
||||||
else stage.deleteObject(E.deleteMapObject);
|
else stage.deleteObject(E.deleteMapObject);
|
||||||
}
|
}
|
||||||
if (E.battleWithActorID != 0){ //Starts a battle with the given enemy ID.
|
if(E.battleWithActorID != 0){ //Starts a battle with the given enemy ID.
|
||||||
if(E.battleWithActorID < 0) stage.beginDuel(stage.getEnemyByID(parentID));
|
if(E.battleWithActorID < 0) stage.beginDuel(stage.getEnemyByID(parentID));
|
||||||
else stage.beginDuel(stage.getEnemyByID(E.battleWithActorID));
|
else stage.beginDuel(stage.getEnemyByID(E.battleWithActorID));
|
||||||
}
|
}
|
||||||
|
if(E.giveBlessing != null) { //Gives a blessing for your next battle.
|
||||||
|
Current.player().addBlessing(E.giveBlessing);
|
||||||
|
}
|
||||||
|
if(E.setColorIdentity != null && !E.setColorIdentity.isEmpty()){ //Sets color identity (use sparingly)
|
||||||
|
Current.player().setColorIdentity(E.setColorIdentity);
|
||||||
|
}
|
||||||
//Create map object.
|
//Create map object.
|
||||||
//Check for quest flags, local.
|
//Toggle dummy object's hitbox. (Like to make a door passable)
|
||||||
//Check for quest flags, global.
|
if(E.setQuestFlag != null && !E.setQuestFlag.key.isEmpty()){ //Set a quest to given value.
|
||||||
|
Current.player().setQuestFlag(E.setQuestFlag.key, E.setQuestFlag.val);
|
||||||
|
}
|
||||||
|
if(E.advanceQuestFlag != null && !E.advanceQuestFlag.isEmpty()){ //Increase a given quest flag by 1.
|
||||||
|
Current.player().advanceQuestFlag(E.advanceQuestFlag);
|
||||||
|
}
|
||||||
|
//Set dungeon flag.
|
||||||
|
if(E.setEffect != null){ //Replace current effects.
|
||||||
|
EnemySprite EN = stage.getEnemyByID(parentID);
|
||||||
|
EN.effect = E.setEffect;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean canShow(){
|
||||||
|
if( data == null) return false;
|
||||||
|
for(DialogData dialog:data) {
|
||||||
|
if(isConditionOk(dialog.condition)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
boolean isConditionOk(DialogData.ConditionData[] data) {
|
boolean isConditionOk(DialogData.ConditionData[] data) {
|
||||||
if(data==null) return true;
|
if( data==null ) return true;
|
||||||
|
AdventurePlayer player = Current.player();
|
||||||
for(DialogData.ConditionData condition:data) {
|
for(DialogData.ConditionData condition:data) {
|
||||||
if(condition.item != null && !condition.item.isEmpty()) { //Check for item.
|
if(condition.item != null && !condition.item.isEmpty()) { //Check for an item in player's inventory.
|
||||||
if(!Current.player().hasItem(condition.item)) {
|
if(!player.hasItem(condition.item)) {
|
||||||
if(!condition.not) return false; //Only return on a false.
|
if(!condition.not) return false; //Only return on a false.
|
||||||
} else if(condition.not) return false;
|
} else if(condition.not) return false;
|
||||||
}
|
}
|
||||||
|
if(condition.colorIdentity != null && !condition.colorIdentity.isEmpty()) { //Check for player's color ID.
|
||||||
|
if(!player.getColorIdentity().equals(condition.colorIdentity.toUpperCase())){
|
||||||
|
if(!condition.not) return false;
|
||||||
|
} else if(condition.not) return false;
|
||||||
|
}
|
||||||
|
if(condition.hasGold != 0){ //Check for at least X gold.
|
||||||
|
if(player.getGold() < condition.hasGold){
|
||||||
|
if(!condition.not) return false;
|
||||||
|
} else if(condition.not) return false;
|
||||||
|
}
|
||||||
|
if(condition.hasLife != 0){ //Check for at least X life..
|
||||||
|
if(player.getLife() < condition.hasLife + 1){
|
||||||
|
if(!condition.not) return false;
|
||||||
|
} else if(condition.not) return false;
|
||||||
|
}
|
||||||
|
if(condition.hasBlessing != null && !condition.hasBlessing.isEmpty()){ //Check for a named blessing.
|
||||||
|
if(!player.hasBlessing(condition.hasBlessing)){
|
||||||
|
if(!condition.not) return false;
|
||||||
|
} else if(condition.not) return false;
|
||||||
|
}
|
||||||
if(condition.actorID != 0) { //Check for actor ID.
|
if(condition.actorID != 0) { //Check for actor ID.
|
||||||
if(!stage.lookForID(condition.actorID)){
|
if(!stage.lookForID(condition.actorID)){
|
||||||
if(!condition.not) return false; //Same as above.
|
if(!condition.not) return false; //Same as above.
|
||||||
} else if(condition.not) return false;
|
} else if(condition.not) return false;
|
||||||
}
|
}
|
||||||
|
if(condition.getQuestFlag != null){
|
||||||
|
String key = condition.getQuestFlag.key;
|
||||||
|
String cond = condition.getQuestFlag.op;
|
||||||
|
|
||||||
|
int val = condition.getQuestFlag.val;
|
||||||
|
int QF = player.getQuestFlag(key);
|
||||||
|
boolean result = false;
|
||||||
|
if(!player.checkQuestFlag(key)) return false; //If the quest is not ongoing, stop.
|
||||||
|
|
||||||
|
|
||||||
|
switch(cond){
|
||||||
|
default: case "EQUALS": case"EQUAL": case "=":
|
||||||
|
if(QF == val) result = true; break;
|
||||||
|
case "LESSTHAN": case "<": if(QF < val) result = true; break;
|
||||||
|
case "MORETHAN": case ">": if(QF > val) result = true; break;
|
||||||
|
case "LE_THAN": case "<=": if(QF <= val) result = true; break;
|
||||||
|
case "ME_THAN": case ">=": if(QF >= val) result = true; break;
|
||||||
|
}
|
||||||
|
if(!result) { if(!condition.not) return false; }
|
||||||
|
else { if(condition.not) return false; }
|
||||||
|
}
|
||||||
|
if(condition.checkQuestFlag != null && !condition.checkQuestFlag.isEmpty()){
|
||||||
|
if(!player.checkQuestFlag(condition.checkQuestFlag)){
|
||||||
|
if(!condition.not) return false;
|
||||||
|
} else if(condition.not) return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package forge.adventure.world;
|
|||||||
import com.badlogic.gdx.files.FileHandle;
|
import com.badlogic.gdx.files.FileHandle;
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.badlogic.gdx.graphics.Pixmap;
|
import com.badlogic.gdx.graphics.Pixmap;
|
||||||
|
import com.badlogic.gdx.graphics.Texture;
|
||||||
import com.badlogic.gdx.math.Rectangle;
|
import com.badlogic.gdx.math.Rectangle;
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||||
@@ -47,6 +48,7 @@ public class World implements Disposable, SaveFileContent {
|
|||||||
private long seed;
|
private long seed;
|
||||||
private final Random random = MyRandom.getRandom();
|
private final Random random = MyRandom.getRandom();
|
||||||
private boolean worldDataLoaded=false;
|
private boolean worldDataLoaded=false;
|
||||||
|
private Texture globalTexture = null;
|
||||||
|
|
||||||
public Random getRandom()
|
public Random getRandom()
|
||||||
{
|
{
|
||||||
@@ -570,5 +572,11 @@ public class World implements Disposable, SaveFileContent {
|
|||||||
random.setSeed(seedOffset+seed);
|
random.setSeed(seedOffset+seed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Texture getGlobalTexture() {
|
||||||
|
if(globalTexture == null){
|
||||||
|
globalTexture = new Texture(Config.instance().getFile("ui/sprite_markers.png"));
|
||||||
|
System.out.print("Loading auxiliary sprites.\n");
|
||||||
|
}
|
||||||
|
return globalTexture;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,12 +118,11 @@ public class WorldSave {
|
|||||||
return currentSave;
|
return currentSave;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static WorldSave generateNewWorld(String name, boolean male, int race, int avatarIndex, int startingDeckIndex, DifficultyData diff, long seed) {
|
public static WorldSave generateNewWorld(String name, boolean male, int race, int avatarIndex, int startingColorIdentity, DifficultyData diff, long seed) {
|
||||||
|
|
||||||
currentSave.world.generateNew(seed);
|
currentSave.world.generateNew(seed);
|
||||||
currentSave.pointOfInterestChanges.clear();
|
currentSave.pointOfInterestChanges.clear();
|
||||||
Deck starterDeck = Config.instance().starterDecks()[startingDeckIndex];
|
Deck starterDeck = Config.instance().starterDecks()[startingColorIdentity];
|
||||||
currentSave.player.create(name, starterDeck, male, race, avatarIndex,diff);
|
currentSave.player.create(name, startingColorIdentity, starterDeck, male, race, avatarIndex,diff);
|
||||||
currentSave.player.setWorldPosY((int) (currentSave.world.getData().playerStartPosY * currentSave.world.getData().height * currentSave.world.getTileSize()));
|
currentSave.player.setWorldPosY((int) (currentSave.world.getData().playerStartPosY * currentSave.world.getData().height * currentSave.world.getTileSize()));
|
||||||
currentSave.player.setWorldPosX((int) (currentSave.world.getData().playerStartPosX * currentSave.world.getData().width * currentSave.world.getTileSize()));
|
currentSave.player.setWorldPosX((int) (currentSave.world.getData().playerStartPosX * currentSave.world.getData().width * currentSave.world.getTileSize()));
|
||||||
currentSave.onLoadList.emit();
|
currentSave.onLoadList.emit();
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
"height": 4300,
|
"height": 4300,
|
||||||
"width": 2
|
"width": 2
|
||||||
},
|
},
|
||||||
"activeFile": "map/waste_town.tmx",
|
"activeFile": "map/debug_map.tmx",
|
||||||
"automapping.whileDrawing": false,
|
"automapping.whileDrawing": false,
|
||||||
"expandedProjectPaths": [
|
"expandedProjectPaths": [
|
||||||
|
"obj",
|
||||||
"tileset",
|
"tileset",
|
||||||
"map/main_story",
|
"map/main_story",
|
||||||
"obj",
|
|
||||||
"map"
|
"map"
|
||||||
],
|
],
|
||||||
"file.lastUsedOpenFilter": "All Files (*)",
|
"file.lastUsedOpenFilter": "All Files (*)",
|
||||||
@@ -1422,11 +1422,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"map/debug_map.tmx": {
|
"map/debug_map.tmx": {
|
||||||
"scale": 8,
|
"scale": 2,
|
||||||
"selectedLayer": 3,
|
"selectedLayer": 3,
|
||||||
"viewCenter": {
|
"viewCenter": {
|
||||||
"x": 240,
|
"x": 175.75,
|
||||||
"y": 239.875
|
"y": 316
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"map/djinnpalace_1.tmx": {
|
"map/djinnpalace_1.tmx": {
|
||||||
@@ -2663,7 +2663,7 @@
|
|||||||
"scale": 3,
|
"scale": 3,
|
||||||
"selectedLayer": 4,
|
"selectedLayer": 4,
|
||||||
"viewCenter": {
|
"viewCenter": {
|
||||||
"x": 235.33333333333331,
|
"x": 235.5,
|
||||||
"y": 135.66666666666663
|
"y": 135.66666666666663
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -2714,7 +2714,7 @@
|
|||||||
"tileset/main.tsx": {
|
"tileset/main.tsx": {
|
||||||
"dynamicWrapping": false,
|
"dynamicWrapping": false,
|
||||||
"scaleInDock": 1.5,
|
"scaleInDock": 1.5,
|
||||||
"scaleInEditor": 0.75
|
"scaleInEditor": 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"map.height": 60,
|
"map.height": 60,
|
||||||
@@ -2726,16 +2726,14 @@
|
|||||||
"openFiles": [
|
"openFiles": [
|
||||||
"map/debug_map.tmx",
|
"map/debug_map.tmx",
|
||||||
"tileset/buildings.tsx",
|
"tileset/buildings.tsx",
|
||||||
"tileset/main.tsx",
|
"tileset/main.tsx"
|
||||||
"map/waste_town.tmx"
|
|
||||||
],
|
],
|
||||||
"project": "main.tiled-project",
|
"project": "main.tiled-project",
|
||||||
"property.type": "string",
|
"property.type": "string",
|
||||||
"recentFiles": [
|
"recentFiles": [
|
||||||
"map/debug_map.tmx",
|
|
||||||
"tileset/buildings.tsx",
|
|
||||||
"tileset/main.tsx",
|
"tileset/main.tsx",
|
||||||
"map/waste_town.tmx",
|
"tileset/buildings.tsx",
|
||||||
|
"map/debug_map.tmx",
|
||||||
"map/main_story/white_castle.tmx",
|
"map/main_story/white_castle.tmx",
|
||||||
"map/main_story/final_castle.tmx",
|
"map/main_story/final_castle.tmx",
|
||||||
"map/main_story/black_castle.tmx",
|
"map/main_story/black_castle.tmx",
|
||||||
@@ -2743,7 +2741,8 @@
|
|||||||
"map/main_story/green_castle.tmx",
|
"map/main_story/green_castle.tmx",
|
||||||
"map/main_story/blue_castle.tmx",
|
"map/main_story/blue_castle.tmx",
|
||||||
"map/main_story/colorless_castle.tmx",
|
"map/main_story/colorless_castle.tmx",
|
||||||
"map/barbariancamp_2.tmx"
|
"map/barbariancamp_2.tmx",
|
||||||
|
"map/portal_1G2.tmx"
|
||||||
],
|
],
|
||||||
"resizeMap.removeObjects": true,
|
"resizeMap.removeObjects": true,
|
||||||
"textEdit.monospace": true
|
"textEdit.monospace": true
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<map version="1.8" tiledversion="1.8.4" orientation="orthogonal" renderorder="right-down" width="30" height="30" tilewidth="16" tileheight="16" infinite="0" nextlayerid="6" nextobjectid="84">
|
<map version="1.8" tiledversion="1.8.4" orientation="orthogonal" renderorder="right-down" width="30" height="30" tilewidth="16" tileheight="16" infinite="0" nextlayerid="6" nextobjectid="86">
|
||||||
<editorsettings>
|
<editorsettings>
|
||||||
<export format="tmx"/>
|
<export format="tmx"/>
|
||||||
</editorsettings>
|
</editorsettings>
|
||||||
@@ -32,11 +32,17 @@
|
|||||||
</data>
|
</data>
|
||||||
</layer>
|
</layer>
|
||||||
<objectgroup id="4" name="Objects">
|
<objectgroup id="4" name="Objects">
|
||||||
<object id="47" template="../obj/gold.tx" x="96" y="224"/>
|
<object id="47" template="../obj/gold.tx" x="32" y="352"/>
|
||||||
<object id="49" template="../obj/gold.tx" x="176" y="224"/>
|
|
||||||
<object id="50" template="../obj/enemy.tx" x="112" y="192" width="64" height="64">
|
<object id="50" template="../obj/enemy.tx" x="112" y="192" width="64" height="64">
|
||||||
<properties>
|
<properties>
|
||||||
|
<property name="effect">{
|
||||||
|
"lifeModifier": -25,
|
||||||
|
"opponent":{
|
||||||
|
"startBattleWithCard": [ "c_0_1_eldrazi_spawn_sac", "c_0_1_eldrazi_spawn_sac", "c_0_1_eldrazi_spawn_sac", "c_0_1_eldrazi_spawn_sac" ]
|
||||||
|
}
|
||||||
|
}</property>
|
||||||
<property name="enemy" value="Emrakul"/>
|
<property name="enemy" value="Emrakul"/>
|
||||||
|
<property name="name" value="Emrakul, the promised rest"/>
|
||||||
</properties>
|
</properties>
|
||||||
</object>
|
</object>
|
||||||
<object id="51" template="../obj/entry_up.tx" x="209" y="480">
|
<object id="51" template="../obj/entry_up.tx" x="209" y="480">
|
||||||
@@ -70,13 +76,12 @@
|
|||||||
<property name="sprite" value="sprites/3life.atlas"/>
|
<property name="sprite" value="sprites/3life.atlas"/>
|
||||||
</properties>
|
</properties>
|
||||||
</object>
|
</object>
|
||||||
<object id="69" template="../obj/treasure.tx" x="192" y="352"/>
|
<object id="69" template="../obj/treasure.tx" x="48" y="336"/>
|
||||||
<object id="74" template="../obj/treasure.tx" x="224" y="352"/>
|
<object id="74" template="../obj/treasure.tx" x="224" y="64"/>
|
||||||
<object id="70" template="../obj/booster.tx" x="32" y="336"/>
|
<object id="70" template="../obj/booster.tx" x="32" y="336"/>
|
||||||
<object id="72" template="../obj/booster.tx" x="224" y="320"/>
|
<object id="72" template="../obj/booster.tx" x="192" y="64"/>
|
||||||
<object id="71" template="../obj/gold.tx" x="48" y="352"/>
|
<object id="71" template="../obj/gold.tx" x="48" y="352"/>
|
||||||
<object id="73" template="../obj/gold.tx" x="224" y="288"/>
|
<object id="78" template="../obj/gate.tx" x="64" y="208" visible="1">
|
||||||
<object id="78" template="../obj/gate.tx" x="144" y="208" visible="0">
|
|
||||||
<properties>
|
<properties>
|
||||||
<property name="dialog">[
|
<property name="dialog">[
|
||||||
{
|
{
|
||||||
@@ -90,7 +95,7 @@
|
|||||||
]</property>
|
]</property>
|
||||||
</properties>
|
</properties>
|
||||||
</object>
|
</object>
|
||||||
<object id="79" template="../obj/gate.tx" x="128" y="208" visible="0">
|
<object id="79" template="../obj/gate.tx" x="128" y="208" width="32" height="16" visible="1">
|
||||||
<properties>
|
<properties>
|
||||||
<property name="dialog">[
|
<property name="dialog">[
|
||||||
{
|
{
|
||||||
@@ -106,10 +111,16 @@
|
|||||||
</object>
|
</object>
|
||||||
<object id="80" template="../obj/enemy.tx" x="96" y="304">
|
<object id="80" template="../obj/enemy.tx" x="96" y="304">
|
||||||
<properties>
|
<properties>
|
||||||
|
<property name="defeatDialog">[
|
||||||
|
{
|
||||||
|
"text":"Impressive...",
|
||||||
|
"loctext":"",
|
||||||
|
"options":[ { "name":"Hey why are you still standing...?" } ]
|
||||||
|
}
|
||||||
|
]</property>
|
||||||
<property name="dialog">[
|
<property name="dialog">[
|
||||||
{
|
{
|
||||||
"effect":[],
|
"effect":[],
|
||||||
"name":"ABC",
|
|
||||||
"text":"I am an elf. I do elf things like hugging trees and being pretty.",
|
"text":"I am an elf. I do elf things like hugging trees and being pretty.",
|
||||||
"loctext":"",
|
"loctext":"",
|
||||||
"condition":[],
|
"condition":[],
|
||||||
@@ -118,7 +129,13 @@
|
|||||||
{
|
{
|
||||||
"name":"Fight me, elf!",
|
"name":"Fight me, elf!",
|
||||||
"text": "Gladly.",
|
"text": "Gladly.",
|
||||||
"options": [ { "name": "I FEAR NOTHING!!?", "effect": [ { "battleWithActorID": -1 } ]} ]
|
"options": [ { "name": "Hey aren't you a bit swole for an elf...?", "effect": [ { "battleWithActorID": -1 } ]} ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "I want to be eco-friendly too.",
|
||||||
|
"condition": [ { "colorIdentity": "G", "not": true } ],
|
||||||
|
"text": "Listen to the forest, friend.\nYour color identity is now green!",
|
||||||
|
"options": [ { "name": "Awesome.", "effect": [ { "setColorIdentity": "G" } ]} ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"I wanna fight Emrakul over there!",
|
"name":"I wanna fight Emrakul over there!",
|
||||||
@@ -133,35 +150,193 @@
|
|||||||
"options": [ { "name": "Sorry..." } ]
|
"options": [ { "name": "Sorry..." } ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"That's cool dude.",
|
"name":"That's cool my green dude.",
|
||||||
"condition": [ { "item": "Treasure", "not": true } ],
|
"condition": [ { "item": "Treasure", "not": true }, { "colorIdentity": "G" } ],
|
||||||
"effect": [ { "addItem": "Treasure" } ],
|
"effect": [ { "addItem": "Treasure" } ],
|
||||||
"text": "You get it. Take this.",
|
"text": "You get it! Take this.",
|
||||||
"options": [ { "name": "Thanks bro." } ]
|
"options": [ { "name": "Thanks bro." } ]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name":"Thanks for the blessing.",
|
||||||
|
"condition": [ { "hasBlessing": "Debug Elf" } ],
|
||||||
|
"text": "You are welcome.",
|
||||||
|
"options": [ { "name": "Thumbs up emoji" } ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"Got any fancy elven blessing?",
|
||||||
|
"condition": [ { "item": "Treasure" }, { "hasBlessing": "Debug Elf", "not": true } ],
|
||||||
|
"text": "If you give me a Treasure, I will give you the blessing of the Debug Elf.\nWhich is a Llanowar Elves and 2 extra life in your next battle. Sounds good?",
|
||||||
|
"options": [
|
||||||
|
{ "name": "But I love my Treasure! I humbly refuse."},
|
||||||
|
{
|
||||||
|
"name": "I'll take it",
|
||||||
|
"effect": [
|
||||||
|
{ "removeItem": "Treasure", "giveBlessing": { "name": "Debug Elf" ,"lifeModifier": 2, "startBattleWithCard": [ "Llanowar Elves" ] } }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name":"Can you open that hidden wall?",
|
"name":"Can you open that hidden wall?",
|
||||||
"condition": [ { "actorID": 83 } ],
|
"condition": [ { "actorID": 83 } ],
|
||||||
"text": "Since you asked nicely, I shall.",
|
"text": "Since you asked nicely, I shall.",
|
||||||
"options": [ { "name": "Thanks bro.", "effect": [ { "deleteMapObject": 83 } ]} ]
|
"options": [ { "name": "Thanks bro.", "effect": [ { "deleteMapObject": 83 } ]} ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Got a quest?",
|
||||||
|
"condition": [ { "checkQuestFlag": "128", "not": true} ],
|
||||||
|
"text": "Ah, perhaps you can help me. Can you ask the Debug Demon about his favorite color?",
|
||||||
|
"options": [
|
||||||
|
{ "name": "That's weird, but sure.", "effect": [ { "setQuestFlag": {"key":"128", "val": 1} } ] },
|
||||||
|
{ "name": "That guy scares me, I'd rather not." }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "About that quest...",
|
||||||
|
"condition": [ { "getQuestFlag": { "key": "128", "op":"<", "val": 3 } } ],
|
||||||
|
"text": "Please let me know what the Debug Demon's answer is.",
|
||||||
|
"options": [
|
||||||
|
{ "name": "Sure" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Got it, bro.",
|
||||||
|
"condition": [ { "getQuestFlag": { "key": "128", "op":"=", "val": 3 } } ],
|
||||||
|
"text": "Ah. I see. Thank you friend, have this gold for your inconvenience.",
|
||||||
|
"options": [
|
||||||
|
{ "name": "Thanks", "effect": [ { "setQuestFlag": {"key":"128", "val": 4}, "addGold": 250 } ] }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]</property>
|
||||||
}
|
<property name="effect">{
|
||||||
]</property>
|
"lifeModifier": 190,
|
||||||
<property name="enemy" value="Elf"/>
|
"startBattleWithCard": [ "Llanowar Elves", "Llanowar Elves", "Forest", "Forest" ]
|
||||||
<property name="permanent" type="bool" value="true"/>
|
}</property>
|
||||||
|
<property name="enemy" value="Elf warrior"/>
|
||||||
|
<property name="name" value="Debug Elf"/>
|
||||||
</properties>
|
</properties>
|
||||||
</object>
|
</object>
|
||||||
<object id="81" template="../obj/enemy.tx" x="288" y="224">
|
<object id="81" template="../obj/enemy.tx" x="288" y="224">
|
||||||
<properties>
|
<properties>
|
||||||
|
<property name="dialog">[
|
||||||
|
{
|
||||||
|
"text": "You...you hurt Grog!\nYou...you filthy swine! I will stop at nothing until I see you defeated!\nGods...anyone! Grant me strength! Grant me REVENGE!!!!",
|
||||||
|
"condition": [
|
||||||
|
{
|
||||||
|
"actorID": 82,
|
||||||
|
"not": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"name": "Uh oh.",
|
||||||
|
"effect": [
|
||||||
|
{
|
||||||
|
"setEffect": {
|
||||||
|
"lifeModifier": 99,
|
||||||
|
"startBattleWithCard": [
|
||||||
|
"Avacyn, Angel of Hope",
|
||||||
|
"Urabrask the Hidden",
|
||||||
|
"Elesh Norn, Grand Cenobite",
|
||||||
|
"Emrakul, the Aeons Torn"
|
||||||
|
]
|
||||||
|
}, "battleWithActorID": -1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]</property>
|
||||||
<property name="enemy" value="Goblin"/>
|
<property name="enemy" value="Goblin"/>
|
||||||
</properties>
|
</properties>
|
||||||
</object>
|
</object>
|
||||||
<object id="82" template="../obj/enemy.tx" gid="2147491275" x="272" y="224">
|
<object id="82" template="../obj/enemy.tx" gid="2147491275" x="272" y="224">
|
||||||
<properties>
|
<properties>
|
||||||
|
<property name="dialog">[
|
||||||
|
{
|
||||||
|
"text":"...",
|
||||||
|
"condition":[ { "getQuestFlag": { "key": "128", "op":"<", "val": 3 } } ],
|
||||||
|
"options":[
|
||||||
|
{ "name":"???" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]</property>
|
||||||
<property name="enemy" value="Goblin"/>
|
<property name="enemy" value="Goblin"/>
|
||||||
</properties>
|
</properties>
|
||||||
</object>
|
</object>
|
||||||
<object id="83" template="../obj/gate.tx" type="dummy" gid="3651" x="64" y="336" width="16" height="16"/>
|
<object id="83" template="../obj/gate.tx" type="dummy" gid="3651" x="64" y="336" width="16" height="16"/>
|
||||||
|
<object id="84" template="../obj/enemy.tx" x="320" y="304">
|
||||||
|
<properties>
|
||||||
|
<property name="dialog">[
|
||||||
|
{
|
||||||
|
"effect":[],
|
||||||
|
"text":"I have some things to offer for that life you have...",
|
||||||
|
"condition":[],
|
||||||
|
"options":[
|
||||||
|
{ "name":"You are suspicious and have two shadows, I'm out." },
|
||||||
|
{
|
||||||
|
"name":"I'll vanquish you, demon!",
|
||||||
|
"text": "Oh look we got a tough guy over here!",
|
||||||
|
"options": [ { "name": "I FEAR NOTHING!!", "effect": [ { "battleWithActorID": -1 } ]} ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "I dig your edge.",
|
||||||
|
"condition": [ { "colorIdentity": "B", "not": true }, { "hasLife": 2 } ],
|
||||||
|
"text": "You can be dark and edgy like me. Maybe for some of your life force...",
|
||||||
|
"options": [ { "name": "I'm doing nothing better with it.", "effect": [ { "setColorIdentity": "B", "addLife": -2 } ]} ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "I dig your edge.",
|
||||||
|
"condition": [ { "colorIdentity": "B", "not": true }, { "hasLife": 2, "not": true } ],
|
||||||
|
"text": "You don't have enough life force...come back with more to offer.",
|
||||||
|
"options": [ { "name": "Aw man..." } ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Any cool demon deals?",
|
||||||
|
"condition": [ { "colorIdentity": "B" }, { "hasGold": 200 } ],
|
||||||
|
"text": "I can offer you this Treasure for the fair price of 200 gold.",
|
||||||
|
"options": [
|
||||||
|
{ "name": "This gem has a lot of edge, just like me. Deal!" , "effect": [ { "addGold": -20000, "addItem": "Treasure" } ] },
|
||||||
|
{ "name": "I'll think about it." }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"Got any fancy demon blessing?",
|
||||||
|
"condition": [ {"colorIdentity": "B"}, { "item": "Treasure" }, { "hasBlessing": "Debug Demon", "not": true } ],
|
||||||
|
"text": "Give me that Treasure of yours...\n(+1 health, Manasight, move speed 120%, Lord of the Pit starts in play)",
|
||||||
|
"options": [
|
||||||
|
{ "name": "That's shady."},
|
||||||
|
{
|
||||||
|
"name": "What can possibly go wrong?",
|
||||||
|
"effect": [
|
||||||
|
{ "removeItem": "Treasure", "giveBlessing": { "name": "Debug Demon" , "lifeModifier": 1, "colorView": true, "moveSpeed": 2, "startBattleWithCard": [ "Lord of the Pit" ] } }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Hey what's your favorite color?",
|
||||||
|
"condition": [ {"getQuestFlag": { "key":"128", "op":"=", "val":1 } } ],
|
||||||
|
"text": "Why, purple. It is a powerful color.",
|
||||||
|
"options": [
|
||||||
|
{ "name": "Thank you Satan.", "effect": [ { "setQuestFlag": { "key":"128", "val":3 } } ] }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]</property>
|
||||||
|
<property name="enemy" value="Demon"/>
|
||||||
|
<property name="name" value="Debug Demon"/>
|
||||||
|
</properties>
|
||||||
|
</object>
|
||||||
|
<object id="85" template="../obj/scroll.tx" x="208" y="96">
|
||||||
|
<properties>
|
||||||
|
<property name="reward">[
|
||||||
|
{ "cardName": "Black Lotus", "type":"card", "count":1 }
|
||||||
|
]</property>
|
||||||
|
</properties>
|
||||||
|
</object>
|
||||||
</objectgroup>
|
</objectgroup>
|
||||||
</map>
|
</map>
|
||||||
|
|||||||
10
forge-gui/res/adventure/Shandalar/maps/obj/scroll.tx
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<template>
|
||||||
|
<tileset firstgid="1" source="../tileset/buildings.tsx"/>
|
||||||
|
<object name="Scroll" type="reward" gid="1363" width="16" height="16">
|
||||||
|
<properties>
|
||||||
|
<property name="reward" value="[ { "type": "card", "cardName": "Black Lotus", "amount": 1 } ]"/>
|
||||||
|
<property name="sprite" value="sprites/scroll.atlas"/>
|
||||||
|
</properties>
|
||||||
|
</object>
|
||||||
|
</template>
|
||||||
|
Before Width: | Height: | Size: 228 KiB After Width: | Height: | Size: 227 KiB |
@@ -321,3 +321,12 @@ touchKnob
|
|||||||
orig: 72, 72
|
orig: 72, 72
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
|
dummy
|
||||||
|
rotate: false
|
||||||
|
xy: 0, 360
|
||||||
|
size: 5,5
|
||||||
|
orig: 1,1
|
||||||
|
split: 1, 1, 1, 1
|
||||||
|
pad: 0, 0, 0, 0
|
||||||
|
offset: 0,0
|
||||||
|
index:-1
|
||||||
|
|||||||
@@ -249,6 +249,25 @@
|
|||||||
"frameDuration": 0.03,
|
"frameDuration": 0.03,
|
||||||
"regions": [],
|
"regions": [],
|
||||||
"playMode": 2
|
"playMode": 2
|
||||||
|
},
|
||||||
|
"dummy": {
|
||||||
|
"region": "dummy",
|
||||||
|
"horizontalStretchAreas": [ 1, 1 ],
|
||||||
|
"verticalStretchAreas": [ 1, 1 ],
|
||||||
|
"tiling": true,
|
||||||
|
"minWidth": 5,
|
||||||
|
"minHeight": 5,
|
||||||
|
"rightWidth": 0,
|
||||||
|
"leftWidth": 0,
|
||||||
|
"bottomHeight": 0,
|
||||||
|
"topHeight": 0,
|
||||||
|
"offsetX": 0,
|
||||||
|
"offsetY": 0,
|
||||||
|
"offsetXspeed": 0,
|
||||||
|
"offsetYspeed": 0,
|
||||||
|
"frameDuration": 0.03,
|
||||||
|
"regions": [],
|
||||||
|
"playMode": 2
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle": {
|
"com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle": {
|
||||||
@@ -316,6 +335,9 @@
|
|||||||
"whiteBig": {
|
"whiteBig": {
|
||||||
"font": "default"
|
"font": "default"
|
||||||
}
|
}
|
||||||
|
"nobg": {
|
||||||
|
"font": "black"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"com.badlogic.gdx.scenes.scene2d.ui.List$ListStyle": {
|
"com.badlogic.gdx.scenes.scene2d.ui.List$ListStyle": {
|
||||||
"default": {
|
"default": {
|
||||||
@@ -345,6 +367,9 @@
|
|||||||
},
|
},
|
||||||
"gold": {
|
"gold": {
|
||||||
"background": "9patch4"
|
"background": "9patch4"
|
||||||
|
},
|
||||||
|
"nobg": {
|
||||||
|
"background": "dummy",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"com.badlogic.gdx.scenes.scene2d.ui.SelectBox$SelectBoxStyle": {
|
"com.badlogic.gdx.scenes.scene2d.ui.SelectBox$SelectBoxStyle": {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
treasure.png
|
treasure.png
|
||||||
size: 64,112
|
size: 64,128
|
||||||
format: RGBA8888
|
format: RGBA8888
|
||||||
filter: Nearest,Nearest
|
filter: Nearest,Nearest
|
||||||
repeat: none
|
repeat: none
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
treasure.png
|
treasure.png
|
||||||
size: 64,112
|
size: 64,128
|
||||||
format: RGBA8888
|
format: RGBA8888
|
||||||
filter: Nearest,Nearest
|
filter: Nearest,Nearest
|
||||||
repeat: none
|
repeat: none
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
treasure.png
|
treasure.png
|
||||||
size: 64,112
|
size: 64,128
|
||||||
format: RGBA8888
|
format: RGBA8888
|
||||||
filter: Nearest,Nearest
|
filter: Nearest,Nearest
|
||||||
repeat: none
|
repeat: none
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
treasure.png
|
treasure.png
|
||||||
size: 64,112
|
size: 64,128
|
||||||
format: RGBA8888
|
format: RGBA8888
|
||||||
filter: Nearest,Nearest
|
filter: Nearest,Nearest
|
||||||
repeat: none
|
repeat: none
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
treasure.png
|
treasure.png
|
||||||
size: 64,112
|
size: 64,128
|
||||||
format: RGBA8888
|
format: RGBA8888
|
||||||
filter: Nearest,Nearest
|
filter: Nearest,Nearest
|
||||||
repeat: none
|
repeat: none
|
||||||
|
|||||||
17
forge-gui/res/adventure/Shandalar/sprites/scroll.atlas
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
treasure.png
|
||||||
|
size: 64,128
|
||||||
|
format: RGBA8888
|
||||||
|
filter: Nearest,Nearest
|
||||||
|
repeat: none
|
||||||
|
Idle
|
||||||
|
xy: 0, 112
|
||||||
|
size: 16, 16
|
||||||
|
Idle
|
||||||
|
xy: 16, 112
|
||||||
|
size: 16, 16
|
||||||
|
Idle
|
||||||
|
xy: 32, 112
|
||||||
|
size: 16, 16
|
||||||
|
Idle
|
||||||
|
xy: 48, 112
|
||||||
|
size: 16, 16
|
||||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 238 B After Width: | Height: | Size: 1.6 KiB |
BIN
forge-gui/res/adventure/Shandalar/ui/colorC.png
Normal file
|
After Width: | Height: | Size: 981 B |
BIN
forge-gui/res/adventure/Shandalar/ui/color_frames.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
@@ -3,64 +3,65 @@
|
|||||||
"height": 270,
|
"height": 270,
|
||||||
"yDown": true,
|
"yDown": true,
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"type": "Image",
|
"type": "Image",
|
||||||
"image": "ui/title_bg.png",
|
"image": "ui/title_bg.png",
|
||||||
"width": 480,
|
"width": 480,
|
||||||
"height": 270
|
"height": 270
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"type": "Image",
|
"type": "Image",
|
||||||
"image": "ui/equipment.png",
|
"image": "ui/equipment.png",
|
||||||
"x": 8,
|
"x": 8,
|
||||||
"y": 8,
|
"y": 8,
|
||||||
"width": 129,
|
"width": 129,
|
||||||
"height": 243
|
"height": 243
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "ImageButton",
|
"type": "ImageButton",
|
||||||
"name": "Equipment_Neck",
|
"name": "Equipment_Neck",
|
||||||
"style": "item_frame",
|
"style": "item_frame",
|
||||||
"width": 20,
|
"width": 20,
|
||||||
"height": 20,
|
"height": 20,
|
||||||
"x": 62,
|
"x": 62,
|
||||||
"y": 40
|
"y": 40
|
||||||
} ,
|
},
|
||||||
{
|
{
|
||||||
"type": "ImageButton",
|
"type": "ImageButton",
|
||||||
"name": "Equipment_Body",
|
"name": "Equipment_Body",
|
||||||
"style": "item_frame",
|
"style": "item_frame",
|
||||||
"width": 20,
|
"width": 20,
|
||||||
"height": 20,
|
"height": 20,
|
||||||
"x": 62,
|
"x": 62,
|
||||||
"y": 85
|
"y": 85
|
||||||
} ,
|
},
|
||||||
{
|
{
|
||||||
"type": "ImageButton",
|
"type": "ImageButton",
|
||||||
"name": "Equipment_Boots",
|
"name": "Equipment_Boots",
|
||||||
"style": "item_frame",
|
"style": "item_frame",
|
||||||
"width": 20,
|
"width": 20,
|
||||||
"height": 20,
|
"height": 20,
|
||||||
"x": 62,
|
"x": 62,
|
||||||
"y": 220
|
"y": 220
|
||||||
} ,
|
},
|
||||||
{
|
{
|
||||||
"type": "ImageButton",
|
"type": "ImageButton",
|
||||||
"name": "Equipment_Left",
|
"name": "Equipment_Left",
|
||||||
"style": "item_frame",
|
"style": "item_frame",
|
||||||
"width": 20,
|
"width": 20,
|
||||||
"height": 20,
|
"height": 20,
|
||||||
"x": 17,
|
"x": 17,
|
||||||
"y": 130
|
"y": 130
|
||||||
} ,
|
},
|
||||||
{
|
{
|
||||||
"type": "ImageButton",
|
"type": "ImageButton",
|
||||||
"name": "Equipment_Right",
|
"name": "Equipment_Right",
|
||||||
"style": "item_frame",
|
"style": "item_frame",
|
||||||
"width": 20,
|
"width": 20,
|
||||||
"height": 20,
|
"height": 20,
|
||||||
"x": 107,
|
"x": 107,
|
||||||
"y": 130
|
"y": 130
|
||||||
} ,
|
},
|
||||||
{
|
{
|
||||||
"type": "Scroll",
|
"type": "Scroll",
|
||||||
"name": "inventory",
|
"name": "inventory",
|
||||||
@@ -68,22 +69,22 @@
|
|||||||
"y": 110,
|
"y": 110,
|
||||||
"width": 330,
|
"width": 330,
|
||||||
"height": 100
|
"height": 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "Window",
|
"type": "Window",
|
||||||
"x": 145,
|
"x": 145,
|
||||||
"y": 8,
|
"y": 8,
|
||||||
"width": 330,
|
"width": 330,
|
||||||
"height": 98
|
"height": 98
|
||||||
} ,
|
},
|
||||||
{
|
{
|
||||||
"type": "Label",
|
"type": "Label",
|
||||||
"name": "item_description",
|
"name": "item_description",
|
||||||
"x": 155,
|
"x": 155,
|
||||||
"y": 8,
|
"y": 12,
|
||||||
"width": 310,
|
"width": 310,
|
||||||
"height": 98
|
"height": 94
|
||||||
} ,
|
},
|
||||||
{
|
{
|
||||||
"type": "TextButton",
|
"type": "TextButton",
|
||||||
"name": "return",
|
"name": "return",
|
||||||
@@ -99,17 +100,17 @@
|
|||||||
"text": "Equip",
|
"text": "Equip",
|
||||||
"width": 60,
|
"width": 60,
|
||||||
"height": 30,
|
"height": 30,
|
||||||
"x": 330,
|
"x": 320,
|
||||||
"y": 222
|
"y": 222
|
||||||
} ,
|
},
|
||||||
{
|
{
|
||||||
"type": "TextButton",
|
"type": "TextButton",
|
||||||
"name": "delete",
|
"name": "delete",
|
||||||
"text": "Delete",
|
"text": "Discard",
|
||||||
"width": 60,
|
"width": 60,
|
||||||
"height": 30,
|
"height": 30,
|
||||||
"x": 240,
|
"x": 240,
|
||||||
"y": 222
|
"y": 222
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
{
|
{
|
||||||
"type": "TextButton",
|
"type": "TextButton",
|
||||||
"name": "delete",
|
"name": "delete",
|
||||||
"text": "Delete",
|
"text": "Discard",
|
||||||
"width": 80,
|
"width": 80,
|
||||||
"height": 30,
|
"height": 30,
|
||||||
"x": 8,
|
"x": 8,
|
||||||
|
|||||||
BIN
forge-gui/res/adventure/Shandalar/ui/sprite_markers.png
Normal file
|
After Width: | Height: | Size: 627 B |
@@ -16,7 +16,7 @@
|
|||||||
"x": 300,
|
"x": 300,
|
||||||
"y": 18,
|
"y": 18,
|
||||||
"width": 160,
|
"width": 160,
|
||||||
"height": 180
|
"height": 200
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "Scroll",
|
"type": "Scroll",
|
||||||
@@ -29,34 +29,25 @@
|
|||||||
{
|
{
|
||||||
"type": "Image",
|
"type": "Image",
|
||||||
"name": "avatar",
|
"name": "avatar",
|
||||||
"x": 320,
|
"x": 321,
|
||||||
"y": 28,
|
"y": 28,
|
||||||
"width": 64,
|
"width": 64,
|
||||||
"height": 64
|
"height": 64
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "Image",
|
"type": "Image",
|
||||||
"name": "avatarBorder",
|
"name": "colorFrame",
|
||||||
"image": "ui/avatarhud.png",
|
"image": "ui/colorC.png",
|
||||||
"x": 320,
|
"x": 305,
|
||||||
"y": 28,
|
"y": 45,
|
||||||
"width": 64,
|
"width": 64,
|
||||||
"height": 64
|
"height": 64
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "Label",
|
|
||||||
"name": "playerName",
|
|
||||||
"x": 330,
|
|
||||||
"y": 90,
|
|
||||||
"width": 80,
|
|
||||||
"height": 24,
|
|
||||||
"font": "black"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "Label",
|
"type": "Label",
|
||||||
"name": "totalWins",
|
"name": "totalWins",
|
||||||
"x": 410,
|
"x": 410,
|
||||||
"y": 114,
|
"y": 102,
|
||||||
"width": 80,
|
"width": 80,
|
||||||
"height": 24,
|
"height": 24,
|
||||||
"font": "black"
|
"font": "black"
|
||||||
@@ -66,7 +57,7 @@
|
|||||||
"name": "wins",
|
"name": "wins",
|
||||||
"text": "Win:",
|
"text": "Win:",
|
||||||
"x": 330,
|
"x": 330,
|
||||||
"y": 114,
|
"y": 102,
|
||||||
"width": 80,
|
"width": 80,
|
||||||
"height": 24,
|
"height": 24,
|
||||||
"font": "black"
|
"font": "black"
|
||||||
@@ -75,7 +66,7 @@
|
|||||||
"type": "Label",
|
"type": "Label",
|
||||||
"name": "totalLoss",
|
"name": "totalLoss",
|
||||||
"x": 410,
|
"x": 410,
|
||||||
"y": 134,
|
"y": 113,
|
||||||
"width": 80,
|
"width": 80,
|
||||||
"height": 24,
|
"height": 24,
|
||||||
"font": "black"
|
"font": "black"
|
||||||
@@ -85,7 +76,7 @@
|
|||||||
"name": "loss",
|
"name": "loss",
|
||||||
"text": "Loss:",
|
"text": "Loss:",
|
||||||
"x": 330,
|
"x": 330,
|
||||||
"y": 134,
|
"y": 113,
|
||||||
"width": 80,
|
"width": 80,
|
||||||
"height": 24,
|
"height": 24,
|
||||||
"font": "black"
|
"font": "black"
|
||||||
@@ -94,7 +85,7 @@
|
|||||||
"type": "Label",
|
"type": "Label",
|
||||||
"name": "lossWinRatio",
|
"name": "lossWinRatio",
|
||||||
"x": 410,
|
"x": 410,
|
||||||
"y": 154,
|
"y": 125,
|
||||||
"width": 80,
|
"width": 80,
|
||||||
"height": 24,
|
"height": 24,
|
||||||
"font": "black"
|
"font": "black"
|
||||||
@@ -104,11 +95,20 @@
|
|||||||
"name": "winloss",
|
"name": "winloss",
|
||||||
"text": "Win Loss Ratio:",
|
"text": "Win Loss Ratio:",
|
||||||
"x": 330,
|
"x": 330,
|
||||||
"y": 154,
|
"y": 125,
|
||||||
"width": 80,
|
"width": 80,
|
||||||
"height": 24,
|
"height": 24,
|
||||||
"font": "black"
|
"font": "black"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "Scroll",
|
||||||
|
"name": "blessingInfo",
|
||||||
|
"style": "nobg",
|
||||||
|
"x": 308,
|
||||||
|
"y": 143,
|
||||||
|
"width": 144,
|
||||||
|
"height": 72
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "TextButton",
|
"type": "TextButton",
|
||||||
"name": "return",
|
"name": "return",
|
||||||
@@ -116,13 +116,13 @@
|
|||||||
"width": 100,
|
"width": 100,
|
||||||
"height": 30,
|
"height": 30,
|
||||||
"x": 335,
|
"x": 335,
|
||||||
"y": 212
|
"y": 224
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "Image",
|
"type": "Image",
|
||||||
"name": "lifeIcon",
|
"name": "lifeIcon",
|
||||||
"image": "ui/life.png",
|
"image": "ui/life.png",
|
||||||
"x": 400,
|
"x": 392,
|
||||||
"y": 40,
|
"y": 40,
|
||||||
"width": 16,
|
"width": 16,
|
||||||
"height": 16
|
"height": 16
|
||||||
@@ -131,18 +131,27 @@
|
|||||||
"type": "Image",
|
"type": "Image",
|
||||||
"name": "goldIcon",
|
"name": "goldIcon",
|
||||||
"image": "ui/money.png",
|
"image": "ui/money.png",
|
||||||
"x": 400,
|
"x": 392,
|
||||||
"y": 60,
|
"y": 60,
|
||||||
"width": 16,
|
"width": 16,
|
||||||
"height": 16
|
"height": 16
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "Label",
|
||||||
|
"name": "playerName",
|
||||||
|
"x": 394,
|
||||||
|
"y": 20,
|
||||||
|
"width": 80,
|
||||||
|
"height": 24,
|
||||||
|
"font": "black"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "Label",
|
"type": "Label",
|
||||||
"name": "lifePoints",
|
"name": "lifePoints",
|
||||||
"font": "black",
|
"font": "black",
|
||||||
"width": 64,
|
"width": 64,
|
||||||
"height": 16,
|
"height": 16,
|
||||||
"x": 420,
|
"x": 410,
|
||||||
"y": 40
|
"y": 40
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -151,7 +160,7 @@
|
|||||||
"font": "black",
|
"font": "black",
|
||||||
"width": 64,
|
"width": 64,
|
||||||
"height": 16,
|
"height": 16,
|
||||||
"x": 420,
|
"x": 410,
|
||||||
"y": 60
|
"y": 60
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,15 +16,15 @@
|
|||||||
"x": 4,
|
"x": 4,
|
||||||
"y": 4,
|
"y": 4,
|
||||||
"width": 262,
|
"width": 262,
|
||||||
"height": 90
|
"height": 98
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "Scroll",
|
"type": "Scroll",
|
||||||
"name": "enemies",
|
"name": "enemies",
|
||||||
"x": 4,
|
"x": 4,
|
||||||
"y": 98,
|
"y": 106,
|
||||||
"width": 262,
|
"width": 262,
|
||||||
"height": 335
|
"height": 327
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "Image",
|
"type": "Image",
|
||||||
@@ -36,28 +36,19 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "Image",
|
"type": "Image",
|
||||||
"name": "avatarBorder",
|
"name": "colorFrame",
|
||||||
"image": "ui/avatarhud.png",
|
"image": "ui/colorC.png",
|
||||||
"x": 24,
|
"x": 8,
|
||||||
"y": 8,
|
"y": 25,
|
||||||
"width": 64,
|
"width": 64,
|
||||||
"height": 64
|
"height": 64
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "Label",
|
|
||||||
"name": "playerName",
|
|
||||||
"x": 34,
|
|
||||||
"y": 70,
|
|
||||||
"width": 80,
|
|
||||||
"height": 24,
|
|
||||||
"font": "black"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "Label",
|
"type": "Label",
|
||||||
"name": "totalWins",
|
"name": "totalWins",
|
||||||
"x": 234,
|
"x": 144,
|
||||||
"y": 14,
|
"y": 56,
|
||||||
"width": 40,
|
"width": 26,
|
||||||
"height": 24,
|
"height": 24,
|
||||||
"font": "black"
|
"font": "black"
|
||||||
},
|
},
|
||||||
@@ -65,8 +56,8 @@
|
|||||||
"type": "Label",
|
"type": "Label",
|
||||||
"name": "wins",
|
"name": "wins",
|
||||||
"text": "Win:",
|
"text": "Win:",
|
||||||
"x": 170,
|
"x": 98,
|
||||||
"y": 14,
|
"y": 56,
|
||||||
"width": 60,
|
"width": 60,
|
||||||
"height": 24,
|
"height": 24,
|
||||||
"font": "black"
|
"font": "black"
|
||||||
@@ -74,9 +65,9 @@
|
|||||||
{
|
{
|
||||||
"type": "Label",
|
"type": "Label",
|
||||||
"name": "totalLoss",
|
"name": "totalLoss",
|
||||||
"x": 234,
|
"x": 144,
|
||||||
"y": 34,
|
"y": 68,
|
||||||
"width": 40,
|
"width": 26,
|
||||||
"height": 24,
|
"height": 24,
|
||||||
"font": "black"
|
"font": "black"
|
||||||
},
|
},
|
||||||
@@ -84,8 +75,8 @@
|
|||||||
"type": "Label",
|
"type": "Label",
|
||||||
"name": "loss",
|
"name": "loss",
|
||||||
"text": "Loss:",
|
"text": "Loss:",
|
||||||
"x": 170,
|
"x": 98,
|
||||||
"y": 34,
|
"y": 68,
|
||||||
"width": 60,
|
"width": 60,
|
||||||
"height": 24,
|
"height": 24,
|
||||||
"font": "black"
|
"font": "black"
|
||||||
@@ -93,9 +84,9 @@
|
|||||||
{
|
{
|
||||||
"type": "Label",
|
"type": "Label",
|
||||||
"name": "lossWinRatio",
|
"name": "lossWinRatio",
|
||||||
"x": 234,
|
"x": 144,
|
||||||
"y": 54,
|
"y": 80,
|
||||||
"width": 40,
|
"width": 26,
|
||||||
"height": 24,
|
"height": 24,
|
||||||
"font": "black"
|
"font": "black"
|
||||||
},
|
},
|
||||||
@@ -103,8 +94,8 @@
|
|||||||
"type": "Label",
|
"type": "Label",
|
||||||
"name": "winloss",
|
"name": "winloss",
|
||||||
"text": "Win Loss Ratio:",
|
"text": "Win Loss Ratio:",
|
||||||
"x": 170,
|
"x": 98,
|
||||||
"y": 54,
|
"y": 80,
|
||||||
"width": 60,
|
"width": 60,
|
||||||
"height": 24,
|
"height": 24,
|
||||||
"font": "black"
|
"font": "black"
|
||||||
@@ -118,12 +109,21 @@
|
|||||||
"x": 5,
|
"x": 5,
|
||||||
"y": 440
|
"y": 440
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "Label",
|
||||||
|
"name": "playerName",
|
||||||
|
"x": 98,
|
||||||
|
"y": 4,
|
||||||
|
"width": 80,
|
||||||
|
"height": 24,
|
||||||
|
"font": "black"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "Image",
|
"type": "Image",
|
||||||
"name": "lifeIcon",
|
"name": "lifeIcon",
|
||||||
"image": "ui/life.png",
|
"image": "ui/life.png",
|
||||||
"x": 104,
|
"x": 98,
|
||||||
"y": 40,
|
"y": 22,
|
||||||
"width": 16,
|
"width": 16,
|
||||||
"height": 16
|
"height": 16
|
||||||
},
|
},
|
||||||
@@ -131,8 +131,8 @@
|
|||||||
"type": "Image",
|
"type": "Image",
|
||||||
"name": "goldIcon",
|
"name": "goldIcon",
|
||||||
"image": "ui/money.png",
|
"image": "ui/money.png",
|
||||||
"x": 104,
|
"x": 98,
|
||||||
"y": 60,
|
"y": 42,
|
||||||
"width": 16,
|
"width": 16,
|
||||||
"height": 16
|
"height": 16
|
||||||
},
|
},
|
||||||
@@ -142,8 +142,8 @@
|
|||||||
"font": "black",
|
"font": "black",
|
||||||
"width": 64,
|
"width": 64,
|
||||||
"height": 16,
|
"height": 16,
|
||||||
"x": 124,
|
"x": 118,
|
||||||
"y": 40
|
"y": 22
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "Label",
|
"type": "Label",
|
||||||
@@ -151,8 +151,17 @@
|
|||||||
"font": "black",
|
"font": "black",
|
||||||
"width": 64,
|
"width": 64,
|
||||||
"height": 16,
|
"height": 16,
|
||||||
"x": 124,
|
"x": 118,
|
||||||
"y": 60
|
"y": 42
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Scroll",
|
||||||
|
"name": "blessingInfo",
|
||||||
|
"style": "nobg",
|
||||||
|
"x": 170,
|
||||||
|
"y": 14,
|
||||||
|
"width": 86,
|
||||||
|
"height": 80
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "Table",
|
"type": "Table",
|
||||||
|
|||||||
@@ -587,6 +587,14 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "Manasight Amulet",
|
||||||
|
"equipmentSlot": "Neck",
|
||||||
|
"iconName": "RelicAmulet",
|
||||||
|
"effect": {
|
||||||
|
"colorView": true
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "Amulet of Kroog",
|
"name": "Amulet of Kroog",
|
||||||
"equipmentSlot": "Neck",
|
"equipmentSlot": "Neck",
|
||||||
|
|||||||