51563 {
51564
51565
51566
51567
51568
51569
51570
51571
51572
51573
51574
51575
51576
51577
51578
51579
51580
51581
51582
51583
51584
51585
51586
51587
51588
51589
51590
51591
51592
51593
51594
51595
51596
51597
51598
51599
51600
51601
51602
51603
51604
51605
51606
51607
51608
51609
51610
51611
51612
51613
51614
51615
51616
51617
51618
51619
51620
51621
51622
51623
51624
51625
51626
51627
51628
51629
51630
51631
51632
51633
51634
51635
51636
51637
51638
51639
51640
51641
51642
51643
51644
51645
51646
51647
51648
51649
51650
51651
51652
51653
51654
51655
51656
51657
51658
51659
51660
51661
51662
51663
51664
51665
51666
51667
51668
51669
51670
51671
51672
51673
51674
51675
51676
51677
51678
51679
51680
51681
51682
51683
51684
51685
51686
51687
51688
51689
51690
51691
51692
51693
51694
51695
51696
51697
51698
51699
51700
51701
51702
51703
51704
51705
51706
51707
51708
51709
51710
51711
51712
51713
51714
51715
51716
51717
51718
51719
51720
51721
51722
51723
51724
51725
51726
51727
51728
51729
51730
51731
51732
51733
51734
51735
51736
51737
51738
51739
51740
51741
51742
51743
51744
51745
51746
51747
51748
51749
51750
51751
51752
51753
51754
51755
51756
51757
51758
51759
51760
51761
51762
51763
51764
51765
51766
51767
51768
51769
51770
51771
51772
51773
51774
51775
51776
51777
51778
51779
51780
51781
51782
51783
51784
51785
51786
51787
51788
51789
51790
51791
51792
51793
51794
51795
51796 if (Main.dedServ)
51797 {
51798 return;
51799 }
51800 if (
sItem.useStyle == 1)
51801 {
51802 if (
sItem.type > -1 && Item.claw[
sItem.type])
51803 {
51805 {
51807 itemLocation.X = position.X + (float)
width * 0.5
f + ((
float)heldItemFrame.Width * 0.5f -
num) * (
float)
direction;
51809 }
51811 {
51813 itemLocation.X = position.X + (float)
width * 0.5
f + ((
float)heldItemFrame.Width * 0.5f -
num12) * (
float)
direction;
51816 }
51817 else
51818 {
51820 itemLocation.X = position.X + (float)
width * 0.5
f - ((
float)heldItemFrame.Width * 0.5f -
num23) * (
float)
direction;
51823 }
51825 }
51826 else
51827 {
51828 Vector2
zero = Vector2.Zero;
51830 {
51833 {
51835 }
51837 {
51839 }
51841 {
51843 }
51845 {
51847 }
51849 {
51851 }
51852 if (
sItem.type == 671)
51853 {
51855 }
51856 itemLocation.X = position.X + (float)
width * 0.5
f + ((
float)heldItemFrame.Width * 0.5f -
num33) * (
float)
direction;
51859 }
51861 {
51864 {
51866 }
51868 {
51870 }
51872 {
51874 }
51876 {
51878 }
51880 {
51882 }
51883 if (
sItem.type == 671)
51884 {
51886 }
51887 itemLocation.X = position.X + (float)
width * 0.5
f + ((
float)heldItemFrame.Width * 0.5f -
num35) * (
float)
direction;
51890 {
51892 }
51894 {
51896 }
51898 {
51900 }
51902 {
51904 }
51905 if (
sItem.type == 671)
51906 {
51908 }
51911 }
51912 else
51913 {
51916 {
51918 }
51920 {
51922 }
51924 {
51926 }
51928 {
51930 }
51932 {
51934 }
51936 {
51938 }
51939 if (
sItem.type == 671)
51940 {
51942 }
51943 itemLocation.X = position.X + (float)
width * 0.5
f - ((
float)heldItemFrame.Width * 0.5f -
num36) * (
float)
direction;
51946 {
51948 }
51950 {
51952 }
51954 {
51956 }
51958 {
51960 }
51961 if (
sItem.type == 671)
51962 {
51964 }
51967 }
51969 {
51971 }
51973 }
51975 {
51978 }
51979 }
51980 else if (
sItem.useStyle == 7)
51981 {
51984 {
51987 }
51988 else
51989 {
51992 }
51994 {
51997 }
51998 }
51999 else if (
sItem.useStyle == 9)
52000 {
52015 {
52017 }
52025 {
52028 }
52029 }
52030 else if (
sItem.useStyle == 6)
52031 {
52035 {
52037 }
52040 {
52043 }
52044 else
52045 {
52048 }
52050 {
52053 }
52054 }
52055 else if (
sItem.useStyle == 2)
52056 {
52061 {
52063 }
52065 {
52067 }
52069 {
52071 }
52076 {
52077 case CompositeArmStretchAmount.Full:
52079 break;
52080 case CompositeArmStretchAmount.ThreeQuarters:
52082 break;
52083 case CompositeArmStretchAmount.Quarter:
52085 break;
52086 case CompositeArmStretchAmount.None:
52088 break;
52089 }
52092 {
52095 }
52096 }
52097 else if (
sItem.useStyle == 11)
52098 {
52103 {
52105 }
52107 {
52109 }
52111 {
52113 }
52115 {
52117 }
52119 {
52121 }
52123 {
52125 }
52130 {
52131 case CompositeArmStretchAmount.Full:
52133 break;
52134 case CompositeArmStretchAmount.ThreeQuarters:
52136 break;
52137 case CompositeArmStretchAmount.Quarter:
52139 break;
52140 case CompositeArmStretchAmount.None:
52142 break;
52143 }
52146 {
52149 }
52150 }
52151 else if (
sItem.useStyle == 3)
52152 {
52154 {
52155 itemLocation.X = -1000
f;
52156 itemLocation.Y = -1000
f;
52158 }
52159 else
52160 {
52161 itemLocation.X = position.X + (float)
width * 0.5
f + ((
float)heldItemFrame.Width * 0.5f - 4
f) * (
float)
direction;
52165 {
52167 }
52169 {
52171 }
52172 itemLocation.X -=
num10;
52174 if (
sItem.type == 946 ||
sItem.type == 4707)
52175 {
52177 }
52178 }
52180 {
52183 }
52184 }
52185 else if (
sItem.useStyle == 4)
52186 {
52189 if (
sItem.type == 3601)
52190 {
52192 }
52193 if (
sItem.type == 5114)
52194 {
52197 }
52198 if (
sItem.type == 5120)
52199 {
52201 }
52206 {
52209 }
52210 }
52211 else if (
sItem.useStyle == 5)
52212 {
52213 if (
sItem.type == 3779)
52214 {
52216 itemLocation.X = base.Center.X + (float)(6 *
direction);
52217 itemLocation.Y = MountedCenter.Y + 6
f;
52218 }
52219 else if (
sItem.type == 4262)
52220 {
52223 itemLocation.Y = MountedCenter.Y - 6
f;
52224 if (Main.rand.Next(20) == 0)
52225 {
52226 int num14 = Main.rand.Next(570, 573);
52227 Vector2
vector4 =
default(Vector2);
52229 Vector2
vector5 =
default(Vector2);
52231 vector5.X *= 1
f + (float)Main.rand.Next(-50, 51) * 0.01f;
52232 vector5.Y *= 1
f + (float)Main.rand.Next(-50, 51) * 0.01f;
52234 {
52236 }
52238 {
52240 }
52242 }
52243 }
52244 else if (Item.staff[
sItem.type])
52245 {
52247 if (
sItem.type == 3476)
52248 {
52250 }
52253 }
52254 else
52255 {
52256 itemLocation.X = position.X + (float)
width * 0.5
f - (
float)heldItemFrame.Width * 0.5f - (float)(
direction * 2);
52257 itemLocation.Y = MountedCenter.Y - (float)
heldItemFrame.Height * 0.5f;
52258 }
52259 if (
sItem.type != 5065)
52260 {
52261 return;
52262 }
52267 {
52271 Main.dust[
num16].noGravity =
true;
52272 Main.dust[
num16].scale = 0.3f;
52273 Main.dust[
num16].fadeIn = Main.rand.NextFloat() * 1.2f;
52274 Main.dust[
num16].velocity = Main.rand.NextVector2Circular(1
f, 1
f) +
velocity;
52276 {
52279 dust5.fadeIn *= 0.85f;
52280 dust5.color = new Color(255, 255, 255, 255);
52281 }
52282 }
52284 {
52286 {
52288 MovementVector =
vector7 * 0.1f + Main.rand.NextVector2Circular(2
f, 2
f) +
velocity
52290 }
52291 }
52292 else if (
sItem.useStyle == 13)
52293 {
52296 {
52298 }
52299 if (useAnimation == 0)
52300 {
52301 useAnimation =
sItem.useAnimation;
52302 }
52304 CompositeArmStretchAmount stretch = CompositeArmStretchAmount.Quarter;
52306 {
52307 stretch = CompositeArmStretchAmount.ThreeQuarters;
52308 }
52310 {
52311 stretch = CompositeArmStretchAmount.Full;
52312 }
52315 }
52316 else if (
sItem.useStyle == 8)
52317 {
52318 Projectile projectile = null;
52320 {
52321 for (int i = 0; i < 1000; i++)
52322 {
52325 {
52327 break;
52328 }
52329 }
52330 }
52332 if (projectile != null)
52333 {
52335 }
52338 {
52339 float num19 = Utils.ToRotation(
new Vector2((
float)(10 *
direction), 10
f)) + (float)
Math.PI / 4
f;
52342 {
52344 }
52346 CompositeArmStretchAmount
stretch2 = CompositeArmStretchAmount.Full;
52347 CompositeArmStretchAmount
stretch3 = CompositeArmStretchAmount.ThreeQuarters;
52350 {
52352 }
52355 {
52357 }
52364 }
52366 {
52369 CompositeArmStretchAmount
stretch4 = CompositeArmStretchAmount.Full;
52370 CompositeArmStretchAmount
stretch5 = CompositeArmStretchAmount.ThreeQuarters;
52376 {
52378 }
52381 Vector2
vector9 =
default(Vector2);
52386 }
52387 else
52388 {
52390 CompositeArmStretchAmount
stretch6 = CompositeArmStretchAmount.Full;
52391 CompositeArmStretchAmount
stretch7 = CompositeArmStretchAmount.ThreeQuarters;
52393 {
52394 stretch7 = CompositeArmStretchAmount.Quarter;
52395 }
52398 {
52400 }
52405 {
52407 }
52414 }
52416 }
52417 else if (
sItem.useStyle == 12)
52418 {
52420 itemLocation.X = MountedCenter.X - (float)(8 *
direction);
52422 Vector2
vector11 = Main.OffsetsPlayerHeadgear[bodyFrame.Y / 56];
52426 {
52428 }
52434 {
52436 }
52438 {
52440 }
52442 {
52444 }
52446 {
52448 }
52450 {
52452 }
52454 {
52456 }
52458 CompositeArmStretchAmount
stretch8 = CompositeArmStretchAmount.Quarter;
52462 {
52463 return;
52464 }
52466 Dust
dust6 = Dust.NewDustPerfect(
vector2, 228, Main.rand.NextVector2CircularEdge(1
f, 1
f));
52467 dust6.noGravity = true;
52468 dust6.noLight = true;
52469 dust6.velocity *= 2
f;
52470 float num31 = 0.5f;
52472 {
52473 if (Main.rand.Next(3) == 0)
52474 {
52475 Dust
dust3 = Dust.NewDustPerfect(
vector2, 278, Vector2.UnitY.RotatedBy(
num32 * ((
float)
Math.PI * 2
f) + Main.rand.NextFloat() *
num31 -
num31 * 0.5f + (
float)
Math.PI / 2
f) * (2
f + Main.rand.NextFloat() * 1
f), 150, Color.Lerp(Color.White, Color.HotPink, Main.rand.NextFloat() * 0.5f + 0.5f), 0.45f);
52476 dust3.noGravity = true;
52477 dust3.velocity *= 0.5f;
52478 dust3.customData = this;
52479 dust3.position += dust3.velocity * 6
f;
52480 }
52481 }
52483 {
52484 if (Main.rand.Next(3) == 0)
52485 {
52486 Dust
dust4 = Dust.NewDustPerfect(
vector2, 278, Vector2.UnitY.RotatedBy(
num34 * ((
float)
Math.PI * 2
f) + Main.rand.NextFloat() *
num31 -
num31 * 0.5f + (
float)
Math.PI / 2
f) * (0.5f + Main.rand.NextFloat() * 1
f), 150, Color.Lerp(Color.White, Color.Gold, Main.rand.NextFloat() * 0.5f + 0.5f), 0.45f);
52487 dust4.noGravity = true;
52488 dust4.velocity *= 0.5f;
52489 dust4.customData = this;
52490 dust4.position += dust4.velocity * 6
f;
52491 }
52492 }
52493 }
52494 else if (
sItem.useStyle == 14 && !Main.dedServ)
52495 {
52497 itemLocation.X = base.Center.X + (float)(6 *
direction);
52499 Vector2
vector3 = Main.OffsetsPlayerHeadgear[bodyFrame.Y / 56];
52501 CompositeArmStretchAmount
stretch9 = CompositeArmStretchAmount.Full;
52504 }
52505 }
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Vector2 position
The position of this Entity in world coordinates.
int width
The width of this Entity's hitbox, in pixels.
int height
The height of this Entity's hitbox, in pixels.
static void RequestParticleSpawn(bool clientOnly, ParticleOrchestraType type, ParticleOrchestraSettings settings, int? overrideInvokingPlayerIndex=null)
static bool[] UsesBetterMeleeItemLocation
If true for a given item type (F:Terraria.Item.type) and if F:Terraria.Item.useStyle == F:Terraria....
void SetCompositeArmBack(bool enabled, CompositeArmStretchAmount stretch, float rotation)
Vector2 GetFrontHandPosition(CompositeArmStretchAmount stretch, float rotation)
Vector2 MountedCenter
Returns the player's center adjusted for mount and step stool usage. Typically used in conjunction wi...
void FlipItemLocationAndRotationForGravity()
float GetAdjustedItemScale(Item item)
Used to determine what the overall scale of an item should be. M:Terraria.ModLoader....
void SetCompositeArmFront(bool enabled, CompositeArmStretchAmount stretch, float rotation)
int[] ownedProjectileCounts
Provides efficient access to the number of projectiles of the specified type owned by this player cur...