From bbcf5ed36d42ce3343b00b7e285bd42f3a6043d8 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <142704082+CongratsIsTrash@users.noreply.github.com> Date: Tue, 29 Aug 2023 14:59:41 -0400 Subject: [PATCH 01/29] Starlight is now exempt from the pierce resist system --- CalamityLists.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/CalamityLists.cs b/CalamityLists.cs index 5439ad99a8..e48f6b1630 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -1989,6 +1989,7 @@ namespace CalamityMod ProjectileID.MonkStaffT3, ProjectileID.LastPrismLaser, ProjectileID.ChargedBlasterLaser, + ProjectileID.PiercingStarlight, ProjectileID.FinalFractal, ProjectileType(), ProjectileType(), From c7a340f5a3e6a1f6c9533233a2c2f231cc3013ae Mon Sep 17 00:00:00 2001 From: GinYuH Date: Mon, 28 Aug 2023 22:51:31 -0700 Subject: [PATCH 02/29] made it easier for other mods to add difficulties --- ModSupport/ModCalls.cs | 18 +++++++++ Systems/DifficultyModeSystem.cs | 60 ++++++++++++++++------------- UI/ModeIndicator/ModeIndicatorUI.cs | 4 +- 3 files changed, 53 insertions(+), 29 deletions(-) diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index 90e028304a..19302dcd1e 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -7,6 +7,7 @@ using CalamityMod.Events; using CalamityMod.Items; using CalamityMod.Particles; using CalamityMod.Particles.Metaballs; +using CalamityMod.Systems; using CalamityMod.UI; using CalamityMod.UI.CalamitasEnchants; using CalamityMod.UI.DraedonSummoning; @@ -521,6 +522,13 @@ namespace CalamityMod return CalamityWorld.armageddon = enabled; } } + + public static void AddCustomDifficulty(DifficultyMode newMode) + { + //Add the new difficulty and recalculate + DifficultyModeSystem.Difficulties.Add(newMode); + DifficultyModeSystem.CalculateDifficultyData(); + } #endregion #region Rogue Class @@ -1865,6 +1873,16 @@ namespace CalamityMod return new ArgumentException("ERROR: The first argument to \"SetDifficulty\" must be a string."); return SetDifficultyActive(args[1].ToString(), enabled); + + case "AddDifficultyToUI": + if (args.Length < 2) + return new ArgumentException("ERROR: Not enough arguements provided"); + + if (args[1] is not DifficultyMode mode) + return new ArgumentException("ERROR: A class inheriting from 'DifficultyMode' must be provided."); + AddCustomDifficulty(mode); + return null; + case "GetLight": case "GetLightLevel": case "GetLightStrength": diff --git a/Systems/DifficultyModeSystem.cs b/Systems/DifficultyModeSystem.cs index fa1cdd14f6..b91788d864 100644 --- a/Systems/DifficultyModeSystem.cs +++ b/Systems/DifficultyModeSystem.cs @@ -22,23 +22,51 @@ namespace CalamityMod.Systems { internal static bool _hasCheckedItOutYet = false; //Simple variable to add a cool effect to the mode selector - public static DifficultyMode[] Difficulties; //Difficulty modes ordered by ascending difficulty + public static List Difficulties = new List(); //Difficulty modes ordered by ascending difficulty public static List DifficultyTiers; //Difficulty modes grouped together by difficulty public static int MostAlternateDifficulties; //The most alternate difficulties at any tier that exists. Used to know the widest space to take in the ui public override void Load() { MostAlternateDifficulties = 1; - Difficulties = new DifficultyMode[] { new NoDifficulty(), new RevengeanceDifficulty(), new DeathDifficulty()}; + //Initialize base mod difficulties + Difficulties = new List() { new NoDifficulty(), new RevengeanceDifficulty(), new DeathDifficulty()}; - //All of this should happen after a hook happens which lets other mods add their own difficulties - Difficulties = Difficulties.OrderBy(d => d.DifficultyScale).ToArray(); + CalculateDifficultyData(); + } + public override void Unload() + { + Difficulties = null; + } + + public static DifficultyMode GetCurrentDifficulty + { + get + { + DifficultyMode mode = Difficulties[0]; + + for (int i = 1; i < Difficulties.Count; i++) + { + if (Difficulties[i].Enabled) + mode = Difficulties[i]; + } + + return mode; + } + } + + public static void CalculateDifficultyData() + { + MostAlternateDifficulties = 1; + Difficulties.OrderBy(d => d.DifficultyScale); + + //Difficulties are arranged in "tiers". This is done so that multiple mods can add their own alternate difficulties sharing a tier with the base ones DifficultyTiers = new List(); float currentTier = -1; int tierIndex = -1; - for (int i = 0; i < Difficulties.Length; i++) + for (int i = 0; i < Difficulties.Count; i++) { //if we are at a new tier, create a new list of difficulties at that tier. if (currentTier != Difficulties[i].DifficultyScale) @@ -53,7 +81,6 @@ namespace CalamityMod.Systems { //ugly DifficultyTiers[tierIndex] = DifficultyTiers[tierIndex].Append(Difficulties[i]).ToArray(); - MostAlternateDifficulties = Math.Max(DifficultyTiers[tierIndex].Length, MostAlternateDifficulties); } @@ -61,27 +88,6 @@ namespace CalamityMod.Systems } } - public override void Unload() - { - Difficulties = null; - } - - public static DifficultyMode GetCurrentDifficulty - { - get - { - DifficultyMode mode = Difficulties[0]; - - for (int i = 1; i < Difficulties.Length; i++) - { - if (Difficulties[i].Enabled) - mode = Difficulties[i]; - } - - return mode; - } - } - public override void SaveWorldData(TagCompound tag) { //Apparently this is ran after worldgen so it cant always be set to true diff --git a/UI/ModeIndicator/ModeIndicatorUI.cs b/UI/ModeIndicator/ModeIndicatorUI.cs index 90c6b4b05d..723f75b573 100644 --- a/UI/ModeIndicator/ModeIndicatorUI.cs +++ b/UI/ModeIndicator/ModeIndicatorUI.cs @@ -210,7 +210,7 @@ namespace CalamityMod.UI.ModeIndicator string modeToDisplay = Difficulties[1].Name.ToString(); bool anyActiveMode = false; - for (int i = 1; i < Difficulties.Length; i++) + for (int i = 1; i < Difficulties.Count; i++) { if (GetCurrentDifficulty == Difficulties[i]) { @@ -406,7 +406,7 @@ namespace CalamityMod.UI.ModeIndicator // But would be super useful so other mods can let their own difficulties go there. // Disable difficulties. - for (int i = 0; i < Difficulties.Length; i++) + for (int i = 0; i < Difficulties.Count; i++) { // Disable all difficulties at the same tier / at a tier above itself. if (Difficulties[i]._difficultyTier >= mode._difficultyTier && Difficulties[i] != mode) From 2f6af2261fb2389229334836a90b09bd353eb091 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <142704082+CongratsIsTrash@users.noreply.github.com> Date: Tue, 29 Aug 2023 15:07:08 -0400 Subject: [PATCH 03/29] Added Ballistic Poison Bomb clouds and Duststorm in a Bottle to the pierce resist exception list --- CalamityLists.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CalamityLists.cs b/CalamityLists.cs index e48f6b1630..77d91932d9 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -2038,6 +2038,8 @@ namespace CalamityMod ProjectileType(), ProjectileType(), ProjectileType(), + ProjectileType(), + ProjectileType(), }; // Lists of enemies that resist piercing to some extent (mostly worms). From 2401b30db93e85d1937a7eda3d63180f7d193bf0 Mon Sep 17 00:00:00 2001 From: Memes <114233643+Mr-Memes@users.noreply.github.com> Date: Sat, 26 Aug 2023 00:40:32 +0200 Subject: [PATCH 04/29] Reworked Snake Eyes (Missing tooltip). --- Items/Weapons/DraedonsArsenal/SnakeEyes.cs | 19 +- .../Mods.CalamityMod.Projectiles.Misc.hjson | 3 +- .../DraedonsArsenal/SnakeEyesProjectile.cs | 198 +++++++++ .../DraedonsArsenal/SnakeEyesSummon.cs | 382 +++++++++--------- 4 files changed, 399 insertions(+), 203 deletions(-) create mode 100644 Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs diff --git a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs index 4085c57b49..13d1938b35 100644 --- a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs +++ b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs @@ -15,12 +15,16 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public class SnakeEyes : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; + + public static float EnemyDistanceDetection = 2000f; + public static float TimeToShoot = 30f; + public static float ProjectileSpeed = 40f; + public static float TimeToRedirect = 15f; + public static float TimeToRestart = 45f; + public override void SetDefaults() { - CalamityGlobalItem modItem = Item.Calamity(); - - Item.shootSpeed = 10f; - Item.damage = 65; + Item.damage = 200; Item.mana = 12; Item.width = 38; Item.height = 24; @@ -35,9 +39,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.UseSound = SoundID.Item15; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; + CalamityGlobalItem modItem = Item.Calamity(); modItem.UsesCharge = true; modItem.MaxCharge = 190f; modItem.ChargePerUse = 1f; @@ -46,10 +50,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int watcher = Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(watcher)) - Main.projectile[watcher].originalDamage = Item.damage; - + Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI); return false; } diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson index 0ba4bae953..304236fe2f 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson @@ -70,4 +70,5 @@ PlagueExplosionGas.DisplayName: Plague Gas PlagueShot.DisplayName: Plague Shot PlagueShotBuffer.DisplayName: Plague Shot WaterShot.DisplayName: Water Shot -WaterShotBuffer.DisplayName: Water Shot \ No newline at end of file +WaterShotBuffer.DisplayName: Water Shot +SnakeEyesProjectile.DisplayName: Snake Eyes Projectile \ No newline at end of file diff --git a/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs b/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs new file mode 100644 index 0000000000..f4f3166b21 --- /dev/null +++ b/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs @@ -0,0 +1,198 @@ +using System; +using System.IO; +using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class SnakeEyesProjectile : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public Player Owner => Main.player[Projectile.owner]; + public NPC TargetShot => Main.npc[(int)TargetID]; + public NPC Target => Projectile.Center.MinionHoming(SnakeEyes.EnemyDistanceDetection, Owner); + + public ref float MinionID => ref Projectile.ai[0]; + public ref float TargetID => ref Projectile.ai[1]; + public ref float TimerToRedirect => ref Projectile.ai[2]; + + public bool HasHitEnemy = false; + public bool HasRedirected = false; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.MinionShot[Type] = true; + + // While this projectile doesn't have afterimages, it keeps track of old positions for its primitive drawcode. + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + } + + public override void SetDefaults() + { + Projectile.DamageType = DamageClass.Summon; + Projectile.localNPCHitCooldown = 10; + Projectile.width = Projectile.height = 16; + Projectile.timeLeft = 120; + Projectile.penetrate = -1; + + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.netImportant = true; + } + + #region Variable Syncing + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(HasHitEnemy); + writer.Write(HasRedirected); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + HasHitEnemy = reader.ReadBoolean(); + HasRedirected = reader.ReadBoolean(); + } + + #endregion + + public override void AI() + { + if (HasHitEnemy && TimerToRedirect < SnakeEyes.TimeToRedirect) + TimerToRedirect++; + + if (TimerToRedirect >= SnakeEyes.TimeToRedirect && !HasRedirected) + { + if (TargetShot is not null) + TargetEnemy(TargetShot); + else if (Target is not null) + TargetEnemy(Target); + } + + if (HasRedirected) + { + if (TargetShot is not null) + FollowEnemy(TargetShot); + else if (Target is not null) + FollowEnemy(Target); + else + Projectile.Kill(); + + Projectile.timeLeft = 2; + } + + for (int i = 0; i < 2; i++) + { + Dust trailDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, HasRedirected ? 261 : 226, Scale : HasRedirected ? 2f : .5f); + trailDust.velocity = Vector2.Zero; + trailDust.noGravity = true; + } + } + + #region AI Methods + + private void TargetEnemy(NPC target) + { + Projectile.velocity = Projectile.SafeDirectionTo(target.Center) * SnakeEyes.ProjectileSpeed; + HasRedirected = true; + + SoundEngine.PlaySound(SoundID.Item92 with { Volume = .8f, Pitch = .5f, PitchVariance = .1f }, Projectile.Center); + + Projectile.netUpdate = true; + } + + private void FollowEnemy(NPC target) + { + Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.SafeDirectionTo(target.Center) * SnakeEyes.ProjectileSpeed, .2f); + } + + #endregion + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + HasHitEnemy = true; + + if (HasRedirected && TargetShot == target) + Projectile.Kill(); + } + + public override void Kill(int timeLeft) + { + if (!HasRedirected) + return; + + Projectile.ExpandHitboxBy(300); + Projectile.Damage(); + + for (int i = 0; i < 20; i++) + { + Dust boomDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, 261, Scale: 2f); + boomDust.noGravity = true; + } + + Particle boom = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.White, Vector2.One, 0f, 0.05f, 1f + Main.rand.NextFloat(0.2f), 20); + GeneralParticleHandler.SpawnParticle(boom); + + SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); + } + + #region Shader Trail Methods + + private float PrimitiveWidthFunction(float completionRatio) + { + float arrowheadCutoff = 0.36f; + float width = 39f; + float minHeadWidth = 0.02f; + float maxHeadWidth = width; + if (completionRatio <= arrowheadCutoff) + width = MathHelper.Lerp(minHeadWidth, maxHeadWidth, Utils.GetLerpValue(0f, arrowheadCutoff, completionRatio, true)); + return width; + } + + private Color PrimitiveColorFunction(float completionRatio) + { + float endFadeRatio = 0.41f; + + float completionRatioFactor = 2.7f; + float globalTimeFactor = 5.3f; + float endFadeFactor = 3.2f; + float endFadeTerm = Utils.GetLerpValue(0f, endFadeRatio * 0.5f, completionRatio, true) * endFadeFactor; + float cosArgument = completionRatio * completionRatioFactor - Main.GlobalTimeWrappedHourly * globalTimeFactor + endFadeTerm; + float startingInterpolant = (float)Math.Cos(cosArgument) * 0.5f + 0.5f; + + float colorLerpFactor = 0.6f; + Color startingColor = Color.Lerp(HasRedirected ? Color.White with { A = 50 } : new Color(0, 0, 0, 0), HasRedirected ? Color.White with { A = 100 } : Color.Cyan with { A = 25 }, startingInterpolant * colorLerpFactor); + + return Color.Lerp(startingColor, HasRedirected ? Color.White : Color.DarkCyan with { A = 50 }, MathHelper.SmoothStep(0f, 1f, Utils.GetLerpValue(0f, endFadeRatio, completionRatio, true))); + } + + #endregion + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = ModContent.Request(Texture).Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Vector2 origin = frame.Size() * 0.5f; + Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + + PrimitiveTrail trail = new PrimitiveTrail(PrimitiveWidthFunction, PrimitiveColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); + GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/FabstaffStreak")); + trail.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 92); + + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs index d210a36699..9d9d6bd098 100644 --- a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs +++ b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs @@ -1,260 +1,256 @@ -using CalamityMod.Buffs.Summon; +using System; +using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.IO; using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.DraedonsArsenal { public class SnakeEyesSummon : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Misc"; - public bool SufferingFromSeparationAnxiety = false; - public Vector2 OldCenter; - public Vector2 Destination; - public float Time + public Player Owner => Main.player[Projectile.owner]; + public CalamityPlayer ModdedOwner => Owner.Calamity(); + public NPC Target => Owner.Center.MinionHoming(2000f, Owner); + + public enum AIState { - get => Projectile.ai[0]; - set => Projectile.ai[0] = value; + Idle, + Targetting, + Redirecting } + public AIState State + { + get => (AIState)Projectile.ai[0]; + set => Projectile.ai[0] = (int)value; + } + public ref float AITimer => ref Projectile.ai[1]; + public ref float EyeAngle => ref Projectile.localAI[0]; + public ref float EyeOutwardness => ref Projectile.localAI[1]; - public float EyeOutwardness = 1f; - public float EyeRotation = 0f; + public bool HasShot = false; + public bool HasTeleported = false; + public Vector2 RandomPosition; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() { + Projectile.DamageType = DamageClass.Summon; + Projectile.minionSlots = 1f; Projectile.width = Projectile.height = 22; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.minionSlots = 1; - Projectile.timeLeft = 18000; Projectile.penetrate = -1; - Projectile.timeLeft *= 5; + + Projectile.friendly = true; Projectile.minion = true; Projectile.tileCollide = false; - Projectile.DamageType = DamageClass.Summon; - } - - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(SufferingFromSeparationAnxiety); - writer.Write(EyeOutwardness); - writer.Write(EyeRotation); - writer.WriteVector2(OldCenter); - writer.WriteVector2(Destination); - } - public override void ReceiveExtraAI(BinaryReader reader) - { - SufferingFromSeparationAnxiety = reader.ReadBoolean(); - EyeOutwardness = reader.ReadSingle(); - EyeRotation = reader.ReadSingle(); - OldCenter = reader.ReadVector2(); - Destination = reader.ReadVector2(); + Projectile.netImportant = true; } public override void AI() { - Player player = Main.player[Projectile.owner]; - if (Projectile.localAI[0] == 0f) + // Checks if the minion can still exist given the player's circumstance. + CheckMinionExistence(); + + // The minion does not use velocity at all, so to prevent AI breaks, velocity will always be 0. + Projectile.velocity = Vector2.Zero; + + // The properties of the minion's pupil, it looks around the target if there's one and to the mouse if there isn't any. + EyeAngle = Projectile.SafeDirectionTo((Target is not null) ? Target.Center : Main.MouseWorld).ToRotation(); + EyeOutwardness = Utils.Remap(Projectile.Distance((Target is not null) ? Target.Center : Main.MouseWorld), 0f, 300f, 0f, 5f); + + // Random flavor pulse. + if (Main.rand.NextBool(100)) { - Initialize(player); - Projectile.localAI[0] = 1f; + Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.DarkCyan, Vector2.One, 0f, 0.05f, 0.4f + Main.rand.NextFloat(0.2f), 30); + GeneralParticleHandler.SpawnParticle(pulse); } - GrantBuffs(player); - NPC potentialTarget = Projectile.Center.MinionHoming(820f, player); - if (potentialTarget == null || SufferingFromSeparationAnxiety) + + switch (State) { - Projectile.ai[1] = 0f; - if (Projectile.localAI[1] == 1f) + case AIState.Idle: + IdleState(); + break; + case AIState.Targetting: + TargettingState(); + break; + case AIState.Redirecting: + RedirectingState(); + break; + } + } + + #region AI Methods + + private void IdleState() + { + // The projectile oscillates in place. + Projectile.Center += Vector2.UnitY * MathF.Sin(Main.GlobalTimeWrappedHourly) / 3f; + + // If the player's far enough from the minion, he'll teleport somewhere around the player. + if (!Projectile.WithinRange(Owner.Center, 400f)) + { + Projectile.Center = Owner.Center + Main.rand.NextVector2Circular(300f, 300f); + DoVFXPulse(); + } + + if (Target is not null) + SwitchAIState(AIState.Targetting); + } + + private void TargettingState() + { + if (Target is not null) + { + // The minion decides a random position around the target. + if (!HasTeleported) { - Time = 0f; - Projectile.localAI[1] = 0f; + RandomPosition = Target.Center + Main.rand.NextVector2CircularEdge(400f, 400f); + Projectile.Center = RandomPosition; + + DoVFXPulse(); + + HasTeleported = true; + Projectile.netUpdate = true; + } + + else + { + // The projectile will stay on that position. + Projectile.Center = RandomPosition; + + // When the delay is over, shoot at the target. + if (!HasShot && AITimer >= SnakeEyes.TimeToShoot) + ShootProjectile(); + + // When the minion has shot, when the projectile redirects towards the target, + // the minion will teleport on that moment on top of the projectile, + // so it looks like the minion deflected his own projectile. + if (HasShot) + { + for (int i = 0; i < Main.maxProjectiles; i++) + { + Projectile proj = Main.projectile[i]; + if (proj is not null && proj.active && proj.type == ModContent.ProjectileType() && proj.owner == Owner.whoAmI && proj.ModProjectile().MinionID == Projectile.whoAmI && proj.ModProjectile().HasRedirected) + { + Projectile.Center = proj.Center; + SwitchAIState(AIState.Redirecting); + } + } + } + + // If the projectile failed to hit it's enemy and therefore couldn't deflect, + // repeat this process. + if (AITimer >= SnakeEyes.TimeToShoot + 120f) + SwitchAIState(AIState.Targetting); + + AITimer++; } - PlayerMovement(player); } else + SwitchAIState(AIState.Idle); + } + + private void ShootProjectile() + { + if (Main.myPlayer == Projectile.owner) { - if (Projectile.localAI[1] == 0f) - { - Time = 0f; - Projectile.localAI[1] = 1f; - } - NPCMovement(potentialTarget); - } - if (!SufferingFromSeparationAnxiety && Projectile.Distance(player.Center) > (potentialTarget is null ? 360f : 1800f)) - { - SufferingFromSeparationAnxiety = true; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, Target, SnakeEyes.ProjectileSpeed), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Owner.whoAmI, Projectile.whoAmI, Target.whoAmI); + + DoVFXPulse(); + + SoundEngine.PlaySound(SoundID.Item91 with { Volume = .8f, Pitch = .5f, PitchVariance = .1f }, Projectile.Center); + + HasShot = true; Projectile.netUpdate = true; } - else if (SufferingFromSeparationAnxiety && Projectile.Distance(player.Center) < (potentialTarget is null ? 10f : 120f)) - { - SufferingFromSeparationAnxiety = false; - Projectile.netUpdate = true; - } - if (!Main.dedServ) - { - GenerateAfterimageDust(); - } - Time++; } - public void Initialize(Player player) + private void RedirectingState() { - Destination = Projectile.Center - Vector2.UnitY * 180f; - for (int i = 0; i < 45; i++) + if (Target is not null) { - float angle = MathHelper.TwoPi / 45f * i; - Vector2 velocity = angle.ToRotationVector2() * 4f; - Dust dust = Dust.NewDustPerfect(Projectile.Center + velocity * 2.75f, 39, velocity); - dust.noGravity = true; + // The projectile will idle on the spot where he "deflected" the projectile to restart the process. + if (AITimer < SnakeEyes.TimeToRestart) + AITimer++; + else + SwitchAIState(AIState.Targetting); } + else + SwitchAIState(AIState.Idle); } - public void GrantBuffs(Player player) + private void SwitchAIState(AIState state) { - bool isCorrectProjectile = Projectile.type == ModContent.ProjectileType(); - player.AddBuff(ModContent.BuffType(), 3600); - if (isCorrectProjectile) - { - if (player.dead) - { - player.Calamity().snakeEyes = false; - } - if (player.Calamity().snakeEyes) - { - Projectile.timeLeft = 2; - } - } + State = state; + + AITimer = 0f; + HasTeleported = false; + HasShot = false; + RandomPosition = Vector2.Zero; + + DoVFXPulse(state == AIState.Redirecting); + + Projectile.netUpdate = true; } - public void PlayerMovement(Player player) + private void CheckMinionExistence() { - Projectile.velocity = Vector2.Zero; - if (!SufferingFromSeparationAnxiety) - { - Projectile.Center = player.Center - Vector2.UnitY * (80f + (float)Math.Sin(Time / 120f * MathHelper.TwoPi) * 30f); - EyeOutwardness = MathHelper.Lerp(EyeOutwardness, 0f, 0.15f); + Owner.AddBuff(ModContent.BuffType(), 2); + if (Type != ModContent.ProjectileType()) return; - } - if (Time % 150f == 0f) - { - OldCenter = Projectile.Center; - } - else if (Time % 150f <= 35f) - { - EyeRotation = Projectile.AngleTo(player.Center); - EyeOutwardness = MathHelper.Lerp(EyeOutwardness, 1f, 0.15f); - Projectile.Center = Vector2.SmoothStep(OldCenter, player.Center - Vector2.UnitY * 80f, Utils.GetLerpValue(0f, 35f, Time % 150f)); - } - else - { - Projectile.Center = player.Center - Vector2.UnitY * (80f + (float)Math.Sin((Time % 150f - 35f) / 115f * MathHelper.TwoPi) * 30f); - } - EyeOutwardness = MathHelper.Lerp(EyeOutwardness, 0f, 0.15f); + + if (Owner.dead) + ModdedOwner.snakeEyes = false; + if (ModdedOwner.snakeEyes) + Projectile.timeLeft = 2; } - public void NPCMovement(NPC npc) + private void DoVFXPulse(bool empowered = false) { - Projectile.velocity = Vector2.Zero; - Vector2 offsetMultiplier = Vector2.UnitX; - switch ((int)Projectile.ai[1] % 4) + int dustAmount = 40; + for (int dustIndex = 0; dustIndex < dustAmount; dustIndex++) { - case 0: - offsetMultiplier = new Vector2(-1f, -1f); - break; - case 1: - offsetMultiplier = new Vector2(-1f, 1f); - break; - case 2: - offsetMultiplier = new Vector2(1f, 1f); - break; - case 3: - offsetMultiplier = new Vector2(1f, -1f); - break; - } - if (Time % 20f == 0f) - { - if (Projectile.ai[1] > 0 && Main.myPlayer == Projectile.owner) - { - Vector2 shootPosition = Projectile.Center + Utils.Vector2FromElipse(EyeRotation.ToRotationVector2(), Projectile.Size * 0.5f * EyeOutwardness); - Vector2 shootVelocity = Projectile.SafeDirectionTo(npc.Center, Main.rand.NextVector2Unit()) * 4f; - int laser = Projectile.NewProjectile(Projectile.GetSource_FromThis(), shootPosition, shootVelocity, ProjectileID.UFOLaser, Projectile.damage, Projectile.knockBack, Projectile.owner); - if (laser.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[laser].timeLeft *= 2; - Main.projectile[laser].originalDamage = Projectile.originalDamage; - Main.projectile[laser].tileCollide = false; - Main.projectile[laser].netUpdate = true; - Main.projectile[laser].DamageType = DamageClass.Summon; - } - } - Projectile.ai[1]++; - OldCenter = Projectile.Center; - } - else - { - EyeOutwardness = MathHelper.Lerp(EyeOutwardness, 1f, 0.15f); - EyeRotation = EyeRotation.AngleTowards(Projectile.AngleTo(npc.Center), MathHelper.TwoPi / 20f); - Projectile.Center = Vector2.SmoothStep(OldCenter, npc.Center + (new Vector2(300f) + Projectile.Size * 0.5f) * offsetMultiplier, Time % 20f / 20f); + float angle = MathHelper.TwoPi / dustAmount * dustIndex; + Vector2 velocity = angle.ToRotationVector2() * 9f; + Dust pulseDust = Dust.NewDustPerfect(Projectile.Center, empowered ? 261 : 226, velocity, Scale: empowered ? 2f : .5f); + pulseDust.noGravity = true; } + + Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, empowered ? Color.White : Color.DarkCyan * 1.2f, Vector2.One, 0f, 0.05f, 0.5f + Main.rand.NextFloat(0.2f), 20); + GeneralParticleHandler.SpawnParticle(pulse); } - public void GenerateAfterimageDust() - { - for (int i = 1; i < Projectile.oldPos.Length; i++) - { - if (i == 1) - { - for (int j = 0; j < 14; j++) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center, 261); - dust.position += (j / 14f * MathHelper.TwoPi).ToRotationVector2() * Projectile.Size * 0.5f * 1.3f; - dust.velocity = Vector2.Zero; - dust.scale = 0.6f; - dust.noGravity = true; - } - } - if (Vector2.Distance(Projectile.oldPos[i - 1], Projectile.oldPos[i]) > 3f) - { - for (int j = 0; j < 7; j++) - { - Dust dust = Dust.NewDustPerfect(Projectile.oldPos[i] + Projectile.Size * 0.5f, 261); - dust.position += (j / 7f * MathHelper.TwoPi).ToRotationVector2() * ((Projectile.oldPos.Length - i) * 1.2f + 3f); - dust.velocity = Vector2.Zero; - dust.scale = 0.6f; - dust.noGravity = true; - } - } - } - } + #endregion + + public override void OnSpawn(IEntitySource source) => DoVFXPulse(); public override bool? CanDamage() => false; public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, 0, Color.White, ProjectileID.Sets.TrailCacheLength[Projectile.type]); + Texture2D texture = ModContent.Request(Texture).Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Vector2 origin = frame.Size() * 0.5f; + Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + Texture2D eyeTexture = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/SnakeEye").Value; - Vector2 offsetVector = Utils.Vector2FromElipse(EyeRotation.ToRotationVector2(), Projectile.Size * 0.5f * EyeOutwardness); - Main.EntitySpriteDraw(eyeTexture, - Projectile.Center + offsetVector - Main.screenPosition, - null, - Color.White, - 0f, - eyeTexture.Size() * 0.5f, - 1f, - SpriteEffects.None, - 0); + Vector2 eyeDrawPosition = Projectile.Center - Main.screenPosition + EyeAngle.ToRotationVector2() * EyeOutwardness; + Main.EntitySpriteDraw(eyeTexture, eyeDrawPosition, null, Color.White, 0f, eyeTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); + return false; } } From 3457afbdac80cd495b30a23de265fa7853eeae1c Mon Sep 17 00:00:00 2001 From: Memes <114233643+Mr-Memes@users.noreply.github.com> Date: Tue, 29 Aug 2023 20:00:35 +0200 Subject: [PATCH 05/29] Final touch-ups to Snake Eyes. --- Items/Weapons/DraedonsArsenal/SnakeEyes.cs | 6 +++--- ...ityMod.Items.Weapons.DraedonsArsenal.hjson | 5 ++++- .../Mods.CalamityMod.Projectiles.Misc.hjson | 4 ++-- .../DraedonsArsenal/SnakeEyesProjectile.cs | 8 ++++---- .../DraedonsArsenal/SnakeEyesSummon.cs | 20 +++++++++---------- 5 files changed, 23 insertions(+), 20 deletions(-) diff --git a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs index 13d1938b35..7d171cf708 100644 --- a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs +++ b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs @@ -1,10 +1,10 @@ -using CalamityMod.CustomRecipes; +using System; +using System.Collections.Generic; +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Rarities; using Microsoft.Xna.Framework; -using System; -using System.Collections.Generic; using Terraria; using Terraria.DataStructures; using Terraria.ID; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson index 879b58bb79..e536965bed 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson @@ -164,7 +164,10 @@ SnakeEyes: { DisplayName: Snake Eyes Tooltip: ''' - Summons a mechanical surveillance drone that flies around enemies and mercilessly zaps them with electricity + Summons magnetic orbs to shred your foes with intense polarized energy + The orb will fire a single piercing beam that travels towards enemies + If the beam hits, the orb will teleport and deflect the projectile back + The deflected beam homes into enemies rapidly and explodes on impact [c/1FFBFF:'Equipped with high-end sensors, little can evade them. Even less are able to escape their ever watchful eyes.] [c/1FFBFF:An excellent bridge between my experiments with the sight-based soul powered machines and my latest project.'] ''' diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson index 304236fe2f..0c5b855b66 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson @@ -45,6 +45,7 @@ UnstableMatter.DisplayName: Unstable Matter VoltageStream.DisplayName: Voltage Stream WavePounderBoom.DisplayName: Explosion WavePounderProjectile.DisplayName: Wave Pounder +SnakeEyesProjectile.DisplayName: Snake Eyes' Beam // Environmental AcidDrop.DisplayName: Acid BrimstoneGeyser.DisplayName: Smoke @@ -70,5 +71,4 @@ PlagueExplosionGas.DisplayName: Plague Gas PlagueShot.DisplayName: Plague Shot PlagueShotBuffer.DisplayName: Plague Shot WaterShot.DisplayName: Water Shot -WaterShotBuffer.DisplayName: Water Shot -SnakeEyesProjectile.DisplayName: Snake Eyes Projectile \ No newline at end of file +WaterShotBuffer.DisplayName: Water Shot \ No newline at end of file diff --git a/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs b/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs index f4f3166b21..2675611ef2 100644 --- a/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs +++ b/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void SetStaticDefaults() { ProjectileID.Sets.MinionShot[Type] = true; - + // While this projectile doesn't have afterimages, it keeps track of old positions for its primitive drawcode. ProjectileID.Sets.TrailingMode[Type] = 2; ProjectileID.Sets.TrailCacheLength[Type] = 6; @@ -92,10 +92,10 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile.timeLeft = 2; } - + for (int i = 0; i < 2; i++) { - Dust trailDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, HasRedirected ? 261 : 226, Scale : HasRedirected ? 2f : .5f); + Dust trailDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, HasRedirected ? 261 : 226, Scale: HasRedirected ? 2f : .5f); trailDust.velocity = Vector2.Zero; trailDust.noGravity = true; } @@ -132,7 +132,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { if (!HasRedirected) return; - + Projectile.ExpandHitboxBy(300); Projectile.Damage(); diff --git a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs index 9d9d6bd098..a789a53b17 100644 --- a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs +++ b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public Player Owner => Main.player[Projectile.owner]; public CalamityPlayer ModdedOwner => Owner.Calamity(); - public NPC Target => Owner.Center.MinionHoming(2000f, Owner); + public NPC Target => Owner.Center.MinionHoming(SnakeEyes.EnemyDistanceDetection, Owner); public enum AIState { @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile.minionSlots = 1f; Projectile.width = Projectile.height = 22; Projectile.penetrate = -1; - + Projectile.friendly = true; Projectile.minion = true; Projectile.tileCollide = false; @@ -64,9 +64,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal // Checks if the minion can still exist given the player's circumstance. CheckMinionExistence(); - // The minion does not use velocity at all, so to prevent AI breaks, velocity will always be 0. - Projectile.velocity = Vector2.Zero; - // The properties of the minion's pupil, it looks around the target if there's one and to the mouse if there isn't any. EyeAngle = Projectile.SafeDirectionTo((Target is not null) ? Target.Center : Main.MouseWorld).ToRotation(); EyeOutwardness = Utils.Remap(Projectile.Distance((Target is not null) ? Target.Center : Main.MouseWorld), 0f, 300f, 0f, 5f); @@ -96,16 +93,18 @@ namespace CalamityMod.Projectiles.DraedonsArsenal private void IdleState() { + AITimer += .01f; + // The projectile oscillates in place. - Projectile.Center += Vector2.UnitY * MathF.Sin(Main.GlobalTimeWrappedHourly) / 3f; - + Projectile.velocity.Y -= MathF.Cos(AITimer) / 350f; + // If the player's far enough from the minion, he'll teleport somewhere around the player. if (!Projectile.WithinRange(Owner.Center, 400f)) { Projectile.Center = Owner.Center + Main.rand.NextVector2Circular(300f, 300f); DoVFXPulse(); } - + if (Target is not null) SwitchAIState(AIState.Targetting); } @@ -172,7 +171,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal DoVFXPulse(); SoundEngine.PlaySound(SoundID.Item91 with { Volume = .8f, Pitch = .5f, PitchVariance = .1f }, Projectile.Center); - + HasShot = true; Projectile.netUpdate = true; } @@ -195,12 +194,13 @@ namespace CalamityMod.Projectiles.DraedonsArsenal private void SwitchAIState(AIState state) { State = state; - AITimer = 0f; HasTeleported = false; HasShot = false; RandomPosition = Vector2.Zero; + Projectile.velocity = Vector2.Zero; + DoVFXPulse(state == AIState.Redirecting); Projectile.netUpdate = true; From 759e273e9e6dfb641e1af0996a7d7106cf3c9765 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Tue, 29 Aug 2023 15:11:20 -0400 Subject: [PATCH 06/29] improved snake eyes tooltip --- .../Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson | 7 +++---- Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson index e536965bed..2330fb0490 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson @@ -164,10 +164,9 @@ SnakeEyes: { DisplayName: Snake Eyes Tooltip: ''' - Summons magnetic orbs to shred your foes with intense polarized energy - The orb will fire a single piercing beam that travels towards enemies - If the beam hits, the orb will teleport and deflect the projectile back - The deflected beam homes into enemies rapidly and explodes on impact + Summons a levitating drone which fires piercing, highly calibrated energy bolts + If a bolt hits, the drone will teleport into its path and reflect the bolt + Reflected bolts home in and explode on impact [c/1FFBFF:'Equipped with high-end sensors, little can evade them. Even less are able to escape their ever watchful eyes.] [c/1FFBFF:An excellent bridge between my experiments with the sight-based soul powered machines and my latest project.'] ''' diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson index 0c5b855b66..ca3c5b88d4 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson @@ -45,7 +45,7 @@ UnstableMatter.DisplayName: Unstable Matter VoltageStream.DisplayName: Voltage Stream WavePounderBoom.DisplayName: Explosion WavePounderProjectile.DisplayName: Wave Pounder -SnakeEyesProjectile.DisplayName: Snake Eyes' Beam +SnakeEyesProjectile.DisplayName: Inescapable Bolt // Environmental AcidDrop.DisplayName: Acid BrimstoneGeyser.DisplayName: Smoke From 8ec10b66f64730913cde8e7e84ab479e26cd0607 Mon Sep 17 00:00:00 2001 From: GinYuH Date: Tue, 29 Aug 2023 21:59:32 -0700 Subject: [PATCH 07/29] fixed levi using deadly sphere sounds --- NPCs/Leviathan/Leviathan.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 926898b098..b0f2f01e1a 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -179,7 +179,7 @@ namespace CalamityMod.NPCs.Leviathan { SoundID.Zombie38, SoundID.Zombie39, - SoundID.Zombie49 + SoundID.Zombie40 }); if (soundDelay > 0) From 85b4719835ca816ee3a5a1a59dbd09b4a59a33f5 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Wed, 30 Aug 2023 12:10:49 -0400 Subject: [PATCH 08/29] removed materially false config comment --- Localization/en-US/Mods.CalamityMod.Configs.hjson | 1 - 1 file changed, 1 deletion(-) diff --git a/Localization/en-US/Mods.CalamityMod.Configs.hjson b/Localization/en-US/Mods.CalamityMod.Configs.hjson index f2f8a3ade9..e15c05bcc1 100644 --- a/Localization/en-US/Mods.CalamityMod.Configs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Configs.hjson @@ -71,7 +71,6 @@ CalamityConfig: { ''' Gives the player a very weak dash by default that requires no equipment or items to use. This dash will be replaced by any other available dash, including those from other mods. - Calamity is balanced around this setting being enabled. ''' } From 845a2f8f4d0aa70183fd649a99cdfed659040e54 Mon Sep 17 00:00:00 2001 From: HaguriHat <141063931+HaguriHat@users.noreply.github.com> Date: Wed, 30 Aug 2023 13:44:49 -0300 Subject: [PATCH 09/29] Fixed some wording on Viruling's entry --- Localization/en-US/Mods.CalamityMod.Bestiary.hjson | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson index dfc3a10260..a59846bfb1 100644 --- a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson +++ b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson @@ -105,7 +105,7 @@ PestilentSlime: The virus hunts for any openings within one’s body to reprogra PlaguebringerMiniboss: Nothing can escape the Plague; everything is either assimilated or culled. Such is the case of queen bees. While strong enough to stave off plagued creatures, they are often forced to abandon their hives due to their subjects becoming infected. This leaves their larvae to be overtaken by nanites, and soon after, a plaguebringer is born. PlagueCharger: Spawn of the plaguebringers, these were born already taken by Draedon’s nanomachines. Nanites ensure they reach adulthood in a matter of hours by supercharging their aging process, even if this means their lifespan can be counted in days. Yet, this is exactly what makes them the perfect dispensable soldiers. Plagueshell: A turtle’s shell and nervous system are intertwined, making giant tortoises ideal targets for the Plague. Whatever pain is caused by the process of drilling into their shells is rapidly anesthetized, putting the tortoises under control without a single protest. -Viruling: Unlike derplings, who use their proboscis to drain the blood of other creatures, virulings use theirs by using it to inject the plague directly into their victims. Aside from the plaguebringers themselves, no creature is nearly as efficient at contaminating the local wildlife. +Viruling: Unlike derplings, who use their proboscis to drain the blood of other creatures, virulings use theirs to inject the plague directly into their victims. Aside from the plaguebringers themselves, no creature is nearly as efficient at contaminating the local wildlife. //Sulphur Sea Enemies AnthozoanCrab: Though disguised as simple rocks, they are capable of hurling entire boulders at creatures with ease, and will retreat swiftly if approached. Elsewhere, a creature such as this would thrive due to its might; yet in such a hostile environment as this, this much is required merely to survive. AquaticUrchin: Closely related to sea urchins, aquatic urchins have been forced to adapt to the acidic water and radioactive waste. Normally their venomous spikes would normally deter predators, but in the environment it lives in, a painful meal is still a meal. Nothing in this sea can afford to be a picky eater. @@ -189,4 +189,4 @@ StormWeaver: An invasive pest from another dimension crowned by many as king of SupremeCalamitas: After inheriting nigh limitless magical power as a mere teenager, she was recruited into Yharim’s army, where she served for nearly a decade. She reveled in the violence of it all, the endless dance of madness and death, allowing the Godseeker to wield her as a weapon in his endless war against the gods. But now that the fire inside her has died, all that remains are the smoldering embers of regret. SupremeCataclysm: The eldest of the three siblings, this brother was a brawler of great renown in Azafure, with few in the city being capable of matching his raw strength. He was protective of his sister, vowing to always be there for her in her times of need. The brother continues to fulfill this promise, even in death. SupremeCatastrophe: The middle child of the three siblings was a skilled swordsman in life, taking up mercenary work to put food on the table. Despite his rather bloody career choice, he did his best to be kind to his sister and keep her out of any danger his occupation could have put his remaining family in. He continues to defend her, even in death. -Yharon: Each dragon once wielded nigh limitless power over their domain, a fundamental power drawn directly from the world's fragmented soul. The dragons were masters of all; life, death, even the great Primordial Light that banishes the eternal night beyond. And yet, one of these majestic beings reached a height of power possibly second only to their king. He who made his kind eternal through his powers of Rebirth... and yet, even eternity did not last. \ No newline at end of file +Yharon: Each dragon once wielded nigh limitless power over their domain, a fundamental power drawn directly from the world's fragmented soul. The dragons were masters of all; life, death, even the great Primordial Light that banishes the eternal night beyond. And yet, one of these majestic beings reached a height of power possibly second only to their king. He who made his kind eternal through his powers of Rebirth... and yet, even eternity did not last. From b04f3f923f853d2d1f31b2c90e3eebc568fb72fe Mon Sep 17 00:00:00 2001 From: Xyk Date: Wed, 30 Aug 2023 13:06:55 -0700 Subject: [PATCH 10/29] Purity line bugfixes and changes Fixed lights on Ambrosial and Purity Fixed life regen based on lower health not working Changed jewel line to specify the extra defense is only while you have that extra debuff and buffed its defense Nerfed Purity defense bonus, but made it tick down slower Fixed standing still in honey not providing extra regen on honey dew and living dew Fixed purity regen on standing still not working and added visuals Made ambrosial regen on standing still not require honey and gave it a visual to match purity's --- CalPlayer/CalamityPlayerLifeRegen.cs | 41 ++++++++++++------- Items/Accessories/AmbrosialAmpoule.cs | 15 ++----- Items/Accessories/Purity.cs | 13 +----- Items/Accessories/RadiantOoze.cs | 10 +---- .../en-US/Mods.CalamityMod.Bestiary.hjson | 2 +- .../Mods.CalamityMod.Items.Accessories.hjson | 8 ++-- ...ods.CalamityMod.Items.Weapons.Ranged.hjson | 2 +- 7 files changed, 38 insertions(+), 53 deletions(-) diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 831e0fafa7..afd8b5b602 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -411,6 +411,15 @@ namespace CalamityMod.CalPlayer Player.lifeRegen += 6; } + // Grant life regen based on missing health for Radiant Ooze, Ambrosial Ampule, and purity + if (rOoze || aAmpoule || purity) + { + float missingLifeRatio = (Player.statLifeMax2 - Player.statLife) / Player.statLifeMax2; + //Ambrosial Ampule and ooze give between 2 and 6 hp/s, Purity gives between 3 and 7 hp/s + float lifeRegenToGive = MathHelper.Lerp( purity ? 6f : 4f, purity ? 14f : 12f, missingLifeRatio); + Player.lifeRegen += (int)lifeRegenToGive; + } + if (purity) { int currentDebuffs = Player.buffType.Count(CalamityLists.debuffList.Contains); @@ -423,7 +432,9 @@ namespace CalamityMod.CalPlayer // Healing slows down after 5 seconds (300 frames) debuffed. For every 15 frames thereafter the cadence slows // There is no upper limit to how slow it can get and it can take a very long time to reset to normal int punishmentFrames = PurityHealSlowdownFrames - 300; - healFrameCadence += (punishmentFrames < 0) ? 0 : punishmentFrames / 15; + //lowest punishment is three full seconds between the one health heal + if (healFrameCadence < 180) + healFrameCadence += (punishmentFrames < 0) ? 0 : punishmentFrames / 15; if (Player.miscCounter % healFrameCadence == healFrameCadence - 1) Player.Heal(1); @@ -431,12 +442,12 @@ namespace CalamityMod.CalPlayer if (Player.lifeRegenTime < 1800) Player.lifeRegenTime = 1800; - jewelBonusDefense = 40 + (currentDebuffs - 1) * 10; + jewelBonusDefense = 20 + (currentDebuffs - 1) * 12; // Count up total frames spent healing for slowdown. ++PurityHealSlowdownFrames; } - else if (Player.miscCounter % 20 == 0 && jewelBonusDefense > 0) //TODO reduce defense and put cooldown at 60 like infected jewel + else if (Player.miscCounter % 60 == 0 && jewelBonusDefense > 0) --jewelBonusDefense; // If the player is clear of all debuffs then gradually reduce the slowdown frames @@ -464,11 +475,11 @@ namespace CalamityMod.CalPlayer if (Player.lifeRegenTime < 1800) Player.lifeRegenTime = 1800; - jewelBonusDefense = 16 + (currentDebuffs - 1) * 4; + jewelBonusDefense = 16 + (currentDebuffs - 1) * 8; } // Otherwise tick down the defense, one point per second - else if (Player.miscCounter % 60 == 0 && jewelBonusDefense > 0) + else if (Player.miscCounter % 20 == 0 && jewelBonusDefense > 0) --jewelBonusDefense; Player.statDefense += jewelBonusDefense; @@ -749,39 +760,39 @@ namespace CalamityMod.CalPlayer #region Standing Still Life Regen // Standing still healing bonuses (all are exclusive with vanilla Shiny Stone, but all function similarly) - if (!Player.shinyStone && Player.StandingStill() && Player.itemAnimation == 0) + if (!Player.shinyStone && Player.StandingStill() && Player.velocity.Y == 0 && Player.itemAnimation == 0) { - bool honeyDewWorking = honeyTurboRegen && Player.honey; - bool anyStandingStillLifeRegen = shadeRegen || cFreeze || honeyDewWorking || photosynthesis; + bool honeyDewWorking = honeyTurboRegen && Player.honeyWet; + bool anyStandingStillLifeRegen = shadeRegen || cFreeze || honeyDewWorking || photosynthesis || aAmpoule || purity; bool onlyPhotosynthesisAtNight = !shadeRegen && !cFreeze && !honeyDewWorking && photosynthesis && !Main.dayTime; // Divides all negative life regen by two before applying any other effects. if (anyStandingStillLifeRegen && Player.lifeRegen < 0) Player.lifeRegen /= 2; - // Spawn dust of some flavor while actually regenerating + // Spawn dust of some flavor while actually regenerating, aAmpule and purity have a slightly different looking style if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife) { - int dustType = shadeRegen ? 173 : cFreeze ? 67 : honeyDewWorking ? DustID.Honey2 : photosynthesis ? 244 : -1; - bool dustSpawnRolled = Main.rand.Next(30000) < Player.lifeRegenTime || Main.rand.NextBool(30); + int dustType = shadeRegen ? 173 : cFreeze ? 67 : honeyDewWorking ? DustID.Honey2 : photosynthesis ? 244 : aAmpoule ? 228 : purity ? 187 : -1; + bool dustSpawnRolled = Main.rand.Next(30000) < Player.lifeRegenTime || purity ? Main.rand.NextBool(2) : aAmpoule ? Main.rand.NextBool(4) : Main.rand.NextBool(30); if (dustType != -1 && dustSpawnRolled) { - int regen = Dust.NewDust(Player.position, Player.width, Player.height, dustType, 0f, 0f, 200, default, 1f); + int regen = Dust.NewDust(Player.position, Player.width, Player.height, dustType, 0f, 0f, purity || aAmpoule ? 80 : 200, default, purity || aAmpoule ? 0.5f : 1f); Main.dust[regen].noGravity = true; Main.dust[regen].fadeIn = 1.3f; Vector2 velocity = CalamityUtils.RandomVelocity(100f, 50f, 100f, 0.04f); Main.dust[regen].velocity = velocity; velocity.Normalize(); - velocity *= 34f; + velocity *= purity || aAmpoule ? 55f : 34f; Main.dust[regen].position = Player.Center - velocity; } } // Actually apply "standing still" regeneration (the stats are granted even at full health) - float regenTimeNeededForTurboRegen = shadeRegen ? 40f : cFreeze ? 60f : honeyDewWorking ? 90f : photosynthesis ? 90f : -1f; + float regenTimeNeededForTurboRegen = shadeRegen ? 40f : cFreeze ? 60f : honeyDewWorking ? 90f : photosynthesis ? 90f : aAmpoule ? 90f : purity ? 60f : -1f; // 4 = vanilla Shiny Stone - int turboRegenPower = shadeRegen || cFreeze ? 4 : honeyDewWorking ? 3 : photosynthesis ? 1 : -1; + int turboRegenPower = shadeRegen || cFreeze || purity ? 4 : honeyDewWorking || aAmpoule ? 3 : photosynthesis ? 1 : -1; if (turboRegenPower > 0) { diff --git a/Items/Accessories/AmbrosialAmpoule.cs b/Items/Accessories/AmbrosialAmpoule.cs index 486893b49c..0836aa2a59 100644 --- a/Items/Accessories/AmbrosialAmpoule.cs +++ b/Items/Accessories/AmbrosialAmpoule.cs @@ -24,26 +24,17 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); player.statLifeMax2 += 70; - // Grant life regen based on missing health - if (!(modPlayer.rOoze || modPlayer.purity)) - { - float missingLifeRatio = (player.statLifeMax2 - player.statLife) / player.statLifeMax2; - float lifeRegenToGive = MathHelper.Lerp(4f, 12f, missingLifeRatio); - player.lifeRegen += (int)lifeRegenToGive; - } - - // bool left in for abyss light purposes + // bool left in for abyss light purposes and life regen effects modPlayer.aAmpoule = true; - // Inherits all effects of Honey Dew and Living Dew + // Inherits all effects of Honey Dew and Living Dew (except standing regen is not honey exclusive anymore) modPlayer.alwaysHoneyRegen = true; - modPlayer.honeyTurboRegen = true; modPlayer.honeyDewHalveDebuffs = true; modPlayer.livingDewHalveDebuffs = true; // Add light if the other accessories aren't equipped and visibility is turned on if (!(modPlayer.rOoze || modPlayer.purity) && !hideVisual) - Lighting.AddLight(player.Center, new Vector3(1.2f, 1.7f, 2.7f)); + Lighting.AddLight(player.Center, new Vector3(1.2f, 1.2f, 0.72f)); } public override void AddRecipes() diff --git a/Items/Accessories/Purity.cs b/Items/Accessories/Purity.cs index 01b3cae591..a0d2242d05 100644 --- a/Items/Accessories/Purity.cs +++ b/Items/Accessories/Purity.cs @@ -27,26 +27,17 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); player.statLifeMax2 += 100; - // Grant life regen based on missing health - if (!(modPlayer.rOoze || modPlayer.aAmpoule)) - { - float missingLifeRatio = (player.statLifeMax2 - player.statLife) / player.statLifeMax2; - float lifeRegenToGive = MathHelper.Lerp(6f, 14f, missingLifeRatio); - player.lifeRegen += (int)lifeRegenToGive; - } - - // Abyss light, debuff near-immunity, and massively enhances debuff halving + // Abyss light, debuff near-immunity, life regen effects, and massively enhances debuff halving modPlayer.purity = true; // Inherits effects from Honey Dew and Living Dew modPlayer.alwaysHoneyRegen = true; - modPlayer.honeyTurboRegen = true; modPlayer.honeyDewHalveDebuffs = true; modPlayer.livingDewHalveDebuffs = true; // Add light if the other accessories aren't equipped and visibility is turned on if (!(modPlayer.rOoze || modPlayer.aAmpoule) && !hideVisual) - Lighting.AddLight(player.Center, new Vector3(1.376f, 1.658f, 2.103f)); + Lighting.AddLight(player.Center, new Vector3(1.32f, 1.32f, 1.82f)); } public override void AddRecipes() diff --git a/Items/Accessories/RadiantOoze.cs b/Items/Accessories/RadiantOoze.cs index 6e71d23589..58f33eec38 100644 --- a/Items/Accessories/RadiantOoze.cs +++ b/Items/Accessories/RadiantOoze.cs @@ -23,15 +23,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); - // Grant life regen based on missing health - if (!(modPlayer.aAmpoule || modPlayer.purity)) - { - float missingLifeRatio = (player.statLifeMax2 - player.statLife) / player.statLifeMax2; - float lifeRegenToGive = MathHelper.Lerp(4f, 12f, missingLifeRatio); - player.lifeRegen += (int)lifeRegenToGive; - } - - // bool left in for abyss light purposes + // bool left in for abyss light purposes and life regen effects modPlayer.rOoze = true; // Add light if the other accessories aren't equipped and visibility is turned on diff --git a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson index a59846bfb1..77baa3201a 100644 --- a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson +++ b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson @@ -189,4 +189,4 @@ StormWeaver: An invasive pest from another dimension crowned by many as king of SupremeCalamitas: After inheriting nigh limitless magical power as a mere teenager, she was recruited into Yharim’s army, where she served for nearly a decade. She reveled in the violence of it all, the endless dance of madness and death, allowing the Godseeker to wield her as a weapon in his endless war against the gods. But now that the fire inside her has died, all that remains are the smoldering embers of regret. SupremeCataclysm: The eldest of the three siblings, this brother was a brawler of great renown in Azafure, with few in the city being capable of matching his raw strength. He was protective of his sister, vowing to always be there for her in her times of need. The brother continues to fulfill this promise, even in death. SupremeCatastrophe: The middle child of the three siblings was a skilled swordsman in life, taking up mercenary work to put food on the table. Despite his rather bloody career choice, he did his best to be kind to his sister and keep her out of any danger his occupation could have put his remaining family in. He continues to defend her, even in death. -Yharon: Each dragon once wielded nigh limitless power over their domain, a fundamental power drawn directly from the world's fragmented soul. The dragons were masters of all; life, death, even the great Primordial Light that banishes the eternal night beyond. And yet, one of these majestic beings reached a height of power possibly second only to their king. He who made his kind eternal through his powers of Rebirth... and yet, even eternity did not last. +Yharon: Each dragon once wielded nigh limitless power over their domain, a fundamental power drawn directly from the world's fragmented soul. The dragons were masters of all; life, death, even the great Primordial Light that banishes the eternal night beyond. And yet, one of these majestic beings reached a height of power possibly second only to their king. He who made his kind eternal through his powers of Rebirth... and yet, even eternity did not last. \ 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 74aacfd921..e81b68f4f0 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -118,7 +118,7 @@ AmbrosialAmpoule: { +70 max life Grants +2 to +6 HP/s life regen based on missing health Provides life regeneration equivalent to standing in Honey - Standing still in Honey grants extremely powerful regen + Standing still grants extremely powerful regen Halves how long you are afflicted with fire and sickness debuffs You emit yellow light if visibility is enabled ''' @@ -248,11 +248,11 @@ Purity: { Grants +3 to +7 HP/s life regen based on missing health Provides life regeneration equivalent to standing in Honey Standing still grants extremely powerful regen - Grants 40 defense and continuous healing while afflicted with any debuff + Grants 20 defense and continuous healing while afflicted with any debuff The healing eventually slows down if debuffed for an extended period of time Massively boosts natural life regen while afflicted with any debuff - Each debuff beyond the first grants 10 additional defense Granted defense fades away slowly when not afflicted with any debuffs + Each debuff beyond the first temporarily grants 12 additional defense while debuffed Makes weak damage over time debuffs harmless and halves the duration of all but the strongest debuffs You emit shining blue light if visibility is enabled 'A once putrid crystal, now glimmering with immaculate purity' @@ -366,8 +366,8 @@ InfectedJewel: { +1 HP/s life regen Grants 16 defense and +2 HP/s life regen while afflicted with any debuff Massively boosts natural life regen while afflicted with any debuff - Each debuff beyond the first grants 4 additional defense Granted defense fades away slowly when not afflicted with any debuffs + Each debuff beyond the first temporarily grants 8 additional defense while debuffed Makes the Astral Infection debuff harmless 'A beautiful gemstone tarnished by spaceborne rot' ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 65e8c606eb..b40cc452aa 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -1285,4 +1285,4 @@ WulfrumBlunderbuss: { [c/83B87E:'The good thing about Wulfrum is that while it breaks fast, it can be reused even faster.] [c/83B87E:In fact, it is quite common for a robot to be turned into ammo right after it stops functioning.'] ''' -} +} \ No newline at end of file From ed00a6bb01da2b547975bdc7e0e3cec9e663062c Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Wed, 30 Aug 2023 16:40:08 -0400 Subject: [PATCH 11/29] Infected Jewel and Purity defense from multiple debuffs fades away properly --- CalPlayer/CalamityPlayerLifeRegen.cs | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index afd8b5b602..e6e8371b46 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -11,6 +11,7 @@ using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; @@ -422,6 +423,7 @@ namespace CalamityMod.CalPlayer if (purity) { + int intendedPurityDefense = 0; int currentDebuffs = Player.buffType.Count(CalamityLists.debuffList.Contains); if (currentDebuffs > 0) { @@ -442,12 +444,17 @@ namespace CalamityMod.CalPlayer if (Player.lifeRegenTime < 1800) Player.lifeRegenTime = 1800; - jewelBonusDefense = 20 + (currentDebuffs - 1) * 12; + intendedPurityDefense = 20 + (currentDebuffs - 1) * 12; + if (jewelBonusDefense < intendedPurityDefense) + jewelBonusDefense = intendedPurityDefense; // Count up total frames spent healing for slowdown. ++PurityHealSlowdownFrames; } - else if (Player.miscCounter % 60 == 0 && jewelBonusDefense > 0) + + // If the defense should be ticking down to some lower value, do that. + // Purity loses 1 point of defense every second. + if (Player.miscCounter % 60 == 0 && jewelBonusDefense > intendedPurityDefense) --jewelBonusDefense; // If the player is clear of all debuffs then gradually reduce the slowdown frames @@ -458,6 +465,7 @@ namespace CalamityMod.CalPlayer PurityHealSlowdownFrames = 0; } + // Actually apply defense bonus Player.statDefense += jewelBonusDefense; } @@ -468,6 +476,7 @@ namespace CalamityMod.CalPlayer // If the player has any debuffs, give the extra life regen and defense // More defense is given for each additional debuff + int intendedJewelDefense = 0; int currentDebuffs = Player.buffType.Count(CalamityLists.debuffList.Contains); if (currentDebuffs > 0) { @@ -475,13 +484,17 @@ namespace CalamityMod.CalPlayer if (Player.lifeRegenTime < 1800) Player.lifeRegenTime = 1800; - jewelBonusDefense = 16 + (currentDebuffs - 1) * 8; + intendedJewelDefense = 16 + (currentDebuffs - 1) * 8; + if (jewelBonusDefense < intendedJewelDefense) + jewelBonusDefense = intendedJewelDefense; } - // Otherwise tick down the defense, one point per second - else if (Player.miscCounter % 20 == 0 && jewelBonusDefense > 0) + // If the defense should be ticking down to some lower value, do that. + // Infected Jewel loses 1 point of defense every 20 frames. + if (Player.miscCounter % 20 == 0 && jewelBonusDefense > intendedJewelDefense) --jewelBonusDefense; + // Actually apply defense bonus Player.statDefense += jewelBonusDefense; } From 7bee71d3fccde5f4045eb121209ee7653554dd35 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Wed, 30 Aug 2023 16:43:06 -0400 Subject: [PATCH 12/29] fix infected jewel and purity localization issues --- Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index e81b68f4f0..413bf28da2 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -251,8 +251,8 @@ Purity: { Grants 20 defense and continuous healing while afflicted with any debuff The healing eventually slows down if debuffed for an extended period of time Massively boosts natural life regen while afflicted with any debuff + Each debuff beyond the first grants 12 additional defense Granted defense fades away slowly when not afflicted with any debuffs - Each debuff beyond the first temporarily grants 12 additional defense while debuffed Makes weak damage over time debuffs harmless and halves the duration of all but the strongest debuffs You emit shining blue light if visibility is enabled 'A once putrid crystal, now glimmering with immaculate purity' @@ -366,8 +366,8 @@ InfectedJewel: { +1 HP/s life regen Grants 16 defense and +2 HP/s life regen while afflicted with any debuff Massively boosts natural life regen while afflicted with any debuff - Granted defense fades away slowly when not afflicted with any debuffs - Each debuff beyond the first temporarily grants 8 additional defense while debuffed + Granted defense fades away quickly when not afflicted with any debuffs + Each debuff beyond the first grants 8 additional defense Makes the Astral Infection debuff harmless 'A beautiful gemstone tarnished by spaceborne rot' ''' From 9989e5154e88acb3d6ac3a2bc9efcc18ef2431bc Mon Sep 17 00:00:00 2001 From: Xyk Date: Wed, 30 Aug 2023 14:46:49 -0700 Subject: [PATCH 13/29] Jewel and purity defense adjustment fixed a mistake from earlier 12 bonus to 8 on purity 8 bonus to 5 on infected jewel both tick down once a second --- CalPlayer/CalamityPlayerLifeRegen.cs | 6 +++--- Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index e6e8371b46..b904ffeb75 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -444,7 +444,7 @@ namespace CalamityMod.CalPlayer if (Player.lifeRegenTime < 1800) Player.lifeRegenTime = 1800; - intendedPurityDefense = 20 + (currentDebuffs - 1) * 12; + intendedPurityDefense = 20 + (currentDebuffs - 1) * 8; if (jewelBonusDefense < intendedPurityDefense) jewelBonusDefense = intendedPurityDefense; @@ -484,14 +484,14 @@ namespace CalamityMod.CalPlayer if (Player.lifeRegenTime < 1800) Player.lifeRegenTime = 1800; - intendedJewelDefense = 16 + (currentDebuffs - 1) * 8; + intendedJewelDefense = 16 + (currentDebuffs - 1) * 5; if (jewelBonusDefense < intendedJewelDefense) jewelBonusDefense = intendedJewelDefense; } // If the defense should be ticking down to some lower value, do that. // Infected Jewel loses 1 point of defense every 20 frames. - if (Player.miscCounter % 20 == 0 && jewelBonusDefense > intendedJewelDefense) + if (Player.miscCounter % 60 == 0 && jewelBonusDefense > intendedJewelDefense) --jewelBonusDefense; // Actually apply defense bonus diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 413bf28da2..0b7b5e55d1 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -251,7 +251,7 @@ Purity: { Grants 20 defense and continuous healing while afflicted with any debuff The healing eventually slows down if debuffed for an extended period of time Massively boosts natural life regen while afflicted with any debuff - Each debuff beyond the first grants 12 additional defense + Each debuff beyond the first grants 8 additional defense Granted defense fades away slowly when not afflicted with any debuffs Makes weak damage over time debuffs harmless and halves the duration of all but the strongest debuffs You emit shining blue light if visibility is enabled @@ -367,7 +367,7 @@ InfectedJewel: { Grants 16 defense and +2 HP/s life regen while afflicted with any debuff Massively boosts natural life regen while afflicted with any debuff Granted defense fades away quickly when not afflicted with any debuffs - Each debuff beyond the first grants 8 additional defense + Each debuff beyond the first grants 5 additional defense Makes the Astral Infection debuff harmless 'A beautiful gemstone tarnished by spaceborne rot' ''' From 110fa8ca05495ba7b5acd1be37255827a7721610 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <142704082+CongratsIsTrash@users.noreply.github.com> Date: Wed, 30 Aug 2023 18:21:15 -0400 Subject: [PATCH 14/29] Nerfed Pulse Rifle's damage more, as after testing it out of curiosity it's still way too good --- Items/Weapons/DraedonsArsenal/PulseRifle.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/DraedonsArsenal/PulseRifle.cs b/Items/Weapons/DraedonsArsenal/PulseRifle.cs index e4afc89dbc..d2684920b4 100644 --- a/Items/Weapons/DraedonsArsenal/PulseRifle.cs +++ b/Items/Weapons/DraedonsArsenal/PulseRifle.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/PulseRifleFire"); - private int BaseDamage = 1280; + private int BaseDamage = 1200; public override void SetDefaults() { From af31478d4b02ea3b2b7b0c48daad88196930125e Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <142704082+CongratsIsTrash@users.noreply.github.com> Date: Wed, 30 Aug 2023 19:28:34 -0400 Subject: [PATCH 15/29] Simplified Starmageddon's recipe (forgot to do this earlier whoops) --- Items/Weapons/Ranged/Starmageddon.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/Items/Weapons/Ranged/Starmageddon.cs b/Items/Weapons/Ranged/Starmageddon.cs index 07cf6bbe9a..078ca87605 100644 --- a/Items/Weapons/Ranged/Starmageddon.cs +++ b/Items/Weapons/Ranged/Starmageddon.cs @@ -55,11 +55,8 @@ namespace CalamityMod.Items.Weapons.Ranged { CreateRecipe(). AddIngredient(). - AddIngredient(). AddIngredient(). - AddIngredient(). AddIngredient(5). - AddIngredient(10). AddIngredient(10). AddIngredient(15). AddTile(ModContent.TileType()). From a3b100fa21c083484a4198b5c707168d739d68b0 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <142704082+CongratsIsTrash@users.noreply.github.com> Date: Wed, 30 Aug 2023 19:53:42 -0400 Subject: [PATCH 16/29] Buffed Starmageddon's damage, and main projectile is now exempt from pierce resist --- CalamityLists.cs | 1 + Items/Weapons/Ranged/Starmageddon.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CalamityLists.cs b/CalamityLists.cs index 77d91932d9..f9d71c9bb7 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -2040,6 +2040,7 @@ namespace CalamityMod ProjectileType(), ProjectileType(), ProjectileType(), + ProjectileType(), }; // Lists of enemies that resist piercing to some extent (mostly worms). diff --git a/Items/Weapons/Ranged/Starmageddon.cs b/Items/Weapons/Ranged/Starmageddon.cs index 078ca87605..d27be3cc48 100644 --- a/Items/Weapons/Ranged/Starmageddon.cs +++ b/Items/Weapons/Ranged/Starmageddon.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 90; + Item.damage = 100; Item.knockBack = 4f; Item.shootSpeed = 16f; Item.useStyle = ItemUseStyleID.Shoot; From 12361d0240f02f62cda803039819f4398f33b9c5 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <142704082+CongratsIsTrash@users.noreply.github.com> Date: Wed, 30 Aug 2023 21:11:44 -0400 Subject: [PATCH 17/29] I have concluded that allowing Elemental Shiv's extra projectiles to pierce was a mistake --- Projectiles/Melee/SHIV.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Projectiles/Melee/SHIV.cs b/Projectiles/Melee/SHIV.cs index 2283f9cf48..d940fd634a 100644 --- a/Projectiles/Melee/SHIV.cs +++ b/Projectiles/Melee/SHIV.cs @@ -19,13 +19,11 @@ namespace CalamityMod.Projectiles.Melee Projectile.height = 20; Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; - Projectile.penetrate = 2; + Projectile.penetrate = 1; Projectile.tileCollide = false; Projectile.timeLeft = 90; Projectile.aiStyle = ProjAIStyleID.Beam; Projectile.extraUpdates = 1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; } public override void AI() From 96f9795b18b60de4c98ba35e51d6aa403442274e Mon Sep 17 00:00:00 2001 From: Done2222 Date: Thu, 31 Aug 2023 09:47:35 +0300 Subject: [PATCH 18/29] Heavenly Gale nerf --- Items/Weapons/Ranged/HeavenlyGale.cs | 4 ++-- .../en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Items/Weapons/Ranged/HeavenlyGale.cs b/Items/Weapons/Ranged/HeavenlyGale.cs index c1675b64ba..0cafcf0831 100644 --- a/Items/Weapons/Ranged/HeavenlyGale.cs +++ b/Items/Weapons/Ranged/HeavenlyGale.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 300; + Item.damage = 221; Item.DamageType = DamageClass.Ranged; Item.width = 138; Item.height = 176; @@ -76,4 +76,4 @@ namespace CalamityMod.Items.Weapons.Ranged Register(); } } -} \ No newline at end of file +} diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 65e8c606eb..b40cc452aa 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -1285,4 +1285,4 @@ WulfrumBlunderbuss: { [c/83B87E:'The good thing about Wulfrum is that while it breaks fast, it can be reused even faster.] [c/83B87E:In fact, it is quite common for a robot to be turned into ammo right after it stops functioning.'] ''' -} +} \ No newline at end of file From b3b59328bc34ce0d100bfc0a9aa709656a0d51d1 Mon Sep 17 00:00:00 2001 From: Done2222 Date: Thu, 31 Aug 2023 09:50:36 +0300 Subject: [PATCH 19/29] Revert "Heavenly Gale nerf" This reverts commit 96f9795b18b60de4c98ba35e51d6aa403442274e. --- Items/Weapons/Ranged/HeavenlyGale.cs | 4 ++-- .../en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Items/Weapons/Ranged/HeavenlyGale.cs b/Items/Weapons/Ranged/HeavenlyGale.cs index 0cafcf0831..c1675b64ba 100644 --- a/Items/Weapons/Ranged/HeavenlyGale.cs +++ b/Items/Weapons/Ranged/HeavenlyGale.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 221; + Item.damage = 300; Item.DamageType = DamageClass.Ranged; Item.width = 138; Item.height = 176; @@ -76,4 +76,4 @@ namespace CalamityMod.Items.Weapons.Ranged Register(); } } -} +} \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index b40cc452aa..65e8c606eb 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -1285,4 +1285,4 @@ WulfrumBlunderbuss: { [c/83B87E:'The good thing about Wulfrum is that while it breaks fast, it can be reused even faster.] [c/83B87E:In fact, it is quite common for a robot to be turned into ammo right after it stops functioning.'] ''' -} \ No newline at end of file +} From 8e0559facee931751097c56fce3e247f2e0dd7eb Mon Sep 17 00:00:00 2001 From: Done2222 Date: Thu, 31 Aug 2023 09:50:57 +0300 Subject: [PATCH 20/29] Heavenly Gale nerf --- Items/Weapons/Ranged/HeavenlyGale.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/Weapons/Ranged/HeavenlyGale.cs b/Items/Weapons/Ranged/HeavenlyGale.cs index c1675b64ba..0cafcf0831 100644 --- a/Items/Weapons/Ranged/HeavenlyGale.cs +++ b/Items/Weapons/Ranged/HeavenlyGale.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 300; + Item.damage = 221; Item.DamageType = DamageClass.Ranged; Item.width = 138; Item.height = 176; @@ -76,4 +76,4 @@ namespace CalamityMod.Items.Weapons.Ranged Register(); } } -} \ No newline at end of file +} From 1ad426a735c21cd1d7242dcd6b08df75e0147586 Mon Sep 17 00:00:00 2001 From: Done2222 Date: Thu, 31 Aug 2023 10:39:17 +0300 Subject: [PATCH 21/29] for some reason i suggested putting this at 130 even though i wrote 162 on my notes --- Items/Weapons/Ranged/DragonsBreath.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/DragonsBreath.cs b/Items/Weapons/Ranged/DragonsBreath.cs index d412ddaefb..7faa5af5dc 100644 --- a/Items/Weapons/Ranged/DragonsBreath.cs +++ b/Items/Weapons/Ranged/DragonsBreath.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 130; + Item.damage = 162; Item.DamageType = DamageClass.Ranged; Item.width = 124; Item.height = 78; From 0e0c893162e6abd868d1ddfa739fdce51187359e Mon Sep 17 00:00:00 2001 From: Done2222 Date: Thu, 31 Aug 2023 13:25:59 +0300 Subject: [PATCH 22/29] The Sponge tooltip fix --- Items/Weapons/Ranged/DragonsBreath.cs | 1 - Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Items/Weapons/Ranged/DragonsBreath.cs b/Items/Weapons/Ranged/DragonsBreath.cs index 7faa5af5dc..7998f6fe0d 100644 --- a/Items/Weapons/Ranged/DragonsBreath.cs +++ b/Items/Weapons/Ranged/DragonsBreath.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.DamageType = DamageClass.Ranged; Item.width = 124; Item.height = 78; - Item.useTime = 9; Item.useAnimation = 18; Item.reuseDelay = BetweenShotsPause; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 0b7b5e55d1..c678c3afb6 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -1818,7 +1818,7 @@ TheSponge: { ''' Projects a quantum foam barrier that absorbs up to 180 damage The barrier grants 30 defense and reduces damage taken by 30% while active - The barrier starts recharging 6 seconds after being hit + The barrier starts recharging 9 seconds after being hit Recharging from zero to full charge takes 6 seconds Being hit again while recharging restarts the charge timer The barrier's color will change to match your team selection as needed From 8120bc52c53eb39b3d9921e6d1e02341f62db027 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <142704082+CongratsIsTrash@users.noreply.github.com> Date: Thu, 31 Aug 2023 09:33:26 -0400 Subject: [PATCH 23/29] Buffed Sand Sharknado Staff because it got completely butchered in 2.0.3 for whatever reason --- Items/Weapons/Summon/SandSharknadoStaff.cs | 6 +++--- Projectiles/Summon/MiniSandShark.cs | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Items/Weapons/Summon/SandSharknadoStaff.cs b/Items/Weapons/Summon/SandSharknadoStaff.cs index 568f0131ee..61b24397f4 100644 --- a/Items/Weapons/Summon/SandSharknadoStaff.cs +++ b/Items/Weapons/Summon/SandSharknadoStaff.cs @@ -11,17 +11,17 @@ namespace CalamityMod.Items.Weapons.Summon public class SandSharknadoStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; - #region Other stats for easy modifcation + #region Other stats for easy modification public const float ProjVel = 30f; - public const float FireSpeed = 120f; // In frames. 60 frames = 2 seconds. + public const float FireSpeed = 50f; // In frames. 60 frames = 1 second. #endregion public override void SetDefaults() { - Item.damage = 47; + Item.damage = 55; Item.knockBack = 2f; Item.mana = 10; diff --git a/Projectiles/Summon/MiniSandShark.cs b/Projectiles/Summon/MiniSandShark.cs index a71818b08e..ad08daaaf9 100644 --- a/Projectiles/Summon/MiniSandShark.cs +++ b/Projectiles/Summon/MiniSandShark.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.minion = true; Projectile.friendly = true; Projectile.ignoreWater = true; + Projectile.extraUpdates = 1; Projectile.DamageType = DamageClass.Summon; } @@ -34,6 +35,16 @@ namespace CalamityMod.Projectiles.Summon public override void Kill(int timeLeft) // When the projectile hits an enemy, it'll make a dust impact effect. { + Projectile.position = Projectile.Center; + Projectile.width = Projectile.height = 64; + Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); + Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2); + Projectile.maxPenetrate = -1; + Projectile.penetrate = -1; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 10; + Projectile.damage = (int)(Projectile.damage * 0.75f); + Projectile.Damage(); SoundEngine.PlaySound(SoundID.Item14, Projectile.position); for (int dustIndex = 0; dustIndex < 36; dustIndex++) { From bf69a301dec14d4f3f222478cd8431d0987422d9 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Thu, 31 Aug 2023 12:25:34 -0400 Subject: [PATCH 24/29] Further Sand Sharknado changes --- Items/Weapons/Summon/SandSharknadoStaff.cs | 4 ++-- Projectiles/Summon/MiniSandShark.cs | 3 ++- Projectiles/Summon/SandnadoMinion.cs | 9 +++++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Items/Weapons/Summon/SandSharknadoStaff.cs b/Items/Weapons/Summon/SandSharknadoStaff.cs index 61b24397f4..95807064b4 100644 --- a/Items/Weapons/Summon/SandSharknadoStaff.cs +++ b/Items/Weapons/Summon/SandSharknadoStaff.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; #region Other stats for easy modification - public const float ProjVel = 30f; + public const float ProjSpeed = 30f; public const float FireSpeed = 50f; // In frames. 60 frames = 1 second. @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - Item.damage = 55; + Item.damage = 47; Item.knockBack = 2f; Item.mana = 10; diff --git a/Projectiles/Summon/MiniSandShark.cs b/Projectiles/Summon/MiniSandShark.cs index ad08daaaf9..939e5d60a1 100644 --- a/Projectiles/Summon/MiniSandShark.cs +++ b/Projectiles/Summon/MiniSandShark.cs @@ -23,6 +23,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.extraUpdates = 1; + Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Summon; } @@ -43,7 +44,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; - Projectile.damage = (int)(Projectile.damage * 0.75f); + Projectile.damage = (int)(Projectile.damage * 0.6f); Projectile.Damage(); SoundEngine.PlaySound(SoundID.Item14, Projectile.position); for (int dustIndex = 0; dustIndex < 36; dustIndex++) diff --git a/Projectiles/Summon/SandnadoMinion.cs b/Projectiles/Summon/SandnadoMinion.cs index 364096e900..d2356c97a6 100644 --- a/Projectiles/Summon/SandnadoMinion.cs +++ b/Projectiles/Summon/SandnadoMinion.cs @@ -143,11 +143,16 @@ namespace CalamityMod.Projectiles.Summon public void ShootTarget(NPC target) { - if (TimerForShooting == SandSharknadoStaff.FireSpeed && Main.myPlayer == Projectile.owner) + int randomDelay = Main.rand.Next(-5, 6); + Vector2 targetPos = target.Center; + Vector2 ProjVel = targetPos - Projectile.Center; + ProjVel.Normalize(); + ProjVel *= SandSharknadoStaff.ProjSpeed; + if (TimerForShooting == SandSharknadoStaff.FireSpeed + randomDelay && Main.myPlayer == Projectile.owner) { int sandSharkProj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, - CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, target, SandSharknadoStaff.ProjVel), + ProjVel, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, From 953463d32ba5bc11c4c6b759055668cc27793882 Mon Sep 17 00:00:00 2001 From: Done2222 Date: Thu, 31 Aug 2023 19:26:12 +0300 Subject: [PATCH 25/29] Blossom Flux nerf (20 -> 14) --- Items/Weapons/Ranged/BlossomFlux.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/BlossomFlux.cs b/Items/Weapons/Ranged/BlossomFlux.cs index 5ce6e69dcb..08bf441c83 100644 --- a/Items/Weapons/Ranged/BlossomFlux.cs +++ b/Items/Weapons/Ranged/BlossomFlux.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 20; + Item.damage = 14; Item.DamageType = DamageClass.Ranged; Item.width = 38; Item.height = 68; From 5a32cff13594c1e07edd4a7be1b0bd123c750181 Mon Sep 17 00:00:00 2001 From: Done2222 Date: Thu, 31 Aug 2023 22:04:52 +0300 Subject: [PATCH 26/29] Hoarfrost Bow and Herring Staff nerfs --- Items/Weapons/Ranged/HoarfrostBow.cs | 2 +- Items/Weapons/Summon/HerringStaff.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/Weapons/Ranged/HoarfrostBow.cs b/Items/Weapons/Ranged/HoarfrostBow.cs index 80a9e04a96..9f290e1709 100644 --- a/Items/Weapons/Ranged/HoarfrostBow.cs +++ b/Items/Weapons/Ranged/HoarfrostBow.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 56; + Item.damage = 37; Item.DamageType = DamageClass.Ranged; Item.width = 26; Item.height = 70; diff --git a/Items/Weapons/Summon/HerringStaff.cs b/Items/Weapons/Summon/HerringStaff.cs index 4f18837d2d..28fdad0288 100644 --- a/Items/Weapons/Summon/HerringStaff.cs +++ b/Items/Weapons/Summon/HerringStaff.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public override void SetDefaults() { - Item.damage = 17; + Item.damage = 15; Item.knockBack = 1.25f; Item.mana = 10; From f68e7b17c930b3544f7154131e6ea8e88ab6fee8 Mon Sep 17 00:00:00 2001 From: Xyk Date: Thu, 31 Aug 2023 13:25:51 -0700 Subject: [PATCH 27/29] Life regen phrasing changes made almost everything cal changes about regen in vanilla say HP/s instead and made all calamity items and buffs use HP/s as well (the stuff Ozz missed) Only exception is OOA armors, but they don't originally specify regen given so I'm not gonna change it --- Items/CalamityGlobalItemTooltip.cs | 14 ++++---- .../en-US/Mods.CalamityMod.Buffs.hjson | 8 ++--- .../Mods.CalamityMod.Items.Accessories.hjson | 2 +- .../Mods.CalamityMod.Items.Potions.hjson | 32 +++++++++---------- ...Mods.CalamityMod.Items.Weapons.Rogue.hjson | 2 +- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index c7ebc3d180..7ce3b741ee 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -442,7 +442,7 @@ namespace CalamityMod.Items // Palladium if (item.type == ItemID.PalladiumSword || item.type == ItemID.PalladiumPike) - EditTooltipByName("Knockback", (line) => line.Text += "\nIncreases life regen on hit"); + EditTooltipByName("Knockback", (line) => line.Text += "\nIncreases natural life regen on hit"); // Mythril if (item.type == ItemID.MythrilSword || item.type == ItemID.MythrilHalberd) @@ -588,7 +588,7 @@ namespace CalamityMod.Items // Fairy Boots buff. if (item.type == ItemID.FairyBoots) EditTooltipByNum(2, (line) => line.Text += "\nFairies can spawn at any time on the surface and spawn far more frequently\n" + - "Nearby fairies grant increased life regen, defense and movement speed\n" + + "Nearby fairies grant +2 HP/s life regen, 10 defense and 10% movement speed\n" + "Fairies are immune to damage and will no longer flee"); // Armor Crunch immunity pre-Golem. @@ -729,7 +729,7 @@ namespace CalamityMod.Items if (item.type == ItemID.TinHelmet) AddTooltip("3% increased critical strike chance"); if (item.type == ItemID.TinChainmail) - AddTooltip("+1 life regen"); + AddTooltip("+0.5 HP/s life regen"); if (item.type == ItemID.TinGreaves) AddTooltip("5% increased movement speed"); @@ -745,7 +745,7 @@ namespace CalamityMod.Items if (item.type == ItemID.SilverHelmet) AddTooltip("5% increased critical strike chance"); if (item.type == ItemID.SilverChainmail) - AddTooltip("+2 life regen"); + AddTooltip("+1 HP/s life regen"); if (item.type == ItemID.SilverGreaves) AddTooltip("8% increased movement speed"); @@ -753,7 +753,7 @@ namespace CalamityMod.Items if (item.type == ItemID.TungstenHelmet) AddTooltip("7% increased damage"); if (item.type == ItemID.TungstenChainmail) - AddTooltip("+1 life regen"); + AddTooltip("+0.5 HP/s life regen"); if (item.type == ItemID.TungstenGreaves) AddTooltip("8% increased movement speed"); @@ -782,7 +782,7 @@ namespace CalamityMod.Items { EditTooltipByNum(0, (line) => { string newTooltip = line.Text.Replace("2%", "5%"); - newTooltip += "\n+1 life regen"; + newTooltip += "\n+0.5 HP/s life regen"; line.Text = newTooltip; }); } @@ -945,7 +945,7 @@ namespace CalamityMod.Items AddWingStats(3f, 1f, 0, 25); if (item.type == ItemID.AngelWings) - AddWingStats(6.25f, 1f, 1, 100, "+20 max life, +10 defense and +2 life regen"); + AddWingStats(6.25f, 1f, 1, 100, "+20 max life, +10 defense and +1 HP/s life regen"); if (item.type == ItemID.DemonWings) AddWingStats(6.25f, 1f, 1, 100, "5% increased damage and critical strike chance"); diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index d352342248..83f5f3c1ea 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -754,7 +754,7 @@ KamiBuff: { Mushy: { DisplayName: Mushy - Description: Increased defense by 6 and life regen by 2 + Description: Increased defense by 6 and life regen by 1HP/s } PhantomicEmpowerment: { @@ -1479,12 +1479,12 @@ WulfrumDroidBuff: { PinkJellyRegen: { DisplayName: Pink Jelly Regen - Description: The power of goo refreshes you, life regen increased by 4 + Description: The power of goo refreshes you, life regen increased by 2HP/s } GreenJellyRegen: { DisplayName: Green Jelly Regen - Description: The regenerative goo empowers you, life regen increased by 5 + Description: The regenerative goo empowers you, life regen increased by 2.5HP/s } AbsorberRegen: { @@ -1492,7 +1492,7 @@ AbsorberRegen: { Description: ''' You are blessed by the culmimation of nature's powers - Life regen increased by 6, damage increased by 8%, damage reduction increased by 5% + Life regen increased by 3HP/s, damage increased by 8%, damage reduction increased by 5% ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index c678c3afb6..2153fdf732 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -799,7 +799,7 @@ FungalSymbiote: { Tooltip: ''' You grow mushrooms on the grass beneath you - Consuming mushrooms provides the Mushy buff, increasing defense by 6 and granting 0.5 HP/s life regen + Consuming mushrooms provides the Mushy buff, increasing defense by 6 and granting 1 HP/s life regen All mushroom-based weapons deal 10% more damage and emit non-damaging mushrooms ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index b694abfb31..b1e804aab3 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -180,7 +180,7 @@ BloodyMary: { Tooltip: ''' 10% increased damage and movement speed during a Blood Moon - Reduces life regen by 4 and defense by 4% + Reduces life regen by 2 HP/s and defense by 4% [c/B00BA5:'Extra spicy... and bloody!'] ''' } @@ -189,7 +189,7 @@ CaribbeanRum: { DisplayName: Caribbean Rum Tooltip: ''' - Increases life regen by 2, movement speed by 10% and wing flight time by 20% + Increases life regen by 1 HP/s, movement speed by 10% and wing flight time by 20% Makes you floaty and reduces defense by 10% [c/B00BA5:'Why is the rum gone?'] ''' @@ -210,7 +210,7 @@ Everclear: { Tooltip: ''' 25% increased damage - Reduces life regen by 10 and defense by 30% + Reduces life regen by 5 HP/s and defense by 30% [c/B00BA5:'This is the most potent booze I have, be careful with it.'] ''' } @@ -220,7 +220,7 @@ EvergreenGin: { Tooltip: ''' Multiplies all sickness and water-related debuff damage by 1.25x - Reduces life regen by 1 + Reduces life regen by 0.5 HP/s [c/B00BA5:'It tastes like a Christmas tree, if you can imagine that.'] ''' } @@ -240,7 +240,7 @@ Fireball: { Tooltip: ''' Multiplies all fire-based debuff damage by 1.25x - Reduces life regen by 1 + Reduces life regen by 0.5 HP/s [c/B00BA5:'A great-tasting cinnamon whiskey.'] ''' } @@ -259,7 +259,7 @@ Margarita: { Tooltip: ''' Halves the duration of most harmful debuffs - Reduces defense by 6% and life regen by 1 + Reduces defense by 6% and life regen by 0.5 HP/s 3 minute duration [c/B00BA5:'One of the best drinks ever created, enjoy it while it lasts.'] ''' @@ -270,7 +270,7 @@ Moonshine: { Tooltip: ''' Increases defense by 10 and damage reduction by 3% - Reduces life regen by 1 + Reduces life regen by 0.5 HP/s [c/B00BA5:'This stuff is pretty strong, but I'm sure you can handle it.'] ''' } @@ -280,7 +280,7 @@ MoscowMule: { Tooltip: ''' Increases damage by 9%, knockback by 50% and critical strike chance by 3% - Reduces life regen by 4 + Reduces life regen by 2 HP/s [c/B00BA5:'I once heard the copper mug can be toxic and I told 'em, 'listen dummy, I'm already poisoning myself!''] ''' } @@ -299,7 +299,7 @@ RedWine: { DisplayName: Red Wine Tooltip: ''' - Reduces life regen by 1 for 15 seconds + Reduces life regen by 0.5 HP/s for 15 seconds [c/B00BA5:'Too dry for my taste.'] ''' } @@ -308,7 +308,7 @@ Rum: { DisplayName: Rum Tooltip: ''' - Increases life regen by 2 and movement speed by 10% + Increases life regen by 1 HP/s and movement speed by 10% Reduces defense by 5% [c/B00BA5:'Sweet and potent, just how I like it.'] ''' @@ -319,7 +319,7 @@ Screwdriver: { Tooltip: ''' Multiplies piercing projectile damage by 1.05x - Reduces life regen by 1 + Reduces life regen by 0.5 HP/s [c/B00BA5:'Do you have a screw loose?'] ''' } @@ -330,7 +330,7 @@ StarBeamRye: { ''' Increases max mana by 50, magic damage by 8%, and reduces mana usage by 10% - Reduces defense by 6% and life regen by 2 + Reduces defense by 6% and life regen by 1 HP/s [c/B00BA5:'Made from some stuff I found near the Astral Meteor crash site. Don't worry, it's safe, trust me...'] ''' } @@ -340,7 +340,7 @@ Tequila: { Tooltip: ''' Increases knockback by 10%, crit chance by 4% and defense by 5 during daytime - Reduces life regen by 1 + Reduces life regen by 0.5 HP/s [c/B00BA5:'Great for mixing up daytime drinks.'] ''' } @@ -350,7 +350,7 @@ TequilaSunrise: { Tooltip: ''' Increases knockback by 20%, crit chance by 8% and defense by 10 during daytime - Reduces life regen by 2 + Reduces life regen by 1 HP/s [c/B00BA5:'The greatest daytime drink I've ever had.'] ''' } @@ -360,7 +360,7 @@ Vodka: { Tooltip: ''' Increases damage by 6% and critical strike chance by 2% - Reduces life regen by 1 and defense by 5% + Reduces life regen by 0.5 HP/s and defense by 5% [c/B00BA5:'The number one alcohol for creating great mixed drinks.'] ''' } @@ -380,7 +380,7 @@ WhiteWine: { Tooltip: ''' Increases magic damage by 8% - Reduces defense by 6% and life regen by 1 + Reduces defense by 6% and life regen by 0.5 HP/s [c/B00BA5:'I drank a full barrel of this stuff once in one night, I couldn't remember who I was the next day.'] ''' } \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 69377fae41..d672b623a1 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -843,7 +843,7 @@ OrichalcumSpikedGemstone: { PalladiumJavelin: { DisplayName: Palladium Javelin - Tooltip: Stealth strikes split into more javelins and boost life regeneration on hits + Tooltip: Stealth strikes split into more javelins and boost natural life regeneration on hits } Penumbra: { From 97cbab115e8993a5ebc8b068071aaa0bea4f1d4d Mon Sep 17 00:00:00 2001 From: Xyk Date: Thu, 31 Aug 2023 14:09:57 -0700 Subject: [PATCH 28/29] Tier shifted Fairy Boots and Rampart of Deities Fairy boots is Spectre Boots, Flower Boots, and 5 souls of light Rampart is Frozen Shield, Deific amulet, 5 auric bars and 5 ASE --- Items/Accessories/RampartofDeities.cs | 9 ++++----- Utilities/CalamityRecipes.cs | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Items/Accessories/RampartofDeities.cs b/Items/Accessories/RampartofDeities.cs index c994cc1856..6ac921ae46 100644 --- a/Items/Accessories/RampartofDeities.cs +++ b/Items/Accessories/RampartofDeities.cs @@ -17,10 +17,10 @@ namespace CalamityMod.Items.Accessories { Item.width = 64; Item.height = 62; - Item.value = CalamityGlobalItem.Rarity14BuyPrice; + Item.value = CalamityGlobalItem.Rarity15BuyPrice; Item.defense = 18; Item.accessory = true; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override void UpdateAccessory(Player player, bool hideVisual) @@ -57,9 +57,8 @@ namespace CalamityMod.Items.Accessories CreateRecipe(). AddIngredient(ItemID.FrozenShield). AddIngredient(). - AddIngredient(10). - AddIngredient(10). - AddIngredient(4). + AddIngredient(5). + AddIngredient(5). AddTile(). Register(); } diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index 75a77e5ee8..8590dabaed 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -827,6 +827,7 @@ namespace CalamityMod { Vanilla(ItemID.BundleofBalloons), AddIngredient(ModContent.ItemType(), 3) }, { r => r.HasResult(ItemID.HorseshoeBundle) && !r.HasIngredient(ItemID.BundleofBalloons), AddIngredient(ModContent.ItemType(), 3) }, { Vanilla(ItemID.NightsEdge), AddIngredient(ModContent.ItemType(), 5) }, + { Vanilla(ItemID.FairyBoots), AddIngredient(ItemID.SoulofLight, 5) }, { Vanilla(ItemID.SpiritFlame), AddGroup(AnyAdamantiteBar, 2) }, { Vanilla(ItemID.TerraBlade), AddIngredient(ModContent.ItemType(), 12) }, { Vanilla(ItemID.FireGauntlet), AddIngredient(ModContent.ItemType(), 5) }, From c79830b69b71e8d509fe0a886ce1ae185fea59c1 Mon Sep 17 00:00:00 2001 From: Storm2103 Date: Thu, 31 Aug 2023 18:58:50 -0600 Subject: [PATCH 29/29] Fixed Utensil Poker only firing forks and made the order of utensils static --- Items/Weapons/Rogue/UtensilPoker.cs | 15 ++++++++------- .../Mods.CalamityMod.Items.Weapons.Rogue.hjson | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Items/Weapons/Rogue/UtensilPoker.cs b/Items/Weapons/Rogue/UtensilPoker.cs index 1ace51a26d..ba75465275 100644 --- a/Items/Weapons/Rogue/UtensilPoker.cs +++ b/Items/Weapons/Rogue/UtensilPoker.cs @@ -5,6 +5,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Particles; namespace CalamityMod.Items.Weapons.Rogue { @@ -45,23 +46,23 @@ namespace CalamityMod.Items.Weapons.Rogue } else { - int utensil = ModContent.ProjectileType(); + type = ModContent.ProjectileType(); double dmgMult = 1D; float kbMult = 1f; - switch (Main.rand.Next(3)) + switch (counter) { case 0: - utensil = ModContent.ProjectileType(); + type = ModContent.ProjectileType(); dmgMult = 1.1; kbMult = 2f; break; case 1: - utensil = ModContent.ProjectileType(); + type = ModContent.ProjectileType(); dmgMult = 1.2; kbMult = 1f; break; case 2: - utensil = ModContent.ProjectileType(); + type = ModContent.ProjectileType(); dmgMult = 1D; kbMult = 1f; break; @@ -70,7 +71,8 @@ namespace CalamityMod.Items.Weapons.Rogue } damage = (int)(damage * dmgMult); knockback = knockback * kbMult; - } + + } } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) @@ -80,7 +82,6 @@ namespace CalamityMod.Items.Weapons.Rogue int idx = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); if (idx.WithinBounds(Main.maxProjectiles)) Main.projectile[idx].Calamity().stealthStrike = mp.StealthStrikeAvailable(); - counter++; if (counter == 3) counter = 0; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index d672b623a1..b75593716d 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -1337,7 +1337,7 @@ UtensilPoker: { DisplayName: Utensil Poker Tooltip: ''' - Fires random utensils in bursts of three + Fires utensils in bursts of three Stealth strikes replace any utensil with a powerful butcher knife 'Space chickens, that is all' '''