From 93d2e8d66287f4d2641d7bbc61e33195f5c65b95 Mon Sep 17 00:00:00 2001 From: Xhack <72313282+energykid@users.noreply.github.com> Date: Tue, 21 May 2024 10:54:40 -0400 Subject: [PATCH] Custom use style items and projectiles; Wind Blade swing animations IMPORTANT NOTE - In order to use a projectile that extends BaseCustomUseStyleProjectile, you have to make the item that shoots it extend CustomUseProjItem. --- Items/BaseItems/CustomUseProjItem.cs | 23 ++ Items/Weapons/Melee/WindBlade.cs | 25 +- Items/Weapons/Melee/WindBlade.png | Bin 930 -> 870 bytes .../BaseCustomUseStyleProjectile.cs | 248 ++++++++++++++++++ Projectiles/Melee/WindBladeHoldout.cs | 132 ++++++++++ Projectiles/Melee/WindBladeHoldout.png | Bin 0 -> 870 bytes Projectiles/Melee/{Cyclone.cs => WindBolt.cs} | 11 +- .../Melee/{Cyclone.png => WindBolt.png} | Bin 8 files changed, 415 insertions(+), 24 deletions(-) create mode 100644 Items/BaseItems/CustomUseProjItem.cs create mode 100644 Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs create mode 100644 Projectiles/Melee/WindBladeHoldout.cs create mode 100644 Projectiles/Melee/WindBladeHoldout.png rename Projectiles/Melee/{Cyclone.cs => WindBolt.cs} (93%) rename Projectiles/Melee/{Cyclone.png => WindBolt.png} (100%) diff --git a/Items/BaseItems/CustomUseProjItem.cs b/Items/BaseItems/CustomUseProjItem.cs new file mode 100644 index 0000000000..800d2dfb97 --- /dev/null +++ b/Items/BaseItems/CustomUseProjItem.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.BaseItems +{ + public abstract class CustomUseProjItem : ModItem + { + public override void SetDefaults() + { + Item.channel = true; + } + + public override bool CanShoot(Player player) + { + return player.ownedProjectileCounts[Item.shoot] < 1; + } + } +} diff --git a/Items/Weapons/Melee/WindBlade.cs b/Items/Weapons/Melee/WindBlade.cs index 8676601b68..24f1c6a98b 100644 --- a/Items/Weapons/Melee/WindBlade.cs +++ b/Items/Weapons/Melee/WindBlade.cs @@ -1,4 +1,6 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.BaseItems; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.BaseProjectiles; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; @@ -8,7 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class WindBlade : ModItem, ILocalizedModType + public class WindBlade : CustomUseProjItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetDefaults() @@ -22,24 +24,15 @@ namespace CalamityMod.Items.Weapons.Melee Item.useTime = 20; Item.useTurn = true; Item.knockBack = 5f; - Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 3f; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) - { - Projectile.NewProjectile(source, position, velocity, type, damage / 2, knockback, player.whoAmI); - return false; - } - - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if (Main.rand.NextBool(3)) - Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.BlueTorch); + Item.channel = true; + Item.shoot = ModContent.ProjectileType(); + Item.noUseGraphic = true; + Item.noMelee = true; + Item.useStyle = ItemUseStyleID.Shoot; } public override void AddRecipes() diff --git a/Items/Weapons/Melee/WindBlade.png b/Items/Weapons/Melee/WindBlade.png index 36d003fbdcbe511f4b0dd3a6f72ea705133b3674..b08f34b7d98f5f3f7a38e51a7dd73f46a2afc898 100644 GIT binary patch literal 870 zcmeAS@N?(olHy`uVBq!ia0vp^UO*he!3-pYE(NXtQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`ivoN?Tn$sRP1>73{Jz+6c$H=S?vVfgZT9cb@Cd7$R6cccw!FDxLSBT0 zyhPo^a^CEQ5DSqR)utI%ie|2rN7kfT*6;d#qovuIOG;L?*@-JB!R+;!#^2YQ&0QlBSEMj7FnN2rIEF;HpS|8)v|2%cEn(7x1s<_eqCS49`}jBhcDuc;3l-beO!lq% z`npHgZn*nMu*dzh-AfIT>8Z1Mr=7L;z&Zj1Mhn$j_SCl<_!meY-<~1Gabt~Jw$)%X-xA3FCfA<#i^DpqzeXMDyX`&HV zyn)fcc}vv8`@CB+F5B2WIv+FtkP%zhb&c~;TO8*_pT2TgIM17lDlc{~n&_b0_XxaXoxbN=EO?x@za_2I+Iw${SZ| z-cZ=0#})AYea)ZGM)Qp1U9W8OsjXS?VU?HfLsJg%MUs2o|K7HjWmfwv1({OWY5LPX zepqcRJpYl|gT?Et_v`WtPtS_BdGq1Y;RmUyZ-u9?(s~{swCv}09-+xjk<+(6D)01^ h6mE806j=LTJkb1E_Xp`4e}QR@!PC{xWt~$(697sik}v=O literal 930 zcmV;T16}-yP)XhFzSdcT!?*u#N@&VB$=WD5d}B3h-lF&5QK&lBFMfr zMudbQA_hu|UlT%pq^Ju^7m6^nQiFnf-`_a5_eRU-^Qq@7=5X(Q%y8%T&N=^cT-qVA z+@dSLVx7CRBVw+DPV9s`MfmK>eBlcV&XDuR^-q|nqwQ>{+>o4Vqhnt=MjaiS4dFVm zuF6Xm{_U659g$?BPBoPz*07p8?ZT(#dW4^TKQ8>lNP8R;by95he|%s_78bnRLh2}N zExN)n>S&TliJ!^3?A)Ls$>oXfoOK;Zax1$Yli5@&ED^4L`+TUwjh& zQDB@r_quUZ_)9gFhTRDab(4wiS6>MY3z9coefo)8e9lIq!f#x?Wk}MDAQQD~B7lAp z_Tgo(@b~lQ$bQG0cuPn!Q8V*rmk>gc>A|>I`>?d49K(7Soso62sVYj&C#R&A9mw>_ z^0`ZrOw^2I&nv%JmtTvJ{rZc=Vjb=pBKzwm-v^R6^5O}>;dx2==LMf7G08;DNVYa+ zkbQMMsY}b^EU)l^bPqXyw_!{Y29k?jNitR6A86~bgd`JHV-Lh?n`I1QA0$E*l2owz zq^@M-x~)@2>B91o@TI9p&K_fuxt^mrO0oT-$fl@|VND}-GgOg5l+5rv&A0t6DMYij zbyAXM{iIc~$wbXankgdG!C>{K@V-a_sgH=+Ouy_#`ku+@T$-0=V|P|E$LOA1R3&Jp zbx}_<{hK5PLC$}>kW2;;o27c83>=rwH|g`&wUHGjYOB`$L(ommK@u?ul98uf`V%zv zLKO+5J}3NGjQJ)p(Y?B8ZSx$_v@mE}WZi~f2if=Ktm^euGt{{1o3mGBnW%Xdrdk-p z?mb*L>|UUGv5(jcq|-M7b(>>!zb*=rAT~7fjbv5CGz{m6arHUQx^`VuozI@qr+T%` z-8=dLRU50Zs%dkab#1*UluJSVbvnyY{&}^V0V$O%`dKKg)|?E(m}a6@UlfEAy>gyA z7Je=dl1~5AL}I&Hl-cu4^nWj^_L*DRwd}m`OTFF7KR&oa1!YWfJMv7_s*55EZYiC= zNbb&5Eo&Faqf1onGN4U&Yj%@kqH1?x70E->rX4i<4W%ooAtHj_!vFvP07*qoM6N<$ Ef~JAQlK=n! diff --git a/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs b/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs new file mode 100644 index 0000000000..09eb794278 --- /dev/null +++ b/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs @@ -0,0 +1,248 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Items.Weapons.Melee; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using ReLogic.Content; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameInput; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.BaseProjectiles +{ + public abstract class BaseCustomUseStyleProjectile : ModProjectile + { + + public override void SetDefaults() + { + Projectile.friendly = true; + Projectile.tileCollide = false; + } + + public override void OnSpawn(IEntitySource source) + { + Projectile.timeLeft = Owner.HeldItem.useAnimation + 1; + } + + #region Fields + /// + /// The offset in pixels of the weapon from the projectile owner's center. This works even while using AbsolutePosition. + /// + public Vector2 Offset = Vector2.Zero; + + /// + /// The Player that is using the projectile. + /// + public virtual Player Owner => Main.player[Projectile.owner]; + + /// + /// The amount of pixels out the center of the projectile's hitbox is. + /// + public virtual float HitboxOutset => 30; + + /// + /// The projectile's hitbox size in pixels. + /// + public virtual Vector2 HitboxSize => new Vector2(30, 30); + + /// + /// The number of animations that this projectile has gone through. Useful for things like swing combos. + /// + public int NumberOfAnimations = 0; + + public float Animation = 0; + + /// + /// If true, flips the sprite with a 45-degree sword tilt in mind. + /// + public bool FlipAsSword = false; + + /// + /// The offset in radians of the weapon's rotation from its current rotation. + /// + public float RotationOffset = 0f; + + /// + /// The offset in radians of the rotation of the player's front arm. + /// + public float ArmRotationOffset = 0f; + + /// + /// The offset in radians of the rotation of the player's back arm. + /// + public float ArmRotationOffsetBack = 0f; + + /// + /// The amount of animation frames the projectile has in a vertical sheet. + /// + public virtual int FrameCount => 1; + + /// + /// The individual frame currently being drawn in a vertical sheet. + /// + public int Frame = 0; + + /// + /// The origin of the sprite when drawn on your character. + /// + /// + public virtual Vector2 SpriteOrigin() + { + return Projectile.Size / 2; + } + + /// + /// Helper method for getting the rotation of the sprite plus RotationOffset, without having to make your own local variable every time. + /// + /// + public float FinalRotation() + { + return Projectile.rotation + RotationOffset; + } + + /// + /// Rotation offset for the hitbox that doesn't affect the sprite. + /// Useful for if you have, for instance, a sword sprite at a 45 degree angle, and need that to reflect on the hitbox. + /// + /// + public virtual float HitboxRotationOffset() + { + return 0f; + } + + /// + /// Whether or not the projectile can hit enemies at the current frame. + /// Useful for wind-up animations where you don't want the projectile to deal damage. + /// + public bool CanHit = true; + + /// + /// Overrides the projectile owner's center as the projectile's location, so long as it isn't Vector2.Zero. + /// + public Vector2 AbsolutePosition = Vector2.Zero; + + /// + /// If this field is true, the projectile will draw at all times. Otherwise, it will only draw when its associated item is in use. + /// + public bool DrawUnconditionally = false; + + /// + /// The number of frames that the current use animation has progressed through. + /// + public float AnimationProgress = 0; + #endregion + + #region Use Style + /// + /// Determines the behavior to reset to when the item is not in use. + /// + public virtual void ResetStyle() { } + + /// + /// Determines the behavior of the projectile when the item is in use. + /// + public virtual void UseStyle() { } + + /// + /// Determines the behavior of the projectile when the item use animation begins for the first time in a row. + /// + public virtual void OnBeginUse() { } + + /// + /// Determines the behavior of the projectile when the item use animation ends. + /// + public virtual void OnEndUse() { } + #endregion + + public override void AI() + { + Projectile.penetrate = 100; + + if (Owner.ItemAnimationActive) + { + Animation++; + + UseStyle(); + Owner.heldProj = Projectile.whoAmI; + Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, Projectile.rotation + RotationOffset + ArmRotationOffset); + Owner.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, Projectile.rotation + RotationOffset + ArmRotationOffsetBack); + } + else + { + Animation = 0; + + if (DrawUnconditionally) + { + Owner.heldProj = Projectile.whoAmI; + Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, Projectile.rotation + RotationOffset + ArmRotationOffset); + Owner.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, Projectile.rotation + RotationOffset + ArmRotationOffsetBack); + } + + NumberOfAnimations = 0; + ResetStyle(); + } + + AnimationProgress = Animation % Owner.itemAnimationMax; + + if (AbsolutePosition == Vector2.Zero) + { + Projectile.position = Owner.position + (Owner.Size / 2) - (Projectile.Size / 2) + Offset; + } + else + { + Projectile.position = AbsolutePosition - (Projectile.Size / 2) + Offset; + } + + if (Owner.itemAnimation == 1) + { + OnEndUse(); + NumberOfAnimations++; + } + + if (Owner.ItemAnimationJustStarted) + { + Projectile.timeLeft = Owner.HeldItem.useAnimation + 1; + OnBeginUse(); + } + } + + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.HitDirectionOverride = Owner.direction; + base.ModifyHitNPC(target, ref modifiers); + } + + public override bool? CanDamage() + { + return CanHit ? base.CanDamage() : false; + } + + public override void ModifyDamageHitbox(ref Rectangle hitbox) + { + Vector2 cen = Projectile.Center + new Vector2(HitboxOutset, 0).RotatedBy(FinalRotation() + HitboxRotationOffset()); + + hitbox = new Rectangle((int)cen.X - (int)(HitboxSize.X / 2), (int)cen.Y - (int)(HitboxSize.Y / 2), (int)HitboxSize.X, (int)HitboxSize.Y); + + base.ModifyDamageHitbox(ref hitbox); + } + + public override bool PreDraw(ref Color lightColor) + { + // Only draw the projectile if the projectile's owner is currently using the item this projectile is attached to. + if (Owner.itemAnimation > 0 || DrawUnconditionally) + { + Asset tex = ModContent.Request(Texture); + + float r = FlipAsSword ? MathHelper.ToRadians(90) : 0f; + + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY), tex.Frame(1, FrameCount, 0, Frame), lightColor, Projectile.rotation + RotationOffset + r, FlipAsSword ? new Vector2(tex.Width() - SpriteOrigin().X, SpriteOrigin().Y) : SpriteOrigin(), Projectile.scale, FlipAsSword ? SpriteEffects.FlipHorizontally : SpriteEffects.None); + } + return false; + } + } +} diff --git a/Projectiles/Melee/WindBladeHoldout.cs b/Projectiles/Melee/WindBladeHoldout.cs new file mode 100644 index 0000000000..d55bf66300 --- /dev/null +++ b/Projectiles/Melee/WindBladeHoldout.cs @@ -0,0 +1,132 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class WindBladeHoldout : BaseCustomUseStyleProjectile, ILocalizedModType + { + public override float HitboxOutset => 60; + + public override Vector2 HitboxSize => new Vector2(70, 70); + + public override float HitboxRotationOffset() + { + return MathHelper.ToRadians(-45); + } + + public override Vector2 SpriteOrigin() + { + return new(0, 80); + } + + public override void OnSpawn(IEntitySource source) + { + Projectile.scale = 0f; + Projectile.ai[1] = 1; + base.OnSpawn(source); + } + + public override void UseStyle() + { + Vector2 mousePos = Main.MouseWorld; + // i don't know how cal handles Main.MouseWorld in netcode. todo: someone fix this up in multiplayer pls + // - ennway + + if (mousePos.X < Owner.Center.X) Owner.direction = -1; + else Owner.direction = 1; + + DrawUnconditionally = true; + + if (NumberOfAnimations % 4 < 2) + { + Projectile.rotation = Owner.AngleTo(mousePos) + MathHelper.ToRadians(45f); + + if (NumberOfAnimations % 4 == 0 && AnimationProgress < 10) + Projectile.scale = MathHelper.Lerp(Projectile.scale, 1f, 0.4f); + + if (AnimationProgress < (Owner.itemAnimationMax / 3)) + { + CanHit = false; + if (AnimationProgress == 0) + { + Projectile.ai[1] = -Projectile.ai[1]; + } + RotationOffset = MathHelper.Lerp(RotationOffset, MathHelper.ToRadians(120f * Projectile.ai[1] * Owner.direction), 0.2f); + } + else + { + CanHit = true; + if ((int)AnimationProgress == (int)(Owner.itemAnimationMax / 1.5f)) + { + SoundEngine.PlaySound(SoundID.DD2_MonkStaffSwing, Owner.Center); + } + if ((int)AnimationProgress > (int)(Owner.itemAnimationMax / 1.5f)) + { + GeneralParticleHandler.SpawnParticle(new HeavySmokeParticle(Owner.Center + (new Vector2(Main.rand.Next(30, 100), 0).RotatedBy(FinalRotation() + MathHelper.ToRadians(-45))), new Vector2(0, 10 * -Projectile.ai[1] * Owner.direction).RotatedBy(FinalRotation() + MathHelper.ToRadians(-45)), Color.LightSkyBlue, 40, 1f, 0.4f, MathHelper.ToRadians(Main.rand.NextFloat(-10f, 10f)), true)); + } + + float time = (AnimationProgress) - (Owner.itemAnimationMax / 3); + float timeMax = Owner.itemAnimationMax - (Owner.itemAnimationMax / 3); + + RotationOffset = MathHelper.Lerp(RotationOffset, MathHelper.ToRadians(MathHelper.Lerp(150f * Projectile.ai[1] * Owner.direction, 120f * -Projectile.ai[1] * Owner.direction, CalamityUtils.ExpInOutEasing(time / timeMax, 1))), + 0.2f); + } + + FlipAsSword = Owner.direction == -1 ? true : false; + } + else if (NumberOfAnimations % 4 == 3) + { + CanHit = true; + if ((int)AnimationProgress == 1) + { + SoundEngine.PlaySound(SoundID.DD2_SkyDragonsFurySwing, Owner.Center); + SoundEngine.PlaySound(SoundID.DD2_MonkStaffSwing.WithPitchOffset(-0.4f), Owner.Center); + } + RotationOffset = 0f; + if (AnimationProgress < Owner.itemAnimationMax / 3) + { + Projectile.scale = MathHelper.Lerp(Projectile.scale, 1.5f, 0.4f); + + float rot = FinalRotation() + MathHelper.ToRadians(-45); + + GeneralParticleHandler.SpawnParticle(new HeavySmokeParticle(Owner.Center + new Vector2(105 * Projectile.scale, 0).RotatedBy(rot), new Vector2(5, 0).RotatedBy(rot + MathHelper.ToRadians(Main.rand.NextFloat(-20, 20))), Color.LightSkyBlue, 30, 2f, 0.3f, MathHelper.ToRadians(Main.rand.NextFloat(-10f, 10f)), true)); + GeneralParticleHandler.SpawnParticle(new LineParticle(Owner.Center + new Vector2(0, 20).RotatedBy(rot) + new Vector2(45 * Projectile.scale, 0).RotatedBy(rot), new Vector2(5, 0).RotatedBy(rot), false, 30, 1f, Color.LightSkyBlue)); + GeneralParticleHandler.SpawnParticle(new LineParticle(Owner.Center + new Vector2(0, -20).RotatedBy(rot) + new Vector2(45 * Projectile.scale, 0).RotatedBy(rot), new Vector2(5, 0).RotatedBy(rot), false, 30, 1f, Color.LightSkyBlue)); + } + else + { + Projectile.scale = MathHelper.Lerp(Projectile.scale, 1.5f, -0.2f); + } + } + else + { + CanHit = false; + + RotationOffset = MathHelper.Lerp(RotationOffset, MathHelper.ToRadians(MathHelper.Lerp(150f * -Projectile.ai[1] * Owner.direction, 120f * Projectile.ai[1] * Owner.direction, 0.1f)), + 0.2f); + + Projectile.rotation = Owner.AngleTo(mousePos) + MathHelper.ToRadians(45f); + Projectile.scale = MathHelper.Lerp(Projectile.scale, 0f, 0.2f); + } + + ArmRotationOffset = MathHelper.ToRadians(-90f); + } + + public override void ResetStyle() + { + } + } +} diff --git a/Projectiles/Melee/WindBladeHoldout.png b/Projectiles/Melee/WindBladeHoldout.png new file mode 100644 index 0000000000000000000000000000000000000000..b08f34b7d98f5f3f7a38e51a7dd73f46a2afc898 GIT binary patch literal 870 zcmeAS@N?(olHy`uVBq!ia0vp^UO*he!3-pYE(NXtQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`ivoN?Tn$sRP1>73{Jz+6c$H=S?vVfgZT9cb@Cd7$R6cccw!FDxLSBT0 zyhPo^a^CEQ5DSqR)utI%ie|2rN7kfT*6;d#qovuIOG;L?*@-JB!R+;!#^2YQ&0QlBSEMj7FnN2rIEF;HpS|8)v|2%cEn(7x1s<_eqCS49`}jBhcDuc;3l-beO!lq% z`npHgZn*nMu*dzh-AfIT>8Z1Mr=7L;z&Zj1Mhn$j_SCl<_!meY-<~1Gabt~Jw$)%X-xA3FCfA<#i^DpqzeXMDyX`&HV zyn)fcc}vv8`@CB+F5B2WIv+FtkP%zhb&c~;TO8*_pT2TgIM17lDlc{~n&_b0_XxaXoxbN=EO?x@za_2I+Iw${SZ| z-cZ=0#})AYea)ZGM)Qp1U9W8OsjXS?VU?HfLsJg%MUs2o|K7HjWmfwv1({OWY5LPX zepqcRJpYl|gT?Et_v`WtPtS_BdGq1Y;RmUyZ-u9?(s~{swCv}09-+xjk<+(6D)01^ h6mE806j=LTJkb1E_Xp`4e}QR@!PC{xWt~$(697sik}v=O literal 0 HcmV?d00001 diff --git a/Projectiles/Melee/Cyclone.cs b/Projectiles/Melee/WindBolt.cs similarity index 93% rename from Projectiles/Melee/Cyclone.cs rename to Projectiles/Melee/WindBolt.cs index e079ace083..fa7973d544 100644 --- a/Projectiles/Melee/Cyclone.cs +++ b/Projectiles/Melee/WindBolt.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class Cyclone : ModProjectile, ILocalizedModType + public class WindBolt : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Melee"; public int dustvortex = 0; @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.ai[0] >= 12) Projectile.tileCollide = true; - Projectile.rotation += 2.5f; + Projectile.rotation += MathHelper.ToRadians(15f); Projectile.alpha -= 5; if (Projectile.alpha < 50) { @@ -95,14 +95,9 @@ namespace CalamityMod.Projectiles.Melee } } - public override Color? GetAlpha(Color lightColor) - { - return new Color(204, 255, 255, Projectile.alpha); - } - public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); return false; } diff --git a/Projectiles/Melee/Cyclone.png b/Projectiles/Melee/WindBolt.png similarity index 100% rename from Projectiles/Melee/Cyclone.png rename to Projectiles/Melee/WindBolt.png