From b187a43a36865ecdecd466cd221b29fba98cc86c Mon Sep 17 00:00:00 2001 From: jjayers99 <56438137+jjayers99@users.noreply.github.com> Date: Wed, 12 Jul 2023 16:33:21 -0400 Subject: [PATCH 1/3] Adventure - Add Shard Trader to Forest Capital --- .../common/maps/map/main_story/forest_capital.tmx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/forge-gui/res/adventure/common/maps/map/main_story/forest_capital.tmx b/forge-gui/res/adventure/common/maps/map/main_story/forest_capital.tmx index 3c8f1edae52..5d665148d2b 100644 --- a/forge-gui/res/adventure/common/maps/map/main_story/forest_capital.tmx +++ b/forge-gui/res/adventure/common/maps/map/main_story/forest_capital.tmx @@ -1,5 +1,5 @@ - + @@ -18,7 +18,7 @@ - eJzNmEtO40AQhnsFSAlKxOsCARMwK2AHF2FPIOxnBi4AgRXiAHAGQFwAkgAi4hScgNcMmxlNWbiVSlHVLzshv1SSH+325+qu6nJHRaVisAhsHmwYNJfyxKlVwFpg7SHhawLHbMqYsD2A/Sgp9XNI7Fepy6jHdKKs1OSQ2FS568c24ZsBu/gmmyZ8WBPMvXlhfjQKSh0iOyr03j8o8M/ZxDFw92z9N9N4aglxNQg+/Y7asrnPCsNzDOcn6bUt8vzKklKrS73Xqp58inmnSfR7OuDPx4Bc5cOXjCFmrMfdY84H9HswM9YiOta+1e18+PIQ5pt1aN8PPs6XHB8nOrd9+Lbir21CxDHeC20HMb6nEIxnVXu7fvBdh73WKDw/QvjqlvyXp7L4ryGsZVmF83cWPl0zJvXOO8TOb4f4+Qvz8J/HXPThq5H3N3OqYU25PWt8NAw1yzMUOy9SweOoED6cq7QPk7r2upj/XPTl43LrfvFzLsZ9+J/KMr54PjYFH67B4r+eFgB/oP2HEEPbwvU81w/MiOdjPOr2PJaOmVC+OQsjHuv6GNSnI5+2M+bH6cMn1SWvMDZvwljT2JbqAKnvLONL63QsHNdS3Lis3a58t5Z+JFYpbrTu0PHGgpmh7cBeI/U3FfMK79yzLay/ei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3139b523b491f077056c5 Mon Sep 17 00:00:00 2001 From: jjayers99 <56438137+jjayers99@users.noreply.github.com> Date: Sun, 16 Jul 2023 22:00:40 -0400 Subject: [PATCH 2/3] Adventure - Difficulty data storage fix --- .../adventure/player/AdventurePlayer.java | 38 +++++++++++++++++-- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/forge-gui-mobile/src/forge/adventure/player/AdventurePlayer.java b/forge-gui-mobile/src/forge/adventure/player/AdventurePlayer.java index bbe81414228..a840f8ca785 100644 --- a/forge-gui-mobile/src/forge/adventure/player/AdventurePlayer.java +++ b/forge-gui-mobile/src/forge/adventure/player/AdventurePlayer.java @@ -282,9 +282,37 @@ public class AdventurePlayer implements Serializable, SaveFileContent { 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; + //Previously these were not being read from or written to save files, causing defaults to appear after reload + //Pull from config if appropriate + DifficultyData configuredDifficulty = null; + for (DifficultyData candidate : Config.instance().getConfigData().difficulties) { + if (candidate.name.equals(this.difficultyData.name)) { + configuredDifficulty = candidate; + break; + } + } + + if (configuredDifficulty != null && (this.difficultyData.shardSellRatio == data.readFloat("shardSellRatio") || data.readFloat("shardSellRatio") == 0)) + this.difficultyData.shardSellRatio = configuredDifficulty.shardSellRatio; + else + this.difficultyData.shardSellRatio = data.readFloat("shardSellRatio"); + if (configuredDifficulty != null && !data.containsKey("goldLoss")) + this.difficultyData.goldLoss = configuredDifficulty.goldLoss; + else + this.difficultyData.goldLoss = data.readFloat("goldLoss"); + if (configuredDifficulty != null && !data.containsKey("lifeLoss")) + this.difficultyData.lifeLoss = configuredDifficulty.lifeLoss; + else + this.difficultyData.lifeLoss = data.readFloat("lifeLoss"); + if (configuredDifficulty != null && !data.containsKey("spawnRank")) + this.difficultyData.spawnRank = configuredDifficulty.spawnRank; + else + this.difficultyData.spawnRank = data.readInt("spawnRank"); + if (configuredDifficulty != null && !data.containsKey("rewardMaxFactor")) + this.difficultyData.rewardMaxFactor = configuredDifficulty.rewardMaxFactor; + else + this.difficultyData.rewardMaxFactor = data.readFloat("rewardMaxFactor"); + // END SPECIAL CASES name = data.readString("name"); heroRace = data.readInt("heroRace"); @@ -413,6 +441,10 @@ public class AdventurePlayer implements Serializable, SaveFileContent { data.store("enemyLifeFactor", this.difficultyData.enemyLifeFactor); data.store("sellFactor", this.difficultyData.sellFactor); data.store("shardSellRatio", this.difficultyData.shardSellRatio); + data.store("goldLoss", this.difficultyData.goldLoss); + data.store("lifeLoss", this.difficultyData.lifeLoss); + data.store("spawnRank", this.difficultyData.spawnRank); + data.store("rewardMaxFactor", this.difficultyData.rewardMaxFactor); data.store("name", name); data.store("heroRace", heroRace); From 0c6ee4992a058106c8d77aa5e340b85c5b9a1fcc Mon Sep 17 00:00:00 2001 From: jjayers99 <56438137+jjayers99@users.noreply.github.com> Date: Sun, 16 Jul 2023 22:01:36 -0400 Subject: [PATCH 3/3] Adventure - Difficulty data storage fix --- forge-gui-mobile/src/forge/adventure/player/AdventurePlayer.java | 1 + 1 file changed, 1 insertion(+) diff --git a/forge-gui-mobile/src/forge/adventure/player/AdventurePlayer.java b/forge-gui-mobile/src/forge/adventure/player/AdventurePlayer.java index a840f8ca785..57b52d11390 100644 --- a/forge-gui-mobile/src/forge/adventure/player/AdventurePlayer.java +++ b/forge-gui-mobile/src/forge/adventure/player/AdventurePlayer.java @@ -282,6 +282,7 @@ public class AdventurePlayer implements Serializable, SaveFileContent { if (this.difficultyData.sellFactor == 0) this.difficultyData.sellFactor = 0.2f; + //BEGIN SPECIAL CASES //Previously these were not being read from or written to save files, causing defaults to appear after reload //Pull from config if appropriate DifficultyData configuredDifficulty = null;