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

◆ Check3x4()

static void Terraria.WorldGen.Check3x4 ( int i,
int j,
int type )
inlinestatic

Definition at line 41379 of file WorldGen.cs.

41380 {
41381 if (destroyObject)
41382 {
41383 return;
41384 }
41385 bool flag = false;
41386 int num = i;
41387 int num2 = j;
41388 int num3 = 0;
41389 int num4 = 0;
41390 int num5 = Main.tile[i, j].frameX / 18;
41391 int num6 = Main.tile[i, j].frameY / 18;
41392 while (num5 >= 3)
41393 {
41394 num3++;
41395 num5 -= 3;
41396 }
41397 while (num6 >= 4)
41398 {
41399 num4++;
41400 num6 -= 4;
41401 }
41402 num -= num5;
41403 num2 -= num6;
41404 for (int k = num; k < num + 3; k++)
41405 {
41406 for (int l = num2; l < num2 + 4; l++)
41407 {
41408 if (Main.tile[k, l] == null)
41409 {
41410 Main.tile[k, l] = new Tile();
41411 }
41412 if (!Main.tile[k, l].active() || Main.tile[k, l].type != type || Main.tile[k, l].frameX != num3 * 54 + (k - num) * 18 || Main.tile[k, l].frameY != num4 * 72 + (l - num2) * 18)
41413 {
41414 flag = true;
41415 }
41416 }
41417 if (Main.tile[k, num2 + 4] == null)
41418 {
41419 Main.tile[k, num2 + 4] = new Tile();
41420 }
41421 if (!SolidTileAllowBottomSlope(k, num2 + 4))
41422 {
41423 flag = true;
41424 }
41425 }
41426 if (!flag)
41427 {
41428 return;
41429 }
41430 destroyObject = true;
41431 for (int m = num; m < num + 3; m++)
41432 {
41433 for (int n = num2; n < num2 + 4; n++)
41434 {
41435 if (Main.tile[m, n].type == type && Main.tile[m, n].active())
41436 {
41437 KillTile(m, n);
41438 }
41439 }
41440 }
41441 switch (type)
41442 {
41443 case 101:
41444 {
41445 int type4;
41446 switch (num3)
41447 {
41448 case 1:
41449 type4 = 1414;
41450 break;
41451 case 2:
41452 type4 = 1415;
41453 break;
41454 case 3:
41455 type4 = 1416;
41456 break;
41457 case 4:
41458 type4 = 1463;
41459 break;
41460 case 5:
41461 type4 = 1512;
41462 break;
41463 case 6:
41464 type4 = 2020;
41465 break;
41466 case 7:
41467 type4 = 2021;
41468 break;
41469 case 8:
41470 type4 = 2022;
41471 break;
41472 case 9:
41473 type4 = 2023;
41474 break;
41475 case 10:
41476 type4 = 2024;
41477 break;
41478 case 11:
41479 type4 = 2025;
41480 break;
41481 case 12:
41482 type4 = 2026;
41483 break;
41484 case 13:
41485 type4 = 2027;
41486 break;
41487 case 14:
41488 type4 = 2028;
41489 break;
41490 case 15:
41491 type4 = 2029;
41492 break;
41493 case 16:
41494 type4 = 2030;
41495 break;
41496 case 17:
41497 type4 = 2031;
41498 break;
41499 case 18:
41500 case 19:
41501 case 20:
41502 case 21:
41503 type4 = 2135 + num3 - 18;
41504 break;
41505 default:
41506 type4 = num3 switch
41507 {
41508 22 => 2233,
41509 23 => 2536,
41510 24 => 2540,
41511 25 => 2554,
41512 26 => 2569,
41513 27 => 2670,
41514 28 => 2817,
41515 29 => 3165,
41516 30 => 3167,
41517 31 => 3166,
41518 32 => 3917,
41519 33 => 3933,
41520 34 => 3960,
41521 35 => 4147,
41522 36 => 4168,
41523 37 => 4189,
41524 38 => 4210,
41525 39 => 4300,
41526 40 => 4568,
41527 41 => 5150,
41528 42 => 5171,
41529 43 => 5192,
41530 _ => 354,
41531 };
41532 break;
41533 }
41534 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 32, 32, type4);
41535 break;
41536 }
41537 case 102:
41538 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 32, 32, 355);
41539 break;
41540 case 463:
41541 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 32, 32, 3813);
41542 break;
41543 case 617:
41544 if (num3 == 27)
41545 {
41546 short type2 = 5110;
41547 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 32, 32, type2);
41548 }
41549 else
41550 {
41551 int type3 = 4924 + num3;
41552 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 32, 32, type3);
41553 }
41554 break;
41555 }
41556 destroyObject = false;
41557 for (int num7 = num - 1; num7 < num + 4; num7++)
41558 {
41559 for (int num8 = num2 - 1; num8 < num2 + 4; num8++)
41560 {
41562 }
41563 }
41564 }
static bool destroyObject
Definition WorldGen.cs:1020
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static void TileFrame(int i, int j, bool resetFrame=false, bool noBreak=false)
static bool SolidTileAllowBottomSlope(int i, int j)
static IEntitySource GetItemSource_FromTileBreak(int x, int y)

References Terraria.Item.NewItem(), Terraria.DataStructures.Tile, Terraria.Main.tile, and System.type.