From e28c0bdff485d9a1fb84cc4c657f99bb93bac10c Mon Sep 17 00:00:00 2001 From: Xyk Date: Mon, 16 Sep 2024 21:07:11 -0700 Subject: [PATCH] right click fix and tooltip --- Items/Weapons/Ranged/OntologicalDespoiler.cs | 36 ++++++++----------- ...ods.CalamityMod.Items.Weapons.Ranged.hjson | 13 +++---- .../Ranged/OntologicalDespoilerGrenade.cs | 15 ++++++-- Projectiles/Rogue/SupernovaStealthBoom.cs | 3 +- 4 files changed, 35 insertions(+), 32 deletions(-) diff --git a/Items/Weapons/Ranged/OntologicalDespoiler.cs b/Items/Weapons/Ranged/OntologicalDespoiler.cs index 61d94a0b03..bcfd29804d 100644 --- a/Items/Weapons/Ranged/OntologicalDespoiler.cs +++ b/Items/Weapons/Ranged/OntologicalDespoiler.cs @@ -61,25 +61,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override void HoldItem(Player player) { - if (player.whoAmI != Main.myPlayer) - return; - - // Right-click channeling - player.Calamity().rightClickListener = true; - - if (player.Calamity().mouseRight && CanUseItem(player) && !Main.mapFullscreen && !Main.blockMouse) - { - // Only one out at a time - if (Main.projectile.Any(n => n.active && n.type == Item.shoot && n.owner == player.whoAmI)) - return; - - var source = player.GetSource_ItemUse(player.ActiveItem()); - Projectile holdout = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, Item.shoot, player.ActiveItem().damage, 0f, player.whoAmI, 0, 0, 10 + (shotType ? 5 : 0)); - holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); - SoundStyle fire = new("CalamityMod/Sounds/Item/DudFire"); - SoundEngine.PlaySound(fire with { Volume = 0.7f, Pitch = -0.5f + (shotType ? 0.5f : 0) }, player.Center); - shotType = !shotType; - } + if (Main.myPlayer == player.whoAmI) + player.Calamity().rightClickListener = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) @@ -88,8 +71,19 @@ namespace CalamityMod.Items.Weapons.Ranged if (Main.projectile.Any(n => n.active && n.type == Item.shoot && n.owner == player.whoAmI)) return false; - Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, shotType ? 0 : 5); - holdout.velocity = player.Calamity().mouseWorld - player.RotatedRelativePoint(player.MountedCenter); + if (player.Calamity().mouseRight && player.whoAmI == Main.myPlayer && !Main.mapFullscreen && !Main.blockMouse) + { + Projectile holdout2 = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, Item.shoot, player.ActiveItem().damage, 0f, player.whoAmI, 0, 0, 10 + (shotType ? 5 : 0)); + holdout2.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); + SoundStyle fire = new("CalamityMod/Sounds/Item/DudFire"); + SoundEngine.PlaySound(fire with { Volume = 0.7f, Pitch = -0.5f + (shotType ? 0.5f : 0) }, player.Center); + shotType = !shotType; + } + else + { + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, shotType ? 0 : 5); + holdout.velocity = player.Calamity().mouseWorld - player.RotatedRelativePoint(player.MountedCenter); + } return false; } public override void ModifyTooltips(List list) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index ffffd36f37..d1ecfd4d9b 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -837,12 +837,13 @@ OntologicalDespoiler: { DisplayName: Ontological Despoiler Tooltip: ''' - Charges and fires bursts of concentrated unreality, swap between unstable and null modes with right click - Unstable is trifurcated and pierces through enemies - Null is fired rapidly and has homing properties - The first charging stage increases the fire rate of the burst - The second charging stage replaces the burst with a disruption shot for unstable, or an annihilation beam for null - Modes charge slower when used in succession; switching resets it + Fires chargeable bursts of concentrated unreality + Swap between unstable mode and null mode with + Unstable bursts are trifurcated and pierce enemies + Null bursts have high rate-of-fire and home in on enemies + At 50% charge, the bursts are fired rapidly + At 100% charge, unleash an unstable disruption shot or a null annihilation beam + Modes charge slower when used in succession, this is reset by switching 'Rob them of continuity and the laws of physics they hold so dear.' ''' } diff --git a/Projectiles/Ranged/OntologicalDespoilerGrenade.cs b/Projectiles/Ranged/OntologicalDespoilerGrenade.cs index 444afa2535..cc136fa064 100644 --- a/Projectiles/Ranged/OntologicalDespoilerGrenade.cs +++ b/Projectiles/Ranged/OntologicalDespoilerGrenade.cs @@ -38,12 +38,16 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 600; Projectile.DamageType = DamageClass.Ranged; - Projectile.extraUpdates = 2; + Projectile.extraUpdates = 3; Projectile.tileCollide = false; } public override void AI() { + // Remove this when ranger doesnt get +1 extra update for free + if (Projectile.extraUpdates > 3) + Projectile.extraUpdates = 3; + Projectile.rotation = Projectile.velocity.ToRotation(); Projectile.frameCounter++; @@ -174,8 +178,13 @@ namespace CalamityMod.Projectiles.Ranged Particle orb3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Black, "CalamityMod/Particles/SmallBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0, 1.2f * power, 39, false); GeneralParticleHandler.SpawnParticle(orb3); - SoundStyle fire = new("CalamityMod/Sounds/Item/EarthMeteor"); - SoundEngine.PlaySound(fire with { Volume = 1f, Pitch = Main.rand.NextFloat(0, 0.1f) * -3 }, Projectile.Center); + for (int i = 0; i < 3; i++) + { + SoundStyle fire = new("CalamityMod/Sounds/Item/EarthMeteor"); + SoundEngine.PlaySound(fire with { Volume = 0.6f, Pitch = -0.1f * (i + 1), MaxInstances = 3 }, Projectile.Center); + } + SoundStyle fire2 = new("CalamityMod/Sounds/Item/ShadowboltReflect"); + SoundEngine.PlaySound(fire2 with { Volume = 0.9f, Pitch = -0.4f}, Projectile.Center); Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 5.5f), Projectile.knockBack * 3, Projectile.owner, 0, 0, 0); } diff --git a/Projectiles/Rogue/SupernovaStealthBoom.cs b/Projectiles/Rogue/SupernovaStealthBoom.cs index be17549c09..07b456c0f6 100644 --- a/Projectiles/Rogue/SupernovaStealthBoom.cs +++ b/Projectiles/Rogue/SupernovaStealthBoom.cs @@ -141,8 +141,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.damage *= 100; } - for (int i = 0; i < 5; i++) - SoundEngine.PlaySound(Supernova.StealthExplosionSound with { Pitch = Projectile.ai[2], MaxInstances = 5 }, Projectile.Center); + SoundEngine.PlaySound(Supernova.StealthExplosionSound with { Pitch = Projectile.ai[2] }, Projectile.Center); Projectile.numHits = 0; damageFrame = true; doDamage = true;