diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2019-08-22 19:54:41 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2019-08-22 19:54:41 -0400 |
| commit | c918a1b6d8008773e9beebb48ba1a770405aee20 (patch) | |
| tree | 7588d9e570addc61d2f318697662e6f2156fa04e /YWD/src/main/java/fyresmodjam/misc/ConfigData.java | |
| parent | 3eb8c7a8fca3f22475d53e30f0b90a6737f313fa (diff) | |
Bulk update back to sanity
Diffstat (limited to 'YWD/src/main/java/fyresmodjam/misc/ConfigData.java')
| -rw-r--r-- | YWD/src/main/java/fyresmodjam/misc/ConfigData.java | 164 |
1 files changed, 72 insertions, 92 deletions
diff --git a/YWD/src/main/java/fyresmodjam/misc/ConfigData.java b/YWD/src/main/java/fyresmodjam/misc/ConfigData.java index 0d7a328..c43930c 100644 --- a/YWD/src/main/java/fyresmodjam/misc/ConfigData.java +++ b/YWD/src/main/java/fyresmodjam/misc/ConfigData.java @@ -6,6 +6,12 @@ import net.minecraftforge.common.config.Configuration; public class ConfigData { /* + * Categories for config options. + */ + private static final String CTG_WORLDGEN = "worldgen"; + private static final String CTG_MOBS = "mobs"; + + /* * Starting ID for achievements */ public static int achievementID = 2500; @@ -13,32 +19,36 @@ public class ConfigData { /* * Keybindings */ - public static int examineKey = Keyboard.KEY_X; - public static int blessingKey = Keyboard.KEY_K; + public static int examineKey = Keyboard.KEY_X; + public static int blessingKey = Keyboard.KEY_K; /* * World generation settings */ + // Pillars - public static int pillarGenChance = 75; - public static int maxPillarsPerChunk = 3; - public static boolean spawnRandomPillars = true; + public static int pillarGenChance = 75; + public static int maxPillarsPerChunk = 3; + public static boolean spawnRandomPillars = true; + // Towers - public static int towerGenChance = 225; - public static boolean spawnTowers = true; + public static int towerGenChance = 225; + public static boolean spawnTowers = true; + // Traps - public static int trapGenChance = 300; - public static boolean spawnTraps = true; - public static boolean trapsBelowGroundOnly = false; + public static int trapGenChance = 300; + public static boolean spawnTraps = true; + public static boolean trapsBelowGroundOnly = false; + // Mushrooms public static int mushroomReplaceChance = 15; /* * Statistic tracking */ - public static boolean enableWeaponKillStats = true; - public static boolean enableMobKillStats = true; - public static boolean enableCraftingStats = true; + public static boolean enableWeaponKillStats = true; + public static boolean enableMobKillStats = true; + public static boolean enableCraftingStats = true; /* * Blessing/Mark parameters @@ -48,93 +58,63 @@ public class ConfigData { /* * Misc. Toggles */ - public static boolean pillarGlow = true; - public static boolean disableDisadvantages = false; - public static boolean versionChecking = true; - public static boolean showAllPillarsInCreative = false; + public static boolean pillarGlow = true; + public static boolean disableDisadvantages = false; + public static boolean versionChecking = true; + public static boolean showAllPillarsInCreative = false; + + /* + * Mob config data + */ + // One in X normal mobs will receive a blessing + public static int diabolicChance = 20; + // A mob of at least this level will receive a blessing + public static int blessingLevel = 5; + // Determines how likely a mob is to be leveled up. Higher is lower + public static int levelupChance = 3; + // A mob gets this percentage of their health additional per level + public static double healthLevelMult = 0.25; + // A mob gets this flat amount on top of their adjusted health, per level + public static int healthLevelFlat = 1; + public static void loadFromConfig(Configuration config) { - pillarGlow = config - .get(Configuration.CATEGORY_GENERAL, - "pillar_glow", - pillarGlow) - .getBoolean(pillarGlow); - - pillarGenChance = config - .get(Configuration.CATEGORY_GENERAL, - "pillar_gen_difficulty", - pillarGenChance) - .getInt(); - maxPillarsPerChunk = config.get( - Configuration.CATEGORY_GENERAL, - "max_pillars_per_chunk", - maxPillarsPerChunk).getInt(); - towerGenChance = config - .get(Configuration.CATEGORY_GENERAL, - "tower_gen_difficulty", - towerGenChance) - .getInt(); - trapGenChance = config - .get(Configuration.CATEGORY_GENERAL, - "trap_gen_difficulty", - trapGenChance) - .getInt(); - mushroomReplaceChance = config.get( - Configuration.CATEGORY_GENERAL, - "mushroom_replace_difficulty", - mushroomReplaceChance).getInt(); - - spawnTraps = !(config - .get(Configuration.CATEGORY_GENERAL, - "disable_traps", - !spawnTraps) - .getBoolean(!spawnTraps)); - spawnTowers = config - .get(Configuration.CATEGORY_GENERAL, - "spawn_towers", - spawnTowers) - .getBoolean(spawnTowers); - spawnRandomPillars = config.get( - Configuration.CATEGORY_GENERAL, - "spawn_random_pillars", - spawnRandomPillars) + diabolicChance = config.get(CTG_MOBS, "diabolic_chance", diabolicChance).getInt(); + blessingLevel = config.get(CTG_MOBS, "blessing_level", diabolicChance).getInt(); + levelupChance = config.get(CTG_MOBS, "levelup_chance", diabolicChance).getInt(); + healthLevelMult = config.get(CTG_MOBS, "health_level_mult", 0).getDouble(); + healthLevelFlat = config.get(CTG_MOBS, "health_level_flat", 0).getInt(); + + pillarGlow = config.get(Configuration.CATEGORY_GENERAL, "pillar_glow", pillarGlow).getBoolean(pillarGlow); + + pillarGenChance = config.get(CTG_WORLDGEN, "pillar_gen_difficulty", pillarGenChance).getInt(); + maxPillarsPerChunk = config.get(CTG_WORLDGEN, "max_pillars_per_chunk", maxPillarsPerChunk).getInt(); + towerGenChance = config.get(CTG_WORLDGEN, "tower_gen_difficulty", towerGenChance).getInt(); + trapGenChance = config.get(CTG_WORLDGEN, "trap_gen_difficulty", trapGenChance).getInt(); + mushroomReplaceChance = config.get(CTG_WORLDGEN, "mushroom_replace_difficulty", mushroomReplaceChance).getInt(); + spawnTraps = !(config.get(CTG_WORLDGEN, "disable_traps", !spawnTraps).getBoolean(!spawnTraps)); + spawnTowers = config.get(CTG_WORLDGEN, "spawn_towers", spawnTowers).getBoolean(spawnTowers); + spawnRandomPillars = config.get(CTG_WORLDGEN, "spawn_random_pillars", spawnRandomPillars) .getBoolean(spawnRandomPillars); - disableDisadvantages = config.get( - Configuration.CATEGORY_GENERAL, - "disable_disadvantages", - disableDisadvantages) + + disableDisadvantages = config.get(Configuration.CATEGORY_GENERAL, "disable_disadvantages", disableDisadvantages) .getBoolean(disableDisadvantages); - versionChecking = config - .get(Configuration.CATEGORY_GENERAL, - "version_checking", - versionChecking) + versionChecking = config.get(Configuration.CATEGORY_GENERAL, "version_checking", versionChecking) .getBoolean(versionChecking); - - showAllPillarsInCreative = config.get( - Configuration.CATEGORY_GENERAL, - "show_all_pillars_in_creative", - showAllPillarsInCreative) + + showAllPillarsInCreative = config + .get(Configuration.CATEGORY_GENERAL, "show_all_pillars_in_creative", showAllPillarsInCreative) .getBoolean(showAllPillarsInCreative); - - enableMobKillStats = config.get( - Configuration.CATEGORY_GENERAL, - "enable_mob_kill_stats", - enableMobKillStats) + + enableMobKillStats = config.get(Configuration.CATEGORY_GENERAL, "enable_mob_kill_stats", enableMobKillStats) .getBoolean(enableMobKillStats); - enableWeaponKillStats = config.get( - Configuration.CATEGORY_GENERAL, - "enable_weapon_kill_stats", - enableWeaponKillStats) + enableWeaponKillStats = config + .get(Configuration.CATEGORY_GENERAL, "enable_weapon_kill_stats", enableWeaponKillStats) .getBoolean(enableWeaponKillStats); - enableCraftingStats = config.get( - Configuration.CATEGORY_GENERAL, - "enable_crafting_stats", - enableCraftingStats) + enableCraftingStats = config.get(Configuration.CATEGORY_GENERAL, "enable_crafting_stats", enableCraftingStats) .getBoolean(enableCraftingStats); - - trapsBelowGroundOnly = config.get( - Configuration.CATEGORY_GENERAL, - "traps_below_ground_only", - trapsBelowGroundOnly) + + trapsBelowGroundOnly = config + .get(Configuration.CATEGORY_GENERAL, "traps_below_ground_only", trapsBelowGroundOnly) .getBoolean(trapsBelowGroundOnly); } }
\ No newline at end of file |
