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

View File

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

View File

@@ -1,6 +1,5 @@
package forge.adventure.scene;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.scenes.scene2d.Group;
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");
ui.onButtonPress("done", () -> done());
ui.onButtonPress("done", this::done);
scroll = ui.findActor("map");
Group table=new Group();
@@ -78,13 +77,4 @@ public class MapViewScene extends UIScene {
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.TypingLabel;
import forge.Forge;
import forge.adventure.data.ItemData;
import forge.adventure.player.AdventurePlayer;
import forge.adventure.scene.*;
import forge.adventure.util.*;
import forge.adventure.world.WorldSave;
import forge.deck.Deck;
import forge.gui.FThreads;
import forge.gui.GuiBase;
import forge.localinstance.properties.ForgePreferences;
import forge.model.FModel;
@@ -51,16 +51,15 @@ public class GameHUD extends Stage {
private final Touchpad touchpad;
private final Console console;
float TOUCHPAD_SCALE = 70f, referenceX;
boolean isHiding = false, isShowing = false;
float opacity = 1f;
private boolean debugMap, updatelife;
private final Dialog dialog;
private boolean dialogOnlyInput;
private final Array<TextraButton> dialogButtonMap = new Array<>();
private final Array<TextraButton> abilityButtonMap = new Array<>();
private final Array<String> questKeys = new Array<>();
private String lifepointsTextColor = "";
private TextraButton selectedKey;
private final ScrollPane scrollPane;
private GameHUD(GameStage gameStage) {
@@ -68,9 +67,7 @@ public class GameHUD extends Stage {
instance = this;
this.gameStage = gameStage;
ui = new UIActor(Config.instance().getFile(GuiBase.isAndroid()
? Forge.isLandscapeMode() ? "ui/hud_landscape.json" : "ui/hud_portrait.json"
: Forge.isLandscapeMode() ? "ui/hud.json" : "ui/hud_portrait.json"));
ui = new UIActor(Config.instance().getFile(Forge.isLandscapeMode() ? "ui/hud_landscape.json" : "ui/hud_portrait.json"));
blank = ui.findActor("blank");
@@ -80,7 +77,7 @@ public class GameHUD extends Stage {
avatarborder = ui.findActor("avatarborder");
deckActor = ui.findActor("deck");
openMapActor = ui.findActor("openmap");
ui.onButtonPress("openmap", () -> GameHUD.this.openMap());
ui.onButtonPress("openmap", this::openMap);
menuActor = ui.findActor("menu");
referenceX = menuActor.getX();
logbookActor = ui.findActor("logbook");
@@ -113,11 +110,11 @@ public class GameHUD extends Stage {
ui.addActor(touchpad);
avatar = ui.findActor("avatar");
ui.onButtonPress("menu", () -> menu());
ui.onButtonPress("inventory", () -> openInventory());
ui.onButtonPress("logbook", () -> logbook());
ui.onButtonPress("deck", () -> openDeck());
ui.onButtonPress("exittoworldmap", () -> exitToWorldMap());
ui.onButtonPress("menu", this::menu);
ui.onButtonPress("inventory", this::openInventory);
ui.onButtonPress("logbook", this::logbook);
ui.onButtonPress("deck", this::openDeck);
ui.onButtonPress("exittoworldmap", this::exitToWorldMap);
lifePoints = ui.findActor("lifePoints");
shards = ui.findActor("shards");
money = ui.findActor("money");
@@ -131,6 +128,7 @@ public class GameHUD extends Stage {
addActor(scrollPane);
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().onEquipmentChanged(this::updateAbility);
WorldSave.getCurrentSave().getPlayer().onGoldChange(() -> money.setText("[%95][+Gold] " + String.valueOf(AdventurePlayer.current().getGold())));
addActor(ui);
@@ -144,7 +142,7 @@ public class GameHUD extends Stage {
avatarborder.addListener(new ConsoleToggleListener());
gamehud.addListener(new ConsoleToggleListener());
}
WorldSave.getCurrentSave().onLoad(() -> GameHUD.this.enter());
WorldSave.getCurrentSave().onLoad(this::enter);
eventTouchDown = new InputEvent();
eventTouchDown.setPointer(-1);
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.setVisible(true);
touchpad.setResetOnTouchUp(true);
hideButtons();
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;
public void playAudio() {
@@ -368,12 +400,12 @@ public class GameHUD extends Stage {
public void act(float delta) {
super.act(delta);
if (fade < targetfade) {
fade += (delta/2);
fade += (delta / 2);
if (fade > targetfade)
fade = targetfade;
fadeAudio(fade);
} else if (fade > targetfade) {
fade -= (delta/2);
fade -= (delta / 2);
if (fade < targetfade)
fade = targetfade;
fadeAudio(fade);
@@ -479,6 +511,11 @@ public class GameHUD extends Stage {
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) {
if (actor != null) {
if (visible)
@@ -498,7 +535,7 @@ public class GameHUD extends Stage {
setVisibility(shards, visible);
setVisibility(money, visible);
setVisibility(blank, visible);
setVisibility(exitToWorldMapActor, GameScene.instance().isNotInWorldMap());
setDisabled(exitToWorldMapActor, !GameScene.instance().isNotInWorldMap());
setAlpha(avatarborder, visible);
setAlpha(avatar, visible);
setAlpha(deckActor, visible);
@@ -506,6 +543,9 @@ public class GameHUD extends Stage {
setAlpha(logbookActor, visible);
setAlpha(inventoryActor, visible);
setAlpha(exitToWorldMapActor, visible);
for (TextraButton button : abilityButtonMap) {
setAlpha(button, visible);
}
opacity = visible ? 1f : 0.4f;
}
@@ -528,11 +568,6 @@ public class GameHUD extends Stage {
if (keycode == Input.Keys.BACK) {
if (console.isVisible()) {
console.toggle();
} else {
if (menuActor.isVisible())
hideButtons();
else
showButtons();
}
}
if (console.isVisible())
@@ -571,38 +606,6 @@ public class GameHUD extends Stage {
}, 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) {
debugMap = b;
}
@@ -626,13 +629,12 @@ public class GameHUD extends Stage {
public boolean act(float v) {
if (exitDungeon) {
MapStage.getInstance().exitDungeon();
exitToWorldMapActor.setVisible(false);
setDisabled(exitToWorldMapActor, true);
}
return true;
}
}));
dialogOnlyInput = false;
selectedKey = null;
}
private void selectNextDialogButton() {
@@ -677,18 +679,9 @@ public class GameHUD extends Stage {
@Override
public boolean longPress(Actor actor, float x, float y) {
hideButtons();
console.toggle();
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() {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -17,6 +17,24 @@
"width": 129,
"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",
"name": "Equipment_Neck",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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