From e7c65aa0462519dc627716424096489ddc0c13ed Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sat, 17 Feb 2024 23:14:13 -0500 Subject: [PATCH 01/24] Changed all instances of "on death" in tooltips --- .../en-US/Mods.CalamityMod.Items.Accessories.hjson | 4 ++-- Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson | 2 +- .../en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson | 2 +- .../en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson | 12 ++++++------ .../Mods.CalamityMod.Items.Weapons.Ranged.hjson | 8 ++++---- .../en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 17620a6973..fba20abffc 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -578,7 +578,7 @@ DragonScales: { Tooltip: ''' Rogue projectiles create slow fireballs as they travel - Stealth strikes create infernados on death + Stealth strikes create infernados where they hit +10% max run speed and acceleration Grants immunity to Dragonfire 'Only a living dragon holds true treasure' @@ -680,7 +680,7 @@ EtherealExtorter: { DisplayName: Ethereal Extorter Tooltip: ''' - Rogue projectiles explode into homing souls on death + Rogue projectiles explode into homing souls on hit 8% increased rogue damage and +5 maximum stealth ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson index 81bd7ef112..e471db5389 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson @@ -47,7 +47,7 @@ BubonicRound: { ElysianArrow: { DisplayName: Elysian Arrow - Tooltip: Summons meteors from the sky on death + Tooltip: Summons meteors from the sky on impact } FlashRound: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index 46d41b7d83..c8816c75fe 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -332,7 +332,7 @@ FlareBolt: { ForbiddenSun: { DisplayName: Forbidden Sun - Tooltip: Casts a fire orb that emits a gigantic explosion on death + Tooltip: Casts a fire orb that emits a gigantic explosion on hit } FrigidflashBolt: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 6fec01ad4f..6f81e4d381 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -189,7 +189,7 @@ Brimlance: { Brimlash: { DisplayName: Brimlash - Tooltip: Fires a brimstone bolt that explodes into more bolts on death + Tooltip: Fires a brimstone bolt that explodes into more bolts on hit } BrimstoneSword: { @@ -305,7 +305,7 @@ CrescentMoon: { DarklightGreatsword: { DisplayName: Darklight Greatsword - Tooltip: Fires darklight blades that split on death + Tooltip: Fires darklight blades that split on impact } DeathsAscension: { @@ -622,7 +622,7 @@ GreatswordofJudgement: { DisplayName: Greatsword of Judgement Tooltip: ''' - Fires a white orb that emits white rain on death for a time + Fires a white orb that emits white rain from where it dissipates for a time A pale white sword from a forgotten land You can hear faint yet comforting whispers emanating from the blade 'No matter where you may be you are never alone @@ -847,7 +847,7 @@ Orderbringer: { DisplayName: Orderbringer Tooltip: ''' - Fires a rainbow blade that emits rainbow rain on death for a time + Fires a rainbow blade that emits rainbow rain from where it dissipated for a time A pale white sword from a forgotten land You can hear faint yet comforting whispers emanating from the blade 'No matter where you may be you are never alone @@ -988,7 +988,7 @@ SausageMaker: { ScourgeoftheCosmos: { DisplayName: Scourge of the Cosmos - Tooltip: Throws a bouncing cosmic scourge that emits tiny homing cosmic scourges on death and tile hits + Tooltip: Throws a bouncing cosmic scourge that emits tiny homing cosmic scourges on enemy and tile hits } SeashineSword: { @@ -1085,7 +1085,7 @@ StormRuler: { DisplayName: Storm Ruler Tooltip: ''' - Fires beams that generate tornadoes on death + Fires beams that generate tornadoes where they strike Tornadoes suck enemies in 'Only a storm can fell a greatwood' ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index fb79477184..8606950d9c 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -537,7 +537,7 @@ FrostbiteBlaster: { Fungicide: { DisplayName: Fungicide - Tooltip: Converts musket balls into fungal rounds that split on death + Tooltip: Converts musket balls into fungal rounds that split upon impact } Galeforce: { @@ -699,7 +699,7 @@ Malevolence: { Tooltip: ''' Fires two arrows at once - Converts wooden arrows into plague arrows that explode into bees on death + Converts wooden arrows into plague arrows that explode into bees ''' } @@ -873,7 +873,7 @@ PearlGod: { PestilentDefiler: { DisplayName: Pestilent Defiler - Tooltip: Converts musket balls into plague rounds that explode and split apart on death + Tooltip: Converts musket balls into plague rounds that explode and split apart on hit } Phangasm: { @@ -1094,7 +1094,7 @@ Shroomer: { SlagMagnum: { DisplayName: Slag Magnum - Tooltip: Converts musket balls into fossil shards that split into additional shards on death + Tooltip: Converts musket balls into fossil shards that split into additional shards on impact } SomaPrime: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 4b5ae39bdb..6ea4b017c6 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -869,7 +869,7 @@ ProfanedPartisan: { DisplayName: Profaned Partisan Tooltip: ''' - Fires an unholy spear that explodes on death + Fires an unholy spear that explodes on enemy hits Stealth strikes spawn smaller spears to fly along side it ''' } From 6e31f578f85bd3e07ac28fb7713fc6afe063ee9d Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Sat, 17 Feb 2024 20:28:47 -0800 Subject: [PATCH 02/24] retired Uber --- Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs index 7fbec72628..96f9efaa05 100644 --- a/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs +++ b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs @@ -97,10 +97,9 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "StipulateVenus", "Tomat", "Triangle", - "Uberransy", "Xyk", "YuH", - + // Former devs "Afzofa", "AdipemDragon", "Akeeli", @@ -192,7 +191,8 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "TikiWiki", "Tinymanx", "Trivaxy", - "Uncle Danny", + "Uberransy", + "Uncle Danny", "Vaikyia", "Vladimier", "Yatagarasu", From 07c6d07be9adb664241644ba5931c81d0c8edfe7 Mon Sep 17 00:00:00 2001 From: Memes Date: Mon, 15 Jan 2024 00:34:33 +0100 Subject: [PATCH 03/24] Flak Kraken Rework, awaiting Xyk. --- CalamityLists.cs | 6 +- Items/Weapons/Ranged/FlakKraken.cs | 63 ++++-- Particles/MediumMistParticleAlphaBlend.cs | 52 +++++ Projectiles/Ranged/FlakKrakenGun.cs | 131 ----------- Projectiles/Ranged/FlakKrakenHoldout.cs | 243 +++++++++++++++++++++ Projectiles/Ranged/FlakKrakenProj.cs | 155 ------------- Projectiles/Ranged/FlakKrakenProjectile.cs | 236 ++++++++++++++++++++ Sounds/Item/FlakKrakenShoot.ogg | Bin 0 -> 24083 bytes 8 files changed, 584 insertions(+), 302 deletions(-) create mode 100644 Particles/MediumMistParticleAlphaBlend.cs delete mode 100644 Projectiles/Ranged/FlakKrakenGun.cs create mode 100644 Projectiles/Ranged/FlakKrakenHoldout.cs delete mode 100644 Projectiles/Ranged/FlakKrakenProj.cs create mode 100644 Projectiles/Ranged/FlakKrakenProjectile.cs create mode 100644 Sounds/Item/FlakKrakenShoot.ogg diff --git a/CalamityLists.cs b/CalamityLists.cs index ed977d0ed9..d94587c944 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -850,7 +850,7 @@ namespace CalamityMod ProjectileType(), ProjectileType(), ProjectileType(), - ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), @@ -875,7 +875,7 @@ namespace CalamityMod ProjectileType(), ProjectileType(), - ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), @@ -2111,7 +2111,7 @@ namespace CalamityMod ProjectileType(), ProjectileType(), ProjectileType(), - ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), diff --git a/Items/Weapons/Ranged/FlakKraken.cs b/Items/Weapons/Ranged/FlakKraken.cs index f24df51895..5d6ae88ea3 100644 --- a/Items/Weapons/Ranged/FlakKraken.cs +++ b/Items/Weapons/Ranged/FlakKraken.cs @@ -1,39 +1,76 @@ -using Terraria.DataStructures; -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.Ranged { public class FlakKraken : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + + #region Other Stats + public static float TimeBetweenShots = 20f; + public static float ProjectilesPerBurst = 2f; + + public static float OwnerKnockbackStrength = 5f; + + public static float ProjectileGravityStrength = 0.15f; + public static float ProjectileShootSpeed = 20f; + + public static float InitialShotDamageMultiplier = 0.5f; + public static float InitialShotHitShrapnelDamageMultiplier = 0.75f; + + public static int ShrapnelAmount = 12; + public static float ShrapnelAngleOffset = MathHelper.PiOver4; + + public static int ClusterShrapnelAmount = 20; + public static float ClusterShrapnelAngleOffset = MathHelper.PiOver2 + MathHelper.ToRadians(10f); + #endregion + public override void SetDefaults() { + Item.damage = 88; // Here you're modifying the shrapnel's damage. + Item.DamageType = DamageClass.Ranged; + Item.useTime = Item.useAnimation = 180; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 15f; + Item.width = 152; Item.height = 58; - Item.damage = 88; - Item.DamageType = DamageClass.Ranged; - Item.useTime = 10; - Item.useAnimation = 10; - Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; - Item.knockBack = 0f; + Item.useAmmo = AmmoID.Rocket; Item.value = CalamityGlobalItem.Rarity7BuyPrice; Item.rare = ItemRarityID.Lime; - Item.UseSound = CommonCalamitySounds.LaserCannonSound; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 30f; //30 + Item.useStyle = ItemUseStyleID.Shoot; + Item.UseSound = new SoundStyle("CalamityMod/Sounds/Item/DudFire") with { Volume = .4f, Pitch = -.9f, PitchVariance = 0.1f }; } - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + // Obviously we don't want multiple holdouts existing at the same time. + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] == 0; + + // Spawning the holdout won't consume ammo. + public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] != 0; + + // Makes the rotation of the mouse around the player sync in multiplayer. + public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true; + + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); + + // We set the rotation to the direction to the mouse so the first frame doesn't appear bugged out. + holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); + + return false; + } public override void AddRecipes() { diff --git a/Particles/MediumMistParticleAlphaBlend.cs b/Particles/MediumMistParticleAlphaBlend.cs new file mode 100644 index 0000000000..4ce8b0a507 --- /dev/null +++ b/Particles/MediumMistParticleAlphaBlend.cs @@ -0,0 +1,52 @@ +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod.Particles +{ + public class MediumMistParticleAlphaBlend : Particle + { + public override string Texture => "CalamityMod/Particles/MediumSmoke"; + public override int FrameVariants => 3; + + private float Opacity; + private Color ColorFire; + private Color ColorFade; + private float Spin; + + public MediumMistParticleAlphaBlend(Vector2 position, Vector2 velocity, Color colorFire, Color colorFade, float scale, float opacity, float rotationSpeed = 0f) + { + Position = position; + Velocity = velocity; + ColorFire = colorFire; + ColorFade = colorFade; + Scale = scale; + Opacity = opacity; + Rotation = Main.rand.NextFloat(MathHelper.TwoPi); + Spin = rotationSpeed; + Variant = Main.rand.Next(3); + } + + public override void Update() + { + Rotation += Spin * ((Velocity.X > 0) ? 1f : -1f); + Velocity *= 0.85f; + + if (Opacity > 90) + { + Lighting.AddLight(Position, Color.ToVector3() * 0.1f); + Scale += 0.01f; + Opacity -= 3; + } + else + { + Scale *= 0.975f; + Opacity -= 2; + } + + if (Opacity < 0) + Kill(); + + Color = Color.Lerp(ColorFire, ColorFade, MathHelper.Clamp((float)((255 - Opacity) - 100) / 80, 0f, 1f)) * (Opacity / 255f); + } + } +} diff --git a/Projectiles/Ranged/FlakKrakenGun.cs b/Projectiles/Ranged/FlakKrakenGun.cs deleted file mode 100644 index 88c4b779db..0000000000 --- a/Projectiles/Ranged/FlakKrakenGun.cs +++ /dev/null @@ -1,131 +0,0 @@ -using System; -using CalamityMod.Items.Weapons.Ranged; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.Localization; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Ranged -{ - public class FlakKrakenGun : ModProjectile - { - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - public override string Texture => "CalamityMod/Items/Weapons/Ranged/FlakKraken"; - - public override void SetDefaults() - { - Projectile.width = 152; - Projectile.height = 58; - Projectile.friendly = true; - Projectile.penetrate = -1; - Projectile.tileCollide = false; - Projectile.DamageType = DamageClass.Ranged; - Projectile.ignoreWater = true; - } - - public override void AI() - { - Player player = Main.player[Projectile.owner]; - float pi = 0f; - Vector2 playerRotation = player.RotatedRelativePoint(player.MountedCenter, true); - if (Projectile.spriteDirection == -1) - { - pi = 3.14159274f; - } - float hitRate = 30f; - if (Projectile.ai[0] > 90f) - { - hitRate = 15f; - } - if (Projectile.ai[0] > 120f) - { - hitRate = 5f; - } - Projectile.damage = player.ActiveItem() is null ? 0 : player.GetWeaponDamage(player.ActiveItem()); - Projectile.ai[0] += 1f; - Projectile.ai[1] += 1f; - bool isUsing = false; - if (Projectile.ai[0] % hitRate == 0f) - { - isUsing = true; - } - if (Projectile.ai[1] >= 1f) - { - Projectile.ai[1] = 0f; - isUsing = true; - if (Main.myPlayer == Projectile.owner) - { - float scaleFactor5 = player.ActiveItem().shootSpeed * Projectile.scale; - Vector2 shootDirection = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY) - playerRotation; - if (player.gravDir == -1f) - { - shootDirection.Y = (float)(Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - playerRotation.Y; - } - Vector2 normalizeShoot = Vector2.Normalize(shootDirection); - if (float.IsNaN(normalizeShoot.X) || float.IsNaN(normalizeShoot.Y)) - { - normalizeShoot = -Vector2.UnitY; - } - normalizeShoot = Vector2.Normalize(Vector2.Lerp(normalizeShoot, Vector2.Normalize(Projectile.velocity), 0.92f)); //0.92 - normalizeShoot *= scaleFactor5; - if (normalizeShoot.X != Projectile.velocity.X || normalizeShoot.Y != Projectile.velocity.Y) - { - Projectile.netUpdate = true; - } - Projectile.velocity = normalizeShoot; - } - } - if (Projectile.soundDelay <= 0) - { - Projectile.soundDelay = 10; - Projectile.soundDelay *= 2; - if (Projectile.ai[0] != 1f && Projectile.ai[0] <= 500f) - { - SoundEngine.PlaySound(SoundID.Item15, Projectile.position); - } - } - if (isUsing && Main.myPlayer == Projectile.owner) - { - bool canUseItem = player.channel && !player.noItems && !player.CCed; - if (canUseItem) - { - if (Projectile.ai[0] == 1f) - { - Vector2 projPos = player.RotatedRelativePoint(player.MountedCenter, true); - float projX = (float)Main.mouseX + Main.screenPosition.X - projPos.X; - float projY = (float)Main.mouseY + Main.screenPosition.Y - projPos.Y; - if (player.gravDir == -1f) - { - projY = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - projPos.Y; - } - if ((float.IsNaN(projX) && float.IsNaN(projY)) || (projX == 0f && projY == 0f)) - { - projX = (float)player.direction; - projY = 0f; - } - projPos += new Vector2(projX, projY); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), projPos.X, projPos.Y, 0f, 0f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, (float)Projectile.whoAmI); - Projectile.netUpdate = true; - } - } - else - { - Projectile.Kill(); - } - } - Projectile.position = player.RotatedRelativePoint(player.MountedCenter, true) - Projectile.Size / 2f; - Projectile.rotation = Projectile.velocity.ToRotation() + pi; - Projectile.spriteDirection = Projectile.direction; - Projectile.timeLeft = 2; - player.ChangeDir(Projectile.direction); - player.heldProj = Projectile.whoAmI; - player.itemTime = 2; - player.itemAnimation = 2; - player.itemRotation = (float)Math.Atan2((double)(Projectile.velocity.Y * (float)Projectile.direction), (double)(Projectile.velocity.X * (float)Projectile.direction)); - } - - public override bool? CanDamage() => false; - } -} diff --git a/Projectiles/Ranged/FlakKrakenHoldout.cs b/Projectiles/Ranged/FlakKrakenHoldout.cs new file mode 100644 index 0000000000..2b21eac1d8 --- /dev/null +++ b/Projectiles/Ranged/FlakKrakenHoldout.cs @@ -0,0 +1,243 @@ +using System; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using static CalamityMod.Items.Weapons.Ranged.FlakKraken; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Projectiles.Ranged +{ + public class FlakKrakenHoldout : ModProjectile + { + public override LocalizedText DisplayName => CalamityUtils.GetItemName(); + public override string Texture => "CalamityMod/Items/Weapons/Ranged/FlakKraken"; + + public Player Owner { get; set; } + public ref float ShootingTimer => ref Projectile.ai[0]; + public ref float TimerBetweenBursts => ref Projectile.ai[1]; + public ref float OffsetLengthScalar => ref Projectile.localAI[0]; + + // The type of dust used in the effects and the color of the particles that it'll use depending on the type of rocket used. + // It'll carry over to the projectiles that it shoots. + public static int DustEffectsID { get; set; } + public static Color EffectsColor { get; set; } + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 152; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.netImportant = true; + } + + public override void AI() + { + // If there's no player, or the player is the server, or the owner's stunned, there'll be no holdout. + bool cantUse = Owner == null || !Owner.active || Owner.dead || !Owner.channel || Main.myPlayer != Projectile.owner || Owner.CCed || Owner.noItems; + if (cantUse) + { + Projectile.Kill(); + return; + } + + // The center of the player, taking into account if they have a mount or not. + Vector2 mountedCenter = Owner.MountedCenter; + + // The vector between the player and the mouse. + Vector2 ownerToMouse = Owner.Calamity().mouseWorld - mountedCenter; + + // Deals with the holdout's rotation and direction, the owner's arms, etc. + ManageHoldout(mountedCenter, ownerToMouse); + + // If the timer reaches Item.useTime, it'll shoot. + // It'll shoot once immediately as the timer reaches. + if (ShootingTimer >= Owner.itemTimeMax) + { + // Every X frames it'll shoot a projectile. + if (ShootingTimer % TimeBetweenShots == 0f) + { + // We use the velocity of this projectie as its direction vector. + Vector2 direction = Projectile.velocity.SafeNormalize(Vector2.Zero); + + // The position of the tip of the gun. + Vector2 nuzzlePosition = Projectile.Center + direction * Projectile.width / 2f; + + // Every time we shoot we use ammo. + // With this method we also use the item's stats, like the shoot speed, or the type of ammo it was used. + Owner.PickAmmo(Owner.ActiveItem(), out _, out float itemShootSpeed, out int itemDamage, out float itemKnockback, out int rocketTypeShot); + + // Decides the color of the effects depending on the type of rocket used. + switch (rocketTypeShot) + { + case ItemID.WetRocket: + DustEffectsID = DustID.Water; + EffectsColor = Color.Blue; + break; + case ItemID.LavaRocket: + DustEffectsID = DustID.Torch; + EffectsColor = Color.Red; + break; + case ItemID.HoneyRocket: + DustEffectsID = DustID.Honey; + EffectsColor = Color.Yellow; + break; + default: + DustEffectsID = 109; + EffectsColor = Color.Black; + break; + } + + // Spawns the projectile. + Projectile.NewProjectileDirect( + Projectile.GetSource_FromThis(), + nuzzlePosition, + direction * itemShootSpeed, + ProjectileType(), + itemDamage, + itemKnockback, + Projectile.owner, + rocketTypeShot, + ownerToMouse.Length()); + + // Applies the knockback to the player. + Owner.velocity += ownerToMouse.SafeNormalize(Vector2.UnitY) * -OwnerKnockbackStrength; + + // Inside here go all the things that dedicated servers shouldn't spend resources on. + // Like visuals and sounds. + if (!Main.dedServ) + { + // By decreasing the offset length of the gun from the arms, we give an effect of recoil. + OffsetLengthScalar = 10f; + + Owner.Calamity().GeneralScreenShakePower = 5f; + + Particle shootPulse = new DirectionalPulseRing(nuzzlePosition, + Vector2.Zero, + Color.Gray * 0.7f, + new Vector2(0.5f, 1f), + Projectile.rotation, + 0.1f, + 0.4f, + 20); + GeneralParticleHandler.SpawnParticle(shootPulse); + + int smokeAmount = Main.rand.Next(12, 16 + 1); + for (int i = 0; i < smokeAmount; i++) + { + Particle smoke = new MediumMistParticleAlphaBlend( + nuzzlePosition, + direction.RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(2f, 30f), + EffectsColor * 0.1f, + Color.Transparent, + Main.rand.NextFloat(0.5f, 1.2f), + Main.rand.NextFloat(300f, 400f)); + GeneralParticleHandler.SpawnParticle(smoke); + } + + int dustAmount = Main.rand.Next(15, 20 + 1); + for (int i = 0; i < dustAmount; i++) + { + Dust shootDust = Dust.NewDustPerfect( + nuzzlePosition, + DustEffectsID, + direction.RotatedByRandom(MathHelper.PiOver4 * 0.5f) * Main.rand.NextFloat(2f, 12f), + Scale: Main.rand.NextFloat(0.8f, 1f)); + shootDust.fadeIn = 100f; + shootDust.noLight = false; + shootDust.noLightEmittence = false; + } + + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/FlakKrakenShoot") { Volume = 0.6f }, nuzzlePosition); + } + + NetUpdate(); + } + + // When it has shot all the projectiles in the burst, reset all the variables and back to shooting. + if (ShootingTimer >= Owner.itemTimeMax + TimeBetweenShots * (ProjectilesPerBurst - 1)) + { + ShootingTimer = 0f; + TimerBetweenBursts = 0f; + NetUpdate(); + } + } + + // When we change the distance of the gun from the arms for the recoil, + // recover to the original position smoothly. + if (OffsetLengthScalar != 30f) + OffsetLengthScalar = MathHelper.Lerp(OffsetLengthScalar, 30f, 0.05f); + + ShootingTimer++; + } + + #region AI Methods + + public void ManageHoldout(Vector2 mountedCenter, Vector2 ownerToMouse) + { + Vector2 rotationVector = Projectile.rotation.ToRotationVector2(); + float velocityRotation = Projectile.velocity.ToRotation(); + float proximityLookingUpwards = Vector2.Dot(ownerToMouse.SafeNormalize(Vector2.Zero), -Vector2.UnitY); + int direction = MathF.Sign(ownerToMouse.X); + + Vector2 armPosition = Owner.RotatedRelativePoint(mountedCenter, true); + Vector2 lengthOffset = rotationVector * OffsetLengthScalar; + Vector2 armOffset = new Vector2(Utils.Remap(proximityLookingUpwards, -1f, 1f, 15f, -18f) * direction, -20f + Utils.Remap(MathF.Abs(proximityLookingUpwards), 0f, 1f, 0f, proximityLookingUpwards > 0f ? 20f : 10f)); + Projectile.Center = armPosition + lengthOffset + armOffset; + Projectile.velocity = velocityRotation.AngleTowards(ownerToMouse.ToRotation(), 0.2f).ToRotationVector2(); + Projectile.rotation = velocityRotation; + Projectile.timeLeft = 2; + + Owner.heldProj = Projectile.whoAmI; + Owner.itemTime = Owner.itemAnimation = 2; + Owner.itemRotation = (Projectile.velocity * Projectile.direction).ToRotation(); + + Projectile.spriteDirection = Projectile.direction = direction; + Owner.ChangeDir(direction); + + float armRotation = Projectile.rotation - MathHelper.PiOver2; // -Pi/2 because the arms rotation starts with arms pointing down. + Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.ThreeQuarters, armRotation); + Owner.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, armRotation); + } + + public void NetUpdate() + { + Projectile.netUpdate = true; + if (Projectile.netSpam >= 10) + Projectile.netSpam = 9; + } + + #endregion + + public override void OnSpawn(IEntitySource source) + { + Owner = Main.player[Projectile.owner]; + OffsetLengthScalar = 30f; + } + + // Because we use the velocity as a direction, we don't need it to change its position. + public override bool ShouldUpdatePosition() => false; + + public override bool? CanDamage() => false; + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = Request(Texture).Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Color drawColor = Projectile.GetAlpha(lightColor); + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = texture.Size() * 0.5f; + SpriteEffects flipSprite = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + Main.EntitySpriteDraw(texture, drawPosition, null, drawColor, drawRotation, rotationPoint, Projectile.scale, flipSprite); + + return false; + } + } +} diff --git a/Projectiles/Ranged/FlakKrakenProj.cs b/Projectiles/Ranged/FlakKrakenProj.cs deleted file mode 100644 index f2e3b7084b..0000000000 --- a/Projectiles/Ranged/FlakKrakenProj.cs +++ /dev/null @@ -1,155 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using Microsoft.Xna.Framework; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Ranged -{ - public class FlakKrakenProj : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Ranged"; - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - } - - public override void SetDefaults() - { - Projectile.width = 54; - Projectile.height = 54; - Projectile.friendly = true; - Projectile.penetrate = -1; - Projectile.tileCollide = false; - Projectile.scale = 0.002f; - Projectile.timeLeft = 36000; - Projectile.DamageType = DamageClass.Ranged; - Projectile.ignoreWater = true; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - } - - public override void AI() - { - if (Projectile.type != ModContent.ProjectileType() || - !Main.projectile[(int)Projectile.ai[1]].active || - Main.projectile[(int)Projectile.ai[1]].type != ModContent.ProjectileType()) - { - Projectile.Kill(); - return; - } - - // This code uses player-specific fields (such as the mouse), and does not need to be run for anyone - // other than its owner. - if (Main.myPlayer != Projectile.owner) - return; - - // This needs to happen retroactively due to Deadshot Brooch and other potential items boosting updates - Projectile.localNPCHitCooldown = 10 * Projectile.MaxUpdates; - - Projectile.rotation += 0.2f; - if (Projectile.localAI[0] < 1f) - { - Projectile.localAI[0] += 0.002f; - Projectile.scale += 0.002f; - Projectile.width = Projectile.height = (int)(50f * Projectile.scale); - } - else - { - Projectile.width = Projectile.height = 50; - } - Player player = Main.player[Projectile.owner]; - Vector2 projPos = player.RotatedRelativePoint(player.MountedCenter, true); - float projX = (float)Main.mouseX + Main.screenPosition.X - projPos.X; - float projY = (float)Main.mouseY + Main.screenPosition.Y - projPos.Y; - if (player.gravDir == -1f) - { - projY = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - projPos.Y; - } - if ((float.IsNaN(projX) && float.IsNaN(projY)) || (projX == 0f && projY == 0f)) - { - projX = (float)player.direction; - projY = 0f; - } - projPos += new Vector2(projX, projY); - float speed = 30f; - float speedScale = 3f; - Vector2 vectorPos = Projectile.Center; - if (Vector2.Distance(projPos, vectorPos) < 90f) - { - speed = 10f; - speedScale = 1f; - } - if (Vector2.Distance(projPos, vectorPos) < 30f) - { - speed = 3f; - speedScale = 0.3f; - } - if (Vector2.Distance(projPos, vectorPos) < 10f) - { - speed = 1f; - speedScale = 0.1f; - } - float projectileX = projPos.X - vectorPos.X; - float projectileY = projPos.Y - vectorPos.Y; - float projectileAdjust = (float)Math.Sqrt((double)(projectileX * projectileX + projectileY * projectileY)); - projectileAdjust = speed / projectileAdjust; - projectileX *= projectileAdjust; - projectileY *= projectileAdjust; - if (Projectile.velocity.X < projectileX) - { - Projectile.velocity.X = Projectile.velocity.X + speedScale; - if (Projectile.velocity.X < 0f && projectileX > 0f) - { - Projectile.velocity.X = Projectile.velocity.X + speedScale; - } - } - else if (Projectile.velocity.X > projectileX) - { - Projectile.velocity.X = Projectile.velocity.X - speedScale; - if (Projectile.velocity.X > 0f && projectileX < 0f) - { - Projectile.velocity.X = Projectile.velocity.X - speedScale; - } - } - if (Projectile.velocity.Y < projectileY) - { - Projectile.velocity.Y = Projectile.velocity.Y + speedScale; - if (Projectile.velocity.Y < 0f && projectileY > 0f) - { - Projectile.velocity.Y = Projectile.velocity.Y + speedScale; - } - } - else if (Projectile.velocity.Y > projectileY) - { - Projectile.velocity.Y = Projectile.velocity.Y - speedScale; - if (Projectile.velocity.Y > 0f && projectileY < 0f) - { - Projectile.velocity.Y = Projectile.velocity.Y - speedScale; - } - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); - - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); - - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - modifiers.SourceDamage *= Projectile.localAI[0]; - } - - public override Color? GetAlpha(Color lightColor) - { - return new Color(255, 200, 50, Projectile.alpha); - } - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); - return false; - } - } -} diff --git a/Projectiles/Ranged/FlakKrakenProjectile.cs b/Projectiles/Ranged/FlakKrakenProjectile.cs new file mode 100644 index 0000000000..58cb67358e --- /dev/null +++ b/Projectiles/Ranged/FlakKrakenProjectile.cs @@ -0,0 +1,236 @@ +using System.IO; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using static CalamityMod.Items.Weapons.Ranged.FlakKraken; +using static CalamityMod.Projectiles.Ranged.FlakKrakenHoldout; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Projectiles.Ranged +{ + public class FlakKrakenProjectile : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "CalamityMod/Projectiles/Summon/CalamarisLamentProjectile"; + + public ref float RocketID => ref Projectile.ai[0]; + public ref float DistanceOwnerMouse => ref Projectile.ai[1]; + public bool IsShrapnel + { + get => Projectile.ai[2] == 1f; + set => Projectile.ai[2] = value == true ? 1f : 0f; + } + public bool HasHitEnemyWithInitialShot; + + public Player Owner { get; set; } + + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + } + + public override void SetDefaults() + { + Projectile.DamageType = DamageClass.Ranged; + Projectile.extraUpdates = 1; + Projectile.width = Projectile.height = 28; + Projectile.timeLeft = 600; + Projectile.localNPCHitCooldown = -1; + + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + } + + // Syncs other variables that can't fit into the Projectile.ai[] array. + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(HasHitEnemyWithInitialShot); + } + public override void ReceiveExtraAI(BinaryReader reader) + { + HasHitEnemyWithInitialShot = reader.ReadBoolean(); + } + + public override void AI() + { + // Enforces the gravity. + if (Projectile.velocity.Y < 25f) + Projectile.velocity.Y += ProjectileGravityStrength; + + // Rotates towards its velocity. + Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; + + Projectile.frameCounter++; + if (Projectile.frameCounter >= 4) + { + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; + Projectile.frameCounter = 0; + } + + // If it's the initial shot and the shot has gone past the distance of the player and the mouse when shooting, + // split into shrapnel. + if (!IsShrapnel && !Projectile.WithinRange(Owner.MountedCenter, DistanceOwnerMouse)) + Projectile.Kill(); + + // Below here go all the things that dedicated servers shouldn't spend resources on. + // Like visuals and sounds. + if (Main.dedServ) + return; + + // The projectile will fade away as its time alive is ending. + Projectile.alpha = (int)Utils.Remap(Projectile.timeLeft, 30f, 0f, 0f, 255f); + + Dust trailDust = Dust.NewDustDirect(Projectile.position, + Projectile.width, + Projectile.height, + DustEffectsID, + Scale: Main.rand.NextFloat(0.5f, 0.8f), + Alpha: 127); + trailDust.noGravity = true; + trailDust.noLight = true; + trailDust.alpha = (int)Utils.Remap(Projectile.timeLeft, 30f, 0f, 127f, 0f); + } + + public override void OnSpawn(IEntitySource source) + { + Owner = Main.player[Projectile.owner]; + Projectile.scale = 1.5f; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(BuffType(), 180); + if (!IsShrapnel) + HasHitEnemyWithInitialShot = true; + } + + public override void OnHitPlayer(Player target, Player.HurtInfo info) + { + target.AddBuff(BuffType(), 180); + if (!IsShrapnel) + HasHitEnemyWithInitialShot = true; + } + + // The initial shot deals less damage. + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.SourceDamage *= IsShrapnel ? 1f : InitialShotDamageMultiplier; + public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers) => modifiers.SourceDamage *= IsShrapnel ? 1f : InitialShotDamageMultiplier; + + public override void OnKill(int timeLeft) + { + var info = new CalamityUtils.RocketBehaviorInfo((int)RocketID) + { + // Since we use our own spawning method for the cluster rockets, we don't need them to shoot anything, + // we'll do it ourselves. + clusterProjectileID = ProjectileID.None, + destructiveClusterProjectileID = ProjectileID.None, + }; + int blastRadius = Projectile.RocketBehavior(info); + Projectile.ExpandHitboxBy((float)blastRadius); + Projectile.Damage(); + + if (!IsShrapnel) + { + bool usedClusterRockets = RocketID == ItemID.ClusterRocketI || RocketID == ItemID.ClusterRocketII; + int flakAmount = usedClusterRockets ? ClusterShrapnelAmount : ShrapnelAmount; + for (int i = 0; i < flakAmount; i++) + { + Projectile shrapnel = Projectile.NewProjectileDirect( + Projectile.GetSource_FromThis(), + Projectile.Center, + Projectile.velocity.SafeNormalize(-Vector2.UnitY).RotatedByRandom(usedClusterRockets ? ClusterShrapnelAngleOffset : ShrapnelAngleOffset) * ProjectileShootSpeed, + ProjectileType(), + (int)(Projectile.damage * (HasHitEnemyWithInitialShot ? InitialShotHitShrapnelDamageMultiplier : 1f)), + Projectile.knockBack, + Projectile.owner, + RocketID, + ai2: 1f); + + // Since the shrapnel and the initial shot are the same projectile, + // and we want to apply the damage penalty for hitting with the initial shot, + // all shrapnel will have this bool on and we'll apply the penalty here. + if (HasHitEnemyWithInitialShot) + shrapnel.ModProjectile().HasHitEnemyWithInitialShot = true; + } + } + + // Inside here go all the things that dedicated servers shouldn't spend resources on. + // Like visuals and sounds. + if (Main.dedServ) + return; + + // These effects will only run if the initial shot is splitting, + // or the shrapnel doesn't have the damage pentalty, so we don't have effect overload. + if (!IsShrapnel || (IsShrapnel && !HasHitEnemyWithInitialShot)) + { + int dustAmount = Main.rand.Next(20, 30 + 1); + for (int i = 0; i < dustAmount; i++) + { + Dust boomDust = Dust.NewDustPerfect(Projectile.Center, + DustEffectsID, + Main.rand.NextVector2Circular(5f, 5f), + newColor: EffectsColor, + Scale: Main.rand.NextFloat(.8f, 1.2f)); + boomDust.noLight = true; + boomDust.noLightEmittence = true; + } + + Particle boomRing = new DirectionalPulseRing(Projectile.Center, + Vector2.Zero, + Color.White * 0.3f, + Vector2.One, + 0f, + Projectile.width / 1560f, + Projectile.width / 156f, + 20); + GeneralParticleHandler.SpawnParticle(boomRing); + + int blobAmount = Main.rand.Next(4, 6 + 1); + for (int i = 0; i < blobAmount; i++) + { + Particle blob = new WaterGlobParticle(Projectile.Center, + Main.rand.NextVector2Circular(5f, 5f), + Main.rand.NextFloat(0.8f, 1.2f)); + blob.Color = EffectsColor; + GeneralParticleHandler.SpawnParticle(blob); + } + + int mistAmount = Main.rand.Next(3, 5 + 1); + for (int mistIndex = 0; mistIndex < mistAmount; mistIndex++) + { + float angle = MathHelper.TwoPi / mistAmount * mistIndex; + Vector2 velocity = angle.ToRotationVector2() * Main.rand.NextFloat(5f, 15f); + Particle boomMist = new MediumMistParticleAlphaBlend(Projectile.Center, + velocity, + EffectsColor * Main.rand.NextFloat(0.1f, 0.3f), + Color.Transparent, + Main.rand.NextFloat(.6f, 1.4f), + Main.rand.NextFloat(200f, 400f)); + GeneralParticleHandler.SpawnParticle(boomMist); + } + } + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = Request(Texture).Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Color drawColor = Projectile.GetAlpha(lightColor); + Vector2 origin = frame.Size() * 0.5f; + + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); + + Main.EntitySpriteDraw(texture, drawPosition, frame, drawColor, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None); + + return false; + } + } +} diff --git a/Sounds/Item/FlakKrakenShoot.ogg b/Sounds/Item/FlakKrakenShoot.ogg new file mode 100644 index 0000000000000000000000000000000000000000..2b3ab03de540bb10e3bdae94ef0324708271500f GIT binary patch literal 24083 zcmeFZWmFx_wkX=TOMu|P-95OwySqEVoj?Kv5AN>n?g{Sh7Th6N2>uqyxA)oaygTm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M&J<$mlxi^=k4#dykSahluwoe zc4e$tZb1vA=DhvNoqm<57fpfU>r8g(ab@#dFN%KW^ZyEs#AA>Us)8MfbzqunG|LM+ z0pk%|eY|~ARe-tlHR~;?q~Ch&9}GSYrbtWFx^WcdEa~I;uTbK*Fqu(8p%#NfKUAWp z2qOx{Z#k^Nfv$|T7bPcs-_UF);BD-62lWF?-FNiT>Icb`eA@qhEEEB~UsW3)+j#Dv zURRY&r9OvLOyEE29e3+v)~7Ln?vV`(1#++Xe}#iFzcSVq+{i1mZ4>a@?3BkcBf9T0 zO6Tu#qCgS0dqzh7$@8{y^l_^z?GqeH2+BZi$`LAp#?TE_x?F z*>@&c`|2(JS!8=^O<=ADONzkX$SB@*=%IDckS%d%C7o*6V(k4fTPU%rq z1Myi}l`x7Ky%tHAAx@zwq)GkCYNS8tqRzL#-0n;=-*t?vO)ERnUz?nK@a+x>LZMMy zW74;YSf0rY^y%!E4Q$OIdgo{D!IS~#RUwB%{J)Ensy|DF+x3%F3^YQG{(XTc#w~sb zBP2dlNQw~*f$@I()%!|AsyO)993l}3qfUIDe98dlGx#X>`>y&O8bpOe$&m- h$L;n*n}b>7!u*e?d&JkhR$lm2eiP1hc%fL}{{T)iRPz7; literal 0 HcmV?d00001 From 68b63b25fdb2b87707ab83e347bc61091f63aaaa Mon Sep 17 00:00:00 2001 From: Xyk Date: Sun, 21 Jan 2024 15:29:10 -0800 Subject: [PATCH 04/24] Xyk gets his grubby hands on it Flak Kraken touch ups, visuals and use time adjustments Adds a tooltip for the weapons --- Items/Weapons/Ranged/FlakKraken.cs | 16 +++--- ...ods.CalamityMod.Items.Weapons.Ranged.hjson | 7 ++- .../Mods.CalamityMod.Projectiles.Ranged.hjson | 1 + Projectiles/Ranged/FlakKrakenHoldout.cs | 16 +++--- Projectiles/Ranged/FlakKrakenProjectile.cs | 52 ++++++++++++++----- 5 files changed, 63 insertions(+), 29 deletions(-) diff --git a/Items/Weapons/Ranged/FlakKraken.cs b/Items/Weapons/Ranged/FlakKraken.cs index 5d6ae88ea3..b17179b7a8 100644 --- a/Items/Weapons/Ranged/FlakKraken.cs +++ b/Items/Weapons/Ranged/FlakKraken.cs @@ -15,29 +15,29 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; #region Other Stats - public static float TimeBetweenShots = 20f; + public static float TimeBetweenShots = 21; public static float ProjectilesPerBurst = 2f; - public static float OwnerKnockbackStrength = 5f; + public static float OwnerKnockbackStrength = 3.5f; - public static float ProjectileGravityStrength = 0.15f; - public static float ProjectileShootSpeed = 20f; + public static float ProjectileGravityStrength = 0.22f; + public static float ProjectileShootSpeed = 25f; public static float InitialShotDamageMultiplier = 0.5f; public static float InitialShotHitShrapnelDamageMultiplier = 0.75f; - public static int ShrapnelAmount = 12; + public static int ShrapnelAmount = 7; public static float ShrapnelAngleOffset = MathHelper.PiOver4; - public static int ClusterShrapnelAmount = 20; - public static float ClusterShrapnelAngleOffset = MathHelper.PiOver2 + MathHelper.ToRadians(10f); + public static int ClusterShrapnelAmount = 13; + public static float ClusterShrapnelAngleOffset = MathHelper.PiOver2 + MathHelper.ToRadians(50f); #endregion public override void SetDefaults() { Item.damage = 88; // Here you're modifying the shrapnel's damage. Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 180; + Item.useTime = Item.useAnimation = 63; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 15f; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 8606950d9c..06bde49472 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -485,7 +485,12 @@ FirestormCannon: { FlakKraken: { DisplayName: Flak Kraken - Tooltip: Fires an energy reticle that becomes more powerful over time + Tooltip: + ''' + Fires a burst of two large shots that explode at the cursor + Large shots burst into a wide cone of ink shrapnel + Hitting enemies directly causes the large shots and its shrapnel deal decreased damage + ''' } FlakToxicannon: { diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index d3b2b1be11..5c774fbde4 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -243,3 +243,4 @@ WaterSpout.DisplayName: Spout WulfrumScrapBullet.DisplayName: High Speed Scrap DragonsBreathFlames.DisplayName: Draconic Flames DragonsBreathMag.DisplayName: Dragons Breath Cartridge +FlakKrakenProjectile.DisplayName: Flak Kraken Projectile diff --git a/Projectiles/Ranged/FlakKrakenHoldout.cs b/Projectiles/Ranged/FlakKrakenHoldout.cs index 2b21eac1d8..37b8122976 100644 --- a/Projectiles/Ranged/FlakKrakenHoldout.cs +++ b/Projectiles/Ranged/FlakKrakenHoldout.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Ranged // Every X frames it'll shoot a projectile. if (ShootingTimer % TimeBetweenShots == 0f) { - // We use the velocity of this projectie as its direction vector. + // We use the velocity of this projectile as its direction vector. Vector2 direction = Projectile.velocity.SafeNormalize(Vector2.Zero); // The position of the tip of the gun. @@ -77,8 +77,8 @@ namespace CalamityMod.Projectiles.Ranged switch (rocketTypeShot) { case ItemID.WetRocket: - DustEffectsID = DustID.Water; - EffectsColor = Color.Blue; + DustEffectsID = 45; + EffectsColor = Color.RoyalBlue; break; case ItemID.LavaRocket: DustEffectsID = DustID.Torch; @@ -116,7 +116,7 @@ namespace CalamityMod.Projectiles.Ranged // By decreasing the offset length of the gun from the arms, we give an effect of recoil. OffsetLengthScalar = 10f; - Owner.Calamity().GeneralScreenShakePower = 5f; + Owner.Calamity().GeneralScreenShakePower = 3.5f; Particle shootPulse = new DirectionalPulseRing(nuzzlePosition, Vector2.Zero, @@ -131,13 +131,13 @@ namespace CalamityMod.Projectiles.Ranged int smokeAmount = Main.rand.Next(12, 16 + 1); for (int i = 0; i < smokeAmount; i++) { - Particle smoke = new MediumMistParticleAlphaBlend( + Particle smoke = new HeavySmokeParticle( nuzzlePosition, direction.RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(2f, 30f), EffectsColor * 0.1f, - Color.Transparent, - Main.rand.NextFloat(0.5f, 1.2f), - Main.rand.NextFloat(300f, 400f)); + Main.rand.Next(45, 61), + Main.rand.NextFloat(.6f, 1.3f), + Main.rand.NextFloat(0.2f, 0.35f)); GeneralParticleHandler.SpawnParticle(smoke); } diff --git a/Projectiles/Ranged/FlakKrakenProjectile.cs b/Projectiles/Ranged/FlakKrakenProjectile.cs index 58cb67358e..81302ae81e 100644 --- a/Projectiles/Ranged/FlakKrakenProjectile.cs +++ b/Projectiles/Ranged/FlakKrakenProjectile.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Ranged { Main.projFrames[Type] = 5; ProjectileID.Sets.TrailingMode[Type] = 2; - ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 12; } public override void SetDefaults() @@ -62,8 +62,17 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { // Enforces the gravity. - if (Projectile.velocity.Y < 25f) - Projectile.velocity.Y += ProjectileGravityStrength; + if (IsShrapnel) + { + if (Projectile.velocity.Y < 25f) + Projectile.velocity.Y += ProjectileGravityStrength; + } + // Scale for non Shrapnel + if (!IsShrapnel) + { + Projectile.scale = 1.5f; + Projectile.extraUpdates = 3; + } // Rotates towards its velocity. Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; @@ -88,6 +97,24 @@ namespace CalamityMod.Projectiles.Ranged // The projectile will fade away as its time alive is ending. Projectile.alpha = (int)Utils.Remap(Projectile.timeLeft, 30f, 0f, 0f, 255f); + // Shrapnel trail + if (IsShrapnel) + { + if (Projectile.timeLeft % 2 == 0 && Projectile.timeLeft <= 590) + { + AltSparkParticle spark = new AltSparkParticle(Projectile.Center - Projectile.velocity * 1.5f, Projectile.velocity * 0.01f, false, 8, 1.3f, EffectsColor * 0.135f); + GeneralParticleHandler.SpawnParticle(spark); + } + } + else + { + Vector2 dustPos = Projectile.Center - Projectile.velocity * 3 + Main.rand.NextVector2Circular(12, 12); + Dust dust = Dust.NewDustPerfect(dustPos, Main.rand.NextBool(4) ? 191 : DustEffectsID); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(1.4f, 1.65f); + dust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.1f, 0.7f); + } + Dust trailDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, @@ -145,7 +172,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile shrapnel = Projectile.NewProjectileDirect( Projectile.GetSource_FromThis(), Projectile.Center, - Projectile.velocity.SafeNormalize(-Vector2.UnitY).RotatedByRandom(usedClusterRockets ? ClusterShrapnelAngleOffset : ShrapnelAngleOffset) * ProjectileShootSpeed, + Projectile.velocity.SafeNormalize(-Vector2.UnitY).RotatedByRandom(usedClusterRockets ? ClusterShrapnelAngleOffset : ShrapnelAngleOffset) * ProjectileShootSpeed * Main.rand.NextFloat(0.45f, 0.85f), ProjectileType(), (int)(Projectile.damage * (HasHitEnemyWithInitialShot ? InitialShotHitShrapnelDamageMultiplier : 1f)), Projectile.knockBack, @@ -206,13 +233,13 @@ namespace CalamityMod.Projectiles.Ranged for (int mistIndex = 0; mistIndex < mistAmount; mistIndex++) { float angle = MathHelper.TwoPi / mistAmount * mistIndex; - Vector2 velocity = angle.ToRotationVector2() * Main.rand.NextFloat(5f, 15f); - Particle boomMist = new MediumMistParticleAlphaBlend(Projectile.Center, + Vector2 velocity = angle.ToRotationVector2() * Main.rand.NextFloat(2f, 7f); + Particle boomMist = new HeavySmokeParticle(Projectile.Center, velocity, - EffectsColor * Main.rand.NextFloat(0.1f, 0.3f), - Color.Transparent, - Main.rand.NextFloat(.6f, 1.4f), - Main.rand.NextFloat(200f, 400f)); + EffectsColor * Main.rand.NextFloat(0.15f, 0.25f), + Main.rand.Next(45, 61), + Main.rand.NextFloat(.4f, 1.1f), + Main.rand.NextFloat(0.2f, 0.35f)); GeneralParticleHandler.SpawnParticle(boomMist); } } @@ -223,10 +250,11 @@ namespace CalamityMod.Projectiles.Ranged Texture2D texture = Request(Texture).Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); - Color drawColor = Projectile.GetAlpha(lightColor); + Color drawColor = IsShrapnel ? Projectile.GetAlpha(lightColor) : Color.Black; Vector2 origin = frame.Size() * 0.5f; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); + if (!IsShrapnel) + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); Main.EntitySpriteDraw(texture, drawPosition, frame, drawColor, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None); From 53d79cd9b68600f9dbd0756b31f7de6f71f6dc5e Mon Sep 17 00:00:00 2001 From: Memes Date: Mon, 22 Jan 2024 01:15:19 +0100 Subject: [PATCH 05/24] Fixed Cluster Rockets II not exploding tiles. --- Projectiles/Ranged/FlakKrakenProjectile.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Projectiles/Ranged/FlakKrakenProjectile.cs b/Projectiles/Ranged/FlakKrakenProjectile.cs index 81302ae81e..c0cf03a8d2 100644 --- a/Projectiles/Ranged/FlakKrakenProjectile.cs +++ b/Projectiles/Ranged/FlakKrakenProjectile.cs @@ -188,6 +188,11 @@ namespace CalamityMod.Projectiles.Ranged } } + // Since we do our own spread for the cluster rockets, it won't explode tiles. + // So we do it manually here. + if (RocketID == ItemID.ClusterRocketII) + Projectile.ExplodeTiles(blastRadius, info.respectStandardBlastImmunity, info.tilesToCheck, info.wallsToCheck); + // Inside here go all the things that dedicated servers shouldn't spend resources on. // Like visuals and sounds. if (Main.dedServ) From 7a0d8b7846d12a5e2d8aa4930ef69e0284ac2e58 Mon Sep 17 00:00:00 2001 From: Xyk Date: Mon, 29 Jan 2024 00:27:00 -0800 Subject: [PATCH 06/24] Flak Toxicannon + Kraken tweaks Flak Toxicannon is basically Flak Kraken but fires one shot, is visually acid rain themed, and shoots faster with less shrapnel and recoil --- CalPlayer/CalamityPlayer.cs | 2 +- Items/Weapons/Ranged/FlakKraken.cs | 4 +- Items/Weapons/Ranged/FlakToxicannon.cs | 62 ++-- ...ods.CalamityMod.Items.Weapons.Ranged.hjson | 12 +- .../Mods.CalamityMod.Projectiles.Ranged.hjson | 1 + Projectiles/Ranged/FlakKrakenProjectile.cs | 5 +- Projectiles/Ranged/FlakToxicannonHoldout.cs | 246 ++++++++++++++++ .../Ranged/FlakToxicannonProjectile.cs | 267 ++++++++++++++++++ Projectiles/Ranged/ToxicannonDrop.cs | 76 ----- Projectiles/Ranged/ToxicannonShot.cs | 90 ------ 10 files changed, 571 insertions(+), 194 deletions(-) create mode 100644 Projectiles/Ranged/FlakToxicannonHoldout.cs create mode 100644 Projectiles/Ranged/FlakToxicannonProjectile.cs delete mode 100644 Projectiles/Ranged/ToxicannonDrop.cs delete mode 100644 Projectiles/Ranged/ToxicannonShot.cs diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 691d32f226..e753b83d0a 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -4043,7 +4043,7 @@ namespace CalamityMod.CalPlayer Vector2 startingPosition = Main.MouseWorld - Vector2.UnitY.RotatedByRandom(0.4f) * 1250f; Vector2 directionToMouse = (Main.MouseWorld - startingPosition).SafeNormalize(Vector2.UnitY).RotatedByRandom(0.1f); - int drop = Projectile.NewProjectile(source, startingPosition, directionToMouse * 15f, ModContent.ProjectileType(), d, 0f, Player.whoAmI); + int drop = Projectile.NewProjectile(source, startingPosition, directionToMouse * 15f, ModContent.ProjectileType(), d, 0f, Player.whoAmI); if (drop.WithinBounds(Main.maxProjectiles)) { Main.projectile[drop].penetrate = 2; diff --git a/Items/Weapons/Ranged/FlakKraken.cs b/Items/Weapons/Ranged/FlakKraken.cs index b17179b7a8..d71127cbb1 100644 --- a/Items/Weapons/Ranged/FlakKraken.cs +++ b/Items/Weapons/Ranged/FlakKraken.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public static float TimeBetweenShots = 21; public static float ProjectilesPerBurst = 2f; - public static float OwnerKnockbackStrength = 3.5f; + public static float OwnerKnockbackStrength = 2.5f; public static float ProjectileGravityStrength = 0.22f; public static float ProjectileShootSpeed = 25f; @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.Rarity7BuyPrice; Item.rare = ItemRarityID.Lime; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = new SoundStyle("CalamityMod/Sounds/Item/DudFire") with { Volume = .4f, Pitch = -.9f, PitchVariance = 0.1f }; + Item.UseSound = new SoundStyle("CalamityMod/Sounds/Item/DudFire") with { Volume = .4f, Pitch = -.95f, PitchVariance = 0.1f }; } // Obviously we don't want multiple holdouts existing at the same time. diff --git a/Items/Weapons/Ranged/FlakToxicannon.cs b/Items/Weapons/Ranged/FlakToxicannon.cs index e367c460d8..5e33173128 100644 --- a/Items/Weapons/Ranged/FlakToxicannon.cs +++ b/Items/Weapons/Ranged/FlakToxicannon.cs @@ -4,40 +4,68 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Audio; namespace CalamityMod.Items.Weapons.Ranged { public class FlakToxicannon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; - public override void SetStaticDefaults() - { - } + #region Other Stats + public static float TimeBetweenShots = 1; + public static float ProjectilesPerBurst = 1f; + + public static float OwnerKnockbackStrength = 1.1f; + + public static float ProjectileGravityStrength = 0.17f; + public static float ProjectileShootSpeed = 25f; + + public static float InitialShotDamageMultiplier = 0.5f; + public static float InitialShotHitShrapnelDamageMultiplier = 0.75f; + + public static int ShrapnelAmount = 4; + public static float ShrapnelAngleOffset = 0.11f; + + public static int ClusterShrapnelAmount = 7; + public static float ClusterShrapnelAngleOffset = 0.53f; + #endregion + public override void SetDefaults() { + Item.damage = 66; // Here you're modifying the shrapnel's damage. + Item.DamageType = DamageClass.Ranged; + Item.useTime = Item.useAnimation = 44; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 15f; + Item.width = 88; Item.height = 28; - Item.damage = 51; - Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 11; - Item.useStyle = ItemUseStyleID.Shoot; - Item.useTurn = false; Item.noMelee = true; - Item.knockBack = 7f; + Item.noUseGraphic = true; + Item.channel = true; + Item.useAmmo = AmmoID.Rocket; Item.value = CalamityGlobalItem.Rarity5BuyPrice; Item.rare = ItemRarityID.Pink; - Item.UseSound = SoundID.Item109; - Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 16f; + Item.useStyle = ItemUseStyleID.Shoot; + Item.UseSound = new SoundStyle("CalamityMod/Sounds/Item/DudFire") with { Volume = .4f, Pitch = -.7f, PitchVariance = 0.1f }; } + + // Obviously we don't want multiple holdouts existing at the same time. + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] == 0; + + // Spawning the holdout won't consume ammo. + public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] != 0; + + // Makes the rotation of the mouse around the player sync in multiplayer. + public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - float angle = velocity.ToRotation() + MathHelper.PiOver2; - if (angle <= -(MathHelper.Pi / 3) || angle >= (MathHelper.Pi / 3)) - return false; + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); + + // We set the rotation to the direction to the mouse so the first frame doesn't appear bugged out. + holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); - Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 06bde49472..02265bbcbd 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -486,20 +486,20 @@ FirestormCannon: { FlakKraken: { DisplayName: Flak Kraken Tooltip: - ''' + ''' Fires a burst of two large shots that explode at the cursor Large shots burst into a wide cone of ink shrapnel - Hitting enemies directly causes the large shots and its shrapnel deal decreased damage - ''' + Hitting enemies directly causes the large shots and their shrapnel to deal decreased damage + ''' } FlakToxicannon: { DisplayName: Flak Toxicannon Tooltip: ''' - Fires angled shots in the direction of the cursor - Can only be shot in a wide cone above the player - 'High IQ required' + Fires a large shot that explodes at the cursor + Large shots burst into a cone of irradiated shrapnel drops + Hitting enemies directly causes the large shot and its shrapnel to deal decreased damage ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index 5c774fbde4..29f6ce4715 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -244,3 +244,4 @@ WulfrumScrapBullet.DisplayName: High Speed Scrap DragonsBreathFlames.DisplayName: Draconic Flames DragonsBreathMag.DisplayName: Dragons Breath Cartridge FlakKrakenProjectile.DisplayName: Flak Kraken Projectile +FlakToxicannonProjectile.DisplayName: Flak Toxicannon Projectile diff --git a/Projectiles/Ranged/FlakKrakenProjectile.cs b/Projectiles/Ranged/FlakKrakenProjectile.cs index c0cf03a8d2..4e63b3f1b1 100644 --- a/Projectiles/Ranged/FlakKrakenProjectile.cs +++ b/Projectiles/Ranged/FlakKrakenProjectile.cs @@ -124,6 +124,8 @@ namespace CalamityMod.Projectiles.Ranged trailDust.noGravity = true; trailDust.noLight = true; trailDust.alpha = (int)Utils.Remap(Projectile.timeLeft, 30f, 0f, 127f, 0f); + + Lighting.AddLight(Projectile.Center, Color.White.ToVector3() * (IsShrapnel ? 0.3f : 1f)); } public override void OnSpawn(IEntitySource source) @@ -258,8 +260,7 @@ namespace CalamityMod.Projectiles.Ranged Color drawColor = IsShrapnel ? Projectile.GetAlpha(lightColor) : Color.Black; Vector2 origin = frame.Size() * 0.5f; - if (!IsShrapnel) - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor * 0.3f); Main.EntitySpriteDraw(texture, drawPosition, frame, drawColor, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None); diff --git a/Projectiles/Ranged/FlakToxicannonHoldout.cs b/Projectiles/Ranged/FlakToxicannonHoldout.cs new file mode 100644 index 0000000000..c75d8daa36 --- /dev/null +++ b/Projectiles/Ranged/FlakToxicannonHoldout.cs @@ -0,0 +1,246 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Particles; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.Localization; +using static CalamityMod.Items.Weapons.Ranged.FlakToxicannon; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Projectiles.Ranged +{ + public class FlakToxicannonHoldout : ModProjectile, ILocalizedModType + { + public override LocalizedText DisplayName => CalamityUtils.GetItemName(); + public override string Texture => "CalamityMod/Items/Weapons/Ranged/FlakToxicannon"; + + public Player Owner { get; set; } + public ref float ShootingTimer => ref Projectile.ai[0]; + public ref float TimerBetweenBursts => ref Projectile.ai[1]; + public ref float OffsetLengthScalar => ref Projectile.localAI[0]; + + // The type of dust used in the effects and the color of the particles that it'll use depending on the type of rocket used. + // It'll carry over to the projectiles that it shoots. + public static int DustEffectsID { get; set; } + public static Color EffectsColor { get; set; } + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 152; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.netImportant = true; + } + + public override void AI() + { + // If there's no player, or the player is the server, or the owner's stunned, there'll be no holdout. + bool cantUse = Owner == null || !Owner.active || Owner.dead || !Owner.channel || Main.myPlayer != Projectile.owner || Owner.CCed || Owner.noItems; + if (cantUse) + { + Projectile.Kill(); + return; + } + + // The center of the player, taking into account if they have a mount or not. + Vector2 mountedCenter = Owner.MountedCenter; + + // The vector between the player and the mouse. + Vector2 ownerToMouse = Owner.Calamity().mouseWorld - mountedCenter; + + // Deals with the holdout's rotation and direction, the owner's arms, etc. + ManageHoldout(mountedCenter, ownerToMouse); + + // If the timer reaches Item.useTime, it'll shoot. + // It'll shoot once immediately as the timer reaches. + if (ShootingTimer >= Owner.itemTimeMax) + { + // Every X frames it'll shoot a projectile. + if (ShootingTimer % TimeBetweenShots == 0f) + { + // We use the velocity of this projectile as its direction vector. + Vector2 direction = Projectile.velocity.SafeNormalize(Vector2.Zero); + + // The position of the tip of the gun. + Vector2 nuzzlePosition = Projectile.Center + direction * Projectile.width / 2f; + + // Every time we shoot we use ammo. + // With this method we also use the item's stats, like the shoot speed, or the type of ammo it was used. + Owner.PickAmmo(Owner.ActiveItem(), out _, out float itemShootSpeed, out int itemDamage, out float itemKnockback, out int rocketTypeShot); + + // Decides the color of the effects depending on the type of rocket used. + switch (rocketTypeShot) + { + case ItemID.WetRocket: + DustEffectsID = 45; + EffectsColor = Color.RoyalBlue; + break; + case ItemID.LavaRocket: + DustEffectsID = DustID.Torch; + EffectsColor = Color.Red; + break; + case ItemID.HoneyRocket: + DustEffectsID = DustID.Honey; + EffectsColor = Color.Yellow; + break; + default: + DustEffectsID = 298; + EffectsColor = Color.GreenYellow; + break; + } + + // Spawns the projectile. + Projectile.NewProjectileDirect( + Projectile.GetSource_FromThis(), + nuzzlePosition, + direction * itemShootSpeed, + ProjectileType(), + itemDamage, + itemKnockback, + Projectile.owner, + rocketTypeShot, + ownerToMouse.Length()); + + // Applies the knockback to the player. + Owner.velocity += ownerToMouse.SafeNormalize(Vector2.UnitY) * -OwnerKnockbackStrength; + + // Inside here go all the things that dedicated servers shouldn't spend resources on. + // Like visuals and sounds. + if (!Main.dedServ) + { + // By decreasing the offset length of the gun from the arms, we give an effect of recoil. + OffsetLengthScalar = 10f; + + Owner.Calamity().GeneralScreenShakePower = 2f; + + Particle shootPulse = new DirectionalPulseRing(nuzzlePosition, + Vector2.Zero, + Color.Gray * 0.7f, + new Vector2(0.5f, 1f), + Projectile.rotation, + 0.1f, + 0.4f, + 20); + GeneralParticleHandler.SpawnParticle(shootPulse); + + int smokeAmount = Main.rand.Next(8, 12 + 1); + for (int i = 0; i < smokeAmount; i++) + { + Particle smoke = new HeavySmokeParticle( + nuzzlePosition, + direction.RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(2f, 30f), + EffectsColor * 0.4f, + Main.rand.Next(45, 61), + Main.rand.NextFloat(.6f, 1.3f), + Main.rand.NextFloat(0.2f, 0.35f), + 0, + true); + GeneralParticleHandler.SpawnParticle(smoke); + } + + int dustAmount = Main.rand.Next(10, 15 + 1); + for (int i = 0; i < dustAmount; i++) + { + Dust shootDust = Dust.NewDustPerfect( + nuzzlePosition, + DustEffectsID, + direction.RotatedByRandom(MathHelper.PiOver4 * 0.5f) * Main.rand.NextFloat(2f, 12f), + Scale: Main.rand.NextFloat(0.8f, 1f)); + shootDust.fadeIn = 100f; + shootDust.noLight = false; + shootDust.noLightEmittence = false; + } + + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/FlakKrakenShoot") { Pitch = 0.65f, Volume = 0.5f }, nuzzlePosition); + } + + NetUpdate(); + } + + // When it has shot all the projectiles in the burst, reset all the variables and back to shooting. + if (ShootingTimer >= Owner.itemTimeMax + TimeBetweenShots * (ProjectilesPerBurst - 1)) + { + ShootingTimer = 0f; + TimerBetweenBursts = 0f; + NetUpdate(); + } + } + + // When we change the distance of the gun from the arms for the recoil, + // recover to the original position smoothly. + if (OffsetLengthScalar != 30f) + OffsetLengthScalar = MathHelper.Lerp(OffsetLengthScalar, 30f, 0.05f); + + ShootingTimer++; + } + + #region AI Methods + + public void ManageHoldout(Vector2 mountedCenter, Vector2 ownerToMouse) + { + Vector2 rotationVector = Projectile.rotation.ToRotationVector2(); + float velocityRotation = Projectile.velocity.ToRotation(); + float proximityLookingUpwards = Vector2.Dot(ownerToMouse.SafeNormalize(Vector2.Zero), -Vector2.UnitY); + int direction = MathF.Sign(ownerToMouse.X); + + Vector2 armPosition = Owner.RotatedRelativePoint(mountedCenter, true); + Vector2 lengthOffset = rotationVector * OffsetLengthScalar; + Vector2 armOffset = new Vector2(Utils.Remap(proximityLookingUpwards, -1f, 1f, 2f, -4f) * direction, -3f + Utils.Remap(MathF.Abs(proximityLookingUpwards), 0f, 1f, 0f, proximityLookingUpwards > 0f ? 10f : 5f)); + Projectile.Center = armPosition + lengthOffset + armOffset; + Projectile.velocity = velocityRotation.AngleTowards(ownerToMouse.ToRotation(), 0.2f).ToRotationVector2(); + Projectile.rotation = velocityRotation; + Projectile.timeLeft = 2; + + Owner.heldProj = Projectile.whoAmI; + Owner.itemTime = Owner.itemAnimation = 2; + Owner.itemRotation = (Projectile.velocity * Projectile.direction).ToRotation(); + + Projectile.spriteDirection = Projectile.direction = direction; + Owner.ChangeDir(direction); + + float armRotation = Projectile.rotation - MathHelper.PiOver2; // -Pi/2 because the arms rotation starts with arms pointing down. + Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.ThreeQuarters, armRotation); + Owner.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, armRotation); + } + + public void NetUpdate() + { + Projectile.netUpdate = true; + if (Projectile.netSpam >= 10) + Projectile.netSpam = 9; + } + + #endregion + + public override void OnSpawn(IEntitySource source) + { + Owner = Main.player[Projectile.owner]; + OffsetLengthScalar = 30f; + } + + // Because we use the velocity as a direction, we don't need it to change its position. + public override bool ShouldUpdatePosition() => false; + + public override bool? CanDamage() => false; + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = Request(Texture).Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Color drawColor = Projectile.GetAlpha(lightColor); + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = texture.Size() * 0.5f; + SpriteEffects flipSprite = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + Main.EntitySpriteDraw(texture, drawPosition, null, drawColor, drawRotation, rotationPoint, Projectile.scale, flipSprite); + + return false; + } + } +} diff --git a/Projectiles/Ranged/FlakToxicannonProjectile.cs b/Projectiles/Ranged/FlakToxicannonProjectile.cs new file mode 100644 index 0000000000..645b948e8a --- /dev/null +++ b/Projectiles/Ranged/FlakToxicannonProjectile.cs @@ -0,0 +1,267 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.IO; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using static CalamityMod.Items.Weapons.Ranged.FlakToxicannon; +using static CalamityMod.Projectiles.Ranged.FlakToxicannonHoldout; +using static Terraria.ModLoader.ModContent; +namespace CalamityMod.Projectiles.Ranged +{ + public class FlakToxicannonProjectile : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "CalamityMod/Projectiles/Enemy/FlakAcid"; + public ref float RocketID => ref Projectile.ai[0]; + public ref float DistanceOwnerMouse => ref Projectile.ai[1]; + public bool IsShrapnel + { + get => Projectile.ai[2] == 1f; + set => Projectile.ai[2] = value == true ? 1f : 0f; + } + public bool HasHitEnemyWithInitialShot; + + public Player Owner { get; set; } + + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 12; + } + + public override void SetDefaults() + { + Projectile.DamageType = DamageClass.Ranged; + Projectile.extraUpdates = 1; + Projectile.width = Projectile.height = 23; + Projectile.timeLeft = 600; + Projectile.localNPCHitCooldown = -1; + + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + } + + // Syncs other variables that can't fit into the Projectile.ai[] array. + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(HasHitEnemyWithInitialShot); + } + public override void ReceiveExtraAI(BinaryReader reader) + { + HasHitEnemyWithInitialShot = reader.ReadBoolean(); + } + + public override void AI() + { + // Enforces the gravity. + if (IsShrapnel) + { + if (Projectile.velocity.Y < 25f) + Projectile.velocity.Y += ProjectileGravityStrength; + } + // Scale for non Shrapnel + if (!IsShrapnel) + { + Projectile.scale = 1.3f; + Projectile.extraUpdates = 2; + } + + // Rotates towards its velocity. + Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; + + // If it's the initial shot and the shot has gone past the distance of the player and the mouse when shooting, + // split into shrapnel. + if (!IsShrapnel && !Projectile.WithinRange(Owner.MountedCenter, DistanceOwnerMouse)) + Projectile.Kill(); + + // Below here go all the things that dedicated servers shouldn't spend resources on. + // Like visuals and sounds. + if (Main.dedServ) + return; + + // The projectile will fade away as its time alive is ending. + Projectile.alpha = (int)Utils.Remap(Projectile.timeLeft, 30f, 0f, 0f, 255f); + + // Shrapnel trail + if (IsShrapnel) + { + if (Projectile.timeLeft % 2 == 0 && Projectile.timeLeft <= 590) + { + AltSparkParticle spark = new AltSparkParticle(Projectile.Center - Projectile.velocity * 1.5f, Projectile.velocity * 0.01f, false, 8, 1.3f, EffectsColor * 0.135f); + GeneralParticleHandler.SpawnParticle(spark); + } + } + else + { + Vector2 dustPos = Projectile.Center - Projectile.velocity * 3 + Main.rand.NextVector2Circular(12, 12); + Dust dust = Dust.NewDustPerfect(dustPos, Main.rand.NextBool(3) ? 299 : DustEffectsID); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(1.4f, 1.65f); + dust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.1f, 0.7f); + } + + Dust trailDust = Dust.NewDustDirect(Projectile.position, + Projectile.width, + Projectile.height, + Main.rand.NextBool(3) ? 299 : DustEffectsID, + Scale: Main.rand.NextFloat(0.5f, 0.8f), + Alpha: 127); + trailDust.noGravity = true; + trailDust.noLight = true; + trailDust.alpha = (int)Utils.Remap(Projectile.timeLeft, 30f, 0f, 127f, 0f); + + Lighting.AddLight(Projectile.Center, Color.GreenYellow.ToVector3() * (IsShrapnel ? 1.5f : 2.5f)); + } + + public override void OnSpawn(IEntitySource source) + { + Owner = Main.player[Projectile.owner]; + Projectile.scale = 1.5f; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(BuffType(), 180); + if (!IsShrapnel) + HasHitEnemyWithInitialShot = true; + } + + public override void OnHitPlayer(Player target, Player.HurtInfo info) + { + target.AddBuff(BuffType(), 180); + if (!IsShrapnel) + HasHitEnemyWithInitialShot = true; + } + + // The initial shot deals less damage. + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.SourceDamage *= IsShrapnel ? 1f : InitialShotDamageMultiplier; + public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers) => modifiers.SourceDamage *= IsShrapnel ? 1f : InitialShotDamageMultiplier; + + public override void OnKill(int timeLeft) + { + var info = new CalamityUtils.RocketBehaviorInfo((int)RocketID) + { + // Since we use our own spawning method for the cluster rockets, we don't need them to shoot anything, + // we'll do it ourselves. + clusterProjectileID = ProjectileID.None, + destructiveClusterProjectileID = ProjectileID.None, + }; + int blastRadius = Projectile.RocketBehavior(info); + Projectile.ExpandHitboxBy((float)blastRadius); + Projectile.Damage(); + + if (!IsShrapnel) + { + bool usedClusterRockets = RocketID == ItemID.ClusterRocketI || RocketID == ItemID.ClusterRocketII; + int flakAmount = usedClusterRockets ? ClusterShrapnelAmount : ShrapnelAmount; + for (int i = 0; i < flakAmount; i++) + { + Projectile shrapnel = Projectile.NewProjectileDirect( + Projectile.GetSource_FromThis(), + Projectile.Center, + Projectile.velocity.SafeNormalize(-Vector2.UnitY).RotatedByRandom(usedClusterRockets ? ClusterShrapnelAngleOffset : ShrapnelAngleOffset) * ProjectileShootSpeed * Main.rand.NextFloat(0.45f, 0.85f), + ProjectileType(), + (int)(Projectile.damage * (HasHitEnemyWithInitialShot ? InitialShotHitShrapnelDamageMultiplier : 1f)), + Projectile.knockBack, + Projectile.owner, + RocketID, + ai2: 1f); + + // Since the shrapnel and the initial shot are the same projectile, + // and we want to apply the damage penalty for hitting with the initial shot, + // all shrapnel will have this bool on and we'll apply the penalty here. + if (HasHitEnemyWithInitialShot) + shrapnel.ModProjectile().HasHitEnemyWithInitialShot = true; + } + } + + // Since we do our own spread for the cluster rockets, it won't explode tiles. + // So we do it manually here. + if (RocketID == ItemID.ClusterRocketII) + Projectile.ExplodeTiles(blastRadius, info.respectStandardBlastImmunity, info.tilesToCheck, info.wallsToCheck); + + // Inside here go all the things that dedicated servers shouldn't spend resources on. + // Like visuals and sounds. + if (Main.dedServ) + return; + + for (int i = 0; i < (IsShrapnel ? 4 : 12) ; ++i) + { + int sprayLifetime = Main.rand.Next(15, 20 + 1); + float sprayScale = Main.rand.NextFloat(0.6f, 0.8f); + Color sprayColor = Main.rand.NextBool(3) ? Color.Chartreuse : EffectsColor; + + if (Main.rand.NextBool(14)) + sprayScale *= 2f; + + float randomSpeedMultiplier = Main.rand.NextFloat(1.25f, 2.25f); + Vector2 sprayVelocity = Main.rand.NextVector2Unit() * 5 * randomSpeedMultiplier; + sprayVelocity.Y -= 5f; + BloodParticle spray = new BloodParticle(Projectile.Center, sprayVelocity, sprayLifetime, sprayScale, sprayColor); + GeneralParticleHandler.SpawnParticle(spray); + } + + // These effects will only run if the initial shot is splitting, + // or the shrapnel doesn't have the damage pentalty, so we don't have effect overload. + if (!IsShrapnel || (IsShrapnel && !HasHitEnemyWithInitialShot)) + { + int dustAmount = Main.rand.Next(14, 23 + 1); + for (int i = 0; i < dustAmount; i++) + { + Dust boomDust = Dust.NewDustPerfect(Projectile.Center, + Main.rand.NextBool(4) ? 299 : DustEffectsID, + Main.rand.NextVector2Circular(5f, 5f), + newColor: EffectsColor, + Scale: Main.rand.NextFloat(.8f, 1.2f)); + boomDust.noLight = true; + boomDust.noLightEmittence = true; + } + + Particle boomRing = new DirectionalPulseRing(Projectile.Center, + Vector2.Zero, + Color.White * 0.3f, + Vector2.One, + 0f, + Projectile.width / 1560f, + Projectile.width / 156f, + 20); + GeneralParticleHandler.SpawnParticle(boomRing); + + int mistAmount = Main.rand.Next(3, 5 + 1); + for (int mistIndex = 0; mistIndex < mistAmount; mistIndex++) + { + float angle = MathHelper.TwoPi / mistAmount * mistIndex; + Vector2 velocity = angle.ToRotationVector2() * Main.rand.NextFloat(2f, 7f); + Particle boomMist = new HeavySmokeParticle(Projectile.Center, + velocity, + EffectsColor * Main.rand.NextFloat(0.35f, 0.55f), + Main.rand.Next(45, 61), + Main.rand.NextFloat(.4f, 1.1f), + Main.rand.NextFloat(0.2f, 0.35f), + 0, + true); + + GeneralParticleHandler.SpawnParticle(boomMist); + } + } + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = IsShrapnel ? Request("CalamityMod/Projectiles/Environment/AcidDrop").Value : Request(Texture).Value; + + Color drawColor = Projectile.GetAlpha(lightColor); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], drawColor * 0.35f, 1, texture); + + return false; + } + } +} diff --git a/Projectiles/Ranged/ToxicannonDrop.cs b/Projectiles/Ranged/ToxicannonDrop.cs deleted file mode 100644 index c556ecd097..0000000000 --- a/Projectiles/Ranged/ToxicannonDrop.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Buffs.StatDebuffs; - -namespace CalamityMod.Projectiles.Ranged -{ - public class ToxicannonDrop : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Ranged"; - public override string Texture => "CalamityMod/Projectiles/Environment/AcidDrop"; - - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - } - - public override void SetDefaults() - { - Projectile.width = 14; - Projectile.height = 20; - Projectile.friendly = true; - Projectile.tileCollide = true; - Projectile.ignoreWater = false; - Projectile.timeLeft = 300; - Projectile.DamageType = DamageClass.Ranged; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 17; - } - - public override void AI() - { - NPC potentialTarget = Projectile.Center.ClosestNPCAt(600f, !Projectile.tileCollide); - if (potentialTarget is not null) - { - float flySpeed = Projectile.velocity.Length(); - if (flySpeed < 5f) - flySpeed = 5f; - - Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.SafeDirectionTo(potentialTarget.Center) * flySpeed, 0.085f); - } - - Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; - Projectile.tileCollide = Projectile.timeLeft <= 300; - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - // Water drip - for (int i = 0; i < 4; i++) - { - int idx = Dust.NewDust(Projectile.position - Projectile.velocity, 2, 2, 154, 0f, 0f, 0, new Color(112, 150, 42, 127), 1f); - Dust dust = Main.dust[idx]; - dust.position.X -= 2f; - Main.dust[idx].alpha = 38; - Main.dust[idx].velocity *= 0.1f; - Main.dust[idx].velocity -= Projectile.velocity * 0.025f; - Main.dust[idx].scale = 2f; - } - return true; - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 180); - } - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], new Color(255, 255, 255, 127), 2); - return false; - } - } -} diff --git a/Projectiles/Ranged/ToxicannonShot.cs b/Projectiles/Ranged/ToxicannonShot.cs deleted file mode 100644 index a62f58ed16..0000000000 --- a/Projectiles/Ranged/ToxicannonShot.cs +++ /dev/null @@ -1,90 +0,0 @@ -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Ranged -{ - public class ToxicannonShot : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Ranged"; - public override string Texture => "CalamityMod/Projectiles/Enemy/FlakAcid"; - - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - } - - public override void SetDefaults() - { - Projectile.width = 30; - Projectile.height = 50; - Projectile.friendly = true; - Projectile.timeLeft = 480; - Projectile.DamageType = DamageClass.Ranged; - Projectile.tileCollide = true; - Projectile.ignoreWater = false; - } - - public override void AI() - { - if (Projectile.ai[0]++ <= 30f) - { - Projectile.alpha = (int)MathHelper.Lerp(255f, 0f, Projectile.ai[0] / 30f); - } - if (Projectile.velocity.Y < 20f) - Projectile.velocity.Y += 0.3f; - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - - if (Math.Sign(Projectile.velocity.Y) != Math.Sign(Projectile.oldVelocity.Y) && Projectile.ai[0] >= 5f) - { - Projectile.Kill(); - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 240); - } - - public override void OnKill(int timeLeft) - { - Projectile.ExpandHitboxBy(180); - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.damage /= 2; - Projectile.Damage(); - for (int i = 0; i <= 40; i++) - { - int idx = Dust.NewDust(Projectile.position, 230, 230, (int)CalamityDusts.SulfurousSeaAcid, 0, 0, 0, default, 0.75f); - Main.dust[idx].noGravity = true; - Main.dust[idx].velocity = Vector2.One.RotatedByRandom(MathHelper.TwoPi) * (Main.dust[idx].position - Projectile.Center).Length() / 25f; - Main.dust[idx].scale = 2.5f; - } - for (int i = 0; i <= 90; i++) - { - int idx = Dust.NewDust(Projectile.Center, 0, 0, (int)CalamityDusts.SulfurousSeaAcid); - Main.dust[idx].velocity = Vector2.One.RotatedByRandom(MathHelper.TwoPi) * 12f; - Main.dust[idx].scale = 3f; - Main.dust[idx].noGravity = true; - } - float count = Main.rand.Next(1, 2 + 1); - for (int i = 0; i < count; i++) - { - float angle = MathHelper.TwoPi * i / count; - angle += Main.rand.NextFloat(0.1f, 0.35f) * Main.rand.NextBool().ToDirectionInt(); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, angle.ToRotationVector2() * Main.rand.NextFloat(4f, 16f), - ModContent.ProjectileType(), Projectile.damage, 2.5f, Projectile.owner); - } - } - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); - return false; - } - } -} From 14c034d0b7764afd5cc2742de2cbf27a9d99ac56 Mon Sep 17 00:00:00 2001 From: Memes Date: Mon, 29 Jan 2024 21:22:06 +0100 Subject: [PATCH 07/24] Flak Toxicannon tweaks & cleanup. 1. Made the holdout be held more naturally. 2. Clean-up code in the following files. 3. Made the holdout hitbox smaller. --- Items/Weapons/Ranged/FlakToxicannon.cs | 7 +++--- Projectiles/Ranged/FlakToxicannonHoldout.cs | 25 +++++++++---------- .../Ranged/FlakToxicannonProjectile.cs | 10 +++----- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/Items/Weapons/Ranged/FlakToxicannon.cs b/Items/Weapons/Ranged/FlakToxicannon.cs index 5e33173128..9d9ea0bc4f 100644 --- a/Items/Weapons/Ranged/FlakToxicannon.cs +++ b/Items/Weapons/Ranged/FlakToxicannon.cs @@ -1,16 +1,17 @@ -using Terraria.DataStructures; -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; namespace CalamityMod.Items.Weapons.Ranged { public class FlakToxicannon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + #region Other Stats public static float TimeBetweenShots = 1; public static float ProjectilesPerBurst = 1f; diff --git a/Projectiles/Ranged/FlakToxicannonHoldout.cs b/Projectiles/Ranged/FlakToxicannonHoldout.cs index c75d8daa36..189df48c84 100644 --- a/Projectiles/Ranged/FlakToxicannonHoldout.cs +++ b/Projectiles/Ranged/FlakToxicannonHoldout.cs @@ -1,15 +1,14 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Buffs.StatDebuffs; +using System; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Particles; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; +using Terraria; using Terraria.Audio; using Terraria.DataStructures; +using Terraria.ID; using Terraria.Localization; +using Terraria.ModLoader; using static CalamityMod.Items.Weapons.Ranged.FlakToxicannon; using static Terraria.ModLoader.ModContent; @@ -32,7 +31,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetDefaults() { - Projectile.width = Projectile.height = 152; + Projectile.width = Projectile.height = 88; Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.netImportant = true; @@ -115,7 +114,7 @@ namespace CalamityMod.Projectiles.Ranged if (!Main.dedServ) { // By decreasing the offset length of the gun from the arms, we give an effect of recoil. - OffsetLengthScalar = 10f; + OffsetLengthScalar = 25f; Owner.Calamity().GeneralScreenShakePower = 2f; @@ -174,8 +173,8 @@ namespace CalamityMod.Projectiles.Ranged // When we change the distance of the gun from the arms for the recoil, // recover to the original position smoothly. - if (OffsetLengthScalar != 30f) - OffsetLengthScalar = MathHelper.Lerp(OffsetLengthScalar, 30f, 0.05f); + if (OffsetLengthScalar != 38f) + OffsetLengthScalar = MathHelper.Lerp(OffsetLengthScalar, 38f, 0.1f); ShootingTimer++; } @@ -191,7 +190,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 armPosition = Owner.RotatedRelativePoint(mountedCenter, true); Vector2 lengthOffset = rotationVector * OffsetLengthScalar; - Vector2 armOffset = new Vector2(Utils.Remap(proximityLookingUpwards, -1f, 1f, 2f, -4f) * direction, -3f + Utils.Remap(MathF.Abs(proximityLookingUpwards), 0f, 1f, 0f, proximityLookingUpwards > 0f ? 10f : 5f)); + Vector2 armOffset = new Vector2(Utils.Remap(proximityLookingUpwards, -1f, 1f, 2f, -10f) * direction, -10f + Utils.Remap(MathF.Abs(proximityLookingUpwards), 0f, 1f, 0f, proximityLookingUpwards > 0f ? 10f : 5f)); Projectile.Center = armPosition + lengthOffset + armOffset; Projectile.velocity = velocityRotation.AngleTowards(ownerToMouse.ToRotation(), 0.2f).ToRotationVector2(); Projectile.rotation = velocityRotation; @@ -206,7 +205,7 @@ namespace CalamityMod.Projectiles.Ranged float armRotation = Projectile.rotation - MathHelper.PiOver2; // -Pi/2 because the arms rotation starts with arms pointing down. Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.ThreeQuarters, armRotation); - Owner.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, armRotation); + Owner.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, armRotation + MathHelper.ToRadians(25f) * direction); } public void NetUpdate() @@ -221,7 +220,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnSpawn(IEntitySource source) { Owner = Main.player[Projectile.owner]; - OffsetLengthScalar = 30f; + OffsetLengthScalar = 38f; } // Because we use the velocity as a direction, we don't need it to change its position. diff --git a/Projectiles/Ranged/FlakToxicannonProjectile.cs b/Projectiles/Ranged/FlakToxicannonProjectile.cs index 645b948e8a..37a3ccf413 100644 --- a/Projectiles/Ranged/FlakToxicannonProjectile.cs +++ b/Projectiles/Ranged/FlakToxicannonProjectile.cs @@ -1,11 +1,8 @@ -using CalamityMod.Buffs.DamageOverTime; +using System.IO; using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Dusts; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.IO; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -13,6 +10,7 @@ using Terraria.ModLoader; using static CalamityMod.Items.Weapons.Ranged.FlakToxicannon; using static CalamityMod.Projectiles.Ranged.FlakToxicannonHoldout; using static Terraria.ModLoader.ModContent; + namespace CalamityMod.Projectiles.Ranged { public class FlakToxicannonProjectile : ModProjectile, ILocalizedModType @@ -193,7 +191,7 @@ namespace CalamityMod.Projectiles.Ranged if (Main.dedServ) return; - for (int i = 0; i < (IsShrapnel ? 4 : 12) ; ++i) + for (int i = 0; i < (IsShrapnel ? 4 : 12); ++i) { int sprayLifetime = Main.rand.Next(15, 20 + 1); float sprayScale = Main.rand.NextFloat(0.6f, 0.8f); @@ -248,7 +246,7 @@ namespace CalamityMod.Projectiles.Ranged Main.rand.NextFloat(0.2f, 0.35f), 0, true); - + GeneralParticleHandler.SpawnParticle(boomMist); } } From bb028b8749c7c5d0de397c4bf3c6b7532a6d73c6 Mon Sep 17 00:00:00 2001 From: Memes Date: Tue, 30 Jan 2024 00:19:55 +0100 Subject: [PATCH 08/24] Flaks fire rate scales up, sorry Angel. --- Items/Weapons/Ranged/FlakKraken.cs | 4 +- Items/Weapons/Ranged/FlakToxicannon.cs | 3 - Projectiles/Ranged/FlakKrakenHoldout.cs | 8 +- Projectiles/Ranged/FlakToxicannonHoldout.cs | 201 ++++++++++---------- 4 files changed, 104 insertions(+), 112 deletions(-) diff --git a/Items/Weapons/Ranged/FlakKraken.cs b/Items/Weapons/Ranged/FlakKraken.cs index d71127cbb1..d09d54ee76 100644 --- a/Items/Weapons/Ranged/FlakKraken.cs +++ b/Items/Weapons/Ranged/FlakKraken.cs @@ -15,6 +15,8 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; #region Other Stats + public static int OriginalUseTime = 63; + public static float TimeBetweenShots = 21; public static float ProjectilesPerBurst = 2f; @@ -37,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.damage = 88; // Here you're modifying the shrapnel's damage. Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 63; + Item.useTime = Item.useAnimation = OriginalUseTime; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 15f; diff --git a/Items/Weapons/Ranged/FlakToxicannon.cs b/Items/Weapons/Ranged/FlakToxicannon.cs index 9d9ea0bc4f..d800625d29 100644 --- a/Items/Weapons/Ranged/FlakToxicannon.cs +++ b/Items/Weapons/Ranged/FlakToxicannon.cs @@ -13,9 +13,6 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; #region Other Stats - public static float TimeBetweenShots = 1; - public static float ProjectilesPerBurst = 1f; - public static float OwnerKnockbackStrength = 1.1f; public static float ProjectileGravityStrength = 0.17f; diff --git a/Projectiles/Ranged/FlakKrakenHoldout.cs b/Projectiles/Ranged/FlakKrakenHoldout.cs index 37b8122976..0d03696dd9 100644 --- a/Projectiles/Ranged/FlakKrakenHoldout.cs +++ b/Projectiles/Ranged/FlakKrakenHoldout.cs @@ -58,10 +58,12 @@ namespace CalamityMod.Projectiles.Ranged // If the timer reaches Item.useTime, it'll shoot. // It'll shoot once immediately as the timer reaches. - if (ShootingTimer >= Owner.itemTimeMax) + Item heldItem = Owner.ActiveItem(); + if (ShootingTimer >= heldItem.useAnimation) { + float adaptiveTimeBetweenShots = MathF.Floor(TimeBetweenShots * heldItem.useAnimation / OriginalUseTime); // Every X frames it'll shoot a projectile. - if (ShootingTimer % TimeBetweenShots == 0f) + if (ShootingTimer % adaptiveTimeBetweenShots == 0f) { // We use the velocity of this projectile as its direction vector. Vector2 direction = Projectile.velocity.SafeNormalize(Vector2.Zero); @@ -161,7 +163,7 @@ namespace CalamityMod.Projectiles.Ranged } // When it has shot all the projectiles in the burst, reset all the variables and back to shooting. - if (ShootingTimer >= Owner.itemTimeMax + TimeBetweenShots * (ProjectilesPerBurst - 1)) + if (ShootingTimer >= heldItem.useAnimation + adaptiveTimeBetweenShots * (ProjectilesPerBurst - 1)) { ShootingTimer = 0f; TimerBetweenBursts = 0f; diff --git a/Projectiles/Ranged/FlakToxicannonHoldout.cs b/Projectiles/Ranged/FlakToxicannonHoldout.cs index 189df48c84..ebd8691cca 100644 --- a/Projectiles/Ranged/FlakToxicannonHoldout.cs +++ b/Projectiles/Ranged/FlakToxicannonHoldout.cs @@ -58,117 +58,108 @@ namespace CalamityMod.Projectiles.Ranged // If the timer reaches Item.useTime, it'll shoot. // It'll shoot once immediately as the timer reaches. - if (ShootingTimer >= Owner.itemTimeMax) + Item heldItem = Owner.ActiveItem(); + if (ShootingTimer >= heldItem.useAnimation) { - // Every X frames it'll shoot a projectile. - if (ShootingTimer % TimeBetweenShots == 0f) + // We use the velocity of this projectile as its direction vector. + Vector2 direction = Projectile.velocity.SafeNormalize(Vector2.Zero); + + // The position of the tip of the gun. + Vector2 nuzzlePosition = Projectile.Center + direction * Projectile.width / 2f; + + // Every time we shoot we use ammo. + // With this method we also use the item's stats, like the shoot speed, or the type of ammo it was used. + Owner.PickAmmo(Owner.ActiveItem(), out _, out float itemShootSpeed, out int itemDamage, out float itemKnockback, out int rocketTypeShot); + + // Decides the color of the effects depending on the type of rocket used. + switch (rocketTypeShot) { - // We use the velocity of this projectile as its direction vector. - Vector2 direction = Projectile.velocity.SafeNormalize(Vector2.Zero); - - // The position of the tip of the gun. - Vector2 nuzzlePosition = Projectile.Center + direction * Projectile.width / 2f; - - // Every time we shoot we use ammo. - // With this method we also use the item's stats, like the shoot speed, or the type of ammo it was used. - Owner.PickAmmo(Owner.ActiveItem(), out _, out float itemShootSpeed, out int itemDamage, out float itemKnockback, out int rocketTypeShot); - - // Decides the color of the effects depending on the type of rocket used. - switch (rocketTypeShot) - { - case ItemID.WetRocket: - DustEffectsID = 45; - EffectsColor = Color.RoyalBlue; - break; - case ItemID.LavaRocket: - DustEffectsID = DustID.Torch; - EffectsColor = Color.Red; - break; - case ItemID.HoneyRocket: - DustEffectsID = DustID.Honey; - EffectsColor = Color.Yellow; - break; - default: - DustEffectsID = 298; - EffectsColor = Color.GreenYellow; - break; - } - - // Spawns the projectile. - Projectile.NewProjectileDirect( - Projectile.GetSource_FromThis(), - nuzzlePosition, - direction * itemShootSpeed, - ProjectileType(), - itemDamage, - itemKnockback, - Projectile.owner, - rocketTypeShot, - ownerToMouse.Length()); - - // Applies the knockback to the player. - Owner.velocity += ownerToMouse.SafeNormalize(Vector2.UnitY) * -OwnerKnockbackStrength; - - // Inside here go all the things that dedicated servers shouldn't spend resources on. - // Like visuals and sounds. - if (!Main.dedServ) - { - // By decreasing the offset length of the gun from the arms, we give an effect of recoil. - OffsetLengthScalar = 25f; - - Owner.Calamity().GeneralScreenShakePower = 2f; - - Particle shootPulse = new DirectionalPulseRing(nuzzlePosition, - Vector2.Zero, - Color.Gray * 0.7f, - new Vector2(0.5f, 1f), - Projectile.rotation, - 0.1f, - 0.4f, - 20); - GeneralParticleHandler.SpawnParticle(shootPulse); - - int smokeAmount = Main.rand.Next(8, 12 + 1); - for (int i = 0; i < smokeAmount; i++) - { - Particle smoke = new HeavySmokeParticle( - nuzzlePosition, - direction.RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(2f, 30f), - EffectsColor * 0.4f, - Main.rand.Next(45, 61), - Main.rand.NextFloat(.6f, 1.3f), - Main.rand.NextFloat(0.2f, 0.35f), - 0, - true); - GeneralParticleHandler.SpawnParticle(smoke); - } - - int dustAmount = Main.rand.Next(10, 15 + 1); - for (int i = 0; i < dustAmount; i++) - { - Dust shootDust = Dust.NewDustPerfect( - nuzzlePosition, - DustEffectsID, - direction.RotatedByRandom(MathHelper.PiOver4 * 0.5f) * Main.rand.NextFloat(2f, 12f), - Scale: Main.rand.NextFloat(0.8f, 1f)); - shootDust.fadeIn = 100f; - shootDust.noLight = false; - shootDust.noLightEmittence = false; - } - - SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/FlakKrakenShoot") { Pitch = 0.65f, Volume = 0.5f }, nuzzlePosition); - } - - NetUpdate(); + case ItemID.WetRocket: + DustEffectsID = 45; + EffectsColor = Color.RoyalBlue; + break; + case ItemID.LavaRocket: + DustEffectsID = DustID.Torch; + EffectsColor = Color.Red; + break; + case ItemID.HoneyRocket: + DustEffectsID = DustID.Honey; + EffectsColor = Color.Yellow; + break; + default: + DustEffectsID = 298; + EffectsColor = Color.GreenYellow; + break; } - // When it has shot all the projectiles in the burst, reset all the variables and back to shooting. - if (ShootingTimer >= Owner.itemTimeMax + TimeBetweenShots * (ProjectilesPerBurst - 1)) + // Spawns the projectile. + Projectile.NewProjectileDirect( + Projectile.GetSource_FromThis(), + nuzzlePosition, + direction * itemShootSpeed, + ProjectileType(), + itemDamage, + itemKnockback, + Projectile.owner, + rocketTypeShot, + ownerToMouse.Length()); + + // Applies the knockback to the player. + Owner.velocity += ownerToMouse.SafeNormalize(Vector2.UnitY) * -OwnerKnockbackStrength; + + // Inside here go all the things that dedicated servers shouldn't spend resources on. + // Like visuals and sounds. + if (!Main.dedServ) { - ShootingTimer = 0f; - TimerBetweenBursts = 0f; - NetUpdate(); + // By decreasing the offset length of the gun from the arms, we give an effect of recoil. + OffsetLengthScalar = 25f; + + Owner.Calamity().GeneralScreenShakePower = 2f; + + Particle shootPulse = new DirectionalPulseRing(nuzzlePosition, + Vector2.Zero, + Color.Gray * 0.7f, + new Vector2(0.5f, 1f), + Projectile.rotation, + 0.1f, + 0.4f, + 20); + GeneralParticleHandler.SpawnParticle(shootPulse); + + int smokeAmount = Main.rand.Next(8, 12 + 1); + for (int i = 0; i < smokeAmount; i++) + { + Particle smoke = new HeavySmokeParticle( + nuzzlePosition, + direction.RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(2f, 30f), + EffectsColor * 0.4f, + Main.rand.Next(45, 61), + Main.rand.NextFloat(.6f, 1.3f), + Main.rand.NextFloat(0.2f, 0.35f), + 0, + true); + GeneralParticleHandler.SpawnParticle(smoke); + } + + int dustAmount = Main.rand.Next(10, 15 + 1); + for (int i = 0; i < dustAmount; i++) + { + Dust shootDust = Dust.NewDustPerfect( + nuzzlePosition, + DustEffectsID, + direction.RotatedByRandom(MathHelper.PiOver4 * 0.5f) * Main.rand.NextFloat(2f, 12f), + Scale: Main.rand.NextFloat(0.8f, 1f)); + shootDust.fadeIn = 100f; + shootDust.noLight = false; + shootDust.noLightEmittence = false; + } + + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/FlakKrakenShoot") { Pitch = 0.65f, Volume = 0.5f }, nuzzlePosition); } + + ShootingTimer = 0f; + + NetUpdate(); } // When we change the distance of the gun from the arms for the recoil, From 5b3eacba9e7d946843676883bf993eb0ce4414c5 Mon Sep 17 00:00:00 2001 From: mochi-angel Date: Thu, 8 Feb 2024 17:05:58 -0800 Subject: [PATCH 09/24] Flak Kraken/Toxicannon Balance Remind me to give Deus a resist --- Items/Weapons/Ranged/FlakKraken.cs | 8 ++++---- Items/Weapons/Ranged/FlakToxicannon.cs | 6 +++--- Projectiles/Ranged/FlakKrakenProjectile.cs | 2 +- Projectiles/Ranged/FlakToxicannonProjectile.cs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Items/Weapons/Ranged/FlakKraken.cs b/Items/Weapons/Ranged/FlakKraken.cs index d09d54ee76..359ca1c820 100644 --- a/Items/Weapons/Ranged/FlakKraken.cs +++ b/Items/Weapons/Ranged/FlakKraken.cs @@ -25,10 +25,10 @@ namespace CalamityMod.Items.Weapons.Ranged public static float ProjectileGravityStrength = 0.22f; public static float ProjectileShootSpeed = 25f; - public static float InitialShotDamageMultiplier = 0.5f; - public static float InitialShotHitShrapnelDamageMultiplier = 0.75f; + public static float InitialShotDamageMultiplier = 0.4f; + public static float InitialShotHitShrapnelDamageMultiplier = 0.4f; - public static int ShrapnelAmount = 7; + public static int ShrapnelAmount = 5; public static float ShrapnelAngleOffset = MathHelper.PiOver4; public static int ClusterShrapnelAmount = 13; @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 88; // Here you're modifying the shrapnel's damage. + Item.damage = 128; // Here you're modifying the shrapnel's damage. Item.DamageType = DamageClass.Ranged; Item.useTime = Item.useAnimation = OriginalUseTime; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Ranged/FlakToxicannon.cs b/Items/Weapons/Ranged/FlakToxicannon.cs index d800625d29..1d2be9214f 100644 --- a/Items/Weapons/Ranged/FlakToxicannon.cs +++ b/Items/Weapons/Ranged/FlakToxicannon.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Items.Weapons.Ranged public static float ProjectileGravityStrength = 0.17f; public static float ProjectileShootSpeed = 25f; - public static float InitialShotDamageMultiplier = 0.5f; - public static float InitialShotHitShrapnelDamageMultiplier = 0.75f; + public static float InitialShotDamageMultiplier = .3f; + public static float InitialShotHitShrapnelDamageMultiplier = .3f; public static int ShrapnelAmount = 4; public static float ShrapnelAngleOffset = 0.11f; @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 66; // Here you're modifying the shrapnel's damage. + Item.damage = 73; // Here you're modifying the shrapnel's damage. Item.DamageType = DamageClass.Ranged; Item.useTime = Item.useAnimation = 44; Item.shoot = ModContent.ProjectileType(); diff --git a/Projectiles/Ranged/FlakKrakenProjectile.cs b/Projectiles/Ranged/FlakKrakenProjectile.cs index 4e63b3f1b1..1d343676ba 100644 --- a/Projectiles/Ranged/FlakKrakenProjectile.cs +++ b/Projectiles/Ranged/FlakKrakenProjectile.cs @@ -176,7 +176,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.Center, Projectile.velocity.SafeNormalize(-Vector2.UnitY).RotatedByRandom(usedClusterRockets ? ClusterShrapnelAngleOffset : ShrapnelAngleOffset) * ProjectileShootSpeed * Main.rand.NextFloat(0.45f, 0.85f), ProjectileType(), - (int)(Projectile.damage * (HasHitEnemyWithInitialShot ? InitialShotHitShrapnelDamageMultiplier : 1f)), + (int)(Projectile.damage * (HasHitEnemyWithInitialShot ? InitialShotHitShrapnelDamageMultiplier : .6f)), Projectile.knockBack, Projectile.owner, RocketID, diff --git a/Projectiles/Ranged/FlakToxicannonProjectile.cs b/Projectiles/Ranged/FlakToxicannonProjectile.cs index 37a3ccf413..c1df05015a 100644 --- a/Projectiles/Ranged/FlakToxicannonProjectile.cs +++ b/Projectiles/Ranged/FlakToxicannonProjectile.cs @@ -167,7 +167,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.Center, Projectile.velocity.SafeNormalize(-Vector2.UnitY).RotatedByRandom(usedClusterRockets ? ClusterShrapnelAngleOffset : ShrapnelAngleOffset) * ProjectileShootSpeed * Main.rand.NextFloat(0.45f, 0.85f), ProjectileType(), - (int)(Projectile.damage * (HasHitEnemyWithInitialShot ? InitialShotHitShrapnelDamageMultiplier : 1f)), + (int)(Projectile.damage * (HasHitEnemyWithInitialShot ? InitialShotHitShrapnelDamageMultiplier : .6f)), Projectile.knockBack, Projectile.owner, RocketID, From 2a04df7bf34055ca7ed781f764af28e26664a640 Mon Sep 17 00:00:00 2001 From: mochi-angel Date: Thu, 15 Feb 2024 16:37:59 -0800 Subject: [PATCH 10/24] Base damage is initial shot damage+balance --- Balancing/BalancingChangesManager.cs | 6 ++++++ Items/Weapons/Ranged/FlakKraken.cs | 8 ++++---- Items/Weapons/Ranged/FlakToxicannon.cs | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index 8701e6d028..4d403ee772 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -191,6 +191,9 @@ namespace CalamityMod.Balancing // 40% resist to Flying Dragon. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileID.DD2SquireSonicBoom)))); + // 30% resist to Flak Kraken. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + // 30% resist to Aurora Blazer. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); #endregion @@ -235,6 +238,9 @@ namespace CalamityMod.Balancing // 60% resist to Aurora Blazer. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.4f, ProjectileType())))); + // 55% resist to Flak Kraken. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.45f, ProjectileType())))); + // 50% resist to true melee. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(ResistTrueMelee(0.5f)))); diff --git a/Items/Weapons/Ranged/FlakKraken.cs b/Items/Weapons/Ranged/FlakKraken.cs index 359ca1c820..b52a5462b8 100644 --- a/Items/Weapons/Ranged/FlakKraken.cs +++ b/Items/Weapons/Ranged/FlakKraken.cs @@ -25,19 +25,19 @@ namespace CalamityMod.Items.Weapons.Ranged public static float ProjectileGravityStrength = 0.22f; public static float ProjectileShootSpeed = 25f; - public static float InitialShotDamageMultiplier = 0.4f; - public static float InitialShotHitShrapnelDamageMultiplier = 0.4f; + public static float InitialShotDamageMultiplier = 1f; + public static float InitialShotHitShrapnelDamageMultiplier = 0.3f; public static int ShrapnelAmount = 5; public static float ShrapnelAngleOffset = MathHelper.PiOver4; - public static int ClusterShrapnelAmount = 13; + public static int ClusterShrapnelAmount = 8; public static float ClusterShrapnelAngleOffset = MathHelper.PiOver2 + MathHelper.ToRadians(50f); #endregion public override void SetDefaults() { - Item.damage = 128; // Here you're modifying the shrapnel's damage. + Item.damage = 124; // Here you're modifying the shrapnel's damage. Item.DamageType = DamageClass.Ranged; Item.useTime = Item.useAnimation = OriginalUseTime; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Ranged/FlakToxicannon.cs b/Items/Weapons/Ranged/FlakToxicannon.cs index 1d2be9214f..8ebe60218b 100644 --- a/Items/Weapons/Ranged/FlakToxicannon.cs +++ b/Items/Weapons/Ranged/FlakToxicannon.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Items.Weapons.Ranged public static float ProjectileGravityStrength = 0.17f; public static float ProjectileShootSpeed = 25f; - public static float InitialShotDamageMultiplier = .3f; - public static float InitialShotHitShrapnelDamageMultiplier = .3f; + public static float InitialShotDamageMultiplier = 1f; + public static float InitialShotHitShrapnelDamageMultiplier = .2f; public static int ShrapnelAmount = 4; public static float ShrapnelAngleOffset = 0.11f; From d7166e40795566bacf5c0aadc115ebeae1d3ef41 Mon Sep 17 00:00:00 2001 From: Memes Date: Fri, 16 Feb 2024 07:32:02 +0100 Subject: [PATCH 11/24] Updated comment. --- Items/Weapons/Ranged/FlakKraken.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/FlakKraken.cs b/Items/Weapons/Ranged/FlakKraken.cs index b52a5462b8..b99f556d6c 100644 --- a/Items/Weapons/Ranged/FlakKraken.cs +++ b/Items/Weapons/Ranged/FlakKraken.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 124; // Here you're modifying the shrapnel's damage. + Item.damage = 124; Item.DamageType = DamageClass.Ranged; Item.useTime = Item.useAnimation = OriginalUseTime; Item.shoot = ModContent.ProjectileType(); From a0013bc3c22ddd1b74d1c8b734f71b84f13d1a15 Mon Sep 17 00:00:00 2001 From: Cameron Ewell Date: Sun, 18 Feb 2024 01:07:40 -0500 Subject: [PATCH 12/24] Improve Flak Kraken and Flak Toxicannon tooltips and display names --- .../Mods.CalamityMod.Items.Weapons.Ranged.hjson | 12 ++++++------ .../en-US/Mods.CalamityMod.Projectiles.Ranged.hjson | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 02265bbcbd..4d0ec0440b 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -487,9 +487,9 @@ FlakKraken: { DisplayName: Flak Kraken Tooltip: ''' - Fires a burst of two large shots that explode at the cursor - Large shots burst into a wide cone of ink shrapnel - Hitting enemies directly causes the large shots and their shrapnel to deal decreased damage + Fires pairs of abyssal flak shells that explode into wide cones of ink shrapnel + Abyssal flak shells burst when they reach the cursor's position + Direct hits with the flak shell will deal reduced shrapnel damage ''' } @@ -497,9 +497,9 @@ FlakToxicannon: { DisplayName: Flak Toxicannon Tooltip: ''' - Fires a large shot that explodes at the cursor - Large shots burst into a cone of irradiated shrapnel drops - Hitting enemies directly causes the large shot and its shrapnel to deal decreased damage + Fires a toxic shell that explodes into a cone of radioactive sludge + Toxic shells burst when they reach the cursor's position + Direct hits with the toxic shell will reduce the damage dealt by the sludge ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index 29f6ce4715..74021c823d 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -243,5 +243,5 @@ WaterSpout.DisplayName: Spout WulfrumScrapBullet.DisplayName: High Speed Scrap DragonsBreathFlames.DisplayName: Draconic Flames DragonsBreathMag.DisplayName: Dragons Breath Cartridge -FlakKrakenProjectile.DisplayName: Flak Kraken Projectile -FlakToxicannonProjectile.DisplayName: Flak Toxicannon Projectile +FlakKrakenProjectile.DisplayName: Flak Kraken +FlakToxicannonProjectile.DisplayName: Flak Toxicannon From 50c6eb598e81f0b223cd70b207c2e3fe1afd8bbc Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 18 Feb 2024 00:11:13 -0500 Subject: [PATCH 13/24] Beetle Scale Mail nerf is now done in IL --- Balancing/BalancingConstants.cs | 4 ++++ Buffs/CalamityGlobalBuff.cs | 12 ------------ ILEditing/BalancingILChanges.cs | 34 +++++++++++++++++++++++++++++++++ ILEditing/ILChangesLoading.cs | 3 +-- 4 files changed, 39 insertions(+), 14 deletions(-) diff --git a/Balancing/BalancingConstants.cs b/Balancing/BalancingConstants.cs index f23d2281f1..b9e1171b89 100644 --- a/Balancing/BalancingConstants.cs +++ b/Balancing/BalancingConstants.cs @@ -22,6 +22,10 @@ // Sharpening Station grants this much armor penetration to melee weapons. internal const float SharpeningStationArmorPenetration = 5f; + // Beetle Scale Mail stats + internal static readonly float BeetleScaleMailMeleeDamagePerBeetle = 0.1f; + internal static readonly float BeetleScaleMailMeleeSpeedPerBeetle = 0.05f; + // Dash cooldowns (in frames) internal const int UniversalDashCooldown = 30; internal const int UniversalShieldSlamCooldown = 30; diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index 18d1069634..dee552de5b 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -88,18 +88,6 @@ namespace CalamityMod.Buffs { player.GetDamage() -= 0.2f; } - else if (type == BuffID.BeetleMight1) - { - player.GetAttackSpeed() -= 0.05f; - } - else if (type == BuffID.BeetleMight2) - { - player.GetAttackSpeed() -= 0.1f; - } - else if (type == BuffID.BeetleMight3) - { - player.GetAttackSpeed() -= 0.15f; - } } public override void Update(int type, NPC npc, ref int buffIndex) diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index b2e14bc1a9..840fadf7ed 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -418,6 +418,40 @@ namespace CalamityMod.ILEditing } #endregion + #region Beetle Scale Mail (DPS chestplate) Nerf + private static void NerfBeetleScaleMail(ILContext il) + { + // Reduce melee speed from each Beetle in Beetle Scale Mail from +10% to +5%. + var cursor = new ILCursor(il); + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdcI4(BuffID.BeetleMight1))) + { + LogFailure("Beetle Scale Mail Nerf", "Could not locate the Beetle Might bff ID."); + return; + } + if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(0.1f))) // The amount of melee damage to grant. + { + LogFailure("Beetle Scale Mail Nerf", "Could not locate the amount of melee damage granted."); + return; + } + + // Replace the value entirely. + cursor.Remove(); + cursor.Emit(OpCodes.Ldc_R4, BalancingConstants.BeetleScaleMailMeleeDamagePerBeetle); + + cursor.GotoNext(); + + if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(0.1f))) // The amount of melee speed to grant. + { + LogFailure("Beetle Scale Mail Nerf", "Could not locate the amount of melee speed granted."); + return; + } + + // Replace the value entirely. + cursor.Remove(); + cursor.Emit(OpCodes.Ldc_R4, BalancingConstants.BeetleScaleMailMeleeSpeedPerBeetle); + } + #endregion + #region Remove Lunatic Cultist Homing Resist private static void RemoveLunaticCultistHomingResist(ILContext il) { diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index abd6038bb1..ff5801ed6e 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -1,8 +1,6 @@ using System; using System.Reflection; using CalamityMod.Graphics.Renderers.CalamityRenderers; -using CalamityMod.Items.Accessories; -using CalamityMod.Items.Armor.LunicCorps; using CalamityMod.Tiles.DraedonStructures; using CalamityMod.Tiles.FurnitureExo; using Terraria; @@ -98,6 +96,7 @@ namespace CalamityMod.ILEditing IL_Projectile.AI_001 += AdjustChlorophyteBullets; IL_Projectile.AI_099_2 += LimitTerrarianProjectiles; IL_Player.UpdateBuffs += NerfSharpeningStation; + IL_Player.UpdateBuffs += NerfBeetleScaleMail; // Movement speed balance IL_Player.UpdateJumpHeight += FixJumpHeightBoosts; From 0c3a817236762ec122d90d209c22868b7872100d Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 18 Feb 2024 00:31:14 -0500 Subject: [PATCH 14/24] Removed multiplicative DR from Beetle Shell and Solar Flare entirely. No compensation yet. --- CalPlayer/CalamityPlayerHitHurt.cs | 5 ----- ILEditing/BalancingILChanges.cs | 31 +++++++++++++++++++++++++++++- ILEditing/ILChangesLoading.cs | 1 + 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 2b4424f45b..de8bc259c6 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -1582,11 +1582,6 @@ namespace CalamityMod.CalPlayer if (enraged) // Demonshade Enrage increases incoming damage by 25%. damageMult += 0.25; - // Add 5% damage multiplier for each Beetle Shell beetle that is active, thus reducing the DR from 10% to 5% per stack. - // TODO -- Remove this when the new DR scaling system is implemented. - if (Player.beetleDefense && Player.beetleOrbs > 0) - damageMult += 0.05 * Player.beetleOrbs; - modifiers.SourceDamage *= (float)damageMult; #endregion diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index 840fadf7ed..2052260b08 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -421,7 +421,7 @@ namespace CalamityMod.ILEditing #region Beetle Scale Mail (DPS chestplate) Nerf private static void NerfBeetleScaleMail(ILContext il) { - // Reduce melee speed from each Beetle in Beetle Scale Mail from +10% to +5%. + // Adjust melee damage from the Beetle Might buff. var cursor = new ILCursor(il); if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdcI4(BuffID.BeetleMight1))) { @@ -440,6 +440,7 @@ namespace CalamityMod.ILEditing cursor.GotoNext(); + // Adjust melee speed from the Beetle Might buff. if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(0.1f))) // The amount of melee speed to grant. { LogFailure("Beetle Scale Mail Nerf", "Could not locate the amount of melee speed granted."); @@ -452,6 +453,34 @@ namespace CalamityMod.ILEditing } #endregion + #region Remove Melee Armor (Beetle Shell + Solar Flare) Multiplicative DR + private static void RemoveBeetleAndSolarFlareMultiplicativeDR(ILContext il) + { + // Remove the multiplicative DR from Solar Flare armor's Solar Shields + var cursor = new ILCursor(il); + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdfld("setSolar"))) + { + LogFailure("Melee Multiplicative DR Removal", "Could not locate the Solar Flare set bonus field."); + return; + } + + // AND with 0 (false) so that the Solar Flare set bonus is never considered to be active. This stops the multiplicative DR from applying. + cursor.Emit(OpCodes.Ldc_I4_0); + cursor.Emit(OpCodes.And); + + // Remove the multiplicative DR from Beetle Shell's beetles + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdfld("beetleDefense"))) + { + LogFailure("Melee Multiplicative DR Removal", "Could not locate the Beetle Shell set bonus field."); + return; + } + + // AND with 0 (false) so that the Beetle Shell set bonus is never considered to be active. This stops the multiplicative DR from applying. + cursor.Emit(OpCodes.Ldc_I4_0); + cursor.Emit(OpCodes.And); + } + #endregion + #region Remove Lunatic Cultist Homing Resist private static void RemoveLunaticCultistHomingResist(ILContext il) { diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index ff5801ed6e..306083a8e0 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -97,6 +97,7 @@ namespace CalamityMod.ILEditing IL_Projectile.AI_099_2 += LimitTerrarianProjectiles; IL_Player.UpdateBuffs += NerfSharpeningStation; IL_Player.UpdateBuffs += NerfBeetleScaleMail; + IL_Player.ApplyVanillaHurtEffectModifiers += RemoveBeetleAndSolarFlareMultiplicativeDR; // Movement speed balance IL_Player.UpdateJumpHeight += FixJumpHeightBoosts; From cbf128c6753f75e057ab77cd6c2b896787f4ceca Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 18 Feb 2024 00:36:02 -0500 Subject: [PATCH 15/24] reorganized balance constants because it is getting rather lengthy --- Balancing/BalancingConstants.cs | 114 +++++++++++++++++--------------- 1 file changed, 62 insertions(+), 52 deletions(-) diff --git a/Balancing/BalancingConstants.cs b/Balancing/BalancingConstants.cs index b9e1171b89..ccdcfef485 100644 --- a/Balancing/BalancingConstants.cs +++ b/Balancing/BalancingConstants.cs @@ -2,6 +2,7 @@ { public static class BalancingConstants { + #region Movement // When the relevant config is enabled: Gives the player a substantial +50% move speed boost at all times internal static readonly float DefaultMoveSpeedBoost = 0.5f; @@ -15,17 +16,9 @@ // Altered jump speed boost provided by Shiny Red Balloon via IL edit // This is a const because it replaces a hardcoded value in vanilla internal const float BalloonJumpSpeedBoost = 0.75f; + #endregion - // Altered default damage deviation - internal const int NewDefaultDamageVariationPercent = 5; - - // Sharpening Station grants this much armor penetration to melee weapons. - internal const float SharpeningStationArmorPenetration = 5f; - - // Beetle Scale Mail stats - internal static readonly float BeetleScaleMailMeleeDamagePerBeetle = 0.1f; - internal static readonly float BeetleScaleMailMeleeSpeedPerBeetle = 0.05f; - + #region Dashes and Dodges // Dash cooldowns (in frames) internal const int UniversalDashCooldown = 30; internal const int UniversalShieldSlamCooldown = 30; @@ -46,8 +39,23 @@ internal static readonly int MirrorDodgeCooldown = 5400; internal static readonly int DaedalusReflectCooldown = 5400; internal static readonly int EvolutionReflectCooldown = 5400; + #endregion - // Internal vanilla item damage variables + #region Damage + // Altered default damage deviation + internal const int NewDefaultDamageVariationPercent = 5; + + // Summoner cross class nerf + internal static readonly float SummonerCrossClassNerf = 0.75f; + + // Summon damage bonuses counting less towards "scales with your best class" + internal static readonly float SummonAllClassScalingFactor = 0.75f; + + // Minimum and maximum allowed attack speed ratios when using Calamity Global Item Tweaks + internal static readonly float MinimumAllowedAttackSpeed = 0.25f; + internal static readonly float MaximumAllowedAttackSpeed = 10f; + + // Internal vanilla whip damage variables internal static readonly float LeatherWhipTagDamageMultiplier = 1.08f; internal static readonly float SnapthornTagDamageMultiplier = 1.04f; internal static readonly float SpinalTapTagDamageMultiplier = 1.08f; @@ -57,10 +65,15 @@ internal static readonly float MorningStarTagDamageMultiplier = 1.11f; internal static readonly float KaleidoscopeTagDamageMultiplier = 1.12f; - // Summoner cross class nerf - internal static readonly float SummonerCrossClassNerf = 0.75f; + // Sharpening Station grants this much armor penetration to melee weapons. + internal const float SharpeningStationArmorPenetration = 5f; - // Rogue stealth + // Beetle Scale Mail stats + internal static readonly float BeetleScaleMailMeleeDamagePerBeetle = 0.1f; + internal static readonly float BeetleScaleMailMeleeSpeedPerBeetle = 0.05f; + #endregion + + #region Rogue Base Stats // If stealth is too weak, increase this number. If stealth is too strong, decrease this number. // This value is intentionally not readonly. public static double UniversalStealthStrikeDamageFactor = 0.42; @@ -71,37 +84,9 @@ internal static readonly float BaseStealthGenTime = 4f; // 4 seconds internal static readonly float MovingStealthGenRatio = 0.5f; + #endregion - // Rage - internal static readonly int DefaultRageDuration = CalamityUtils.SecondsToFrames(9); // Rage lasts 9 seconds by default. - internal static readonly int RageDurationPerBooster = CalamityUtils.SecondsToFrames(1); // Each booster is +1 second: 10, 11, 12. - internal static readonly int RageCombatDelayTime = CalamityUtils.SecondsToFrames(10); - internal static readonly int RageFadeTime = CalamityUtils.SecondsToFrames(30); - internal static readonly float DefaultRageDamageBoost = 0.35f; // +35% - - // Proximity Rage - // These variables should be used in general to classify "enemies" vs "non-enemies" as well. - // See NPCUtils.IsAnEnemy - internal const int TinyHealthThreshold = 5; - internal const int TinyDamageThreshold = 5; - // If an enemy has more health than this, they are considered an enemy even if they have 0 contact damage - internal const int NoContactDamageHealthThreshold = 3000; - internal const int UnreasonableHealthThreshold = 25000000; // 25 million - - // Adrenaline - internal static readonly float AdrenalineDamageBoost = 2f; // +200% - internal static readonly float AdrenalineDamagePerBooster = 0.15f; // +15% - internal static readonly float FullAdrenalineDR = 0.5f; // 50% - internal static readonly float AdrenalineDRPerBooster = 0.05f; // +5% per booster - - // Summon damage bonuses counting less towards "scales with your best class" - internal static readonly float SummonAllClassScalingFactor = 0.75f; - - // Minimum and maximum allowed attack speed ratios when using Calamity Global Item Tweaks - internal static readonly float MinimumAllowedAttackSpeed = 0.25f; - internal static readonly float MaximumAllowedAttackSpeed = 10f; - - // Defense Damage + #region Defense and Defense Damage internal const double DefaultDefenseDamageRatio = 0.3333; // Defense damage floor: PHM | HM | PML @@ -111,15 +96,40 @@ // Death Mode: 5 | 12 | 24 // Boss Rush: 25 internal static readonly int DefenseDamageFloor_NormalPHM = 3; - internal static readonly int DefenseDamageFloor_NormalHM = 8; + internal static readonly int DefenseDamageFloor_NormalHM = 8; internal static readonly int DefenseDamageFloor_NormalPML = 16; - internal static readonly int DefenseDamageFloor_RevPHM = 4; - internal static readonly int DefenseDamageFloor_RevHM = 10; - internal static readonly int DefenseDamageFloor_RevPML = 20; - internal static readonly int DefenseDamageFloor_DeathPHM = 5; - internal static readonly int DefenseDamageFloor_DeathHM = 12; - internal static readonly int DefenseDamageFloor_DeathPML = 24; - internal static readonly int DefenseDamageFloor_BossRush = 25; + internal static readonly int DefenseDamageFloor_RevPHM = 4; + internal static readonly int DefenseDamageFloor_RevHM = 10; + internal static readonly int DefenseDamageFloor_RevPML = 20; + internal static readonly int DefenseDamageFloor_DeathPHM = 5; + internal static readonly int DefenseDamageFloor_DeathHM = 12; + internal static readonly int DefenseDamageFloor_DeathPML = 24; + internal static readonly int DefenseDamageFloor_BossRush = 25; + #endregion + + #region Rage and Adrenaline (Rippers) + internal static readonly int DefaultRageDuration = CalamityUtils.SecondsToFrames(9); // Rage lasts 9 seconds by default. + internal static readonly int RageDurationPerBooster = CalamityUtils.SecondsToFrames(1); // Each booster is +1 second: 10, 11, 12. + internal static readonly int RageCombatDelayTime = CalamityUtils.SecondsToFrames(10); + internal static readonly int RageFadeTime = CalamityUtils.SecondsToFrames(30); + internal static readonly float DefaultRageDamageBoost = 0.35f; // +35% + + internal static readonly float AdrenalineDamageBoost = 2f; // +200% + internal static readonly float AdrenalineDamagePerBooster = 0.15f; // +15% + internal static readonly float FullAdrenalineDR = 0.5f; // 50% + internal static readonly float AdrenalineDRPerBooster = 0.05f; // +5% per booster + #endregion + + // TODO -- NPC classification is not done consistently with predictable thresholds. + // These variables should be used in general to classify "enemies" vs "non-enemies" as well. + // See NPCUtils.IsAnEnemy + #region NPC Classification + internal const int TinyHealthThreshold = 5; + internal const int TinyDamageThreshold = 5; + // If an enemy has more health than this, they are considered an enemy even if they have 0 contact damage + internal const int NoContactDamageHealthThreshold = 3000; + internal const int UnreasonableHealthThreshold = 25000000; // 25 million + #endregion // TODO -- Add all balance related constants here that don't belong in other files. // Review all constants and static readonlys in the entire mod to find things to add. From 0db55701734d5661006f88bfdfcea18a50d21035 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 18 Feb 2024 00:55:58 -0500 Subject: [PATCH 16/24] Solar Flare defensive effects are now balanced --- Balancing/BalancingConstants.cs | 6 ++++++ Buffs/CalamityGlobalBuff.cs | 20 ++++++++++++++++++-- CalPlayer/CalamityPlayer.cs | 1 - ILEditing/BalancingILChanges.cs | 3 --- Items/CalamityGlobalItem.cs | 15 +++++++-------- 5 files changed, 31 insertions(+), 14 deletions(-) diff --git a/Balancing/BalancingConstants.cs b/Balancing/BalancingConstants.cs index ccdcfef485..6bf401283d 100644 --- a/Balancing/BalancingConstants.cs +++ b/Balancing/BalancingConstants.cs @@ -87,6 +87,12 @@ #endregion #region Defense and Defense Damage + // Beetle Shell's multiplicative DR is removed by Calamity. In compensation, you get this much regular DR per beetle. + internal static readonly float BeetleShellDRPerBeetle = 0.1f; + + // Solar Flare Armor's multiplicative DR is removed by Calamity. In compensation, you get this much DR from having at least one solar shield up. + internal static readonly float SolarFlareShieldDR = 0.25f; + internal const double DefaultDefenseDamageRatio = 0.3333; // Defense damage floor: PHM | HM | PML diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index dee552de5b..7f146fa834 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -1,6 +1,6 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Balancing; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.NPCs; -using System.Text; using Terraria; using Terraria.ID; using Terraria.Localization; @@ -73,6 +73,22 @@ namespace CalamityMod.Buffs { player.endurance -= 0.1f; } + + // Beetle Shell DR is a full compensation, as the vanilla multiplicative DR is removed entirely. + else if (type >= BuffID.BeetleEndurance1 && type <= BuffID.BeetleEndurance3 && player.beetleDefense) + { + int orbsToGrant = player.beetleOrbs < 0 ? 0 : player.beetleOrbs; + if (orbsToGrant > 3) + orbsToGrant = 3; + player.endurance += BalancingConstants.BeetleShellDRPerBeetle * orbsToGrant; + } + + // Solar Flare DR is a full compensation, as the vanilla multiplicative DR is removed entirely. + else if (type >= BuffID.SolarShield1 && type <= BuffID.SolarShield3) + { + player.endurance += BalancingConstants.SolarFlareShieldDR; + } + else if (type >= BuffID.NebulaUpDmg1 && type <= BuffID.NebulaUpDmg3) { float nebulaDamage = 0.075f * player.nebulaLevelDamage; // 15% to 45% changed to 7.5% to 22.5% diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index e753b83d0a..60c957bfa6 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -30,7 +30,6 @@ using CalamityMod.Items.TreasureBags.MiscGrabBags; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.DraedonsArsenal; using CalamityMod.Items.Weapons.Melee; -using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs; diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index 2052260b08..45331a1813 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -1,9 +1,6 @@ using System; using CalamityMod.Balancing; using CalamityMod.Items.Accessories; -using CalamityMod.Items.Placeables.FurniturePlagued; -using CalamityMod.Items.Potions; -using CalamityMod.NPCs.DraedonLabThings; using Mono.Cecil.Cil; using MonoMod.Cil; using Terraria; diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index a069f3cf37..0403f43b50 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1,12 +1,12 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.Potions; +using System; +using System.IO; using CalamityMod.Buffs.StatBuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Enums; using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Placeables; -using CalamityMod.Items.Potions; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Summon; @@ -25,9 +25,6 @@ using CalamityMod.UI.CalamitasEnchants; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.IO; -using CalamityMod.Buffs.StatDebuffs; using Terraria; using Terraria.Audio; using Terraria.DataStructures; @@ -36,7 +33,6 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.IO; using Terraria.Utilities; -using CalamityMod.Items.Potions.Alcohol; namespace CalamityMod.Items { @@ -1036,7 +1032,10 @@ namespace CalamityMod.Items } else if (set == "SolarFlare") { - player.endurance *= 0.8928f; // Removes the base 12% DR + // Cancel out the base 12% DR + player.endurance -= 0.12f; + + // Solar Flare armor dash overrides modded dashes by default if (player.solarShields > 0) modPlayer.DashID = string.Empty; } From c06c8723a7ba9aad28531af7404d86559314987d Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sun, 18 Feb 2024 01:38:38 -0500 Subject: [PATCH 17/24] Two cleanup changes: * Remove Flak Kraken projectile from pierce resist exception list since it doesn't pierce * Fixed a typo in one of the IL edit log messages --- CalamityLists.cs | 1 - ILEditing/BalancingILChanges.cs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CalamityLists.cs b/CalamityLists.cs index d94587c944..51a03832ea 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -2111,7 +2111,6 @@ namespace CalamityMod ProjectileType(), ProjectileType(), ProjectileType(), - ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index 45331a1813..bae3728966 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -422,7 +422,7 @@ namespace CalamityMod.ILEditing var cursor = new ILCursor(il); if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdcI4(BuffID.BeetleMight1))) { - LogFailure("Beetle Scale Mail Nerf", "Could not locate the Beetle Might bff ID."); + LogFailure("Beetle Scale Mail Nerf", "Could not locate the Beetle Might buff ID."); return; } if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(0.1f))) // The amount of melee damage to grant. From 0e1293e962b03bf25c6fe728d19221513c83357b Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Sat, 17 Feb 2024 22:58:19 -0800 Subject: [PATCH 18/24] fixed Dark Master log warn thing --- Items/Weapons/Melee/TheDarkMaster.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Items/Weapons/Melee/TheDarkMaster.cs b/Items/Weapons/Melee/TheDarkMaster.cs index d12a03c7e0..bf66cfdbe6 100644 --- a/Items/Weapons/Melee/TheDarkMaster.cs +++ b/Items/Weapons/Melee/TheDarkMaster.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.Weapons.Melee public const float DamagePerHealth = 0.001f; // 0.1 damage per additional health. 100 health = 10% damage. public new string LocalizationCategory => "Items.Weapons.Melee"; - BloomRing ring; + [CloneByReference] + public BloomRing ring; public override void SetStaticDefaults() { From be94a2c7eed47b8166738daa4f31969ab3a05ead Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 18 Feb 2024 01:40:18 -0500 Subject: [PATCH 19/24] Starting stages of Nebula Armor nerf rewrite --- Balancing/BalancingConstants.cs | 13 +++++++- Buffs/CalamityGlobalBuff.cs | 5 --- CalPlayer/CalamityPlayer.cs | 1 - CalPlayer/CalamityPlayerLifeRegen.cs | 7 ++-- CalPlayer/CalamityPlayerMiscEffects.cs | 16 --------- ILEditing/BalancingILChanges.cs | 46 ++++++++++++++++++++++++++ ILEditing/ILChangesLoading.cs | 1 + 7 files changed, 62 insertions(+), 27 deletions(-) diff --git a/Balancing/BalancingConstants.cs b/Balancing/BalancingConstants.cs index 6bf401283d..453c8d97a6 100644 --- a/Balancing/BalancingConstants.cs +++ b/Balancing/BalancingConstants.cs @@ -71,6 +71,12 @@ // Beetle Scale Mail stats internal static readonly float BeetleScaleMailMeleeDamagePerBeetle = 0.1f; internal static readonly float BeetleScaleMailMeleeSpeedPerBeetle = 0.05f; + + // Nebula Armor Damage Booster + internal static readonly float NebulaDamagePerBooster = 0.075f; // 0.15f in vanilla + + // Nebula Armor Mana Booster + // nothing here yet #endregion #region Rogue Base Stats @@ -86,13 +92,18 @@ internal static readonly float MovingStealthGenRatio = 0.5f; #endregion - #region Defense and Defense Damage + #region Defense and Health // Beetle Shell's multiplicative DR is removed by Calamity. In compensation, you get this much regular DR per beetle. internal static readonly float BeetleShellDRPerBeetle = 0.1f; // Solar Flare Armor's multiplicative DR is removed by Calamity. In compensation, you get this much DR from having at least one solar shield up. internal static readonly float SolarFlareShieldDR = 0.25f; + // Nebula Armor Life Regen + internal static readonly int NebulaLifeRegenPerBooster = 4; // 6 in vanilla + #endregion + + #region Defense Damage internal const double DefaultDefenseDamageRatio = 0.3333; // Defense damage floor: PHM | HM | PML diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index 7f146fa834..3655744b56 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -89,11 +89,6 @@ namespace CalamityMod.Buffs player.endurance += BalancingConstants.SolarFlareShieldDR; } - else if (type >= BuffID.NebulaUpDmg1 && type <= BuffID.NebulaUpDmg3) - { - float nebulaDamage = 0.075f * player.nebulaLevelDamage; // 15% to 45% changed to 7.5% to 22.5% - player.GetDamage() -= nebulaDamage; - } else if (type == BuffID.Warmth) { player.buffImmune[ModContent.BuffType()] = true; diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 60c957bfa6..1068fcd645 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -191,7 +191,6 @@ namespace CalamityMod.CalPlayer public int StellarHammer = 0; public int GalaxyHammer = 0; public int hideOfDeusMeleeBoostTimer = 0; - public int nebulaManaNerfCounter = 0; public int alcoholPoisonLevel = 0; public int modStealthTimer; public int dashTimeMod; diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index b008ffc90f..93c241074e 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -264,6 +264,7 @@ namespace CalamityMod.CalPlayer if (alcoholPoisonLevel > (cirrusDress ? 5 : 3)) { + // Independently of Calamity's nerfs to Nebula life regen, it is disabled entirely by alcohol poisoning. Player.nebulaLevelLife = 0; if (Player.whoAmI == Main.myPlayer) @@ -535,6 +536,8 @@ namespace CalamityMod.CalPlayer // 3. Air drowning in the Abyss // + // All forms of overtly disabling life regeneration disable Nebula Life boosters as well. + if (noLifeRegen) { Player.nebulaLevelLife = 0; @@ -646,10 +649,6 @@ namespace CalamityMod.CalPlayer if (trinketOfChi || chiRegen) Player.lifeRegen += 2; - // Nebula armor life booster nerf - if (Player.nebulaLevelLife > 0) - Player.lifeRegen -= 2 * Player.nebulaLevelLife; - if (ursaSergeant) { if (Player.statLife <= (int)(actualMaxLife * 0.15)) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 6910c86ca8..824c8edc1d 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -901,22 +901,6 @@ namespace CalamityMod.CalPlayer float lifeStealCooldown = BossRushEvent.BossRushActive ? 0.3f : CalamityWorld.death ? 0.25f : CalamityWorld.revenge ? 0.2f : Main.expertMode ? 0.15f : 0.1f; Player.lifeSteal -= lifeStealCooldown; - // Nebula Armor nerf - if (Player.nebulaLevelMana > 0 && Player.statMana < Player.statManaMax2) - { - int num = 12; - nebulaManaNerfCounter += Player.nebulaLevelMana; - if (nebulaManaNerfCounter >= num) - { - nebulaManaNerfCounter -= num; - Player.statMana--; - if (Player.statMana < 0) - Player.statMana = 0; - } - } - else - nebulaManaNerfCounter = 0; - // Bool for drawing boss health bar small text or not if (Main.myPlayer == Player.whoAmI) BossHealthBarManager.CanDrawExtraSmallText = shouldDrawSmallText; diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index bae3728966..a84a2f2297 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -450,6 +450,52 @@ namespace CalamityMod.ILEditing } #endregion + #region Nebula Armor Nerfs + private static void NerfNebulaArmorBaseLifeRegenAndDamage(ILContext il) + { + // Nebula's buffs are processed in the order Mana, Life, Damage + // The mana buff is merely tracked and updated in this function, so it is not IL edited here. + var cursor = new ILCursor(il); + + // Adjust life regen from the Nebula Life Boosters. + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdcI4(BuffID.NebulaUpLife1))) + { + LogFailure("Nebula Armor Nerf", "Could not locate the Nebula Life buff ID."); + return; + } + if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdfld("lifeRegen"))) + { + LogFailure("Nebula Armor Nerf", "Could not locate the player's life regen being loaded."); + return; + } + if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcI4(6))) + { + LogFailure("Nebula Armor Nerf", "Could not locate the amount of life regen to grant."); + return; + } + + // Replace the constant "load 6" opcode with a regular integer load with Calamity's value. + cursor.Remove(); + cursor.Emit(OpCodes.Ldc_I4, BalancingConstants.NebulaLifeRegenPerBooster); + + // Adjust damage from Nebula Damage Boosters. + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdcI4(BuffID.NebulaUpDmg1))) + { + LogFailure("Nebula Armor Nerf", "Could not locate the Nebula Damage buff ID."); + return; + } + if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(0.15f))) + { + LogFailure("Nebula Armor Nerf", "Could not locate the amount of damage to grant."); + return; + } + + // Replace the value entirely. + cursor.Remove(); + cursor.Emit(OpCodes.Ldc_R4, BalancingConstants.NebulaDamagePerBooster); + } + #endregion + #region Remove Melee Armor (Beetle Shell + Solar Flare) Multiplicative DR private static void RemoveBeetleAndSolarFlareMultiplicativeDR(ILContext il) { diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 306083a8e0..a04e45928b 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -97,6 +97,7 @@ namespace CalamityMod.ILEditing IL_Projectile.AI_099_2 += LimitTerrarianProjectiles; IL_Player.UpdateBuffs += NerfSharpeningStation; IL_Player.UpdateBuffs += NerfBeetleScaleMail; + IL_Player.UpdateBuffs += NerfNebulaArmorBaseLifeRegenAndDamage; IL_Player.ApplyVanillaHurtEffectModifiers += RemoveBeetleAndSolarFlareMultiplicativeDR; // Movement speed balance From 0be7ebd63281d6c8777360114448cbe9bf63bd3b Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 18 Feb 2024 01:43:40 -0500 Subject: [PATCH 20/24] Fix IL to not mutilate labels --- ILEditing/BalancingILChanges.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index a84a2f2297..3629cc90e5 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -484,15 +484,14 @@ namespace CalamityMod.ILEditing LogFailure("Nebula Armor Nerf", "Could not locate the Nebula Damage buff ID."); return; } - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(0.15f))) + if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdcR4(0.15f))) { LogFailure("Nebula Armor Nerf", "Could not locate the amount of damage to grant."); return; } - // Replace the value entirely. - cursor.Remove(); - cursor.Emit(OpCodes.Ldc_R4, BalancingConstants.NebulaDamagePerBooster); + // There are multiple branches pointing to this instruction, so it cannot be removed. Instead, swap its value directly. + cursor.Next.Operand = BalancingConstants.NebulaDamagePerBooster; } #endregion From 1c7f26d98ed6e38fd6f49be509377390c2d93119 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 18 Feb 2024 01:51:41 -0500 Subject: [PATCH 21/24] Nebula Life Boosters no longer make you immune to all DoT damage --- ILEditing/BalancingILChanges.cs | 16 ++++++++++++++++ ILEditing/ILChangesLoading.cs | 1 + 2 files changed, 17 insertions(+) diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index 3629cc90e5..6b8ee28786 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -493,6 +493,22 @@ namespace CalamityMod.ILEditing // There are multiple branches pointing to this instruction, so it cannot be removed. Instead, swap its value directly. cursor.Next.Operand = BalancingConstants.NebulaDamagePerBooster; } + + private static void RemoveNebulaLifeBoosterDoTImmunity(ILContext il) + { + // Prevent Nebula Life Boosters from canceling out all DoT debuff damage. + var cursor = new ILCursor(il); + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdfld("nebulaLevelLife"))) + { + LogFailure("Nebula Armor DoT Ignoring Nerf", "Could not locate the Nebula Armor Life Booster variable."); + return; + } + + // Pop this value off the stack and replace it with a zero. + // Zero will never be greater than zero, so negative life regen will never be canceled out. + cursor.Emit(OpCodes.Pop); + cursor.Emit(OpCodes.Ldc_I4_0); + } #endregion #region Remove Melee Armor (Beetle Shell + Solar Flare) Multiplicative DR diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index a04e45928b..5f32c45ebc 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -109,6 +109,7 @@ namespace CalamityMod.ILEditing // Life regen balance IL_Player.UpdateLifeRegen += PreventWellFedFromBeingRequiredInExpertModeForFullLifeRegen; + IL_Player.UpdateLifeRegen += RemoveNebulaLifeBoosterDoTImmunity; // Mana regen balance IL_Player.Update += ManaRegenDelayAdjustment; From afeb293706c9bb9b4ca5be876a3671d4a366df45 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 18 Feb 2024 02:05:34 -0500 Subject: [PATCH 22/24] Nebula armor mana boosters are now controlled by balance constants. Halved mana regen. --- Balancing/BalancingConstants.cs | 14 +++++++++++++- ILEditing/BalancingILChanges.cs | 18 ++++++++++++++++++ ILEditing/ILChangesLoading.cs | 1 + 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/Balancing/BalancingConstants.cs b/Balancing/BalancingConstants.cs index 453c8d97a6..ebdce6c769 100644 --- a/Balancing/BalancingConstants.cs +++ b/Balancing/BalancingConstants.cs @@ -92,7 +92,7 @@ internal static readonly float MovingStealthGenRatio = 0.5f; #endregion - #region Defense and Health + #region Defense, Health and Mana (Armor set stuff) // Beetle Shell's multiplicative DR is removed by Calamity. In compensation, you get this much regular DR per beetle. internal static readonly float BeetleShellDRPerBeetle = 0.1f; @@ -101,6 +101,18 @@ // Nebula Armor Life Regen internal static readonly int NebulaLifeRegenPerBooster = 4; // 6 in vanilla + + // Nebula Armor Mana Regen + // This value works differently than you might expect. Raising it actually nerfs the mana regeneration of Nebula Armor + // Every frame, Terraria adds 1 to a counter for each Mana Booster the player has. + // If this counter reaches the below threshold, that player gains 1 mana. + // By default, it's 6, which has the following effects: + // 1 booster = +1 mana every 6 frames = +10 mana per second + // 2 boosters = +1 mana every 3 frames = +20 mana per second + // 3 boosters = +1 mana every 2 frames = +30 mana per second + // + // Calamity just halves this, that's probably good enough. + internal static readonly int NebulaManaRegenFrameCounterThreshold = 12; // 6 in vanilla #endregion #region Defense Damage diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index 6b8ee28786..2582d40c30 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -509,6 +509,24 @@ namespace CalamityMod.ILEditing cursor.Emit(OpCodes.Pop); cursor.Emit(OpCodes.Ldc_I4_0); } + + private static void NerfNebulaArmorManaRegen(ILContext il) + { + // Reduce Nebula armor mana regen. + // The regen is controlled by a frame counter threshold right at the top of the function, typically 6. + // 1 value is added to the counter for every Mana Booster you have. + // If the value reaches the threshold, you gain 1 mana. + // All that needs to be done is raising the threshold, so it takes more frames to get each point of mana. + var cursor = new ILCursor(il); + if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdcI4(6))) + { + LogFailure("Nebula Armor Mana Regen Nerf", "Could not locate the Nebula Armor mana regeneration frame counter threshold."); + return; + } + + // Swap the threshold with Calamity's value. + cursor.Next.Operand = BalancingConstants.NebulaManaRegenFrameCounterThreshold; + } #endregion #region Remove Melee Armor (Beetle Shell + Solar Flare) Multiplicative DR diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 5f32c45ebc..cf53fdf790 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -114,6 +114,7 @@ namespace CalamityMod.ILEditing // Mana regen balance IL_Player.Update += ManaRegenDelayAdjustment; IL_Player.UpdateManaRegen += ManaRegenAdjustment; + IL_Player.UpdateManaRegen += NerfNebulaArmorManaRegen; // Debuff balancing IL_Projectile.StatusPlayer += RemoveFrozenInflictionFromDeerclopsIceSpikes; From f214f4d1233f9f211b4b70fb7986235e91ff80be Mon Sep 17 00:00:00 2001 From: Memes Date: Sun, 18 Feb 2024 15:54:41 +0100 Subject: [PATCH 23/24] Standarized Holdout conditions. --- .../DraedonsArsenal/GatlingLaserProj.cs | 6 ++-- .../DraedonsArsenal/PhaseslayerProjectile.cs | 2 +- Projectiles/Magic/AetherfluxCannonHoldout.cs | 3 +- Projectiles/Magic/BlushieStaffProj.cs | 3 +- Projectiles/Magic/DarkSparkPrism.cs | 3 +- Projectiles/Magic/EternityBook.cs | 6 ++-- Projectiles/Magic/GhastlyVisageProj.cs | 2 +- Projectiles/Magic/HadalUrnHoldout.cs | 2 +- Projectiles/Magic/HeresyProj.cs | 6 ++-- Projectiles/Magic/NanoPurgeHoldout.cs | 3 +- Projectiles/Magic/NebulousCataclysm_Held.cs | 2 +- .../Magic/RainbowPartyCannonProjectile.cs | 7 ++-- Projectiles/Magic/Snowflake.cs | 2 +- Projectiles/Magic/YharimsCrystalPrism.cs | 2 +- .../Melee/ArkOfTheCosmos_SwungBlade.cs | 36 +++++++++---------- .../Melee/ArkOfTheElements_SwungBlade.cs | 2 +- .../Melee/BrokenBiomeBlade_AridGrandeur.cs | 6 +--- Projectiles/Melee/ChronomancersScytheSwing.cs | 2 +- Projectiles/Melee/DeathsAscensionSwing.cs | 2 +- Projectiles/Melee/DevilsSunriseProj.cs | 2 +- Projectiles/Melee/Galaxia_AndromedasStride.cs | 20 +++++------ Projectiles/Melee/Galaxia_AriesWrath.cs | 13 ++++--- Projectiles/Melee/Galaxia_PhoenixsPride.cs | 15 ++++---- Projectiles/Melee/Galaxia_PolarisGaze.cs | 17 ++++----- Projectiles/Melee/MarniteDeconstructorProj.cs | 14 ++++---- Projectiles/Melee/MarniteObliteratorProj.cs | 2 +- .../MendedBiomeBlade_ExtantAbhorrence.cs | 30 +++++++--------- .../Melee/MendedBiomeBlade_HeavensMight.cs | 17 +++++---- .../MendedBiomeBlade_TrueAridGrandeur.cs | 3 +- Projectiles/Melee/MurasamaSlash.cs | 2 +- Projectiles/Melee/OmnibladeSwing.cs | 2 +- Projectiles/Melee/PhotonRipperProjectile.cs | 2 +- Projectiles/Melee/Spears/StreamGougeProj.cs | 3 +- .../Melee/SpineOfThanatosProjectile.cs | 2 +- Projectiles/Melee/StygianShieldAttack.cs | 2 +- ...TrueBiomeBlade_LamentationsOfTheChained.cs | 6 +--- .../Melee/TrueBiomeBlade_MercurialTides.cs | 6 +--- .../Melee/TrueBiomeBlade_SanguineFury.cs | 7 +--- .../Melee/TrueBiomeBlade_SwordsmithsPride.cs | 3 +- Projectiles/Ranged/ArcNovaDiffuserHoldout.cs | 6 ++-- Projectiles/Ranged/ButcherGun.cs | 6 ++-- Projectiles/Ranged/ChickenCannonHeld.cs | 2 +- Projectiles/Ranged/ClockworkBowHoldout.cs | 4 +-- Projectiles/Ranged/CondemnationHoldout.cs | 3 +- Projectiles/Ranged/ContagionBow.cs | 3 +- Projectiles/Ranged/DaemonsFlameBow.cs | 2 +- Projectiles/Ranged/DrataliornusBow.cs | 2 +- .../Ranged/ElementalEruptionHouldout.cs | 12 ++----- Projectiles/Ranged/FlakKrakenHoldout.cs | 4 +-- Projectiles/Ranged/FlakToxicannonHoldout.cs | 4 +-- .../Ranged/FlurrystormCannonShooting.cs | 2 +- Projectiles/Ranged/FreedomStarHoldout.cs | 6 ++-- Projectiles/Ranged/KingsbaneHoldout.cs | 20 +++++------ Projectiles/Ranged/MaelstromHoldout.cs | 5 +-- Projectiles/Ranged/MagnaCannonHoldout.cs | 6 ++-- Projectiles/Ranged/MineralMortarHoldout.cs | 6 ++-- Projectiles/Ranged/NorfleetCannon.cs | 2 +- Projectiles/Ranged/OpalStrikerHoldout.cs | 5 ++- Projectiles/Ranged/PhangasmBow.cs | 2 +- Projectiles/Ranged/PumplerHoldout.cs | 3 +- Projectiles/Ranged/ScorpioHoldout.cs | 3 +- Projectiles/Ranged/SevensStrikerHoldout.cs | 2 +- Projectiles/Ranged/StarfleetMK2Gun.cs | 2 +- Projectiles/Ranged/StarmageddonHeld.cs | 5 ++- Projectiles/Ranged/SurgeDriverHoldout.cs | 11 +++--- .../Ranged/TerraFlamebursterHouldout.cs | 12 ++----- Projectiles/Ranged/UltimaBowProjectile.cs | 7 ++-- Projectiles/Rogue/FinalDawnProjectile.cs | 2 +- Projectiles/Typeless/TerminusHoldout.cs | 2 +- Utilities/PlayerUtils.cs | 13 +++++-- 70 files changed, 179 insertions(+), 250 deletions(-) diff --git a/Projectiles/DraedonsArsenal/GatlingLaserProj.cs b/Projectiles/DraedonsArsenal/GatlingLaserProj.cs index f6b0fe0b94..166d444d77 100644 --- a/Projectiles/DraedonsArsenal/GatlingLaserProj.cs +++ b/Projectiles/DraedonsArsenal/GatlingLaserProj.cs @@ -1,8 +1,8 @@ -using CalamityMod.Items; +using System; +using CalamityMod.Items; using CalamityMod.Items.Weapons.DraedonsArsenal; using Microsoft.Xna.Framework; using ReLogic.Utilities; -using System; using Terraria; using Terraria.Audio; using Terraria.Localization; @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal // This grabs the weapon's current damage, taking current charge level into account. int currentDamage = player.GetWeaponDamage(gatling); - bool stillInUse = player.channel && !player.noItems && !player.CCed; + bool stillInUse = !player.CantUseHoldout(); // This both checks if the player has sufficient mana and consumes it if they do. // If this is false, the Gatling Laser stops functioning. diff --git a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs index 972f61dcda..eb565f44ce 100644 --- a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs +++ b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs @@ -129,7 +129,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal // In addition to typical channel cancellation criteria, the sword fizzles out if it runs out of charge. Item playerItem = player.ActiveItem(); bool hasCharge = modItem.Charge > 0f; - if (player.channel && !player.noItems && !player.CCed && playerItem.type == ModContent.ItemType() && hasCharge) + if (!player.CantUseHoldout() && playerItem.type == ModContent.ItemType() && hasCharge) { // The distance ratio ranges from 0 (your mouse is directly on the player) to 1 (your mouse is at the max range considered, or any further distance). float mouseDistance = Projectile.Distance(Main.MouseWorld); diff --git a/Projectiles/Magic/AetherfluxCannonHoldout.cs b/Projectiles/Magic/AetherfluxCannonHoldout.cs index 1b544e3520..9b0da4e2de 100644 --- a/Projectiles/Magic/AetherfluxCannonHoldout.cs +++ b/Projectiles/Magic/AetherfluxCannonHoldout.cs @@ -14,7 +14,6 @@ namespace CalamityMod.Projectiles.Magic private const int FramesPerFireRateIncrease = 36; private Player Owner => Main.player[Projectile.owner]; - private bool OwnerCanShoot => Owner.channel && Owner.HasAmmo(Owner.ActiveItem()) && !Owner.noItems && !Owner.CCed; private ref float DeployedFrames => ref Projectile.ai[0]; private ref float AnimationRate => ref Projectile.ai[1]; @@ -43,7 +42,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 gunBarrelPos = armPosition + Projectile.velocity * Projectile.height * 0.4f; // If the player is unable to continue using the holdout, delete it. - if (!OwnerCanShoot) + if (Owner.CantUseHoldout() || !Owner.HasAmmo(Owner.ActiveItem())) { Projectile.Kill(); return; diff --git a/Projectiles/Magic/BlushieStaffProj.cs b/Projectiles/Magic/BlushieStaffProj.cs index 4df959828f..98e2af8c09 100644 --- a/Projectiles/Magic/BlushieStaffProj.cs +++ b/Projectiles/Magic/BlushieStaffProj.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using rail; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -29,7 +30,7 @@ namespace CalamityMod.Projectiles.Magic Player player = Main.player[Projectile.owner]; if (Main.myPlayer == Projectile.owner) { - if (!player.channel || player.noItems || player.CCed || Projectile.ai[0] > 3600f) + if (player.CantUseHoldout() || Projectile.ai[0] > 3600f) { Projectile.Kill(); } diff --git a/Projectiles/Magic/DarkSparkPrism.cs b/Projectiles/Magic/DarkSparkPrism.cs index 47c4b5985e..a25156ec02 100644 --- a/Projectiles/Magic/DarkSparkPrism.cs +++ b/Projectiles/Magic/DarkSparkPrism.cs @@ -126,8 +126,7 @@ namespace CalamityMod.Projectiles.Magic if (shouldHitChargedUp && Main.myPlayer == Projectile.owner) { bool hasMana = !shouldHitNotCharged || player.CheckMana(player.ActiveItem(), -1, true, false); - bool canUseItem = player.channel && hasMana && !player.noItems && !player.CCed; - if (canUseItem) + if (!player.CantUseHoldout() && hasMana) { if (Projectile.ai[0] == 1f) { diff --git a/Projectiles/Magic/EternityBook.cs b/Projectiles/Magic/EternityBook.cs index d85f9649f2..a2b8f21950 100644 --- a/Projectiles/Magic/EternityBook.cs +++ b/Projectiles/Magic/EternityBook.cs @@ -1,7 +1,7 @@ -using CalamityMod.Items.Weapons.Magic; +using System; +using CalamityMod.Items.Weapons.Magic; using CalamityMod.NPCs.Providence; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.Audio; using Terraria.Localization; @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Magic Player player = Main.player[Projectile.owner]; // If the player is no longer able to hold the book, kill it (and by extension the other projectiles). - if (!player.channel || player.noItems || player.CCed) + if (player.CantUseHoldout()) { Projectile.Kill(); return; diff --git a/Projectiles/Magic/GhastlyVisageProj.cs b/Projectiles/Magic/GhastlyVisageProj.cs index 5ac1b0be89..1293dd0a63 100644 --- a/Projectiles/Magic/GhastlyVisageProj.cs +++ b/Projectiles/Magic/GhastlyVisageProj.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.ai[1] = (float)(soundDelayer - soundDelayMult * aiSoundDelay); isActive = true; } - bool canUseItem = player.channel && !player.noItems && !player.CCed; + bool canUseItem = !player.CantUseHoldout(); if (Projectile.localAI[0] > 0f) { Projectile.localAI[0] -= 1f; diff --git a/Projectiles/Magic/HadalUrnHoldout.cs b/Projectiles/Magic/HadalUrnHoldout.cs index 7440446aa5..c46a5fbf8a 100644 --- a/Projectiles/Magic/HadalUrnHoldout.cs +++ b/Projectiles/Magic/HadalUrnHoldout.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Magic Player player = Main.player[Projectile.owner]; float rotoffset = MathHelper.PiOver2; Vector2 playerpos = player.RotatedRelativePoint(player.MountedCenter, true); - bool shouldBeHeld = player.channel && !player.noItems && !player.CCed; + bool shouldBeHeld = !player.CantUseHoldout(); Projectile.damage = player.ActiveItem() is null ? 0 : player.GetWeaponDamage(player.ActiveItem()); if (Projectile.ai[0] > 0f) { diff --git a/Projectiles/Magic/HeresyProj.cs b/Projectiles/Magic/HeresyProj.cs index 36d1749ddf..3efc82880f 100644 --- a/Projectiles/Magic/HeresyProj.cs +++ b/Projectiles/Magic/HeresyProj.cs @@ -1,7 +1,7 @@ -using CalamityMod.Items.Weapons.Magic; +using System; +using CalamityMod.Items.Weapons.Magic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { // If the player is no longer able to hold the book, kill it. - if (!Owner.channel || Owner.noItems || Owner.CCed) + if (Owner.CantUseHoldout()) { Projectile.Kill(); return; diff --git a/Projectiles/Magic/NanoPurgeHoldout.cs b/Projectiles/Magic/NanoPurgeHoldout.cs index 50a24ff00b..b68d0f826f 100644 --- a/Projectiles/Magic/NanoPurgeHoldout.cs +++ b/Projectiles/Magic/NanoPurgeHoldout.cs @@ -15,7 +15,6 @@ namespace CalamityMod.Projectiles.Magic private static int[] LaserOffsetByAnimationFrame = { 4, 3, 0, 3 }; private Player Owner => Main.player[Projectile.owner]; - private bool OwnerCanShoot => Owner.channel && Owner.HasAmmo(Owner.ActiveItem()) && !Owner.noItems && !Owner.CCed; private ref float DeployedFrames => ref Projectile.ai[0]; private ref float ChargeTowardsNextShot => ref Projectile.ai[1]; @@ -41,7 +40,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 gunBarrelPos = armPosition + Projectile.velocity * Projectile.height * 0.5f; // If the player is unable to continue using the holdout, delete it. - if (!OwnerCanShoot) + if (Owner.CantUseHoldout() || !Owner.HasAmmo(Owner.ActiveItem())) { Projectile.Kill(); return; diff --git a/Projectiles/Magic/NebulousCataclysm_Held.cs b/Projectiles/Magic/NebulousCataclysm_Held.cs index a953411c23..77f4bdc209 100644 --- a/Projectiles/Magic/NebulousCataclysm_Held.cs +++ b/Projectiles/Magic/NebulousCataclysm_Held.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Magic bool shoot = CurrentFrame == ShootFrame && Projectile.ai[0] == 0f; bool ableToShoot = true; - bool weaponInUse = Owner.channel && !Owner.noItems && !Owner.CCed; + bool weaponInUse = !Owner.CantUseHoldout(); int manaCost = (int)(30f * Owner.manaCost); Vector2 halvedSize = Projectile.Size / 2f; Vector2 staffOffset = halvedSize + new Vector2(24f, 24f); diff --git a/Projectiles/Magic/RainbowPartyCannonProjectile.cs b/Projectiles/Magic/RainbowPartyCannonProjectile.cs index 4f9c2b43df..4472644d00 100644 --- a/Projectiles/Magic/RainbowPartyCannonProjectile.cs +++ b/Projectiles/Magic/RainbowPartyCannonProjectile.cs @@ -1,6 +1,6 @@ -using CalamityMod.Items.Weapons.Magic; +using System; +using CalamityMod.Items.Weapons.Magic; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.Audio; using Terraria.Localization; @@ -31,8 +31,7 @@ namespace CalamityMod.Projectiles.Magic UpdatePlayerVisuals(Owner.Center); - bool stillUsingCannon = Owner.channel && !Owner.noItems && !Owner.CCed; - if (!stillUsingCannon) + if (Owner.CantUseHoldout()) { Projectile.Kill(); return; diff --git a/Projectiles/Magic/Snowflake.cs b/Projectiles/Magic/Snowflake.cs index e3ac8eedf6..7d3a526c69 100644 --- a/Projectiles/Magic/Snowflake.cs +++ b/Projectiles/Magic/Snowflake.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Magic Player player = Main.player[Projectile.owner]; if (player == null) return; - if (!(player.channel && !player.noItems && !player.CCed)) + if (player.CantUseHoldout()) Projectile.Kill(); if (Projectile.type != ModContent.ProjectileType() || Main.player[Projectile.owner].HeldItem.type != ModContent.ItemType() || !Main.player[Projectile.owner].channel) diff --git a/Projectiles/Magic/YharimsCrystalPrism.cs b/Projectiles/Magic/YharimsCrystalPrism.cs index 63521620f7..234e5618d2 100644 --- a/Projectiles/Magic/YharimsCrystalPrism.cs +++ b/Projectiles/Magic/YharimsCrystalPrism.cs @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Magic // CheckMana returns true if the mana cost can be paid. If mana isn't consumed this frame, the CheckMana short-circuits out of being evaluated. bool allowContinuedUse = !ShouldConsumeMana() || player.CheckMana(player.ActiveItem(), -1, true, false); - bool crystalStillInUse = player.channel && allowContinuedUse && !player.noItems && !player.CCed; + bool crystalStillInUse = !player.CantUseHoldout() && allowContinuedUse; // The beams are only projected once (on frame 1). if (crystalStillInUse && Projectile.ai[0] == 1f) diff --git a/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs b/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs index 1b52867093..105148d9ca 100644 --- a/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs +++ b/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs @@ -1,16 +1,16 @@ -using CalamityMod.Particles; +using System; +using System.IO; using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; +using CalamityMod.Sounds; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.IO; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; -using static Terraria.ModLoader.ModContent; using static CalamityMod.CalamityUtils; -using Terraria.Audio; -using CalamityMod.Sounds; +using static Terraria.ModLoader.ModContent; namespace CalamityMod.Projectiles.Melee { @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Melee #region Throw variables //Only used for the long range throw - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed && Owner.HeldItem.type == ItemType(); + private bool OwnerCanShoot => !Owner.CantUseHoldout() && Owner.HeldItem.type == ItemType(); public bool Thrown => Combo == 2 || Combo == 3; public const float MaxThrowTime = 140; public float ThrowReach; @@ -141,7 +141,7 @@ namespace CalamityMod.Projectiles.Melee { if (!initialized) //Initialization { - Projectile.timeLeft = Thrown ? (int) MaxThrowTime : (int)MaxSwingTime; + Projectile.timeLeft = Thrown ? (int)MaxThrowTime : (int)MaxSwingTime; SoundStyle sound = (Charge > 0 || Thrown) ? CommonCalamitySounds.LouderPhantomPhoenix : SoundID.Item71; SoundEngine.PlaySound(sound, Projectile.Center); direction = Projectile.velocity; @@ -182,11 +182,11 @@ namespace CalamityMod.Projectiles.Melee //Slightly shift the blasts up so the final close shots don't go BELOW the cursor and instead go right on it. float adjustedBlastRotation = Projectile.rotation - MathHelper.PiOver4 * 1.15f * Owner.direction; - var source = Projectile.GetSource_FromThis(); - Projectile blast = Projectile.NewProjectileDirect(source, Owner.Center + adjustedBlastRotation.ToRotationVector2() * 10f, adjustedBlastRotation.ToRotationVector2() * 20f, ProjectileType(), (int)(ArkoftheCosmos.SwirlBoltDamageMultiplier / ArkoftheCosmos.SwirlBoltAmount * Projectile.damage), 0f, Owner.whoAmI, 0.55f, MathHelper.Pi * 0.05f); - { + var source = Projectile.GetSource_FromThis(); + Projectile blast = Projectile.NewProjectileDirect(source, Owner.Center + adjustedBlastRotation.ToRotationVector2() * 10f, adjustedBlastRotation.ToRotationVector2() * 20f, ProjectileType(), (int)(ArkoftheCosmos.SwirlBoltDamageMultiplier / ArkoftheCosmos.SwirlBoltAmount * Projectile.damage), 0f, Owner.whoAmI, 0.55f, MathHelper.Pi * 0.05f); + { blast.timeLeft = 100; - } + } } } @@ -268,7 +268,7 @@ namespace CalamityMod.Projectiles.Melee if (Combo == 3f) { //Slow down the projectile's retraction - float curveDownGently = MathHelper.Lerp(1f, 0.8f, 1f - (float)Math.Sqrt(1f - (float)Math.Pow(SnapEndCompletion , 2f))); + float curveDownGently = MathHelper.Lerp(1f, 0.8f, 1f - (float)Math.Sqrt(1f - (float)Math.Pow(SnapEndCompletion, 2f))); Projectile.Center = Owner.Center + direction * curveDownGently; Projectile.scale = 1.5f; @@ -276,7 +276,7 @@ namespace CalamityMod.Projectiles.Melee float extraRotations = (direction.ToRotation() + MathHelper.PiOver4 > Projectile.velocity.ToRotation()) ? -MathHelper.TwoPi : 0f; - Projectile.rotation = MathHelper.Lerp(Projectile.velocity.ToRotation(), direction.ToRotation() + extraRotations, orientateProperly); + Projectile.rotation = MathHelper.Lerp(Projectile.velocity.ToRotation(), direction.ToRotation() + extraRotations, orientateProperly); } //Sharticles @@ -385,7 +385,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 distance = Main.rand.NextVector2Circular(maxDistance, maxDistance); Vector2 angularVelocity = Utils.SafeNormalize(distance.RotatedBy(-MathHelper.PiOver2), Vector2.Zero) * 2 * (1f + distance.Length() / 15f); Color glitterColor = Main.hslToRgb(Main.rand.NextFloat(), 1, 0.5f); - Particle glitter = new CritSpark(Projectile.Center + distance, Owner.velocity + angularVelocity, Color.White , glitterColor, 1f + 1 * (distance.Length() / maxDistance), 10, 0.05f, 3f); + Particle glitter = new CritSpark(Projectile.Center + distance, Owner.velocity + angularVelocity, Color.White, glitterColor, 1f + 1 * (distance.Length() / maxDistance), 10, 0.05f, 3f); GeneralParticleHandler.SpawnParticle(glitter); } @@ -424,14 +424,14 @@ namespace CalamityMod.Projectiles.Melee { for (int i = 0; i < 5; i++) { - Vector2 particleSpeed = Utils.SafeNormalize(target.Center - Projectile.Center , Vector2.One).RotatedByRandom(MathHelper.PiOver4 * 0.8f) * Main.rand.NextFloat(3.6f, 8f); + Vector2 particleSpeed = Utils.SafeNormalize(target.Center - Projectile.Center, Vector2.One).RotatedByRandom(MathHelper.PiOver4 * 0.8f) * Main.rand.NextFloat(3.6f, 8f); Particle energyLeak = new SquishyLightParticle(target.Center, particleSpeed, Main.rand.NextFloat(0.3f, 0.6f), Color.OrangeRed, 60, 2, 2.5f, hueShift: 0.06f); GeneralParticleHandler.SpawnParticle(energyLeak); } if (Combo == 3f) { - SoundEngine.PlaySound(CommonCalamitySounds.ScissorGuillotineSnapSound with { Volume =CommonCalamitySounds.ScissorGuillotineSnapSound.Volume * 1.3f }, Projectile.Center); + SoundEngine.PlaySound(CommonCalamitySounds.ScissorGuillotineSnapSound with { Volume = CommonCalamitySounds.ScissorGuillotineSnapSound.Volume * 1.3f }, Projectile.Center); } } @@ -445,7 +445,7 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(SoundID.Item84, Projectile.Center); Vector2 sliceDirection = Utils.SafeNormalize(direction, Vector2.One) * 40; - Particle SliceLine = new LineVFX(Projectile.Center - sliceDirection, sliceDirection * 2f, 0.2f, Color.Orange * 0.7f, expansion : 250f) + Particle SliceLine = new LineVFX(Projectile.Center - sliceDirection, sliceDirection * 2f, 0.2f, Color.Orange * 0.7f, expansion: 250f) { Lifetime = 10 }; diff --git a/Projectiles/Melee/ArkOfTheElements_SwungBlade.cs b/Projectiles/Melee/ArkOfTheElements_SwungBlade.cs index 7978bdce89..f79d155d93 100644 --- a/Projectiles/Melee/ArkOfTheElements_SwungBlade.cs +++ b/Projectiles/Melee/ArkOfTheElements_SwungBlade.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Melee #region Throw variables //Only used for the long range throw - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed && Owner.HeldItem.type == ItemType(); + private bool OwnerCanShoot => !Owner.CantUseHoldout() && Owner.HeldItem.type == ItemType(); public bool Thrown => Combo == 2 || Combo == 3; const float MaxThrowTime = 80; const float ThrowReachMax = 500; diff --git a/Projectiles/Melee/BrokenBiomeBlade_AridGrandeur.cs b/Projectiles/Melee/BrokenBiomeBlade_AridGrandeur.cs index babd63e22f..2442ef22ca 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_AridGrandeur.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_AridGrandeur.cs @@ -24,14 +24,10 @@ namespace CalamityMod.Projectiles.Melee public ref float PogoCooldown => ref Projectile.ai[1]; //Cooldown for the pogo public Player Owner => Main.player[Projectile.owner]; public bool CanPogo => Owner.velocity.Y != 0 && PogoCooldown <= 0; //Only pogo when in the air and if the cooldown is zero - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; public const float pogoStrenght = 16f; //How much the player gets pogoed up public const float maxShred = 500; //How much shred you get - public override void SetStaticDefaults() - { - } public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; @@ -102,7 +98,7 @@ namespace CalamityMod.Projectiles.Melee initialized = true; } - if (!OwnerCanShoot) + if (Owner.CantUseHoldout()) { Projectile.Kill(); return; diff --git a/Projectiles/Melee/ChronomancersScytheSwing.cs b/Projectiles/Melee/ChronomancersScytheSwing.cs index f894b99f8e..3cbf102a7c 100644 --- a/Projectiles/Melee/ChronomancersScytheSwing.cs +++ b/Projectiles/Melee/ChronomancersScytheSwing.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Melee if (Main.myPlayer == Projectile.owner) { - if (Owner.channel && !Owner.noItems && !Owner.CCed) + if (!Owner.CantUseHoldout()) { float scaleFactor6 = 1f; diff --git a/Projectiles/Melee/DeathsAscensionSwing.cs b/Projectiles/Melee/DeathsAscensionSwing.cs index 076d9591d3..0992cccb36 100644 --- a/Projectiles/Melee/DeathsAscensionSwing.cs +++ b/Projectiles/Melee/DeathsAscensionSwing.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 playerRotatedPoint = Owner.RotatedRelativePoint(Owner.MountedCenter, true); if (Main.myPlayer == Projectile.owner) { - if (Owner.channel && !Owner.noItems && !Owner.CCed) + if (!Owner.CantUseHoldout()) HandleChannelMovement(playerRotatedPoint); else Projectile.Kill(); diff --git a/Projectiles/Melee/DevilsSunriseProj.cs b/Projectiles/Melee/DevilsSunriseProj.cs index c8153a182d..a9acc45230 100644 --- a/Projectiles/Melee/DevilsSunriseProj.cs +++ b/Projectiles/Melee/DevilsSunriseProj.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Melee if (Main.myPlayer == Projectile.owner) { - if (Owner.channel && !Owner.noItems && !Owner.CCed) + if (!Owner.CantUseHoldout()) { float scaleFactor6 = 1f; diff --git a/Projectiles/Melee/Galaxia_AndromedasStride.cs b/Projectiles/Melee/Galaxia_AndromedasStride.cs index c356147811..7edfd1b67f 100644 --- a/Projectiles/Melee/Galaxia_AndromedasStride.cs +++ b/Projectiles/Melee/Galaxia_AndromedasStride.cs @@ -1,17 +1,17 @@ -using CalamityMod.Particles; +using System; +using System.IO; using CalamityMod.Items.Weapons.Melee; -using Terraria.Graphics.Shaders; +using CalamityMod.Particles; +using CalamityMod.Tiles.Astral; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.IO; using Terraria; +using Terraria.Audio; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; -using static Terraria.ModLoader.ModContent; using static CalamityMod.CalamityUtils; -using Terraria.Audio; -using CalamityMod.Tiles.Astral; +using static Terraria.ModLoader.ModContent; namespace CalamityMod.Projectiles.Melee { @@ -27,15 +27,11 @@ namespace CalamityMod.Projectiles.Melee public ref float CurrentIndicator => ref Projectile.localAI[0]; //What "indicator" stage are you on. public ref float OverCharge => ref Projectile.localAI[1]; - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; const float MaxCharge = 360; public Vector2 lastDisplacement; public float dashDuration; - public override void SetStaticDefaults() - { - } public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; @@ -79,7 +75,7 @@ namespace CalamityMod.Projectiles.Melee initialized = true; } - if (!OwnerCanShoot) + if (Owner.CantUseHoldout()) { if (State == 0f) { diff --git a/Projectiles/Melee/Galaxia_AriesWrath.cs b/Projectiles/Melee/Galaxia_AriesWrath.cs index d0e7cd2ecc..e1579d2614 100644 --- a/Projectiles/Melee/Galaxia_AriesWrath.cs +++ b/Projectiles/Melee/Galaxia_AriesWrath.cs @@ -1,15 +1,15 @@ -using CalamityMod.Particles; +using System; +using System.Linq; using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.Linq; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; -using static Terraria.ModLoader.ModContent; using static CalamityMod.CalamityUtils; -using Terraria.Audio; +using static Terraria.ModLoader.ModContent; namespace CalamityMod.Projectiles.Melee { @@ -21,7 +21,6 @@ namespace CalamityMod.Projectiles.Melee public Player Owner => Main.player[Projectile.owner]; public ref float ChainSwapTimer => ref Projectile.ai[0]; public ref float BlastCooldown => ref Projectile.ai[1]; - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed && Owner.HeldItem.type == ItemType(); const float MaxProjReach = 500f; //How far away do you check for enemies for the extra projs from crits be @@ -120,7 +119,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - if (!OwnerCanShoot) + if (Owner.CantUseHoldout() || Owner.HeldItem.type != ItemType()) { //Kill the projectile if too far away from the player or close enough to get "re-absorbed) if ((Owner.Center - Projectile.Center).Length() < 30f || (Owner.Center - Projectile.Center).Length() > 2000f || Projectile.velocity.Length() > 100f) diff --git a/Projectiles/Melee/Galaxia_PhoenixsPride.cs b/Projectiles/Melee/Galaxia_PhoenixsPride.cs index 5b216395f9..1f8fdea9f6 100644 --- a/Projectiles/Melee/Galaxia_PhoenixsPride.cs +++ b/Projectiles/Melee/Galaxia_PhoenixsPride.cs @@ -1,16 +1,16 @@ -using CalamityMod.Particles; +using System; +using System.IO; using CalamityMod.Items.Weapons.Melee; -using Terraria.Graphics.Shaders; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.IO; using Terraria; +using Terraria.Audio; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; -using static Terraria.ModLoader.ModContent; using static CalamityMod.CalamityUtils; -using Terraria.Audio; +using static Terraria.ModLoader.ModContent; namespace CalamityMod.Projectiles.Melee { @@ -22,7 +22,6 @@ namespace CalamityMod.Projectiles.Melee Vector2 direction = Vector2.Zero; public ref float CurrentState => ref Projectile.ai[0]; public Player Owner => Main.player[Projectile.owner]; - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; public const float throwOutTime = 90f; public const float throwOutDistance = 440f; @@ -87,7 +86,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.rotation = direction.ToRotation(); //Only done for afterimages - if (!OwnerCanShoot) + if (Owner.CantUseHoldout()) { if (CurrentState == 2f || (CurrentState == 0f && Empowerment / maxEmpowerment < 0.5)) { diff --git a/Projectiles/Melee/Galaxia_PolarisGaze.cs b/Projectiles/Melee/Galaxia_PolarisGaze.cs index 4516bc10f3..b0ef505bab 100644 --- a/Projectiles/Melee/Galaxia_PolarisGaze.cs +++ b/Projectiles/Melee/Galaxia_PolarisGaze.cs @@ -1,15 +1,15 @@ -using CalamityMod.Particles; +using System; +using System.IO; using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; +using CalamityMod.Sounds; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.IO; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; -using Terraria.Audio; -using CalamityMod.Sounds; namespace CalamityMod.Projectiles.Melee { @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Melee public float Bounce(float x) => x <= 50 ? x / 50f : x <= 65 ? 1 + 0.15f * (float)Math.Sin((x - 50f) / 15f * MathHelper.Pi) : 1f; public float ShredRatio => MathHelper.Clamp(Shred / (maxShred * 0.5f), 0f, 1f); public Player Owner => Main.player[Projectile.owner]; - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; public const float maxShred = 650; //How much shred you get @@ -36,10 +35,6 @@ namespace CalamityMod.Projectiles.Melee public Particle[] Rings = new Particle[3]; public Particle PolarStar; - - public override void SetStaticDefaults() - { - } public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; @@ -93,7 +88,7 @@ namespace CalamityMod.Projectiles.Melee } } - if (!OwnerCanShoot) + if (Owner.CantUseHoldout()) { Projectile.Kill(); return; diff --git a/Projectiles/Melee/MarniteDeconstructorProj.cs b/Projectiles/Melee/MarniteDeconstructorProj.cs index 8f5a251276..f48e59a284 100644 --- a/Projectiles/Melee/MarniteDeconstructorProj.cs +++ b/Projectiles/Melee/MarniteDeconstructorProj.cs @@ -1,13 +1,11 @@ -using CalamityMod.Items.Tools; +using System; +using CalamityMod.Items.Tools; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; -using System; using Terraria; using Terraria.Audio; using Terraria.GameContent; -using Terraria.Graphics.Shaders; -using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -63,10 +61,10 @@ namespace CalamityMod.Projectiles.Melee Lighting.AddLight(Projectile.Center, Color.Blue.ToVector3() * 0.7f); } - if (MoveInIntervals > 0f) - MoveInIntervals -= 1f; + if (MoveInIntervals > 0f) + MoveInIntervals -= 1f; - if (!Owner.channel || Owner.noItems || Owner.CCed) + if (Owner.CantUseHoldout()) Projectile.Kill(); else if (MoveInIntervals <= 0f) @@ -203,7 +201,7 @@ namespace CalamityMod.Projectiles.Melee { Main.EntitySpriteDraw(selectionTex, Projectile.Center + offset - Main.screenPosition, null, bloomColor.MultiplyRGB(colorMod), 0f, selectionTex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); }); - + //Draw laser beams going around the selection Texture2D beamTex = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/SimpleGradient").Value; diff --git a/Projectiles/Melee/MarniteObliteratorProj.cs b/Projectiles/Melee/MarniteObliteratorProj.cs index 6fb40c5187..d067452dab 100644 --- a/Projectiles/Melee/MarniteObliteratorProj.cs +++ b/Projectiles/Melee/MarniteObliteratorProj.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Melee if (MoveInIntervals > 0f) MoveInIntervals -= 1f; - if (!Owner.channel || Owner.noItems || Owner.CCed) + if (Owner.CantUseHoldout()) Projectile.Kill(); else if (MoveInIntervals <= 0f) diff --git a/Projectiles/Melee/MendedBiomeBlade_ExtantAbhorrence.cs b/Projectiles/Melee/MendedBiomeBlade_ExtantAbhorrence.cs index 1c704c6301..9df3e7d636 100644 --- a/Projectiles/Melee/MendedBiomeBlade_ExtantAbhorrence.cs +++ b/Projectiles/Melee/MendedBiomeBlade_ExtantAbhorrence.cs @@ -1,18 +1,18 @@ -using CalamityMod.Particles; -using CalamityMod.Items.Weapons.Melee; -using Terraria.Graphics.Shaders; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; +using System; using System.IO; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using static Terraria.ModLoader.ModContent; -using static CalamityMod.CalamityUtils; -using Terraria.Audio; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; using CalamityMod.Tiles.Astral; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; +using static CalamityMod.CalamityUtils; +using static Terraria.ModLoader.ModContent; namespace CalamityMod.Projectiles.Melee { @@ -28,15 +28,11 @@ namespace CalamityMod.Projectiles.Melee public ref float CurrentIndicator => ref Projectile.localAI[0]; //What "indicator" stage are you on. public ref float OverCharge => ref Projectile.localAI[1]; - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; const float MaxCharge = 500; public Vector2 lastDisplacement; public float dashDuration; - public override void SetStaticDefaults() - { - } public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; @@ -80,7 +76,7 @@ namespace CalamityMod.Projectiles.Melee initialized = true; } - if (!OwnerCanShoot) + if (Owner.CantUseHoldout()) { if (State == 0f) { diff --git a/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs b/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs index e72bf5ead3..5ebbdb63e1 100644 --- a/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs +++ b/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs @@ -1,16 +1,16 @@ -using CalamityMod.Particles; +using System; +using System.IO; using CalamityMod.Items.Weapons.Melee; -using Terraria.Graphics.Shaders; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.IO; using Terraria; +using Terraria.Audio; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; -using static Terraria.ModLoader.ModContent; using static CalamityMod.CalamityUtils; -using Terraria.Audio; +using static Terraria.ModLoader.ModContent; namespace CalamityMod.Projectiles.Melee { @@ -20,10 +20,9 @@ namespace CalamityMod.Projectiles.Melee public override string Texture => "CalamityMod/Projectiles/Melee/MendedBiomeBlade_HeavensMight"; private bool initialized = false; Vector2 direction = Vector2.Zero; - Vector2 oldDirection = Vector2.Zero; + Vector2 oldDirection; public ref float CurrentState => ref Projectile.ai[0]; public Player Owner => Main.player[Projectile.owner]; - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; public const float throwOutTime = 90f; public const float throwOutDistance = 440f; @@ -85,7 +84,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.rotation = direction.ToRotation(); //Only done for afterimages - if (!OwnerCanShoot) + if (Owner.CantUseHoldout()) { if (CurrentState == 2f || (CurrentState == 0f && Empowerment / maxEmpowerment < 0.5)) { diff --git a/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeur.cs b/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeur.cs index 838e3b442a..2c4fede876 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeur.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeur.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Melee public ref float ChargeSoundCooldown => ref Projectile.localAI[1]; public Player Owner => Main.player[Projectile.owner]; public bool CanPogo => Owner.velocity.Y != 0 && PogoCooldown <= 0; //Only pogo when in the air and if the cooldown is zero - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; public const float pogoStrenght = 16f; //How much the player gets pogoed up public const float maxShred = 500; //How much shred you get @@ -104,7 +103,7 @@ namespace CalamityMod.Projectiles.Melee initialized = true; } - if (!OwnerCanShoot) + if (Owner.CantUseHoldout()) { Projectile.Kill(); return; diff --git a/Projectiles/Melee/MurasamaSlash.cs b/Projectiles/Melee/MurasamaSlash.cs index 02c1dc1fd3..42a240e4f0 100644 --- a/Projectiles/Melee/MurasamaSlash.cs +++ b/Projectiles/Melee/MurasamaSlash.cs @@ -115,7 +115,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 playerRotatedPoint = player.RotatedRelativePoint(player.MountedCenter, true); if (Main.myPlayer == Projectile.owner) { - if (player.channel && !player.noItems && !player.CCed) + if (!player.CantUseHoldout()) HandleChannelMovement(player, playerRotatedPoint); else { diff --git a/Projectiles/Melee/OmnibladeSwing.cs b/Projectiles/Melee/OmnibladeSwing.cs index b31748f23a..9ffc93cd92 100644 --- a/Projectiles/Melee/OmnibladeSwing.cs +++ b/Projectiles/Melee/OmnibladeSwing.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 playerRotatedPoint = Owner.RotatedRelativePoint(Owner.MountedCenter, true); if (Main.myPlayer == Projectile.owner) { - if (Owner.channel && !Owner.noItems && !Owner.CCed) + if (!Owner.CantUseHoldout()) HandleChannelMovement(playerRotatedPoint); else Projectile.Kill(); diff --git a/Projectiles/Melee/PhotonRipperProjectile.cs b/Projectiles/Melee/PhotonRipperProjectile.cs index 437469c640..b40519a1e4 100644 --- a/Projectiles/Melee/PhotonRipperProjectile.cs +++ b/Projectiles/Melee/PhotonRipperProjectile.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 playerRotatedPosition = Owner.RotatedRelativePoint(Owner.MountedCenter); if (Main.myPlayer == Projectile.owner) { - if (Owner.channel && !Owner.noItems && !Owner.CCed) + if (!Owner.CantUseHoldout()) HandleChannelMovement(playerRotatedPosition); else Projectile.Kill(); diff --git a/Projectiles/Melee/Spears/StreamGougeProj.cs b/Projectiles/Melee/Spears/StreamGougeProj.cs index 44a50069ab..d22856fe21 100644 --- a/Projectiles/Melee/Spears/StreamGougeProj.cs +++ b/Projectiles/Melee/Spears/StreamGougeProj.cs @@ -91,7 +91,6 @@ namespace CalamityMod.Projectiles.Melee.Spears public void DeterminePlayerVariables() { - bool spearStillInUse = Owner.channel && !Owner.noItems && !Owner.CCed; Owner.ChangeDir((Math.Cos(Projectile.rotation - MathHelper.Pi + MathHelper.PiOver4) > 0f).ToDirectionInt()); Owner.heldProj = Projectile.whoAmI; Owner.itemTime = Owner.itemAnimation = 2; @@ -99,7 +98,7 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.Center = Owner.Center; // Die if the spear is no longer in use. - if (!spearStillInUse) + if (Owner.CantUseHoldout()) Projectile.Kill(); } diff --git a/Projectiles/Melee/SpineOfThanatosProjectile.cs b/Projectiles/Melee/SpineOfThanatosProjectile.cs index 291a7730c5..336650b92f 100644 --- a/Projectiles/Melee/SpineOfThanatosProjectile.cs +++ b/Projectiles/Melee/SpineOfThanatosProjectile.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 playerRotatedPosition = Owner.RotatedRelativePoint(Owner.MountedCenter); if (Main.myPlayer == Projectile.owner) { - if (!Owner.noItems && !Owner.CCed) + if (!Owner.CantUseHoldout()) HandleChannelMovement(playerRotatedPosition); else Projectile.Kill(); diff --git a/Projectiles/Melee/StygianShieldAttack.cs b/Projectiles/Melee/StygianShieldAttack.cs index 3e80cc65e5..2ac58dc92d 100644 --- a/Projectiles/Melee/StygianShieldAttack.cs +++ b/Projectiles/Melee/StygianShieldAttack.cs @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Melee } // Attack upon releasing the button - if (!Owner.channel || Owner.noItems || Owner.CCed) + if (Owner.CantUseHoldout()) Attack(); } diff --git a/Projectiles/Melee/TrueBiomeBlade_LamentationsOfTheChained.cs b/Projectiles/Melee/TrueBiomeBlade_LamentationsOfTheChained.cs index 34e6c90b6f..364bdda86d 100644 --- a/Projectiles/Melee/TrueBiomeBlade_LamentationsOfTheChained.cs +++ b/Projectiles/Melee/TrueBiomeBlade_LamentationsOfTheChained.cs @@ -24,7 +24,6 @@ namespace CalamityMod.Projectiles.Melee public Player Owner => Main.player[Projectile.owner]; public ref float ChainSwapTimer => ref Projectile.ai[0]; public ref float SnapCoyoteTime => ref Projectile.ai[1]; - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; const float MaxTangleReach = 400f; //How long can tangling vines from crits be @@ -36,9 +35,6 @@ namespace CalamityMod.Projectiles.Melee public Particle smear; public Particle smear2; - public override void SetStaticDefaults() - { - } public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; @@ -162,7 +158,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - if (!OwnerCanShoot) + if (Owner.CantUseHoldout()) { Projectile.Kill(); return; diff --git a/Projectiles/Melee/TrueBiomeBlade_MercurialTides.cs b/Projectiles/Melee/TrueBiomeBlade_MercurialTides.cs index d11f6cbaef..4b7b4bc753 100644 --- a/Projectiles/Melee/TrueBiomeBlade_MercurialTides.cs +++ b/Projectiles/Melee/TrueBiomeBlade_MercurialTides.cs @@ -28,15 +28,11 @@ namespace CalamityMod.Projectiles.Melee public ref float CurrentIndicator => ref Projectile.localAI[0]; //What "indicator" stage are you on. public ref float OverCharge => ref Projectile.localAI[1]; - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; const float MaxCharge = 500; public Vector2 lastDisplacement; public float dashDuration; - public override void SetStaticDefaults() - { - } public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; @@ -80,7 +76,7 @@ namespace CalamityMod.Projectiles.Melee initialized = true; } - if (!OwnerCanShoot) + if (Owner.CantUseHoldout()) { if (State == 0f) { diff --git a/Projectiles/Melee/TrueBiomeBlade_SanguineFury.cs b/Projectiles/Melee/TrueBiomeBlade_SanguineFury.cs index ced8054f2d..104207dfa7 100644 --- a/Projectiles/Melee/TrueBiomeBlade_SanguineFury.cs +++ b/Projectiles/Melee/TrueBiomeBlade_SanguineFury.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Melee public ref float ChargeSoundCooldown => ref Projectile.localAI[1]; public Player Owner => Main.player[Projectile.owner]; public bool CanPogo => Owner.velocity.Y != 0 && PogoCooldown <= 0; //Only pogo when in the air and if the cooldown is zero - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; public const float pogoStrenght = 16f; //How much the player gets pogoed up public const float maxShred = 500; //How much shred you get @@ -36,10 +35,6 @@ namespace CalamityMod.Projectiles.Melee public bool Dashing; public Vector2 DashStart; - - public override void SetStaticDefaults() - { - } public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; @@ -127,7 +122,7 @@ namespace CalamityMod.Projectiles.Melee } } - if (!OwnerCanShoot) + if (Owner.CantUseHoldout()) { Projectile.Kill(); return; diff --git a/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs b/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs index ddce8634b1..901dbb3bb6 100644 --- a/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs +++ b/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs @@ -22,7 +22,6 @@ namespace CalamityMod.Projectiles.Melee Vector2 direction = Vector2.Zero; public ref float CurrentState => ref Projectile.ai[0]; public Player Owner => Main.player[Projectile.owner]; - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; public const float throwOutTime = 90f; public const float throwOutDistance = 440f; @@ -89,7 +88,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.rotation = direction.ToRotation(); //Only done for afterimages - if (!OwnerCanShoot) + if (Owner.CantUseHoldout()) { if (CurrentState == 2f || (CurrentState == 0f && Empowerment / maxEmpowerment < 0.5)) { diff --git a/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs b/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs index 61d070848e..010aada6a2 100644 --- a/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs +++ b/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs @@ -30,8 +30,6 @@ namespace CalamityMod.Projectiles.Ranged private bool ChargeLV1 => CurrentChargingFrames >= ArcNovaDiffuser.Charge1Frames; private bool ChargeLV2 => CurrentChargingFrames >= ArcNovaDiffuser.Charge2Frames; - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; - public override void SetDefaults() { Projectile.width = 72; @@ -63,7 +61,7 @@ namespace CalamityMod.Projectiles.Ranged ChargeSound.Position = Projectile.Center; // Fire if the owner stops channeling or otherwise cannot use the weapon. - if (!OwnerCanShoot) + if (Owner.CantUseHoldout()) { // Big Shot mode if (ChargeLV2) @@ -237,7 +235,7 @@ namespace CalamityMod.Projectiles.Ranged // Rumble (only while channeling) float rumble = MathHelper.Clamp(CurrentChargingFrames, 0f, ArcNovaDiffuser.Charge2Frames); - if (OwnerCanShoot) + if (!Owner.CantUseHoldout()) Projectile.position += Main.rand.NextVector2Circular(rumble / 70f, rumble / 70f); } diff --git a/Projectiles/Ranged/ButcherGun.cs b/Projectiles/Ranged/ButcherGun.cs index f6282c1b7d..ea90fbc25e 100644 --- a/Projectiles/Ranged/ButcherGun.cs +++ b/Projectiles/Ranged/ButcherGun.cs @@ -1,6 +1,6 @@ -using CalamityMod.Items.Weapons.Ranged; +using System; +using CalamityMod.Items.Weapons.Ranged; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.ai[1] = (float)(shootDelayBase - incrementMult * incrementAmt); willShoot = true; } - bool canShoot = player.channel && player.HasAmmo(player.ActiveItem()) && !player.noItems && !player.CCed; + bool canShoot = !player.CantUseHoldout() && player.HasAmmo(player.ActiveItem()); if (Projectile.localAI[0] > 0f) { Projectile.localAI[0] -= 1f; diff --git a/Projectiles/Ranged/ChickenCannonHeld.cs b/Projectiles/Ranged/ChickenCannonHeld.cs index 229af447f4..fd8e163e88 100644 --- a/Projectiles/Ranged/ChickenCannonHeld.cs +++ b/Projectiles/Ranged/ChickenCannonHeld.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Ranged FramesTillNextShot = FireRate; shouldShoot = true; } - bool canShoot = player.channel && (player.HasAmmo(player.ActiveItem()) || FreeShotLoaded > 0) && !player.noItems && !player.CCed; + bool canShoot = !player.CantUseHoldout() && (player.HasAmmo(player.ActiveItem()) || FreeShotLoaded > 0); if (Projectile.soundDelay <= 0 && canShoot) { Projectile.soundDelay = (int)FireRate; diff --git a/Projectiles/Ranged/ClockworkBowHoldout.cs b/Projectiles/Ranged/ClockworkBowHoldout.cs index da0aaa1734..e83b0248f8 100644 --- a/Projectiles/Ranged/ClockworkBowHoldout.cs +++ b/Projectiles/Ranged/ClockworkBowHoldout.cs @@ -20,9 +20,7 @@ namespace CalamityMod.Projectiles.Ranged private ref float CurrentChargingFrames => ref Projectile.ai[0]; private ref float LoadedBolts => ref Projectile.ai[1]; private ref float FramesToLoadBolt => ref Projectile.localAI[0]; - private ref float LastDirection => ref Projectile.localAI[1]; - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; private float storedVelocity = 1f; private float angularSpread = MathHelper.ToRadians(16); @@ -46,7 +44,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 tipPosition = armPosition + Projectile.velocity * Projectile.width * 0.5f; // If the player releases left click, shoot out the arrows - if (!OwnerCanShoot) + if (Owner.CantUseHoldout()) { if (LoadedBolts <= 0f) //If theres no arrows to shoot diff --git a/Projectiles/Ranged/CondemnationHoldout.cs b/Projectiles/Ranged/CondemnationHoldout.cs index cc7056d048..5b19398992 100644 --- a/Projectiles/Ranged/CondemnationHoldout.cs +++ b/Projectiles/Ranged/CondemnationHoldout.cs @@ -18,7 +18,6 @@ namespace CalamityMod.Projectiles.Ranged private ref float ArrowsLoaded => ref Projectile.ai[1]; private ref float FramesToLoadNextArrow => ref Projectile.localAI[0]; - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; private float storedVelocity = 1f; public const float velocityMultiplier = 1.2f; public bool homing = false; @@ -42,7 +41,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 tipPosition = armPosition + Projectile.velocity * Projectile.width * 0.5f; // Fire arrows if the owner stops channeling or otherwise cannot use the weapon. - if (!OwnerCanShoot) + if (Owner.CantUseHoldout()) { // No arrows left to shoot? The bow disappears. if (ArrowsLoaded <= 0f) diff --git a/Projectiles/Ranged/ContagionBow.cs b/Projectiles/Ranged/ContagionBow.cs index 9f3338c2ef..4aefe23579 100644 --- a/Projectiles/Ranged/ContagionBow.cs +++ b/Projectiles/Ranged/ContagionBow.cs @@ -87,8 +87,7 @@ namespace CalamityMod.Projectiles.Ranged } if (fullSpeed && Main.myPlayer == Projectile.owner) { - bool canUseItem = player.channel && !player.noItems && !player.CCed; - if (canUseItem) + if (!player.CantUseHoldout()) { float speed = player.ActiveItem().shootSpeed * Projectile.scale; Vector2 spawnPos = vector; diff --git a/Projectiles/Ranged/DaemonsFlameBow.cs b/Projectiles/Ranged/DaemonsFlameBow.cs index 1a2fd7c368..3f9e86d4a4 100644 --- a/Projectiles/Ranged/DaemonsFlameBow.cs +++ b/Projectiles/Ranged/DaemonsFlameBow.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Ranged fullSpeed = true; int arg_1EF4_0 = (int)Projectile.ai[0] / (delayCompare - fireSpeedCompare * fireSpeed); } - bool canUseItem = player.channel && player.HasAmmo(player.ActiveItem()) && !player.noItems && !player.CCed; + bool canUseItem = !player.CantUseHoldout() && player.HasAmmo(player.ActiveItem()); if (Projectile.localAI[0] > 0f) { Projectile.localAI[0] -= 1f; diff --git a/Projectiles/Ranged/DrataliornusBow.cs b/Projectiles/Ranged/DrataliornusBow.cs index 1f636193d9..bb350b41cb 100644 --- a/Projectiles/Ranged/DrataliornusBow.cs +++ b/Projectiles/Ranged/DrataliornusBow.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Ranged timeToFire = true; } - bool canFire = player.channel && player.HasAmmo(player.ActiveItem()) && !player.noItems && !player.CCed; + bool canFire = !player.CantUseHoldout() && player.HasAmmo(player.ActiveItem()); if (Projectile.soundDelay <= 0 && canFire) { diff --git a/Projectiles/Ranged/ElementalEruptionHouldout.cs b/Projectiles/Ranged/ElementalEruptionHouldout.cs index d3e8ed59cc..382c5fd4e6 100644 --- a/Projectiles/Ranged/ElementalEruptionHouldout.cs +++ b/Projectiles/Ranged/ElementalEruptionHouldout.cs @@ -1,10 +1,5 @@ using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Particles; -using log4net.Core; using Microsoft.Xna.Framework; -using Mono.Cecil; -using ReLogic.Utilities; -using System; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -25,7 +20,6 @@ namespace CalamityMod.Projectiles.Ranged public int ShotCooldown; public int FireBlobs = 0; public int Time = 0; - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; public override void SetDefaults() { @@ -55,10 +49,8 @@ namespace CalamityMod.Projectiles.Ranged Vector2 tipPosition = armPosition + Projectile.velocity * Projectile.width * 0.8f; // Kill if the owner stops channeling or otherwise cannot use the weapon. - if (!OwnerCanShoot) - { + if (Owner.CantUseHoldout()) Projectile.Kill(); - } else { var effectcolor = Main.rand.Next(4) switch @@ -102,7 +94,7 @@ namespace CalamityMod.Projectiles.Ranged else { if (ShootTimer == 1) - SoundEngine.PlaySound(SoundID.Item73 with { Volume = 0.7f}, Projectile.Center); + SoundEngine.PlaySound(SoundID.Item73 with { Volume = 0.7f }, Projectile.Center); ShotsFired = 0; for (int i = 0; i < 2; i++) { diff --git a/Projectiles/Ranged/FlakKrakenHoldout.cs b/Projectiles/Ranged/FlakKrakenHoldout.cs index 0d03696dd9..88ad21ae67 100644 --- a/Projectiles/Ranged/FlakKrakenHoldout.cs +++ b/Projectiles/Ranged/FlakKrakenHoldout.cs @@ -40,10 +40,10 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { // If there's no player, or the player is the server, or the owner's stunned, there'll be no holdout. - bool cantUse = Owner == null || !Owner.active || Owner.dead || !Owner.channel || Main.myPlayer != Projectile.owner || Owner.CCed || Owner.noItems; - if (cantUse) + if (Owner.CantUseHoldout()) { Projectile.Kill(); + NetUpdate(); return; } diff --git a/Projectiles/Ranged/FlakToxicannonHoldout.cs b/Projectiles/Ranged/FlakToxicannonHoldout.cs index ebd8691cca..7b192a5220 100644 --- a/Projectiles/Ranged/FlakToxicannonHoldout.cs +++ b/Projectiles/Ranged/FlakToxicannonHoldout.cs @@ -40,10 +40,10 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { // If there's no player, or the player is the server, or the owner's stunned, there'll be no holdout. - bool cantUse = Owner == null || !Owner.active || Owner.dead || !Owner.channel || Main.myPlayer != Projectile.owner || Owner.CCed || Owner.noItems; - if (cantUse) + if (Owner.CantUseHoldout()) { Projectile.Kill(); + NetUpdate(); return; } diff --git a/Projectiles/Ranged/FlurrystormCannonShooting.cs b/Projectiles/Ranged/FlurrystormCannonShooting.cs index 0636e74854..75d9e76bf7 100644 --- a/Projectiles/Ranged/FlurrystormCannonShooting.cs +++ b/Projectiles/Ranged/FlurrystormCannonShooting.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.ai[1] = (float)(initialRate - fireRateMult * fireRate); shouldShoot = true; } - bool canShoot = player.channel && player.HasAmmo(player.ActiveItem()) && !player.noItems && !player.CCed; + bool canShoot = !player.CantUseHoldout() && player.HasAmmo(player.ActiveItem()); if (Projectile.localAI[0] > 0f) { Projectile.localAI[0] -= 1f; diff --git a/Projectiles/Ranged/FreedomStarHoldout.cs b/Projectiles/Ranged/FreedomStarHoldout.cs index c742913a0e..edf9c7e9a4 100644 --- a/Projectiles/Ranged/FreedomStarHoldout.cs +++ b/Projectiles/Ranged/FreedomStarHoldout.cs @@ -1,7 +1,7 @@ -using CalamityMod.Items; +using System; +using CalamityMod.Items; using CalamityMod.Items.Weapons.Ranged; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -143,7 +143,7 @@ namespace CalamityMod.Projectiles.Ranged // This grabs the weapon's current damage, taking current charge level into account. int currentDamage = player.GetWeaponDamage(freedomStar); - bool stillInUse = player.channel && !player.noItems && !player.CCed; + bool stillInUse = !player.CantUseHoldout(); // Checks if the Freedom Star has sufficient charge to fire. If this is false, it stops functioning. CalamityGlobalItem modItem = freedomStar.Calamity(); diff --git a/Projectiles/Ranged/KingsbaneHoldout.cs b/Projectiles/Ranged/KingsbaneHoldout.cs index f51f3a7772..9ac5958b2b 100644 --- a/Projectiles/Ranged/KingsbaneHoldout.cs +++ b/Projectiles/Ranged/KingsbaneHoldout.cs @@ -1,8 +1,5 @@ using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Particles; using Microsoft.Xna.Framework; -using ReLogic.Utilities; -using System; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -15,7 +12,6 @@ namespace CalamityMod.Projectiles.Ranged { // Take the name and texture from the weapon public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; public override string Texture => "CalamityMod/Projectiles/Ranged/KingsbaneWindUp"; private Player Owner => Main.player[Projectile.owner]; @@ -47,7 +43,7 @@ namespace CalamityMod.Projectiles.Ranged soundTimer++; Projectile.frameCounter++; - if (Projectile.frameCounter > windupAnim && OwnerCanShoot) + if (Projectile.frameCounter > windupAnim && !Owner.CantUseHoldout()) { if (Projectile.frame == 1 && Time < 85) { @@ -59,7 +55,7 @@ namespace CalamityMod.Projectiles.Ranged windupAnim--; Projectile.frameCounter = 0; } - else if (!OwnerCanShoot) + else if (Owner.CantUseHoldout()) { Projectile.frame++; } @@ -74,14 +70,14 @@ namespace CalamityMod.Projectiles.Ranged } Vector2 armPosition = Owner.RotatedRelativePoint(Owner.MountedCenter, true); - Vector2 tipPosition = armPosition + Projectile.velocity * Projectile.width * 0.85f + new Vector2 (0, 3.8f); + Vector2 tipPosition = armPosition + Projectile.velocity * Projectile.width * 0.85f + new Vector2(0, 3.8f); Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 15; int bulletAMMO = ProjectileID.Bullet; Owner.PickAmmo(Owner.ActiveItem(), out bulletAMMO, out float SpeedNoUse, out int bulletDamage, out float kBackNoUse, out int _); // Fire Auric Bullets if the owner stops channeling or otherwise cannot use the weapon. - if (!OwnerCanShoot) + if (Owner.CantUseHoldout()) { if (fullRev && fullRevShots > 0) { @@ -125,13 +121,13 @@ namespace CalamityMod.Projectiles.Ranged dust3.scale = Main.rand.NextFloat(0.9f, 1.6f); } Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center, shootVelocity.RotatedByRandom(MathHelper.ToRadians(1.5f)), bulletAMMO, Projectile.damage, Projectile.knockBack, Projectile.owner); - SoundEngine.PlaySound(SoundID.Item41 with { Volume = 0.75f}, Projectile.Center); + SoundEngine.PlaySound(SoundID.Item41 with { Volume = 0.75f }, Projectile.Center); framesBetweenShots = 3; } if (framesBetweenShots > 0) framesBetweenShots--; } - + } UpdateProjectileHeldVariables(armPosition); ManipulatePlayerVariables(); @@ -150,12 +146,12 @@ namespace CalamityMod.Projectiles.Ranged Projectile.netUpdate = true; } } - Projectile.Center = armPosition + Projectile.velocity * MathHelper.Clamp(47f - (framesBetweenShots * 2), 0f, 47f) + new Vector2 (0, 5); + Projectile.Center = armPosition + Projectile.velocity * MathHelper.Clamp(47f - (framesBetweenShots * 2), 0f, 47f) + new Vector2(0, 5); Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); Projectile.spriteDirection = Projectile.direction; // Rumble - if (!OwnerCanShoot) + if (Owner.CantUseHoldout()) { Projectile.position += Main.rand.NextVector2Circular(4.5f, 4.5f); } diff --git a/Projectiles/Ranged/MaelstromHoldout.cs b/Projectiles/Ranged/MaelstromHoldout.cs index 07797ac2f3..b67a1b6cdb 100644 --- a/Projectiles/Ranged/MaelstromHoldout.cs +++ b/Projectiles/Ranged/MaelstromHoldout.cs @@ -13,9 +13,7 @@ namespace CalamityMod.Projectiles.Ranged { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); private Player Owner => Main.player[Projectile.owner]; - private bool OwnerCanShoot => Owner.channel && Owner.HasAmmo(Owner.ActiveItem()) && !Owner.noItems && !Owner.CCed; private ref float CurrentChargingFrames => ref Projectile.ai[0]; - private ref float ArrowsLoaded => ref Projectile.ai[1]; private ref float FramesToLoadNextArrow => ref Projectile.localAI[0]; public override string Texture => "CalamityMod/Items/Weapons/Ranged/TheMaelstrom"; @@ -37,7 +35,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 shootPosition = armPosition + Projectile.velocity * Projectile.width * 0.5f; // Destroy the holdout projectile if the owner is no longer eligible to hold it. - if (!OwnerCanShoot) + if (Owner.CantUseHoldout() || !Owner.HasAmmo(Owner.ActiveItem())) { Projectile.Kill(); return; @@ -93,7 +91,6 @@ namespace CalamityMod.Projectiles.Ranged float shootSpeed = heldItem.shootSpeed; float knockback = heldItem.knockBack; - bool uselessFuckYou = OwnerCanShoot; int projectileType = 0; Owner.PickAmmo(heldItem, out projectileType, out shootSpeed, out arrowDamage, out knockback, out _); projectileType = ModContent.ProjectileType(); diff --git a/Projectiles/Ranged/MagnaCannonHoldout.cs b/Projectiles/Ranged/MagnaCannonHoldout.cs index 47ddf75246..38e4a631ac 100644 --- a/Projectiles/Ranged/MagnaCannonHoldout.cs +++ b/Projectiles/Ranged/MagnaCannonHoldout.cs @@ -29,8 +29,6 @@ namespace CalamityMod.Projectiles.Ranged private bool FullyCharged => CurrentChargingFrames >= MagnaCannon.FullChargeFrames; public int Time = 0; - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; - public override void SetDefaults() { Projectile.width = 58; @@ -62,7 +60,7 @@ namespace CalamityMod.Projectiles.Ranged ChargeSound.Position = Projectile.Center; // Fire if the owner stops channeling or otherwise cannot use the weapon. - if (!OwnerCanShoot) + if (Owner.CantUseHoldout()) { if (ShotsLoaded > 0) { @@ -158,7 +156,7 @@ namespace CalamityMod.Projectiles.Ranged // Rumble (only while channeling) float rumble = MathHelper.Clamp(CurrentChargingFrames, 0f, MagnaCannon.FullChargeFrames); - if (OwnerCanShoot) + if (!Owner.CantUseHoldout()) Projectile.position += Main.rand.NextVector2Circular(rumble / 43f, rumble / 43f); } diff --git a/Projectiles/Ranged/MineralMortarHoldout.cs b/Projectiles/Ranged/MineralMortarHoldout.cs index 6b0d1999db..1e7e8dc5ed 100644 --- a/Projectiles/Ranged/MineralMortarHoldout.cs +++ b/Projectiles/Ranged/MineralMortarHoldout.cs @@ -31,9 +31,11 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { - bool cantUse = Owner == null || !Owner.active || Owner.dead || !Owner.channel || Owner.CCed || Owner.noItems; - if (cantUse) + if (Owner.CantUseHoldout()) + { Projectile.Kill(); + return; + } Vector2 mouse = Owner.Calamity().mouseWorld; diff --git a/Projectiles/Ranged/NorfleetCannon.cs b/Projectiles/Ranged/NorfleetCannon.cs index 8ff16789e3..c596bfc633 100644 --- a/Projectiles/Ranged/NorfleetCannon.cs +++ b/Projectiles/Ranged/NorfleetCannon.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.ai[1] = baseUseTime - modifier * Projectile.localAI[0]; timeToFire = true; } - bool canFire = player.channel && player.HasAmmo(player.ActiveItem()) && !player.noItems && !player.CCed; + bool canFire = !player.CantUseHoldout() && player.HasAmmo(player.ActiveItem()); if (Projectile.soundDelay <= 0 && canFire) { Projectile.soundDelay = baseUseTime - modifier * (int)Projectile.localAI[0]; diff --git a/Projectiles/Ranged/OpalStrikerHoldout.cs b/Projectiles/Ranged/OpalStrikerHoldout.cs index d0ab405986..5cc4bf8eec 100644 --- a/Projectiles/Ranged/OpalStrikerHoldout.cs +++ b/Projectiles/Ranged/OpalStrikerHoldout.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged private ref float CurrentChargingFrames => ref Projectile.ai[0]; private bool FullyCharged => CurrentChargingFrames >= OpalStriker.FullChargeFrames; public int Time = 0; - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; public override void SetDefaults() { @@ -59,7 +58,7 @@ namespace CalamityMod.Projectiles.Ranged ChargeSound.Position = Projectile.Center; // Fire if the owner stops channeling or otherwise cannot use the weapon. - if (!OwnerCanShoot) + if (Owner.CantUseHoldout()) { if (Projectile.ai[1] != 1f) { @@ -146,7 +145,7 @@ namespace CalamityMod.Projectiles.Ranged // Rumble (only while channeling) float rumble = MathHelper.Clamp(CurrentChargingFrames, 0f, OpalStriker.FullChargeFrames); - if (OwnerCanShoot) + if (!Owner.CantUseHoldout()) Projectile.position += Main.rand.NextVector2Circular(rumble / 30f, rumble / 30f); } diff --git a/Projectiles/Ranged/PhangasmBow.cs b/Projectiles/Ranged/PhangasmBow.cs index 22be884ad1..cf9d398386 100644 --- a/Projectiles/Ranged/PhangasmBow.cs +++ b/Projectiles/Ranged/PhangasmBow.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Ranged fullSpeed = true; int arg_1EF4_0 = (int)Projectile.ai[0] / (delayCompare - fireSpeedCompare * fireSpeed); } - bool canUseItem = player.channel && player.HasAmmo(player.ActiveItem()) && !player.noItems && !player.CCed; + bool canUseItem = !player.CantUseHoldout() && player.HasAmmo(player.ActiveItem()); if (Projectile.localAI[0] > 0f) { Projectile.localAI[0] -= 1f; diff --git a/Projectiles/Ranged/PumplerHoldout.cs b/Projectiles/Ranged/PumplerHoldout.cs index 2209c5cc97..6b84143409 100644 --- a/Projectiles/Ranged/PumplerHoldout.cs +++ b/Projectiles/Ranged/PumplerHoldout.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged private Player Owner => Main.player[Projectile.owner]; - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; private ref float CurrentChargingFrames => ref Projectile.ai[0]; private ref float PumpkinsCharge => ref Projectile.ai[1]; private ref float FramesToLoadNextPumpkin => ref Projectile.localAI[0]; @@ -50,7 +49,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 tipPosition = armPosition + Projectile.velocity * Projectile.width * 0.5f; // Unloads all pumpkins if you can't shoot/stop holding out the projectile or if the gun is overfilled - if (!OwnerCanShoot || Overfilled == 1f) + if (Owner.CantUseHoldout() || Overfilled == 1f) { if (PumpkinsCharge <= 0f && Overfilled == 0f) //If the projectile isnt playing its animation and if there arent any pumpkins loaded, kill it diff --git a/Projectiles/Ranged/ScorpioHoldout.cs b/Projectiles/Ranged/ScorpioHoldout.cs index 771eab1869..ba60966ccb 100644 --- a/Projectiles/Ranged/ScorpioHoldout.cs +++ b/Projectiles/Ranged/ScorpioHoldout.cs @@ -45,8 +45,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { // If there's no player, or the player is the server, or the owner's stunned, there'll be no holdout. - bool cantUse = Owner == null || !Owner.active || Owner.dead || !Owner.channel || Main.myPlayer != Projectile.owner || Owner.CCed || Owner.noItems; - if (cantUse) + if (Owner.CantUseHoldout()) { Projectile.Kill(); NetUpdate(); diff --git a/Projectiles/Ranged/SevensStrikerHoldout.cs b/Projectiles/Ranged/SevensStrikerHoldout.cs index 5996cb2eb8..4de9f0c215 100644 --- a/Projectiles/Ranged/SevensStrikerHoldout.cs +++ b/Projectiles/Ranged/SevensStrikerHoldout.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Ranged { Player player = Main.player[Projectile.owner]; Vector2 playerpos = player.RotatedRelativePoint(player.MountedCenter, true); - bool shouldBeHeld = player.channel && !player.noItems && !player.CCed; + bool shouldBeHeld = !player.CantUseHoldout(); int shot; float scaleFactor = 14f; diff --git a/Projectiles/Ranged/StarfleetMK2Gun.cs b/Projectiles/Ranged/StarfleetMK2Gun.cs index 02b6de6ec7..d2697996c9 100644 --- a/Projectiles/Ranged/StarfleetMK2Gun.cs +++ b/Projectiles/Ranged/StarfleetMK2Gun.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.ai[1] = baseUseTime - modifier * Projectile.localAI[0]; timeToFire = true; } - bool canFire = player.channel && player.HasAmmo(player.ActiveItem()) && !player.noItems && !player.CCed; + bool canFire = !player.CantUseHoldout() && player.HasAmmo(player.ActiveItem()); if (Projectile.soundDelay <= 0 && canFire) { Projectile.soundDelay = baseUseTime - modifier * (int)Projectile.localAI[0]; diff --git a/Projectiles/Ranged/StarmageddonHeld.cs b/Projectiles/Ranged/StarmageddonHeld.cs index 8d65941729..7b7b147c26 100644 --- a/Projectiles/Ranged/StarmageddonHeld.cs +++ b/Projectiles/Ranged/StarmageddonHeld.cs @@ -71,14 +71,13 @@ namespace CalamityMod.Projectiles.Ranged Projectile.frame = 7; bool timeToFire = noStars && Projectile.frame == 7; - bool canFire = player.channel && !player.noItems && !player.CCed; - if (!canFire) + if (player.CantUseHoldout()) Projectile.Kill(); Vector2 playerPosition = player.RotatedRelativePoint(player.MountedCenter, true); if (timeToFire && Main.myPlayer == Projectile.owner) { - if (canFire) + if (!player.CantUseHoldout()) { SoundEngine.PlaySound(SoundID.Item92, Projectile.Center); diff --git a/Projectiles/Ranged/SurgeDriverHoldout.cs b/Projectiles/Ranged/SurgeDriverHoldout.cs index 8950c735c4..b0542bac73 100644 --- a/Projectiles/Ranged/SurgeDriverHoldout.cs +++ b/Projectiles/Ranged/SurgeDriverHoldout.cs @@ -12,7 +12,6 @@ namespace CalamityMod.Projectiles.Ranged { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public Player Owner => Main.player[Projectile.owner]; - public bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; public ref float ShootCountdown => ref Projectile.ai[0]; public override void SetDefaults() @@ -35,12 +34,10 @@ namespace CalamityMod.Projectiles.Ranged UpdateProjectileHeldVariables(armPosition); ManipulatePlayerVariables(); - if (!OwnerCanShoot) - { - // Prevent spam clicking by letting the animation run if the player just stops holding - if (Owner.noItems || Owner.CCed || Owner.dead || ShootCountdown < 0f) - Projectile.Kill(); - } + // Prevent spam clicking by letting the animation run if the player just stops holding + if (Owner.CantUseHoldout() && ShootCountdown < 0f) + Projectile.Kill(); + // Can't shoot on frame 1 as it can't use ammo yet else if (ShootCountdown < 0f && Owner.HasAmmo(Owner.ActiveItem())) { diff --git a/Projectiles/Ranged/TerraFlamebursterHouldout.cs b/Projectiles/Ranged/TerraFlamebursterHouldout.cs index 9481b8c9ea..aa3645be19 100644 --- a/Projectiles/Ranged/TerraFlamebursterHouldout.cs +++ b/Projectiles/Ranged/TerraFlamebursterHouldout.cs @@ -1,10 +1,5 @@ using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Particles; -using log4net.Core; using Microsoft.Xna.Framework; -using Mono.Cecil; -using ReLogic.Utilities; -using System; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -25,7 +20,6 @@ namespace CalamityMod.Projectiles.Ranged public int ShotCooldown; public int FireBlobs = 0; public int Time = 0; - private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed; public override void SetDefaults() { @@ -55,10 +49,8 @@ namespace CalamityMod.Projectiles.Ranged Vector2 tipPosition = armPosition + Projectile.velocity * Projectile.width * 0.8f; // Kill if the owner stops channeling or otherwise cannot use the weapon. - if (!OwnerCanShoot) - { + if (Owner.CantUseHoldout()) Projectile.Kill(); - } else { // While channeled, keep refreshing the projectile lifespan @@ -92,7 +84,7 @@ namespace CalamityMod.Projectiles.Ranged else { if (ShootTimer == 1) - SoundEngine.PlaySound(SoundID.Item73 with { Volume = 0.7f}, Projectile.Center); + SoundEngine.PlaySound(SoundID.Item73 with { Volume = 0.7f }, Projectile.Center); ShotsFired = 0; for (int i = 0; i < 2; i++) { diff --git a/Projectiles/Ranged/UltimaBowProjectile.cs b/Projectiles/Ranged/UltimaBowProjectile.cs index 01a3f2459e..4a7d7e186b 100644 --- a/Projectiles/Ranged/UltimaBowProjectile.cs +++ b/Projectiles/Ranged/UltimaBowProjectile.cs @@ -1,6 +1,6 @@ -using CalamityMod.Items.Weapons.Ranged; +using System; +using CalamityMod.Items.Weapons.Ranged; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -43,8 +43,7 @@ namespace CalamityMod.Projectiles.Ranged public void AttemptToFireProjectiles(Player player) { - bool canFire = player.channel && player.HasAmmo(player.ActiveItem()) && !player.noItems && !player.CCed; - if (!canFire) + if (player.CantUseHoldout() || !player.HasAmmo(player.ActiveItem())) { Projectile.Kill(); return; diff --git a/Projectiles/Rogue/FinalDawnProjectile.cs b/Projectiles/Rogue/FinalDawnProjectile.cs index 6f97f45932..6087da1c03 100644 --- a/Projectiles/Rogue/FinalDawnProjectile.cs +++ b/Projectiles/Rogue/FinalDawnProjectile.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Rogue if (Main.myPlayer == Projectile.owner) { - if (!player.channel || player.noItems || player.CCed) + if (player.CantUseHoldout()) { AttemptExecuteAttacks(player); Projectile.Kill(); diff --git a/Projectiles/Typeless/TerminusHoldout.cs b/Projectiles/Typeless/TerminusHoldout.cs index ec89caa8ee..586a5bb926 100644 --- a/Projectiles/Typeless/TerminusHoldout.cs +++ b/Projectiles/Typeless/TerminusHoldout.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { Time++; - if (!Owner.channel || Owner.noItems || Owner.CCed) + if (Owner.CantUseHoldout()) { // Reset the boss rush timer to what it would normally be if disabling is done prematurely. if (BossRushEvent.BossRushActive || BossRushEvent.StartTimer > 0) diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index 578c40e2fa..ce3f29870b 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -282,7 +282,7 @@ namespace CalamityMod return false; return true; } - + // See also: Player.IsStandingStillForSpecialEffects (Vanilla shiny stone + standing still mana regen) // That is more or less equivalent to this with the default value of 0.05 public static bool StandingStill(this Player player, float velocity = 0.05f) => player.velocity.Length() < velocity; @@ -713,7 +713,7 @@ namespace CalamityMod #endregion #region Visual Layers - public static void HideAccessories(this Player player, bool hideHeadAccs = true, bool hideBodyAccs = true, bool hideLegAccs = true, bool hideShield = true) + public static void HideAccessories(this Player player, bool hideHeadAccs = true, bool hideBodyAccs = true, bool hideLegAccs = true, bool hideShield = true) { if (hideHeadAccs) player.face = -1; @@ -722,7 +722,7 @@ namespace CalamityMod { player.handon = -1; player.handoff = -1; - + player.back = -1; player.front = -1; player.neck = -1; @@ -739,6 +739,13 @@ namespace CalamityMod } #endregion + /// + /// A shorthand bool to check if the player can continue using the holdout or not. + /// + /// The player using the holdout. + /// Returns if the player CAN'T use the item. + public static bool CantUseHoldout(this Player player) => player == null || !player.active || player.dead || !player.channel || player.CCed || player.noItems; + /// /// Makes the given player send the given packet to all appropriate receivers.
/// If server is false, the packet is sent only to the multiplayer host.
From 98c87397cdb75d1dde9d1c8c79d894676886a27d Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sun, 18 Feb 2024 11:33:33 -0500 Subject: [PATCH 24/24] Changed all non-remix DamageRatios to DamageExacts Should be no actual damage changes --- Items/CalamityGlobalItemTweaks.cs | 47 +++++++++++++++---------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 0673fdc852..e23e34a84b 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -81,20 +81,20 @@ namespace CalamityMod.Items { ItemID.CrystalStorm, Do(DamageExact(40)) }, { ItemID.CursedArrow, Do(DamageExact(15)) }, { ItemID.CursedDart, Do(DamageExact(25)) }, - { ItemID.Cutlass, Do(UseRatio(0.9f), DamageRatio(1.85f)) }, + { ItemID.Cutlass, Do(UseRatio(0.9f), DamageExact(90)) }, { ItemID.DaedalusStormbow, Do(DamageExact(30)) }, { ItemID.DaoofPow, Do(DamageExact(160)) }, { ItemID.DarkLance, Do(AutoReuse, TrueMelee, DamageExact(45)) }, { ItemID.DartRifle, Do(PointBlank, DamageExact(58)) }, { ItemID.DayBreak, Do(DamageExact(125), UseExact(20)) }, - { ItemID.DD2BetsyBow, Do(DamageRatio(1.1f)) }, // Aerial Bane's ridiculous multiplier is removed, so this compensates for that + { ItemID.DD2BetsyBow, Do(DamageExact(42)) }, // Aerial Bane's ridiculous multiplier is removed, so this compensates for that { ItemID.DD2SquireBetsySword, Do(UseMeleeSpeed, DamageExact(150)) }, // Flying Dragon { ItemID.DD2SquireDemonSword, Do(DamageExact(110), UseExact(25)) }, // Brand of the Inferno { ItemID.DeathSickle, Do(UseMeleeSpeed, DamageExact(82), ShootSpeedExact(15f)) }, { ItemID.DemonBow, Do(PointBlank, DamageExact(12), AutoReuse) }, { ItemID.DemonScythe, Do(AutoReuse, DamageExact(33)) }, { ItemID.DyeTradersScimitar, Do(AutoReuse, UseTurn, DamageExact(24)) }, // Exotic Scimitar - { ItemID.ElectrosphereLauncher, Do(DamageRatio(1.1f)) }, + { ItemID.ElectrosphereLauncher, Do(DamageExact(44)) }, { ItemID.ElfMelter, Do(ShootSpeedDelta(+5f)) }, { ItemID.EmeraldStaff, Do(DamageExact(27)) }, { ItemID.EmpressBlade, Do(AutoReuse, DamageExact(60), UseExact(20)) }, // Terraprisma @@ -108,7 +108,7 @@ namespace CalamityMod.Items // { ItemID.FireworksLauncher, Do(DamageRatio(2f)) }, // Celebration { ItemID.Flairon, Do(DamageExact(73)) }, { ItemID.Flamarang, Do(DamageExact(40)) }, - { ItemID.Flamelash, Do(DamageRatio(1.25f)) }, + { ItemID.Flamelash, Do(DamageExact(40)) }, { ItemID.Flamethrower, Do(DamageExact(21), ShootSpeedDelta(+3f)) }, { ItemID.FlowerofFire, Do(AutoReuse, ManaExact(7), UseRatio(0.88f), DamageRatio(0.65f)) }, // Uses ratios due to remix seed { ItemID.FlowerofFrost, Do(AutoReuse, ManaExact(7), UseExact(22), DamageExact(70), ShootSpeedExact(14)) }, @@ -122,7 +122,7 @@ namespace CalamityMod.Items { ItemID.Gradient, Do(AutoReuse, DamageExact(39)) }, { ItemID.GreenPhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) }, { ItemID.GreenPhasesaber, Do(ScaleRatio(1.5f), DamageExact(60)) }, - { ItemID.GrenadeLauncher, Do(DamageRatio(1.5f)) }, + { ItemID.GrenadeLauncher, Do(DamageExact(90)) }, { ItemID.Gungnir, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(92), ShootSpeedRatio(1.25f)) }, { ItemID.HallowedRepeater, Do(PointBlank, UseExact(12)) }, { ItemID.Handgun, Do(PointBlank, UseExact(22), DamageExact(36)) }, @@ -136,7 +136,7 @@ namespace CalamityMod.Items { ItemID.IceSickle, Do(AutoReuse, UseMeleeSpeed, DamageExact(75), ShootSpeedExact(20f)) }, { ItemID.IchorArrow, Do(DamageExact(11)) }, { ItemID.ImpStaff, Do(AutoReuse, UseExact(30), DamageExact(25)) }, - { ItemID.InfernoFork, Do(DamageRatio(1.2f)) }, + { ItemID.InfernoFork, Do(DamageExact(84)) }, { ItemID.InfluxWaver, Do(UseMeleeSpeed, DamageExact(80), UseExact(25)) }, { ItemID.IronShortsword, Do(AutoReuse, TrueMelee, DamageExact(10)) }, { ItemID.JestersArrow, Do(DamageExact(6)) }, @@ -147,21 +147,21 @@ namespace CalamityMod.Items { ItemID.LastPrism, Do(DamageExact(57), ManaExact(10)) }, { ItemID.LeadShortsword, Do(AutoReuse, TrueMelee, DamageExact(11)) }, { ItemID.LightDisc, Do(DamageExact(128), ShootSpeedExact(18)) }, - { ItemID.LunarFlareBook, Do(DamageRatio(1.2f)) }, + { ItemID.LunarFlareBook, Do(DamageExact(120)) }, { ItemID.MagicalHarp, Do(DamageExact(50), ShootSpeedExact(12f)) }, { ItemID.MagicDagger, Do(DamageRatio(1.8f), UseRatio(1.88f), ShootSpeedExact(30)) }, // Uses ratios due to remix seed { ItemID.MagicMissile, Do(DamageExact(23), ManaExact(10), UseAnimationExact(20), UseTimeExact(10)) }, - { ItemID.MagnetSphere, Do(DamageRatio(1.1f)) }, + { ItemID.MagnetSphere, Do(DamageExact(52)) }, { ItemID.Marrow, Do(PointBlank, DamageExact(69)) }, - { ItemID.MedusaHead, Do(ManaExact(6), DamageRatio(1.2f)) }, - { ItemID.Meowmere, Do(UseMeleeSpeed, DamageExact(240)/*, DamageRatio(1.33f) */) }, + { ItemID.MedusaHead, Do(ManaExact(6), DamageExact(48)) }, + { ItemID.Meowmere, Do(UseMeleeSpeed, DamageExact(240)) }, { ItemID.MeteorStaff, Do(DamageExact(58), ManaExact(7), ShootSpeedExact(13f)) }, { ItemID.MiniNukeI, Do(DamageExact(90)) }, { ItemID.MiniNukeII, Do(DamageExact(90)) }, { ItemID.Minishark, Do(PointBlank, DamageExact(4)) }, { ItemID.MoltenFury, Do(PointBlank, UseExact(29), AutoReuse) }, { ItemID.MonkStaffT1, Do(TrueMeleeNoSpeed, DamageExact(83)) }, // Sleepy Octopod - { ItemID.MonkStaffT2, Do(AutoReuse, TrueMelee, DamageRatio(2f)) }, // Ghastly Glaive + { ItemID.MonkStaffT2, Do(AutoReuse, TrueMelee, DamageExact(90)) }, // Ghastly Glaive { ItemID.MonkStaffT3, Do(DamageExact(225)) }, // Sky Dragon's Fury { ItemID.Muramasa, Do(CritDelta(+20)) }, { ItemID.MushroomSpear, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(100)) }, @@ -182,8 +182,8 @@ namespace CalamityMod.Items { ItemID.PalladiumPike, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(96)) }, { ItemID.PalladiumRepeater, Do(PointBlank, DamageExact(45)) }, { ItemID.PalladiumSword, Do(UseTurn, ScaleRatio(1.4f), DamageExact(100)) }, - { ItemID.PearlwoodBow, Do(AutoReuse, PointBlank, DamageRatio(2.31f), UseDelta(+8), ShootSpeedDelta(+3.4f), KnockbackDelta(+1f)) }, - { ItemID.PearlwoodSword, Do(UseTurn, DamageRatio(1.5f)) }, + { ItemID.PearlwoodBow, Do(AutoReuse, PointBlank, DamageExact(20), UseDelta(+8), ShootSpeedDelta(+3.4f), KnockbackDelta(+1f)) }, + { ItemID.PearlwoodSword, Do(UseTurn, DamageExact(45)) }, { ItemID.PewMaticHorn, Do(DamageExact(24)) }, { ItemID.Phantasm, Do(PointBlank, DamageExact(48)) }, { ItemID.PhoenixBlaster, Do(AutoReuse, PointBlank, UseExact(18)) }, @@ -192,7 +192,7 @@ namespace CalamityMod.Items { ItemID.PlatinumShortsword, Do(AutoReuse, TrueMelee, DamageExact(18)) }, { ItemID.PoisonStaff, Do(DamageExact(57)) }, { ItemID.PossessedHatchet, Do(DamageExact(135)) }, - { ItemID.PsychoKnife, Do(UseTurn, UseExact(11), DamageRatio(3f)) }, + { ItemID.PsychoKnife, Do(UseTurn, UseExact(11), DamageExact(255)) }, { ItemID.PurpleClubberfish, Do(UseTurn, ScaleRatio(1.2f), KnockbackExact(10f)) }, { ItemID.PurplePhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) }, { ItemID.PurplePhasesaber, Do(ScaleRatio(1.5f), DamageExact(60)) }, @@ -224,21 +224,20 @@ namespace CalamityMod.Items { ItemID.SkyFracture, Do(DamageExact(54), ShootSpeedExact(30f)) }, { ItemID.SlapHand, Do(UseTurn, ScaleRatio(1.5f), DamageExact(120)) }, { ItemID.Smolstar, Do(DamageExact(9), AutoReuse, UseExact(25)) }, // Blade Staff - { ItemID.SolarEruption, Do(DamageRatio(1.5f)) }, - // Life Drain could probably get a bigger buff - { ItemID.SoulDrain, Do(DamageRatio(1.1f)) }, // Life Drain + { ItemID.SolarEruption, Do(DamageExact(157)) }, + { ItemID.SoulDrain, Do(DamageExact(38)) }, // Life Drain { ItemID.SpaceGun, Do(DamageExact(25)) }, { ItemID.Spear, Do(AutoReuse, TrueMelee, DamageExact(14)) }, - { ItemID.SpectreStaff, Do(DamageRatio(1.2f)) }, + { ItemID.SpectreStaff, Do(DamageExact(78)) }, { ItemID.SpiritFlame, Do(UseExact(20), ManaExact(11), ShootSpeedExact(2f)) }, - { ItemID.StaffofEarth, Do(DamageRatio(1.2f)) }, + { ItemID.StaffofEarth, Do(DamageExact(150)) }, { ItemID.StarCannon, Do(DamageExact(25)) }, { ItemID.StardustDragonStaff, Do(AutoReuse, DamageExact(20), UseExact(19)) }, { ItemID.StormTigerStaff, Do(AutoReuse, DamageExact(49), UseExact(20)) }, // Desert Tiger Staff { ItemID.StylistKilLaKillScissorsIWish, Do(AutoReuse, UseTurn, DamageExact(18)) }, // Stylish Scissors { ItemID.Stynger, Do(DamageExact(75)) }, { ItemID.Swordfish, Do(AutoReuse, TrueMelee, DamageExact(24)) }, - { ItemID.TacticalShotgun, Do(PointBlank, DamageRatio(1.2f)) }, + { ItemID.TacticalShotgun, Do(PointBlank, DamageExact(34)) }, { ItemID.TaxCollectorsStickOfDoom, Do(AutoReuse, UseTurn, ScaleRatio(1.5f), UseRatio(0.8f), DamageExact(70)) }, { ItemID.TendonBow, Do(PointBlank, DamageExact(17), AutoReuse) }, { ItemID.TerraBlade, Do(DamageExact(122)) }, @@ -264,14 +263,14 @@ namespace CalamityMod.Items { ItemID.TungstenShortsword, Do(AutoReuse, TrueMelee, DamageExact(15)) }, { ItemID.UnholyArrow, Do(DamageExact(11)) }, { ItemID.UnholyTrident, Do(ManaRatio(0.78f), DamageRatio(0.91f)) }, // Uses ratios due to remix seed - { ItemID.VampireKnives, Do(DamageRatio(1.33f)) }, + { ItemID.VampireKnives, Do(DamageExact(38)) }, { ItemID.ValkyrieYoyo, Do(AutoReuse, DamageExact(48)) }, // Red's Throw and Valkyrie Yoyo are the same weapon basically - { ItemID.VenomStaff, Do(DamageRatio(1.25f)) }, + { ItemID.VenomStaff, Do(DamageExact(55)) }, { ItemID.WaspGun, Do(UseExact(11), DamageExact(58)) }, { ItemID.WaterBolt, Do(DamageExact(23)) }, { ItemID.WhitePhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) }, { ItemID.WhitePhasesaber, Do(ScaleRatio(1.5f), DamageExact(60)) }, - { ItemID.WoodenBoomerang, Do(DamageRatio(2f), Value(Item.sellPrice(copper: 20))) }, + { ItemID.WoodenBoomerang, Do(DamageExact(16), Value(Item.sellPrice(copper: 20))) }, { ItemID.Yelets, Do(AutoReuse, DamageExact(53)) }, { ItemID.YellowPhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) }, { ItemID.YellowPhasesaber, Do(ScaleRatio(1.5f), DamageExact(60)) }, @@ -373,7 +372,7 @@ namespace CalamityMod.Items { ItemID.PalladiumPickaxe, Do(PickPower(130), UseTimeExact(9)) }, { ItemID.PalladiumWaraxe, Do(AxePower(125), UseTimeExact(12), TileBoostExact(+0)) }, { ItemID.PalmWoodHammer, Do(HammerPower(25), UseTimeExact(11), TileBoostExact(+0)) }, - { ItemID.PearlwoodHammer, Do(HammerPower(25), UseTimeExact(4), UseAnimationExact(20), DamageRatio(4f), TileBoostExact(+0)) }, + { ItemID.PearlwoodHammer, Do(HammerPower(25), UseTimeExact(4), UseAnimationExact(20), DamageExact(36), TileBoostExact(+0)) }, { ItemID.PickaxeAxe, Do(PickPower(200), AxePower(110), UseTimeExact(7), TileBoostExact(+1)) }, { ItemID.Picksaw, Do(PickPower(210), AxePower(125), UseTimeExact(6), TileBoostExact(+1)) }, { ItemID.PlatinumAxe, Do(AxePower(80), UseTimeExact(14), TileBoostExact(+0)) },