-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSoA.cs
406 lines (377 loc) · 22.3 KB
/
SoA.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
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
using Humanizer;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Newtonsoft.Json;
using ShardsOfAtheria.Config;
using ShardsOfAtheria.Items.Accessories.GemCores;
using ShardsOfAtheria.Items.Accessories.GemCores.Greater;
using ShardsOfAtheria.Items.Accessories.GemCores.Regular;
using ShardsOfAtheria.Items.Accessories.GemCores.Super;
using ShardsOfAtheria.Items.BossSummons;
using ShardsOfAtheria.Items.Weapons.Ranged;
using ShardsOfAtheria.NPCs.Boss.Elizabeth;
using ShardsOfAtheria.NPCs.Boss.NovaStellar.LightningValkyrie;
using ShardsOfAtheria.NPCs.Town.TheAtherian;
using ShardsOfAtheria.Systems;
using ShardsOfAtheria.Utilities;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using Terraria;
using Terraria.Audio;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.Utilities;
namespace ShardsOfAtheria
{
public partial class SoA : Mod
{
public static int MaxNecronomiconPages = 2;
public static ModKeybind OverdriveKey { get; private set; }
public static ModKeybind TomeKey { get; private set; }
public static ModKeybind EmeraldTeleportKey { get; private set; }
public static ModKeybind AmethystBombToggle { get; private set; }
public static ModKeybind PhaseSwitch { get; private set; }
public static ModKeybind SoulTeleport { get; private set; }
public static ModKeybind ProcessorElement { get; private set; }
public static ShardsServer ServerConfig => ModContent.GetInstance<ShardsServer>();
public static ShardsClient ClientConfig => ModContent.GetInstance<ShardsClient>();
public static ShardsDownedSystem DownedSystem => ModContent.GetInstance<ShardsDownedSystem>();
public static bool AprilFools => DateTime.Now is DateTime { Month: 4 };
public static bool BNEEnabled => ModLoader.TryGetMod(ElementModName, out Mod _);
public static Mod Instance => ModContent.GetInstance<SoA>();
public static readonly SoundStyle ReactorAlarm = new(ItemSoundPath + "ReactorMeltdownAlarm");
public static readonly SoundStyle TheMessiah = new(ItemSoundPath + "TheMessiah");
public static readonly SoundStyle Rekkoha = new(ItemSoundPath + "MessiahRekkoha");
public static readonly SoundStyle Coin = new(ItemSoundPath + "Coin");
public static readonly SoundStyle KatanaScream = new(ItemSoundPath + "KatanaScream");
public static readonly SoundStyle MagnetChargeUp = new SoundStyle(ItemSoundPath + "MagnetChargeUp").WithVolumeScale(0.75f);
public static readonly SoundStyle MagnetWeakShot = new SoundStyle(ItemSoundPath + "MagnetWeakShot").WithVolumeScale(0.75f);
public static readonly SoundStyle MagnetShot = new SoundStyle(ItemSoundPath + "MagnetShot").WithVolumeScale(0.75f);
public static readonly SoundStyle KeyPress = new(ItemSoundPath + "KeyPress");
public static readonly SoundStyle ZeroCharge = new(ItemSoundPath + "ZeroCharge") { MaxInstances = 1 };
public static readonly SoundStyle Katana = new(ItemSoundPath + "Katana") { Volume = 0.25f, MaxInstances = 2, PitchVariance = 0.1f };
public static readonly SoundStyle HeavyCut = new(ItemSoundPath + "HeavyCut") { Volume = 0.5f, MaxInstances = 2, PitchVariance = 0.2f };
public static readonly SoundStyle Judgement1 = new(ItemSoundPath + "Judgement2_1") { Volume = 0.25f, MaxInstances = 2, PitchVariance = 0.1f };
public static readonly SoundStyle Judgement2 = new(ItemSoundPath + "Judgement2_2") { Volume = 0.25f, MaxInstances = 2, PitchVariance = 0.1f };
public static readonly SoundStyle Judgement3 = new(ItemSoundPath + "Judgement2_3") { Volume = 0.25f, MaxInstances = 2, PitchVariance = 0.1f };
public static readonly SoundStyle SilverRings = new(ItemSoundPath + "SilverRing");
public static readonly SoundStyle SilverRingsSoft = new(ItemSoundPath + "SilverRingSoft");
public static readonly Color HardlightColor = new(224, 92, 165);
public static readonly Color HardlightColorA = HardlightColor.UseA(0);
public static readonly Vector3 HardlightColorV3 = HardlightColor.ToVector3();
public static readonly Vector3 HardlightColorV3A = HardlightColorA.ToVector3();
public static readonly Color AreusColor = Color.Cyan;
public static readonly Color AreusColorA = AreusColor.UseA(0);
public static readonly Vector3 AreusColorV3 = AreusColor.ToVector3();
public static readonly Vector3 AreusColorV3A = AreusColorA.ToVector3();
public static readonly Color ElectricColor = new(113, 251, 255);
public static readonly Color ElectricColorA = ElectricColor.UseA(0);
public static readonly Vector3 ElectricColorV3 = ElectricColor.ToVector3();
public static readonly Vector3 ElectricColorV3A = ElectricColorA.ToVector3();
public static Texture2D OrbBloom => ModContent.Request<Texture2D>("ShardsOfAtheria/Assets/BlurTrails/OrbBlur").Value;
public static Texture2D DiamondBloom => ModContent.Request<Texture2D>("ShardsOfAtheria/Assets/BlurTrails/DiamondBlur").Value;
public static Texture2D LineBloom => ModContent.Request<Texture2D>("ShardsOfAtheria/Assets/BlurTrails/LineTrail").Value;
public static bool Eternity()
{
if (ModLoader.TryGetMod("FargowiltasSouls", out Mod souls))
{
return (bool)souls.Call("EternityMode");
}
return false;
}
public static bool Massochist()
{
return Eternity() && Main.masterMode;
}
//Get stick bugged lmao
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡛⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠀⠀⠈⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⣋⣥⣴⣾⢏⣼⣿⣷⣄⠈⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⣩⣤⣶⣿⣿⣿⣿⡏⣼⣿⣿⡿⢋⣤⣦⡀⠈⠙⠛⠛⠛⠟⠛⠛⠛⠛⢛⣙⣛⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢋⣴⣿⣿⣿⣿⣿⣿⣿⡟⣸⣿⡿⢋⣴⣿⣿⣿⡇⠀⣶⣶⣶⣶⣶⣶⣶⣤⣤⡍⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⣱⣿⣿⣿⣿⣿⣿⣿⣿⣿⣱⣿⠟⣡⣾⣿⣿⣿⡿⢠⡆⣽⣿⣿⣿⣿⣿⣿⣿⣿⣧⢹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢋⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⢣⣿⣿⣸⣿⣿⣿⣿⣿⢡⡿⣱⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
//⠿⠿⠿⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣱⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣏⣾⣿⡇⣿⣿⣿⣿⣿⡟⠼⣣⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
//⣶⣶⣶⣶⣤⣤⣤⣀⣈⣉⣉⡉⠉⠛⠛⠛⠰⠿⠿⠿⢿⣿⣿⣿⣿⣿⣿⡟⣾⣿⣿⢹⣿⣿⣿⣿⣿⡇⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣶⣶⣶⣦⣤⣤⣄⣈⣉⣉⣁⣉⠉⠋⠘⠻⠿⠿⠿⠿⢡⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣶⣶⣤⣤⣬⣍⣉⣉⣉⡛⠛⠛⠛⠿⠿⠿⠸⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣶⣶⣤⣤⣤⣄⣉⣉⣉⣉⠛⠛⠛⠿⠿⠿⠿⠿
public override void Load()
{
OverdriveKey = KeybindLoader.RegisterKeybind(Instance, "ToggleOverdrive", "F");
TomeKey = KeybindLoader.RegisterKeybind(Instance, "KnowledgeBase", "N");
EmeraldTeleportKey = KeybindLoader.RegisterKeybind(Instance, "EmeraldTeleport", "Z");
AmethystBombToggle = KeybindLoader.RegisterKeybind(Instance, "AmethystBombToggle", "J");
PhaseSwitch = KeybindLoader.RegisterKeybind(Instance, "PhaseType", "RightAlt");
SoulTeleport = KeybindLoader.RegisterKeybind(Instance, "SoulCrystalTeleport", "V");
if (BNEEnabled) ProcessorElement = KeybindLoader.RegisterKeybind(Instance, "CycleElementAffinity", "C");
if (!Main.dedServ)
{
ModLoader.TryGetMod("Wikithis", out Mod wikithis);
if (wikithis != null)
{
wikithis.Call("AddModURL", Instance, "https://terrariamods.wiki.gg/wiki/Shards_of_Atheria/{}");
// If you want to replace default icon for your mod, then call this. Icon should be 30x30, either way it will be cut.
wikithis.Call("AddWikiTexture", Instance, ModContent.Request<Texture2D>("ShardsOfAtheria/icon_small"));
}
}
}
public override void PostSetupContent()
{
if (!Main.dedServ)
{
if (ClientConfig.windowTitle)
{
if (Main.rand.NextBool(3))
{
Main.instance.Window.Title = ChooseTitleText();
}
}
}
if (ModLoader.TryGetMod("TerraTyping", out Mod terratyping))
{
Dictionary<string, object> addWeapon = new()
{
{ "call", "AddTypes" },
{ "typestoadd", "weapon" },
{ "callingmod", Instance },
{ "filename", TerraTypingFolder.FormatWith("Weapons") }
};
terratyping.Call(addWeapon);
Dictionary<string, object> addProjectile = new()
{
{ "call", "AddTypes" },
{ "typestoadd", "projectile" },
{ "callingmod", Instance },
{ "filename", TerraTypingFolder.FormatWith("Projectiles") }
};
terratyping.Call(addProjectile);
Dictionary<string, object> addAmmo = new()
{
{ "call", "AddTypes" },
{ "typestoadd", "ammo" },
{ "callingmod", Instance },
{ "filename", TerraTypingFolder.FormatWith("Ammo") }
};
terratyping.Call(addAmmo);
Dictionary<string, object> addNPC = new()
{
{ "call", "AddTypes" },
{ "typestoadd", "npc" },
{ "callingmod", Instance },
{ "filename", TerraTypingFolder.FormatWith("NPCs") }
};
terratyping.Call(addNPC);
Dictionary<string, object> addArmor = new()
{
{ "call", "AddTypes" },
{ "typestoadd", "armor" },
{ "callingmod", Instance },
{ "filename", TerraTypingFolder.FormatWith("Armor") }
};
terratyping.Call(addArmor);
Dictionary<string, object> addItem = new()
{
{ "call", "AddTypes" },
{ "typestoadd", "specialitem" },
{ "callingmod", Instance },
{ "filename", TerraTypingFolder.FormatWith("Items") }
};
terratyping.Call(addItem);
if (ServerConfig.overrideTypes)
{
Dictionary<string, object> overrideNPC = new()
{
{ "call", "OverrideTypes" },
{ "typestoadd", "npc" },
{ "callingmod", Instance },
{ "filename", TerraTypingFolder.FormatWith("NPCOverride") },
{ "modtarget", "Terraria" }
};
terratyping.Call(overrideNPC);
Dictionary<string, object> overrideProjectile = new()
{
{ "call", "OverrideTypes" },
{ "typestoadd", "projectile" },
{ "callingmod", Instance },
{ "filename", TerraTypingFolder.FormatWith("ProjectileOverride") },
{ "modtarget", "Terraria" }
};
terratyping.Call(overrideProjectile);
}
}
if (ModLoader.TryGetMod("RecipeBrowser", out Mod rb))
{
var iconTexture = ModContent.Request<Texture2D>(ModContent.GetInstance<Atherian>().HeadTexture);
rb.Call("AddItemCategory", "Upgrades", "", iconTexture, (Predicate<Item>)((Item item) => HasBlueprint(item)));
static bool HasBlueprint(Item item)
{
foreach (UpgradeBlueprint blueprint in UpgradeBlueprintLoader.upgrades)
{
if (blueprint.ResultItem.type == item.type) return true;
}
return false;
}
}
if (ModLoader.TryGetMod("BossChecklist", out Mod checklist))
{
string despawnPath = "Mods.ShardsOfAtheria.NPCs.{0}.BossChecklistIntegration.Despawn";
checklist.Call(
"LogBoss",
Instance,
nameof(NovaStellar),
5.5f,
() => ShardsDownedSystem.downedValkyrie,
ModContent.NPCType<NovaStellar>(),
new Dictionary<string, object>()
{
["spawnItems"] = ModContent.ItemType<ValkyrieCrest>(),
["despawnMessage"] = Language.GetText(despawnPath.FormatWith("NovaStellar"))
}
);
checklist.Call(
"LogBoss",
Instance,
nameof(Death),
19f,
() => ShardsDownedSystem.downedDeath,
ModContent.NPCType<Death>(),
new Dictionary<string, object>()
{
["spawnItems"] = ModContent.ItemType<AncientMedalion>(),
["despawnMessage"] = Language.GetText(despawnPath.FormatWith("Death"))
}
);
}
if (ModLoader.TryGetMod("ShoeSlot", out Mod shoeSlot))
{
shoeSlot.Call(ModContent.ItemType<EmeraldCore>());
shoeSlot.Call(ModContent.ItemType<EmeraldCore_Greater>());
shoeSlot.Call(ModContent.ItemType<EmeraldCore_Super>());
shoeSlot.Call(ModContent.ItemType<MegaGemCore>());
}
if (ModLoader.TryGetMod("ShieldSlot", out Mod shieldSlot))
{
shieldSlot.Call(ModContent.ItemType<DiamondCore>(),
ModContent.ItemType<DiamondCore_Greater>(),
ModContent.ItemType<DiamondCore_Super>(),
ModContent.ItemType<MegaGemCore>());
}
if (ModLoader.TryGetMod("Fargowiltas", out Mod fargos))
{
fargos.Call("AddSummon", 5.5f, ModContent.ItemType<ValkyrieCrest>(), () => ShardsDownedSystem.downedValkyrie, 50000);
fargos.Call("AddSummon", 19f, ModContent.ItemType<AncientMedalion>(), () => ShardsDownedSystem.downedDeath, 500000);
}
if (ModLoader.TryGetMod("RORBossHealthbars", out Mod ror2Bars))
{
ror2Bars.Call("HPPool", new List<int>()
{
ModContent.NPCType<NovaStellar>(),
ModContent.NPCType<Death>(),
});
ror2Bars.Call("CustomName", ModContent.NPCType<NovaStellar>(), "Mods.ShardsOfAtheria.NPCs.NovaStellar.DisplayName");
ror2Bars.Call("BossDesc", ModContent.NPCType<NovaStellar>(), "Mods.ShardsOfAtheria.NPCs.NovaStellar.BossDesc");
ror2Bars.Call("CustomName", ModContent.NPCType<Death>(), "Mods.ShardsOfAtheria.NPCs.Death.DisplayName");
ror2Bars.Call("BossDesc", ModContent.NPCType<Death>(), "Mods.ShardsOfAtheria.NPCs.Death.BossDesc");
}
if (ModLoader.TryGetMod("RiskOfTerrain", out Mod rot))
{
rot.Call("HPPool", new List<int>()
{
ModContent.NPCType<NovaStellar>(),
ModContent.NPCType<Death>(),
});
rot.Call("CustomName", ModContent.NPCType<NovaStellar>(), "Mods.ShardsOfAtheria.NPCs.NovaStellar.DisplayName");
rot.Call("BossDesc", ModContent.NPCType<NovaStellar>(), "Mods.ShardsOfAtheria.NPCs.NovaStellar.BossDesc");
rot.Call("CustomName", ModContent.NPCType<Death>(), "Mods.ShardsOfAtheria.NPCs.Death.DisplayName");
rot.Call("BossDesc", ModContent.NPCType<Death>(), "Mods.ShardsOfAtheria.NPCs.Death.BossDesc");
}
ShardsHelpers.SetGunStats(ModContent.ItemType<AreusAssaultRifle>(), "rifle", 30);
ShardsHelpers.SetGunStats(ModContent.ItemType<AreusCalibratedShotgun>(), "shotgun", 8);
ShardsHelpers.SetGunStats(ModContent.ItemType<AreusMagnum>(), "revolver", 1);
ShardsHelpers.SetGunStats(ModContent.ItemType<AreusPistol>(), "pistol", 8);
ShardsHelpers.SetGunStats(ModContent.ItemType<HansMachineGun>(), "lmg", 100);
ShardsHelpers.SetGunStats(ModContent.ItemType<HeroGun>(), "pistol", 12);
ShardsHelpers.SetGunStats(ModContent.ItemType<HuntingRifle>(), "rifle", 20);
ShardsHelpers.SetGunStats(ModContent.ItemType<Magnus>(), "revolver", 8);
ShardsHelpers.SetGunStats(ModContent.ItemType<P90>(), "smg", 50);
ShardsHelpers.SetGunStats(ModContent.ItemType<PhantomRose>(), "pistol", 12);
ShardsHelpers.SetGunStats(ModContent.ItemType<Scarlet>(), "sniper", 10);
}
public static void TryElementCall(params object[] args)
{
if (ModLoader.TryGetMod(ElementModName, out var battleNetworkElements))
{
battleNetworkElements.Call(args);
}
}
public static void TryCalamityCall(params object[] args)
{
if (ModLoader.TryGetMod("CalamityMod", out var calamity))
{
calamity.Call(args);
}
}
public static void TryRedemptionCall(params object[] args)
{
if (ModLoader.TryGetMod("Redemption", out var redemption))
{
redemption.Call(args);
}
}
public static void TryReloadableGunsCall(params object[] args)
{
if (ModLoader.TryGetMod("ReloadableGunsRevitalized", out var rgr))
{
rgr.Call(args);
}
}
public static string ChooseTitleText()
{
WeightedRandom<string> titles = new();
int i = 0;
while (true)
{
string titleText = ShardsHelpers.LocalizeCommon("TitleText" + i);
if (titleText.Equals("No key found.")) break;
else { titles.Add(titleText); i++; };
}
return titles;
}
public static Dictionary<string, List<string>> GetContentArrayFile(string name)
{
using var stream = Instance.GetFileStream($"Content/{name}.json", newFileStream: true);
using var streamReader = new StreamReader(stream);
return JsonConvert.DeserializeObject<Dictionary<string, List<string>>>(streamReader.ReadToEnd());
}
private static bool ConsoleDebug => ClientConfig.debug;
internal static void LogInfo(object value, string label = "", bool ignoreDebugConfig = false)
{
if (ConsoleDebug || ignoreDebugConfig)
{
Instance.Logger.Info(label + value);
if (value is IList list)
{
Instance.Logger.Info("--List items--");
if (list.Count == 0)
{
Instance.Logger.Info("None");
}
else
{
foreach (object item in list)
{
Instance.Logger.Info(item);
}
}
}
}
}
}
}