-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathAmuletOfManyMinions.cs
84 lines (76 loc) · 2.47 KB
/
AmuletOfManyMinions.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
using AmuletOfManyMinions.Core.Minions.Tactics;
using AmuletOfManyMinions.Core.Netcode;
using AmuletOfManyMinions.Projectiles.Minions.VanillaClones;
using AmuletOfManyMinions.Projectiles.Minions.NullHatchet;
using AmuletOfManyMinions.Projectiles.Minions.VoidKnife;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.GameContent.Creative;
using AmuletOfManyMinions.Projectiles.Minions.TerrarianEnt;
using AmuletOfManyMinions.Projectiles.Minions.MinonBaseClasses;
using AmuletOfManyMinions.Items.Accessories.CombatPetAccessories;
using AmuletOfManyMinions.CrossModSystem;
using System;
using AmuletOfManyMinions.CrossModClient.SummonersShine;
namespace AmuletOfManyMinions
{
public class AmuletOfManyMinions : Mod
{
internal static ModKeybind CycleTacticHotKey;
internal static ModKeybind CycleTacticsGroupHotKey;
internal static ModKeybind QuickDefendHotKey;
public override void Load()
{
NetHandler.Load();
LandChunkConfigs.Load();
SpriteCompositionManager.Load();
CritterConfigs.Load();
CycleTacticHotKey = KeybindLoader.RegisterKeybind(this, "CycleMinionTactic", "K");
CycleTacticsGroupHotKey = KeybindLoader.RegisterKeybind(this, "CycleTacticsGroup", "L");
QuickDefendHotKey = KeybindLoader.RegisterKeybind(this, "MinionQuickDefend", "V");
}
public override void PostSetupContent()
{
CrossMod.AddSummonersAssociationMetadata(this);
CrossModSetup.AddSummonersShineMetadata(this);
// add Journey Mode support to any item which doesn't explicitly reference it
var catalog = CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId;
IEnumerable<ModItem> items = GetContent<ModItem>().Where(i=>!catalog.ContainsKey(i.Type));
foreach(var item in items)
{
catalog[item.Type] = 1;
}
}
public override object Call(params object[] args)
{
try
{
return ModCallHandler.HandleCall(args);
} catch(Exception e)
{
Logger.Error("Exception in mod.Call", e);
return default;
}
}
public override void Unload()
{
NetHandler.Unload();
LandChunkConfigs.Unload();
SpriteCompositionManager.Unload();
CritterConfigs.Unload();
CycleTacticHotKey = null;
CycleTacticsGroupHotKey = null;
QuickDefendHotKey = null;
}
public override void HandlePacket(BinaryReader reader, int whoAmI)
{
//This should be the only thing in here
NetHandler.HandlePackets(reader, whoAmI);
}
}
}