-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathConfigFile.cs
350 lines (286 loc) · 10.5 KB
/
ConfigFile.cs
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Microsoft.Xna.Framework;
using Terraria;
using System.IO;
using Terraria.ModLoader;
using Terraria.ModLoader.Config;
using Microsoft.Xna.Framework.Graphics;
using Newtonsoft.Json.Converters;
using System.Collections;
using System.ComponentModel;
using System.Runtime.Serialization;
using Terraria.ModLoader.UI;
using AnotherRpgMod.UI;
using Terraria.ID;
namespace AnotherRpgMod
{
[Flags]
public enum GamePlayFlag
{
NONE = 0x0,
NPCPROGRESS = 0x1,
XPREDUTION = 0x2,
NPCRARITY = 0x4,
NPCMODIFIER = 0x8,
BOSSMODIFIER = 0x10,
BOSSCLUSTERED = 0x20,
RPGPlayer = 0x40,
ITEMRARITY = 0x80,
ITEMMODIFIER = 0x100,
LIMITNPCGROWTH = 0x200,
DISPLAYNPCNAME = 0x400,
BOSSKILLINCREASELEVEL = 0x800
}
[Label("AnRPG display config")]
public class VisualConfig : ModConfig
{
// You MUST specify a MultiPlayerSyncMode.
public override ConfigScope Mode => ConfigScope.ClientSide;
[Label("HealthBar Offset")]
[Tooltip("Health Bar Offset on the Y axis")]
[Range(-500f, 1500f)]
[Increment(10f)]
[DefaultValue(100)]
public float HealthBarYoffSet;
[Label("Health Bar Scale")]
[Range(0.1f, 3f)]
[Increment(.25f)]
[DefaultValue(0.75f)]
public float HealthBarScale;
[Label("Other UI Scale")]
[Tooltip("Used for the scale of all other UI element from Another RPG Mod")]
[Range(0.1f, 3f)]
[Increment(.25f)]
[DefaultValue(0.75f)]
public float UI_Scale;
[Label("Display npc name")]
[Tooltip("Display NPC information at all time and detailed information when mouse over")]
[DefaultValue(true)]
public bool DisplayNpcName;
[Label("Display Town names")]
[Tooltip("Display Town Npc information at all time and detailed information when mouse over")]
[DefaultValue(true)]
public bool DisplayTownName;
[Label("Hide Old Bar")]
[Tooltip("Hide The vanilla game HealthBar")]
[DefaultValue(true)]
public bool HideVanillaHB;
public override void OnLoaded()
{
AnotherRpgMod.visualConfig = this;
}
public override void OnChanged()
{
if (Main.netMode != NetmodeID.Server)
{
AnotherRpgMod.visualConfig = this;
if (AnotherRpgMod.Instance!= null) {
AnotherRpgMod.Instance.healthBar.Reset();
AnotherRpgMod.Instance.OpenST.Reset();
AnotherRpgMod.Instance.openStatMenu.Reset();
}
}
}
}
[Label("AnRPG gameplay config")]
public class GamePlayConfig : ModConfig
{
// You MUST specify a MultiPlayerSyncMode.
public override ConfigScope Mode => ConfigScope.ServerSide;
[Label("Xp Level Reduction")]
[Tooltip("Reduce the exp gained when the entity level is too low, look at Xp Reduction delta to change the value")]
[DefaultValue(true)]
public bool XPReduction;
[Label("RPG Player Module")]
[Tooltip("Enable all Player related RPG elements")]
[DefaultValue(true)]
public bool RPGPlayer;
[Label("Item Rarity")]
[Tooltip("Enable item rarity like : Broken, Masterpiece, Legendary...")]
[DefaultValue(true)]
public bool ItemRarity;
[Label("Item Modifier")]
[Tooltip("Enable Item modifier like : Bonus damage based on distance...")]
[DefaultValue(true)]
public bool ItemModifier;
[Label("Item Tree")]
[Tooltip("Enable Skill Tree evolution for Item")]
[DefaultValue(true)]
public bool ItemTree;
[Label("Item Ascension Limit")]
[Tooltip("Cap the maximum ascension based on the world progress")]
[DefaultValue(true)]
public bool AscendLimit;
[Label("Item Ascension Limit Per Boss")]
[Tooltip("How much the ascend limit Increase Per boss, 0.5 mean one for two each boss killed, '2' mean two for each boss killed")]
[Range(0.1F, 10F)]
[Increment(.25f)]
[DefaultValue(1f)]
public float AscendLimitPerBoss;
[Label("Xp Reduction Delta")]
[Tooltip("Level range at which the xp gain will start to be reduced")]
[DefaultValue(10)]
public int XPReductionDelta;
[Label("Xp Multiplier")]
[Tooltip("Multiply all xp gain for Player by this value")]
[Range(0.1F, 50F)]
[Increment(.25f)]
[DefaultValue(1f)]
public float XpMultiplier;
[Label("Item Xp Multiplier")]
[Tooltip("Multiply all xp gain for weapon by this value")]
[Range(0.1F, 50F)]
[Increment(.25f)]
[DefaultValue(1f)]
public float ItemXpMultiplier;
[Label("Life Leech Cooldown")]
[Tooltip("CoolDown between Each LifeLeech procc")]
[Range(0.01f, 5F)]
[Increment(.25f)]
[DefaultValue(1f)]
public float LifeLeechCD;
[Label("Vanity give stat")]
[Tooltip("Allow vanity object to give stat")]
[DefaultValue(false)]
public bool VanityGiveStat;
[Label("Use Custom SkillTree")]
[Tooltip("When true, it'll use the JsonSkillTree in \"Documents\\My Games\\Terraria\\ModLoader\\Mod Configs\\AnRPG\" ")]
[DefaultValue(false)]
public bool UseCustomSkillTree;
public override void OnLoaded()
{
AnotherRpgMod.gpConfig = this;
}
public override void OnChanged()
{
AnotherRpgMod.gpConfig = this;
}
}
[Label("AnRPG Enemies config")]
public class NPCConfig : ModConfig
{
public override ConfigScope Mode => ConfigScope.ServerSide;
[Label("Npc Progression")]
[Tooltip("Npc level enable/Disable")]
[DefaultValue(true)]
public bool NPCProgress;
[Label("NPC Rank")]
[Tooltip("Enable NPC rank, like : Alpha, Legendary ect ...")]
[DefaultValue(true)]
public bool NPCRarity;
[Label("NPC Modifier")]
[Tooltip("Enable NPC modifier, like : The golden, Clustered ect ...")]
[DefaultValue(true)]
public bool NPCModifier;
[Label("Boss Rarity")]
[Tooltip("Apply Rarity to boss")]
[DefaultValue(true)]
public bool BossRarity;
[Label("Boss Modifier")]
[Tooltip("Apply modifier to boss")]
[DefaultValue(true)]
public bool BossModifier;
[Label("Boss Clustered")]
[Tooltip("Enable Clustered modifier on boss, it's disable since most people don't want an army of boss spawning after killing one")]
[DefaultValue(false)]
public bool BossClustered;
[Label("Limit NPC growth")]
[Tooltip("If activated cap max npc level arround the Player level based on Limit NPC growth Value")]
[DefaultValue(true)]
public bool LimitNPCGrowth;
[Label("Limit NPC growth Value")]
[Tooltip("If Limit Npc Growth is actiaved, limit npc level by your level + this value + level X Growth Percent")]
[Range(0, int.MaxValue)]
[Increment(10)]
[DefaultValue(20)]
public int LimitNPCGrowthValue;
[Label("Limit NPC growth Percent")]
[Tooltip("If Limit Npc Growth is actiaved, limit npc level by your level + Growth Value + level X Growth Percent ")]
[Range(0f, 200f)]
[Increment(5f)]
[DefaultValue(20f)]
public float LimitNPCGrowthPercent;
[Label("Npc Level Multiplier")]
[Tooltip("Multiply all npc level by this value")]
[Range(0.1F, 50F)]
[Increment(.25f)]
[DefaultValue(1f)]
public float NpclevelMultiplier;
[Label("Npc Projectile Level")]
[Tooltip("Used as a workd-arround to scale NPC projectile, tweak this value if needed")]
[Range(1, 2500)]
[Increment(10)]
[DefaultValue(10)]
public int NPCProjectileDamageLevel;
[Label("Npc Damage Multiplier")]
[Tooltip("Multiply all npc Damage by this value")]
[Range(0.1F, 50F)]
[Increment(.25f)]
[DefaultValue(1f)]
public float NpcDamageMultiplier;
[Label("Npc Health Multiplier")]
[Tooltip("Multiply all npc Health by this value")]
[Range(0.1F, 50F)]
[Increment(.25f)]
[DefaultValue(1f)]
public float NpcHealthMultiplier;
[Label("Boss Health multiplier")]
[Tooltip("Multiplier to boss health")]
[Range(0.1f, 10f)]
[Increment(.1f)]
[DefaultValue(1f)]
public float BossHealthMultiplier;
[Label("Each Boss Kill NPC growth")]
[Tooltip("When True, Each boss kill will increase the global level (instead of just the first kill) ")]
[DefaultValue(false)]
public bool BossKillLevelIncrease;
[Label("NPC growth Per Boss")]
[Tooltip("How many level the world gain when killing a boss")]
[Range(1, int.MaxValue)]
[Increment(5)]
[DefaultValue(15)]
public int NPCGrowthValue;
[Label("NPC growth OnHardMode")]
[Tooltip("How many level the world gain when entering hardmode")]
[Range(1, int.MaxValue)]
[Increment(5)]
[DefaultValue(50)]
public int NPCGrowthHardMode;
[Label("NPC growth Hard Mode Percent")]
[Tooltip("Multiply the world level by this value (applied before \"NPC growth OnHardMode\")")]
[Range(1f, 10f)]
[Increment(0.1f)]
[DefaultValue(1.1f)]
public float NPCGrowthHardModePercent;
public override void OnLoaded()
{
AnotherRpgMod.NPCConfig = this;
}
public override void OnChanged()
{
AnotherRpgMod.NPCConfig = this;
JsonSkillTree.Load();
JsonCharacterClass.Load();
}
}
public class Config
{
static public VisualConfig vConfig
{
get { return AnotherRpgMod.visualConfig; }
}
static public GamePlayConfig gpConfig
{
get { return AnotherRpgMod.gpConfig; }
}
static public NPCConfig NPCConfig
{
get { return AnotherRpgMod.NPCConfig; }
}
}
}