From 5d4f2fbdd941841ceace1565d890a5200f0c01fa Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Tue, 16 Dec 2025 16:10:37 -0800 Subject: [PATCH] reverted aquashard and removed shardshocker --- Items/Weapons/Ranged/AquashardShotgun.cs | 70 +++++ Items/Weapons/Ranged/AquashardShotgun.png | Bin 0 -> 999 bytes Items/Weapons/Ranged/Shardshocker.cs | 99 ------- Items/Weapons/Ranged/Shardshocker.png | Bin 1342 -> 0 bytes Items/Weapons/Ranged/TheBlunderbass.cs | 101 ------- Items/Weapons/Ranged/TheBlunderbass.png | Bin 829 -> 0 bytes ...ods.CalamityMod.Items.Weapons.Ranged.hjson | 26 +- .../Mods.CalamityMod.Projectiles.Ranged.hjson | 3 +- Projectiles/Ranged/Aquashard.cs | 118 +------- Projectiles/Ranged/Aquashard.png | Bin 826 -> 259 bytes Projectiles/Ranged/AquashardSplit.cs | 16 +- Projectiles/Ranged/ShardshockerCrystal.cs | 259 ------------------ 12 files changed, 95 insertions(+), 597 deletions(-) create mode 100644 Items/Weapons/Ranged/AquashardShotgun.cs create mode 100644 Items/Weapons/Ranged/AquashardShotgun.png delete mode 100644 Items/Weapons/Ranged/Shardshocker.cs delete mode 100644 Items/Weapons/Ranged/Shardshocker.png delete mode 100644 Items/Weapons/Ranged/TheBlunderbass.cs delete mode 100644 Items/Weapons/Ranged/TheBlunderbass.png delete mode 100644 Projectiles/Ranged/ShardshockerCrystal.cs diff --git a/Items/Weapons/Ranged/AquashardShotgun.cs b/Items/Weapons/Ranged/AquashardShotgun.cs new file mode 100644 index 0000000000..33568b1b9f --- /dev/null +++ b/Items/Weapons/Ranged/AquashardShotgun.cs @@ -0,0 +1,70 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Ranged +{ + public class AquashardShotgun : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Weapons.Ranged"; + public override void SetDefaults() + { + Item.width = 62; + Item.height = 26; + Item.damage = 12; + Item.DamageType = DamageClass.Ranged; + Item.useTime = 30; + Item.useAnimation = 30; + Item.useStyle = ItemUseStyleID.Shoot; + Item.noMelee = true; + Item.knockBack = 5.5f; + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.rare = ItemRarityID.Orange; + Item.UseSound = SoundID.Item61; + Item.autoReuse = true; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 30f; + Item.useAmmo = AmmoID.Bullet; + } + + // Terraria seems to really dislike high crit values in SetDefaults + public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 6; + + public override Vector2? HoldoutOffset() => new Vector2(-10, 0); + + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + int projAmt = Main.rand.Next(2, 4); + for (int index = 0; index < projAmt; ++index) + { + float SpeedX = velocity.X + Main.rand.Next(-40, 41) * 0.05f; + float SpeedY = velocity.Y + Main.rand.Next(-40, 41) * 0.05f; + + if (type == ProjectileID.Bullet) + { + int projectile = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + Main.projectile[projectile].timeLeft = 200; + } + else + Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI); + } + return false; + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(ItemID.Boomstick). + AddIngredient(2). + AddIngredient(10). + AddTile(TileID.Anvils). + Register(); + } + } +} diff --git a/Items/Weapons/Ranged/AquashardShotgun.png b/Items/Weapons/Ranged/AquashardShotgun.png new file mode 100644 index 0000000000000000000000000000000000000000..516b1fa7cc75d73cde0477191372990d28cfe904 GIT binary patch literal 999 zcmVX)@mN$S`R=b{_{?!T2>9a+S~s~ zjl0l?K`ftL1)#fk5P;72&jRqyhfx52`r?WU9?8BTu?Jp%835<{Jr`gx6$hYof4?O? zi-+wN`I;qe?X=-@G429;80-`)7;d%z>Fdi28;8P95z*kAa& z>b#Q0``em-?GmrFJ6Dp%n6`@?e+7W}?{^IHdrqG=+C83}1h#s@(IZCz=pA*8di4NR z>e`P0v>a%&0P+vh#@^CAU|Rs|%LM?OoKy9G)GqOkJtqNhT0?HN4_murMFVaK@OEX@ z{sVgfSa_Il!P~9JKKTgni28N)t4l^Xdg`K4j{SDtC?~(01t9$KkYUeEE&-68&sO^z zo2p&n;ou<`AlnxK;Jwc;7#~cG%Zj%bMgdryjR9b{=H*0KkrfUGWetmolnXHO)F@98rqw!CQC`-Vyz<2M-fqbEv6JFQm@H%dOS^ynV|rmxDWP$&Mz zr*8t@%0$k7X?*C9wfKYpw-+VDviofS_P!*Dl=Q(diS^-;eMbA4X&L9Q2c5vy^IH{o zG7fC@04=MwOa70qe+BBqJ>q`-IX7pNE5%~OYBKD-1439yE8*BLHvn(<)xBk4Bd2$+ z-vc}k&~sj;=f8fp)_kk%yoxijCk2P4UOjYQyK6z6xVH-{DZeU_cW$m4c8zJ3pRnB% zvH;R~NgMJVVIzO=lUKdS1D?jl4ZEH~s!Ubnf~+VP;)CKw~F**u2^& z9&7}E!IIoMl>?yktW-5atQ7Mq%_CH8hs^G}q8}J#z1_8ShAn`^)VDyLxJO*&C;#O3 zQ={B)Msnq2gM(!|*7LI5nB|P?Es_TWhDHF$t)#ydvjkdgitT)Mhxim5B0>t{|Rup}EtkM`|32%8RDauc1EnKx- zv5@swSA9kDlUCI%@y!^oq)=GS-ApoL*qhoVQ?t9;07%WPRO-iq?Z1WnSE^a!{{pfS VWT1Z^Wb*(3002ovPDHLkV1l$z>16-_ literal 0 HcmV?d00001 diff --git a/Items/Weapons/Ranged/Shardshocker.cs b/Items/Weapons/Ranged/Shardshocker.cs deleted file mode 100644 index 1223124a57..0000000000 --- a/Items/Weapons/Ranged/Shardshocker.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System; -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.SunkenSea; -using CalamityMod.NPCs.SunkenSea; -using CalamityMod.Projectiles.Ranged; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Ranged -{ - public class Shardshocker : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Weapons.Ranged"; - public static readonly SoundStyle ShootAndReloadSound = new("CalamityMod/Sounds/Item/WulfrumBlunderbussFireAndReload") { PitchVariance = 0.25f }; - public override void SetDefaults() - { - Item.width = 86; - Item.height = 44; - Item.damage = 131; - Item.DamageType = DamageClass.Ranged; - Item.useTime = 60; - Item.useAnimation = 60; - Item.useStyle = ItemUseStyleID.Shoot; - Item.noMelee = true; - Item.knockBack = 5.5f; - Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; - Item.rare = ItemRarityID.Orange; - Item.UseSound = null; - Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 50f; - } - - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 6; - - public override Vector2? HoldoutOffset() => new Vector2(-10, 0); - - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) - { - SoundEngine.PlaySound(ShootAndReloadSound with { PitchVariance = 0.3f }, position); - SoundEngine.PlaySound(GiantClam.SlamSound with { Pitch = 0.2f }, position); - Projectile.NewProjectile(source, position, velocity, Item.shoot, damage, knockback, player.whoAmI); - return false; - } - public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true; - - public override void UseStyle(Player player, Rectangle heldItemFrame) - { - player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X)); - float itemRotation = player.compositeFrontArm.rotation + MathHelper.PiOver2 * player.gravDir; - - Vector2 itemPosition = player.MountedCenter + itemRotation.ToRotationVector2() * 41f; - Vector2 itemSize = new Vector2(Item.width, Item.height); - Vector2 itemOrigin = new Vector2(4, 1); - - CalamityUtils.CleanHoldStyle(player, itemRotation, itemPosition, itemSize, itemOrigin); - base.UseStyle(player, heldItemFrame); - } - - // Recoil + Not having the gun aim downwards - public override void UseItemFrame(Player player) - { - player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X)); - - float animProgress = 1 - player.itemTime / (float)player.itemTimeMax; - float rotation = (player.Center - player.Calamity().mouseWorld).ToRotation() * player.gravDir + MathHelper.PiOver2; - if (animProgress < 0.5) - rotation += (player.altFunctionUse == 2 ? -1f : -0.45f) * (float)Math.Pow((0.5f - animProgress) / 0.5f, 2) * player.direction; - player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, rotation); //must be here otherwise it will vibrate - - - //Reloads the gun - if (animProgress > 0.5f) - { - float backArmRotation = rotation + 0.52f * player.direction; - - Player.CompositeArmStretchAmount stretch = ((float)Math.Sin(MathHelper.Pi * (animProgress - 0.5f) / 0.36f)).ToStretchAmount(); - player.SetCompositeArmBack(true, stretch, backArmRotation); - } - - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(). - AddIngredient(5). - AddIngredient(15). - AddIngredient(2). - AddTile(TileID.Anvils). - Register(); - } - } -} diff --git a/Items/Weapons/Ranged/Shardshocker.png b/Items/Weapons/Ranged/Shardshocker.png deleted file mode 100644 index dc5fde0017f68f09e019b97d5bd434dafcc4dcaf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1342 zcmV-E1;P4>P)Px#1ZP1_K>z@;j|==^1poj9=t)FDRA@u(nr~>8RT#j38_^#~CD$sqJ9lSmGlv8% zVr!uew_>7#xro&v?&y@4M@^dxqxueS6M(&O7#=-+kWaocE+)iHCOY8}Y`cswz{w@&BDv zv%!%ZtXU++9$B*lfCYQMg`3D+XRIZx*%PYWJ_7LSwpX7~ znl+}ek#oNQkQcrWZUS?iv6irIit z`z8x#tR<|^rWjQD@#_GzG#v$C-O>uJUw!qPS{xhrM~j8j;%opqYF-3j<nw^d(N4cGzNRRwRpU_{aSIxTEb`S<~{EMuw(5On1s2esU~8sX{?DDys!Nm0MfE^ z0C?f~Rp2qzWJOsa0P8MaHZK8C`|CyUb@F;hPmP zu44PAT6>VW(qAa8s(~aJY9hwAO&1HC0SB_ZWh9<4nxzqu}ii!5M3h6fyO+ zM)lU0m5j`gX|B*0ISW8$-dwF+NM!h>?x+?Q&r~a<`a>!gzr3LcfcHOY*J2?&Yo->r zw(3dfe!@mD@iKdR?Y)4WZ!>iogZI&~glqBMM=s)^>aKLgO+*JbpW z99Q!m)?%~1cg9-6SI5qIplAf(r8UdIW8jzHAJY0=xuOZq+Q**+kGX=G>&{2j+uX$L zXJU?%Tr4CqGS+*{_rKc28EXmOESkpd`sx4xooCv7eZ9yyVJQ0%Z#bH>g|AEIYq6~L zpNstkam>Fbq*oaiVydbTb32FPzYBz0(&Df5CW@I;O`Nfo2z=^dVAoIWfqlk8#+&9! z{U{{br4oY$G1)X&=s2dn+U`C-2tZc&4gf-#KlA2jact53 z0Bp!m@muAaU<`Aev6hJYw3CTxuDKUsegTjjd|4r-Mos{blc^h2I#(GaB&t`3)0DZ% z=EBLQxX;iTYl*l|+XiCpv@PmffSmM}9evp)DqsHwcy^y8Cl7Ah!B|Xnotg+|tR<#w zmc`iN)#^NeoV^mn)czLrg@9*PXxI5{KU{}q2H}jg#FWpzoNE6<$}I>wiESe0-e{%@&R9$Q3)#Hjm{llq`v3p{07*qoM6N<$f@77F Ac>n+a diff --git a/Items/Weapons/Ranged/TheBlunderbass.cs b/Items/Weapons/Ranged/TheBlunderbass.cs deleted file mode 100644 index d29689df96..0000000000 --- a/Items/Weapons/Ranged/TheBlunderbass.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.FurnitureDriftwood; -using CalamityMod.Items.Placeables.SunkenSea; -using CalamityMod.NPCs.SunkenSea; -using CalamityMod.Projectiles.Ranged; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Ranged -{ - [LegacyName("AquashardShotgun")] - public class TheBlunderbass : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Weapons.Ranged"; - public static readonly SoundStyle ShootAndReloadSound = new("CalamityMod/Sounds/Item/WulfrumBlunderbussFireAndReload") { PitchVariance = 0.25f }; - public override void SetDefaults() - { - Item.width = 56; - Item.height = 26; - Item.damage = 35; - Item.DamageType = DamageClass.Ranged; - Item.useTime = 55; - Item.useAnimation = 55; - Item.useStyle = ItemUseStyleID.Shoot; - Item.noMelee = true; - Item.knockBack = 5.5f; - Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; - Item.rare = ItemRarityID.Orange; - Item.UseSound = null; - Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 25f; - } - - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 6; - - public override Vector2? HoldoutOffset() => new Vector2(-10, 0); - - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) - { - SoundEngine.PlaySound(ShootAndReloadSound with { PitchVariance = 0.3f }, position); - SoundEngine.PlaySound(GiantClam.SlamSound with { Pitch = 0.2f }, position); - Projectile.NewProjectile(source, position, velocity, Item.shoot, damage, knockback, player.whoAmI); - return false; - } - public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true; - - public override void UseStyle(Player player, Rectangle heldItemFrame) - { - player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X)); - float itemRotation = player.compositeFrontArm.rotation + MathHelper.PiOver2 * player.gravDir; - - Vector2 itemPosition = player.MountedCenter + itemRotation.ToRotationVector2() * 41f; - Vector2 itemSize = new Vector2(Item.width, Item.height); - Vector2 itemOrigin = new Vector2(4, 1); - - CalamityUtils.CleanHoldStyle(player, itemRotation, itemPosition, itemSize, itemOrigin); - base.UseStyle(player, heldItemFrame); - } - - // Recoil + Not having the gun aim downwards - public override void UseItemFrame(Player player) - { - player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X)); - - float animProgress = 1 - player.itemTime / (float)player.itemTimeMax; - float rotation = (player.Center - player.Calamity().mouseWorld).ToRotation() * player.gravDir + MathHelper.PiOver2; - if (animProgress < 0.5) - rotation += (player.altFunctionUse == 2 ? -1f : -0.45f) * (float)Math.Pow((0.5f - animProgress) / 0.5f, 2) * player.direction; - player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, rotation); //must be here otherwise it will vibrate - - - //Reloads the gun - if (animProgress > 0.5f) - { - float backArmRotation = rotation + 0.52f * player.direction; - - Player.CompositeArmStretchAmount stretch = ((float)Math.Sin(MathHelper.Pi * (animProgress - 0.5f) / 0.36f)).ToStretchAmount(); - player.SetCompositeArmBack(true, stretch, backArmRotation); - } - - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(). - AddIngredient(15). - AddIngredient(3). - AddIngredient(7). - AddTile(TileID.Anvils). - Register(); - } - } -} diff --git a/Items/Weapons/Ranged/TheBlunderbass.png b/Items/Weapons/Ranged/TheBlunderbass.png deleted file mode 100644 index 255af4609df3528f1d6f07fbb4882094c33a7ea3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 829 zcmV-D1H$}?P)Px#1ZP1_K>z@;j|==^1poj7=Sf6CR9Hvtm|aLzK@@;LqwuH5(ljWxSTWreLQM(N z1kuQ%%pgIeh+Zs$ut!7aNs{&@C?lvS%7_pQGKj7 zU}m~&8cDG0_q6BS*}Kbp_sq<>@Q-koR0NzQ6#+Bh;WcP|65%~J;p24^5P)fE7UbLD|D<6|E`>jMpB zoUp8{41kHwc2Eq7xq|(>l+p0?&O>dS{GRJzJ^)$iTeNZEW3Z<1Kmg!W>#Z5BW;@&g zfZmvC09<*+pv>g*;v#kUZ+vZj1d7QWRYyRXaY4*oJ$6pZZ>%~Dz_*45Eidq(VlKtuR?~RhP5{QdZviN-KMO!(#c2SlA6u)LZ}`=7nPX6P*!WH!MLJy0Q@ha02pq$2+BSg`Ub^J^`5=jh1&b~ zw0L()1^{U()(kgx4}guqpZS{sh+l8z{cna)S@OyUHs;LLR1lNqDjUq) z%%Ewg+h@&`#De7ee@trmwuF^hJXh9i-K53upTE{(F}|uY8-Qu=1OT12*TBY{5c&q? z!=ao~>r5FPsSOasm~XU4%gcWFCn96knklg976h|KWuKL9LJ)I8_! "Projectiles.Ranged"; - public int time = 0; public override void SetDefaults() { - Projectile.width = 20; - Projectile.height = 20; + Projectile.width = 10; + Projectile.height = 10; Projectile.friendly = true; - Projectile.tileCollide = true; Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = 1; Projectile.timeLeft = 300; + Projectile.aiStyle = ProjAIStyleID.Arrow; + Projectile.extraUpdates = 1; } public override void AI() { - //Rotation - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - if (time == 1) - { - Vector2 smokeVel = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 5; - int smokeAmount = Main.rand.Next(8, 12 + 1); - for (int i = 0; i < smokeAmount; i++) - { - Particle smoke = new HeavySmokeParticle(Projectile.Center, smokeVel.RotatedByRandom(0.4f) * Main.rand.NextFloat(1.2f, 2f), Color.White, Main.rand.Next(40, 60 + 1), Main.rand.NextFloat(0.2f, 0.4f), 0.3f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: true); - GeneralParticleHandler.SpawnParticle(smoke); - - } - for (int i = 0; i < 5; i++) - { - Particle spark = new GlowSparkParticle(Projectile.Center, Projectile.velocity.RotatedByRandom(0.8f) * Main.rand.NextFloat(0.2f, 0.4f), false, 12, 0.009f, Color.DarkTurquoise, new Vector2(1.5f, 0.7f), true, false, 1.3f); - GeneralParticleHandler.SpawnParticle(spark); - } - } - if (time >= 2) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(3) ? 135 : 279, -Projectile.velocity.RotatedByRandom(0.5f) * Main.rand.NextFloat(0.05f, 0.2f) - new Vector2(0, 1)); - dust.scale = Main.rand.NextFloat(0.6f, 0.8f); - dust.noGravity = false; - } - if (time == 14) - { - Projectile.Kill(); - } - time++; + Projectile.velocity.X *= 0.9995f; + Projectile.velocity.Y += 0.01f; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - int projAmt = 3; - for (int i = 0; i < projAmt; i++) - { - Vector2 velocity = CalamityUtils.RandomVelocity(50f, 35f, 50f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.3f), 0f, Projectile.owner); - } - float offset = Main.rand.NextFloat(MathHelper.TwoPi); - for (int i = 0; i < 4; i++) - { - Vector2 velocity = (MathHelper.TwoPi * i / 4f + offset).ToRotationVector2() * 0.5f;; - Particle cross = new SparkParticle(Projectile.Center + velocity * 15f, velocity, false, 15, 1.5f, Color.DarkTurquoise, true); - GeneralParticleHandler.SpawnParticle(cross); - } - for (int k = 0; k < 3; k++) - { - Particle outerGlow = new CustomPulse(Projectile.Center, Vector2.Zero, Color.DarkSlateBlue, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.5f, 0.25f, 25); - GeneralParticleHandler.SpawnParticle(outerGlow); - Particle innerGlow = new CustomPulse(Projectile.Center, Vector2.Zero, Color.DarkTurquoise, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.4f, 0.15f, 25); - GeneralParticleHandler.SpawnParticle(innerGlow); - } - Player Owner = Main.player[Projectile.owner]; - if (Owner.Calamity().GeneralScreenShakePower < 1.2f) - Owner.Calamity().GeneralScreenShakePower = 1.2f; - target.AddBuff(ModContent.BuffType(), 30); - } - - public override void OnKill(int timeLeft) - { - SoundEngine.PlaySound(SoundID.DD2_WitherBeastDeath with { Volume = 0.8f }, Projectile.Center); - int projAmt = 3; + int projAmt = Main.rand.Next(1, 3); if (Projectile.owner == Main.myPlayer) { for (int i = 0; i < projAmt; i++) { - Vector2 velocity = CalamityUtils.RandomVelocity(50f, 35f, 50f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), 0f, Projectile.owner); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.6), 0f, Projectile.owner); } } - // Create Blast - float blastSize = 80; - float minMultiplier = 0.25f; - int hitsToMinMult = 8; - Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.25f), 0f, Projectile.owner, blastSize, minMultiplier, hitsToMinMult); - blast.DamageType = DamageClass.Ranged; - blast.ArmorPenetration = 5; + } + + public override void OnKill(int timeLeft) + { + SoundEngine.PlaySound(SoundID.Item27, Projectile.position); for (int k = 0; k < 5; k++) { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Rain, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } - Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.DarkTurquoise, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(-12, 12), 0f, 0.08f, 22); - GeneralParticleHandler.SpawnParticle(blastRing); - Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.DeepSkyBlue * 0.8f, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(-10, 10), 0f, 0.06f, 22, true); - GeneralParticleHandler.SpawnParticle(blastRing2); - Particle blastRing3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.DeepSkyBlue * 0.8f, "CalamityMod/Particles/DetailedExplosion", Vector2.One, Main.rand.NextFloat(-10, 10), 0f, 0.2f, 22, true); - GeneralParticleHandler.SpawnParticle(blastRing3); - for (int i = 0; i < (int)(15); i++) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1f), 0, default, Main.rand.NextFloat(1f, 1.3f)); - dust.noGravity = !Main.rand.NextBool(); - dust.color = Main.rand.NextBool(5) ? Color.DeepSkyBlue : Color.DarkTurquoise; - } - } - public override bool PreDraw(ref Color lightColor) - { - if (time < 2) - { - return false; - } - return base.PreDraw(ref lightColor); } } } diff --git a/Projectiles/Ranged/Aquashard.png b/Projectiles/Ranged/Aquashard.png index 54457ff6b4845dd0e906170d21b3c9754bf65837..0e32025173488e1c6680c9524dbb5273b3bb75ac 100644 GIT binary patch literal 259 zcmV+e0sQ`nP)6e+|aWh&PYTt^xqkevie8D<4mDa67~Ei6QsLM$}| zEyCCsa1_bRDerq6?t>SqQP($_A4JCo0iJIjz>h$&MS19S}Z4Zcu6Of%hcN${AlC?=v{<55Vhq3|jjwkcvxooL{$j zGy_+ccRAyn!p1*~X%b75c=6(Yglg2yeNFSE9pLHuHkTJRegS2BEI);ysZ9U?002ov JPDHLkV1kE@W9t9_ literal 826 zcmV-A1I7G_P)Px#1ZP1_K>z@;j|==^1poj7%1J~)R7gw3md{HRVHn3huc-ru>yOHZ$uK}n`XY-ng8{mclYk^GM zFf(z(lrb$9`&cwYEE;l}_j8f^kF>j>z@vaiaoV|_d;Z4!(i-ziYfdv&P4!eY)t6s^ z2t)@>fQob3Dk@ez5@!`TceGb+1t9U}6S$Lu5*gAr7}7WBkA~=vhDaJZNkeDTSh2h> zM9B;ME0yv?#?Hx*z5%wJoXMRB%G4|Xf!w@xE!%}7ecb>|xRnE|iu{+(JIBE0kwo^K zfS$;+O9dT0y#OqXzJ&jxV634HfZ?s>yos_>oSsY4kuU&0RRcE_SPMAod90z$Qd0^( zRl}!hEKX0dI6Z0ET~Odr1Rh1~%^2*>7z}SMABaD;e(xk530v{EBZ7581nWfE6e3xdi~$V^6_V1(NWUTLA3( z8v!_y_+n+a diff --git a/Projectiles/Ranged/AquashardSplit.cs b/Projectiles/Ranged/AquashardSplit.cs index 82ce78b9f9..a9555374d0 100644 --- a/Projectiles/Ranged/AquashardSplit.cs +++ b/Projectiles/Ranged/AquashardSplit.cs @@ -2,15 +2,13 @@ using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Particles; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; namespace CalamityMod.Projectiles.Ranged { public class AquashardSplit : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "CalamityMod/Projectiles/Ranged/Aquashard"; public override void SetStaticDefaults() => ProjectileID.Sets.CultistIsResistantTo[Type] = true; public override void SetDefaults() @@ -38,16 +36,10 @@ namespace CalamityMod.Projectiles.Ranged public override void OnKill(int timeLeft) { - SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact with { Volume = 0.5f, PitchVariance = 0.3f }, Projectile.Center); - Particle Star = new CritSpark(Projectile.Center, Vector2.Zero, Color.SkyBlue, Color.DarkTurquoise, Main.rand.NextFloat(1f, 1.1f), 30, 0.1f, 3f); - GeneralParticleHandler.SpawnParticle(Star); - int num190 = Main.rand.Next(5, 9); - for (int i = 0; i < num190; i++) + SoundEngine.PlaySound(SoundID.Item27, Projectile.position); + for (int k = 0; k < 5; k++) { - int bubbly = Dust.NewDust(Projectile.Center, 0, 0, DustID.UnusedWhiteBluePurple, 0f, 0f, 100, default, 1.4f); - Main.dust[bubbly].velocity *= 0.8f; - Main.dust[bubbly].position = Vector2.Lerp(Main.dust[bubbly].position, Projectile.Center, 0.5f); - Main.dust[bubbly].noGravity = true; + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Rain, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } } } diff --git a/Projectiles/Ranged/ShardshockerCrystal.cs b/Projectiles/Ranged/ShardshockerCrystal.cs deleted file mode 100644 index 75ceacb4f8..0000000000 --- a/Projectiles/Ranged/ShardshockerCrystal.cs +++ /dev/null @@ -1,259 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; -using CalamityMod.Particles; -using CalamityMod.Tiles.Abyss; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; -using static Terraria.GameContent.Animations.Actions.Sprites; -using CalamityMod.Dusts; -using Microsoft.Xna.Framework.Graphics; -using Terraria.GameContent; -using CalamityMod.Projectiles.Summon; -using CalamityMod.Projectiles.Melee; -using System; -using System.Data; -using CalamityMod.Items.Ammo; - -namespace CalamityMod.Projectiles.Ranged -{ - public class ShardshockerCrystal : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Ranged"; - public override string Texture => "CalamityMod/Projectiles/Ranged/Aquashard"; - public static readonly SoundStyle Collision = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeImpact") { Volume = 0.5f }; - public int time = 0; - - public override void SetDefaults() - { - Projectile.width = 33; - Projectile.height = 33; - Projectile.friendly = true; - Projectile.tileCollide = true; - Projectile.DamageType = DamageClass.Ranged; - Projectile.penetrate = 1; - Projectile.timeLeft = 240; - } - - //The crystal can only damage enemies if it's not hanging in the air - public override bool? CanDamage() => time <= 30 ? null : false; - public override void AI() - { - //Set the projectile as traveling and only update rotation while traveling - if (time < 30) - { - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - Projectile.ai[1] = 1f; - } - - // Make it lose velocity as it travels - Projectile.velocity *= 0.94f; - #region Traveling Visuals - //Firing effects on frame one - if (time == 1) - { - Vector2 smokeVel = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 5; - int smokeAmount = Main.rand.Next(8, 12 + 1); - for (int i = 0; i < smokeAmount; i++) - { - Particle smoke = new HeavySmokeParticle(Projectile.Center, smokeVel.RotatedByRandom(0.4f) * Main.rand.NextFloat(1.2f, 2f), Color.White, Main.rand.Next(40, 60 + 1), Main.rand.NextFloat(0.2f, 0.4f), 0.3f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: true); - GeneralParticleHandler.SpawnParticle(smoke); - - } - for (int i = 0; i < 5; i++) - { - Particle spark = new GlowSparkParticle(Projectile.Center, Projectile.velocity.RotatedByRandom(0.8f) * Main.rand.NextFloat(0.2f, 0.4f), false, 12, 0.009f, Color.DarkTurquoise, new Vector2(1.5f, 0.7f), true, false, 1.3f); - GeneralParticleHandler.SpawnParticle(spark); - } - } - //Only spawn dust trails while traveling - if (time >= 2 && time <= 30) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(3) ? 135 : 279, -Projectile.velocity.RotatedByRandom(0.5f) * Main.rand.NextFloat(0.05f, 0.2f) - new Vector2(0, 1)); - dust.scale = Main.rand.NextFloat(0.6f, 0.8f); - dust.noGravity = false; - } - #endregion - //After traveling for 30 frames, come to a stop in the air - if (time >= 30) - { - //Set AI as stopped so traveling crystals can collide with it - Projectile.ai[1] = 0f; - Projectile.velocity = Vector2.Zero; - Vector2 velocity = Main.rand.NextVector2Unit() * (Main.rand.NextFloat(8f, 10f)); - Dust spark = Dust.NewDustPerfect(Projectile.Center, 278, velocity); - spark.noGravity = true; - spark.color = Main.rand.NextBool() ? Color.Aquamarine : Color.LightSkyBlue; - if (Main.rand.NextBool(13)) - { - // Create a lightning bolt-like particle in the direction of the shot and 3 random hue-shifted ones by the side - Particle bolt = new CrackParticle(Projectile.Center, velocity * 0.5f, Main.rand.NextBool() ? Color.DarkTurquoise : Color.SkyBlue, Vector2.One, 0, 0, Main.rand.NextFloat(0.4f, 0.5f), 12); - GeneralParticleHandler.SpawnParticle(bolt); - - for (int i = 1; i < 4; i++) - { - Particle bolt2 = new CrackParticle(Projectile.Center, velocity.RotatedBy(MathHelper.PiOver2 * i + MathHelper.ToRadians(Main.rand.NextFloat(-40f, 40f))) * 0.5f, Main.rand.NextBool() ? Color.DarkTurquoise : Color.SkyBlue, Vector2.One, 0, 0, Main.rand.NextFloat(0.2f, 0.3f), 12); - GeneralParticleHandler.SpawnParticle(bolt2); - } - } - //Create a lightning AoE every second - if (time % 60 == 0) - { - SoundEngine.PlaySound(SoundID.Item93, Projectile.Center); - // Create Blast - float blastSize = 120; - float minMultiplier = 0.25f; - int hitsToMinMult = 8; - Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 1.5f), 0f, Projectile.owner, blastSize, minMultiplier, hitsToMinMult); - blast.DamageType = DamageClass.Ranged; - Particle blastRing3 = new CustomPulse(Projectile.Center, Vector2.Zero, Main.rand.NextBool() ? Color.MediumTurquoise : Color.SkyBlue, "CalamityMod/Particles/PlasmaExplosion", Vector2.One, Main.rand.NextFloat(-10, 10), 0f, 0.12f, 30); - GeneralParticleHandler.SpawnParticle(blastRing3); - } - //Set up colliding behavior - foreach (Projectile proj in Main.ActiveProjectiles) - { - // Only allow other large crystals to collide - if (proj.type != Type) - continue; - - // Check if the colliding crystal is traveling - if (proj.ai[1] > 0f && Projectile.Hitbox.Intersects(proj.Hitbox)) - { - SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/LightningAura"), Projectile.Center); - //Set on kill effects and kill the stopped crystal - Projectile.ai[1] = 2f; - Projectile.Kill(); - //Kill the traveling crystal - proj.timeLeft = 0; - } - } - } - time++; - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - // Create a smaller AoE on direct hits - float blastSize = 130; - float minMultiplier = 0.25f; - int hitsToMinMult = 4; - Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.8f), 0f, Projectile.owner, blastSize, minMultiplier, hitsToMinMult); - blast.DamageType = DamageClass.Ranged; - - target.AddBuff(ModContent.BuffType(), 60); - - #region Visuals and Sound - SoundEngine.PlaySound(Collision, Projectile.Center); - - Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Main.rand.NextBool() ? Color.MediumAquamarine : Color.DarkSeaGreen, "CalamityMod/Particles/FlameExplosion", Vector2.One, Main.rand.NextFloat(-10, 10), 0f, 0.1f, 22, true); - GeneralParticleHandler.SpawnParticle(blastRing); - Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.MediumAquamarine, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(-12, 12), 0f, 0.18f, 22, true); - GeneralParticleHandler.SpawnParticle(blastRing2); - Particle blastRing3 = new CustomPulse(Projectile.Center, Vector2.Zero, Main.rand.NextBool() ? Color.DarkTurquoise : Color.SkyBlue, "CalamityMod/Particles/PlasmaExplosion", Vector2.One, Main.rand.NextFloat(-10, 10), 0f, 0.12f, 22); - GeneralParticleHandler.SpawnParticle(blastRing3); - - float offset = Main.rand.NextFloat(MathHelper.TwoPi); - for (int i = 0; i < 4; i++) - { - Vector2 velocity = (MathHelper.TwoPi * i / 4f + offset).ToRotationVector2() * 0.5f; ; - Particle cross = new SparkParticle(Projectile.Center + velocity * 15f, velocity, false, 15, 1.5f, Color.MediumAquamarine, true); - GeneralParticleHandler.SpawnParticle(cross); - } - for (int k = 0; k < 3; k++) - { - Particle outerGlow = new CustomPulse(Projectile.Center, Vector2.Zero, Color.DarkSlateBlue, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.5f, 0.25f, 25); - GeneralParticleHandler.SpawnParticle(outerGlow); - Particle innerGlow = new CustomPulse(Projectile.Center, Vector2.Zero, Color.MediumAquamarine, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.4f, 0.15f, 25); - GeneralParticleHandler.SpawnParticle(innerGlow); - } - - for (int i = 1; i < 8; i++) - { - Vector2 velocity = Main.rand.NextVector2Unit() * (Main.rand.NextFloat(9f, 11f)); - Dust spark = Dust.NewDustPerfect(Projectile.Center, 278, velocity); - spark.color = Main.rand.NextBool() ? Color.Aquamarine : Color.SkyBlue; - } - - for (int i = 1; i < 6; i++) - { - Vector2 velocity = Main.rand.NextVector2Unit() * (Main.rand.NextFloat(8f, 10f)); - Particle bolt2 = new CrackParticle(Projectile.Center, velocity.RotatedBy(MathHelper.PiOver2 * i + MathHelper.ToRadians(Main.rand.NextFloat(-40f, 40f))) * 0.5f, Main.rand.NextBool() ? Color.DarkTurquoise : Color.SkyBlue, Vector2.One, 0, 0, Main.rand.NextFloat(0.8f, 1.1f), 17); - GeneralParticleHandler.SpawnParticle(bolt2); - } - #endregion - } - - public override void OnKill(int timeLeft) - { - //These effects only occur if another crystal collides with a stopped one - if (Projectile.ai[1] == 2f) - { - SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/LightningAura"), Projectile.Center); - Player Owner = Main.player[Projectile.owner]; - if (Owner.Calamity().GeneralScreenShakePower < 1.2f) - Owner.Calamity().GeneralScreenShakePower = 1.2f; - int projAmt = 15; - for (int i = 0; i < projAmt; i++) - { - Vector2 velocity = CalamityUtils.RandomVelocity(50f, 35f, 50f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.2f), 0f, Projectile.owner); - } - float blastSize = 185; - float minMultiplier = 0.25f; - int hitsToMinMult = 8; - int debuff1 = BuffID.Electrified; - int debuffTime = 240; - Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 4f), 0f, Projectile.owner, blastSize, minMultiplier, hitsToMinMult); - blast.localAI[0] = debuff1; - blast.localAI[1] = debuffTime; - blast.DamageType = DamageClass.Ranged; - for (int i = 1; i < 9; i++) - { - Vector2 velocity = Main.rand.NextVector2Unit() * (Main.rand.NextFloat(8f, 10f)); - Particle bolt2 = new CrackParticle(Projectile.Center, velocity.RotatedBy(MathHelper.PiOver2 * i + MathHelper.ToRadians(Main.rand.NextFloat(-40f, 40f))) * 0.5f, Main.rand.NextBool() ? Color.DarkTurquoise : Color.SkyBlue, Vector2.One, 0, 0, Main.rand.NextFloat(0.9f, 1.5f), 20); - GeneralParticleHandler.SpawnParticle(bolt2); - } - Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.MediumAquamarine, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(-12, 12), 0f, 0.25f, 25, true); - GeneralParticleHandler.SpawnParticle(blastRing); - Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, Main.rand.NextBool() ? Color.MediumAquamarine : Color.DarkSeaGreen, "CalamityMod/Particles/FlameExplosion", Vector2.One, Main.rand.NextFloat(-10, 10), 0f, 0.13f, 25, true); - GeneralParticleHandler.SpawnParticle(blastRing2); - Particle blastRing3 = new CustomPulse(Projectile.Center, Vector2.Zero, Main.rand.NextBool() ? Color.DarkTurquoise : Color.SkyBlue, "CalamityMod/Particles/PlasmaExplosion", Vector2.One, Main.rand.NextFloat(-10, 10), 0f, 0.16f, 25, true); - GeneralParticleHandler.SpawnParticle(blastRing3); - float offset = Main.rand.NextFloat(MathHelper.TwoPi); - for (int i = 0; i < 4; i++) - { - Vector2 velocity = (MathHelper.TwoPi * i / 4f + offset).ToRotationVector2() * 0.5f; ; - Particle cross = new SparkParticle(Projectile.Center + velocity * 15f, velocity, false, 15, 2.5f, Color.MediumAquamarine, true); - GeneralParticleHandler.SpawnParticle(cross); - } - for (int k = 0; k < 3; k++) - { - Particle outerGlow = new CustomPulse(Projectile.Center, Vector2.Zero, Color.DarkSlateBlue, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.5f, 0.25f, 25); - GeneralParticleHandler.SpawnParticle(outerGlow); - Particle innerGlow = new CustomPulse(Projectile.Center, Vector2.Zero, Color.MediumAquamarine, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.4f, 0.15f, 25); - GeneralParticleHandler.SpawnParticle(innerGlow); - } - } - //These effects always occur - SoundEngine.PlaySound(SoundID.DD2_WitherBeastDeath with { Volume = 0.8f }, Projectile.Center); - for (int i = 0; i < (int)(15); i++) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1f), 0, default, Main.rand.NextFloat(1f, 1.3f)); - dust.noGravity = !Main.rand.NextBool(); - dust.color = Main.rand.NextBool(5) ? Color.DeepSkyBlue : Color.DarkTurquoise; - } - } - public override bool PreDraw(ref Color lightColor) - { - //Don't draw the projectile for the first two frames, to prevent it from coming out of the player - if (time < 2) - { - return false; - } - return base.PreDraw(ref lightColor); - } - } -}