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

◆ GetTileCollisionParameters()

void Terraria.NPC.GetTileCollisionParameters ( out Vector2 cPosition,
out int cWidth,
out int cHeight )
inline

Definition at line 89517 of file NPC.cs.

89518 {
89520 cWidth = width;
89521 cHeight = height;
89522 if (type == 594)
89523 {
89524 int num = (int)(44f + 20f * ai[1]);
89525 cPosition.Y += num;
89526 cHeight += num;
89527 cPosition.X += cWidth / 2;
89528 cWidth = (int)(6f + 26f * ai[1]);
89529 cPosition.X -= cWidth / 2;
89530 }
89531 if (type == 686)
89532 {
89533 int num2 = 64;
89534 cPosition.Y += num2;
89535 cHeight += num2;
89536 cPosition.X += cWidth / 2;
89537 cWidth = 32;
89538 cPosition.X -= cWidth / 2;
89539 }
89540 if (type == 243)
89541 {
89542 cHeight = 90;
89543 }
89544 if (type == 290)
89545 {
89546 cHeight = 40;
89547 }
89548 if (type == 351)
89549 {
89550 cHeight = 40;
89551 }
89552 if (type == 482)
89553 {
89554 cHeight = 40;
89555 }
89556 if (type == 351 || type == 343 || type == 348 || type == 349)
89557 {
89558 cHeight = 40;
89559 }
89560 if (type == 391)
89561 {
89562 for (int i = 0; i < 200; i++)
89563 {
89564 if (Main.npc[i].active && Main.npc[i].type == 390 && Main.npc[i].ai[0] == (float)whoAmI)
89565 {
89566 cHeight = 62;
89567 break;
89568 }
89569 }
89570 }
89571 if (type == 415)
89572 {
89573 for (int j = 0; j < 200; j++)
89574 {
89575 if (Main.npc[j].active && Main.npc[j].type == 416 && Main.npc[j].ai[0] == (float)whoAmI)
89576 {
89577 cHeight = 62;
89578 break;
89579 }
89580 }
89581 }
89582 if (type == 576 || type == 577)
89583 {
89584 cPosition.X += 32f;
89585 cWidth -= 64;
89586 }
89587 if (cHeight != height)
89588 {
89589 cPosition.Y += height - cHeight;
89590 }
89591 }
Vector2 position
Definition Entity.cs:14
float[] ai
Definition NPC.cs:447
int type
Definition NPC.cs:445

References Terraria.Main.npc, and System.type.

Referenced by Terraria.NPC.AI_107_ImprovedWalkers().