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

◆ PlaceAt()

static void Terraria.GameContent.Biomes.Desert.PitEntrance.PlaceAt ( DesertDescription description,
Point position,
int holeRadius )
inlinestaticprivate

Definition at line 16 of file PitEntrance.cs.

17 {
18 for (int i = -holeRadius - 3; i < holeRadius + 3; i++)
19 {
20 for (int j = description.Surface[i + position.X]; j <= description.Hive.Top + 10; j++)
21 {
22 double value = (double)(j - description.Surface[i + position.X]) / (double)(description.Hive.Top - description.Desert.Top);
23 value = Utils.Clamp(value, 0.0, 1.0);
24 int num = (int)(GetHoleRadiusScaleAt(value) * (double)holeRadius);
25 if (Math.Abs(i) < num)
26 {
27 Main.tile[i + position.X, j].ClearEverything();
28 }
29 else if (Math.Abs(i) < num + 3 && value > 0.35)
30 {
31 Main.tile[i + position.X, j].ResetToType(397);
32 }
33 double num2 = Math.Abs((double)i / (double)holeRadius);
34 num2 *= num2;
35 if (Math.Abs(i) < num + 3 && (double)(j - position.Y) > 15.0 - 3.0 * num2)
36 {
37 Main.tile[i + position.X, j].wall = 187;
38 WorldGen.SquareWallFrame(i + position.X, j - 1);
39 WorldGen.SquareWallFrame(i + position.X, j);
40 }
41 }
42 }
43 holeRadius += 4;
44 for (int k = -holeRadius; k < holeRadius; k++)
45 {
46 int num3 = holeRadius - Math.Abs(k);
47 num3 = Math.Min(10, num3 * num3);
48 for (int l = 0; l < num3; l++)
49 {
50 Main.tile[k + position.X, l + description.Surface[k + position.X]].ClearEverything();
51 }
52 }
53 }
static byte Min(byte val1, byte val2)
Definition Math.cs:912
static double Abs(double value)
static double GetHoleRadiusScaleAt(double yProgress)

References System.Math.Abs(), Terraria.GameContent.Biomes.Desert.DesertDescription.Desert, Terraria.GameContent.Biomes.Desert.PitEntrance.GetHoleRadiusScaleAt(), Terraria.GameContent.Biomes.Desert.DesertDescription.Hive, System.Math.Min(), Terraria.WorldGen.SquareWallFrame(), Terraria.GameContent.Biomes.Desert.DesertDescription.Surface, Terraria.Main.tile, Microsoft.Xna.Framework.Rectangle.Top, System.value, Microsoft.Xna.Framework.Point.X, and Microsoft.Xna.Framework.Point.Y.

Referenced by Terraria.GameContent.Biomes.Desert.PitEntrance.Place().