diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 9be1e4418a..f9a27a9264 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1026,6 +1026,8 @@ namespace CalamityMod.CalPlayer public int tornadoCooldown = 0; /// Calamity's Snow armor set bonus; reduces cold enemy damage and increases cold debuff damage. public bool eskimoSet = false; + /// Calamity's Rain armor set bonus; gives jump speed and makes jumps create a splash + public bool rainSet = false; /// Calamity's Meteor armor set bonus; makes all magic guns cost 33% mana instead of Space Gun costing 0 mana. public bool meteorSet = false; /// Calamity's Necro armor set bonus; gives a temporary 10 second revive when the player is killed before actually dying. @@ -2305,6 +2307,7 @@ namespace CalamityMod.CalPlayer miningSetCooldown = 0; eskimoSet = false; + rainSet = false; meteorSet = false; necroSet = false; frostSet = false; @@ -3082,6 +3085,7 @@ namespace CalamityMod.CalPlayer forbiddenCooldown = 0; tornadoCooldown = 0; eskimoSet = false; + rainSet = false; meteorSet = false; necroSet = false; frostSet = false; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index a11f838354..d0b0ee94de 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -68,6 +68,7 @@ using CalamityMod.World; using Microsoft.CodeAnalysis; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using Mono.Cecil; using ReLogic.Content; using Terraria; using Terraria.Audio; @@ -1428,6 +1429,17 @@ namespace CalamityMod.CalPlayer Player.GetCritChance() += critUp; } + // Rain armor set effects + if (rainSet) + { + if (Player.jump == 15) // This is technically the frame after you start jumping from the ground + { + bool rainBoost = Player.Center.Y < Main.worldSurface * 16.0 && Main.raining; + int damage = (int)Player.GetBestClassDamage().ApplyTo(30 * (rainBoost ? 2f : 1)); + Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Vector2.UnitY * 26, Vector2.Zero, ModContent.ProjectileType(), damage, 0, Main.myPlayer); + } + } + bool profanedSoulBuffs = profanedCrystalBuffs || (!profanedCrystal && pSoulArtifact) || (profanedCrystal && DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs); // Guardian bonuses diff --git a/Items/VanillaArmorChanges/RainArmorSetChange.cs b/Items/VanillaArmorChanges/RainArmorSetChange.cs new file mode 100644 index 0000000000..c3845a3259 --- /dev/null +++ b/Items/VanillaArmorChanges/RainArmorSetChange.cs @@ -0,0 +1,28 @@ +using CalamityMod.Buffs.StatDebuffs; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.VanillaArmorChanges +{ + public class RainArmorSetChange : VanillaArmorChange + { + public override int? HeadPieceID => ItemID.RainHat; + public override int? BodyPieceID => ItemID.RainCoat; + public override int? LegPieceID => null; + + public override string ArmorSetName => "Rain"; + + public override void UpdateSetBonusText(ref string setBonusText) + { + setBonusText = $"{CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}")}"; + } + + public override void ApplyArmorSetBonus(Player player) + { + player.Calamity().rainSet = true; + player.autoJump = true; + player.jumpSpeedBoost += 1.2f; // 24% + } + } +} diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index fdf34000e6..98b90a5e98 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -145,3 +145,4 @@ YanmeisKnifeSlash.DisplayName: Yanmei's Knife YellowLabSeeker.DisplayName: Seeking Mechanism VoidofExtinctionCrit.DisplayName: Void of Extinction Crit XykDeathAnim.DisplayName: Xyk Death Animation +PuddleSplash.DisplayName: Puddle Splash diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson index 4f7221a84d..fd225c4c58 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson @@ -41,6 +41,12 @@ SetBonus: { Cold enemies will deal reduced contact damage to the player Provides immunity to the Chilled, Frozen, Frostburn and Glacial State debuffs ''' + Rain: + ''' + 24% increased jump speed and allows auto-jump + Jumping creates a puddle splash that damages and knocks back enemies + This splash is stronger if it is raining + ''' Forbidden: ''' {$LegacyTooltip.48} {$ArmorSetBonus.Forbidden} diff --git a/Particles/HighResHollowCircleHardEdgeAlt.png b/Particles/HighResHollowCircleHardEdgeAlt.png new file mode 100644 index 0000000000..98559c5458 Binary files /dev/null and b/Particles/HighResHollowCircleHardEdgeAlt.png differ diff --git a/Projectiles/Typeless/PuddleSplash.cs b/Projectiles/Typeless/PuddleSplash.cs new file mode 100644 index 0000000000..992b40eea4 --- /dev/null +++ b/Projectiles/Typeless/PuddleSplash.cs @@ -0,0 +1,65 @@ +using CalamityMod.Dusts; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class PuddleSplash : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public ref float time => ref Projectile.ai[0]; + public Player Owner => Main.player[Projectile.owner]; + public override void SetDefaults() + { + Projectile.width = 165; + Projectile.height = 80; + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.DamageType = AverageDamageClass.Instance; + Projectile.penetrate = -1; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + Projectile.timeLeft = 25; + } + + public override void AI() + { + if (time == 0) + { + SoundStyle waterSound = new("CalamityMod/Sounds/Item/WaterSplash" + (Main.rand.NextBool() ? "1" : "2")); + SoundEngine.PlaySound(waterSound with { Volume = 0.2f, Pitch = Main.rand.NextFloat(0.9f, 1f) }, Projectile.Center); + for (int i = 0; i < 6; i++) + { + BloodParticle water = new BloodParticle(Projectile.Center, (-Vector2.UnitY * Main.rand.NextFloat(6f, 12f)).RotatedByRandom(0.65f), 30, Main.rand.NextFloat(0.7f, 1.2f), Main.rand.NextBool() ? Color.CornflowerBlue : Color.SkyBlue); + GeneralParticleHandler.SpawnParticle(water); + + Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), (-Vector2.UnitY * Main.rand.NextFloat(2f, 5f)).RotatedByRandom(0.65f), 0, default, Main.rand.NextFloat(1.1f, 1.4f)); + dust.noGravity = false; + dust.color = Main.rand.NextBool() ? Color.CornflowerBlue : Color.SkyBlue; + dust.noLight = true; + dust.noLightEmittence = true; + dust.alpha = 100; + } + for (int i = 0; i < 2; i++) + { + Particle blastRing = new CustomSpark(Projectile.Center, -Vector2.UnitY * 0.1f, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false, i == 0 ? 15 : 22, i == 0 ? 0.07f : 0.05f, i == 0 ? Color.CornflowerBlue : Color.SkyBlue, new Vector2(0.7f, i == 0 ? 1.3f : 0.9f), shrinkSpeed: i == 0 ? -0.6f : -0.5f); + GeneralParticleHandler.SpawnParticle(blastRing); + } + } + time++; + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(BuffID.Wet, 180); + Vector2 launchVel = Utils.DirectionTo(Owner.Center, target.Center) + Vector2.UnitY * -0.75f; + target.MoveNPC(launchVel, 12, false); + } + public override bool? CanCutTiles() => false; + } +}