-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMoreSkills.cs
95 lines (82 loc) · 3.96 KB
/
MoreSkills.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
using System;
using HarmonyLib;
using MoreSkills.Config;
using MoreSkills.Utility;
using UnityEngine;
namespace MoreSkills_Skills
{
class MoreSkills
{
/*[HarmonyPatch(typeof(TreeBase), "Damage")]
public static class TreeBaseTest
{
public static void Postfix(ref TreeBase __instance, HitData hit)
{
Debug.LogWarning("Nombre: " + __instance.name);
Debug.LogWarning("Chance: " + __instance.m_dropWhenDestroyed.m_dropChance);
Debug.LogWarning("Min: " + __instance.m_dropWhenDestroyed.m_dropMin);
Debug.LogWarning("Max: " + __instance.m_dropWhenDestroyed.m_dropMax);
try
{
List<GameObject> dropList = __instance.m_dropWhenDestroyed.GetDropList();
for (int i = 0; i < (dropList.Count * 200); i++)
{
Vector2 vector = UnityEngine.Random.insideUnitCircle * 0.5f;
Vector3 position = __instance.transform.position + Vector3.up * __instance.m_spawnYOffset + new Vector3(vector.x, __instance.m_spawnYStep * (float)i, vector.y);
Quaternion rotation = Quaternion.Euler(0f, (float)UnityEngine.Random.Range(0, 360), 0f);
UnityEngine.Object.Instantiate<GameObject>(dropList[i], position, rotation);
Debug.LogWarning("Drop: " + dropList[i] + " " + i);
Debug.LogWarning("mates health: " + (__instance.m_health - hit.GetTotalDamage()));
}
}
catch (Exception)
{
}
}
}
[HarmonyPatch(typeof(TreeLog), "Damage")]
public static class TreeLogTest
{
public static void Postfix(ref TreeLog __instance)
{
Debug.LogWarning("Nombre: " + __instance.name);
Debug.LogWarning("Chance: " + __instance.m_dropWhenDestroyed.m_dropChance);
Debug.LogWarning("Min: " + __instance.m_dropWhenDestroyed.m_dropMin);
Debug.LogWarning("Max: " + __instance.m_dropWhenDestroyed.m_dropMax);
try
{
List<GameObject> dropList = __instance.m_dropWhenDestroyed.GetDropList();
for (int i = 0; i < (dropList.Count * 200); i++)
{
Vector2 vector = UnityEngine.Random.insideUnitCircle * 0.5f;
Vector3 position = __instance.transform.position + __instance.transform.up * UnityEngine.Random.Range(-__instance.m_spawnDistance, __instance.m_spawnDistance) + Vector3.up * 0.3f * (float)i;
Quaternion rotation = Quaternion.Euler(0f, (float)UnityEngine.Random.Range(0, 360), 0f);
UnityEngine.Object.Instantiate<GameObject>(dropList[i], position, rotation);
Debug.LogWarning("Drop: " + dropList[i] + " " + i);
}
}
catch (Exception)
{
}
}
}*/
/*[HarmonyPatch(typeof(InventoryGui), "Show")]
public static class Test1
{
public static void Postfix(ref InventoryGui __instance)
{
foreach (Recipe recipe in ObjectDB.instance.m_recipes)
{
if (recipe.m_item == null || recipe == null)
continue;
Debug.LogWarning("Nombre: " + recipe.m_item);
Debug.LogWarning("Cantidad: " + recipe.m_amount);
foreach (Piece.Requirement req in recipe.m_resources)
{
Debug.LogWarning("Recurso: " + req.m_resItem + " Cantidad Crafteo: " + req.m_amount + " Cantidad upgrade: " + req.m_amountPerLevel);
}
}
}
}*/
}
}