mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Merge pull request #3480 from jjayers99/master
Adventure Difficulty data storage fix
This commit is contained in:
@@ -282,9 +282,38 @@ 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;
|
||||
//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;
|
||||
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 +442,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);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map version="1.10" tiledversion="1.10.1" orientation="orthogonal" renderorder="right-down" width="40" height="40" tilewidth="16" tileheight="16" infinite="0" nextlayerid="7" nextobjectid="81">
|
||||
<map version="1.10" tiledversion="1.10.1" orientation="orthogonal" renderorder="right-down" width="40" height="40" tilewidth="16" tileheight="16" infinite="0" nextlayerid="7" nextobjectid="82">
|
||||
<editorsettings>
|
||||
<export target="wastetown..tmx" format="tmx"/>
|
||||
</editorsettings>
|
||||
@@ -18,7 +18,7 @@
|
||||
</layer>
|
||||
<layer id="6" name="Ground2" width="40" height="40">
|
||||
<data encoding="base64" compression="zlib">
|
||||
eJzNmEtO40AQhnsFSAlKxOsCARMwK2AHF2FPIOxnBi4AgRXiAHAGQFwAkgAi4hScgNcMmxlNWbiVSlHVLzshv1SSH+325+qu6nJHRaVisAhsHmwYNJfyxKlVwFpg7SHhawLHbMqYsD2A/Sgp9XNI7Fepy6jHdKKs1OSQ2FS568c24ZsBu/gmmyZ8WBPMvXlhfjQKSh0iOyr03j8o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+TeX97YRq2KjcHjc+cN2ijvMzFDsvXMFjKBc+nKukD4O69iqT/Fy05aNy60Hmby76Q/ifijO+eD62GR+uwuK/FhYAn9D+i4mhGnM9yfUDM+L56E+aPY8lY8aVr6RhxGNdT0F9OvFnWyk7Ths+ri55hbF5Y8ZajW2uDuD6jjO+ap2OheOaixuTtduU70bTD8fKxY3ULTpeX4hm6Bqwy/qRqzOJV1jnnhqz/sq1IIqPku5/Tl0HqfYbTB+YQX6nKV9himfyopG1XByfR/DtO+7nBIq7x7SX1fPF2c9Jao+JGt/znN1eziU6vsgN9nFp2V9L6U/1n6ueytHnrqL41Jzzn0rKfzaS5Ste9zpEuyD3XTvymeSSB/tu+2pzyeaP2H/qvmaTYFJtlJI5g+LwkM/w+S+Eme+Q
|
||||
</data>
|
||||
</layer>
|
||||
<layer id="3" name="Walls" width="40" height="40">
|
||||
@@ -244,5 +244,11 @@
|
||||
<property name="signYOffset" type="float" value="0"/>
|
||||
</properties>
|
||||
</object>
|
||||
<object id="81" template="../../obj/shardtrader.tx" x="495" y="162" width="19" height="19">
|
||||
<properties>
|
||||
<property name="signXOffset" type="float" value="14"/>
|
||||
<property name="signYOffset" type="float" value="-2"/>
|
||||
</properties>
|
||||
</object>
|
||||
</objectgroup>
|
||||
</map>
|
||||
|
||||
Reference in New Issue
Block a user