diff --git a/Gores/SeadragonCasing.png b/Gores/SeadragonCasing.png new file mode 100644 index 0000000000..7faaa79ce6 Binary files /dev/null and b/Gores/SeadragonCasing.png differ diff --git a/Gores/SeadragonMag.png b/Gores/SeadragonMag.png new file mode 100644 index 0000000000..681b0094dd Binary files /dev/null and b/Gores/SeadragonMag.png differ diff --git a/Items/Weapons/Ranged/Archerfish.cs b/Items/Weapons/Ranged/Archerfish.cs index 642e47ca2b..049bc504b1 100644 --- a/Items/Weapons/Ranged/Archerfish.cs +++ b/Items/Weapons/Ranged/Archerfish.cs @@ -5,41 +5,66 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Localization; namespace CalamityMod.Items.Weapons.Ranged { public class Archerfish : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + + public static int AmmoSavedPercent = 33; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent); + public override void SetDefaults() { Item.width = 78; Item.height = 36; Item.damage = 16; Item.DamageType = DamageClass.Ranged; - Item.useTime = 6; - Item.useAnimation = 6; - Item.channel = true; + Item.useTime = 11; + Item.useAnimation = 11; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; - Item.knockBack = 2.5f; + Item.knockBack = 2f; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; - Item.UseSound = null; + Item.UseSound = SoundID.Item85; Item.autoReuse = true; - Item.noUseGraphic = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 2f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 11f; Item.useAmmo = AmmoID.Bullet; } - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; - public override bool RangedPrefix() => true; //Can't scale with attack speed, but should still be able to recieve Unreal - public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.NextFloat() > 0.95f && player.ownedProjectileCounts[Item.shoot] > 0; + + public override Vector2? HoldoutOffset() => new Vector2(-10, -5); + 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, position, velocity, Item.shoot, damage, knockback, player.whoAmI); - holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); + // Reposition to the gun's tip + Vector2 newPos = position + new Vector2(60f, player.direction * (Math.Abs(velocity.SafeNormalize(Vector2.Zero).X) < 0.02f ? -2f : -8f)).RotatedBy(velocity.ToRotation()); + + // Fires a spread of harmless bubbles + for (int i = 0; i < 4; i++) + { + Gore bubble = Gore.NewGorePerfect(source, newPos, velocity.RotatedByRandom(MathHelper.ToRadians(30f)) * 0.5f, 411); + bubble.timeLeft = 6 + Main.rand.Next(4); + bubble.scale = Main.rand.NextFloat(0.6f, 0.8f); + bubble.type = Main.rand.NextBool(3) ? 412 : 411; + } + + // Replaces standard bullets with water jets. + if (type == ProjectileID.Bullet) + Projectile.NewProjectile(source, newPos, velocity, Item.shoot, damage, knockback, player.whoAmI); + else + Projectile.NewProjectile(source, newPos, velocity, type, damage, knockback, player.whoAmI); + + // Always fires a close range water blast. + int waterRingDamage = (int)(damage * 0.5f); + float boostedKB = knockback + 5f; + Projectile.NewProjectile(source, newPos, velocity * 0.5f, ModContent.ProjectileType(), waterRingDamage, boostedKB, player.whoAmI); + return false; } + public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= AmmoSavedPercent; } } diff --git a/Items/Weapons/Ranged/Megalodon.cs b/Items/Weapons/Ranged/Megalodon.cs index caaf31a6e4..e4fe7564e0 100644 --- a/Items/Weapons/Ranged/Megalodon.cs +++ b/Items/Weapons/Ranged/Megalodon.cs @@ -8,6 +8,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Localization; namespace CalamityMod.Items.Weapons.Ranged { @@ -15,11 +16,13 @@ namespace CalamityMod.Items.Weapons.Ranged { public new string LocalizationCategory => "Items.Weapons.Ranged"; public int sharkGunDamageScaling = 0; + public static int AmmoSavedPercent = 50; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent); public override void SetDefaults() { Item.width = 102; - Item.height = 42; + Item.height = 43; Item.damage = 58; Item.DamageType = DamageClass.Ranged; Item.useTime = 4; @@ -39,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Ranged } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override bool RangedPrefix() => true; //Can't scale with attack speed, but should still be able to recieve Unreal - public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.NextFloat() > 0.95f && player.ownedProjectileCounts[Item.shoot] > 0; + public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0 && Main.rand.Next(100) >= AmmoSavedPercent; 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, position, velocity, Item.shoot, damage, knockback, player.whoAmI); diff --git a/Items/Weapons/Ranged/Megalodon.png b/Items/Weapons/Ranged/Megalodon.png index f90b9be703..6d3e45d1aa 100644 Binary files a/Items/Weapons/Ranged/Megalodon.png and b/Items/Weapons/Ranged/Megalodon.png differ diff --git a/Items/Weapons/Ranged/Seadragon.cs b/Items/Weapons/Ranged/Seadragon.cs index 1a3657a7a2..c1b5fdcf3d 100644 --- a/Items/Weapons/Ranged/Seadragon.cs +++ b/Items/Weapons/Ranged/Seadragon.cs @@ -8,6 +8,7 @@ using Terraria; using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged @@ -15,6 +16,8 @@ namespace CalamityMod.Items.Weapons.Ranged public class Seadragon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + public static int AmmoSavedPercent = 66; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent); public override void SetDefaults() { @@ -41,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override Vector2? HoldoutOffset() => new Vector2(-10, 0); public override bool RangedPrefix() => true; //Can't scale with attack speed, but should still be able to recieve Unreal public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; - public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.NextFloat() > 0.95f && player.ownedProjectileCounts[Item.shoot] > 0; + public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0 && Main.rand.Next(100) >= AmmoSavedPercent; 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, position, velocity, Item.shoot, damage, knockback, player.whoAmI); diff --git a/Items/Weapons/Ranged/Voidragon.cs b/Items/Weapons/Ranged/Voidragon.cs index 935173c4b5..5a4f7bd84d 100644 --- a/Items/Weapons/Ranged/Voidragon.cs +++ b/Items/Weapons/Ranged/Voidragon.cs @@ -6,6 +6,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged @@ -15,6 +16,8 @@ namespace CalamityMod.Items.Weapons.Ranged { public new string LocalizationCategory => "Items.Weapons.Ranged"; public int sharkGunDamageScaling = 0; + public static int AmmoSavedPercent = 66; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent); public override void SetStaticDefaults() { @@ -47,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override bool RangedPrefix() => true; //Can't scale with attack speed, but should still be able to recieve Unreal - public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.NextFloat() > 0.95f && player.ownedProjectileCounts[Item.shoot] > 0; + public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0 && Main.rand.Next(100) >= AmmoSavedPercent; 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, position, velocity, Item.shoot, damage, knockback, player.whoAmI); diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index ee926c25be..a07c595b6d 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -712,8 +712,10 @@ Megalodon: { DisplayName: Megalodon Tooltip: ''' - Rapidly fires alternating bullets and pressurized water jets - Water jets consume no ammo + Loads a 30 round magazine of bullets and pressurized water streams that are rapidly unleashed + After firing, the gun unleashes a powerful homing rocket before reloading + Rocket damage is based on how many shots hit + {$CommonItemTooltip.PercentChanceToSaveAmmo} ''' } @@ -1058,9 +1060,10 @@ Seadragon: { DisplayName: Seadragon Tooltip: ''' - Unleashes a deluge of alternating bullets and pressurized water jets - Additionally fires rockets and emits devastating muzzle blasts - Water jets consume no ammo + Loads a 50 round deluge of alternating bullets and pressurized water jets + Water jets summon small fish that swim around you + Once your mag runs empty, all fish rush towards the cursor before reloading + {$CommonItemTooltip.PercentChanceToSaveAmmo} ''' } @@ -1474,9 +1477,11 @@ Voidragon: { DisplayName: Voidragon Tooltip: ''' - Fires void blasts that explode every other shot - Shoots demon flame tentacles alongside every shot - Void blasts consume no ammo and bullets have a {0}% chance to save ammo + Loads a 50 round onslaught of alternating bullets and void blasts + Once your mag runs empty, the gun unleashes a jet of abyssal fire that annihilates anything in its path + The abyssal fire and lingering flames grow increasingly powerful with the amount of shots you hit + {$CommonItemTooltip.PercentChanceToSaveAmmo} + [c/620BB0: 'Fade to black'] ''' } diff --git a/Projectiles/Magic/RancorFog.cs b/Projectiles/Magic/RancorFog.cs index bc4ee599e4..aefe9a2e09 100644 --- a/Projectiles/Magic/RancorFog.cs +++ b/Projectiles/Magic/RancorFog.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 origin = texture.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition; float opacity = Utils.GetLerpValue(0f, 0.08f, LightPower, true) * Projectile.Opacity * 0.5f; - Color drawColor = new Color(236, 0, 68) * opacity; + Color drawColor = Projectile.localAI[0] == 2f ? new Color(236, 0, 68) : Color.Indigo * opacity; Vector2 scale = Projectile.Size / texture.Size() * Projectile.scale; Main.EntitySpriteDraw(texture, drawPosition, null, drawColor, Projectile.rotation, origin, scale, SpriteEffects.None, 0); diff --git a/Projectiles/Ranged/AbyssalFire.cs b/Projectiles/Ranged/AbyssalFire.cs index 095cdebee7..4f73421d4e 100644 --- a/Projectiles/Ranged/AbyssalFire.cs +++ b/Projectiles/Ranged/AbyssalFire.cs @@ -9,6 +9,7 @@ using CalamityMod.Effects; using CalamityMod.Enums; using CalamityMod.Graphics.Metaballs; using CalamityMod.Graphics.Primitives; +using CalamityMod.NPCs; using CalamityMod.Packets.Entities; using CalamityMod.Particles; using CalamityMod.Utilities.Daybreak; @@ -25,6 +26,7 @@ using Terraria.WorldBuilding; namespace CalamityMod.Projectiles.Ranged { + [PierceResistException] public class AbyssalFire : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; diff --git a/Projectiles/Ranged/ArcherfishShot.cs b/Projectiles/Ranged/ArcherfishShot.cs index 220786a5ec..0f128affa3 100644 --- a/Projectiles/Ranged/ArcherfishShot.cs +++ b/Projectiles/Ranged/ArcherfishShot.cs @@ -28,6 +28,15 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { + // Bubbles + if (Main.rand.NextBool()) + { + Gore bubble = Gore.NewGorePerfect(Projectile.GetSource_FromAI(), Projectile.position, Projectile.velocity * 0.2f + Main.rand.NextVector2Circular(1f, 1f), 411); + bubble.timeLeft = 9 + Main.rand.Next(7); + bubble.scale = Main.rand.NextFloat(0.6f, 1f); + bubble.type = Main.rand.NextBool(3) ? 412 : 411; + } + // Water trail for (int i = 0; i < 6; i++) { @@ -53,23 +62,11 @@ namespace CalamityMod.Projectiles.Ranged { target.AddBuff(BuffID.Wet, 120); target.AddBuff(ModContent.BuffType(), 120); - //Only increase damage on the first hit - if (Projectile.numHits == 0) - { - Player Owner = Main.player[Projectile.owner]; - Owner.Calamity().sharkGunDamageScaling++; - } } public override void OnHitPlayer(Player target, Player.HurtInfo info) { target.AddBuff(BuffID.Wet, 120); target.AddBuff(ModContent.BuffType(), 120); - //Only increase damage on the first hit - if (Projectile.numHits == 0) - { - Player Owner = Main.player[Projectile.owner]; - Owner.Calamity().sharkGunDamageScaling++; - } } } } diff --git a/Projectiles/Ranged/MegalodonHoldout.cs b/Projectiles/Ranged/MegalodonHoldout.cs index 3303d73d71..5e0324fffd 100644 --- a/Projectiles/Ranged/MegalodonHoldout.cs +++ b/Projectiles/Ranged/MegalodonHoldout.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Ranged framesBetweenShots = 4; OffsetLengthFromArm -= 3f; //Here we detect which ammo the bullets will use - Owner.PickAmmo(Owner.HeldItem, out int bulletAMMO, out float SpeedNoUse, out int bulletDamage, out float kBackNoUse, out _, !Main.rand.NextBool(4)); + Owner.PickAmmo(Owner.HeldItem, out int bulletAMMO, out float SpeedNoUse, out int bulletDamage, out float kBackNoUse, out _); //Alternate between shooting bullets and water streams. We seperate it into two different projectiles due to the bullets needing to use a Global Projectile to track the damage multiplier if (!swapType) { diff --git a/Projectiles/Ranged/SeadragonHoldout.cs b/Projectiles/Ranged/SeadragonHoldout.cs index 12b08670f3..f6aa8abe8b 100644 --- a/Projectiles/Ranged/SeadragonHoldout.cs +++ b/Projectiles/Ranged/SeadragonHoldout.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Ranged SoundEngine.PlaySound(SoundID.Item149, Projectile.Center); if (Main.netMode != NetmodeID.Server) { - string goreType = Main.rand.NextBool() ? "EmptyAnimosityShell" : "EmptyAnimosityShell2"; + string goreType = "SeadragonMag"; Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.Center, Projectile.velocity.RotatedBy(2f * -Owner.direction) * Main.rand.NextFloat(0.6f, 0.7f), Mod.Find(goreType).Type); } //Set the scaling to 0 whenever it reloads @@ -74,13 +74,19 @@ namespace CalamityMod.Projectiles.Ranged framesBetweenShots = 3; OffsetLengthFromArm -= 2f; //Here we detect which ammo the bullets will use - Owner.PickAmmo(Owner.HeldItem, out int bulletAMMO, out float SpeedNoUse, out int bulletDamage, out float kBackNoUse, out _, !Main.rand.NextBool(4)); + Owner.PickAmmo(Owner.HeldItem, out int bulletAMMO, out float SpeedNoUse, out int bulletDamage, out float kBackNoUse, out _); //Alternate between shooting bullets and water streams. Despite not having damage scaling, the fish gain movement speed based on the scaling, so we still need a Global Projectile if (!swapType) { Projectile scalingShot = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedByRandom(MathHelper.ToRadians(1.5f)), bulletAMMO, Projectile.damage, Projectile.knockBack, Projectile.owner); CalamityGlobalProjectile cgp = scalingShot.Calamity(); cgp.sharkBullets = true; + //Only eject casings from the gun if bullets are fired, preventing too many at once + if (Main.netMode != NetmodeID.Server) + { + string goreType = "SeadragonCasing"; + Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.Center + (-Projectile.velocity * 6), -Projectile.velocity * 4f, Mod.Find(goreType).Type); + } } if (swapType) { diff --git a/Projectiles/Ranged/VoidBlast.cs b/Projectiles/Ranged/VoidBlast.cs index aa14c9d8d6..6b88761727 100644 --- a/Projectiles/Ranged/VoidBlast.cs +++ b/Projectiles/Ranged/VoidBlast.cs @@ -4,6 +4,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Packets.Entities; using CalamityMod.Particles; +using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Typeless; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -81,6 +82,10 @@ namespace CalamityMod.Projectiles.Ranged blast.localAI[1] = debuffTime; blast.timeLeft = 2; blast.DamageType = Projectile.DamageType; + for (int i = 0; i < 2; i++) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Main.rand.NextVector2Circular(6f, 6f), ModContent.ProjectileType(), 0, 0f, Projectile.owner, 0f, 2f); + } #region Visuals and Sounds SoundStyle fire = new("CalamityMod/Sounds/Item/OmicronBeam"); SoundEngine.PlaySound(fire with { Volume = 0.9f }, Projectile.Center); diff --git a/Projectiles/Ranged/VoidragonHoldout.cs b/Projectiles/Ranged/VoidragonHoldout.cs index 1e6b57385d..7a4f92290b 100644 --- a/Projectiles/Ranged/VoidragonHoldout.cs +++ b/Projectiles/Ranged/VoidragonHoldout.cs @@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Ranged framesBetweenShots = 3; OffsetLengthFromArm -= 2.5f; //Here we detect which ammo the bullets will use - Owner.PickAmmo(Owner.HeldItem, out int bulletAMMO, out float SpeedNoUse, out int bulletDamage, out float kBackNoUse, out _, !Main.rand.NextBool(4)); + Owner.PickAmmo(Owner.HeldItem, out int bulletAMMO, out float SpeedNoUse, out int bulletDamage, out float kBackNoUse, out _); //Alternate between shooting bullets and void blasts. We seperate it into two different projectiles due to the bullets needing to use a Global Projectile to track the damage multiplier if (!swapType) { diff --git a/Systems/Collections/CalamityProjectileSets.cs b/Systems/Collections/CalamityProjectileSets.cs index 740bf59a91..82b46cd708 100644 --- a/Systems/Collections/CalamityProjectileSets.cs +++ b/Systems/Collections/CalamityProjectileSets.cs @@ -75,7 +75,8 @@ namespace CalamityMod.Systems.Collections /// Defaults to . /// public static bool[] DoesNotGetHomingWithGrapeBeer = Factory.CreateBoolSet(ProjectileType(), ProjectileType(), ProjectileType(), - ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType()); + ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType()); /// /// Determines what other projectiles this projectile will share ID-static immunity frames with. Defaults to -1, which means that it does not share immunity frames.