TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ ShellPile()

static bool Terraria.WorldGen.ShellPile ( int X,
int Y )
inlinestatic

Definition at line 7146 of file WorldGen.cs.

7147 {
7148 int num = Y;
7149 while (!SolidTile(X, num))
7150 {
7151 num++;
7152 if ((double)num > Main.worldSurface)
7153 {
7154 return false;
7155 }
7156 }
7157 if (Main.tile[X, num].type != 53)
7158 {
7159 return false;
7160 }
7161 if (Main.tile[X, num].wall > 0)
7162 {
7163 return false;
7164 }
7165 num--;
7166 Vector2D vector2D = new Vector2D(X, num);
7167 Vector2D vector2D2 = default(Vector2D);
7168 vector2D2.X = genRand.NextDouble() * 0.6 - 0.3;
7169 vector2D2.Y = genRand.NextDouble() * 0.5 + 0.5;
7170 double num2 = genRand.Next(2, 4);
7171 if (genRand.Next(10) == 0)
7172 {
7173 num2 += 1.0;
7174 }
7175 int num3 = genRand.Next(3, 6);
7176 while (num3 > 0)
7177 {
7178 num3--;
7179 for (int i = X - (int)num2 * 4; (double)i <= (double)X + num2 * 4.0; i++)
7180 {
7181 int num4 = num + (int)num2 * 4;
7182 while ((double)num4 > (double)num - num2 * 4.0)
7183 {
7184 double num5 = num2 * (double)genRand.Next(70, 91) * 0.01;
7185 Vector2D vector2D3 = vector2D - new Vector2D(i, num4);
7186 vector2D3.X *= 0.6;
7187 if (vector2D3.Length() < num5)
7188 {
7189 if (num4 <= num + 1 || genRand.Next(6) == 0)
7190 {
7191 Main.tile[i, num4].type = 495;
7192 Main.tile[i, num4].active(active: true);
7193 Main.tile[i, num4].halfBrick(halfBrick: false);
7194 Main.tile[i, num4].slope(0);
7195 if (!Main.tile[i, num4 + 1].active())
7196 {
7197 Main.tile[i, num4 + 1].type = 495;
7198 Main.tile[i, num4 + 1].active(active: true);
7199 Main.tile[i, num4 + 1].halfBrick(halfBrick: false);
7200 Main.tile[i, num4 + 1].slope(0);
7201 if (!Main.tile[i, num4 + 2].active())
7202 {
7203 Main.tile[i, num4 + 2].type = 53;
7204 Main.tile[i, num4 + 2].active(active: true);
7205 Main.tile[i, num4 + 2].halfBrick(halfBrick: false);
7206 Main.tile[i, num4 + 2].slope(0);
7207 if (!Main.tile[i, num4 + 3].active())
7208 {
7209 Main.tile[i, num4 + 3].type = 397;
7210 Main.tile[i, num4 + 3].active(active: true);
7211 Main.tile[i, num4 + 3].halfBrick(halfBrick: false);
7212 Main.tile[i, num4 + 3].slope(0);
7213 }
7214 }
7215 }
7216 if (!gen)
7217 {
7219 }
7220 }
7221 else if (Main.tile[i, num4].type != 495)
7222 {
7223 Main.tile[i, num4].active(active: true);
7224 Main.tile[i, num4].halfBrick(halfBrick: false);
7225 Main.tile[i, num4].slope(0);
7226 Main.tile[i, num4].type = 53;
7227 if (!gen)
7228 {
7230 }
7231 }
7232 }
7233 num4--;
7234 }
7235 }
7237 vector2D2.X += genRand.NextDouble() * 0.2 - 0.1;
7238 vector2D2.Y += genRand.NextDouble() * 0.2 - 0.1;
7239 Utils.Clamp(vector2D2.X, -0.3, 0.3);
7240 Utils.Clamp(vector2D2.Y, 0.5, 1.0);
7241 }
7242 return true;
7243 }
static volatile bool gen
Definition WorldGen.cs:1210
static UnifiedRandom genRand
Definition WorldGen.cs:1455
static void SquareTileFrame(int i, int j, bool resetFrame=true)

References Terraria.WorldGen.gen, Terraria.WorldGen.genRand, Terraria.Enums.SolidTile, Terraria.WorldGen.SquareTileFrame(), Terraria.Main.tile, and Terraria.Main.worldSurface.

+ Here is the call graph for this function: