Rain Armor set bonus

but why
This commit is contained in:
Xyk committed 2025-02-28 18:02:20 -08:00
1 parent 9544034232
commit 32cd4c3322
7 files changed
+116

No files matched your search

+4
View File
@@ -1026,6 +1026,8 @@ namespace CalamityMod.CalPlayer
public int tornadoCooldown = 0;
/// <summary> Calamity's Snow armor set bonus; reduces cold enemy damage and increases cold debuff damage. </summary>
public bool eskimoSet = false;
/// <summary> Calamity's Rain armor set bonus; gives jump speed and makes jumps create a splash </summary>
public bool rainSet = false;
/// <summary> Calamity's Meteor armor set bonus; makes all magic guns cost 33% mana instead of Space Gun costing 0 mana. </summary>
public bool meteorSet = false;
/// <summary> Calamity's Necro armor set bonus; gives a temporary 10 second revive when the player is killed before actually dying. </summary>
@@ -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;
+12
View File
@@ -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<GenericDamageClass>() += 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<PuddleSplash>(), damage, 0, Main.myPlayer);
}
}
bool profanedSoulBuffs = profanedCrystalBuffs || (!profanedCrystal && pSoulArtifact) || (profanedCrystal && DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs);
// Guardian bonuses
@@ -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%
}
}
}
@@ -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
@@ -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}
Binary file not shown.

After

Width:  |  Height:  |  Size: 363 KiB

+65
View File
@@ -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<LightDust>(), (-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;
}
}