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

◆ PlaceUncheckedStalactite()

static void Terraria.WorldGen.PlaceUncheckedStalactite ( int x,
int y,
bool preferSmall,
int variation,
bool spiders )
inlinestatic

Definition at line 33134 of file WorldGen.cs.

33135 {
33136 ushort type = 165;
33137 variation = Utils.Clamp(variation, 0, 2);
33138 if (SolidTile(x, y - 1) && !Main.tile[x, y].active() && !Main.tile[x, y + 1].active())
33139 {
33140 if (spiders)
33141 {
33142 int num = 108 + variation * 18;
33143 Main.tile[x, y].type = type;
33144 Main.tile[x, y].active(active: true);
33145 Main.tile[x, y].frameX = (short)num;
33146 Main.tile[x, y].frameY = 0;
33147 Main.tile[x, y + 1].type = type;
33148 Main.tile[x, y + 1].active(active: true);
33149 Main.tile[x, y + 1].frameX = (short)num;
33150 Main.tile[x, y + 1].frameY = 18;
33151 return;
33152 }
33153 if (Main.tile[x, y - 1].type == 147 || Main.tile[x, y - 1].type == 161 || Main.tile[x, y - 1].type == 163 || Main.tile[x, y - 1].type == 164 || Main.tile[x, y - 1].type == 200)
33154 {
33155 if (preferSmall)
33156 {
33157 int num2 = variation * 18;
33158 Main.tile[x, y].type = type;
33159 Main.tile[x, y].active(active: true);
33160 Main.tile[x, y].frameX = (short)num2;
33161 Main.tile[x, y].frameY = 72;
33162 }
33163 else
33164 {
33165 int num3 = variation * 18;
33166 Main.tile[x, y].type = type;
33167 Main.tile[x, y].active(active: true);
33168 Main.tile[x, y].frameX = (short)num3;
33169 Main.tile[x, y].frameY = 0;
33170 Main.tile[x, y + 1].type = type;
33171 Main.tile[x, y + 1].active(active: true);
33172 Main.tile[x, y + 1].frameX = (short)num3;
33173 Main.tile[x, y + 1].frameY = 18;
33174 }
33175 }
33176 if (Main.tile[x, y - 1].type == 1 || Main.tileMoss[Main.tile[x, y - 1].type] || Main.tile[x, y - 1].type == 117 || Main.tile[x, y - 1].type == 25 || Main.tile[x, y - 1].type == 203)
33177 {
33178 if (preferSmall)
33179 {
33180 int num4 = 54 + variation * 18;
33181 Main.tile[x, y].type = type;
33182 Main.tile[x, y].active(active: true);
33183 Main.tile[x, y].frameX = (short)num4;
33184 Main.tile[x, y].frameY = 72;
33185 }
33186 else
33187 {
33188 int num5 = 54 + variation * 18;
33189 Main.tile[x, y].type = type;
33190 Main.tile[x, y].active(active: true);
33191 Main.tile[x, y].frameX = (short)num5;
33192 Main.tile[x, y].frameY = 0;
33193 Main.tile[x, y + 1].type = type;
33194 Main.tile[x, y + 1].active(active: true);
33195 Main.tile[x, y + 1].frameX = (short)num5;
33196 Main.tile[x, y + 1].frameY = 18;
33197 }
33198 }
33199 if (Main.tile[x, y - 1].type == 225)
33200 {
33201 int num6 = 162 + variation * 18;
33202 Main.tile[x, y].type = type;
33203 Main.tile[x, y].active(active: true);
33204 Main.tile[x, y].frameX = (short)num6;
33205 Main.tile[x, y].frameY = 72;
33206 }
33207 if (Main.tile[x, y - 1].type == 396 || Main.tile[x, y - 1].type == 397)
33208 {
33209 if (preferSmall)
33210 {
33211 int num7 = 378 + variation * 18;
33212 Main.tile[x, y].type = type;
33213 Main.tile[x, y].active(active: true);
33214 Main.tile[x, y].frameX = (short)num7;
33215 Main.tile[x, y].frameY = 72;
33216 }
33217 else
33218 {
33219 int num8 = 378 + variation * 18;
33220 Main.tile[x, y].type = type;
33221 Main.tile[x, y].active(active: true);
33222 Main.tile[x, y].frameX = (short)num8;
33223 Main.tile[x, y].frameY = 0;
33224 Main.tile[x, y + 1].type = type;
33225 Main.tile[x, y + 1].active(active: true);
33226 Main.tile[x, y + 1].frameX = (short)num8;
33227 Main.tile[x, y + 1].frameY = 18;
33228 }
33229 }
33230 if (Main.tile[x, y - 1].type == 368)
33231 {
33232 if (preferSmall)
33233 {
33234 int num9 = 432 + variation * 18;
33235 Main.tile[x, y].type = type;
33236 Main.tile[x, y].active(active: true);
33237 Main.tile[x, y].frameX = (short)num9;
33238 Main.tile[x, y].frameY = 72;
33239 }
33240 else
33241 {
33242 int num10 = 432 + variation * 18;
33243 Main.tile[x, y].type = type;
33244 Main.tile[x, y].active(active: true);
33245 Main.tile[x, y].frameX = (short)num10;
33246 Main.tile[x, y].frameY = 0;
33247 Main.tile[x, y + 1].type = type;
33248 Main.tile[x, y + 1].active(active: true);
33249 Main.tile[x, y + 1].frameX = (short)num10;
33250 Main.tile[x, y + 1].frameY = 18;
33251 }
33252 }
33253 if (Main.tile[x, y - 1].type == 367)
33254 {
33255 if (preferSmall)
33256 {
33257 int num11 = 486 + variation * 18;
33258 Main.tile[x, y].type = type;
33259 Main.tile[x, y].active(active: true);
33260 Main.tile[x, y].frameX = (short)num11;
33261 Main.tile[x, y].frameY = 72;
33262 }
33263 else
33264 {
33265 int num12 = 486 + variation * 18;
33266 Main.tile[x, y].type = type;
33267 Main.tile[x, y].active(active: true);
33268 Main.tile[x, y].frameX = (short)num12;
33269 Main.tile[x, y].frameY = 0;
33270 Main.tile[x, y + 1].type = type;
33271 Main.tile[x, y + 1].active(active: true);
33272 Main.tile[x, y + 1].frameX = (short)num12;
33273 Main.tile[x, y + 1].frameY = 18;
33274 }
33275 }
33276 }
33277 else
33278 {
33279 if (spiders || !SolidTile(x, y + 1) || Main.tile[x, y].active() || Main.tile[x, y - 1].active())
33280 {
33281 return;
33282 }
33283 if (Main.tile[x, y + 1].type == 1 || Main.tileMoss[Main.tile[x, y + 1].type] || Main.tile[x, y - 1].type == 117 || Main.tile[x, y - 1].type == 25 || Main.tile[x, y - 1].type == 203)
33284 {
33285 if (preferSmall)
33286 {
33287 int num13 = 54 + variation * 18;
33288 Main.tile[x, y].type = type;
33289 Main.tile[x, y].active(active: true);
33290 Main.tile[x, y].frameX = (short)num13;
33291 Main.tile[x, y].frameY = 90;
33292 }
33293 else
33294 {
33295 int num14 = 54 + variation * 18;
33296 Main.tile[x, y - 1].type = type;
33297 Main.tile[x, y - 1].active(active: true);
33298 Main.tile[x, y - 1].frameX = (short)num14;
33299 Main.tile[x, y - 1].frameY = 36;
33300 Main.tile[x, y].type = type;
33301 Main.tile[x, y].active(active: true);
33302 Main.tile[x, y].frameX = (short)num14;
33303 Main.tile[x, y].frameY = 54;
33304 }
33305 }
33306 if (Main.tile[x, y + 1].type == 225)
33307 {
33308 int num15 = 162 + variation * 18;
33309 Main.tile[x, y].type = type;
33310 Main.tile[x, y].active(active: true);
33311 Main.tile[x, y].frameX = (short)num15;
33312 Main.tile[x, y].frameY = 90;
33313 }
33314 if (Main.tile[x, y + 1].type == 396 || Main.tile[x, y + 1].type == 397)
33315 {
33316 if (preferSmall)
33317 {
33318 int num16 = 378 + variation * 18;
33319 Main.tile[x, y].type = type;
33320 Main.tile[x, y].active(active: true);
33321 Main.tile[x, y].frameX = (short)num16;
33322 Main.tile[x, y].frameY = 90;
33323 }
33324 else
33325 {
33326 int num17 = 378 + variation * 18;
33327 Main.tile[x, y - 1].type = type;
33328 Main.tile[x, y - 1].active(active: true);
33329 Main.tile[x, y - 1].frameX = (short)num17;
33330 Main.tile[x, y - 1].frameY = 36;
33331 Main.tile[x, y].type = type;
33332 Main.tile[x, y].active(active: true);
33333 Main.tile[x, y].frameX = (short)num17;
33334 Main.tile[x, y].frameY = 54;
33335 }
33336 }
33337 if (Main.tile[x, y + 1].type == 368)
33338 {
33339 if (preferSmall)
33340 {
33341 int num18 = 432 + variation * 18;
33342 Main.tile[x, y].type = type;
33343 Main.tile[x, y].active(active: true);
33344 Main.tile[x, y].frameX = (short)num18;
33345 Main.tile[x, y].frameY = 90;
33346 }
33347 else
33348 {
33349 int num19 = 432 + variation * 18;
33350 Main.tile[x, y - 1].type = type;
33351 Main.tile[x, y - 1].active(active: true);
33352 Main.tile[x, y - 1].frameX = (short)num19;
33353 Main.tile[x, y - 1].frameY = 36;
33354 Main.tile[x, y].type = type;
33355 Main.tile[x, y].active(active: true);
33356 Main.tile[x, y].frameX = (short)num19;
33357 Main.tile[x, y].frameY = 54;
33358 }
33359 }
33360 if (Main.tile[x, y + 1].type == 367)
33361 {
33362 if (preferSmall)
33363 {
33364 int num20 = 486 + variation * 18;
33365 Main.tile[x, y].type = type;
33366 Main.tile[x, y].active(active: true);
33367 Main.tile[x, y].frameX = (short)num20;
33368 Main.tile[x, y].frameY = 90;
33369 }
33370 else
33371 {
33372 int num21 = 486 + variation * 18;
33373 Main.tile[x, y - 1].type = type;
33374 Main.tile[x, y - 1].active(active: true);
33375 Main.tile[x, y - 1].frameX = (short)num21;
33376 Main.tile[x, y - 1].frameY = 36;
33377 Main.tile[x, y].type = type;
33378 Main.tile[x, y].active(active: true);
33379 Main.tile[x, y].frameX = (short)num21;
33380 Main.tile[x, y].frameY = 54;
33381 }
33382 }
33383 }
33384 }

References Terraria.Enums.SolidTile, Terraria.Main.tile, Terraria.Main.tileMoss, and System.type.

Referenced by Terraria.GameContent.Biomes.GraniteBiome.PlaceDecorations().