summaryrefslogtreecommitdiff
path: root/YWD/src/main/java/fyresmodjam/misc/ConfigData.java
blob: c43930c4d1910e2aa2390c3032d0ed7ef46eb5a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
package fyresmodjam.misc;

import org.lwjgl.input.Keyboard;

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;

	/*
	 * Keybindings
	 */
	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;
	
	// Towers
	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;
	
	// Mushrooms
	public static int mushroomReplaceChance = 15;

	/*
	 * Statistic tracking
	 */
	public static boolean enableWeaponKillStats = true;
	public static boolean enableMobKillStats = true;
	public static boolean enableCraftingStats = true;

	/*
	 * Blessing/Mark parameters
	 */
	public static final double RETALIATION_CHANCE = 0.05;

	/*
	 * Misc. Toggles
	 */
	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) {
		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)
				.getBoolean(disableDisadvantages);
		versionChecking = config.get(Configuration.CATEGORY_GENERAL, "version_checking", versionChecking)
				.getBoolean(versionChecking);

		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)
				.getBoolean(enableMobKillStats);
		enableWeaponKillStats = config
				.get(Configuration.CATEGORY_GENERAL, "enable_weapon_kill_stats", enableWeaponKillStats)
				.getBoolean(enableWeaponKillStats);
		enableCraftingStats = config.get(Configuration.CATEGORY_GENERAL, "enable_crafting_stats", enableCraftingStats)
				.getBoolean(enableCraftingStats);

		trapsBelowGroundOnly = config
				.get(Configuration.CATEGORY_GENERAL, "traps_below_ground_only", trapsBelowGroundOnly)
				.getBoolean(trapsBelowGroundOnly);
	}
}