Repository navigation
Expand file tree
/
Copy pathModEntry.cs
More file actions
521 lines (422 loc) · 46.8 KB
/
Copy pathModEntry.cs
File metadata and controls
521 lines (422 loc) · 46.8 KB
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
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
using GenericModConfigMenu;
using HarmonyLib;
using LevelForMore.Classes;
using Newtonsoft.Json;
using StardewModdingAPI;
using StardewModdingAPI.Events;
using StardewValley;
using System.Runtime.Serialization;
namespace LevelForMore
{
/// <summary>
/// Defines a configurable drop rule used in the Mine For More mod to enhance Mining and Foraging.
/// Each rule determines which item drops, under what conditions (such as skill type or object ID),
/// and how many items are added or multiplied. It can also control the chance to spawn extra resource nodes.
/// This model powers all drop-related behavior for ores, gems, logs, forageables, and more.
/// </summary>
public class ResourceDropRule
{
public string Name { get; set; } = "";
public string SkillType { get; set; } = "";
public string Type { get; set; } = "";
public string ObjectID { get; set; } = "";
public int AddAmount { get; set; } = 3;
public double Multiplier { get; set; } = 1.0;
public float ExtraNodeSpawnChancePercent { get; set; } = 0f;
public List<string> DropsFromObjectIDs { get; set; } = new();
}
/// <summary>
/// Defines all configurable options for the Mine For More mod, including global toggles,
/// skill-specific multipliers, and embedded drop rules for mining and foraging resources.
/// </summary>
public class Config
{
public bool TurnOnMineForMore { get; set; } = true;
public bool CanMineOnDay1 { get; set; } = true;
public bool AllowPlayerToExceedLevel10 { get; set; } = true;
public bool TurnOnProfessionLevelUpDescription { get; set; } = true;
public bool AllowExtraNodeSpawnsInMine { get; set; } = true;
public bool DebugMode { get; set; } = false;
// Mining
public float MinerProfessionBonusOrePerLevel { get; set; } = 1.0f;
public float GeologistProfessionBonusGemsPerLevel { get; set; } = 1.0f;
public float ProspectorProfessionBonusCoalPerLevel { get; set; } = 1.0f;
public float ExcavatorProfessionBonusGeodesPerLevel { get; set; } = 1.0f;
// Foraging
public float ForesterWoodPerLevelBonus { get; set; } = 3.0f;
public float ForesterSeedPerLevelBonus { get; set; } = 1.0f;
public float ForesterTreeGrowthPerLevelBonus { get; set; } = 0.10f;
public float GathererExtraDropPerLevel { get; set; } = 1.5f;
public float LumberjackHardwoodPerLevelBonus { get; set; } = 0.5f;
public float LumberjackHardwordDropChancePerLevelBonus { get; set; } = 0.025f;
public float TapperSpeedBonusPercentPerLevel { get; set; } = 0.25f;
public float TapperExtraQuantityPerLevel { get; set; } = 1.0f;
// Node spawn chance with profession
public float GemNodeSpawnChanceBonusWithProfession { get; set; } = 1f;
public float GeodeNodeSpawnChanceBonusWithProfession { get; set; } = 1f;
public float CoalNodeSpawnChanceBonusWithProfession { get; set; } = 1f;
// === Source of truth ===
public Dictionary<string, ResourceDropRule> Rules { get; set; } = new();
// === Legacy strongly-typed rules (JsonIgnore) ===
[JsonIgnore] public ResourceDropRule Stone { get; set; } = new() { Name = "Stone", SkillType = "Mining", Type = "Ore", ObjectID = "(O)390", DropsFromObjectIDs = new() { "32", "34", "36", "38", "40", "48", "50", "52", "54", "56", "58", "343", "450", "668", "670", "760", "762", "845", "846", "847" } };
[JsonIgnore] public ResourceDropRule CopperOre { get; set; } = new() { Name = "Copper Ore", SkillType = "Mining", Type = "Ore", ObjectID = "(O)378", DropsFromObjectIDs = new() { "751" } };
[JsonIgnore] public ResourceDropRule IronOre { get; set; } = new() { Name = "Iron Ore", SkillType = "Mining", Type = "Ore", ObjectID = "(O)380", DropsFromObjectIDs = new() { "290" } };
[JsonIgnore] public ResourceDropRule GoldOre { get; set; } = new() { Name = "Gold Ore", SkillType = "Mining", Type = "Ore", ObjectID = "(O)384", DropsFromObjectIDs = new() { "764" } };
[JsonIgnore] public ResourceDropRule IridiumOre { get; set; } = new() { Name = "Iridium Ore", SkillType = "Mining", Type = "Ore", ObjectID = "(O)386", DropsFromObjectIDs = new() { "765" } };
[JsonIgnore] public ResourceDropRule RadioactiveOre { get; set; } = new() { Name = "Radioactive Ore", SkillType = "Mining", Type = "Ore", ObjectID = "(O)909", DropsFromObjectIDs = new() { "95" } };
[JsonIgnore] public ResourceDropRule CinderShard { get; set; } = new() { Name = "Cinder Shard", SkillType = "Mining", Type = "Ore", ObjectID = "(O)848", DropsFromObjectIDs = new() { "843", "844" } };
[JsonIgnore] public ResourceDropRule Coal { get; set; } = new() { Name = "Coal", SkillType = "Mining", Type = "Coal&Others", ObjectID = "(O)382", DropsFromObjectIDs = new() { "VolcanoCoalNode0", "VolcanoCoalNode1", "BasicCoalNode0", "BasicCoalNode1" } };
[JsonIgnore] public ResourceDropRule Clay { get; set; } = new() { Name = "Clay", SkillType = "Mining", Type = "Coal&Others", ObjectID = "(O)330", DropsFromObjectIDs = new() { "818" } };
[JsonIgnore] public ResourceDropRule Diamond { get; set; } = new() { Name = "Diamond", SkillType = "Mining", Type = "Gem", ObjectID = "(O)72", DropsFromObjectIDs = new() { "2" } };
[JsonIgnore] public ResourceDropRule Amethyst { get; set; } = new() { Name = "Amethyst", SkillType = "Mining", Type = "Gem", ObjectID = "(O)66", DropsFromObjectIDs = new() { "8" } };
[JsonIgnore] public ResourceDropRule Aquamarine { get; set; } = new() { Name = "Aquamarine", SkillType = "Mining", Type = "Gem", ObjectID = "(O)62", DropsFromObjectIDs = new() { "14" } };
[JsonIgnore] public ResourceDropRule Emerald { get; set; } = new() { Name = "Emerald", SkillType = "Mining", Type = "Gem", ObjectID = "(O)60", DropsFromObjectIDs = new() { "12" } };
[JsonIgnore] public ResourceDropRule Topaz { get; set; } = new() { Name = "Topaz", SkillType = "Mining", Type = "Gem", ObjectID = "(O)68", DropsFromObjectIDs = new() { "10" } };
[JsonIgnore] public ResourceDropRule Ruby { get; set; } = new() { Name = "Ruby", SkillType = "Mining", Type = "Gem", ObjectID = "(O)64", DropsFromObjectIDs = new() { "4" } };
[JsonIgnore] public ResourceDropRule Jade { get; set; } = new() { Name = "Jade", SkillType = "Mining", Type = "Gem", ObjectID = "(O)70", DropsFromObjectIDs = new() { "6" } };
[JsonIgnore] public ResourceDropRule Geode { get; set; } = new() { Name = "Geode", SkillType = "Mining", Type = "Geode", ObjectID = "(O)535", DropsFromObjectIDs = new() { "75" } };
[JsonIgnore] public ResourceDropRule FrozenGeode { get; set; } = new() { Name = "Frozen Geode", SkillType = "Mining", Type = "Geode", ObjectID = "(O)536", DropsFromObjectIDs = new() { "76" } };
[JsonIgnore] public ResourceDropRule MagmaGeode { get; set; } = new() { Name = "Magma Geode", SkillType = "Mining", Type = "Geode", ObjectID = "(O)537", DropsFromObjectIDs = new() { "77" } };
[JsonIgnore] public ResourceDropRule OmniGeode { get; set; } = new() { Name = "Omni Geode", SkillType = "Mining", Type = "Geode", ObjectID = "(O)749", DropsFromObjectIDs = new() { "819" } };
// More Custom Gems Conversion (dynamic bonus handled by ExtraMoreCustomGemsDropsPatch)
[JsonIgnore] public ResourceDropRule Alexandrite { get; set; } = new() { Name = "Alexandrite", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)Alexandrite" };
[JsonIgnore] public ResourceDropRule Ammolite { get; set; } = new() { Name = "Ammolite", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)Ammolite" };
[JsonIgnore] public ResourceDropRule Apatite { get; set; } = new() { Name = "Apatite", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)Apatite" };
[JsonIgnore] public ResourceDropRule Azurite { get; set; } = new() { Name = "Azurite", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)Azurite" };
[JsonIgnore] public ResourceDropRule Bloodstone { get; set; } = new() { Name = "Bloodstone", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)Bloodstone" };
[JsonIgnore] public ResourceDropRule BlueZircon { get; set; } = new() { Name = "Blue Zircon", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)BlueZircon" };
[JsonIgnore] public ResourceDropRule BrownZircon { get; set; } = new() { Name = "Brown Zircon", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)BrownZircon" };
[JsonIgnore] public ResourceDropRule Chryzokola { get; set; } = new() { Name = "Chryzokola", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)Chryzokola" };
[JsonIgnore] public ResourceDropRule Clinohumite { get; set; } = new() { Name = "Clinohumite", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)Clinohumite" };
[JsonIgnore] public ResourceDropRule BlueCoral { get; set; } = new() { Name = "Blue Coral", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)BlueCoral" };
[JsonIgnore] public ResourceDropRule BrownCoral { get; set; } = new() { Name = "Brown Coral", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)BrownCoral" };
[JsonIgnore] public ResourceDropRule GreenCoral { get; set; } = new() { Name = "Green Coral", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)GreenCoral" };
[JsonIgnore] public ResourceDropRule PurpleCoral { get; set; } = new() { Name = "Purple Coral", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)PurpleCoral" };
[JsonIgnore] public ResourceDropRule CrystalOfLife { get; set; } = new() { Name = "Crystal of Life", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)CrystalOfLife" };
[JsonIgnore] public ResourceDropRule CrystalOfDeath { get; set; } = new() { Name = "Crystal of Death", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)CrystalOfDeath" };
[JsonIgnore] public ResourceDropRule CrystalOfLifeAndDeath { get; set; } = new() { Name = "Crystal of Life and Death", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)CrystalOfLifeAndDeath" };
[JsonIgnore] public ResourceDropRule Cymophane { get; set; } = new() { Name = "Cymophane", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)Cymophane" };
[JsonIgnore] public ResourceDropRule Danburite { get; set; } = new() { Name = "Danburite", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)Danburite" };
[JsonIgnore] public ResourceDropRule FireAgate { get; set; } = new() { Name = "Fire Agate", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)FireAgate" };
[JsonIgnore] public ResourceDropRule Fluorite { get; set; } = new() { Name = "Fluorite", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)Fluorite" };
[JsonIgnore] public ResourceDropRule Labradorite { get; set; } = new() { Name = "Labradorite", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)Labradorite" };
[JsonIgnore] public ResourceDropRule LavaCrystal { get; set; } = new() { Name = "Lava Crystal", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)LavaCrystal" };
[JsonIgnore] public ResourceDropRule MossAgate { get; set; } = new() { Name = "Moss Agate", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)MossAgate" };
[JsonIgnore] public ResourceDropRule Phosphophyllite { get; set; } = new() { Name = "Phosphophyllite", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)Phosphophyllite" };
[JsonIgnore] public ResourceDropRule Andesine { get; set; } = new() { Name = "Andesine", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)Andesine" };
[JsonIgnore] public ResourceDropRule Aventurine { get; set; } = new() { Name = "Aventurine", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)Aventurine" };
[JsonIgnore] public ResourceDropRule LavenderQuartz { get; set; } = new() { Name = "Lavender Quartz", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)LavenderQuartz" };
[JsonIgnore] public ResourceDropRule RutilatedQuartz { get; set; } = new() { Name = "Rutilated Quartz", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)RutilatedQuartz" };
[JsonIgnore] public ResourceDropRule RedZircon { get; set; } = new() { Name = "Red Zircon", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)RedZircon" };
[JsonIgnore] public ResourceDropRule PurpleSapphire { get; set; } = new() { Name = "Purple Sapphire", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)PurpleSapphire" };
[JsonIgnore] public ResourceDropRule VioletSapphire { get; set; } = new() { Name = "Violet Sapphire", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)VioletSapphire" };
[JsonIgnore] public ResourceDropRule StarGarnet { get; set; } = new() { Name = "Star Garnet", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)StarGarnet" };
[JsonIgnore] public ResourceDropRule GoldTopaz { get; set; } = new() { Name = "Gold Topaz", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)GoldTopaz" };
[JsonIgnore] public ResourceDropRule SkyBlueTopaz { get; set; } = new() { Name = "Sky Blue Topaz", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)SkyBlueTopaz" };
[JsonIgnore] public ResourceDropRule YellowTopaz { get; set; } = new() { Name = "Yellow Topaz", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)YellowTopaz" };
[JsonIgnore] public ResourceDropRule YellowZircon { get; set; } = new() { Name = "Yellow Zircon", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)YellowZircon" };
[JsonIgnore] public ResourceDropRule Zircon { get; set; } = new() { Name = "Zircon", SkillType = "Mining", Type = "MoreCustomGemsConversion", ObjectID = "(O)Zircon" };
//FOraging item list
[JsonIgnore] public ResourceDropRule Oak_Wood { get; set; } = new() { Name = "Oak Wood", SkillType = "Foraging", Type = "Wood", ObjectID = "(O)388", DropsFromObjectIDs = new() { "TreeOak" } };
[JsonIgnore] public ResourceDropRule Oak_Seed { get; set; } = new() { Name = "Oak Seed", SkillType = "Foraging", Type = "Seed", ObjectID = "(O)309", AddAmount = 2, DropsFromObjectIDs = new() { "TreeOak" } };
[JsonIgnore] public ResourceDropRule Oak_Resin { get; set; } = new() { Name = "Oak Resin", SkillType = "Foraging", Type = "Tap", ObjectID = "(O)725", DropsFromObjectIDs = new() { "TreeOak" } };
[JsonIgnore] public ResourceDropRule Maple_Wood { get; set; } = new() { Name = "Maple Wood", SkillType = "Foraging", Type = "Wood", ObjectID = "(O)388", DropsFromObjectIDs = new() { "TreeMaple" } };
[JsonIgnore] public ResourceDropRule Maple_Seed { get; set; } = new() { Name = "Maple Seed", SkillType = "Foraging", Type = "Seed", ObjectID = "(O)310", AddAmount = 2, DropsFromObjectIDs = new() { "TreeMaple" } };
[JsonIgnore] public ResourceDropRule Maple_Syrup { get; set; } = new() { Name = "Maple Syrup", SkillType = "Foraging", Type = "Tap", ObjectID = "(O)724", DropsFromObjectIDs = new() { "TreeMaple" } };
[JsonIgnore] public ResourceDropRule Pine_Wood { get; set; } = new() { Name = "Pine Wood", SkillType = "Foraging", Type = "Wood", ObjectID = "(O)388", DropsFromObjectIDs = new() { "TreePine" } };
[JsonIgnore] public ResourceDropRule Pine_Seed { get; set; } = new() { Name = "Pine Cone", SkillType = "Foraging", Type = "Seed", ObjectID = "(O)311", AddAmount = 2, DropsFromObjectIDs = new() { "TreePine" } };
[JsonIgnore] public ResourceDropRule Pine_Tar { get; set; } = new() { Name = "Pine Tar", SkillType = "Foraging", Type = "Tap", ObjectID = "(O)726", DropsFromObjectIDs = new() { "TreePine" } };
[JsonIgnore] public ResourceDropRule Mahogany_Hardwood { get; set; } = new() { Name = "Mahogany Hardwood", SkillType = "Foraging", Type = "Hardwood", ObjectID = "(O)709", DropsFromObjectIDs = new() { "TreeMahogany" } };
[JsonIgnore] public ResourceDropRule Mahogany_Seed { get; set; } = new() { Name = "Mahogany Seed", SkillType = "Foraging", Type = "Seed", ObjectID = "(O)292", AddAmount = 2, DropsFromObjectIDs = new() { "TreeMahogany" } };
[JsonIgnore] public ResourceDropRule Mahogany_Sap { get; set; } = new() { Name = "Sap", SkillType = "Foraging", Type = "Tap", ObjectID = "(O)92", DropsFromObjectIDs = new() { "TreeMahogany" } };
[JsonIgnore] public ResourceDropRule LargeStump { get; set; } = new() { Name = "Large Stump Hardwood", SkillType = "Foraging", Type = "Hardwood", ObjectID = "(O)709", DropsFromObjectIDs = new() { "LargeStump" }, AddAmount = 2, Multiplier = 1.0 };
[JsonIgnore] public ResourceDropRule LargeLog { get; set; } = new() { Name = "Large Log Hardwood", SkillType = "Foraging", Type = "Hardwood", ObjectID = "(O)709", DropsFromObjectIDs = new() { "LargeLog" }, AddAmount = 3, Multiplier = 1.0 };
[JsonIgnore] public ResourceDropRule Sap { get; set; } = new() { Name = "Sap", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)92", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "92" } };
[JsonIgnore] public ResourceDropRule SeaUrchin { get; set; } = new() { Name = "Sea Urchin", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)397", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "397" } };
[JsonIgnore] public ResourceDropRule Coral { get; set; } = new() { Name = "Coral", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)393", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "393" } };
[JsonIgnore] public ResourceDropRule Mussel { get; set; } = new() { Name = "Mussel", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)719", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "719" } };
[JsonIgnore] public ResourceDropRule Clam { get; set; } = new() { Name = "Clam", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)372", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "372" } };
[JsonIgnore] public ResourceDropRule Oyster { get; set; } = new() { Name = "Oyster", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)723", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "723" } };
[JsonIgnore] public ResourceDropRule Seaweed { get; set; } = new() { Name = "Seaweed", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)152", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "152" } };
[JsonIgnore] public ResourceDropRule CactusFruit { get; set; } = new() { Name = "Cactus Fruit", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)90", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "90" } };
[JsonIgnore] public ResourceDropRule Daffodil { get; set; } = new() { Name = "Daffodil", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)18", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "18" } };
[JsonIgnore] public ResourceDropRule Dandelion { get; set; } = new() { Name = "Dandelion", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)22", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "22" } };
[JsonIgnore] public ResourceDropRule Leek { get; set; } = new() { Name = "Leek", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)20", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "20" } };
[JsonIgnore] public ResourceDropRule WildHorseradish { get; set; } = new() { Name = "Wild Horseradish", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)16", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "16" } };
[JsonIgnore] public ResourceDropRule SpringOnion { get; set; } = new() { Name = "Spring Onion", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)399", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "399" } };
[JsonIgnore] public ResourceDropRule Salmonberry { get; set; } = new() { Name = "Salmonberry", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)296", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "296" } };
[JsonIgnore] public ResourceDropRule Morel { get; set; } = new() { Name = "Morel", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)257", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "257" } };
[JsonIgnore] public ResourceDropRule CommonMushroom { get; set; } = new() { Name = "Common Mushroom", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)404", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "404" } };
[JsonIgnore] public ResourceDropRule SweetPea { get; set; } = new() { Name = "Sweet Pea", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)402", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "402" } };
[JsonIgnore] public ResourceDropRule SpiceBerry { get; set; } = new() { Name = "Spice Berry", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)396", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "396" } };
[JsonIgnore] public ResourceDropRule Grape { get; set; } = new() { Name = "Grape", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)398", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "398" } };
[JsonIgnore] public ResourceDropRule FiddleheadFern { get; set; } = new() { Name = "Fiddlehead Fern", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)490", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "490" } };
[JsonIgnore] public ResourceDropRule RedMushroom { get; set; } = new() { Name = "Red Mushroom", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)420", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "420" } };
[JsonIgnore] public ResourceDropRule Blackberry { get; set; } = new() { Name = "Blackberry", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)410", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "410" } };
[JsonIgnore] public ResourceDropRule Hazelnut { get; set; } = new() { Name = "Hazelnut", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)408", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "408" } };
[JsonIgnore] public ResourceDropRule WildPlum { get; set; } = new() { Name = "Wild Plum", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)406", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "406" } };
[JsonIgnore] public ResourceDropRule Chanterelle { get; set; } = new() { Name = "Chanterelle", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)422", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "422" } };
[JsonIgnore] public ResourceDropRule PurpleMushroom { get; set; } = new() { Name = "Purple Mushroom", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)422", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "422" } };
[JsonIgnore] public ResourceDropRule WinterRoot { get; set; } = new() { Name = "Winter Root", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)412", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "412" } };
[JsonIgnore] public ResourceDropRule SnowYam { get; set; } = new() { Name = "Snow Yam", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)416", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "416" } };
[JsonIgnore] public ResourceDropRule Crocus { get; set; } = new() { Name = "Crocus", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)418", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "418" } };
[JsonIgnore] public ResourceDropRule CrystalFruit { get; set; } = new() { Name = "Crystal Fruit", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)414", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "414" } };
[JsonIgnore] public ResourceDropRule Holly { get; set; } = new() { Name = "Holly", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)421", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "421" } };
[JsonIgnore] public ResourceDropRule Ginger { get; set; } = new() { Name = "Ginger", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)829", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "829" } };
[JsonIgnore] public ResourceDropRule MagmaCap { get; set; } = new() { Name = "Magma Cap", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)851", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "851" } };
[JsonIgnore] public ResourceDropRule Coconut { get; set; } = new() { Name = "Coconut", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)88", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "88" } };
[JsonIgnore] public ResourceDropRule Cherry { get; set; } = new() { Name = "Cherry", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)638", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "638" } };
[JsonIgnore] public ResourceDropRule Pomegranate { get; set; } = new() { Name = "Pomegranate", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)637", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "637" } };
[JsonIgnore] public ResourceDropRule Peach { get; set; } = new() { Name = "Peach", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)636", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "636" } };
[JsonIgnore] public ResourceDropRule Apple { get; set; } = new() { Name = "Apple", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)613", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "613" } };
[JsonIgnore] public ResourceDropRule Orange { get; set; } = new() { Name = "Orange", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)635", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "635" } };
[JsonIgnore] public ResourceDropRule Apricot { get; set; } = new() { Name = "Apricot", SkillType = "Foraging", Type = "Forage", ObjectID = "(O)634", AddAmount = 2, Multiplier = 1f, DropsFromObjectIDs = new() { "634" } };
public Config()
{
MergeLegacyIntoRules(overwriteExisting: false);
UpdateLegacyPropertiesFromRules();
}
private void UpdateLegacyPropertiesFromRules()
{
foreach (var pi in typeof(Config).GetProperties()
.Where(p => p.PropertyType == typeof(ResourceDropRule)))
{
var key = pi.Name;
if (Rules.TryGetValue(key, out var rule) && rule != null)
pi.SetValue(this, rule);
}
}
[OnDeserialized]
internal void OnDeserialized(StreamingContext _)
{
MergeLegacyIntoRules(overwriteExisting: false);
UpdateLegacyPropertiesFromRules();
}
private void MergeLegacyIntoRules(bool overwriteExisting)
{
foreach (var pi in typeof(Config).GetProperties().Where(p => p.PropertyType == typeof(ResourceDropRule)))
{
var rule = (ResourceDropRule)pi.GetValue(this);
if (rule == null) continue;
var key = pi.Name;
if (overwriteExisting || !Rules.ContainsKey(key))
Rules[key] = rule;
}
}
}
public class ModEntry : Mod
{
public static ModEntry Instance { get; private set; }
public Config Config { get; set; }
public uint realCurrentDay; //Used for MineOnDay1
public bool AddedAddQuickSmeltRecipes = false; //Used for Mining-Level 10 Blacksmith Profession
public bool AddedGemologistRecipes = false;
public bool SaveGameIsLoaded = false;
public override void Entry(IModHelper helper)
{
Instance = this;
Config = helper.ReadConfig<Config>();
helper.Events.GameLoop.GameLaunched += OnGameLaunched;
if (Config.TurnOnMineForMore)
{
var harmony = new Harmony(ModManifest.UniqueID);
if (Config.CanMineOnDay1)
{
new LevelForMore.Patches.MiningPatches.LandslidePatch().Apply(harmony, Monitor);
}
if (Config.TurnOnMineForMore)
{
new LevelForMore.Patches.ForagingPatches.PerformTreeFallPatch().Apply(harmony, Monitor);
new LevelForMore.Patches.ForagingPatches.TreeGrowthPatch().Apply(harmony, Monitor);
new LevelForMore.Patches.ForagingPatches.OnHarvestedForagePatch().Apply(harmony, Monitor);
new LevelForMore.Patches.ForagingPatches.GetShakenOffItemPatch().Apply(harmony, Monitor);
new LevelForMore.Patches.ForagingPatches.UpdateTapperProductPatch().Apply(harmony, Monitor);
new LevelForMore.Patches.ForagingPatches.ResourceClumpDestroyedPatch().Apply(harmony, Monitor);
new LevelForMore.Patches.MiningPatches.UpdateOreGemDropsPatch(Config).Apply(harmony, Monitor);
new LevelForMore.Patches.MiningPatches.ExtraMoreCustomGemsDrops_OnPickupAndManualDropPatch(Config, Monitor).Apply(harmony);
if (Config.TurnOnProfessionLevelUpDescription)
{
new ProfessionLevelDescriptionPatch(Config).Apply(harmony, Monitor);
}
if (Config.AllowExtraNodeSpawnsInMine)
{
new LevelForMore.Patches.MiningPatches.MineShaftOresPatches(Config).Apply(harmony, Monitor);
}
if (Config.AllowPlayerToExceedLevel10)
{
new UnlimitedSkillLevel(Config).Apply(harmony, Monitor);
}
}
helper.Events.GameLoop.SaveLoaded += OnSaveLoaded;
helper.Events.GameLoop.Saving += OnSaving;
helper.Events.GameLoop.ReturnedToTitle += OnReturnedToTitle;
}
}
private void OnSaveLoaded(object sender, SaveLoadedEventArgs e)
{
SaveGameIsLoaded = true;
//checks for player's Blacksmith profession and add recipes for quick smelt
if (Game1.player.professions.Contains(20) && !AddedAddQuickSmeltRecipes)
{
Recipe recipe = new Recipe(Instance);
recipe.AddQuickSmeltRecipes();
AddedAddQuickSmeltRecipes = true;
}
//Rebuilds GMCM so that it uses object item from localized languages
registerGMCM();
}
private void OnSaving(object sender, SavingEventArgs e)
{
}
private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
{
SaveGameIsLoaded = false;
registerGMCM();
}
//gets all DropResourceRules dynamically instead of manually entering each
public IEnumerable<ResourceDropRule> GetAllRules()
{
return this.Config?.Rules?.Values ?? Enumerable.Empty<ResourceDropRule>();
}
private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
{
registerGMCM();
}
// returns the localized item name for an object ID ("390" or "(O)390"); falls back to 'fallback' otherwise
private static string GetObjectName(string idOrQualifiedId, string fallback = null)
{
if (string.IsNullOrWhiteSpace(idOrQualifiedId))
return fallback ?? "";
string qid;
if (idOrQualifiedId.StartsWith("(O)", StringComparison.Ordinal))
qid = idOrQualifiedId;
else if (int.TryParse(idOrQualifiedId, out _))
qid = $"(O){idOrQualifiedId}";
else
return fallback ?? idOrQualifiedId; // not an object ID — assume it's already a label
try
{
return StardewValley.Object.GetObjectDisplayName(qid, null, null); // localized
}
catch
{
return fallback ?? idOrQualifiedId;
}
}
/// <summary>
/// Registers GMCM UI.
/// </summary>
private void registerGMCM()
{
IGenericModConfigMenuApi gmcm = Helper.ModRegistry.GetApi<IGenericModConfigMenuApi>("spacechase0.GenericModConfigMenu"); if (gmcm is null) return;
gmcm.Unregister(this.ModManifest);
gmcm.Register(mod: ModManifest, reset: () => Config = new Config(), save: () => Helper.WriteConfig(Config));
gmcm.AddSectionTitle(mod: ModManifest, text: () => Helper.Translation.Get("gmcm.section.editSkills.title"));
gmcm.AddParagraph(mod: ModManifest, text: () => Helper.Translation.Get("gmcm.section.editSkills.desc"));
gmcm.AddPageLink(mod: ModManifest, pageId: "Mining Settings", text: () => Helper.Translation.Get("gmcm.pageLink.mining.text"), tooltip: () => "");
gmcm.AddPageLink(mod: ModManifest, pageId: "Foraging Settings", text: () => Helper.Translation.Get("gmcm.pageLink.foraging.text"), tooltip: () => "");
gmcm.AddSectionTitle(mod: ModManifest, text: () => " ");
gmcm.AddSectionTitle(mod: ModManifest, text: () => Helper.Translation.Get("gmcm.section.other.title"));
gmcm.AddParagraph(mod: ModManifest, text: () => Helper.Translation.Get("gmcm.section.other.desc"));
gmcm.AddPageLink(mod: ModManifest, pageId: "Other Settings", text: () => Helper.Translation.Get("gmcm.pageLink.other.text"), tooltip: () => "");
MiningConfigPage(gmcm);
ForagingConfigPage(gmcm);
OtherSettingsPages(gmcm);
}
private void OtherSettingsPages(IGenericModConfigMenuApi gmcm)
{
gmcm.AddPage(mod: ModManifest, pageId: "Other Settings", pageTitle: () => Helper.Translation.Get("gmcm.page.other.title"));
gmcm.AddSectionTitle(mod: ModManifest, text: () => Helper.Translation.Get("gmcm.page.other.sectionTitle"));
gmcm.AddParagraph(mod: ModManifest, text: () => Helper.Translation.Get("gmcm.page.other.paragraph"));
gmcm.AddBoolOption(mod: ModManifest, name: () => Helper.Translation.Get("gmcm.option.enableMod.name"), tooltip: () => Helper.Translation.Get("gmcm.option.enableMod.tooltip"), getValue: () => Config.TurnOnMineForMore, setValue: v => Config.TurnOnMineForMore = v);
gmcm.AddBoolOption(mod: ModManifest, name: () => Helper.Translation.Get("gmcm.option.mineDay1.name"), tooltip: () => Helper.Translation.Get("gmcm.option.mineDay1.tooltip"), getValue: () => Config.CanMineOnDay1, setValue: v => Config.CanMineOnDay1 = v);
gmcm.AddBoolOption(mod: ModManifest, name: () => Helper.Translation.Get("gmcm.option.overLevel10.name"), tooltip: () => Helper.Translation.Get("gmcm.option.overLevel10.tooltip"), getValue: () => Config.AllowPlayerToExceedLevel10, setValue: v => Config.AllowPlayerToExceedLevel10 = v);
gmcm.AddBoolOption(mod: ModManifest, name: () => Helper.Translation.Get("gmcm.option.levelUpDesc.name"), tooltip: () => Helper.Translation.Get("gmcm.option.levelUpDesc.tooltip"), getValue: () => Config.TurnOnProfessionLevelUpDescription, setValue: v => Config.TurnOnProfessionLevelUpDescription = v);
gmcm.AddBoolOption(mod: ModManifest, name: () => Helper.Translation.Get("gmcm.option.extraNodes.name"), tooltip: () => Helper.Translation.Get("gmcm.option.extraNodes.tooltip"), getValue: () => Config.AllowExtraNodeSpawnsInMine, setValue: v => Config.AllowExtraNodeSpawnsInMine = v);
gmcm.AddBoolOption(mod: ModManifest, name: () => Helper.Translation.Get("gmcm.option.DebugMode.name"), tooltip: () => Helper.Translation.Get("gmcm.option.DebugMode.tooltip"), getValue: () => Config.DebugMode, setValue: v => Config.DebugMode = v);
}
private void ForagingConfigPage(IGenericModConfigMenuApi gmcm)
{
gmcm.AddPage(mod: ModManifest, pageId: "Foraging Settings", pageTitle: () => Helper.Translation.Get("gmcm.page.foraging.title"));
gmcm.AddSectionTitle(mod: ModManifest, text: () => Helper.Translation.Get("gmcm.page.foraging.prof.title"), tooltip: () => Helper.Translation.Get("gmcm.page.foraging.prof.tooltip"));
gmcm.AddParagraph(mod: ModManifest, text: () => Helper.Translation.Get("gmcm.page.foraging.prof.paragraph"));
gmcm.AddNumberOption(mod: ModManifest, getValue: () => Config.ForesterWoodPerLevelBonus, setValue: v => Config.ForesterWoodPerLevelBonus = v, name: () => Helper.Translation.Get("gmcm.foraging.option.woodPerLevel.name"), tooltip: () => Helper.Translation.Get("gmcm.foraging.option.woodPerLevel.tooltip"), min: 0f, max: 10f, interval: 0.1f);
gmcm.AddNumberOption(mod: ModManifest, getValue: () => Config.ForesterTreeGrowthPerLevelBonus, setValue: v => Config.ForesterTreeGrowthPerLevelBonus = v, name: () => Helper.Translation.Get("gmcm.foraging.option.treeGrowthPerLevel.name"), tooltip: () => Helper.Translation.Get("gmcm.foraging.option.treeGrowthPerLevel.tooltip"), min: 0f, max: 1f, interval: 0.01f);
gmcm.AddNumberOption(mod: ModManifest, getValue: () => Config.ForesterSeedPerLevelBonus, setValue: v => Config.ForesterSeedPerLevelBonus = v, name: () => Helper.Translation.Get("gmcm.foraging.option.seedPerLevel.name"), tooltip: () => Helper.Translation.Get("gmcm.foraging.option.seedPerLevel.tooltip"), min: 0f, max: 10f, interval: 0.01f);
gmcm.AddNumberOption(mod: ModManifest, getValue: () => Config.LumberjackHardwoodPerLevelBonus, setValue: v => Config.LumberjackHardwoodPerLevelBonus = v, name: () => Helper.Translation.Get("gmcm.foraging.option.hardwoodChancePerLevel.name"), tooltip: () => Helper.Translation.Get("gmcm.foraging.option.hardwoodChancePerLevel.tooltip"), min: 0f, max: 1f, interval: 0.01f);
gmcm.AddNumberOption(mod: ModManifest, getValue: () => Config.LumberjackHardwordDropChancePerLevelBonus, setValue: v => Config.LumberjackHardwordDropChancePerLevelBonus = v, name: () => Helper.Translation.Get("gmcm.foraging.option.hardwoodDropChancePerLevel.name"), tooltip: () => Helper.Translation.Get("gmcm.foraging.option.hardwoodDropChancePerLevel.tooltip"), min: 0f, max: 1f, interval: 0.001f);
gmcm.AddNumberOption(mod: ModManifest, name: () => Helper.Translation.Get("gmcm.foraging.option.gathererExtraPerLevel.name"), tooltip: () => Helper.Translation.Get("gmcm.foraging.option.gathererExtraPerLevel.tooltip"), getValue: () => (float)Config.GathererExtraDropPerLevel, setValue: v => Config.GathererExtraDropPerLevel = v, min: 0f, max: 10f, interval: 0.01f);
gmcm.AddNumberOption(mod: ModManifest, name: () => Helper.Translation.Get("gmcm.foraging.option.tapperSpeedPerLevel.name"), tooltip: () => Helper.Translation.Get("gmcm.foraging.option.tapperSpeedPerLevel.tooltip"), getValue: () => Config.TapperSpeedBonusPercentPerLevel, setValue: v => Config.TapperSpeedBonusPercentPerLevel = MathF.Max(0f, v), min: 0f, max: 10f, interval: 0.05f);
gmcm.AddNumberOption(mod: ModManifest, getValue: () => Config.TapperExtraQuantityPerLevel, v => Config.TapperExtraQuantityPerLevel = Math.Max(0f, v), name: () => Helper.Translation.Get("gmcm.foraging.option.tapperExtraQuantityPerLevel.name"), () => Helper.Translation.Get("gmcm.foraging.option.tapperExtraQuantityPerLevel.tooltip"), 0f, 20f, 0.25f);
gmcm.AddSectionTitle(ModManifest, text: () => Helper.Translation.Get("gmcm.page.foraging.chop.sectionTitle"), tooltip: () => Helper.Translation.Get("gmcm.page.foraging.chop.tooltip"));
gmcm.AddParagraph(mod: ModManifest, text: () => Helper.Translation.Get("gmcm.page.foraging.chop.paragraph"));
foreach (var drop in GetAllRules())
if (drop.SkillType.ToString().Equals("Foraging"))
if (!drop.Type.ToString().Equals("Forage"))
{
string dropName = drop.Name;
if (SaveGameIsLoaded)
{
dropName = GetObjectName(drop.ObjectID, drop.Name);
}
AddDropToGMCM(gmcm, dropName, () => drop, drop.SkillType);
}
gmcm.AddSectionTitle(ModManifest, text: () => Helper.Translation.Get("gmcm.page.foraging.foraged.sectionTitle"), tooltip: () => Helper.Translation.Get("gmcm.page.foraging.foraged.tooltip"));
gmcm.AddParagraph(mod: ModManifest, text: () => Helper.Translation.Get("gmcm.page.foraging.foraged.paragraph"));
foreach (var drop in GetAllRules())
if (drop.SkillType.ToString().Equals("Foraging"))
if (drop.Type.ToString().Equals("Forage"))
{
string dropName = drop.Name;
if (SaveGameIsLoaded)
{
dropName = GetObjectName(drop.ObjectID, drop.Name);
}
AddDropToGMCM(gmcm, dropName, () => drop, drop.SkillType);
}
}
private void MiningConfigPage(IGenericModConfigMenuApi gmcm)
{
gmcm.AddPage(mod: ModManifest, pageId: "Mining Settings", pageTitle: () => Helper.Translation.Get("gmcm.page.mining.title"));
gmcm.AddSectionTitle(mod: ModManifest, text: () => Helper.Translation.Get("gmcm.page.mining.prof.title"), tooltip: () => Helper.Translation.Get("gmcm.page.mining.prof.tooltip"));
gmcm.AddParagraph(mod: ModManifest, text: () => Helper.Translation.Get("gmcm.page.mining.prof.paragraph"));
gmcm.AddNumberOption(mod: ModManifest, name: () => Helper.Translation.Get("gmcm.mining.option.minerOre.name"), tooltip: () => Helper.Translation.Get("gmcm.mining.option.minerOre.tooltip"), getValue: () => Config.MinerProfessionBonusOrePerLevel, setValue: v => Config.MinerProfessionBonusOrePerLevel = v, min: 0f, max: 10f, interval: 0.1f);
gmcm.AddNumberOption(mod: ModManifest, name: () => Helper.Translation.Get("gmcm.mining.option.geologistGem.name"), tooltip: () => Helper.Translation.Get("gmcm.mining.option.geologistGem.tooltip"), getValue: () => Config.GeologistProfessionBonusGemsPerLevel, setValue: v => Config.GeologistProfessionBonusGemsPerLevel = v, min: 0f, max: 10f, interval: 0.1f);
gmcm.AddNumberOption(mod: ModManifest, name: () => Helper.Translation.Get("gmcm.mining.option.gemologistNode.name"), tooltip: () => Helper.Translation.Get("gmcm.mining.option.gemologistNode.tooltip"), getValue: () => Config.GemNodeSpawnChanceBonusWithProfession, setValue: v => Config.GemNodeSpawnChanceBonusWithProfession = v, min: 0f, max: 100f, interval: 0.1f);
gmcm.AddNumberOption(mod: ModManifest, name: () => Helper.Translation.Get("gmcm.mining.option.prospectorCoal.name"), tooltip: () => Helper.Translation.Get("gmcm.mining.option.prospectorCoal.tooltip"), getValue: () => Config.ProspectorProfessionBonusCoalPerLevel, setValue: v => Config.ProspectorProfessionBonusCoalPerLevel = v, min: 0f, max: 10f, interval: 0.1f);
gmcm.AddNumberOption(mod: ModManifest, name: () => Helper.Translation.Get("gmcm.mining.option.prospectorCoalNode.name"), tooltip: () => Helper.Translation.Get("gmcm.mining.option.prospectorCoalNode.tooltip"), getValue: () => Config.CoalNodeSpawnChanceBonusWithProfession, setValue: v => Config.CoalNodeSpawnChanceBonusWithProfession = v, min: 0f, max: 100f, interval: 0.1f);
gmcm.AddNumberOption(mod: ModManifest, name: () => Helper.Translation.Get("gmcm.mining.option.excavatorGeode.name"), tooltip: () => Helper.Translation.Get("gmcm.mining.option.excavatorGeode.tooltip"), getValue: () => Config.ExcavatorProfessionBonusGeodesPerLevel, setValue: v => Config.ExcavatorProfessionBonusGeodesPerLevel = v, min: 0f, max: 10f, interval: 0.1f);
gmcm.AddNumberOption(mod: ModManifest, name: () => Helper.Translation.Get("gmcm.mining.option.excavatorGeodeNode.name"), tooltip: () => Helper.Translation.Get("gmcm.mining.option.excavatorGeodeNode.tooltip"), getValue: () => Config.GeodeNodeSpawnChanceBonusWithProfession, setValue: v => Config.GeodeNodeSpawnChanceBonusWithProfession = v, min: 0f, max: 100f, interval: 0.1f);
gmcm.AddSectionTitle(mod: ModManifest, text: () => Helper.Translation.Get("gmcm.page.mining.drops.title"), tooltip: () => Helper.Translation.Get("gmcm.page.mining.drops.tooltip"));
gmcm.AddParagraph(mod: ModManifest, text: () => Helper.Translation.Get("gmcm.page.mining.drops.paragraph"));
foreach (var drop in GetAllRules())
if (drop.SkillType.ToString().Equals("Mining") && !drop.Type.ToString().Equals("MoreCustomGemsConversion"))
{
string dropName = drop.Name;
if (SaveGameIsLoaded)
{
dropName = GetObjectName(drop.ObjectID, drop.Name);
}
AddDropToGMCM(gmcm, dropName, () => drop, drop.SkillType);
}
gmcm.AddSectionTitle(mod: ModManifest, text: () => "[CP] More Custom Gems Conversion");
foreach (var drop in GetAllRules())
if (drop.SkillType.ToString().Equals("Mining") && drop.Type.ToString().Equals("MoreCustomGemsConversion"))
{
string dropName = drop.Name;
if (SaveGameIsLoaded)
{
dropName = GetObjectName(drop.ObjectID, drop.Name);
}
AddDropToGMCM(gmcm, dropName, () => drop, drop.SkillType);
}
}
private void AddDropToGMCM(IGenericModConfigMenuApi gmcm, string label, Func<ResourceDropRule> getDrop, string skilltype)
{
var drop = getDrop();
gmcm.AddNumberOption(mod: ModManifest, name: () => Helper.Translation.Get("gmcm.drop.addAmount.name", new { label }), tooltip: () => Helper.Translation.Get("gmcm.drop.addAmount.tooltip", new { label }), getValue: () => drop.AddAmount, setValue: v => drop.AddAmount = v, min: 0, max: 50);
gmcm.AddNumberOption(mod: ModManifest, name: () => Helper.Translation.Get("gmcm.drop.multiplier.name", new { label }), tooltip: () => Helper.Translation.Get("gmcm.drop.multiplier.tooltip", new { label }), getValue: () => (float)drop.Multiplier, setValue: v => drop.Multiplier = v, min: 0f, max: 10f, interval: 0.1f);
if (skilltype.ToString().Equals("Mining") && !drop.Type.Equals("MoreCustomGemsConversion")) gmcm.AddNumberOption(mod: ModManifest, name: () => Helper.Translation.Get("gmcm.drop.extraNodeChance.name", new { label }), tooltip: () => Helper.Translation.Get("gmcm.drop.extraNodeChance.tooltip", new { label }), getValue: () => drop.ExtraNodeSpawnChancePercent, setValue: v => drop.ExtraNodeSpawnChancePercent = v, min: 0f, max: 100f, interval: 0.1f);
}
}
}