From 2b6eee0fdff69fe94d030b5539b76e55912249ec Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Wed, 22 May 2024 15:42:52 -0400 Subject: [PATCH] Removed Wind Blade rework from main branch Hi to people who snoop around in the source I guess --- Items/BaseItems/CustomUseProjItem.cs | 23 -- Items/Weapons/Melee/WindBlade.cs | 31 ++- Items/Weapons/Melee/WindBlade.png | Bin 870 -> 930 bytes ...Mods.CalamityMod.Items.Weapons.Melee.hjson | 7 +- .../Mods.CalamityMod.Projectiles.Melee.hjson | 2 +- .../BaseCustomUseStyleProjectile.cs | 250 ------------------ Projectiles/Melee/Cyclone.cs | 125 +++++++++ .../Melee/{WindBolt.png => Cyclone.png} | Bin Projectiles/Melee/WindBladeHoldout.cs | 132 --------- Projectiles/Melee/WindBladeHoldout.png | Bin 870 -> 0 bytes Projectiles/Melee/WindBolt.cs | 146 ---------- 11 files changed, 146 insertions(+), 570 deletions(-) delete mode 100644 Items/BaseItems/CustomUseProjItem.cs delete mode 100644 Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs create mode 100644 Projectiles/Melee/Cyclone.cs rename Projectiles/Melee/{WindBolt.png => Cyclone.png} (100%) delete mode 100644 Projectiles/Melee/WindBladeHoldout.cs delete mode 100644 Projectiles/Melee/WindBladeHoldout.png delete mode 100644 Projectiles/Melee/WindBolt.cs diff --git a/Items/BaseItems/CustomUseProjItem.cs b/Items/BaseItems/CustomUseProjItem.cs deleted file mode 100644 index 800d2dfb97..0000000000 --- a/Items/BaseItems/CustomUseProjItem.cs +++ /dev/null @@ -1,23 +0,0 @@ -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 2f9aa92a91..8676601b68 100644 --- a/Items/Weapons/Melee/WindBlade.cs +++ b/Items/Weapons/Melee/WindBlade.cs @@ -1,6 +1,4 @@ -using CalamityMod.Items.BaseItems; -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; @@ -10,29 +8,38 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class WindBlade : CustomUseProjItem, ILocalizedModType + public class WindBlade : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetDefaults() { Item.width = 58; Item.height = 58; - Item.damage = 42; + Item.damage = 41; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 18; + Item.useAnimation = 20; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 18; + 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; + } - Item.channel = true; - Item.shoot = ModContent.ProjectileType(); - Item.noUseGraphic = true; - Item.noMelee = true; - Item.useStyle = ItemUseStyleID.Shoot; + 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); } public override void AddRecipes() diff --git a/Items/Weapons/Melee/WindBlade.png b/Items/Weapons/Melee/WindBlade.png index b08f34b7d98f5f3f7a38e51a7dd73f46a2afc898..36d003fbdcbe511f4b0dd3a6f72ea705133b3674 100644 GIT binary patch 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! 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 diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index cebfe4bd20..afeab0b76b 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -1390,12 +1390,7 @@ VulcaniteLance: { WindBlade: { DisplayName: Wind Blade - Tooltip: - ''' - Perform a three swing combo which ends by thrusting the blade forwards - Thrusting the blade launches an expanding cyclone that lingers - Cyclones pull enemies in, or pulls itself towards bosses - ''' + Tooltip: Fires cyclones that suck enemies in } WulfrumScrewdriver: { diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index 701a9c1703..f49ed13e17 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -76,6 +76,7 @@ CosmicSpiritBomb3.DisplayName: Cosmic Bomb CrescentMoonFlail.DisplayName: Crescent Moon CrescentMoonProj.DisplayName: Crescent Moon CrystylCrusherRay.DisplayName: Crystyl Crusher Ray +Cyclone.DisplayName: Cyclone DarkBall.DisplayName: Dark Ball DarkBeam.DisplayName: Dark Beam DarkIceZero.DisplayName: Dark Ice @@ -310,7 +311,6 @@ Waterfall.DisplayName: Waterfall Beam WhiteBoltAura.DisplayName: White Aura WhiteOrb.DisplayName: White Orb Whiterain.DisplayName: White Rain -WindBolt.DisplayName: Wind Bolt WulfrumScrew.DisplayName: Wulfrum Screw WulfrumScrewdriverProj.DisplayName: Wulfrum Screwdriver YateveoBloomProj.DisplayName: Yateveo Bloom diff --git a/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs b/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs deleted file mode 100644 index 0b9ec47dfe..0000000000 --- a/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs +++ /dev/null @@ -1,250 +0,0 @@ -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; - Projectile.penetrate = -1; - } - - 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 => 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 => 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 => 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() - { - Owner.Calamity().mouseWorldListener = true; - - 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 bool? CanHitNPC(NPC target) - { - bool bb = (target.immune[0] <= 0) && !target.friendly && !target.dontTakeDamage; - - return bb; - } - - - 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/Cyclone.cs b/Projectiles/Melee/Cyclone.cs new file mode 100644 index 0000000000..0a14bde12d --- /dev/null +++ b/Projectiles/Melee/Cyclone.cs @@ -0,0 +1,125 @@ +using CalamityMod.CalPlayer; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Audio; + +namespace CalamityMod.Projectiles.Melee +{ + public class Cyclone : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public int dustvortex = 0; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; + ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + } + + public override void SetDefaults() + { + Projectile.width = 56; + Projectile.height = 56; + Projectile.alpha = 255; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Melee; + Projectile.timeLeft = 300; + Projectile.extraUpdates = 2; + Projectile.penetrate = 2; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + Projectile.tileCollide = false; + } + + public override void AI() + { + Projectile.ai[0]++; + Projectile.ai[1]++; + + //Code so it doesnt collide on tiles instantly + if (Projectile.ai[0] >= 12) + Projectile.tileCollide = true; + + Projectile.rotation += 2.5f; + Projectile.alpha -= 5; + if (Projectile.alpha < 50) + { + Projectile.alpha = 50; + if (Projectile.ai[1] >= 15) + { + + for (int i = 1; i <= 6; i++) + { + Vector2 dustspeed = new Vector2(3f, 3f).RotatedBy(MathHelper.ToRadians(dustvortex)); + int d = Dust.NewDust(Projectile.Center, Projectile.width / 2, Projectile.height / 2, 31, dustspeed.X, dustspeed.Y, 200, new Color(232, 251, 250, 200), 1.3f); + Main.dust[d].noGravity = true; + Main.dust[d].velocity = dustspeed; + dustvortex += 60; + } + dustvortex -= 355; + Projectile.ai[1] = 0; + } + } + float num472 = Projectile.Center.X; + float num473 = Projectile.Center.Y; + float num474 = 600f; + for (int num475 = 0; num475 < Main.maxNPCs; num475++) + { + NPC npc = Main.npc[num475]; + if (npc.CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, npc.Center, 1, 1) && !CalamityPlayer.areThereAnyDamnBosses) + { + float npcCenterX = npc.position.X + (float)(npc.width / 2); + float npcCenterY = npc.position.Y + (float)(npc.height / 2); + float num478 = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - npcCenterX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - npcCenterY); + if (num478 < num474) + { + if (npc.position.X < num472) + { + npc.velocity.X += 0.05f; + } + else + { + npc.velocity.X -= 0.05f; + } + if (npc.position.Y < num473) + { + npc.velocity.Y += 0.05f; + } + else + { + npc.velocity.Y -= 0.05f; + } + } + } + } + } + + 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); + return false; + } + + public override void OnKill(int timeLeft) + { + SoundEngine.PlaySound(SoundID.Item60 with { Volume = SoundID.Item60.Volume * 0.6f }, Projectile.Center); + + for (int i = 0; i <= 360; i += 3) + { + Vector2 dustspeed = new Vector2(3f, 3f).RotatedBy(MathHelper.ToRadians(i)); + int d = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, 31, dustspeed.X, dustspeed.Y, 200, new Color(232, 251, 250, 200), 1.4f); + Main.dust[d].noGravity = true; + Main.dust[d].position = Projectile.Center; + Main.dust[d].velocity = dustspeed; + } + } + } +} diff --git a/Projectiles/Melee/WindBolt.png b/Projectiles/Melee/Cyclone.png similarity index 100% rename from Projectiles/Melee/WindBolt.png rename to Projectiles/Melee/Cyclone.png diff --git a/Projectiles/Melee/WindBladeHoldout.cs b/Projectiles/Melee/WindBladeHoldout.cs deleted file mode 100644 index 50d4a88d50..0000000000 --- a/Projectiles/Melee/WindBladeHoldout.cs +++ /dev/null @@ -1,132 +0,0 @@ -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.Localization; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Melee -{ - public class WindBladeHoldout : BaseCustomUseStyleProjectile, ILocalizedModType - { - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - - public override float HitboxOutset => 60; - - public override Vector2 HitboxSize => new Vector2(70, 70); - public override float HitboxRotationOffset => MathHelper.ToRadians(-45); - - public override Vector2 SpriteOrigin => new(0, 80); - - public override void SetDefaults() - { - base.SetDefaults(); - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - } - - public override void OnSpawn(IEntitySource source) - { - Projectile.scale = 0f; - Projectile.ai[1] = 1; - base.OnSpawn(source); - } - - public override void UseStyle() - { - Vector2 mousePos = Owner.Calamity().mouseWorld; - - 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) - { - float ProjectileSpeed = 10; - int ProjectileDamage = (int)(Projectile.damage * 0.3f); - float ProjectileKnockback = (int)(Projectile.knockBack * 0.5f); - CanHit = true; - if ((int)AnimationProgress == 1) - { - SoundEngine.PlaySound(SoundID.DD2_SkyDragonsFurySwing, Owner.Center); - SoundEngine.PlaySound(SoundID.DD2_MonkStaffSwing.WithPitchOffset(-0.4f), Owner.Center); - - Projectile.NewProjectile(new EntitySource_ItemUse(Owner, Owner.HeldItem), Projectile.Hitbox.Center.ToVector2(), new Vector2(ProjectileSpeed, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)), ModContent.ProjectileType(), ProjectileDamage, ProjectileKnockback, Owner.whoAmI); - } - 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 deleted file mode 100644 index b08f34b7d98f5f3f7a38e51a7dd73f46a2afc898..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/Projectiles/Melee/WindBolt.cs b/Projectiles/Melee/WindBolt.cs deleted file mode 100644 index 08ec3d63f3..0000000000 --- a/Projectiles/Melee/WindBolt.cs +++ /dev/null @@ -1,146 +0,0 @@ -using System; -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria; -using Terraria.Audio; -using Terraria.GameContent.UI; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.Utilities.Terraria.Utilities; -using XPT.Core.Audio.MP3Sharp.Decoding.Decoders.LayerIII; - -namespace CalamityMod.Projectiles.Melee -{ - public class WindBolt : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Melee"; - public int dustvortex = 0; - public float scFactor = 0f; - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - } - - public override void SetDefaults() - { - Projectile.width = 40; - Projectile.height = 40; - Projectile.alpha = 255; - Projectile.friendly = true; - Projectile.DamageType = DamageClass.Melee; - Projectile.timeLeft = 300; - Projectile.extraUpdates = 2; - Projectile.penetrate = -1; - Projectile.ignoreWater = true; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 8 * Projectile.MaxUpdates; - Projectile.tileCollide = false; - } - - public override void AI() - { - Projectile.velocity *= 0.98f; - - Projectile.ai[0]++; - Projectile.ai[1]++; - - //Code so it doesnt collide on tiles instantly - if (Projectile.ai[0] >= 12) - Projectile.tileCollide = true; - - Projectile.rotation += MathHelper.ToRadians(1f); - Projectile.alpha -= 5; - { - Projectile.alpha = 50; - if (Projectile.ai[1] >= 15) - { - scFactor = MathHelper.Lerp(scFactor, 1f, 0.1f); - for (int i = 1; i <= 6; i++) - { - Vector2 dustpos = new Vector2(48f, 48f).RotatedBy(MathHelper.ToRadians(dustvortex + Main.rand.Next(30))); - Vector2 dustspeed = new Vector2(-5f, -5f).RotatedBy(MathHelper.ToRadians(dustvortex + Main.rand.Next(30))); - int d = Dust.NewDust(Projectile.Center + dustpos, Projectile.width / 2, Projectile.height / 2, DustID.Smoke, dustspeed.X, dustspeed.Y, 200, new Color(232, 251, 250, 50), 1.3f); - - Main.dust[d].noGravity = true; - Main.dust[d].velocity = dustspeed; - dustvortex += 60; - } - dustvortex -= 355; - Projectile.ai[1] = 0; - } - } - float projX = Projectile.Center.X; - float projY = Projectile.Center.Y; - foreach (var npc in Main.ActiveNPCs) - { - if (npc.CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, npc.Center, 1, 1)) - { - if (!CalamityPlayer.areThereAnyDamnBosses) // Pulls enemies in while no boss is alive - { - float npcCenterX = npc.position.X + (float)(npc.width / 2); - float npcCenterY = npc.position.Y + (float)(npc.height / 2); - float npcDistance = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - npcCenterX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - npcCenterY); - if (npcDistance < 320f) - { - float factor = MathHelper.Lerp(1f, 0f, CalamityUtils.SineBumpEasing(npcDistance / 300, 1)); - - npc.velocity += npc.DirectionTo(Projectile.Center) * factor * 0.25f; - } - if (npcDistance < 40) - npc.velocity *= 0.75f; - } - else // Pulls itself toward enemies while a boss is alive so that the gimmick isn't entirely lost - { - if (Math.Abs(Projectile.velocity.X) < 1.5f && Math.Abs(Projectile.velocity.Y) < 1.5f) - CalamityUtils.HomeInOnNPC(Projectile, false, 320f, 1.5f, 20f); - } - } - } - } - - public override bool PreDraw(ref Color lightColor) - { - Asset tex = ModContent.Request(Texture); - - for (int i = 5; i >= 0; i--) - { - float c = Math.Max(i, 1); - - Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, tex.Frame(), new Color(1f / c, 1f / c, 1f / c, 1f / c), -Projectile.rotation * c, tex.Size() / 2, (float)MathHelper.Lerp(1f, i, scFactor), SpriteEffects.None); - } - - return false; - } - - public override void ModifyDamageHitbox(ref Rectangle hitbox) - { - // The hitbox gets bigger over time, because the vortex visually grows - int sizeIncrease = (int)(Projectile.ai[0] * 0.3f); - hitbox.Inflate(sizeIncrease, sizeIncrease); - } - - // The vortex slows down on enemies hits, so that it is easier for it to linger on top of stuff - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Projectile.velocity *= 0.5f; - - public override void OnKill(int timeLeft) - { - SoundEngine.PlaySound(SoundID.Item60 with { Volume = SoundID.Item60.Volume * 0.6f }, Projectile.Center); - - for (int i = 0; i <= 360; i += 3) - { - Vector2 dustspeed = new Vector2(12f, 12f).RotatedBy(MathHelper.ToRadians(i)); - int d = Dust.NewDust(Projectile.Center + (dustspeed * 2), Projectile.width, Projectile.height, DustID.Smoke, dustspeed.X, dustspeed.Y, 200, new Color(232, 251, 250, 200), 1.4f); - Main.dust[d].noGravity = true; - Main.dust[d].position = Projectile.Center; - Main.dust[d].velocity = dustspeed; - } - } - } -}