diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index d6240557af..3844ca20a3 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -78,6 +78,7 @@ namespace CalamityMod.CalPlayer public bool killSpikyBalls = false; public float KameiTrailXScale = 0.1f; public int KameiBladeUseDelay = 0; + public int SpeedBlasterDashDelayCooldown = 0; public Vector2[] OldPositions = new Vector2[4]; public double contactDamageReduction = 0D; public double projectileDamageReduction = 0D; @@ -174,6 +175,9 @@ namespace CalamityMod.CalPlayer #region Timer and Counter public int gaelSwipes = 0; + public float ColorValue = 0; //used for Speed Blaster's colors + public bool sBlasterDashActivated = false; + public int SpeedBlasterDashVisual = 1; public int Holyhammer = 0; public int PHAThammer = 0; public int StellarHammer = 0; @@ -474,6 +478,7 @@ namespace CalamityMod.CalPlayer public bool hideOfDeus = false; public bool dAmulet = false; public bool gShell = false; + public bool lAmbergris = false; public bool tortShell = false; public bool absorber = false; public bool alwaysHoneyRegen = false; @@ -550,6 +555,7 @@ namespace CalamityMod.CalPlayer public bool crawCarapace = false; public bool baroclaw = false; public bool HasReducedDashFirstFrame = false; + public bool HasIncreasedDashFirstFrame = false; public bool voidOfCalamity = false; public bool voidOfExtinction = false; public bool eArtifact = false; @@ -693,6 +699,7 @@ namespace CalamityMod.CalPlayer public bool godSlayerRanged = false; public bool godSlayerThrowing = false; public bool godSlayerDashHotKeyPressed = false; + public bool SpeedBlasterDashStarted = false; public bool ataxiaBolt = false; public bool ataxiaFire = false; public bool ataxiaVolley = false; @@ -1585,6 +1592,7 @@ namespace CalamityMod.CalPlayer hideOfDeus = false; dAmulet = false; gShell = false; + lAmbergris = false; tortShell = false; absorber = false; alwaysHoneyRegen = false; @@ -1637,6 +1645,7 @@ namespace CalamityMod.CalPlayer crawCarapace = false; baroclaw = false; gShell = false; + lAmbergris = false; tortShell = false; voidOfCalamity = false; voidOfExtinction = false; @@ -2396,6 +2405,7 @@ namespace CalamityMod.CalPlayer godSlayerRanged = false; godSlayerThrowing = false; godSlayerDashHotKeyPressed = false; + SpeedBlasterDashStarted = false; auricBoost = false; silvaSet = false; silvaMage = false; @@ -2933,6 +2943,21 @@ namespace CalamityMod.CalPlayer } } + //Right click dash on Speed Blaster + if (sBlasterDashActivated == true) + { + if ((Player.controlUp || Player.controlDown || Player.controlLeft || Player.controlRight) && !Player.pulley && Player.grappling[0] == -1 && !Player.tongued && !Player.mount.Active && SpeedBlasterDashDelayCooldown == 300 && Player.dashDelay == 0) + { + SpeedBlasterDashStarted = true; + } + } + + if (Player.Calamity().SpeedBlasterDashStarted || (Player.dashDelay != 0 && Player.Calamity().LastUsedDashID == SpeedBlasterDash.ID)) + { + Player.Calamity().DeferredDashID = SpeedBlasterDash.ID; + Player.dash = 0; + } + // Trigger for pressing the Rage hotkey. if (CalamityKeybinds.RageHotKey.JustPressed) { @@ -4167,6 +4192,18 @@ namespace CalamityMod.CalPlayer Player.eocDash = 0; } + // Disable vanilla dashes during god slayer dash + if (SpeedBlasterDashStarted) + { + // Set the player to have no registered vanilla dashes. + Player.dashType = 0; + + // Prevent the possibility of Shield of Cthulhu invulnerability exploits. + Player.eocHit = -1; + if (Player.eocDash != 0) + Player.eocDash = 0; + } + if ((silvaCountdown > 0 && hasSilvaEffect && silvaSet) || (DashID == GodslayerArmorDash.ID && Player.dashDelay < 0)) { if (Player.lifeRegen < 0) diff --git a/CalPlayer/CalamityPlayerDashEffects.cs b/CalPlayer/CalamityPlayerDashEffects.cs index 0224e9cb98..9e36bbecba 100644 --- a/CalPlayer/CalamityPlayerDashEffects.cs +++ b/CalPlayer/CalamityPlayerDashEffects.cs @@ -14,6 +14,7 @@ namespace CalamityMod.CalPlayer public partial class CalamityPlayer : ModPlayer { public int VerticalGodslayerDashTimer; + public int VerticalSpeedBlasterDashTimer; private string dashID; //private backing variable @@ -100,6 +101,13 @@ namespace CalamityMod.CalPlayer } } + if (Player.dashDelay > 0) //Speed Blaster + { + VerticalSpeedBlasterDashTimer = 0; + LastUsedDashID = string.Empty; + return; + } + if (Player.dashDelay > 0) { VerticalGodslayerDashTimer = 0; @@ -135,6 +143,17 @@ namespace CalamityMod.CalPlayer } } + if (UsedDash.IsOmnidirectional && VerticalSpeedBlasterDashTimer < 25) + { + VerticalSpeedBlasterDashTimer++; + if (VerticalSpeedBlasterDashTimer >= 25) + { + Player.dashDelay = dashDelayToApply; + // Stop the player from going flying + Player.velocity *= 0.2f; + } + } + if (HasCustomDash) { Player.vortexStealthActive = false; diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 864b42070a..206402c9cd 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -2015,9 +2015,6 @@ namespace CalamityMod.CalPlayer SoundEngine.PlaySound(SoundID.Item96, Player.Center); } - if ((flameLickedShell) && !Player.panic) - Player.AddBuff(ModContent.BuffType(), 180); - if (gShell) //5 seconds of no dash reduction and reduced defense giantShellPostHit = 300; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 2a62c20776..120723ce40 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -43,6 +43,8 @@ using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.Other; using CalamityMod.NPCs.PlagueEnemies; using CalamityMod.NPCs.TownNPCs; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Healing; using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Rogue; @@ -226,6 +228,86 @@ namespace CalamityMod.CalPlayer HasReducedDashFirstFrame = false; } + if (lAmbergris) + { + if (Player.dashDelay == -1)// TODO: prevent working with special dashes, this was inconsitent with my old solution so I didn't keep it. not huge deal) + { + Player.endurance += 0.05f; + if (!HasIncreasedDashFirstFrame) + { + Player.velocity.X *= 1.15f; + Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType(), 75, 20f, Player.whoAmI); + HasIncreasedDashFirstFrame = true; + } + float numberOfDusts = 10f; + float rotFactor = 180f / numberOfDusts; + for (int i = 0; i < numberOfDusts; i++) + { + float rot = MathHelper.ToRadians(i * rotFactor); + Vector2 offset = new Vector2(Player.velocity.X * Player.direction * 0.7f + 6f, 0).RotatedBy(rot * Main.rand.NextFloat(4f, 5f)); + Vector2 velOffset = Vector2.Zero; + Dust dust = Dust.NewDustPerfect(Player.Center + offset + Player.velocity, Main.rand.NextBool(2) ? 160 : 307, new Vector2(velOffset.X, velOffset.Y)); + dust.noGravity = true; + dust.velocity = velOffset; + dust.alpha = 100; + dust.scale = (Player.velocity.X * Player.direction * 0.08f); + } + if (Player.miscCounter % 4 == 0) + { + float sparkscale = (Player.velocity.X * Player.direction * 0.07f); + Vector2 SparkVelocity1 = Player.velocity.RotatedBy(Player.direction * 2, default) * 0.1f - Player.velocity / 2f; + SparkParticle spark = new SparkParticle(Player.Center + Player.velocity.RotatedBy(2f * Player.direction) * 1.5f, SparkVelocity1, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool(2) ? Color.DarkTurquoise : Color.DodgerBlue); + GeneralParticleHandler.SpawnParticle(spark); + Vector2 SparkVelocity2 = Player.velocity.RotatedBy(Player.direction * -2, default) * 0.1f - Player.velocity / 2f; + SparkParticle spark2 = new SparkParticle(Player.Center + Player.velocity.RotatedBy(-2f * Player.direction) * 1.5f, SparkVelocity2, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool(2) ? Color.DarkTurquoise : Color.DodgerBlue); + GeneralParticleHandler.SpawnParticle(spark2); + } + if (Player.miscCounter % 4 == 0 && Player.velocity != Vector2.Zero) //every other frame spawn the hitbox + Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType(), 115, 0f, Player.whoAmI); + } + else + HasIncreasedDashFirstFrame = false; + } + + if (flameLickedShell) + { + if (Player.dashDelay == -1)// TODO: prevent working with special dashes, this was inconsitent with my old solution so I didn't keep it. not huge deal) + { + if (!HasReducedDashFirstFrame) + { + SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact with { Volume = 0.4f , PitchVariance = 0.4f }, Player.Center); + Player.velocity.X *= 0.75f; //25% reduced dash velocity + Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType(), 67, 16f, Player.whoAmI); + HasReducedDashFirstFrame = true; + } + float numberOfDusts = 10f; + float rotFactor = 180f / numberOfDusts; + for (int i = 0; i < numberOfDusts; i++) + { + float rot = MathHelper.ToRadians(i * rotFactor); + Vector2 offset = new Vector2(Player.velocity.X * Player.direction * 0.7f + 8f, 0).RotatedBy(rot * Main.rand.NextFloat(4f, 5f)); + Vector2 velOffset = Vector2.Zero; + Dust dust = Dust.NewDustPerfect(Player.Center + offset + Player.velocity, Main.rand.NextBool(2) ? 35 : 127, new Vector2(velOffset.X, velOffset.Y)); + dust.noGravity = true; + dust.velocity = velOffset; + dust.alpha = 100; + dust.scale = (Player.velocity.X * Player.direction * 0.08f); + } + float sparkscale = (Player.velocity.X * Player.direction * 0.08f); + Vector2 SparkVelocity1 = Player.velocity.RotatedBy(Player.direction * -3, default) * 0.1f - Player.velocity / 2f; + SparkParticle spark = new SparkParticle(Player.Center + Player.velocity.RotatedBy(2f * Player.direction) * 1.5f, SparkVelocity1, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool(2) ? Color.DarkOrange : Color.OrangeRed); + GeneralParticleHandler.SpawnParticle(spark); + Vector2 SparkVelocity2 = Player.velocity.RotatedBy(Player.direction * 3, default) * 0.1f - Player.velocity / 2f; + SparkParticle spark2 = new SparkParticle(Player.Center + Player.velocity.RotatedBy(-2f * Player.direction) * 1.5f, SparkVelocity2, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool(2) ? Color.DarkOrange : Color.OrangeRed); + GeneralParticleHandler.SpawnParticle(spark2); + + if (Player.miscCounter % 5 == 0 && Player.velocity != Vector2.Zero) //every other frame spawn the hitbox + Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType(), 220, 16f, Player.whoAmI); + } + else + HasReducedDashFirstFrame = false; + } + if (tortShell) { //reduce player dash velocity as long as you didn't just get hit @@ -1178,6 +1260,8 @@ namespace CalamityMod.CalPlayer phantomicBulwarkCooldown--; if (KameiBladeUseDelay > 0) KameiBladeUseDelay--; + if (SpeedBlasterDashDelayCooldown > 0) + SpeedBlasterDashDelayCooldown--; if (galileoCooldown > 0) galileoCooldown--; if (dragonRageCooldown > 0) @@ -2781,7 +2865,7 @@ namespace CalamityMod.CalPlayer if (vexation) { - if (Player.statLife < (int)(Player.statLifeMax2 * 0.5)) + if (Player.statLife <= (int)(Player.statLifeMax2 * 0.5)) Player.GetDamage() += 0.2f; } diff --git a/CalPlayer/Dashes/SpeedBlasterDash.cs b/CalPlayer/Dashes/SpeedBlasterDash.cs new file mode 100644 index 0000000000..40efa99161 --- /dev/null +++ b/CalPlayer/Dashes/SpeedBlasterDash.cs @@ -0,0 +1,48 @@ +using System; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using CalamityMod.Enums; +using CalamityMod.Items.Armor.GodSlayer; +using CalamityMod.Items.Weapons.Ranged; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using CalamityMod.Projectiles.Ranged; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.Dashes +{ + public class SpeedBlasterDash : PlayerDashEffect + { + public static new string ID => "Speed Blaster"; + public override DashCollisionType CollisionType => DashCollisionType.NoCollision; + + public override bool IsOmnidirectional => true; + + public bool dustOnce = true; + + public override float CalculateDashSpeed(Player player) => 30f; + + public override void OnDashEffects(Player player) + { + SoundEngine.PlaySound(SpeedBlaster.Dash, player.Center); + } + + public override void MidDashEffects(Player player, ref float dashSpeed, ref float dashSpeedDecelerationFactor, ref float runSpeedDecelerationFactor) + { + // Fall way, way, faster than usual. + player.maxFallSpeed = 50f; + + // Dash at a much, much faster speed than the default value. + dashSpeed = 20f; + runSpeedDecelerationFactor = 0.8f; + + // Cooldown for dash. + player.Calamity().SpeedBlasterDashStarted = false; + player.Calamity().sBlasterDashActivated = false; + } + } +} diff --git a/Items/Accessories/FlameLickedShell.cs b/Items/Accessories/FlameLickedShell.cs index d9af971d33..f75e44e451 100644 --- a/Items/Accessories/FlameLickedShell.cs +++ b/Items/Accessories/FlameLickedShell.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { - Item.defense = 36; + Item.defense = 18; Item.width = 36; Item.height = 42; Item.value = CalamityGlobalItem.Rarity5BuyPrice; @@ -24,13 +24,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.flameLickedShell = true; - player.buffImmune[ModContent.BuffType()] = true; player.lavaImmune = true; - float moveSpeedDecrease = modPlayer.shellBoost ? 0.15f : 0.35f; - player.moveSpeed -= moveSpeedDecrease; - player.thorns += 0.25f; - if (modPlayer.shellBoost) - player.statDefense -= 18; } } } diff --git a/Items/Accessories/LeviathanAmbergris.cs b/Items/Accessories/LeviathanAmbergris.cs index c73071d1f4..c707a8e9c3 100644 --- a/Items/Accessories/LeviathanAmbergris.cs +++ b/Items/Accessories/LeviathanAmbergris.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -11,7 +12,6 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { - Item.defense = 20; Item.width = 20; Item.height = 22; Item.value = CalamityGlobalItem.Rarity7BuyPrice; @@ -21,62 +21,8 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - var source = player.GetSource_Accessory(Item); - player.ignoreWater = true; - if (!player.lavaWet && !player.honeyWet) - { - if (!Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) - { - player.endurance += 0.05f; - player.GetDamage() += 0.05f; - } - else - { - player.GetDamage() += 0.1f; - player.statDefense += 10; - player.moveSpeed += 0.3f; - } - } - if ((double)player.velocity.X > 0 || (double)player.velocity.Y > 0 || (double)player.velocity.X < -0.1 || (double)player.velocity.Y < -0.1) - { - if (player.whoAmI == Main.myPlayer) - { - int seawaterDamage = (int)player.GetBestClassDamage().ApplyTo(50); - Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), seawaterDamage, 5f, player.whoAmI, 0f, 0f); - } - } - int seaCounter = 0; - Lighting.AddLight((int)(player.Center.X / 16f), (int)(player.Center.Y / 16f), 0f, 0.5f, 1.25f); - int num = BuffID.Venom; - float num2 = 200f; - bool flag = seaCounter % 60 == 0; - int auraDamage = (int)player.GetBestClassDamage().ApplyTo(15); - int random = Main.rand.Next(5); - if (player.whoAmI == Main.myPlayer) - { - if (random == 0 && player.immune && Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) - { - for (int l = 0; l < Main.maxNPCs; l++) - { - NPC nPC = Main.npc[l]; - if (nPC.active && !nPC.friendly && nPC.damage > 0 && !nPC.dontTakeDamage && !nPC.buffImmune[num] && Vector2.Distance(player.Center, nPC.Center) <= num2) - { - if (nPC.FindBuffIndex(num) == -1) - { - nPC.AddBuff(num, 300, false); - } - if (flag) - { - if (player.whoAmI == Main.myPlayer) - { - Projectile.NewProjectileDirect(source, nPC.Center, Vector2.Zero, ModContent.ProjectileType(), auraDamage, 0f, player.whoAmI, l); - } - } - } - } - } - } - seaCounter++; + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.lAmbergris = true; } } } diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 782acf588f..7c2cae46f0 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -135,7 +135,7 @@ namespace CalamityMod.Items { ItemID.Keybrand, Do(UseTurn, ScaleRatio(1.5f)) }, // Uses ratios due to remix seed { ItemID.KOCannon, Do(DamageRatio(2.65f)) }, // Uses ratios due to remix seed { ItemID.LaserRifle, Do(DamageExact(46), UseExact(10), ManaExact(4)) }, - { ItemID.LastPrism, Do(DamageRatio(0.75f)) }, + { 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)) }, diff --git a/Items/Weapons/Magic/AuguroftheElements.cs b/Items/Weapons/Magic/AuguroftheElements.cs index 0adc311c50..47f921ea19 100644 --- a/Items/Weapons/Magic/AuguroftheElements.cs +++ b/Items/Weapons/Magic/AuguroftheElements.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() { - Item.damage = 147; + Item.damage = 131; Item.DamageType = DamageClass.Magic; - Item.mana = 11; + Item.mana = 14; Item.width = 28; Item.height = 30; Item.useTime = 2; diff --git a/Items/Weapons/Magic/NuclearFury.cs b/Items/Weapons/Magic/NuclearFury.cs index afa36d0a1c..afa88f6865 100644 --- a/Items/Weapons/Magic/NuclearFury.cs +++ b/Items/Weapons/Magic/NuclearFury.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() { - Item.damage = 114; + Item.damage = 140; Item.DamageType = DamageClass.Magic; - Item.mana = 13; + Item.mana = 22; Item.width = 38; Item.height = 40; Item.useTime = 25; diff --git a/Items/Weapons/Melee/AnarchyBlade.cs b/Items/Weapons/Melee/AnarchyBlade.cs index d4ecbe3199..451030a25c 100644 --- a/Items/Weapons/Melee/AnarchyBlade.cs +++ b/Items/Weapons/Melee/AnarchyBlade.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Items.Weapons.Melee Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), Item.damage, Item.knockBack, Main.myPlayer); target.AddBuff(ModContent.BuffType(), 300); - if (player.statLife < (player.statLifeMax2 * 0.5f) && Main.rand.NextBool(5)) + if (player.statLife <= (player.statLifeMax2 * 0.5f) && Main.rand.NextBool(5)) { if (!CalamityPlayer.areThereAnyDamnBosses && CalamityGlobalNPC.ShouldAffectNPC(target)) { diff --git a/Items/Weapons/Ranged/SpeedBlaster.cs b/Items/Weapons/Ranged/SpeedBlaster.cs index 7f8a6836bc..1bf22c5011 100644 --- a/Items/Weapons/Ranged/SpeedBlaster.cs +++ b/Items/Weapons/Ranged/SpeedBlaster.cs @@ -1,67 +1,104 @@ using Terraria.DataStructures; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Projectiles.Ranged; +using Terraria.Audio; +using CalamityMod.Projectiles.Magic; +using CalamityMod.CalPlayer.Dashes; +using CalamityMod.Particles; namespace CalamityMod.Items.Weapons.Ranged { [LegacyName("PaintballBlaster")] public class SpeedBlaster : ModItem, ILocalizedModType { + public static readonly SoundStyle Shot = new("CalamityMod/Sounds/Item/Splatshot") { PitchVariance = 0.3f, Volume = 3.5f }; + public static readonly SoundStyle Dash = new("CalamityMod/Sounds/Item/SplatshotDash") { PitchVariance = 0.3f, Volume = 5f }; + public static readonly SoundStyle ShotBig = new("CalamityMod/Sounds/Item/SplatshotBig") { PitchVariance = 0.3f, Volume = 2f }; + public static readonly SoundStyle Empty = new("CalamityMod/Sounds/Item/DudFire") { PitchVariance = 0.3f, Volume = 0.7f }; public new string LocalizationCategory => "Items.Weapons.Ranged"; + public int ColorValue = 0; + public int UseTime = 10; + public float ShotBigMode = 0; public override void SetDefaults() { - Item.damage = 34; + Item.damage = 55; Item.DamageType = DamageClass.Ranged; Item.width = 54; Item.height = 26; - Item.useTime = 4; - Item.useAnimation = 24; - Item.reuseDelay = 9; - Item.useLimitPerAnimation = 6; + Item.useTime = Item.useAnimation = UseTime; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 2.25f; Item.value = CalamityGlobalItem.Rarity5BuyPrice; Item.rare = ItemRarityID.Pink; - Item.UseSound = null; + Item.UseSound = Shot; Item.autoReuse = true; Item.shootSpeed = 20f; - Item.shoot = ProjectileID.PainterPaintball; + Item.shoot = ModContent.ProjectileType(); Item.Calamity().canFirePointBlankShots = true; } + public override bool AltFunctionUse(Player player) => true; + public override bool CanUseItem(Player player) + { + if (player.Calamity().SpeedBlasterDashDelayCooldown > 0 && player.altFunctionUse == 2) + { + SoundEngine.PlaySound(Empty, player.Center); + return false; + } + Item.UseSound = player.altFunctionUse == 2 && player.Calamity().SpeedBlasterDashDelayCooldown == 0 ? ShotBig : Shot; + return base.CanUseItem(player); + } + public override Vector2? HoldoutOffset() + { + return new Vector2(-1, -6); + } + public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) + { + if (player.Calamity().SpeedBlasterDashDelayCooldown == 0) + { + Item.useTime = Item.useAnimation = 9; + ShotBigMode = 0; + } + if (player.altFunctionUse == 2 && player.Calamity().SpeedBlasterDashDelayCooldown == 0) + { + ShotBigMode = 3; + if (ColorValue >= 4) + ColorValue = 0; + else + ColorValue++; + + Item.useTime = Item.useAnimation = 8; + player.Calamity().SpeedBlasterDashDelayCooldown = 300; + + player.Calamity().sBlasterDashActivated = true; + } + } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - float num72 = Item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) + // Reposition to the gun's tip + add some inaccuracy + Vector2 newPos = position + new Vector2(38f, player.direction * (Math.Abs(velocity.SafeNormalize(Vector2.Zero).X) < 0.02f ? -2f : -8f)).RotatedBy(velocity.ToRotation()); + Vector2 newVel = velocity.RotatedByRandom(MathHelper.ToRadians(ShotBigMode == 3 ? 0f : ShotBigMode == 2 ? 3f : 17f)); + Projectile.NewProjectile(source, newPos, newVel, ModContent.ProjectileType(), damage * (ShotBigMode == 3 ? 5 : 1), knockback, player.whoAmI, ColorValue, ShotBigMode); + if (player.Calamity().SpeedBlasterDashDelayCooldown > 0) { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + ShotBigMode = 2; } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + player.Calamity().ColorValue = ColorValue; + if (player.Calamity().SpeedBlasterDashDelayCooldown == 300 && player.velocity != Vector2.Zero) { - num78 = (float)player.direction; - num79 = 0f; + Color ColorUsed = (ColorValue == 0 ? Color.Aqua : ColorValue == 1 ? Color.Blue : ColorValue == 2 ? Color.Fuchsia : ColorValue == 3 ? Color.Lime : ColorValue == 4 ? Color.Yellow : Color.White); + for (int i = 0; i <= 8; i++) + { + CritSpark spark = new CritSpark(player.Center, player.velocity.RotatedByRandom(MathHelper.ToRadians(13f)) * Main.rand.NextFloat(-2.1f, -4.5f), Color.White, ColorUsed, 2f, 45, 2f, 2.5f); + GeneralParticleHandler.SpawnParticle(spark); + } } - else - { - num80 = num72 / num80; - } - float num208 = num78; - float num209 = num79; - num208 += (float)Main.rand.Next(-1, 2) * 0.5f; - num209 += (float)Main.rand.Next(-1, 2) * 0.5f; - if (Collision.CanHitLine(player.Center, 0, 0, vector2 + new Vector2(num208, num209) * 2f, 0, 0)) - { - vector2 += new Vector2(num208, num209); - } - Projectile.NewProjectile(source, position.X, position.Y - player.gravDir * 4f, num208, num209, ProjectileID.PainterPaintball, damage, knockback, player.whoAmI, 0f, (float)Main.rand.Next(12) / 6f); return false; } @@ -69,7 +106,7 @@ namespace CalamityMod.Items.Weapons.Ranged { CreateRecipe(). AddIngredient(ItemID.PainterPaintballGun). - AddIngredient(ItemID.SoulofSight, 5). + AddIngredient(ItemID.MythrilBar, 5). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index a56fe1702e..803d89b434 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -1499,4 +1499,4 @@ AbsorberRegen: { AbsorberAffliction: { DisplayName: Absorber Affliction Description: Damn nature, you scary! -} +} \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 38ea640c70..8e1998f43f 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -716,10 +716,9 @@ FlameLickedShell: { DisplayName: Flame-Licked Shell Tooltip: ''' - 35% decreased movement speed - Enemies take damage when they hit you - You move faster and lose 18 defense for 3 seconds if you take damage - Grants immunity to lava and Armor Crunch + 25% decreased dash velocity + Your dashes are empowered by fire, shredding enemies near you with violent explosions + Grants immunity to lava ''' } @@ -989,10 +988,9 @@ LeviathanAmbergris: { DisplayName: Leviathan Ambergris Tooltip: ''' - You leave behind poisonous seawater as you move - 30% increased movement speed, 10% increase to all damage and plus 10 defense while submerged in liquid - If you are damaged while submerged in liquid you will gain a damaging aura for a short time - Being outside of liquid increases all damage by 5% and increases damage reduction by 5% + 15% increased dash velocity + You gain 5% damage reduction while dashing + Your dashes are empowered by water, knocking back and damaging nearby enemies with viscous currents ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 1538fd125a..ce282fd69c 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -1072,7 +1072,13 @@ SpectralstormCannon: { SpeedBlaster: { DisplayName: Speed Blaster - Tooltip: Shoots a string of paint blasts + Tooltip: + ''' + Fires gravity affected paint shots + Right click while holding down the movement keys to dash omnidirectionally and fire a powerful straight shot + After right clicking your fire rate and shot velocity are increased for a while + Right clicks only work while your shots aren't velocity boosted + ''' } Spyker: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson index 0f1fb46e11..dc36e9d9ef 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -48,7 +48,7 @@ AtlasMunitionsBeacon: { [c/F2B629:The cannon will fire at enemies within its range] [c/F27049:If an enemy is in close proximity, it will enter Overdrive] [c/F27049:When in Overdrive the cannon uses its full power to bring down any foe] - [c/F27049:The cannon heats up the more it fires during Overdrive] + [c/F27049:While in Overdrive, the cannon will build up heat, eventually overheating] [c/69F0DC:Press right click while holding this item to pick up the cannon and use it yourself] [c/69F0DC:When held, the cannon will always be in Overdrive] [c/69F0DC:If the cannon overheats while you hold it, you will be forced to drop it] diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index 1b316cb95e..938114e96b 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -259,4 +259,5 @@ WaterSpout.DisplayName: Spout WulfrumScrapBullet.DisplayName: High Speed Scrap ArcNovaDiffuserHoldout.DisplayName: Arc Nova Diffuser Holdout NovaShot.DisplayName: Nova Bolt -NovaChargeShot.DisplayName: Charged Nova Blast \ No newline at end of file +NovaChargeShot.DisplayName: Charged Nova Blast +SpeedBlasterShot.DisplayName: Splatter Shot \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index f2e924a3a1..67118e77bf 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -128,4 +128,7 @@ YanmeisKnifeSlash.DisplayName: Yanmei's Knife YellowLabSeeker.DisplayName: Seeking Mechanism TarragonAura.DisplayName: Tarragon Aura BlazingStarHeal.DisplayName: Blazing Star Heal -BlazingStarThatDoesNotHeal.DisplayName: Blazing Star That Does Not Heal \ No newline at end of file +BlazingStarThatDoesNotHeal.DisplayName: Blazing Star That Does Not Heal +LeviAmberDash.DisplayName: Riptide Slam +FlameLickedShellBurst.DisplayName: Flame Slam +FlameLickedShellExplosion.DisplayName: Fire Blast \ No newline at end of file diff --git a/Projectiles/Magic/NuclearFuryProjectile.cs b/Projectiles/Magic/NuclearFuryProjectile.cs index 10d3fd82a2..139ca350b3 100644 --- a/Projectiles/Magic/NuclearFuryProjectile.cs +++ b/Projectiles/Magic/NuclearFuryProjectile.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.alpha = 255; Projectile.friendly = true; Projectile.DamageType = DamageClass.Magic; - Projectile.penetrate = -1; + Projectile.penetrate = 3; Projectile.timeLeft = 600; Projectile.tileCollide = false; Projectile.extraUpdates = 2; diff --git a/Projectiles/Ranged/MeowFire.cs b/Projectiles/Ranged/MeowFire.cs index a46a6b59f6..6c6f9789e9 100644 --- a/Projectiles/Ranged/MeowFire.cs +++ b/Projectiles/Ranged/MeowFire.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.Ranged; - Projectile.penetrate = -1; + Projectile.penetrate = 5; Projectile.extraUpdates = 3; Projectile.timeLeft = 95; Projectile.usesIDStaticNPCImmunity = true; diff --git a/Projectiles/Ranged/MeowFire2.cs b/Projectiles/Ranged/MeowFire2.cs index 13aba71e0b..1a8ad087dd 100644 --- a/Projectiles/Ranged/MeowFire2.cs +++ b/Projectiles/Ranged/MeowFire2.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.Ranged; - Projectile.penetrate = -1; + Projectile.penetrate = 5; Projectile.extraUpdates = 3; Projectile.timeLeft = 95; Projectile.usesIDStaticNPCImmunity = true; diff --git a/Projectiles/Ranged/SpeedBlasterShot.cs b/Projectiles/Ranged/SpeedBlasterShot.cs new file mode 100644 index 0000000000..2bf812a6b8 --- /dev/null +++ b/Projectiles/Ranged/SpeedBlasterShot.cs @@ -0,0 +1,167 @@ +using CalamityMod.Particles; +using CalamityMod.Items.Weapons.Ranged; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +using System; + +namespace CalamityMod.Projectiles.Ranged +{ + public class SpeedBlasterShot : ModProjectile, ILocalizedModType + { + public bool FirstFrameSettings = true; + public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "CalamityMod/Projectiles/Ranged/SpeedBlasterShot"; + public ref float ColorValue => ref Main.player[Projectile.owner].Calamity().ColorValue; + + public static readonly SoundStyle ShotImpact = new("CalamityMod/Sounds/Item/SplatshotImpact") { PitchVariance = 0.3f, Volume = 2.5f }; + public static readonly SoundStyle ShotImpactBig = new("CalamityMod/Sounds/Item/SplatshotBigImpact") { PitchVariance = 0.3f, Volume = 4f }; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 12; + ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + } + public static int DashShot = 3; //used with projectile.ai[1] to fire the big shot + public static int PostDashShot = 2; //used with projectile.ai[1] to fire the higher velocity post dash shots + public bool FirstHit = true; + public override void SetDefaults() + { + Projectile.width = Projectile.height = 10; + Projectile.friendly = true; + Projectile.alpha = 0; + Projectile.penetrate = 1; + Projectile.extraUpdates = 1; + Projectile.timeLeft = 300; + Projectile.DamageType = DamageClass.Ranged; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 50; + } + + public override void AI() + { + ColorValue = Projectile.ai[0]; + if (Projectile.ai[1] == DashShot) + { + if (FirstFrameSettings) + { + Projectile.penetrate = 4; + Projectile.extraUpdates = 28; + Projectile.timeLeft = 1500; + Projectile.Size *= 2f; + FirstFrameSettings = false; + } + } + else if (Projectile.ai[1] == PostDashShot) + Projectile.extraUpdates = 2; + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + Projectile.velocity *= (Projectile.ai[1] == DashShot ? 1f : Projectile.ai[1] == PostDashShot ? 0.985f : 0.97f); + Projectile.velocity.Y += (Projectile.ai[1] == DashShot ? 0f : Projectile.ai[1] == PostDashShot ? 0.19f : 0.28f); + Color ColorUsed = (Projectile.ai[0] == 0 ? Color.Aqua : Projectile.ai[0] == 1 ? Color.Blue : Projectile.ai[0] == 2 ? Color.Fuchsia : Projectile.ai[0] == 3 ? Color.Lime : Projectile.ai[0] == 4 ? Color.Yellow : Color.White); + + if (Main.rand.NextBool(20) && Projectile.ai[1] != DashShot) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, 192); + dust.noLight = true; + dust.noGravity = false; + dust.scale = 1.2f; + dust.velocity = new Vector2(Main.rand.Next(-1, 1), 3); + dust.color = ColorUsed; + dust.alpha = 75; + } + if (Projectile.ai[1] == DashShot) + { + Dust dust2 = Dust.NewDustPerfect(Projectile.Center + new Vector2(Main.rand.Next(-5, 5), Main.rand.Next(-5, 5)), 279); + dust2.noLightEmittence = true; + dust2.noGravity = true; + dust2.scale = Main.rand.NextFloat(2.5f, 3.8f); + dust2.velocity = Vector2.Zero; + dust2.color = ColorUsed; + dust2.alpha = 15; + + for (int i = 0; i <= 2; i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, 192); + dust.noLight = true; + dust.noGravity = false; + dust.scale = Main.rand.NextFloat(1.3f, 1.5f); + dust.velocity = new Vector2(Main.rand.Next(-1, 1), Main.rand.Next(0, 8)).RotatedByRandom(MathHelper.ToRadians(10f)) * Main.rand.NextFloat(0.05f, 0.3f); + dust.color = ColorUsed; + dust.alpha = Main.rand.Next(145, 240); + } + } + if (Projectile.timeLeft == 300 && Projectile.ai[1] == DashShot) + { + for (int i = 0; i <= 10; i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, 192, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(30f)) * Main.rand.NextFloat(0.4f, 1.2f)); + dust.noGravity = true; + dust.color = ColorUsed; + dust.alpha = Main.rand.Next(40, 90); + dust.scale = Main.rand.NextFloat(1.2f, 2.3f); + dust.noLight = true; + } + } + if (Projectile.timeLeft == 300 && Projectile.ai[1] != DashShot) + { + for (int i = 0; i <= 7; i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, 192, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(Projectile.ai[1] == PostDashShot ? 13f : 23f)) * Main.rand.NextFloat(0.4f, 1.2f)); + dust.noGravity = true; + dust.color = ColorUsed; + dust.alpha = Main.rand.Next(40, 90); + dust.scale = Main.rand.NextFloat(0.7f, 1.6f); + dust.noLight = true; + } + } + + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + Color ColorUsed = (Projectile.ai[0] == 0 ? Color.Aqua : Projectile.ai[0] == 1 ? Color.Blue : Projectile.ai[0] == 2 ? Color.Fuchsia : Projectile.ai[0] == 3 ? Color.Lime : Projectile.ai[0] == 4 ? Color.Yellow : Color.White); + if (Projectile.ai[1] == DashShot) + { + if (FirstHit) + { + FirstHit = false; + SoundEngine.PlaySound(ShotImpactBig, Projectile.position); + } + + for (int i = 0; i < 2; i++) + { + CritSpark spark = new CritSpark(Projectile.Center, Vector2.Zero, Color.White, ColorUsed, 5.5f, 7, 10f, 4.5f); + GeneralParticleHandler.SpawnParticle(spark); + } + } + } + public override void Kill(int timeLeft) + { + if (Projectile.ai[1] != DashShot) + SoundEngine.PlaySound(ShotImpact, Projectile.position); + + for (int i = 0; i <= 8; i++) + { + Color ColorUsed = (Projectile.ai[0] == 0 ? Color.Aqua : Projectile.ai[0] == 1 ? Color.Blue : Projectile.ai[0] == 2 ? Color.Fuchsia : Projectile.ai[0] == 3 ? Color.Lime : Projectile.ai[0] == 4 ? Color.Yellow : Color.White); + Dust dust = Dust.NewDustPerfect(Projectile.position, 192, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(20f)) * Main.rand.NextFloat(0.05f, 0.3f), 0, default, Main.rand.NextFloat(0.6f, 1.2f)); + dust.noLight = true; + dust.noGravity = false; + dust.color = ColorUsed; + dust.alpha = 75; + } + } + public override Color? GetAlpha(Color drawColor) + { + Color ColorUsed = (Projectile.ai[0] == 0 ? Color.Aqua : Projectile.ai[0] == 1 ? Color.Blue : Projectile.ai[0] == 2 ? Color.Fuchsia : Projectile.ai[0] == 3 ? Color.Lime : Projectile.ai[0] == 4 ? Color.Yellow : Color.White); + Color lightColor = ColorUsed * drawColor.A; + return lightColor * Projectile.Opacity; + } + public override bool PreDraw(ref Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + return false; + } + } +} diff --git a/Projectiles/Ranged/SpeedBlasterShot.png b/Projectiles/Ranged/SpeedBlasterShot.png new file mode 100644 index 0000000000..349bbafe0c Binary files /dev/null and b/Projectiles/Ranged/SpeedBlasterShot.png differ diff --git a/Projectiles/Typeless/FlameLickedShellBurst.cs b/Projectiles/Typeless/FlameLickedShellBurst.cs new file mode 100644 index 0000000000..acf9bb556d --- /dev/null +++ b/Projectiles/Typeless/FlameLickedShellBurst.cs @@ -0,0 +1,63 @@ +using System; +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class FlameLickedShellBurst : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public Player Owner => Main.player[Projectile.owner]; + private static float ExplosionRadius = 75f; + + public override void SetDefaults() + { + //These shouldn't matter because its circular + Projectile.width = 75; + Projectile.height = 75; + Projectile.friendly = true; + Projectile.DamageType = AverageDamageClass.Instance; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.penetrate = 1; + Projectile.timeLeft = 4; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(BuffID.OnFire3, 180); + target.AddBuff(ModContent.BuffType(), 180); + SoundEngine.PlaySound(SoundID.DD2_ExplosiveTrapExplode with { Volume = 0.6f, PitchVariance = 0.4f }, Projectile.Center); + + for (int i = 0; i <= 8; i++) + { + Dust dust = Dust.NewDustPerfect(target.Center, Main.rand.NextBool(2) ? 174 : 127, new Vector2(0, -2).RotatedByRandom(MathHelper.ToRadians(30f)) * Main.rand.NextFloat(2f, 4.5f), 0, default, Main.rand.NextFloat(2.8f, 3.4f)); + dust.noGravity = false; + } + for (int i = 0; i <= 5; i++) + { + Dust dust2 = Dust.NewDustPerfect(target.Center, Main.rand.NextBool(2) ? 174 : 127, new Vector2(0, -3).RotatedByRandom(MathHelper.ToRadians(8f)) * Main.rand.NextFloat(1f, 5f), 0, default, Main.rand.NextFloat(2.8f, 3.4f)); + dust2.noGravity = false; + } + + Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage / 2, 23f, Projectile.owner); + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox); + public override bool? CanDamage() => base.CanDamage(); + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.HitDirectionOverride = Math.Sign(Owner.direction); + } + + public override bool? CanCutTiles() => false; + } +} diff --git a/Projectiles/Typeless/FlameLickedShellExplosion.cs b/Projectiles/Typeless/FlameLickedShellExplosion.cs new file mode 100644 index 0000000000..454f553441 --- /dev/null +++ b/Projectiles/Typeless/FlameLickedShellExplosion.cs @@ -0,0 +1,55 @@ +using System; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class FlameLickedShellExplosion : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public Player Owner => Main.player[Projectile.owner]; + private static float ExplosionRadius = 150f; + + public override void SetDefaults() + { + //These shouldn't matter because its circular + Projectile.width = 150; + Projectile.height = 150; + Projectile.friendly = true; + Projectile.DamageType = AverageDamageClass.Instance; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.penetrate = -1; + Projectile.timeLeft = 2; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(BuffID.OnFire3, 180); + + Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.OrangeRed, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0f, Main.rand.NextFloat(0.8f, 1.1f), 20); + GeneralParticleHandler.SpawnParticle(pulse); + Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.DarkOrange, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0f, Main.rand.NextFloat(0.6f, 0.9f), 20); + GeneralParticleHandler.SpawnParticle(pulse2); + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox); + public override bool? CanDamage() => base.CanDamage(); + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.HitDirectionOverride = Math.Sign(Owner.direction); + } + + public override bool? CanCutTiles() => false; + } +} diff --git a/Projectiles/Typeless/LeviAmberDash.cs b/Projectiles/Typeless/LeviAmberDash.cs new file mode 100644 index 0000000000..b4b16055e7 --- /dev/null +++ b/Projectiles/Typeless/LeviAmberDash.cs @@ -0,0 +1,71 @@ +using System; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class LeviAmberDash : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public Player Owner => Main.player[Projectile.owner]; + private static float ExplosionRadius = 75f; + public static readonly SoundStyle Slap = new("CalamityMod/Sounds/Custom/WetSlap", 4) { Volume = 0.8f, PitchVariance = 0.3f}; + + public override void SetDefaults() + { + //These shouldn't matter because its circular + Projectile.width = 75; + Projectile.height = 75; + Projectile.friendly = true; + Projectile.DamageType = AverageDamageClass.Instance; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.penetrate = -1; + Projectile.timeLeft = 4; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (!target.boss) + { + target.velocity.Y += -9f; + target.velocity.X += 10f * Owner.direction; + } + target.AddBuff(BuffID.Wet, 300); + target.AddBuff(ModContent.BuffType(), 60); + SoundEngine.PlaySound(SoundID.Item85 with { Volume = 0.6f, PitchVariance = 0.4f }, Projectile.Center); + for (int i = 0; i < 3; ++i) + { + int bloodLifetime = Main.rand.Next(20, 26); + float bloodScale = Main.rand.NextFloat(0.6f, 0.8f); + Color bloodColor = Color.Lerp(Color.DodgerBlue, Color.DarkTurquoise, Main.rand.NextFloat()); + + if (Main.rand.NextBool(20)) + bloodScale *= 2f; + + float randomSpeedMultiplier = Main.rand.NextFloat(1.25f, 2.25f); + Vector2 bloodVelocity = Main.rand.NextVector2Unit() * 5 * randomSpeedMultiplier; + bloodVelocity.Y -= 5f; + BloodParticle blood = new BloodParticle(Projectile.Center, bloodVelocity, bloodLifetime, bloodScale, bloodColor); + GeneralParticleHandler.SpawnParticle(blood); + } + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox); + public override bool? CanDamage() => base.CanDamage(); + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.HitDirectionOverride = Math.Sign(Owner.direction); + } + + public override bool? CanCutTiles() => false; + } +} diff --git a/Sounds/Item/DudFire.ogg b/Sounds/Item/DudFire.ogg new file mode 100644 index 0000000000..4fa781a3c9 Binary files /dev/null and b/Sounds/Item/DudFire.ogg differ diff --git a/Sounds/Item/Splatshot.ogg b/Sounds/Item/Splatshot.ogg new file mode 100644 index 0000000000..154989362a Binary files /dev/null and b/Sounds/Item/Splatshot.ogg differ diff --git a/Sounds/Item/SplatshotBig.ogg b/Sounds/Item/SplatshotBig.ogg new file mode 100644 index 0000000000..db91a37b8e Binary files /dev/null and b/Sounds/Item/SplatshotBig.ogg differ diff --git a/Sounds/Item/SplatshotBigImpact.ogg b/Sounds/Item/SplatshotBigImpact.ogg new file mode 100644 index 0000000000..71e33f03cc Binary files /dev/null and b/Sounds/Item/SplatshotBigImpact.ogg differ diff --git a/Sounds/Item/SplatshotDash.ogg b/Sounds/Item/SplatshotDash.ogg new file mode 100644 index 0000000000..8486c8d29b Binary files /dev/null and b/Sounds/Item/SplatshotDash.ogg differ diff --git a/Sounds/Item/SplatshotImpact.ogg b/Sounds/Item/SplatshotImpact.ogg new file mode 100644 index 0000000000..ad1ad4ab1c Binary files /dev/null and b/Sounds/Item/SplatshotImpact.ogg differ