-
Notifications
You must be signed in to change notification settings - Fork 1
/
GSINode.cs
186 lines (167 loc) · 6.03 KB
/
GSINode.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
using System.Collections.Generic;
using System.Linq;
namespace AuroraGSI
{
public class GSINode
{
public readonly ProviderNode provider = new ProviderNode();
public readonly WorldNode world = new WorldNode();
public readonly PlayerNode player = new PlayerNode();
public GSINode Update()
{
player.Update();
world.Update();
return this;
}
public class ProviderNode
{
public string name = "tmodloader";
public int appid = 1281930;
}
public class PlayerNode
{
public bool inGame;
public int depth;
public int depthLayer;
public int maxdepth;
public int health;
public int maxHealth;
public int mana;
public int maxMana;
public int defense;
public int biome;
public bool zoneTowerSolar;
public bool zoneTowerVortex;
public bool zoneTowerNebula;
public bool zoneTowerStardust;
public bool zoneOldOneArmy;
public bool zonePeaceCandle;
public bool zoneWaterCandle;
public bool zoneCorrupt;
public bool zoneCrimson;
public bool zoneHoly;
public bool zoneGlowshroom;
public bool zoneUndergroundDesert;
public bool zoneMeteor;
public bool zoneDungeon;
public bool zoneSandstorm;
public void Update()
{
try
{
var player = Terraria.Main.LocalPlayer;
inGame = !Terraria.Main.gameMenu;
depth = (int)player.position.Y;
maxdepth = (int)Terraria.Main.bottomWorld;
health = player.statLife;
maxHealth = player.statLifeMax;
mana = player.statMana;
maxMana = player.statManaMax;
defense = player.statDefense;
if (player.ZoneUnderworldHeight) depthLayer = 0;
else if (player.ZoneRockLayerHeight) depthLayer = 1;
else if (player.ZoneDirtLayerHeight) depthLayer = 2;
else if (player.ZoneOverworldHeight) depthLayer = 3;
else if (player.ZoneSkyHeight) depthLayer = 4;
else depthLayer = -1;
zoneTowerSolar = player.ZoneTowerSolar;
zoneTowerVortex = player.ZoneTowerVortex;
zoneTowerNebula = player.ZoneTowerNebula;
zoneTowerStardust = player.ZoneTowerStardust;
zoneOldOneArmy = player.ZoneOldOneArmy;
zonePeaceCandle = player.ZonePeaceCandle;
zoneWaterCandle = player.ZoneWaterCandle;
zoneCorrupt = player.ZoneCorrupt;
zoneCrimson = player.ZoneCrimson;
zoneHoly = player.ZoneHoly;
zoneGlowshroom = player.ZoneGlowshroom;
zoneUndergroundDesert = player.ZoneUndergroundDesert;
zoneMeteor = player.ZoneMeteor;
zoneDungeon = player.ZoneDungeon;
zoneSandstorm = player.ZoneSandstorm;
if (player.ZoneDesert) biome = 4;
else if (player.ZoneSnow) biome = 3;
else if (player.ZoneJungle) biome = 2;
else if (player.ZoneBeach) biome = 1;
else biome = 0;//forest
}
catch
{ }
}
}
public class WorldNode
{
public double time;
public bool raining;
public bool hardMode;
public bool expertMode;
public bool eclipse;
public bool bloodMoon;
public bool pumpkinMoon;
public bool snowMoon;
public bool slimeRain;
public int boss;
public void Update()
{
try
{
eclipse = Terraria.Main.eclipse;
hardMode = Terraria.Main.hardMode;
expertMode = Terraria.Main.expertMode;
time = Terraria.Main.time;
bloodMoon = Terraria.Main.bloodMoon;
pumpkinMoon = Terraria.Main.pumpkinMoon;
snowMoon = Terraria.Main.snowMoon;
raining = Terraria.Main.raining;
slimeRain = Terraria.Main.slimeRain;
boss = GetBoss(System.Array.Find(Terraria.Main.npc, n => n.boss)?.type ?? -1);
}
catch
{ }
}
}
private static int GetBoss(int type)
{
switch (type)
{
case 50://king slime
return 0;
case 4://eye
return 1;
case 13:
case 14:
case 15://eater
return 2;
case 266://brain
return 3;
case 222://bee
return 4;
case 35://skeletron
return 5;
case 113://wall
return 6;
case 125:
case 126://twins
return 7;
case 134://destroyer
return 8;
case 127://prime
return 9;
case 262://plantera
return 10;
case 245://golem
return 11;
case 370://fishron
return 12;
case 439://cultist
return 13;
case 396:
case 397:
case 398://moon lord D:
return 14;
default:
return -1;
}
}
}
}