31339 {
31340
31341
31342
31343
31344
31345
31346
31347
31348
31349
31350
31351
31352
31353
31354
31355
31356
31357
31358
31359
31360
31361
31362
31363
31364
31365
31366
31367
31368
31369
31370
31371
31372
31373
31374
31375
31376
31377
31378
31379
31380
31381
31382
31383
31384
31385
31386
31387
31388
31389
31390
31391
31392
31393
31394
31395
31396
31397
31398
31399
31400
31401
31402
31403
31404
31405
31406
31407
31408
31409
31410
31411
31412
31413
31414
31415
31416
31417
31418
31419
31420
31421
31422
31423
31424
31425
31426
31427
31428
31429
31430
31431
31432
31433
31434
31435
31436
31437
31438
31439
31440
31441
31442
31443
31444
31445
31446
31447
31448
31449
31450
31451
31452
31453
31454
31455
31456
31457
31458
31459
31460
31461
31462
31463
31464
31465
31466
31467
31468
31469
31470
31471
31472
31473
31474
31475
31476
31477
31478
31479
31480
31481
31482
31483
31484
31485
31486
31487
31488
31489
31490
31491
31492
31493
31494
31495
31496
31497
31498
31499
31500
31501
31502
31503
31504
31505
31506
31507
31508
31509
31510
31511
31512
31513
31514
31515
31516
31517
31518
31519
31520
31521
31522
31523
31524
31525
31526
31527
31528
31529
31530
31531
31532
31533
31534
31535
31536
31537
31538
31539
31540
31541
31542
31543
31544
31545
31546
31547
31548
31549
31550
31551
31552
31553
31555 {
31556 int num = n.frame.Y /
n.frame.Height;
31558 if (
num >= array.Length)
31559 {
31561 }
31564 switch (
n.GetPartyHatColor())
31565 {
31568 break;
31571 break;
31574 break;
31577 break;
31578 }
31580 rectangle.Width -= 2;
31581 rectangle.Height -= 2;
31584 int num17 =
n.spriteDirection;
31586 {
31588 }
31590 {
31593 {
31594 case 19:
31595 case 22:
31596 case 23:
31597 case 24:
31598 case 25:
31599 case 26:
31600 case 27:
31602 break;
31603 case 11:
31604 case 12:
31605 case 13:
31606 case 14:
31607 case 15:
31609 break;
31610 }
31611 }
31613 {
31615 }
31617 {
31620 {
31621 case 1:
31622 case 2:
31623 case 3:
31625 break;
31626 case 18:
31627 case 19:
31628 case 20:
31629 case 21:
31630 case 22:
31631 case 23:
31632 case 24:
31633 case 25:
31635 break;
31636 case 8:
31638 break;
31639 }
31640 }
31642 {
31645 {
31646 default:
31648 break;
31649 case 670:
31651 break;
31652 case 681:
31654 break;
31655 case 682:
31658 break;
31659 case 683:
31662 break;
31663 case 684:
31665 break;
31666 case 679:
31667 break;
31668 }
31669 }
31670 if (
n.IsShimmerVariant)
31671 {
31673 {
31674 case 38:
31677 break;
31678 case 178:
31679 case 228:
31682 break;
31683 case 107:
31686 break;
31687 case 54:
31689 break;
31690 case 160:
31692 break;
31693 case 108:
31694 case 124:
31695 case 208:
31696 case 209:
31697 case 227:
31699 break;
31700 }
31701 }
31702 Vector2
vector = n.Top +
new Vector2((
float)(-2 *
num17),
n.gfxOffY);
31704 vector.Y += array[
num];
31709 {
31712 {
31714 }
31716 {
31718 }
31720 {
31722 }
31724 {
31726 }
31727 if (
n.type == 108 ||
n.type == 178)
31728 {
31730 }
31732 {
31734 }
31736 {
31738 }
31739 }
31741 if (
n.type == 229 &&
n.ai[0] == 12
f)
31742 {
31743 vector.X -=
num17 * 4;
31744 }
31745 if (
n.type == 550 &&
n.ai[0] == 5
f)
31746 {
31747 vector.X +=
num17 * 7;
31748 }
31752 {
31753 case 550:
31755 break;
31756 case 588:
31758 break;
31759 case 227:
31761 break;
31762 case 228:
31764 break;
31765 case 17:
31766 case 18:
31767 case 19:
31768 case 20:
31769 case 22:
31770 case 124:
31771 case 229:
31772 case 353:
31773 case 633:
31774 case 637:
31775 case 638:
31776 case 656:
31777 case 670:
31778 case 678:
31779 case 679:
31780 case 680:
31781 case 681:
31782 case 682:
31783 case 683:
31784 case 684:
31786 break;
31787 case 37:
31788 case 38:
31789 case 54:
31790 case 107:
31791 case 108:
31792 case 160:
31793 case 207:
31794 case 209:
31796 break;
31797 case 178:
31798 case 208:
31799 case 369:
31801 break;
31802 }
31804 vector.X += 4 *
num17;
31807 {
31809 }
31811 if (
n.shimmerTransparency > 0
f)
31812 {
31813 num20 *= 1
f -
n.shimmerTransparency;
31814 }
31816 }
31818 {
31820 }
31822 {
31823 if (
n.type == 228 ||
n.type == 229 ||
n.type == 209)
31824 {
31825 return;
31826 }
31829 if (
n.spriteDirection == 1)
31830 {
31832 }
31834 if (
n.type == 22 &&
n.ai[2] > -0.1f)
31835 {
31837 }
31838 if (
n.type == 368 &&
hardMode &&
n.ai[2] > -0.1f)
31839 {
31841 }
31842 if (
n.type == 368 && !
hardMode &&
n.ai[2] < -0.1f)
31843 {
31845 }
31846 float rotation =
num21 * ((float)
Math.PI / 2
f) * (float)
n.spriteDirection;
31851 {
31854 {
31855 vector5.X -= 10 *
n.direction;
31857 }
31858 }
31859 else if (
n.type == 22)
31860 {
31863 }
31864 else if (
n.type == 178)
31865 {
31867 }
31868 else if (
n.type == 227)
31869 {
31873 }
31874 else if (
n.type == 368)
31875 {
31878 {
31880 }
31881 else
31882 {
31883 if (
n.ai[2] < -0.1f)
31884 {
31886 }
31888 }
31889 }
31894 Vector2
origin2 =
default(Vector2);
31896 if (
n.spriteDirection == -1)
31897 {
31899 }
31902 {
31904 if (
n.IsShimmerVariant)
31905 {
31907 }
31910 }
31912 {
31914 if (
n.IsShimmerVariant)
31915 {
31917 }
31920 }
31921 }
31923 {
31925 Vector2
vector6 = n.Bottom +
new Vector2(0
f,
n.gfxOffY + 4
f);
31929 }
31931 {
31934 Vector2
zero = Vector2.Zero;
31937 {
31941 {
31942 return;
31943 }
31945 {
31947 }
31948 }
31949 else if (
n.type == 353)
31950 {
31954 {
31955 return;
31956 }
31958 {
31960 }
31961 }
31962 else if (
n.type == 441)
31963 {
31968 {
31969 return;
31970 }
31972 {
31974 }
31975 }
31979 Vector2
vector7 = swingStats.Item1 + (swingStats.Item1 -
n.Center) *
num6 +
zero;
31980 Vector2
origin4 =
rectangle3.Size() *
new Vector2((
float)((
n.spriteDirection != 1) ? 1 : 0), 1
f);
31982 }
31983 if (
n.type == 550 &&
n.ai[0] == 18
f)
31984 {
31986 {
31987 return;
31988 }
31992 float num9 = 0.15f;
31993 Vector2
zero2 = Vector2.Zero;
31995 int num10 = (int)
n.ai[2];
31997 {
31999 bool flag = player.HeldItem.type == 353 && player.direction ==
Math.Sign(
n.Center.X -
player.Center.X);
32001 float num12 =
n.localAI[3];
32003 {
32005 if (
n.localAI[3] !=
num12)
32006 {
32007 Vector2
vector8 = n.Center +
new Vector2((
float)(
n.spriteDirection * 30), -6
f);
32008 Vector2
vector9 =
default(Vector2);
32010 for (int i = 0; i < 30; i++)
32011 {
32012 Dust
obj = Dust.NewDustDirect(
vector8 -
vector9 / 2
f, (
int)
vector9.X, (int)
vector9.Y, 4, 0
f, 0
f, 50,
new Color(245, 200, 30, 155), 0.7f);
32013 obj.noGravity = true;
32014 obj.velocity *= 1
f;
32015 Dust
obj2 = Dust.NewDustDirect(
vector8 -
vector9 / 2
f, (
int)
vector9.X, (int)
vector9.Y, 4, 0
f, 0
f, 50,
new Color(245, 200, 30, 155), 0.6f);
32016 obj2.velocity *= 2
f;
32017 }
32018 }
32019 }
32020 else if (
n.localAI[3] == 1
f)
32021 {
32023 }
32024 }
32026 Vector2
vector10 = swingStats2.Item1 + (swingStats2.Item1 -
n.Center) *
num9 +
zero2;
32027 Vector2
origin5 =
rectangle4.Size() *
new Vector2((
float)((
n.spriteDirection != 1) ? 1 : 0), 1
f);
32029 }
32031 {
32032 return;
32033 }
32034 int num13 = (int)
n.ai[2];
32036 {
32037 return;
32038 }
32041 num14 = (((int)
n.frameCounter < 6) ? 1 : 2);
32043 {
32045 }
32047 {
32048 return;
32049 }
32050 Vector2
vector2 = Vector2.Zero;
32052 {
32054 }
32056 {
32058 }
32060 {
32062 }
32064 {
32065 vector2.X *= 0.5f;
32067 }
32069 {
32071 }
32073 {
32075 {
32077 }
32079 }
32081 Vector2
origin6 =
rectangle5.Size() *
new Vector2((
float)((
n.spriteDirection != 1) ? 1 : 0), 1
f);
32082 Vector2 position = default(Vector2);
32086 }
static Asset< Texture2D >[] Npc
static Asset< Texture2D >[] Item
static Asset< Texture2D >[] Extra
static readonly short Count
static int[][] TownNPCsFramingGroups
The vertical offset, in pixels, that this NPC's party hat will draw. Indexed using values from F:Terr...
static int[] AttackTime
The duration of this town NPC's attack animation in ticks. Defaults to -1.
static bool[] IsTownSlime
If true for a given NPC type (F:Terraria.NPC.type), then that NPC is categorized as a town slime....
static int[] AttackType
Determines how a town NPC with the given NPC type (F:Terraria.NPC.type) attacks. For -1,...
static int[] HatOffsetY
The vertical offset, in pixels, that an NPC's party hat will draw with. Defaults to 0.
static int[] NPCFramingGroup
The index for F:Terraria.ID.NPCID.Sets.TownNPCsFramingGroups for a given NPC type (F:Terraria....
static Vector2[] OffsetsNPCOffhand
static int[] npcFrameCount
static SpriteBatch spriteBatch
static void GetItemDrawFrame(int item, out Texture2D itemTexture, out Rectangle itemFrame)
Gets the texture and frame of the given item type (F:Terraria.Item.type).
static Vector2 screenPosition
The position of the top left corner of the screen in world coordinates. Modify in M:Terraria....
static Vector2 DrawPlayerItemPos(float gravdir, int itemtype)
static void DrawTownAttackSwing(NPC npc, ref Texture2D item, ref Rectangle itemFrame, ref int itemSize, ref float scale, ref Vector2 offset)
static void DrawTownAttackGun(NPC npc, ref Texture2D item, ref Rectangle itemFrame, ref float scale, ref int horizontalHoldoutOffset)
This serves as the central class from which NPC-related functions are carried out....