-
Notifications
You must be signed in to change notification settings - Fork 2
/
AtosArrows.cs
164 lines (144 loc) · 5.51 KB
/
AtosArrows.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
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using System.Reflection;
using JotunnLib.Managers;
using JotunnLib.Entities;
using UnityEngine;
using System;
using System.IO;
using AtosArrows.Arrows;
namespace AtosArrows
{
[BepInPlugin("com.bepinex.plugins.atosarrows", "AtosArrows", "0.1.0")]
[BepInDependency("com.bepinex.plugins.jotunnlib")]
public class AtosArrows : BaseUnityPlugin
{
// Add Items here and below at %%%
private static GameObject itemPrefabStoneArrow;
private static GameObject itemPrefabCoreArrow;
private static GameObject itemPrefabFireBomb;
private void Awake()
{
ObjectManager.Instance.ObjectRegister += registerObjects;
PrefabManager.Instance.PrefabRegister += registerPrefabs;
//ASSET BUNDLES
AssetBundle bundle = AssetBundle.LoadFromFile(Path.Combine(Paths.PluginPath, "AtosArrows/atoarrows"));
// %%% add aditional items here
// STONE ARROW
itemPrefabStoneArrow = (GameObject)bundle.LoadAsset("Assets/AtosArrows/ArrowStone.prefab");
itemPrefabCoreArrow = (GameObject)bundle.LoadAsset("Assets/AtosArrows/ArrowCore.prefab");
itemPrefabFireBomb = (GameObject)bundle.LoadAsset("Assets/AtosArrows/FireBomb.prefab");
}
private void registerPrefabs(object sender, EventArgs e)
{
// STONE ARROW
PrefabManager.Instance.RegisterPrefab(itemPrefabStoneArrow, "StoneArrow_bundle");
PrefabManager.Instance.RegisterPrefab(new StoneArrowPrefab());
PrefabManager.Instance.RegisterPrefab(itemPrefabCoreArrow, "CoreArrow_bundle");
PrefabManager.Instance.RegisterPrefab(new CoreArrowPrefab());
PrefabManager.Instance.RegisterPrefab(itemPrefabFireBomb, "FireBomb_bundle");
PrefabManager.Instance.RegisterPrefab(new FireBombPrefab());
}
// REGISTER ITEMS
private void registerObjects(object sender, EventArgs e)
{
// STONE ARROW
ObjectManager.Instance.RegisterItem("StoneArrow");
ObjectManager.Instance.RegisterItem("CoreArrow");
ObjectManager.Instance.RegisterItem("FireBomb");
// REGISTER RECIPIES
// Stone Arrow
ObjectManager.Instance.RegisterRecipe(new RecipeConfig()
{
Name = "Recipe_StoneArrow",
Item = "StoneArrow",
Amount = 20,
CraftingStation = "piece_workbench",
MinStationLevel = 1,
Requirements = new PieceRequirementConfig[]
{
new PieceRequirementConfig()
{
Item = "Stone",
Amount = 2
},
new PieceRequirementConfig()
{
Item = "Wood",
Amount = 8
},
new PieceRequirementConfig()
{
Item = "Feathers",
Amount = 2
}
}
});
//Core Arrow
ObjectManager.Instance.RegisterRecipe(new RecipeConfig()
{
Name = "Recipe_CoreArrow",
Item = "CoreArrow",
Amount = 20,
CraftingStation = "forge",
MinStationLevel = 1,
Requirements = new PieceRequirementConfig[]
{
new PieceRequirementConfig()
{
Item = "Bronze",
Amount = 1
},
new PieceRequirementConfig()
{
Item = "Stone",
Amount = 2
},
new PieceRequirementConfig()
{
Item = "RoundLog",
Amount = 8
},
new PieceRequirementConfig()
{
Item = "Feathers",
Amount = 2
}
}
});
//Fire Bomb
ObjectManager.Instance.RegisterRecipe(new RecipeConfig()
{
Name = "Recipe_CoreArrow",
Item = "FireBomb",
Amount = 2,
CraftingStation = "piece_workbench",
MinStationLevel = 1,
Requirements = new PieceRequirementConfig[]
{
new PieceRequirementConfig()
{
Item = "Resin",
Amount = 10
},
new PieceRequirementConfig()
{
Item = "Coal",
Amount = 10
},
new PieceRequirementConfig()
{
Item = "LeatherScraps",
Amount = 8
},
new PieceRequirementConfig()
{
Item = "Entrails",
Amount = 2
}
}
});
}
}
}