47745 {
47746 if (Main.dedServ)
47747 {
47748 return;
47749 }
47750 if (
sItem.useStyle == 1)
47751 {
47753 {
47755 {
47756 float num = 10f;
47757 itemLocation.X = position.X + (float)
width * 0.5f + ((
float)heldItemFrame.Width * 0.5f - num) * (
float)
direction;
47759 }
47761 {
47763 itemLocation.X = position.X + (float)
width * 0.5f + ((
float)heldItemFrame.Width * 0.5f -
num2) * (
float)
direction;
47766 }
47767 else
47768 {
47770 itemLocation.X = position.X + (float)
width * 0.5f - ((
float)heldItemFrame.Width * 0.5f -
num3) * (
float)
direction;
47773 }
47775 }
47776 else
47777 {
47780 {
47783 {
47785 }
47787 {
47789 }
47791 {
47793 }
47795 {
47797 }
47799 {
47801 }
47802 if (
sItem.type == 671)
47803 {
47805 }
47806 itemLocation.X = position.X + (float)
width * 0.5f + ((
float)heldItemFrame.Width * 0.5f -
num4) * (
float)
direction;
47809 }
47811 {
47814 {
47816 }
47818 {
47820 }
47822 {
47824 }
47826 {
47828 }
47830 {
47832 }
47833 if (
sItem.type == 671)
47834 {
47836 }
47837 itemLocation.X = position.X + (float)
width * 0.5f + ((
float)heldItemFrame.Width * 0.5f -
num5) * (
float)
direction;
47840 {
47842 }
47844 {
47846 }
47848 {
47850 }
47852 {
47854 }
47855 if (
sItem.type == 671)
47856 {
47858 }
47861 }
47862 else
47863 {
47866 {
47868 }
47870 {
47872 }
47874 {
47876 }
47878 {
47880 }
47882 {
47884 }
47886 {
47888 }
47889 if (
sItem.type == 671)
47890 {
47892 }
47893 itemLocation.X = position.X + (float)
width * 0.5f - ((
float)heldItemFrame.Width * 0.5f -
num6) * (
float)
direction;
47896 {
47898 }
47900 {
47902 }
47904 {
47906 }
47908 {
47910 }
47911 if (
sItem.type == 671)
47912 {
47914 }
47917 }
47919 {
47921 }
47923 }
47925 {
47928 }
47929 }
47930 else if (
sItem.useStyle == 7)
47931 {
47934 {
47937 }
47938 else
47939 {
47942 }
47944 {
47947 }
47948 }
47949 else if (
sItem.useStyle == 9)
47950 {
47952 float t = 1f -
num7;
47953 t = Utils.GetLerpValue(0f, 0.7f, t,
clamped:
true);
47965 {
47967 }
47975 {
47978 }
47979 }
47980 else if (
sItem.useStyle == 6)
47981 {
47985 {
47987 }
47990 {
47993 }
47994 else
47995 {
47998 }
48000 {
48003 }
48004 }
48005 else if (
sItem.useStyle == 2)
48006 {
48011 {
48013 }
48015 {
48017 }
48019 {
48021 }
48026 {
48027 case CompositeArmStretchAmount.Full:
48029 break;
48030 case CompositeArmStretchAmount.ThreeQuarters:
48032 break;
48033 case CompositeArmStretchAmount.Quarter:
48035 break;
48036 case CompositeArmStretchAmount.None:
48038 break;
48039 }
48042 {
48045 }
48046 }
48047 else if (
sItem.useStyle == 11)
48048 {
48053 {
48055 }
48057 {
48059 }
48061 {
48063 }
48065 {
48067 }
48069 {
48071 }
48073 {
48075 }
48080 {
48081 case CompositeArmStretchAmount.Full:
48083 break;
48084 case CompositeArmStretchAmount.ThreeQuarters:
48086 break;
48087 case CompositeArmStretchAmount.Quarter:
48089 break;
48090 case CompositeArmStretchAmount.None:
48092 break;
48093 }
48096 {
48099 }
48100 }
48101 else if (
sItem.useStyle == 3)
48102 {
48104 {
48105 itemLocation.X = -1000f;
48106 itemLocation.Y = -1000f;
48108 }
48109 else
48110 {
48111 itemLocation.X = position.X + (float)
width * 0.5f + ((
float)heldItemFrame.Width * 0.5f - 4f) * (
float)
direction;
48115 {
48117 }
48119 {
48121 }
48122 itemLocation.X -=
num18;
48124 if (
sItem.type == 946 ||
sItem.type == 4707)
48125 {
48127 }
48128 }
48130 {
48133 }
48134 }
48135 else if (
sItem.useStyle == 4)
48136 {
48139 if (
sItem.type == 3601)
48140 {
48142 }
48143 if (
sItem.type == 5114)
48144 {
48147 }
48148 if (
sItem.type == 5120)
48149 {
48151 }
48156 {
48159 }
48160 }
48161 else if (
sItem.useStyle == 5)
48162 {
48163 if (
sItem.type == 3779)
48164 {
48166 itemLocation.X = base.Center.X + (float)(6 *
direction);
48167 itemLocation.Y = MountedCenter.Y + 6f;
48168 }
48169 else if (
sItem.type == 4262)
48170 {
48173 itemLocation.Y = MountedCenter.Y - 6f;
48174 if (Main.rand.Next(20) == 0)
48175 {
48176 int num21 = Main.rand.Next(570, 573);
48179 vector3.X *= 1f + (float)Main.rand.Next(-50, 51) * 0.01f;
48180 vector3.Y *= 1f + (float)Main.rand.Next(-50, 51) * 0.01f;
48182 {
48183 vector2.X -= 8f;
48184 }
48186 {
48187 vector2.X -= 4f;
48188 }
48190 }
48191 }
48193 {
48195 if (
sItem.type == 3476)
48196 {
48198 }
48201 }
48202 else
48203 {
48204 itemLocation.X = position.X + (float)
width * 0.5f - (
float)heldItemFrame.Width * 0.5f - (float)(
direction * 2);
48205 itemLocation.Y = MountedCenter.Y - (float)
heldItemFrame.Height * 0.5f;
48206 }
48207 if (
sItem.type != 5065)
48208 {
48209 return;
48210 }
48215 {
48219 Main.dust[
num23].noGravity =
true;
48220 Main.dust[
num23].scale = 0.3f;
48221 Main.dust[
num23].fadeIn = Main.rand.NextFloat() * 1.2f;
48222 Main.dust[
num23].velocity = Main.rand.NextVector2Circular(1f, 1f) +
velocity;
48224 {
48225 Dust dust = Dust.CloneDust(
num23);
48226 dust.scale /= 2f;
48227 dust.fadeIn *= 0.85f;
48228 dust.color =
new Color(255, 255, 255, 255);
48229 }
48230 }
48232 {
48234 {
48236 MovementVector =
vector5 * 0.1f + Main.rand.NextVector2Circular(2f, 2f) +
velocity
48238 }
48239 }
48240 else if (
sItem.useStyle == 13)
48241 {
48244 {
48246 }
48247 if (useAnimation == 0)
48248 {
48249 useAnimation =
sItem.useAnimation;
48250 }
48252 CompositeArmStretchAmount stretch = CompositeArmStretchAmount.Quarter;
48254 {
48255 stretch = CompositeArmStretchAmount.ThreeQuarters;
48256 }
48258 {
48259 stretch = CompositeArmStretchAmount.Full;
48260 }
48263 }
48264 else if (
sItem.useStyle == 8)
48265 {
48266 Projectile projectile = null;
48268 {
48269 for (
int i = 0;
i < 1000;
i++)
48270 {
48273 {
48275 break;
48276 }
48277 }
48278 }
48280 if (projectile != null)
48281 {
48283 }
48286 {
48290 {
48292 }
48294 CompositeArmStretchAmount
stretch2 = CompositeArmStretchAmount.Full;
48295 CompositeArmStretchAmount
stretch3 = CompositeArmStretchAmount.ThreeQuarters;
48298 {
48300 }
48303 {
48305 }
48312 }
48314 {
48317 CompositeArmStretchAmount
stretch4 = CompositeArmStretchAmount.Full;
48318 CompositeArmStretchAmount
stretch5 = CompositeArmStretchAmount.ThreeQuarters;
48324 {
48326 }
48333 }
48334 else
48335 {
48337 CompositeArmStretchAmount
stretch6 = CompositeArmStretchAmount.Full;
48338 CompositeArmStretchAmount
stretch7 = CompositeArmStretchAmount.ThreeQuarters;
48340 {
48341 stretch7 = CompositeArmStretchAmount.Quarter;
48342 }
48345 {
48347 }
48352 {
48354 }
48361 }
48363 }
48364 else if (
sItem.useStyle == 12)
48365 {
48367 itemLocation.X = MountedCenter.X - (float)(8 *
direction);
48373 {
48375 }
48381 {
48383 }
48385 {
48387 }
48389 {
48391 }
48393 {
48395 }
48397 {
48399 }
48401 {
48403 }
48405 CompositeArmStretchAmount
stretch8 = CompositeArmStretchAmount.Quarter;
48409 {
48410 return;
48411 }
48413 Dust
dust2 = Dust.NewDustPerfect(
vector10, 228, Main.rand.NextVector2CircularEdge(1f, 1f));
48414 dust2.noGravity = true;
48415 dust2.noLight = true;
48416 dust2.velocity *= 2f;
48417 float num38 = 0.5f;
48419 {
48420 if (Main.rand.Next(3) == 0)
48421 {
48423 dust3.noGravity = true;
48424 dust3.velocity *= 0.5f;
48425 dust3.customData = this;
48426 dust3.position += dust3.velocity * 6f;
48427 }
48428 }
48430 {
48431 if (Main.rand.Next(3) == 0)
48432 {
48434 dust4.noGravity = true;
48435 dust4.velocity *= 0.5f;
48436 dust4.customData = this;
48437 dust4.position += dust4.velocity * 6f;
48438 }
48439 }
48440 }
48441 else if (
sItem.useStyle == 14 && !Main.dedServ)
48442 {
48444 itemLocation.X = base.Center.X + (float)(6 *
direction);
48445 itemLocation.Y = position.Y + 40f +
mountOffset - 8f;
48448 CompositeArmStretchAmount
stretch9 = CompositeArmStretchAmount.Full;
48451 }
48452 }
static float Lerp(float value1, float value2, float amount)
static double Cos(double d)
static void RequestParticleSpawn(bool clientOnly, ParticleOrchestraType type, ParticleOrchestraSettings settings, int? overrideInvokingPlayerIndex=null)
static bool[] UsesBetterMeleeItemLocation
void SetCompositeArmBack(bool enabled, CompositeArmStretchAmount stretch, float rotation)
Vector2 GetFrontHandPosition(CompositeArmStretchAmount stretch, float rotation)
void FlipItemLocationAndRotationForGravity()
float GetAdjustedItemScale(Item item)
void SetCompositeArmFront(bool enabled, CompositeArmStretchAmount stretch, float rotation)
int[] ownedProjectileCounts
static Color Lerp(Color value1, Color value2, float amount)
static float Distance(Vector2 value1, Vector2 value2)