forked from blushiemagic/ElementalUnleash
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSpawnHelper.cs
More file actions
67 lines (56 loc) · 2.13 KB
/
SpawnHelper.cs
File metadata and controls
67 lines (56 loc) · 2.13 KB
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
using System;
using Terraria;
using Terraria.GameContent.Events;
using Terraria.ModLoader;
namespace Bluemagic
{
public static class SpawnHelper
{
public static bool MoonEvent(NPCSpawnInfo info)
{
return (Main.pumpkinMoon || Main.snowMoon) && info.spawnTileY <= Main.worldSurface && !Main.dayTime;
}
public static bool Eclipse(NPCSpawnInfo info)
{
return Main.eclipse && info.spawnTileY <= Main.worldSurface && Main.dayTime;
}
public static bool LunarTower(NPCSpawnInfo info)
{
Player player = info.player;
return player.ZoneTowerSolar || player.ZoneTowerVortex || player.ZoneTowerNebula || player.ZoneTowerStardust;
}
public static bool NoInvasion(NPCSpawnInfo info)
{
return !info.invasion && !DD2Event.Ongoing && !MoonEvent(info) && !Eclipse(info) && !LunarTower(info);
}
public static bool NoBiome(NPCSpawnInfo info)
{
Player player = info.player;
return !player.ZoneJungle && !player.ZoneDungeon && !player.ZoneCorrupt && !player.ZoneCrimson && !player.ZoneHoly && !player.ZoneSnow && !player.ZoneUndergroundDesert && info.spawnTileY < Main.maxTilesY - 190;
}
public static bool NoZoneAllowWater(NPCSpawnInfo info)
{
return !info.sky && !info.player.ZoneMeteor && !info.spiderCave;
}
public static bool NoZone(NPCSpawnInfo info)
{
return NoZoneAllowWater(info) && !info.water;
}
public static bool NormalSpawn(NPCSpawnInfo info)
{
return !info.playerInTown && NoInvasion(info);
}
public static bool NoZoneNormalSpawn(NPCSpawnInfo info)
{
return NormalSpawn(info) && NoZone(info);
}
public static bool NoZoneNormalSpawnAllowWater(NPCSpawnInfo info)
{
return NormalSpawn(info) && NoZoneAllowWater(info);
}
public static bool NoBiomeNormalSpawn(NPCSpawnInfo info)
{
return NormalSpawn(info) && NoBiome(info) && NoZone(info);
}
}
}