-
Notifications
You must be signed in to change notification settings - Fork 5
/
BTFABossOres.cs
138 lines (137 loc) · 6.84 KB
/
BTFABossOres.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
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace ForgottenMemories
{
public class BTFABossOres : GlobalNPC
{
public override void NPCLoot(NPC npc)
{
if (npc.type == 50)
{
if (!TGEMWorld.Gelatine)
{
Main.NewText("Gelatine seeps into the subterranean caverns!", 0, 29, 255);
TGEMWorld.Gelatine = true;
for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 18E-05); k++)
{
int i = WorldGen.genRand.Next(10, Main.maxTilesX - 10);
int j = WorldGen.genRand.Next((int) Main.worldSurface - 1, Main.maxTilesY - 10);
Tile tile = Main.tile[i, j];
if ((tile.type == 0 || tile.type == 1) && j > Main.worldSurface)
{
WorldGen.OreRunner(i, j, (double)WorldGen.genRand.Next(6, 7), WorldGen.genRand.Next(6, 7), (ushort)mod.TileType("GelatineOre"));
}
}
}
}
if (npc.type == 13 || npc.type == 266)
{
if (!TGEMWorld.Cryotine)
{
Main.NewText("Ice crystallizes beneath the tundra!", 36, 242, 242);
TGEMWorld.Cryotine = true;
for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 22E-05); k++)
{
int i = WorldGen.genRand.Next(10, Main.maxTilesX - 10);
int j = WorldGen.genRand.Next((int) Main.worldSurface - 1, Main.maxTilesY - 10);
Tile tile = Main.tile[i, j];
if ((tile.type == 147 || tile.type == 161) && j > Main.worldSurface)
{
WorldGen.OreRunner(i, j, (double)WorldGen.genRand.Next(6, 7), WorldGen.genRand.Next(6, 7), (ushort)mod.TileType("CryotineOre"));
}
}
}
}
if (npc.type == 134)
{
if (NPC.downedMechBoss2 && NPC.downedMechBoss3 && !TGEMWorld.Blight)
{
Main.NewText("A malevolent mineral seeps into the most pestillent stone...", 221, 153, 255);
TGEMWorld.Blight = true;
for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 22E-05); k++)
{
int i = WorldGen.genRand.Next(10, Main.maxTilesX - 10);
int j = WorldGen.genRand.Next((int) Main.worldSurface - 1, Main.maxTilesY - 10);
Tile tile = Main.tile[i, j];
if ((tile.type == 203 || tile.type == 204 || tile.type == 22 || tile.type == 25 || tile.type == 112 || tile.type == 398 || tile.type == 400 || tile.type == 399 || tile.type == 401 || tile.type == 234 || tile.type == 163 || tile.type == 200) && j > Main.worldSurface)
{
WorldGen.OreRunner(i, j, (double)WorldGen.genRand.Next(6, 7), WorldGen.genRand.Next(6, 7), (ushort)mod.TileType("BlightOre"));
}
}
}
}
if (npc.type == 125 && !NPC.AnyNPCs(126))
{
if (NPC.downedMechBoss1 && NPC.downedMechBoss3 && !TGEMWorld.Blight)
{
Main.NewText("A malevolent mineral seeps into the most pestillent stone...", 221, 153, 255);
TGEMWorld.Blight = true;
for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 22E-05); k++)
{
int i = WorldGen.genRand.Next(10, Main.maxTilesX - 10);
int j = WorldGen.genRand.Next((int) Main.worldSurface - 1, Main.maxTilesY - 10);
Tile tile = Main.tile[i, j];
if ((tile.type == 203 || tile.type == 204 || tile.type == 22 || tile.type == 25 || tile.type == 112 || tile.type == 398 || tile.type == 400 || tile.type == 399 || tile.type == 401 || tile.type == 234 || tile.type == 163 || tile.type == 200) && j > Main.worldSurface)
{
WorldGen.OreRunner(i, j, (double)WorldGen.genRand.Next(6, 7), WorldGen.genRand.Next(6, 7), (ushort)mod.TileType("BlightOre"));
}
}
}
}
else if (npc.type == 126 && !NPC.AnyNPCs(125))
{
if (NPC.downedMechBoss1 && NPC.downedMechBoss3 && !TGEMWorld.Blight)
{
Main.NewText("A malevolent mineral seeps into the most pestillent stone...", 221, 153, 255);
TGEMWorld.Blight = true;
for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 22E-05); k++)
{
int i = WorldGen.genRand.Next(10, Main.maxTilesX - 10);
int j = WorldGen.genRand.Next((int) Main.worldSurface - 1, Main.maxTilesY - 10);
Tile tile = Main.tile[i, j];
if ((tile.type == 203 || tile.type == 204 || tile.type == 22 || tile.type == 25 || tile.type == 112 || tile.type == 398 || tile.type == 400 || tile.type == 399 || tile.type == 401 || tile.type == 234 || tile.type == 163 || tile.type == 200) && j > Main.worldSurface)
{
WorldGen.OreRunner(i, j, (double)WorldGen.genRand.Next(6, 7), WorldGen.genRand.Next(6, 7), (ushort)mod.TileType("BlightOre"));
}
}
}
}
if (npc.type == 127)
{
if (NPC.downedMechBoss1 && NPC.downedMechBoss2 && !TGEMWorld.Blight)
{
Main.NewText("A malevolent mineral seeps into the most pestillent stone...", 221, 153, 255);
TGEMWorld.Blight = true;
for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 22E-05); k++)
{
int i = WorldGen.genRand.Next(10, Main.maxTilesX - 10);
int j = WorldGen.genRand.Next((int) Main.worldSurface - 1, Main.maxTilesY - 10);
Tile tile = Main.tile[i, j];
if ((tile.type == 203 || tile.type == 204 || tile.type == 22 || tile.type == 25 || tile.type == 112 || tile.type == 398 || tile.type == 400 || tile.type == 399 || tile.type == 401 || tile.type == 234 || tile.type == 163 || tile.type == 200) && j > Main.worldSurface)
{
WorldGen.OreRunner(i, j, (double)WorldGen.genRand.Next(6, 7), WorldGen.genRand.Next(6, 7), (ushort)mod.TileType("BlightOre"));
}
}
}
}
if (npc.type == mod.NPCType("TitanRock"))
{
if (!TGEMWorld.Cosmirock)
{
Main.NewText("Your world is blessed with extraterrestrial clumps!", 175, 167, 75);
TGEMWorld.Cosmirock = true;
for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 14E-05); k++)
{
int i = WorldGen.genRand.Next(10, Main.maxTilesX - 10);
int j = WorldGen.genRand.Next((int) Main.worldSurface - 1, Main.maxTilesY - 10);
if (j > Main.worldSurface)
{
WorldGen.OreRunner(i, j, (double)WorldGen.genRand.Next(3, 4), WorldGen.genRand.Next(4, 5), (ushort)mod.TileType("CosmirockTile"));
}
}
}
}
}
}
}