update GameHUD, InventoryScene

- can equip activatable items for quick access on GameHUD
This commit is contained in:
Anthony Calosa
2023-04-14 02:49:09 +08:00
parent 1eca58c313
commit 8ccdabcdf6
22 changed files with 490 additions and 421 deletions

View File

@@ -26,7 +26,7 @@ import java.util.*;
* 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 {
public static final int NUMBER_OF_DECKS=10; public static final int NUMBER_OF_DECKS = 10;
// Player profile data. // Player profile data.
private String name; private String name;
private int heroRace; private int heroRace;
@@ -43,53 +43,57 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
// Game data. // Game data.
private float worldPosX; private float worldPosX;
private float worldPosY; private float worldPosY;
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 shards = 0; private int shards = 0;
private EffectData blessing; //Blessing to apply for next battle. private EffectData blessing; //Blessing to apply for next battle.
private final PlayerStatistic statistic = new PlayerStatistic(); private final PlayerStatistic statistic = new PlayerStatistic();
private final Map<String, Byte> questFlags = new HashMap<>(); private final Map<String, Byte> questFlags = new HashMap<>();
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<>();
private List<AdventureQuestData> quests= new ArrayList<>(); private final List<AdventureQuestData> quests = new ArrayList<>();
// Fantasy/Chaos mode settings. // Fantasy/Chaos mode settings.
private boolean fantasyMode = false; private boolean fantasyMode = false;
private boolean announceFantasy = false; private boolean announceFantasy = false;
private boolean usingCustomDeck = false; private boolean usingCustomDeck = false;
private boolean announceCustom = false; private boolean announceCustom = false;
// Signals // Signals
final SignalList onLifeTotalChangeList = new SignalList(); final SignalList onLifeTotalChangeList = new SignalList();
final SignalList onShardsChangeList = new SignalList(); final SignalList onShardsChangeList = new SignalList();
final SignalList onGoldChangeList = new SignalList(); final SignalList onGoldChangeList = new SignalList();
final SignalList onPlayerChangeList = new SignalList(); final SignalList onPlayerChangeList = new SignalList();
final SignalList onEquipmentChange = new SignalList(); final SignalList onEquipmentChange = new SignalList();
final SignalList onBlessing = new SignalList(); final SignalList onBlessing = new SignalList();
public AdventurePlayer() { clear(); } public AdventurePlayer() {
clear();
}
public PlayerStatistic getStatistic(){ return statistic; } public PlayerStatistic getStatistic() {
return statistic;
}
private void clearDecks() { private void clearDecks() {
for(int i=0; i < NUMBER_OF_DECKS; i++) decks[i] = new Deck("Empty Deck"); for (int i = 0; i < NUMBER_OF_DECKS; i++) decks[i] = new Deck("Empty Deck");
deck = decks[0]; deck = decks[0];
selectedDeckIndex = 0; selectedDeckIndex = 0;
} }
private void clear() { private void clear() {
//Ensure sensitive gameplay data is properly reset between games. //Ensure sensitive gameplay data is properly reset between games.
//Reset all properties HERE. //Reset all properties HERE.
fantasyMode = false; fantasyMode = false;
announceFantasy = false; announceFantasy = false;
usingCustomDeck = false; usingCustomDeck = false;
blessing = null; blessing = null;
gold = 0; gold = 0;
maxLife = 20; maxLife = 20;
life = 20; life = 20;
shards = 0; shards = 0;
clearDecks(); clearDecks();
inventoryItems.clear(); inventoryItems.clear();
equippedItems.clear(); equippedItems.clear();
@@ -105,33 +109,33 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
return WorldSave.getCurrentSave().getPlayer(); return WorldSave.getCurrentSave().getPlayer();
} }
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, boolean isFantasy, boolean isUsingCustomDeck, DifficultyData difficultyData) { public void create(String n, Deck startingDeck, boolean male, int race, int avatar, boolean isFantasy, boolean isUsingCustomDeck, DifficultyData difficultyData) {
clear(); clear();
announceFantasy = fantasyMode = isFantasy; //Set Chaos mode first. announceFantasy = fantasyMode = isFantasy; //Set Chaos mode first.
announceCustom = usingCustomDeck = isUsingCustomDeck; announceCustom = usingCustomDeck = isUsingCustomDeck;
deck = startingDeck; deck = startingDeck;
decks[0] = deck; decks[0] = deck;
cards.addAllFlat(deck.getAllCardsInASinglePool().toFlatList()); cards.addAllFlat(deck.getAllCardsInASinglePool().toFlatList());
this.difficultyData.startingLife = difficultyData.startingLife; this.difficultyData.startingLife = difficultyData.startingLife;
this.difficultyData.staringMoney = difficultyData.staringMoney; this.difficultyData.staringMoney = difficultyData.staringMoney;
this.difficultyData.startingDifficulty = difficultyData.startingDifficulty; this.difficultyData.startingDifficulty = difficultyData.startingDifficulty;
this.difficultyData.name = difficultyData.name; this.difficultyData.name = difficultyData.name;
this.difficultyData.spawnRank = difficultyData.spawnRank; this.difficultyData.spawnRank = difficultyData.spawnRank;
this.difficultyData.enemyLifeFactor = difficultyData.enemyLifeFactor; this.difficultyData.enemyLifeFactor = difficultyData.enemyLifeFactor;
this.difficultyData.sellFactor = difficultyData.sellFactor; this.difficultyData.sellFactor = difficultyData.sellFactor;
this.difficultyData.shardSellRatio = difficultyData.shardSellRatio; this.difficultyData.shardSellRatio = difficultyData.shardSellRatio;
gold = difficultyData.staringMoney; gold = difficultyData.staringMoney;
name = n; name = n;
heroRace = race; heroRace = race;
avatarIndex = avatar; avatarIndex = avatar;
isFemale = !male; isFemale = !male;
setColorIdentity(DeckProxy.getColorIdentity(deck)); setColorIdentity(DeckProxy.getColorIdentity(deck));
@@ -145,12 +149,13 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
} }
public void setSelectedDeckSlot(int slot) { public void setSelectedDeckSlot(int slot) {
if(slot>=0&&slot<NUMBER_OF_DECKS) { if (slot >= 0 && slot < NUMBER_OF_DECKS) {
selectedDeckIndex = slot; selectedDeckIndex = slot;
deck = decks[selectedDeckIndex]; deck = decks[selectedDeckIndex];
setColorIdentity(DeckProxy.getColorIdentity(deck)); setColorIdentity(DeckProxy.getColorIdentity(deck));
} }
} }
public void updateDifficulty(DifficultyData diff) { public void updateDifficulty(DifficultyData diff) {
maxLife = diff.startingLife; maxLife = diff.startingLife;
this.difficultyData.startingShards = diff.startingShards; this.difficultyData.startingShards = diff.startingShards;
@@ -166,28 +171,71 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
} }
//Getters //Getters
public int getSelectedDeckIndex() { return selectedDeckIndex; } public int getSelectedDeckIndex() {
public Deck getSelectedDeck() { return deck; } return selectedDeckIndex;
public Array<String> getItems() { return inventoryItems; } }
public Deck getDeck(int index) { return decks[index]; }
public CardPool getCards() { return cards; }
public String getName() { return name; }
public float getWorldPosX() { return worldPosX; }
public float getWorldPosY() { return worldPosY; }
public int getGold() { return gold; }
public int getLife() { return life; }
public int getMaxLife() { return maxLife; }
public int getShards() { return shards; }
public @Null EffectData getBlessing() { return blessing; }
public Collection<String> getEquippedItems() { return equippedItems.values(); } public Deck getSelectedDeck() {
public ItemPool<InventoryItem> getNewCards() { return newCards; } return deck;
}
public ColorSet getColorIdentity(){ public Array<String> getItems() {
return inventoryItems;
}
public Deck getDeck(int index) {
return decks[index];
}
public CardPool getCards() {
return cards;
}
public String getName() {
return name;
}
public float getWorldPosX() {
return worldPosX;
}
public float getWorldPosY() {
return worldPosY;
}
public int getGold() {
return gold;
}
public int getLife() {
return life;
}
public int getMaxLife() {
return maxLife;
}
public int getShards() {
return shards;
}
public @Null EffectData getBlessing() {
return blessing;
}
public Collection<String> getEquippedItems() {
return equippedItems.values();
}
public ItemPool<InventoryItem> getNewCards() {
return newCards;
}
public ColorSet getColorIdentity() {
return colorIdentity; return colorIdentity;
} }
public String getColorIdentityLong(){ public String getColorIdentityLong() {
return colorIdentity.toString(); return colorIdentity.toString();
} }
@@ -196,62 +244,61 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
public void setWorldPosX(float worldPosX) { public void setWorldPosX(float worldPosX) {
this.worldPosX = worldPosX; this.worldPosX = worldPosX;
} }
public void setWorldPosY(float worldPosY) { public void setWorldPosY(float worldPosY) {
this.worldPosY = worldPosY; this.worldPosY = worldPosY;
} }
public void setColorIdentity(String C){ public void setColorIdentity(String C) {
colorIdentity= ColorSet.fromNames(C.toCharArray()); colorIdentity = ColorSet.fromNames(C.toCharArray());
} }
public void setColorIdentity(ColorSet set){ public void setColorIdentity(ColorSet set) {
this.colorIdentity = set; this.colorIdentity = set;
} }
@Override @Override
public void load(SaveFileData data) { public void load(SaveFileData data) {
clear(); //Reset player data. clear(); //Reset player 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");
this.difficultyData.startingDifficulty=data.readBool("startingDifficulty"); this.difficultyData.startingDifficulty = data.readBool("startingDifficulty");
this.difficultyData.name=data.readString("difficultyName"); this.difficultyData.name = data.readString("difficultyName");
this.difficultyData.enemyLifeFactor=data.readFloat("enemyLifeFactor"); this.difficultyData.enemyLifeFactor = data.readFloat("enemyLifeFactor");
this.difficultyData.sellFactor=data.readFloat("sellFactor"); this.difficultyData.sellFactor = data.readFloat("sellFactor");
if(this.difficultyData.sellFactor==0) if (this.difficultyData.sellFactor == 0)
this.difficultyData.sellFactor=0.2f; this.difficultyData.sellFactor = 0.2f;
this.difficultyData.shardSellRatio=data.readFloat("sellFactor"); this.difficultyData.shardSellRatio = data.readFloat("sellFactor");
if(this.difficultyData.shardSellRatio==0) if (this.difficultyData.shardSellRatio == 0)
this.difficultyData.shardSellRatio=0.8f; this.difficultyData.shardSellRatio = 0.8f;
name = data.readString("name"); name = data.readString("name");
heroRace = data.readInt("heroRace"); heroRace = data.readInt("heroRace");
avatarIndex = data.readInt("avatarIndex"); avatarIndex = data.readInt("avatarIndex");
isFemale = data.readBool("isFemale"); isFemale = data.readBool("isFemale");
if(data.containsKey("colorIdentity")) if (data.containsKey("colorIdentity"))
setColorIdentity(data.readString("colorIdentity")); setColorIdentity(data.readString("colorIdentity"));
else else
colorIdentity = ColorSet.ALL_COLORS; colorIdentity = ColorSet.ALL_COLORS;
gold = data.readInt("gold"); gold = data.readInt("gold");
maxLife = data.readInt("maxLife"); maxLife = data.readInt("maxLife");
life = data.readInt("life"); life = data.readInt("life");
shards = data.containsKey("shards")?data.readInt("shards"):0; shards = data.containsKey("shards") ? data.readInt("shards") : 0;
worldPosX = data.readFloat("worldPosX"); worldPosX = data.readFloat("worldPosX");
worldPosY = data.readFloat("worldPosY"); worldPosY = data.readFloat("worldPosY");
if(data.containsKey("blessing")) blessing = (EffectData)data.readObject("blessing"); if (data.containsKey("blessing")) blessing = (EffectData) data.readObject("blessing");
if(data.containsKey("inventory")) { if (data.containsKey("inventory")) {
String[] inv=(String[])data.readObject("inventory"); String[] inv = (String[]) data.readObject("inventory");
//Prevent items with wrong names from getting through. Hell breaks loose if it causes null pointers. //Prevent items with wrong names from getting through. Hell breaks loose if it causes null pointers.
//This only needs to be done on load. //This only needs to be done on load.
for(String i : inv){ for (String i : inv) {
if(ItemData.getItem(i) != null) inventoryItems.add(i); if (ItemData.getItem(i) != null) inventoryItems.add(i);
else { else {
System.err.printf("Cannot find item name %s\n", i); System.err.printf("Cannot find item name %s\n", i);
//Allow official© permission for the player to get a refund. We will allow it this time. //Allow official© permission for the player to get a refund. We will allow it this time.
@@ -260,15 +307,15 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
} }
} }
} }
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);
//Like above, prevent items with wrong names. If it triggered in inventory it'll trigger here as well. //Like above, prevent items with wrong names. If it triggered in inventory it'll trigger here as well.
for(int i=0;i<slots.length;i++) { for (int i = 0; i < slots.length; i++) {
if(ItemData.getItem(items[i]) != null) if (ItemData.getItem(items[i]) != null)
equippedItems.put(slots[i],items[i]); equippedItems.put(slots[i], items[i]);
else { else {
System.err.printf("Cannot find equip name %s\n", items[i]); System.err.printf("Cannot find equip name %s\n", items[i]);
} }
@@ -276,19 +323,19 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
} }
deck = new Deck(data.readString("deckName")); deck = new Deck(data.readString("deckName"));
deck.getMain().addAll(CardPool.fromCardList(Lists.newArrayList((String[])data.readObject("deckCards")))); deck.getMain().addAll(CardPool.fromCardList(Lists.newArrayList((String[]) data.readObject("deckCards"))));
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"))));
if(data.containsKey("questFlagsKey") && data.containsKey("questFlagsValue")){ if (data.containsKey("questFlagsKey") && data.containsKey("questFlagsValue")) {
String[] keys = (String[]) data.readObject("questFlagsKey"); String[] keys = (String[]) data.readObject("questFlagsKey");
Byte[] values = (Byte[]) data.readObject("questFlagsValue"); Byte[] values = (Byte[]) data.readObject("questFlagsValue");
assert( keys.length == values.length ); assert (keys.length == values.length);
for( int i = 0; i < keys.length; i++){ for (int i = 0; i < keys.length; i++) {
questFlags.put(keys[i], values[i]); questFlags.put(keys[i], values[i]);
} }
} }
if(data.containsKey("quests")){ if (data.containsKey("quests")) {
quests.clear(); quests.clear();
Object[] q = (Object[]) data.readObject("quests"); Object[] q = (Object[]) data.readObject("quests");
if (q != null) { if (q != null) {
@@ -297,24 +344,24 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
} }
} }
for(int i=0;i<NUMBER_OF_DECKS;i++) { for (int i = 0; i < NUMBER_OF_DECKS; i++) {
if(!data.containsKey("deck_name_" + i)) { if (!data.containsKey("deck_name_" + i)) {
if(i==0) decks[i] = deck; if (i == 0) decks[i] = deck;
else decks[i] = new Deck("Empty Deck"); else decks[i] = new Deck("Empty Deck");
continue; continue;
} }
decks[i] = new Deck(data.readString("deck_name_"+i)); decks[i] = new Deck(data.readString("deck_name_" + i));
decks[i].getMain().addAll(CardPool.fromCardList(Lists.newArrayList((String[])data.readObject("deck_"+i)))); decks[i].getMain().addAll(CardPool.fromCardList(Lists.newArrayList((String[]) data.readObject("deck_" + i))));
if(data.containsKey("sideBoardCards_"+i)) if (data.containsKey("sideBoardCards_" + i))
decks[i].getOrCreate(DeckSection.Sideboard).addAll(CardPool.fromCardList(Lists.newArrayList((String[])data.readObject("sideBoardCards_"+i)))); decks[i].getOrCreate(DeckSection.Sideboard).addAll(CardPool.fromCardList(Lists.newArrayList((String[]) data.readObject("sideBoardCards_" + i))));
} }
setSelectedDeckSlot(data.readInt("selectedDeckIndex")); setSelectedDeckSlot(data.readInt("selectedDeckIndex"));
cards.addAll(CardPool.fromCardList(Lists.newArrayList((String[])data.readObject("cards")))); cards.addAll(CardPool.fromCardList(Lists.newArrayList((String[]) data.readObject("cards"))));
fantasyMode = data.containsKey("fantasyMode") ? data.readBool("fantasyMode") : false; fantasyMode = data.containsKey("fantasyMode") && data.readBool("fantasyMode");
announceFantasy = data.containsKey("announceFantasy") ? data.readBool("announceFantasy") : false; announceFantasy = data.containsKey("announceFantasy") && data.readBool("announceFantasy");
usingCustomDeck = data.containsKey("usingCustomDeck") ? data.readBool("usingCustomDeck") : false; usingCustomDeck = data.containsKey("usingCustomDeck") && data.readBool("usingCustomDeck");
announceCustom = data.containsKey("announceCustom") ? data.readBool("announceCustom") : false; announceCustom = data.containsKey("announceCustom") && data.readBool("announceCustom");
onLifeTotalChangeList.emit(); onLifeTotalChangeList.emit();
onShardsChangeList.emit(); onShardsChangeList.emit();
@@ -324,53 +371,53 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
@Override @Override
public SaveFileData save() { public SaveFileData save() {
SaveFileData data= new SaveFileData(); SaveFileData data = new SaveFileData();
data.store("statistic",this.statistic.save()); data.store("statistic", this.statistic.save());
data.store("startingLife",this.difficultyData.startingLife); data.store("startingLife", this.difficultyData.startingLife);
data.store("staringMoney",this.difficultyData.staringMoney); data.store("staringMoney", this.difficultyData.staringMoney);
data.store("startingDifficulty",this.difficultyData.startingDifficulty); data.store("startingDifficulty", this.difficultyData.startingDifficulty);
data.store("difficultyName",this.difficultyData.name); data.store("difficultyName", this.difficultyData.name);
data.store("enemyLifeFactor",this.difficultyData.enemyLifeFactor); data.store("enemyLifeFactor", this.difficultyData.enemyLifeFactor);
data.store("sellFactor",this.difficultyData.sellFactor); data.store("sellFactor", this.difficultyData.sellFactor);
data.store("shardSellRatio", this.difficultyData.shardSellRatio); data.store("shardSellRatio", this.difficultyData.shardSellRatio);
data.store("name",name); data.store("name", name);
data.store("heroRace",heroRace); data.store("heroRace", heroRace);
data.store("avatarIndex",avatarIndex); data.store("avatarIndex", avatarIndex);
data.store("isFemale",isFemale); data.store("isFemale", isFemale);
data.store("colorIdentity", colorIdentity.getColor()); data.store("colorIdentity", colorIdentity.getColor());
data.store("fantasyMode",fantasyMode); data.store("fantasyMode", fantasyMode);
data.store("announceFantasy",announceFantasy); data.store("announceFantasy", announceFantasy);
data.store("usingCustomDeck", usingCustomDeck); data.store("usingCustomDeck", usingCustomDeck);
data.store("announceCustom", announceCustom); data.store("announceCustom", announceCustom);
data.store("worldPosX",worldPosX); data.store("worldPosX", worldPosX);
data.store("worldPosY",worldPosY); data.store("worldPosY", worldPosY);
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("shards",shards); data.store("shards", shards);
data.store("deckName",deck.getName()); data.store("deckName", deck.getName());
data.storeObject("inventory",inventoryItems.toArray(String.class)); data.storeObject("inventory", inventoryItems.toArray(String.class));
ArrayList<String> slots=new ArrayList<>(); ArrayList<String> slots = new ArrayList<>();
ArrayList<String> items=new ArrayList<>(); ArrayList<String> items = new ArrayList<>();
for (Map.Entry<String,String> entry : equippedItems.entrySet()) { for (Map.Entry<String, String> entry : equippedItems.entrySet()) {
slots.add(entry.getKey()); slots.add(entry.getKey());
items.add(entry.getValue()); items.add(entry.getValue());
} }
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]));
data.storeObject("blessing", blessing); data.storeObject("blessing", blessing);
//Save quest flags. //Save quest flags.
ArrayList<String> questFlagsKey = new ArrayList<>(); ArrayList<String> questFlagsKey = new ArrayList<>();
ArrayList<Byte> questFlagsValue = new ArrayList<>(); ArrayList<Byte> questFlagsValue = new ArrayList<>();
for(Map.Entry<String, Byte> entry : questFlags.entrySet()){ for (Map.Entry<String, Byte> entry : questFlags.entrySet()) {
questFlagsKey.add(entry.getKey()); questFlagsKey.add(entry.getKey());
questFlagsValue.add(entry.getValue()); questFlagsValue.add(entry.getValue());
} }
@@ -378,17 +425,17 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
data.storeObject("questFlagsValue", questFlagsValue.toArray(new Byte[0])); data.storeObject("questFlagsValue", questFlagsValue.toArray(new Byte[0]));
data.storeObject("quests", quests.toArray()); data.storeObject("quests", quests.toArray());
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)
data.storeObject("sideBoardCards",deck.get(DeckSection.Sideboard).toCardList("\n").split("\n")); data.storeObject("sideBoardCards", deck.get(DeckSection.Sideboard).toCardList("\n").split("\n"));
for(int i=0;i<NUMBER_OF_DECKS;i++) { for (int i = 0; i < NUMBER_OF_DECKS; i++) {
data.store("deck_name_"+i,decks[i].getName()); data.store("deck_name_" + i, decks[i].getName());
data.storeObject("deck_"+i,decks[i].getMain().toCardList("\n").split("\n")); data.storeObject("deck_" + i, decks[i].getMain().toCardList("\n").split("\n"));
if(decks[i].get(DeckSection.Sideboard)!=null) if (decks[i].get(DeckSection.Sideboard) != null)
data.storeObject("sideBoardCards_"+i,decks[i].get(DeckSection.Sideboard).toCardList("\n").split("\n")); data.storeObject("sideBoardCards_" + i, decks[i].get(DeckSection.Sideboard).toCardList("\n").split("\n"));
} }
data.store("selectedDeckIndex",selectedDeckIndex); data.store("selectedDeckIndex", selectedDeckIndex);
data.storeObject("cards",cards.toCardList("\n").split("\n")); data.storeObject("cards", cards.toCardList("\n").split("\n"));
return data; return data;
} }
@@ -420,7 +467,7 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
addGold(reward.getCount()); addGold(reward.getCount());
break; break;
case Item: case Item:
if(reward.getItem()!=null) if (reward.getItem() != null)
inventoryItems.add(reward.getItem().name); inventoryItems.add(reward.getItem().name);
break; break;
case Life: case Life:
@@ -433,29 +480,31 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
} }
private void addGold(int goldCount) { private void addGold(int goldCount) {
gold+=goldCount; gold += goldCount;
onGoldChangeList.emit(); onGoldChangeList.emit();
} }
public void onShardsChange(Runnable o) {
public void onShardsChange(Runnable o) {
onShardsChangeList.add(o); onShardsChangeList.add(o);
o.run(); o.run();
} }
public void onLifeChange(Runnable o) { public void onLifeChange(Runnable o) {
onLifeTotalChangeList.add(o); onLifeTotalChangeList.add(o);
o.run(); o.run();
} }
public void onPlayerChanged(Runnable o) {
public void onPlayerChanged(Runnable o) {
onPlayerChangeList.add(o); onPlayerChangeList.add(o);
o.run(); o.run();
} }
public void onEquipmentChanged(Runnable o) { public void onEquipmentChanged(Runnable o) {
onEquipmentChange.add(o); onEquipmentChange.add(o);
o.run(); o.run();
} }
public void onGoldChange(Runnable o) { public void onGoldChange(Runnable o) {
onGoldChangeList.add(o); onGoldChangeList.add(o);
o.run(); o.run();
} }
@@ -489,46 +538,55 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
} }
public int falseLifeCost() { public int falseLifeCost() {
int ret = 200 + (int)(50 * getStatistic().winLossRatio()); int ret = 200 + (int) (50 * getStatistic().winLossRatio());
return ret < 0?250:ret; return ret < 0 ? 250 : ret;
} }
public void heal(int amount) { public void heal(int amount) {
life = Math.min(life + amount, maxLife); life = Math.min(life + amount, maxLife);
onLifeTotalChangeList.emit(); onLifeTotalChangeList.emit();
} }
public void heal(float percent) { public void heal(float percent) {
life = Math.min(life + (int)(maxLife*percent), maxLife); life = Math.min(life + (int) (maxLife * percent), maxLife);
onLifeTotalChangeList.emit(); onLifeTotalChangeList.emit();
} }
public boolean defeated() { public boolean defeated() {
gold= (int) (gold-(gold*difficultyData.goldLoss)); gold = (int) (gold - (gold * difficultyData.goldLoss));
int newLife=(int)(life-(maxLife*difficultyData.lifeLoss)); int newLife = (int) (life - (maxLife * difficultyData.lifeLoss));
life=Math.max(1,newLife); life = Math.max(1, newLife);
onLifeTotalChangeList.emit(); onLifeTotalChangeList.emit();
onGoldChangeList.emit(); onGoldChangeList.emit();
return newLife < 1; return newLife < 1;
//If true, the player would have had 0 or less, and thus is actually "defeated" if the caller cares about it //If true, the player would have had 0 or less, and thus is actually "defeated" if the caller cares about it
} }
public void win() { public void win() {
Current.player().addShards(1); Current.player().addShards(1);
} }
public void addMaxLife(int count) { public void addMaxLife(int count) {
maxLife += count; maxLife += count;
life += count; life += count;
onLifeTotalChangeList.emit(); onLifeTotalChangeList.emit();
} }
public void giveGold(int price) { public void giveGold(int price) {
takeGold(-price); takeGold(-price);
} }
public void takeGold(int price) { public void takeGold(int price) {
gold -= price; gold -= price;
onGoldChangeList.emit(); onGoldChangeList.emit();
//play sfx //play sfx
SoundSystem.instance.play(SoundEffectType.CoinsDrop, false); SoundSystem.instance.play(SoundEffectType.CoinsDrop, false);
} }
public void addShards(int number) { public void addShards(int number) {
takeShards(-number); takeShards(-number);
} }
public void takeShards(int number) { public void takeShards(int number) {
shards -= number; shards -= number;
onShardsChangeList.emit(); onShardsChangeList.emit();
@@ -541,7 +599,7 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
onShardsChangeList.emit(); onShardsChangeList.emit();
} }
public void addBlessing(EffectData bless){ public void addBlessing(EffectData bless) {
blessing = bless; blessing = bless;
onBlessing.emit(); onBlessing.emit();
} }
@@ -551,53 +609,76 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
onBlessing.emit(); onBlessing.emit();
} }
public boolean hasBlessing(String name){ //Checks for a named 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. //It is not necessary to name all blessings, only the ones you'd want to check for.
if(blessing == null) return false; if (blessing == null) return false;
if(blessing.name.equals(name)) return true; return blessing.name.equals(name);
return false;
} }
public boolean isFantasyMode(){ public boolean isFantasyMode() {
return fantasyMode; return fantasyMode;
} }
public boolean isUsingCustomDeck(){
public boolean isUsingCustomDeck() {
return usingCustomDeck; return usingCustomDeck;
} }
public boolean hasAnnounceFantasy(){ public boolean hasAnnounceFantasy() {
return announceFantasy; return announceFantasy;
} }
public void clearAnnounceFantasy(){ public void clearAnnounceFantasy() {
announceFantasy = false; announceFantasy = false;
} }
public boolean hasAnnounceCustom(){
public boolean hasAnnounceCustom() {
return announceCustom; return announceCustom;
} }
public void clearAnnounceCustom(){
public void clearAnnounceCustom() {
announceCustom = false; announceCustom = false;
} }
public boolean hasColorView() { public boolean hasColorView() {
for(String name:equippedItems.values()) { for (String name : equippedItems.values()) {
ItemData data=ItemData.getItem(name); ItemData data = ItemData.getItem(name);
if(data != null && data.effect.colorView) return true; if (data != null && data.effect != null && data.effect.colorView) return true;
} }
if(blessing != null) { if (blessing != null) {
if(blessing.colorView) return true; return blessing.colorView;
} }
return false; return false;
} }
public ItemData getEquippedAbility1() {
for (String name : equippedItems.values()) {
ItemData data = ItemData.getItem(name);
if (data != null && "Ability1".equalsIgnoreCase(data.equipmentSlot)) {
return data;
}
}
return null;
}
public ItemData getEquippedAbility2() {
for (String name : equippedItems.values()) {
ItemData data = ItemData.getItem(name);
if (data != null && "Ability2".equalsIgnoreCase(data.equipmentSlot)) {
return data;
}
}
return null;
}
public int bonusDeckCards() { public int bonusDeckCards() {
int result = 0; int result = 0;
for(String name:equippedItems.values()) { for (String name : equippedItems.values()) {
ItemData data=ItemData.getItem(name); ItemData data = ItemData.getItem(name);
if(data != null && data.effect.cardRewardBonus > 0) result += data.effect.cardRewardBonus; if (data != null && data.effect != null && data.effect.cardRewardBonus > 0)
result += data.effect.cardRewardBonus;
} }
if(blessing != null) { if (blessing != null) {
if(blessing.cardRewardBonus > 0) result += blessing.cardRewardBonus; if (blessing.cardRewardBonus > 0) result += blessing.cardRewardBonus;
} }
return Math.min(result, 3); return Math.min(result, 3);
} }
@@ -606,50 +687,52 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
return difficultyData; return difficultyData;
} }
public void renameDeck( String text) { public void renameDeck(String text) {
deck = (Deck)deck.copyTo(text); deck = (Deck) deck.copyTo(text);
decks[selectedDeckIndex]=deck; decks[selectedDeckIndex] = deck;
} }
public int cardSellPrice(PaperCard card) { public int cardSellPrice(PaperCard card) {
return (int)(CardUtil.getCardPrice(card)*difficultyData.sellFactor); return (int) (CardUtil.getCardPrice(card) * difficultyData.sellFactor);
} }
public void sellCard(PaperCard card, Integer result) { public void sellCard(PaperCard card, Integer result) {
float price = CardUtil.getCardPrice(card) * result; float price = CardUtil.getCardPrice(card) * result;
price *= difficultyData.sellFactor; price *= difficultyData.sellFactor;
cards.remove(card, result); cards.remove(card, result);
addGold((int)price); addGold((int) price);
} }
public void removeItem(String name) { public void removeItem(String name) {
if(name == null || name.equals("")) return; if (name == null || name.equals("")) return;
inventoryItems.removeValue(name,false); inventoryItems.removeValue(name, false);
if(equippedItems.values().contains(name) && !inventoryItems.contains(name,false)) { if (equippedItems.values().contains(name) && !inventoryItems.contains(name, false)) {
equippedItems.values().remove(name); equippedItems.values().remove(name);
} }
} }
public void equip(ItemData item) { public void equip(ItemData item) {
if(equippedItems.get(item.equipmentSlot) != null && equippedItems.get(item.equipmentSlot).equals(item.name)) { if (equippedItems.get(item.equipmentSlot) != null && equippedItems.get(item.equipmentSlot).equals(item.name)) {
equippedItems.remove(item.equipmentSlot); equippedItems.remove(item.equipmentSlot);
} else { } else {
equippedItems.put(item.equipmentSlot,item.name); equippedItems.put(item.equipmentSlot, item.name);
} }
onEquipmentChange.emit(); onEquipmentChange.emit();
} }
public String itemInSlot(String key) { return equippedItems.get(key); } public String itemInSlot(String key) {
return equippedItems.get(key);
}
public float equipmentSpeed() { public float equipmentSpeed() {
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 != null && data.effect.moveSpeed > 0.0) //Avoid negative speeds. It would be silly. if (data != null && data.effect != 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 != null) { //If a blessing gives speed, take it into account.
if(blessing.moveSpeed > 0.0) if (blessing.moveSpeed > 0.0)
factor *= blessing.moveSpeed; factor *= blessing.moveSpeed;
} }
return factor; return factor;
@@ -657,19 +740,20 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
public float goldModifier(boolean sale) { public float goldModifier(boolean sale) {
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 != null && data.effect.goldModifier > 0.0) //Avoid negative modifiers. if (data != null && data.effect != null && data.effect.goldModifier > 0.0) //Avoid negative modifiers.
factor *= data.effect.goldModifier; factor *= data.effect.goldModifier;
} }
if(blessing != null) { //If a blessing gives speed, take it into account. if (blessing != null) { //If a blessing gives speed, take it into account.
if(blessing.goldModifier > 0.0) if (blessing.goldModifier > 0.0)
factor *= blessing.goldModifier; factor *= blessing.goldModifier;
} }
if(sale) return Math.max(1.0f + (1.0f - factor), 2.5f); if (sale) return Math.max(1.0f + (1.0f - factor), 2.5f);
return Math.max(factor, 0.25f); return Math.max(factor, 0.25f);
} }
public float goldModifier(){
public float goldModifier() {
return goldModifier(false); return goldModifier(false);
} }
@@ -678,8 +762,8 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
} }
public boolean addItem(String name) { public boolean addItem(String name) {
ItemData item=ItemData.getItem(name); ItemData item = ItemData.getItem(name);
if(item==null) if (item == null)
return false; return false;
inventoryItems.add(name); inventoryItems.add(name);
return true; return true;
@@ -687,45 +771,48 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
// Quest functions. // Quest functions.
public void setQuestFlag(String key, int value){ public void setQuestFlag(String key, int value) {
questFlags.put(key, (byte) value); questFlags.put(key, (byte) value);
} }
public void advanceQuestFlag(String key){
if(questFlags.get(key) != null){ public void advanceQuestFlag(String key) {
if (questFlags.get(key) != null) {
questFlags.put(key, (byte) (questFlags.get(key) + 1)); questFlags.put(key, (byte) (questFlags.get(key) + 1));
} else { } else {
questFlags.put(key, (byte) 1); questFlags.put(key, (byte) 1);
} }
} }
public boolean checkQuestFlag(String key){
public boolean checkQuestFlag(String key) {
return questFlags.get(key) != null; return questFlags.get(key) != null;
} }
public int getQuestFlag(String key){
public int getQuestFlag(String key) {
return (int) questFlags.getOrDefault(key, (byte) 0); return (int) questFlags.getOrDefault(key, (byte) 0);
} }
public void resetQuestFlags(){
public void resetQuestFlags() {
questFlags.clear(); questFlags.clear();
} }
public void addQuest(String questID){ public void addQuest(String questID) {
int id = Integer.parseInt(questID); int id = Integer.parseInt(questID);
addQuest(id); addQuest(id);
} }
public void addQuest(int questID){ public void addQuest(int questID) {
AdventureQuestData toAdd = AdventureQuestController.instance().generateQuest(questID); AdventureQuestData toAdd = AdventureQuestController.instance().generateQuest(questID);
if (toAdd != null){ if (toAdd != null) {
addQuest(toAdd); addQuest(toAdd);
} }
} }
public void addQuest(AdventureQuestData q){ public void addQuest(AdventureQuestData q) {
//TODO: add a config flag for this //TODO: add a config flag for this
boolean autoTrack = true; boolean autoTrack = true;
for (AdventureQuestData existing : quests){ for (AdventureQuestData existing : quests) {
if (autoTrack && existing.isTracked) if (autoTrack && existing.isTracked) {
{
autoTrack = false; autoTrack = false;
break; break;
} }
@@ -738,23 +825,21 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
return quests; return quests;
} }
public int getEnemyDeckNumber(String enemyName, int maxDecks){ public int getEnemyDeckNumber(String enemyName, int maxDecks) {
int deckNumber = 0; int deckNumber = 0;
if (statistic.getWinLossRecord().get(enemyName)!=null) if (statistic.getWinLossRecord().get(enemyName) != null) {
{ int playerWins = statistic.getWinLossRecord().get(enemyName).getKey();
int playerWins = statistic.getWinLossRecord().get(enemyName).getKey(); int enemyWins = statistic.getWinLossRecord().get(enemyName).getValue();
int enemyWins = statistic.getWinLossRecord().get(enemyName).getValue(); if (playerWins > enemyWins) {
if (playerWins > enemyWins){ int deckNumberAfterAlgorithmOutput = (int) ((playerWins - enemyWins) * (difficultyData.enemyLifeFactor / 3));
int deckNumberAfterAlgorithmOutput = (int)((playerWins-enemyWins) * (difficultyData.enemyLifeFactor / 3)); if (deckNumberAfterAlgorithmOutput < maxDecks) {
if (deckNumberAfterAlgorithmOutput < maxDecks){ deckNumber = deckNumberAfterAlgorithmOutput;
deckNumber = deckNumberAfterAlgorithmOutput; } else {
} deckNumber = maxDecks - 1;
else { }
deckNumber = maxDecks-1;
} }
} }
} return deckNumber;
return deckNumber;
} }
public void removeQuest(AdventureQuestData quest) { public void removeQuest(AdventureQuestData quest) {

View File

@@ -39,11 +39,11 @@ public class InventoryScene extends UIScene {
public InventoryScene() { public InventoryScene() {
super(Forge.isLandscapeMode() ? "ui/inventory.json" : "ui/inventory_portrait.json"); super(Forge.isLandscapeMode() ? "ui/inventory.json" : "ui/inventory_portrait.json");
equipOverlay = Forge.getAssets().getTexture(Config.instance().getFile(Paths.ITEMS_EQUIP)); equipOverlay = Forge.getAssets().getTexture(Config.instance().getFile(Paths.ITEMS_EQUIP));
ui.onButtonPress("return", () -> done()); ui.onButtonPress("return", this::done);
leave = ui.findActor("return"); leave = ui.findActor("return");
ui.onButtonPress("delete", () -> showConfirm()); ui.onButtonPress("delete", this::showConfirm);
ui.onButtonPress("equip", () -> equip()); ui.onButtonPress("equip", this::equip);
ui.onButtonPress("use", () -> use()); ui.onButtonPress("use", this::use);
equipButton = ui.findActor("equip"); equipButton = ui.findActor("equip");
useButton = ui.findActor("use"); useButton = ui.findActor("use");
useButton.setDisabled(true); useButton.setDisabled(true);
@@ -299,7 +299,6 @@ public class InventoryScene extends UIScene {
} }
public Button createInventorySlot() { public Button createInventorySlot() {
ImageButton button = new ImageButton(Controls.getSkin(), "item_frame"); return new ImageButton(Controls.getSkin(), "item_frame");
return button;
} }
} }

View File

@@ -1,6 +1,5 @@
package forge.adventure.scene; package forge.adventure.scene;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.scenes.scene2d.Group; import com.badlogic.gdx.scenes.scene2d.Group;
import com.badlogic.gdx.scenes.scene2d.ui.Image; import com.badlogic.gdx.scenes.scene2d.ui.Image;
@@ -32,7 +31,7 @@ public class MapViewScene extends UIScene {
super(Forge.isLandscapeMode() ? "ui/map.json" : "ui/map_portrait.json"); super(Forge.isLandscapeMode() ? "ui/map.json" : "ui/map_portrait.json");
ui.onButtonPress("done", () -> done()); ui.onButtonPress("done", this::done);
scroll = ui.findActor("map"); scroll = ui.findActor("map");
Group table=new Group(); Group table=new Group();
@@ -78,13 +77,4 @@ public class MapViewScene extends UIScene {
super.enter(); super.enter();
} }
@Override
public boolean keyPressed(int keycode) {
if (keycode == Input.Keys.ESCAPE || keycode == Input.Keys.BACK || keycode == Input.Keys.BUTTON_B) {
done();
}
return true;
}
} }

View File

@@ -22,12 +22,12 @@ import com.github.tommyettinger.textra.TextraButton;
import com.github.tommyettinger.textra.TextraLabel; import com.github.tommyettinger.textra.TextraLabel;
import com.github.tommyettinger.textra.TypingLabel; import com.github.tommyettinger.textra.TypingLabel;
import forge.Forge; import forge.Forge;
import forge.adventure.data.ItemData;
import forge.adventure.player.AdventurePlayer; import forge.adventure.player.AdventurePlayer;
import forge.adventure.scene.*; import forge.adventure.scene.*;
import forge.adventure.util.*; import forge.adventure.util.*;
import forge.adventure.world.WorldSave; import forge.adventure.world.WorldSave;
import forge.deck.Deck; import forge.deck.Deck;
import forge.gui.FThreads;
import forge.gui.GuiBase; import forge.gui.GuiBase;
import forge.localinstance.properties.ForgePreferences; import forge.localinstance.properties.ForgePreferences;
import forge.model.FModel; import forge.model.FModel;
@@ -51,16 +51,15 @@ public class GameHUD extends Stage {
private final Touchpad touchpad; private final Touchpad touchpad;
private final Console console; private final Console console;
float TOUCHPAD_SCALE = 70f, referenceX; float TOUCHPAD_SCALE = 70f, referenceX;
boolean isHiding = false, isShowing = false;
float opacity = 1f; float opacity = 1f;
private boolean debugMap, updatelife; private boolean debugMap, updatelife;
private final Dialog dialog; private final Dialog dialog;
private boolean dialogOnlyInput; private boolean dialogOnlyInput;
private final Array<TextraButton> dialogButtonMap = new Array<>(); private final Array<TextraButton> dialogButtonMap = new Array<>();
private final Array<TextraButton> abilityButtonMap = new Array<>();
private final Array<String> questKeys = new Array<>(); private final Array<String> questKeys = new Array<>();
private String lifepointsTextColor = ""; private String lifepointsTextColor = "";
private TextraButton selectedKey;
private final ScrollPane scrollPane; private final ScrollPane scrollPane;
private GameHUD(GameStage gameStage) { private GameHUD(GameStage gameStage) {
@@ -68,9 +67,7 @@ public class GameHUD extends Stage {
instance = this; instance = this;
this.gameStage = gameStage; this.gameStage = gameStage;
ui = new UIActor(Config.instance().getFile(GuiBase.isAndroid() ui = new UIActor(Config.instance().getFile(Forge.isLandscapeMode() ? "ui/hud_landscape.json" : "ui/hud_portrait.json"));
? Forge.isLandscapeMode() ? "ui/hud_landscape.json" : "ui/hud_portrait.json"
: Forge.isLandscapeMode() ? "ui/hud.json" : "ui/hud_portrait.json"));
blank = ui.findActor("blank"); blank = ui.findActor("blank");
@@ -80,7 +77,7 @@ public class GameHUD extends Stage {
avatarborder = ui.findActor("avatarborder"); avatarborder = ui.findActor("avatarborder");
deckActor = ui.findActor("deck"); deckActor = ui.findActor("deck");
openMapActor = ui.findActor("openmap"); openMapActor = ui.findActor("openmap");
ui.onButtonPress("openmap", () -> GameHUD.this.openMap()); ui.onButtonPress("openmap", this::openMap);
menuActor = ui.findActor("menu"); menuActor = ui.findActor("menu");
referenceX = menuActor.getX(); referenceX = menuActor.getX();
logbookActor = ui.findActor("logbook"); logbookActor = ui.findActor("logbook");
@@ -113,11 +110,11 @@ public class GameHUD extends Stage {
ui.addActor(touchpad); ui.addActor(touchpad);
avatar = ui.findActor("avatar"); avatar = ui.findActor("avatar");
ui.onButtonPress("menu", () -> menu()); ui.onButtonPress("menu", this::menu);
ui.onButtonPress("inventory", () -> openInventory()); ui.onButtonPress("inventory", this::openInventory);
ui.onButtonPress("logbook", () -> logbook()); ui.onButtonPress("logbook", this::logbook);
ui.onButtonPress("deck", () -> openDeck()); ui.onButtonPress("deck", this::openDeck);
ui.onButtonPress("exittoworldmap", () -> exitToWorldMap()); ui.onButtonPress("exittoworldmap", this::exitToWorldMap);
lifePoints = ui.findActor("lifePoints"); lifePoints = ui.findActor("lifePoints");
shards = ui.findActor("shards"); shards = ui.findActor("shards");
money = ui.findActor("money"); money = ui.findActor("money");
@@ -131,6 +128,7 @@ public class GameHUD extends Stage {
addActor(scrollPane); addActor(scrollPane);
AdventurePlayer.current().onLifeChange(() -> lifePoints.setText("[%95][+Life]" + lifepointsTextColor + " " + AdventurePlayer.current().getLife() + "/" + AdventurePlayer.current().getMaxLife())); AdventurePlayer.current().onLifeChange(() -> lifePoints.setText("[%95][+Life]" + lifepointsTextColor + " " + AdventurePlayer.current().getLife() + "/" + AdventurePlayer.current().getMaxLife()));
AdventurePlayer.current().onShardsChange(() -> shards.setText("[%95][+Shards] " + AdventurePlayer.current().getShards())); AdventurePlayer.current().onShardsChange(() -> shards.setText("[%95][+Shards] " + AdventurePlayer.current().getShards()));
AdventurePlayer.current().onEquipmentChanged(this::updateAbility);
WorldSave.getCurrentSave().getPlayer().onGoldChange(() -> money.setText("[%95][+Gold] " + String.valueOf(AdventurePlayer.current().getGold()))); WorldSave.getCurrentSave().getPlayer().onGoldChange(() -> money.setText("[%95][+Gold] " + String.valueOf(AdventurePlayer.current().getGold())));
addActor(ui); addActor(ui);
@@ -144,7 +142,7 @@ public class GameHUD extends Stage {
avatarborder.addListener(new ConsoleToggleListener()); avatarborder.addListener(new ConsoleToggleListener());
gamehud.addListener(new ConsoleToggleListener()); gamehud.addListener(new ConsoleToggleListener());
} }
WorldSave.getCurrentSave().onLoad(() -> GameHUD.this.enter()); WorldSave.getCurrentSave().onLoad(this::enter);
eventTouchDown = new InputEvent(); eventTouchDown = new InputEvent();
eventTouchDown.setPointer(-1); eventTouchDown.setPointer(-1);
eventTouchDown.setType(InputEvent.Type.touchDown); eventTouchDown.setType(InputEvent.Type.touchDown);
@@ -230,7 +228,6 @@ public class GameHUD extends Stage {
touchpad.setBounds(touch.x - TOUCHPAD_SCALE / 2, touch.y - TOUCHPAD_SCALE / 2, TOUCHPAD_SCALE, TOUCHPAD_SCALE); touchpad.setBounds(touch.x - TOUCHPAD_SCALE / 2, touch.y - TOUCHPAD_SCALE / 2, TOUCHPAD_SCALE, TOUCHPAD_SCALE);
touchpad.setVisible(true); touchpad.setVisible(true);
touchpad.setResetOnTouchUp(true); touchpad.setResetOnTouchUp(true);
hideButtons();
return super.touchDown(screenX, screenY, pointer, button); return super.touchDown(screenX, screenY, pointer, button);
} }
} }
@@ -333,6 +330,41 @@ public class GameHUD extends Stage {
} }
} }
void updateAbility() {
for (TextraButton button : abilityButtonMap) {
button.remove();
}
abilityButtonMap.clear();
setAbilityButton(AdventurePlayer.current().getEquippedAbility1());
setAbilityButton(AdventurePlayer.current().getEquippedAbility2());
float x = Forge.isLandscapeMode() ? 426f : 216f;
float y = 10f;
float w = 45f;
float h = 35f;
for (TextraButton button : abilityButtonMap) {
button.getColor().a = opacity;
button.setSize(w, h);
button.setPosition(x, y);
y += h + 10f;
addActor(button);
}
}
void setAbilityButton(ItemData data) {
if (data != null) {
TextraButton button = Controls.newTextButton("[%120][+" + data.iconName + "][+Shards]" + data.shardsNeeded, () -> {
boolean isInPoi = MapStage.getInstance().isInMap();
if (!(isInPoi && data.usableInPoi || !isInPoi && data.usableOnWorldMap))
return;
if (data.shardsNeeded > Current.player().getShards())
return;
Current.player().addShards(-data.shardsNeeded);
ConsoleCommandInterpreter.getInstance().command(data.commandOnUse);
});
abilityButtonMap.add(button);
}
}
private Pair<FileHandle, Music> audio = null; private Pair<FileHandle, Music> audio = null;
public void playAudio() { public void playAudio() {
@@ -368,12 +400,12 @@ public class GameHUD extends Stage {
public void act(float delta) { public void act(float delta) {
super.act(delta); super.act(delta);
if (fade < targetfade) { if (fade < targetfade) {
fade += (delta/2); fade += (delta / 2);
if (fade > targetfade) if (fade > targetfade)
fade = targetfade; fade = targetfade;
fadeAudio(fade); fadeAudio(fade);
} else if (fade > targetfade) { } else if (fade > targetfade) {
fade -= (delta/2); fade -= (delta / 2);
if (fade < targetfade) if (fade < targetfade)
fade = targetfade; fade = targetfade;
fadeAudio(fade); fadeAudio(fade);
@@ -479,6 +511,11 @@ public class GameHUD extends Stage {
actor.setVisible(visible); actor.setVisible(visible);
} }
private void setDisabled(Actor actor, boolean enable) {
if (actor != null && actor instanceof Button)
((Button) actor).setDisabled(enable);
}
private void setAlpha(Actor actor, boolean visible) { private void setAlpha(Actor actor, boolean visible) {
if (actor != null) { if (actor != null) {
if (visible) if (visible)
@@ -498,7 +535,7 @@ public class GameHUD extends Stage {
setVisibility(shards, visible); setVisibility(shards, visible);
setVisibility(money, visible); setVisibility(money, visible);
setVisibility(blank, visible); setVisibility(blank, visible);
setVisibility(exitToWorldMapActor, GameScene.instance().isNotInWorldMap()); setDisabled(exitToWorldMapActor, !GameScene.instance().isNotInWorldMap());
setAlpha(avatarborder, visible); setAlpha(avatarborder, visible);
setAlpha(avatar, visible); setAlpha(avatar, visible);
setAlpha(deckActor, visible); setAlpha(deckActor, visible);
@@ -506,6 +543,9 @@ public class GameHUD extends Stage {
setAlpha(logbookActor, visible); setAlpha(logbookActor, visible);
setAlpha(inventoryActor, visible); setAlpha(inventoryActor, visible);
setAlpha(exitToWorldMapActor, visible); setAlpha(exitToWorldMapActor, visible);
for (TextraButton button : abilityButtonMap) {
setAlpha(button, visible);
}
opacity = visible ? 1f : 0.4f; opacity = visible ? 1f : 0.4f;
} }
@@ -528,11 +568,6 @@ public class GameHUD extends Stage {
if (keycode == Input.Keys.BACK) { if (keycode == Input.Keys.BACK) {
if (console.isVisible()) { if (console.isVisible()) {
console.toggle(); console.toggle();
} else {
if (menuActor.isVisible())
hideButtons();
else
showButtons();
} }
} }
if (console.isVisible()) if (console.isVisible())
@@ -571,38 +606,6 @@ public class GameHUD extends Stage {
}, 0.10f); }, 0.10f);
} }
private void hideButtons() {
if (isShowing)
return;
if (isHiding)
return;
isHiding = true;
deckActor.addAction(Actions.sequence(Actions.fadeOut(0.10f), Actions.hide(), Actions.moveTo(deckActor.getX() + deckActor.getWidth(), deckActor.getY())));
inventoryActor.addAction(Actions.sequence(Actions.fadeOut(0.15f), Actions.hide(), Actions.moveTo(inventoryActor.getX() + inventoryActor.getWidth(), inventoryActor.getY())));
logbookActor.addAction(Actions.sequence(Actions.fadeOut(0.20f), Actions.hide(), Actions.moveTo(logbookActor.getX() + logbookActor.getWidth(), logbookActor.getY())));
menuActor.addAction(Actions.sequence(Actions.fadeOut(0.25f), Actions.hide(), Actions.moveTo(menuActor.getX() + menuActor.getWidth(), menuActor.getY())));
if (GameScene.instance().isNotInWorldMap())
exitToWorldMapActor.addAction(Actions.sequence(Actions.fadeOut(0.2f), Actions.hide(), Actions.moveTo(exitToWorldMapActor.getX() + exitToWorldMapActor.getWidth(), exitToWorldMapActor.getY())));
FThreads.delayInEDT(300, () -> isHiding = false);
}
private void showButtons() {
if (console.isVisible())
return;
if (isHiding)
return;
if (isShowing)
return;
isShowing = true;
menuActor.addAction(Actions.sequence(Actions.delay(0.1f), Actions.parallel(Actions.show(), Actions.alpha(opacity, 0.1f), Actions.moveTo(referenceX, menuActor.getY(), 0.25f))));
logbookActor.addAction(Actions.sequence(Actions.delay(0.15f), Actions.parallel(Actions.show(), Actions.alpha(opacity, 0.1f), Actions.moveTo(referenceX, logbookActor.getY(), 0.25f))));
inventoryActor.addAction(Actions.sequence(Actions.delay(0.2f), Actions.parallel(Actions.show(), Actions.alpha(opacity, 0.1f), Actions.moveTo(referenceX, inventoryActor.getY(), 0.25f))));
deckActor.addAction(Actions.sequence(Actions.delay(0.25f), Actions.parallel(Actions.show(), Actions.alpha(opacity, 0.1f), Actions.moveTo(referenceX, deckActor.getY(), 0.25f))));
if (GameScene.instance().isNotInWorldMap())
exitToWorldMapActor.addAction(Actions.sequence(Actions.delay(0.25f), Actions.parallel(Actions.show(), Actions.alpha(opacity, 0.1f), Actions.moveTo(referenceX, exitToWorldMapActor.getY(), 0.25f))));
FThreads.delayInEDT(300, () -> isShowing = false);
}
public void setDebug(boolean b) { public void setDebug(boolean b) {
debugMap = b; debugMap = b;
} }
@@ -626,13 +629,12 @@ public class GameHUD extends Stage {
public boolean act(float v) { public boolean act(float v) {
if (exitDungeon) { if (exitDungeon) {
MapStage.getInstance().exitDungeon(); MapStage.getInstance().exitDungeon();
exitToWorldMapActor.setVisible(false); setDisabled(exitToWorldMapActor, true);
} }
return true; return true;
} }
})); }));
dialogOnlyInput = false; dialogOnlyInput = false;
selectedKey = null;
} }
private void selectNextDialogButton() { private void selectNextDialogButton() {
@@ -677,18 +679,9 @@ public class GameHUD extends Stage {
@Override @Override
public boolean longPress(Actor actor, float x, float y) { public boolean longPress(Actor actor, float x, float y) {
hideButtons();
console.toggle(); console.toggle();
return super.longPress(actor, x, y); return super.longPress(actor, x, y);
} }
@Override
public void tap(InputEvent event, float x, float y, int count, int button) {
super.tap(event, x, y, count, button);
//show menu buttons if double tapping the avatar, for android devices without visible navigation buttons
if (count > 1)
showButtons();
}
} }
public void updateMusic() { public void updateMusic() {

View File

@@ -17,7 +17,6 @@ import forge.util.Aggregates;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.*; import java.util.*;
import java.util.List;
public class AdventureQuestController implements Serializable { public class AdventureQuestController implements Serializable {

View File

@@ -21,7 +21,6 @@
"type": "TextButton", "type": "TextButton",
"name": "return", "name": "return",
"text": "tr(lblBack)", "text": "tr(lblBack)",
"binding": "Back",
"width": 86, "width": 86,
"height": 30, "height": 30,
"x": 4, "x": 4,
@@ -31,7 +30,6 @@
"type": "TextButton", "type": "TextButton",
"name": "rename", "name": "rename",
"text": "tr(lblRename)", "text": "tr(lblRename)",
"binding": "Equip",
"width": 86, "width": 86,
"height": 30, "height": 30,
"x": 92, "x": 92,
@@ -41,7 +39,6 @@
"type": "TextButton", "type": "TextButton",
"name": "edit", "name": "edit",
"text": "tr(lblEdit)", "text": "tr(lblEdit)",
"binding": "Use",
"width": 86, "width": 86,
"height": 30, "height": 30,
"x": 180, "x": 180,

View File

@@ -85,45 +85,42 @@
{ {
"type": "TextButton", "type": "TextButton",
"name": "deck", "name": "deck",
"style":"menu",
"text": "[%120][+Deck]", "text": "[%120][+Deck]",
"binding": "Deck", "binding": "Deck",
"width": 64, "width": 45,
"height": 36, "height": 25,
"x": 416, "x": 175,
"y": 106 "y": 0
}, },
{ {
"type": "TextButton", "type": "TextButton",
"name": "inventory", "name": "inventory",
"style":"menu",
"text": "[%120][+Item]", "text": "[%120][+Item]",
"binding": "Inventory", "binding": "Inventory",
"width": 64, "width": 45,
"height": 36, "height": 25,
"x": 416, "x": 220,
"y": 146 "y": 0
}, },
{ {
"type": "TextButton", "type": "TextButton",
"name": "logbook", "name": "logbook",
"style":"menu",
"text": "[%120][+Logbook]", "text": "[%120][+Logbook]",
"width": 64, "binding": "Status",
"height": 36, "width": 45,
"x": 416, "height": 25,
"y": 186 "x": 265,
"y": 0
}, },
{ {
"type": "TextButton", "type": "TextButton",
"name": "menu", "name": "menu",
"style":"menu",
"text": "[%120][+Menu]", "text": "[%120][+Menu]",
"binding": "Menu", "binding": "Menu",
"width": 64, "width": 45,
"height": 36, "height": 25,
"x": 416, "x": 130,
"y": 226 "y": 0
}, },
{ {
"type": "TextButton", "type": "TextButton",
@@ -138,13 +135,12 @@
{ {
"type": "TextButton", "type": "TextButton",
"name": "exittoworldmap", "name": "exittoworldmap",
"style":"menu",
"text": "[%120][+ExitToWorldMap]", "text": "[%120][+ExitToWorldMap]",
"binding": "ExitToWorldMap", "binding": "ExitToWorldMap",
"width": 64, "width": 45,
"height": 32, "height": 25,
"x": 416, "x": 310,
"y": 66 "y": 0
} }
] ]
} }

View File

@@ -84,53 +84,44 @@
{ {
"type": "TextButton", "type": "TextButton",
"name": "deck", "name": "deck",
"style":"menu",
"text": "[%120][+Deck]", "text": "[%120][+Deck]",
"binding": "Deck", "width": 25,
"width": 64, "height": 25,
"height": 32, "x": 105,
"x": 206, "y": 0
"y": 306
}, },
{ {
"type": "TextButton", "type": "TextButton",
"name": "inventory", "name": "inventory",
"style":"menu",
"text": "[%120][+Item]", "text": "[%120][+Item]",
"binding": "Inventory", "width": 25,
"width": 64, "height": 25,
"height": 32, "x": 130,
"x": 206, "y": 0
"y": 346
}, },
{ {
"type": "TextButton", "type": "TextButton",
"name": "logbook", "name": "logbook",
"style":"menu",
"text": "[%120][+Logbook]", "text": "[%120][+Logbook]",
"binding": "Status", "width": 25,
"width": 64, "height": 25,
"height": 32, "x": 155,
"x": 206, "y": 0
"y": 386
}, },
{ {
"type": "TextButton", "type": "TextButton",
"name": "menu", "name": "menu",
"style":"menu",
"text": "[%120][+Menu]", "text": "[%120][+Menu]",
"binding": "Menu", "width": 25,
"width": 64, "height": 25,
"height": 32, "x": 80,
"x": 206, "y": 0
"y": 426
}, },
{ {
"type": "TextButton", "type": "TextButton",
"name": "openmap", "name": "openmap",
"text": "[%80]tr(lblZoom)", "text": "[%80]tr(lblZoom)",
"binding": "Map",
"width": 80, "width": 80,
"height": 20, "height": 20,
"x": 0, "x": 0,
@@ -139,13 +130,11 @@
{ {
"type": "TextButton", "type": "TextButton",
"name": "exittoworldmap", "name": "exittoworldmap",
"style":"menu",
"text": "[%120][+ExitToWorldMap]", "text": "[%120][+ExitToWorldMap]",
"binding": "ExitToWorldMap", "width": 25,
"width": 64, "height": 25,
"height": 32, "x": 180,
"x": 206, "y": 0
"y": 266
} }
] ]
} }

View File

@@ -22,7 +22,6 @@
"type": "TextButton", "type": "TextButton",
"name": "tempHitPointCost", "name": "tempHitPointCost",
"text": "Cost", "text": "Cost",
"binding": "Status",
"width": 100, "width": 100,
"height": 30, "height": 30,
"x": 165, "x": 165,
@@ -51,7 +50,6 @@
"type": "TextButton", "type": "TextButton",
"name": "sell", "name": "sell",
"text": "tr(lblSell)", "text": "tr(lblSell)",
"binding": "Equip",
"width": 100, "width": 100,
"height": 30, "height": 30,
"x": 165, "x": 165,
@@ -70,7 +68,6 @@
"type": "TextButton", "type": "TextButton",
"name": "done", "name": "done",
"text": "tr(lblBack)", "text": "tr(lblBack)",
"binding": "Back",
"width": 100, "width": 100,
"height": 30, "height": 30,
"x": 165, "x": 165,

View File

@@ -17,6 +17,24 @@
"width": 129, "width": 129,
"height": 243 "height": 243
}, },
{
"type": "ImageButton",
"name": "Equipment_Ability1",
"style": "item_frame",
"width": 20,
"height": 20,
"x": 17,
"y": 20
},
{
"type": "ImageButton",
"name": "Equipment_Ability2",
"style": "item_frame",
"width": 20,
"height": 20,
"x": 107,
"y": 20
},
{ {
"type": "ImageButton", "type": "ImageButton",
"name": "Equipment_Neck", "name": "Equipment_Neck",

View File

@@ -17,6 +17,24 @@
"width": 129, "width": 129,
"height": 243 "height": 243
}, },
{
"type": "ImageButton",
"name": "Equipment_Ability1",
"style": "item_frame",
"width": 20,
"height": 20,
"x": 17,
"y": 124
},
{
"type": "ImageButton",
"name": "Equipment_Ability2",
"style": "item_frame",
"width": 20,
"height": 20,
"x": 107,
"y": 124
},
{ {
"type": "ImageButton", "type": "ImageButton",
"name": "Equipment_Neck", "name": "Equipment_Neck",
@@ -25,7 +43,7 @@
"height": 20, "height": 20,
"x": 62, "x": 62,
"y": 144 "y": 144
} , },
{ {
"type": "ImageButton", "type": "ImageButton",
"name": "Equipment_Body", "name": "Equipment_Body",
@@ -34,7 +52,7 @@
"height": 20, "height": 20,
"x": 62, "x": 62,
"y": 189 "y": 189
} , },
{ {
"type": "ImageButton", "type": "ImageButton",
"name": "Equipment_Boots", "name": "Equipment_Boots",
@@ -43,7 +61,7 @@
"height": 20, "height": 20,
"x": 62, "x": 62,
"y": 324 "y": 324
} , },
{ {
"type": "ImageButton", "type": "ImageButton",
"name": "Equipment_Left", "name": "Equipment_Left",
@@ -84,12 +102,11 @@
"y": 16, "y": 16,
"width": 246, "width": 246,
"height": 90 "height": 90
} , },
{ {
"type": "TextButton", "type": "TextButton",
"name": "delete", "name": "delete",
"text": "tr(lblDispose)", "text": "tr(lblDispose)",
"binding": "Status",
"width": 60, "width": 60,
"height": 30, "height": 30,
"x": 8, "x": 8,
@@ -99,7 +116,6 @@
"type": "TextButton", "type": "TextButton",
"name": "equip", "name": "equip",
"text": "tr(lblEquip)", "text": "tr(lblEquip)",
"binding": "Equip",
"width": 60, "width": 60,
"height": 30, "height": 30,
"x": 75, "x": 75,
@@ -109,7 +125,6 @@
"type": "TextButton", "type": "TextButton",
"name": "use", "name": "use",
"text": "tr(lblUse)", "text": "tr(lblUse)",
"binding": "Use",
"width": 60, "width": 60,
"height": 30, "height": 30,
"x": 140, "x": 140,
@@ -119,7 +134,6 @@
"type": "TextButton", "type": "TextButton",
"name": "return", "name": "return",
"text": "tr(lblBack)", "text": "tr(lblBack)",
"binding": "Back",
"width": 60, "width": 60,
"height": 30, "height": 30,
"x": 205, "x": 205,

View File

@@ -28,7 +28,6 @@
"type": "TextButton", "type": "TextButton",
"name": "detail", "name": "detail",
"text": "Detail", "text": "Detail",
"binding": "Equip",
"width": 128, "width": 128,
"height": 32, "height": 32,
"x": 140, "x": 140,
@@ -38,7 +37,6 @@
"type": "TextButton", "type": "TextButton",
"name": "done", "name": "done",
"text": "tr(lblLeave)", "text": "tr(lblLeave)",
"binding": "Back",
"width": 128, "width": 128,
"height": 32, "height": 32,
"x": 140, "x": 140,

View File

@@ -13,7 +13,6 @@
"type": "TextButton", "type": "TextButton",
"name": "done", "name": "done",
"text": "[%80]tr(lblBack)", "text": "[%80]tr(lblBack)",
"binding": "Back",
"width": 48, "width": 48,
"height": 20, "height": 20,
"x": 5, "x": 5,

View File

@@ -187,7 +187,6 @@
"name": "back", "name": "back",
"text": "tr(lblBack)", "text": "tr(lblBack)",
"selectable": true, "selectable": true,
"binding": "Back",
"width": 64, "width": 64,
"height": 28, "height": 28,
"x": 32, "x": 32,
@@ -198,7 +197,6 @@
"name": "start", "name": "start",
"text": "tr(lblStart)", "text": "tr(lblStart)",
"selectable": true, "selectable": true,
"binding": "Status",
"width": 64, "width": 64,
"height": 28, "height": 28,
"x": 165, "x": 165,

View File

@@ -66,7 +66,6 @@
"type": "TextButton", "type": "TextButton",
"name": "return", "name": "return",
"text": "tr(lblBack)", "text": "tr(lblBack)",
"binding": "Back",
"width": 130, "width": 130,
"height": 30, "height": 30,
"x": 135, "x": 135,
@@ -76,7 +75,6 @@
"type": "TextButton", "type": "TextButton",
"name": "status", "name": "status",
"text": "Status", "text": "Status",
"binding": "Status",
"width": 130, "width": 130,
"height": 30, "height": 30,
"x": 5, "x": 5,

View File

@@ -45,7 +45,6 @@
"type": "TextButton", "type": "TextButton",
"name": "return", "name": "return",
"text": "tr(lblBack)", "text": "tr(lblBack)",
"binding": "Back",
"width": 120, "width": 120,
"height": 32, "height": 32,
"x": 10, "x": 10,
@@ -54,7 +53,6 @@
{ {
"type": "TextButton", "type": "TextButton",
"name": "save", "name": "save",
"binding": "Use",
"width": 120, "width": 120,
"height": 32, "height": 32,
"x": 140, "x": 140,

View File

@@ -21,7 +21,6 @@
"type": "TextButton", "type": "TextButton",
"name": "return", "name": "return",
"text": "tr(lblBack)", "text": "tr(lblBack)",
"binding": "Back",
"width": 250, "width": 250,
"height": 32, "height": 32,
"x": 10, "x": 10,

View File

@@ -22,7 +22,6 @@
"type": "TextButton", "type": "TextButton",
"name": "btnBuyShardsCost", "name": "btnBuyShardsCost",
"text": "btnBuyShardsCost", "text": "btnBuyShardsCost",
"binding": "Status",
"width": 100, "width": 100,
"height": 30, "height": 30,
"x": 165, "x": 165,
@@ -41,7 +40,6 @@
"type": "TextButton", "type": "TextButton",
"name": "btnSellShardsQuantity", "name": "btnSellShardsQuantity",
"text": "btnSellShardsQuantity", "text": "btnSellShardsQuantity",
"binding": "Equip",
"width": 100, "width": 100,
"height": 30, "height": 30,
"x": 165, "x": 165,
@@ -60,7 +58,6 @@
"type": "TextButton", "type": "TextButton",
"name": "done", "name": "done",
"text": "tr(lblBack)", "text": "tr(lblBack)",
"binding": "Back",
"width": 100, "width": 100,
"height": 30, "height": 30,
"x": 165, "x": 165,

View File

@@ -64,7 +64,6 @@
"selectable": true, "selectable": true,
"name": "done", "name": "done",
"text": "tr(lblBack)", "text": "tr(lblBack)",
"binding": "Back",
"x": 180, "x": 180,
"y": 150, "y": 150,
"width": 90, "width": 90,
@@ -151,7 +150,6 @@
"type": "TextButton", "type": "TextButton",
"selectable": true, "selectable": true,
"name": "pullUsingGold", "name": "pullUsingGold",
"binding": "Status",
"text": "tr(lblDraw) [+gold]", "text": "tr(lblDraw) [+gold]",
"x": 180, "x": 180,
"y": 25, "y": 25,
@@ -171,7 +169,6 @@
"type": "TextButton", "type": "TextButton",
"selectable": true, "selectable": true,
"name": "pullUsingShards", "name": "pullUsingShards",
"binding": "Equip",
"text": "tr(lblDraw) [+shards]", "text": "tr(lblDraw) [+shards]",
"x": 180, "x": 180,
"y": 75, "y": 75,

View File

@@ -54,7 +54,6 @@
"name": "Resume", "name": "Resume",
"text": "tr(lblResume)", "text": "tr(lblResume)",
"selectable": true, "selectable": true,
"binding": "Back",
"width": 238, "width": 238,
"height": 48, "height": 48,
"x": 16, "x": 16,

View File

@@ -112,7 +112,6 @@
"type": "TextButton", "type": "TextButton",
"name": "return", "name": "return",
"text": "tr(lblBack)", "text": "tr(lblBack)",
"binding": "Back",
"width": 115, "width": 115,
"height": 30, "height": 30,
"x": 155, "x": 155,
@@ -122,7 +121,6 @@
"type": "TextButton", "type": "TextButton",
"name": "quests", "name": "quests",
"text": "Quests", "text": "Quests",
"binding": "Status",
"width": 115, "width": 115,
"height": 30, "height": 30,
"x": 35, "x": 35,

View File

@@ -870,6 +870,7 @@
{ {
"name": "Colorless rune", "name": "Colorless rune",
"usableOnWorldMap":true, "usableOnWorldMap":true,
"equipmentSlot": "Ability2",
"description": "Teleports you to the center", "description": "Teleports you to the center",
"commandOnUse": "teleport to poi Spawn", "commandOnUse": "teleport to poi Spawn",
"iconName": "ColorlessRune", "iconName": "ColorlessRune",
@@ -880,6 +881,7 @@
{ {
"name": "White rune", "name": "White rune",
"usableOnWorldMap":true, "usableOnWorldMap":true,
"equipmentSlot": "Ability2",
"effect": { "effect": {
"name": "" "name": ""
}, },
@@ -893,6 +895,7 @@
{ {
"name": "Black rune", "name": "Black rune",
"usableOnWorldMap":true, "usableOnWorldMap":true,
"equipmentSlot": "Ability2",
"effect": { "effect": {
"name": "" "name": ""
}, },
@@ -906,6 +909,7 @@
{ {
"name": "Blue rune", "name": "Blue rune",
"usableOnWorldMap":true, "usableOnWorldMap":true,
"equipmentSlot": "Ability2",
"effect": { "effect": {
"name": "" "name": ""
}, },
@@ -919,6 +923,7 @@
{ {
"name": "Red rune", "name": "Red rune",
"usableOnWorldMap":true, "usableOnWorldMap":true,
"equipmentSlot": "Ability2",
"effect": { "effect": {
"name": "" "name": ""
}, },
@@ -932,6 +937,7 @@
{ {
"name": "Green rune", "name": "Green rune",
"usableOnWorldMap":true, "usableOnWorldMap":true,
"equipmentSlot": "Ability2",
"effect": { "effect": {
"name": "" "name": ""
}, },
@@ -944,6 +950,7 @@
}, },
{ {
"name": "White Staff", "name": "White Staff",
"equipmentSlot": "Ability1",
"usableOnWorldMap":true, "usableOnWorldMap":true,
"usableInPoi":true, "usableInPoi":true,
"effect": { "effect": {
@@ -958,6 +965,7 @@
}, },
{ {
"name": "Black Staff", "name": "Black Staff",
"equipmentSlot": "Ability1",
"usableOnWorldMap":true, "usableOnWorldMap":true,
"usableInPoi":false, "usableInPoi":false,
"effect": { "effect": {
@@ -973,6 +981,7 @@
{ {
"name": "Blue Staff", "name": "Blue Staff",
"usableOnWorldMap":true, "usableOnWorldMap":true,
"equipmentSlot": "Ability1",
"effect": { "effect": {
"name": "" "name": ""
}, },
@@ -986,6 +995,7 @@
{ {
"name": "Red Staff", "name": "Red Staff",
"usableOnWorldMap":true, "usableOnWorldMap":true,
"equipmentSlot": "Ability1",
"effect": { "effect": {
"name": "" "name": ""
}, },
@@ -998,6 +1008,7 @@
}, },
{ {
"name": "Green Staff", "name": "Green Staff",
"equipmentSlot": "Ability1",
"usableOnWorldMap":true, "usableOnWorldMap":true,
"usableInPoi":true, "usableInPoi":true,
"effect": { "effect": {