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

◆ PlaceSlab()

void Terraria.GameContent.Biomes.MarbleBiome.PlaceSlab ( Slab slab,
int originX,
int originY,
int scale )
inlineprivate

Definition at line 112 of file MarbleBiome.cs.

113 {
114 ushort num = 367;
115 ushort wall = 178;
116 if (WorldGen.drunkWorldGen)
117 {
118 num = 368;
119 wall = 180;
120 }
121 int num2 = -1;
122 int num3 = scale + 1;
123 int num4 = 0;
124 int num5 = scale;
125 for (int i = num2; i < num3; i++)
126 {
127 if ((i == num2 || i == num3 - 1) && WorldGen.genRand.Next(2) == 0)
128 {
129 continue;
130 }
131 if (WorldGen.genRand.Next(2) == 0)
132 {
133 num4--;
134 }
135 if (WorldGen.genRand.Next(2) == 0)
136 {
137 num5++;
138 }
139 for (int j = num4; j < num5; j++)
140 {
141 Tile tile = GenBase._tiles[originX + i, originY + j];
142 tile.ResetToType(TileID.Sets.Ore[tile.type] ? tile.type : num);
143 bool active = slab.State(i, j, scale);
144 tile.active(active);
145 if (slab.HasWall)
146 {
147 tile.wall = wall;
148 }
149 WorldUtils.TileFrame(originX + i, originY + j, frameNeighbors: true);
150 WorldGen.SquareWallFrame(originX + i, originY + j);
151 Tile.SmoothSlope(originX + i, originY + j);
152 if (WorldGen.SolidTile(originX + i, originY + j - 1) && GenBase._random.Next(4) == 0)
153 {
154 WorldGen.PlaceTight(originX + i, originY + j);
155 }
156 if (WorldGen.SolidTile(originX + i, originY + j) && GenBase._random.Next(4) == 0)
157 {
158 WorldGen.PlaceTight(originX + i, originY + j - 1);
159 }
160 }
161 }
162 }
static bool[] Ore
Definition TileID.cs:295
static UnifiedRandom _random
Definition GenBase.cs:9
static void TileFrame(int x, int y, bool frameNeighbors=false)
Definition WorldUtils.cs:61

References Terraria.WorldBuilding.GenBase._random, Terraria.WorldBuilding.GenBase._tiles, Terraria.Tile.active(), Terraria.WorldGen.drunkWorldGen, Terraria.WorldGen.genRand, Terraria.GameContent.Biomes.MarbleBiome.Slab.HasWall, Terraria.ID.TileID.Sets.Ore, Terraria.WorldGen.PlaceTight(), Terraria.Tile.ResetToType(), Terraria.Tile.SmoothSlope(), Terraria.WorldGen.SolidTile(), Terraria.WorldGen.SquareWallFrame(), Terraria.GameContent.Biomes.MarbleBiome.Slab.State, Terraria.WorldBuilding.WorldUtils.TileFrame(), and Terraria.Tile.type.

Referenced by Terraria.GameContent.Biomes.MarbleBiome.Place().