From 1e0e3a717ae76d031e05212251fad8493dec93ea Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 3 Jun 2020 22:24:22 -0400 Subject: [PATCH 001/160] made an exo debuffs utility --- Projectiles/Magic/VividBeam.cs | 21 ++++---- Projectiles/Magic/VividBolt.cs | 15 +++--- Projectiles/Magic/VividClarityBeam.cs | 20 +++---- Projectiles/Magic/VividLaser2.cs | 19 +++---- Projectiles/Magic/Vortex.cs | 17 +++--- Projectiles/Melee/ElementalExcaliburBeam.cs | 26 +++++---- Projectiles/Melee/ExoGladComet.cs | 17 +++--- Projectiles/Melee/ExoGladProj.cs | 59 +++++++++++++++++---- Projectiles/Melee/ExoGladSpears.cs | 17 +++--- Projectiles/Melee/ExoGladiusBeam.cs | 18 +++---- Projectiles/Melee/Exobeam.cs | 17 +++--- Projectiles/Melee/Exoboom.cs | 32 +++++------ Projectiles/Melee/Exocomet.cs | 25 +++++---- Projectiles/Ranged/BlueExoArrow.cs | 31 +++++++---- Projectiles/Ranged/DrataliornusExoArrow.cs | 14 ++--- Projectiles/Ranged/ExoFire.cs | 17 +++--- Projectiles/Ranged/ExoLight.cs | 18 +++---- Projectiles/Ranged/ExoLightBurst.cs | 20 +++---- Projectiles/Ranged/GreenExoArrow.cs | 17 +++--- Projectiles/Ranged/MagnomalyBeam.cs | 15 +++--- Projectiles/Ranged/MagnomalyExplosion.cs | 17 +++--- Projectiles/Ranged/MagnomalyRocket.cs | 30 +++++++---- Projectiles/Ranged/OrangeExoArrow.cs | 17 +++--- Projectiles/Ranged/TealExoArrow.cs | 17 +++--- Projectiles/Rogue/Celestus2.cs | 22 +------- Projectiles/Rogue/CelestusBoomerang.cs | 22 +------- Projectiles/Rogue/SupernovaBomb.cs | 22 +------- Projectiles/Rogue/SupernovaBoom.cs | 22 +------- Projectiles/Rogue/SupernovaHoming.cs | 22 +------- Projectiles/Rogue/SupernovaSpike.cs | 22 +------- Projectiles/Summon/CosmicBlast.cs | 17 +++--- Projectiles/Summon/CosmicBlastBig.cs | 17 +++--- Utilities/CalamityUtils.cs | 50 +++++++++++++++++ 33 files changed, 326 insertions(+), 406 deletions(-) diff --git a/Projectiles/Magic/VividBeam.cs b/Projectiles/Magic/VividBeam.cs index 1bba3fbf3a..5f07ad4ae7 100644 --- a/Projectiles/Magic/VividBeam.cs +++ b/Projectiles/Magic/VividBeam.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using System; @@ -98,15 +96,16 @@ namespace CalamityMod.Projectiles.Magic { SummonLasers(); } - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (projectile.owner == Main.myPlayer) + { + SummonLasers(); + } + target.ExoDebuffs(); } private void SummonLasers() diff --git a/Projectiles/Magic/VividBolt.cs b/Projectiles/Magic/VividBolt.cs index a0443dcca5..1fa5ae52b2 100644 --- a/Projectiles/Magic/VividBolt.cs +++ b/Projectiles/Magic/VividBolt.cs @@ -65,15 +65,12 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.ExoDebuffs(); } } } diff --git a/Projectiles/Magic/VividClarityBeam.cs b/Projectiles/Magic/VividClarityBeam.cs index 59d149066b..614d4279b8 100644 --- a/Projectiles/Magic/VividClarityBeam.cs +++ b/Projectiles/Magic/VividClarityBeam.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -97,20 +95,18 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); if (target.type == NPCID.TargetDummy) { return; } - projectile.damage = (int)((double)projectile.damage * 1.1); + projectile.damage = (int)(projectile.damage * 1.1); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.ExoDebuffs(); + projectile.damage = (int)(projectile.damage * 1.1); } } } diff --git a/Projectiles/Magic/VividLaser2.cs b/Projectiles/Magic/VividLaser2.cs index b8f9e7ac1d..3db215c1c7 100644 --- a/Projectiles/Magic/VividLaser2.cs +++ b/Projectiles/Magic/VividLaser2.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -62,16 +60,13 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); - } + target.ExoDebuffs(); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.ExoDebuffs(); + } // Cannot deal damage for the first several frames of existence. public override bool? CanHitNPC(NPC target) diff --git a/Projectiles/Magic/Vortex.cs b/Projectiles/Magic/Vortex.cs index 86462050c7..4ad04b0ed0 100644 --- a/Projectiles/Magic/Vortex.cs +++ b/Projectiles/Magic/Vortex.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -149,15 +147,12 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.ExoDebuffs(); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Melee/ElementalExcaliburBeam.cs b/Projectiles/Melee/ElementalExcaliburBeam.cs index 9df00e4032..660a368351 100644 --- a/Projectiles/Melee/ElementalExcaliburBeam.cs +++ b/Projectiles/Melee/ElementalExcaliburBeam.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -245,15 +243,21 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 60); - target.AddBuff(ModContent.BuffType(), 240); - target.AddBuff(ModContent.BuffType(), 240); - target.AddBuff(ModContent.BuffType(), 240); - target.AddBuff(ModContent.BuffType(), 240); - target.AddBuff(BuffID.CursedInferno, 240); - target.AddBuff(BuffID.Frostburn, 240); - target.AddBuff(BuffID.OnFire, 240); - target.AddBuff(BuffID.Ichor, 240); + target.ExoDebuffs(2f); + + if (projectile.ai[0] == 7f) + { + projectile.velocity *= 0.25f; + } + else if (projectile.ai[0] == 8f) + { + projectile.velocity *= -1f; + } + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.ExoDebuffs(2f); if (projectile.ai[0] == 7f) { diff --git a/Projectiles/Melee/ExoGladComet.cs b/Projectiles/Melee/ExoGladComet.cs index ede9497a67..7ae372dc51 100644 --- a/Projectiles/Melee/ExoGladComet.cs +++ b/Projectiles/Melee/ExoGladComet.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -70,15 +68,12 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.ExoDebuffs(); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Melee/ExoGladProj.cs b/Projectiles/Melee/ExoGladProj.cs index ae2b717f7e..ace192dfb5 100644 --- a/Projectiles/Melee/ExoGladProj.cs +++ b/Projectiles/Melee/ExoGladProj.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using System; using Terraria; @@ -152,16 +150,55 @@ namespace CalamityMod.Projectiles.Melee num14 *= num16; int num17 = Projectile.NewProjectile(x, y, num13, num14, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), swordKB, projectile.owner, 0f, 0f); } + target.ExoDebuffs(); + } - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + public override void OnHitPvp(Player target, int damage, bool crit) + { + int type = ModContent.ProjectileType(); + int numSwords = Main.rand.Next(1,4); + float swordKB = projectile.knockBack; + for (int i = 0; i < numSwords; ++i) + { + float startOffsetX = Main.rand.NextFloat(1000f, 1400f) * (Main.rand.NextBool() ? -1f : 1f); + float startOffsetY = Main.rand.NextFloat(80f, 900f) * (Main.rand.NextBool() ? -1f : 1f); + Vector2 startPos = new Vector2(target.Center.X + startOffsetX, target.Center.Y + startOffsetY); + float dx = target.Center.X - startPos.X; + float dy = target.Center.Y - startPos.Y; + + dx += Main.rand.NextFloat(-5f, 5f); + dy += Main.rand.NextFloat(-5f, 5f); + float speed = Main.rand.NextFloat(24f, 30f); + float dist = (float)Math.Sqrt((double)(dx * dx + dy * dy)); + dist = speed / dist; + dx *= dist; + dy *= dist; + Vector2 swordVel = new Vector2(dx, dy); + float angle = Main.rand.NextFloat(MathHelper.TwoPi); + if (projectile.owner == Main.myPlayer) + { + int idx = Projectile.NewProjectile(startPos, swordVel, type, (int)((double)projectile.damage * 0.25), swordKB, projectile.owner, 0f, 0f); + Main.projectile[idx].rotation = angle; + } + } + + int spearAmt = Main.rand.Next(1,4); + for (int n = 0; n < spearAmt; n++) + { + float x = projectile.position.X + (float)Main.rand.Next(-400, 400); + float y = projectile.position.Y + (float)Main.rand.Next(800, 1000); + Vector2 vector = new Vector2(x, y); + float num13 = projectile.position.X + (float)(projectile.width / 2) - vector.X; + float num14 = projectile.position.Y + (float)(projectile.height / 2) - vector.Y; + num13 += (float)Main.rand.Next(-100, 101); + int num15 = 29; + float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); + num16 = (float)num15 / num16; + num13 *= num16; + num14 *= num16; + int num17 = Projectile.NewProjectile(x, y, num13, num14, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), swordKB, projectile.owner, 0f, 0f); + } + target.ExoDebuffs(); } } } diff --git a/Projectiles/Melee/ExoGladSpears.cs b/Projectiles/Melee/ExoGladSpears.cs index 8b1a20bf84..489d2eea50 100644 --- a/Projectiles/Melee/ExoGladSpears.cs +++ b/Projectiles/Melee/ExoGladSpears.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -166,15 +164,12 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.ExoDebuffs(); } } } diff --git a/Projectiles/Melee/ExoGladiusBeam.cs b/Projectiles/Melee/ExoGladiusBeam.cs index e0b562e115..bebcea157f 100644 --- a/Projectiles/Melee/ExoGladiusBeam.cs +++ b/Projectiles/Melee/ExoGladiusBeam.cs @@ -118,15 +118,15 @@ namespace CalamityMod.Projectiles.Melee projectile.scale += (maxScale - 1) / (float)penetrationAmt; projectile.ai[1] = 5 + Main.rand.Next(-2, 3); - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + projectile.scale += (maxScale - 1) / (float)penetrationAmt; + projectile.ai[1] = 5 + Main.rand.Next(-2, 3); + + target.ExoDebuffs(); } } } diff --git a/Projectiles/Melee/Exobeam.cs b/Projectiles/Melee/Exobeam.cs index 77884b6d39..382ada426d 100644 --- a/Projectiles/Melee/Exobeam.cs +++ b/Projectiles/Melee/Exobeam.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -137,15 +135,12 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.ExoDebuffs(); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Melee/Exoboom.cs b/Projectiles/Melee/Exoboom.cs index 8b5b528c9e..802afbb5f6 100644 --- a/Projectiles/Melee/Exoboom.cs +++ b/Projectiles/Melee/Exoboom.cs @@ -81,30 +81,26 @@ namespace CalamityMod.Projectiles.Melee num463 *= num466; num464 *= num466; int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(0, 255, 255), 1.5f); - Main.dust[num467].noGravity = true; - Main.dust[num467].position.X = projectile.Center.X; - Main.dust[num467].position.Y = projectile.Center.Y; - Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X += (float)Main.rand.Next(-10, 11); - Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y += (float)Main.rand.Next(-10, 11); - Main.dust[num467].velocity.X = num463; - Main.dust[num467].velocity.Y = num464; + Dust dust = Main.dust[num467]; + dust.noGravity = true; + dust.position.X = projectile.Center.X; + dust.position.Y = projectile.Center.Y; + dust.position.X += (float)Main.rand.Next(-10, 11); + dust.position.Y += (float)Main.rand.Next(-10, 11); + dust.velocity.X = num463; + dust.velocity.Y = num464; num462++; } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.ExoDebuffs(); + } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); } } } diff --git a/Projectiles/Melee/Exocomet.cs b/Projectiles/Melee/Exocomet.cs index 4efc5a5ed2..400ab230b9 100644 --- a/Projectiles/Melee/Exocomet.cs +++ b/Projectiles/Melee/Exocomet.cs @@ -90,15 +90,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); if (target.type == NPCID.TargetDummy) { return; @@ -115,6 +107,21 @@ namespace CalamityMod.Projectiles.Melee CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ModContent.ProjectileType(), 1200f, 1f); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.ExoDebuffs(); + float healAmt = (float)damage * 0.01f; + if ((int)healAmt == 0) + { + return; + } + if (Main.player[Main.myPlayer].lifeSteal <= 0f) + { + return; + } + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ModContent.ProjectileType(), 1200f, 1f); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Ranged/BlueExoArrow.cs b/Projectiles/Ranged/BlueExoArrow.cs index b38cfbcacc..2a9210321b 100644 --- a/Projectiles/Ranged/BlueExoArrow.cs +++ b/Projectiles/Ranged/BlueExoArrow.cs @@ -96,17 +96,30 @@ namespace CalamityMod.Projectiles.Ranged return false; } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.ExoDebuffs(); + for (int x = 0; x < 3; x++) + { + float xPos = projectile.ai[0] > 0 ? projectile.position.X + 500 : projectile.position.X - 500; + Vector2 vector2 = new Vector2(xPos, projectile.position.Y + Main.rand.Next(-500, 501)); + float num80 = xPos; + float speedX = (float)target.position.X - vector2.X; + float speedY = (float)target.position.Y - vector2.Y; + float dir = (float)Math.Sqrt((double)(speedX * speedX + speedY * speedY)); + dir = 10 / num80; + speedX *= dir * 150; + speedY *= dir * 150; + if (projectile.owner == Main.myPlayer) + { + Projectile.NewProjectile(vector2.X, vector2.Y, speedX, speedY, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.7), 1f, projectile.owner); + } + } + } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); for (int x = 0; x < 3; x++) { float xPos = projectile.ai[0] > 0 ? projectile.position.X + 500 : projectile.position.X - 500; diff --git a/Projectiles/Ranged/DrataliornusExoArrow.cs b/Projectiles/Ranged/DrataliornusExoArrow.cs index c032573a6e..d57837122d 100644 --- a/Projectiles/Ranged/DrataliornusExoArrow.cs +++ b/Projectiles/Ranged/DrataliornusExoArrow.cs @@ -60,10 +60,11 @@ namespace CalamityMod.Projectiles.Ranged } } - public override void OnHitPlayer(Player target, int damage, bool crit) + public override void OnHitPvp(Player target, int damage, bool crit) { - target.AddBuff(BuffID.Ichor, 540); target.AddBuff(ModContent.BuffType(), 540); + target.AddBuff(BuffID.Ichor, 540); + target.ExoDebuffs(); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) @@ -72,14 +73,7 @@ namespace CalamityMod.Projectiles.Ranged target.AddBuff(BuffID.Daybreak, 540); target.AddBuff(ModContent.BuffType(), 540); - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Ranged/ExoFire.cs b/Projectiles/Ranged/ExoFire.cs index 8058226979..455f3739a8 100644 --- a/Projectiles/Ranged/ExoFire.cs +++ b/Projectiles/Ranged/ExoFire.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using System.Collections.Generic; using Terraria; @@ -96,15 +94,12 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.ExoDebuffs(); } } } diff --git a/Projectiles/Ranged/ExoLight.cs b/Projectiles/Ranged/ExoLight.cs index b86913a0af..18b4b57568 100644 --- a/Projectiles/Ranged/ExoLight.cs +++ b/Projectiles/Ranged/ExoLight.cs @@ -1,6 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; @@ -86,15 +84,11 @@ namespace CalamityMod.Projectiles.Ranged } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 60); - target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(BuffID.CursedInferno, 180); - target.AddBuff(BuffID.Frostburn, 180); - target.AddBuff(BuffID.OnFire, 180); - target.AddBuff(BuffID.Ichor, 180); + target.ExoDebuffs(2f); + } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.ExoDebuffs(2f); } } } diff --git a/Projectiles/Ranged/ExoLightBurst.cs b/Projectiles/Ranged/ExoLightBurst.cs index b34a586853..42660174e2 100644 --- a/Projectiles/Ranged/ExoLightBurst.cs +++ b/Projectiles/Ranged/ExoLightBurst.cs @@ -1,6 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -75,17 +73,15 @@ namespace CalamityMod.Projectiles.Ranged CalamityGlobalProjectile.ExpandHitboxBy(projectile, width, height); return null; } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 60); - target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(BuffID.CursedInferno, 180); - target.AddBuff(BuffID.Frostburn, 180); - target.AddBuff(BuffID.OnFire, 180); - target.AddBuff(BuffID.Ichor, 180); + target.ExoDebuffs(2f); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.ExoDebuffs(2f); } } } diff --git a/Projectiles/Ranged/GreenExoArrow.cs b/Projectiles/Ranged/GreenExoArrow.cs index 14dbd90676..966670abc7 100644 --- a/Projectiles/Ranged/GreenExoArrow.cs +++ b/Projectiles/Ranged/GreenExoArrow.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -59,15 +57,12 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.ExoDebuffs(); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Ranged/MagnomalyBeam.cs b/Projectiles/Ranged/MagnomalyBeam.cs index c89a3e15ca..6814cdcebe 100644 --- a/Projectiles/Ranged/MagnomalyBeam.cs +++ b/Projectiles/Ranged/MagnomalyBeam.cs @@ -103,15 +103,12 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.ExoDebuffs(); } } } diff --git a/Projectiles/Ranged/MagnomalyExplosion.cs b/Projectiles/Ranged/MagnomalyExplosion.cs index 5f6e9859f2..eaa19849a5 100644 --- a/Projectiles/Ranged/MagnomalyExplosion.cs +++ b/Projectiles/Ranged/MagnomalyExplosion.cs @@ -1,8 +1,6 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; namespace CalamityMod.Projectiles.Ranged { public class MagnomalyExplosion : ModProjectile @@ -29,15 +27,12 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.ExoDebuffs(); } } } diff --git a/Projectiles/Ranged/MagnomalyRocket.cs b/Projectiles/Ranged/MagnomalyRocket.cs index ebc84779fa..ad1f2deaf7 100644 --- a/Projectiles/Ranged/MagnomalyRocket.cs +++ b/Projectiles/Ranged/MagnomalyRocket.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -145,15 +143,25 @@ namespace CalamityMod.Projectiles.Ranged int proj2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage / 4, projectile.knockBack / 4, projectile.owner, 0f, 1f); } } - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (projectile.owner == Main.myPlayer) + { + float random = Main.rand.Next(30, 90); + float spread = random * 0.0174f; + double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + for (int i = 0; i < 4; i++) + { + double offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; + int proj1 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage / 4, projectile.knockBack / 4, projectile.owner, 0f, 1f); + int proj2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage / 4, projectile.knockBack / 4, projectile.owner, 0f, 1f); + } + } + target.ExoDebuffs(); } } } diff --git a/Projectiles/Ranged/OrangeExoArrow.cs b/Projectiles/Ranged/OrangeExoArrow.cs index 085e80af95..275bbc4e0a 100644 --- a/Projectiles/Ranged/OrangeExoArrow.cs +++ b/Projectiles/Ranged/OrangeExoArrow.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -97,15 +95,12 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.ExoDebuffs(); } public override void Kill(int timeLeft) diff --git a/Projectiles/Ranged/TealExoArrow.cs b/Projectiles/Ranged/TealExoArrow.cs index 4a9e00a9f9..0704497d31 100644 --- a/Projectiles/Ranged/TealExoArrow.cs +++ b/Projectiles/Ranged/TealExoArrow.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -61,15 +59,12 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.ExoDebuffs(); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Rogue/Celestus2.cs b/Projectiles/Rogue/Celestus2.cs index 7f9d070323..825b8d27e4 100644 --- a/Projectiles/Rogue/Celestus2.cs +++ b/Projectiles/Rogue/Celestus2.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -52,28 +50,12 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); } public override void OnHitPvp(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Rogue/CelestusBoomerang.cs b/Projectiles/Rogue/CelestusBoomerang.cs index 5ccaed09b3..08a6c98a18 100644 --- a/Projectiles/Rogue/CelestusBoomerang.cs +++ b/Projectiles/Rogue/CelestusBoomerang.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -116,15 +114,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); if (projectile.owner == Main.myPlayer) { float spread = 45f * 0.0174f; @@ -143,15 +133,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitPvp(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); if (projectile.owner == Main.myPlayer) { float spread = 45f * 0.0174f; diff --git a/Projectiles/Rogue/SupernovaBomb.cs b/Projectiles/Rogue/SupernovaBomb.cs index 09f49bc211..2c2b5bde8d 100644 --- a/Projectiles/Rogue/SupernovaBomb.cs +++ b/Projectiles/Rogue/SupernovaBomb.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -144,28 +142,12 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); } public override void OnHitPvp(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Rogue/SupernovaBoom.cs b/Projectiles/Rogue/SupernovaBoom.cs index 6af43f0920..6cbb60b03d 100644 --- a/Projectiles/Rogue/SupernovaBoom.cs +++ b/Projectiles/Rogue/SupernovaBoom.cs @@ -3,8 +3,6 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; namespace CalamityMod.Projectiles.Rogue { public class SupernovaBoom : ModProjectile @@ -98,28 +96,12 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); } public override void OnHitPvp(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); } } } diff --git a/Projectiles/Rogue/SupernovaHoming.cs b/Projectiles/Rogue/SupernovaHoming.cs index 98c15fc61a..b1631a0873 100644 --- a/Projectiles/Rogue/SupernovaHoming.cs +++ b/Projectiles/Rogue/SupernovaHoming.cs @@ -2,8 +2,6 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Rogue { @@ -107,28 +105,12 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); } public override void OnHitPvp(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); } } } diff --git a/Projectiles/Rogue/SupernovaSpike.cs b/Projectiles/Rogue/SupernovaSpike.cs index 512e8781ab..e6d3859eb4 100644 --- a/Projectiles/Rogue/SupernovaSpike.cs +++ b/Projectiles/Rogue/SupernovaSpike.cs @@ -2,8 +2,6 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Rogue { @@ -63,28 +61,12 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); } public override void OnHitPvp(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); } internal static void Visuals(Projectile projectile, ref Color c) diff --git a/Projectiles/Summon/CosmicBlast.cs b/Projectiles/Summon/CosmicBlast.cs index ed589327a3..4aadd4ee21 100644 --- a/Projectiles/Summon/CosmicBlast.cs +++ b/Projectiles/Summon/CosmicBlast.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -90,15 +88,12 @@ namespace CalamityMod.Projectiles.Summon public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.ExoDebuffs(); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Summon/CosmicBlastBig.cs b/Projectiles/Summon/CosmicBlastBig.cs index fb140b945c..846aea163a 100644 --- a/Projectiles/Summon/CosmicBlastBig.cs +++ b/Projectiles/Summon/CosmicBlastBig.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using System; using Terraria; @@ -104,15 +102,12 @@ namespace CalamityMod.Projectiles.Summon public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.ExoDebuffs(); } public override void Kill(int timeLeft) diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index f4931c6f06..45b41352c6 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -1,3 +1,5 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Items; using CalamityMod.Items.Tools.ClimateChange; @@ -122,6 +124,25 @@ namespace CalamityMod { return player.inventory.Any(item => items.Contains(item.type)); } + + /// + /// Inflict typical exo weapon debuffs in pvp. + /// + /// The Player attacked. + /// Debuff time multiplier if needed. + /// Inflicts debuffs if the target isn't immune. + public static void ExoDebuffs(this Player target, float multiplier = 1f) + { + target.AddBuff(ModContent.BuffType(), (int)(30 * multiplier)); + target.AddBuff(ModContent.BuffType(), (int)(120 * multiplier)); + target.AddBuff(ModContent.BuffType(), (int)(120 * multiplier)); + target.AddBuff(ModContent.BuffType(), (int)(120 * multiplier)); + target.AddBuff(ModContent.BuffType(), (int)(120 * multiplier)); + target.AddBuff(BuffID.CursedInferno, (int)(120 * multiplier)); + target.AddBuff(BuffID.Frostburn, (int)(120 * multiplier)); + target.AddBuff(BuffID.OnFire, (int)(120 * multiplier)); + target.AddBuff(BuffID.Ichor, (int)(120 * multiplier)); + } #endregion #region NPC Utilities @@ -265,6 +286,35 @@ namespace CalamityMod } return false; } + + /// + /// Inflict typical exo weapon debuffs. This helps bypass the 5 debuff limit by checking if the NPC already has it. + /// + /// The NPC attacked. + /// Debuff time multiplier if needed. + /// Inflicts debuffs if they can. + public static void ExoDebuffs(this NPC target, float multiplier = 1f) + { + CalamityGlobalNPC modTarget = target.Calamity(); + if (modTarget.eFreeze <= 0) + target.AddBuff(ModContent.BuffType(), (int)(30 * multiplier)); + if (modTarget.bFlames <= 0) + target.AddBuff(ModContent.BuffType(), (int)(120 * multiplier)); + if (modTarget.gState <= 0) + target.AddBuff(ModContent.BuffType(), (int)(120 * multiplier)); + if (modTarget.pFlames <= 0) + target.AddBuff(ModContent.BuffType(), (int)(120 * multiplier)); + if (modTarget.hFlames <= 0) + target.AddBuff(ModContent.BuffType(), (int)(120 * multiplier)); + if (!target.onFire2) + target.AddBuff(BuffID.CursedInferno, (int)(120 * multiplier)); + if (!target.onFrostBurn) + target.AddBuff(BuffID.Frostburn, (int)(120 * multiplier)); + if (!target.onFire) + target.AddBuff(BuffID.OnFire, (int)(120 * multiplier)); + if (!target.ichor) + target.AddBuff(BuffID.Ichor, (int)(120 * multiplier)); + } #endregion #region Item Utilities From 87e102f39c99bb244a8001f0e1eac911fa42847e Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 3 Jun 2020 22:32:37 -0400 Subject: [PATCH 002/160] totally didn't forget Exoblade and Exo Gladius exist --- Items/Weapons/Melee/DraedonsExoblade.cs | 20 ++------------------ Items/Weapons/Melee/ExoGladius.cs | 20 ++------------------ 2 files changed, 4 insertions(+), 36 deletions(-) diff --git a/Items/Weapons/Melee/DraedonsExoblade.cs b/Items/Weapons/Melee/DraedonsExoblade.cs index 0abf7fbb2b..0281210719 100644 --- a/Items/Weapons/Melee/DraedonsExoblade.cs +++ b/Items/Weapons/Melee/DraedonsExoblade.cs @@ -64,15 +64,7 @@ namespace CalamityMod.Items.Weapons.Melee { Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), knockback, Main.myPlayer); } - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); Main.PlaySound(SoundID.Item88, player.Center); float xPos = player.position.X + 800 * Main.rand.NextBool(2).ToDirectionInt(); float yPos = player.position.Y + Main.rand.Next(-800, 801); @@ -106,15 +98,7 @@ namespace CalamityMod.Items.Weapons.Melee { Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), item.knockBack, Main.myPlayer); } - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); Main.PlaySound(SoundID.Item88, player.Center); float xPos = player.position.X + 800 * Main.rand.NextBool(2).ToDirectionInt(); float yPos = player.position.Y + Main.rand.Next(-800, 801); diff --git a/Items/Weapons/Melee/ExoGladius.cs b/Items/Weapons/Melee/ExoGladius.cs index 543f56e7e1..eac90b1bf4 100644 --- a/Items/Weapons/Melee/ExoGladius.cs +++ b/Items/Weapons/Melee/ExoGladius.cs @@ -81,15 +81,7 @@ namespace CalamityMod.Items.Weapons.Melee player.hurtCooldowns[1] = 10; } - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); float x = target.Center.X + (float)Main.rand.Next(-400, 400); float y = target.Center.Y - (float)Main.rand.Next(500, 800); @@ -121,15 +113,7 @@ namespace CalamityMod.Items.Weapons.Melee player.hurtCooldowns[1] = 10; } - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); + target.ExoDebuffs(); float x = target.Center.X + (float)Main.rand.Next(-400, 400); float y = target.Center.Y - (float)Main.rand.Next(500, 800); From ab2da173d09e101687a3911122513c0ec8fbed16 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 3 Jun 2020 22:33:07 -0400 Subject: [PATCH 003/160] removed using directives --- Items/Weapons/Melee/DraedonsExoblade.cs | 2 -- Items/Weapons/Melee/ExoGladius.cs | 2 -- 2 files changed, 4 deletions(-) diff --git a/Items/Weapons/Melee/DraedonsExoblade.cs b/Items/Weapons/Melee/DraedonsExoblade.cs index 0281210719..40e701a021 100644 --- a/Items/Weapons/Melee/DraedonsExoblade.cs +++ b/Items/Weapons/Melee/DraedonsExoblade.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; using CalamityMod.Tiles.Furniture.CraftingStations; diff --git a/Items/Weapons/Melee/ExoGladius.cs b/Items/Weapons/Melee/ExoGladius.cs index eac90b1bf4..efd767fa2d 100644 --- a/Items/Weapons/Melee/ExoGladius.cs +++ b/Items/Weapons/Melee/ExoGladius.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; using CalamityMod.Tiles.Furniture.CraftingStations; From 5484aa9bcc3c101b9cfea1a31f2d33196ff61a20 Mon Sep 17 00:00:00 2001 From: DominicKarma42 <51094361+DominicKarma@users.noreply.github.com> Date: Fri, 3 Jul 2020 06:49:32 -0500 Subject: [PATCH 004/160] Various new wulfrum enemies + Wulfrum shard rename --- ExtraTextures/WulfrumPylon.png | Bin 0 -> 616 bytes Items/Materials/WulfrumShard.cs | 2 +- Items/Materials/WulfrumShard.png | Bin 261 -> 346 bytes .../Placeables/Banners/WulfrumDroneBanner.png | Bin 237 -> 385 bytes .../Banners/WulfrumGyratorBanner.cs | 26 ++ .../Banners/WulfrumGyratorBanner.png | Bin 0 -> 382 bytes .../Banners/WulfrumHovercraftBanner.cs | 26 ++ .../Banners/WulfrumHovercraftBanner.png | Bin 0 -> 385 bytes .../Placeables/Banners/WulfrumPylonBanner.cs | 26 ++ .../Placeables/Banners/WulfrumPylonBanner.png | Bin 0 -> 364 bytes .../Placeables/Banners/WulfrumRoverBanner.cs | 26 ++ .../Placeables/Banners/WulfrumRoverBanner.png | Bin 0 -> 357 bytes NPCs/NormalNPCs/WulfrumDrone.cs | 120 +++++++-- NPCs/NormalNPCs/WulfrumDrone.png | Bin 1881 -> 722 bytes NPCs/NormalNPCs/WulfrumGyrator.cs | 175 ++++++++++++ NPCs/NormalNPCs/WulfrumGyrator.png | Bin 0 -> 2893 bytes NPCs/NormalNPCs/WulfrumHovercraft.cs | 253 ++++++++++++++++++ NPCs/NormalNPCs/WulfrumHovercraft.png | Bin 0 -> 3431 bytes NPCs/NormalNPCs/WulfrumPylon.cs | 159 +++++++++++ NPCs/NormalNPCs/WulfrumPylon.png | Bin 0 -> 616 bytes NPCs/NormalNPCs/WulfrumRover.cs | 141 ++++++++++ NPCs/NormalNPCs/WulfrumRover.png | Bin 0 -> 3622 bytes NPCs/NormalNPCs/WulfrumRoverShield.png | Bin 0 -> 5552 bytes Tiles/MonsterBanner.cs | 24 ++ Tiles/MonsterBanner.png | Bin 73834 -> 81167 bytes 25 files changed, 961 insertions(+), 17 deletions(-) create mode 100644 ExtraTextures/WulfrumPylon.png create mode 100644 Items/Placeables/Banners/WulfrumGyratorBanner.cs create mode 100644 Items/Placeables/Banners/WulfrumGyratorBanner.png create mode 100644 Items/Placeables/Banners/WulfrumHovercraftBanner.cs create mode 100644 Items/Placeables/Banners/WulfrumHovercraftBanner.png create mode 100644 Items/Placeables/Banners/WulfrumPylonBanner.cs create mode 100644 Items/Placeables/Banners/WulfrumPylonBanner.png create mode 100644 Items/Placeables/Banners/WulfrumRoverBanner.cs create mode 100644 Items/Placeables/Banners/WulfrumRoverBanner.png create mode 100644 NPCs/NormalNPCs/WulfrumGyrator.cs create mode 100644 NPCs/NormalNPCs/WulfrumGyrator.png create mode 100644 NPCs/NormalNPCs/WulfrumHovercraft.cs create mode 100644 NPCs/NormalNPCs/WulfrumHovercraft.png create mode 100644 NPCs/NormalNPCs/WulfrumPylon.cs create mode 100644 NPCs/NormalNPCs/WulfrumPylon.png create mode 100644 NPCs/NormalNPCs/WulfrumRover.cs create mode 100644 NPCs/NormalNPCs/WulfrumRover.png create mode 100644 NPCs/NormalNPCs/WulfrumRoverShield.png diff --git a/ExtraTextures/WulfrumPylon.png b/ExtraTextures/WulfrumPylon.png new file mode 100644 index 0000000000000000000000000000000000000000..c578407dd3457bdf2eedb9f8085748718a475571 GIT binary patch literal 616 zcmeAS@N?(olHy`uVBq!ia0vp^dJGJVA{@*>R`SO$RX~cdILO_JVcj{Imq3nLfKP}k zkWTMRnZ3HyH#*qC!A-X{zA8E3+{smk{yXO#h~4%7r&diw%OQgbbv=eOV59p~ErKgCAQds_ZoA<=sdf&T>a z?)R;7=)5juy+?18!Ev_#S{n}}e<{vtd@yZl1;@T8RiaxLA4)DcSN%N8_+I&~O6KJ) zLhr5LuK1AY)%oD*!Rece^=}0}+Opx2%%PVD=N5Y{F33vFd=}<(*23I3`GY{x8r7Xg zeot|dXb;X})ZH9n#C88Phm2+To4bBH!uK>@RzATM|N2(gonsHyX6%&e&-Y$iAi*v# z!9IPh)0Nza9GTcXnk);s9t%7$;FDngWG=KgNm%T0Xr0tG&47n<{_N2Rcs%FN8!?T- ze*!5o=cXREn8*D1!6lJJxrdb=3p~tjUD2du)~Cn!*kX5K#J<|gpMv&$(E4DeBH6or zVMm5@*rR^SD-n+!c6_Zl#C2Sfo&B)Iw}Lr^1#1sjRQ!=S)+nPqWA~b5%j`^L;fFo0 zjfX8PB#v!te_SsUqiw(^*IuY_yzlIs)W+-Kv5Y|vZ;S0>T5?D}f4#E9{v+0l79B{G zsY#HDvCEYC5-8!$94hTYjq~-1LK;()78&qol`;+0B~^? A{r~^~ literal 0 HcmV?d00001 diff --git a/Items/Materials/WulfrumShard.cs b/Items/Materials/WulfrumShard.cs index e7975c53b3..bcdec89051 100644 --- a/Items/Materials/WulfrumShard.cs +++ b/Items/Materials/WulfrumShard.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Items.Materials { public override void SetStaticDefaults() { - DisplayName.SetDefault("Wulfrum Shard"); + DisplayName.SetDefault("Wulfrum Metal Scrap"); } public override void SetDefaults() diff --git a/Items/Materials/WulfrumShard.png b/Items/Materials/WulfrumShard.png index ffe827c29ea9cae7b4fd63cea993a0f2b47c0979..58f2d888a567fd59289b1311f9e42af08c9b536f 100644 GIT binary patch literal 346 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRp!3HFQtmCqP6k~CayA#8@b22Z19F}xPUq=Rp zjs4tz5?O(K&H|6fVg?4j!ywFfJby(BQ1HE{i(`m|fAW`JzJKQ%SV}DaIYkO6XlWkf zSoGeelJ{BtAMR&HHGkL_&OD&P+HmpULEbk_FLG)(G;ExsIis!7bn`UFNP&W%?8Z}A z8Lt#K?piJr!63WDdWU1=iUoC-ybOG+#X0U*F)vH3d+sm5a9LiwhT*cvZiYOD6KW|v zd=4*}EqiO~eo6MMe9k1n@Kdy9ery&0F@p_`lbCxhGCtk7VAV4AzSe+f)eQ_h3vR2G zJ&~PJ_v;Poj5fwsI~z=WxOEtqUzio0;Aq$^|9G~1!oTnG0<)_09M}z{Bklh&ezvdw o$FwZ}{w|hfi49KT1_lfaZcZVO*ru<42lP6Fr>mdKI;Vst07Q&_{{R30 literal 261 zcmV+g0s8)lP)pcl_@uePD$Z};z=*6Ag@Y_XP$RkmbO)5?n1F>g9Jz@i#YnbBL(c%PUtlIj zx>=%_ynNSjFu!}s8B`m|)(A5O-2j*kpPqij8t(8=h55C)-5$kh6l+8`5W_}eZwauC zXScpUaU#hYVH#lZc>BUWU_jNAcB2&x9WSVNa+jjP%hW6gRPg6MvQ*?=C}WNQQfdZ2l9GB_He00000 LNkvXXu0mjf8+U4| diff --git a/Items/Placeables/Banners/WulfrumDroneBanner.png b/Items/Placeables/Banners/WulfrumDroneBanner.png index 42706a4b587037952ebd4685f951179be878273f..2bad2928145d23db4e13d843c67b2d348da71f7e 100644 GIT binary patch delta 358 zcmV-s0h#{o0f7UMB!2;OQb$4nuFf3k0003yNklL7M->g10}Cl~*Lg1eKB&Q1mYfh@(v$#f>&_J z8Q*sAeee6>-Mu?esVo8DdNu%^)_cT{a6MbZc>ppb3^Sj#6o2Q>e0&o`hlAJJ{xIf&H zgt(VMPd)+Z5d2!8I1b;7K4Cw20N~){QxQ~mWj?1%`2P)NW_nxzg!M)QP-RvT5>8;I7>)NX?>kQnMJkD&U2WDWe%TzGBx z`1Bj94P zKcuE_!XHW`YrqxVl*cs5iH~Fruslt41|nMn^-B$s3o=qQ008CKu3cZ(); + item.placeStyle = 123; + } + } +} diff --git a/Items/Placeables/Banners/WulfrumGyratorBanner.png b/Items/Placeables/Banners/WulfrumGyratorBanner.png new file mode 100644 index 0000000000000000000000000000000000000000..5e24c1fe4c2b2ba388cdabc7a67c09be696000ca GIT binary patch literal 382 zcmV-^0fGLBP)f00001b5ch_0Itp) z=>Px$I7vi7R5*>bls!uWK@>&LXckgLL)0h%vm%QY7FviRijYd}w6gIJ1njL$X>Ap- zvD`*d#6O@#AY!^DAc%-Y1(8+34?;j>EOu9&B}FpPSIyk_<{j>QiA-h*0Mm*CaC7-0 z`4y%W7rqWa7i~r)oiLQn8=F%~ft`0GKssRvJ%WgJ12Es`k*3WVrQpiC0Kg@J9^vHl zS^{kCECcX3y9&TS|%`-w^D)qjU_Pi#}o3xdmYF z_){s!<~)5+m+=1!zCEnnHvq`yl1jm1PYi%_o;xIjN!5mTiXs c_o_$u0t(); + item.placeStyle = 124; + } + } +} diff --git a/Items/Placeables/Banners/WulfrumHovercraftBanner.png b/Items/Placeables/Banners/WulfrumHovercraftBanner.png new file mode 100644 index 0000000000000000000000000000000000000000..561441a62ca9d02c5ffa12a9919c15e000ea0ab0 GIT binary patch literal 385 zcmV-{0e=38P)f00001b5ch_0Itp) z=>Px$J4r-AR5*>bl)X#CKpcjj^8?~X5!fx=PYY3{kb7(Z&FO`B>7`M}oLWG0{(); + item.placeStyle = 126; + } + } +} diff --git a/Items/Placeables/Banners/WulfrumPylonBanner.png b/Items/Placeables/Banners/WulfrumPylonBanner.png new file mode 100644 index 0000000000000000000000000000000000000000..6e547011a37b604b0d5663edbe1b79bd2c35a9d3 GIT binary patch literal 364 zcmV-y0h9iTP)f00001b5ch_0Itp) z=>Px$CP_p=R5*>jlRZlVK@f(Yji(SL5;R3HU?aH%kpnFv1Pc*cv9PqXuu7vCoBRST ztOFv5ReHfDrQ`<)f+vU|C=t#NJhc+fBIn^8f;ysav%9nJ?8EHNnz_XVLIr%#b z8GuAQ`jxDQTOWY_ffN8E_1(@G8d{Yj0J@%zQ4!3ZR}M$AmXG^gU~Squ;pz0000< KMNUMnLSTZNG?o(p literal 0 HcmV?d00001 diff --git a/Items/Placeables/Banners/WulfrumRoverBanner.cs b/Items/Placeables/Banners/WulfrumRoverBanner.cs new file mode 100644 index 0000000000..00af6ecb9c --- /dev/null +++ b/Items/Placeables/Banners/WulfrumRoverBanner.cs @@ -0,0 +1,26 @@ +using CalamityMod.Tiles; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.Banners +{ + public class WulfrumRoverBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = ModContent.TileType(); + item.placeStyle = 125; + } + } +} diff --git a/Items/Placeables/Banners/WulfrumRoverBanner.png b/Items/Placeables/Banners/WulfrumRoverBanner.png new file mode 100644 index 0000000000000000000000000000000000000000..3852b1568c799730f515b5e71a3dd484aaa1925f GIT binary patch literal 357 zcmV-r0h<1aP)f00001b5ch_0Itp) z=>Px$A4x<(R5*>Tls!+vKpcmk8cckFFtjk(i5S!gHwQlfF>!)PzksWQVbR6afmy?7 zoLu|@OpQZPXElL=1j10UiHQylb+{h!PeP1$Jk#C3zq=>BH)sE_MoPjjx}`;?Z~zvj ztACM+25$g(z6-#~bu0o$X9WOO`(GFuhT{Yv8jb3|hLG7#W=MMkN6_Z`J|W z^tJ$aiJnF9@*=>Xf*piXVh&#A)P4U?H?F#mnft7mU; zUn2n8ot_A+Rd(zQlRK>`_ literal 0 HcmV?d00001 diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index feebdb3e5f..36462945bd 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -4,53 +4,141 @@ using CalamityMod.Items.Placeables.Banners; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using System; +using Microsoft.Xna.Framework; + namespace CalamityMod.NPCs.NormalNPCs { + internal enum DroneAIState + { + Searching = 0, + Charging = 1 + } public class WulfrumDrone : ModNPC { + internal DroneAIState AIState + { + get => (DroneAIState)(int)npc.ai[0]; + set => npc.ai[0] = (int)value; + } + public float HorizontalChargeTime + { + get => npc.ai[1]; + set => npc.ai[1] = value; + } + public float Time + { + get => npc.ai[2]; + set => npc.ai[2] = value; + } + public float SuperchargeTimer + { + get => npc.ai[3]; + set => npc.ai[3] = value; + } + public bool Supercharged => SuperchargeTimer > 0; + + public const float TotalHorizontalChargeTime = 75f; public override void SetStaticDefaults() { DisplayName.SetDefault("Wulfrum Drone"); - Main.npcFrameCount[npc.type] = 5; + Main.npcFrameCount[npc.type] = 6; } public override void SetDefaults() { - npc.damage = 10; - npc.aiStyle = 3; - aiType = NPCID.GoblinScout; - npc.width = 40; - npc.height = 30; + aiType = -1; + npc.aiStyle = -1; + npc.damage = 16; + npc.width = 32; + npc.height = 32; npc.defense = 4; - npc.lifeMax = 22; + npc.lifeMax = 21; npc.knockBackResist = 0.35f; - npc.value = Item.buyPrice(0, 0, 0, 50); + npc.value = Item.buyPrice(0, 0, 1, 20); + npc.noGravity = true; + npc.noTileCollide = true; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; + npc.buffImmune[BuffID.Confused] = false; banner = npc.type; bannerItem = ModContent.ItemType(); - npc.buffImmune[BuffID.Confused] = false; } - public override void PostAI() + public override void AI() { - npc.spriteDirection = (npc.direction > 0) ? 1 : -1; + npc.TargetClosest(false); + + Player player = Main.player[npc.target]; + + if (Supercharged) + { + SuperchargeTimer--; + } + + if (AIState == DroneAIState.Searching) + { + if (npc.direction == 0) + npc.direction = 1; + Vector2 destination = player.Center + new Vector2(300f * npc.direction, -90f); + npc.velocity = Vector2.Lerp(npc.velocity, npc.DirectionTo(destination) * 8f, 0.1f); + if (npc.Distance(destination) < 40f) + { + Time++; + npc.velocity *= 0.95f; + if (Time >= 40f) + { + AIState = DroneAIState.Charging; + npc.netUpdate = true; + } + } + } + else + { + if (HorizontalChargeTime < 25) + { + npc.velocity = Vector2.Lerp(npc.velocity, npc.DirectionTo(player.Center) * 8f, 0.1f); + } + if (Supercharged && Main.netMode != NetmodeID.MultiplayerClient && HorizontalChargeTime % 30f == 29f) + { + Projectile.NewProjectile(npc.Center + Vector2.UnitX * 6f * npc.spriteDirection, npc.DirectionTo(player.Center) * 6f, ProjectileID.MartianTurretBolt, 14, 0f); + } + HorizontalChargeTime++; + if (HorizontalChargeTime > TotalHorizontalChargeTime) + { + AIState = DroneAIState.Searching; + HorizontalChargeTime = 0f; + npc.direction = (player.Center.X - npc.Center.X < 0).ToDirectionInt(); + npc.netUpdate = true; + } + } + npc.spriteDirection = (npc.velocity.X < 0).ToDirectionInt(); + npc.rotation = npc.velocity.X / 25f; + + // Generate idle dust + if (!Main.dedServ) + { + Dust dust = Dust.NewDustPerfect(npc.Bottom, 229); + dust.color = Color.Green; + dust.scale = 0.9f; + } } public override void FindFrame(int frameHeight) { - npc.frameCounter += 0.15f; - npc.frameCounter %= Main.npcFrameCount[npc.type]; - int frame = (int)npc.frameCounter; + npc.frameCounter++; + int frame = (int)(npc.frameCounter / 5) % (Main.npcFrameCount[npc.type] / 2); + if (Supercharged) + frame += Main.npcFrameCount[npc.type] / 2; + npc.frame.Y = frame * frameHeight; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { if (spawnInfo.playerSafe || spawnInfo.player.Calamity().ZoneSulphur) - { return 0f; - } + return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.05f : 0.2f); } diff --git a/NPCs/NormalNPCs/WulfrumDrone.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aj#? zF*Fjku{5?QJG&X-F9StU)Z*HFLi&&D!$4I^jaDuhFfr*L1GX_WQmLUrgXoVjyICj7 zZZ@jqY)9A2!Ho`KA3C1kEGwlak5X-!Iv^yF!~ zpGf%Uoi>d!WBEW6V<1{wj(OzTYE385a3tFA=2o=d4MClNI|TW|fGOA3s*-Cu$7O^EEiWTD{M!YE|Jdf*GFhI`_LGr07fo5t>bnaHTMaGCnYQPWgv`yA7uxmy zF;FyyrmQSy^0OoM+&Fj*ICc T)fgN900000NkvXXu0mjfm6?Jh diff --git a/NPCs/NormalNPCs/WulfrumGyrator.cs b/NPCs/NormalNPCs/WulfrumGyrator.cs new file mode 100644 index 0000000000..69a75e1c7e --- /dev/null +++ b/NPCs/NormalNPCs/WulfrumGyrator.cs @@ -0,0 +1,175 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Banners; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.NPCs.NormalNPCs +{ + public class WulfrumGyrator : ModNPC + { + public float TimeSpentStuck + { + get => npc.ai[0]; + set => npc.ai[0] = value; + } + public float SuperchargeTimer + { + get => npc.ai[3]; + set => npc.ai[3] = value; + } + public bool Supercharged => SuperchargeTimer > 0; + + public const float PlayerTargetingThreshold = 90f; + public const float PlayerSearchDistance = 500f; + public const float StuckJumpPromptTime = 45f; + public const float MaxMovementSpeedX = 8f; + public const float JumpSpeed = -9f; + public const float NPCGravity = 0.3f; // NPC.cs has this, but it's private, and there's no way in hell I'm using reflection. + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wulfrum Gyrator"); + Main.npcFrameCount[npc.type] = 10; + } + + public override void SetDefaults() + { + aiType = -1; + npc.aiStyle = -1; + npc.damage = 15; + npc.width = 40; + npc.height = 40; + npc.defense = 5; + npc.lifeMax = 18; + npc.knockBackResist = 0.15f; + npc.value = Item.buyPrice(0, 0, 1, 15); + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath14; + banner = npc.type; + bannerItem = ModContent.ItemType(); + } + + public override void FindFrame(int frameHeight) + { + npc.frameCounter++; + int frame = (int)(npc.frameCounter / 5) % (Main.npcFrameCount[npc.type] / 2); + if (Supercharged) + frame += Main.npcFrameCount[npc.type] / 2; + + npc.frame.Y = frame * frameHeight; + } + + public override void AI() + { + npc.TargetClosest(false); + + Player player = Main.player[npc.target]; + + if (Supercharged) + { + float chargeJumpSpeed = -14f; + + float maxHeight = chargeJumpSpeed * chargeJumpSpeed * (float)Math.Pow(Math.Sin(npc.AngleTo(player.Center)), 2) / (4f * NPCGravity); + bool jumpWouldHitPlayer = maxHeight > Math.Abs(player.Center.Y - npc.Center.Y) && maxHeight < Math.Abs(player.Center.Y - npc.Center.Y) + player.height; + if (jumpWouldHitPlayer && npc.collideY && npc.velocity.Y == 0f) + { + npc.velocity.Y = chargeJumpSpeed; + } + SuperchargeTimer--; + } + + // Jump if there's an obstacle ahead. + if (HoleAtPosition(npc.Center.X + npc.velocity.X * 4f) && npc.collideY && npc.velocity.Y == 0f) + { + npc.velocity.Y = JumpSpeed; + } + if (Collision.CanHitLine(player.position, player.width, player.height, npc.position, npc.width, npc.height) && + Math.Abs(player.Center.X - npc.Center.X) < PlayerSearchDistance && + Math.Abs(player.Center.X - npc.Center.X) > PlayerTargetingThreshold) + { + int direction = Math.Sign(player.Center.X - npc.Center.X); + if (npc.direction != direction) + { + npc.direction = direction; + npc.netUpdate = true; + } + } + else if (npc.collideX && npc.collideY && npc.velocity.Y == 0f) + { + npc.velocity.Y = JumpSpeed; + } + + if (npc.oldPosition == npc.position) + { + TimeSpentStuck++; + if (TimeSpentStuck > StuckJumpPromptTime) + { + npc.velocity.Y = JumpSpeed; + TimeSpentStuck = 0f; + npc.netUpdate = true; + } + } + else + { + TimeSpentStuck = 0f; + } + + npc.velocity.X = MathHelper.Lerp(npc.velocity.X, MaxMovementSpeedX * npc.direction * (Supercharged ? 1.333f : 1f), Supercharged ? 0.025f : 0.015f); + Vector4 adjustedVectors = Collision.WalkDownSlope(npc.position, npc.velocity, npc.width, npc.height, NPCGravity); + npc.position = adjustedVectors.XY(); + npc.velocity = adjustedVectors.ZW(); + } + private bool HoleAtPosition(float xPosition) + { + int tileWidth = npc.width / 16; + xPosition = (int)(xPosition / 16f) - tileWidth; + if (npc.velocity.X > 0) + { + xPosition += tileWidth; + } + int tileY = (int)((npc.position.Y + npc.height) / 16f); + for (int y = tileY; y < tileY + 2; y++) + { + for (int x = (int)xPosition; x < xPosition + tileWidth; x++) + { + if (Main.tile[x, y].active()) + { + return false; + } + } + } + return true; + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.playerSafe || spawnInfo.player.Calamity().ZoneSulphur) + return 0f; + return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.0333f : 0.15f); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (!Main.dedServ) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 3, hitDirection, -1f, 0, default, 1f); + } + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 3, hitDirection, -1f, 0, default, 1f); + } + } + } + } + + public override void NPCLoot() + { + DropHelper.DropItem(npc, ModContent.ItemType(), 1, 2); + } + } +} diff --git a/NPCs/NormalNPCs/WulfrumGyrator.png b/NPCs/NormalNPCs/WulfrumGyrator.png new file mode 100644 index 0000000000000000000000000000000000000000..05d8021a90d312e64bb202fafefab50288c0263b GIT binary patch literal 2893 zcmeH}={MWk8pnSKVv1JL7;Y9NL}{HWN{*^|iXoC1;;5ojtAnX}6Ga<@V`@~19&;jU zJXEN;N^k@^3sX226ZmIBPSYYEW?rTtEU$9ZUhBh9>saM-Tu60IWU1 z65L0sojw`qZen8P@Do1bGFIQ`H_w*K0f~P4HScpO!Z`=#%?Epfz2)G^zvFKL|6>G_ zGzA*KIstCu9PtPL-vQvi2qVGg6$!Q>h5-Pq^Kk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OGrIohBR3yma{9}-&we^J*x&$pbTHN3A7E7>w~KP zVTnY9T1{`In9&Vplmj5_ml^3$T2%>sPFbRhXdQDA8^) zlV5TQ6jL4)zXM&czkhhFd_)nAZWv=tr8A#IPaW@fU(&Pu5VMT)Z z=F8Jexl%Wb;9wZCBoBk{gO#(Oh$y~Okrzf2H7D^`Fi~1n$2XyMC10#W{DUDU^RF`# z41_h5@4ynQ+G#r@B2!bu(EE<&o!%ZA*06S>HSWn{I* zVs)gmWXc55!i)@(XlSybC&-M$rKg%))m7!%f?(qM6Tf@#waC4LZ<3_t#-3OAV>}Lj OGPahE7FA~6G5-d(1$;UH literal 0 HcmV?d00001 diff --git a/NPCs/NormalNPCs/WulfrumHovercraft.cs b/NPCs/NormalNPCs/WulfrumHovercraft.cs new file mode 100644 index 0000000000..aec09cd0f0 --- /dev/null +++ b/NPCs/NormalNPCs/WulfrumHovercraft.cs @@ -0,0 +1,253 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Banners; +using Microsoft.Xna.Framework; +using System; +using System.IO; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.NPCs.NormalNPCs +{ + public class WulfrumHovercraft : ModNPC + { + internal enum HovercraftAIState + { + Searching = 0, + Hover = 1, + Slowdown = 2, + SwoopDownward = 3 + } + public float StunTime; + internal HovercraftAIState AIState + { + get => (HovercraftAIState)(int)npc.ai[0]; + set => npc.ai[0] = (int)value; + } + public float SubphaseTime + { + get => npc.ai[1]; + set => npc.ai[1] = value; + } + public float SearchDirection + { + get => npc.ai[2]; + set => npc.ai[2] = value; + } + public float SuperchargeTimer + { + get => npc.ai[3]; + set => npc.ai[3] = value; + } + public bool Supercharged => SuperchargeTimer > 0; + + public const float StunTimeMax = 45f; + public const float SearchXOffset = 345f; + public const float SearchSpeed = 7f; + public const float HoverSpeed = 5f; + public const float TotalSubphaseTime = 110f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wulfrum Hovercraft"); + Main.npcFrameCount[npc.type] = 12; + } + + public override void SetDefaults() + { + aiType = -1; + npc.aiStyle = -1; + npc.damage = 15; + npc.width = 40; + npc.height = 38; + npc.defense = 4; + npc.lifeMax = 20; + npc.value = Item.buyPrice(0, 0, 1, 50); + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath14; + npc.noGravity = true; + npc.noTileCollide = true; + banner = npc.type; + bannerItem = ModContent.ItemType(); + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(StunTime); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + StunTime = reader.ReadSingle(); + } + + public override void FindFrame(int frameHeight) + { + npc.frameCounter++; + int frame = (int)(npc.frameCounter / 5) % (Main.npcFrameCount[npc.type] / 2); + if (Supercharged) + frame += Main.npcFrameCount[npc.type] / 2; + + npc.frame.Y = frame * frameHeight; + } + + public override void AI() + { + npc.knockBackResist = 0.1f; + + if (npc.target < 0 || npc.target >= 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) + { + npc.TargetClosest(false); + + // Fly away if there is no living target, or the closest target is too far away. + if (Main.player[npc.target].dead || + !Main.player[npc.target].active || + npc.Distance(Main.player[npc.target].Center) > 1100f) + { + npc.velocity = Vector2.Lerp(npc.velocity, Vector2.UnitY * -8f, 0.1f); + npc.rotation = npc.rotation.AngleTowards(0f, MathHelper.ToRadians(15f)); + return; + } + } + + Lighting.AddLight(npc.Center - Vector2.UnitY * 8f, Color.Lime.ToVector3() * 1.5f); + + if (StunTime > 0) + { + if (!Main.dedServ && Main.rand.NextBool(4)) + { + for (int i = 0; i < 2; i++) + { + Dust.NewDustPerfect(npc.Center + Main.rand.NextVector2Circular(8f, 8f), 226).scale = 0.7f; + } + } + + npc.rotation = npc.rotation.AngleTowards(0f, MathHelper.ToRadians(15f)); + if (StunTime > StunTimeMax - 15) + npc.velocity *= 0.6f; + else + npc.knockBackResist = 2.4f; + + StunTime--; + return; + } + + Player player = Main.player[npc.target]; + if (SearchDirection == 0f) + { + if (Math.Abs(player.Center.X + SearchXOffset - npc.Center.X) < Math.Abs(player.Center.X - SearchXOffset - npc.Center.X)) + SearchDirection = 1f; + else + SearchDirection = -1f; + + npc.netUpdate = true; + } + if (AIState == HovercraftAIState.Searching || + AIState == HovercraftAIState.Hover) + { + Vector2 destination = player.Center + new Vector2(SearchXOffset * SearchDirection, -160f); + npc.velocity = npc.DirectionTo(destination) * (Supercharged ? 8.5f : 6f); + if (AIState == HovercraftAIState.Hover) + { + destination = player.Center + new Vector2(SearchXOffset * -SearchDirection, -160f); + npc.velocity = npc.DirectionTo(destination) * (Supercharged ? 7f : 5f); + } + + npc.rotation = npc.velocity.X / 16f; + if (npc.Distance(destination) < 50f) + { + if (AIState == HovercraftAIState.Searching) + { + AIState = HovercraftAIState.Slowdown; + } + else + { + AIState = HovercraftAIState.SwoopDownward; + } + npc.netUpdate = true; + } + } + + if (AIState == HovercraftAIState.Slowdown) + { + SubphaseTime++; + if (SubphaseTime < 30f) + { + npc.velocity *= 0.96f; + } + else + { + AIState = HovercraftAIState.Hover; + SubphaseTime = 0f; + npc.netUpdate = true; + } + } + + if (AIState == HovercraftAIState.SwoopDownward) + { + npc.rotation = 0f; + float swoopType = Supercharged ? TotalSubphaseTime - 40f : TotalSubphaseTime; + float swoopSlowdownTime = Supercharged ? 10f : 45f; + Vector2 swoopVelocity = Vector2.UnitY.RotatedBy(MathHelper.Pi * SubphaseTime / swoopType * -SearchDirection) * (Supercharged ? 13f : 10f); + + SubphaseTime++; + if (SubphaseTime < swoopSlowdownTime) + { + swoopVelocity *= MathHelper.Lerp(1f, 0.75f, Utils.InverseLerp(45f, 0f, SubphaseTime)); + } + if (SubphaseTime >= swoopType - swoopSlowdownTime) + { + swoopVelocity *= MathHelper.Lerp(1f, 0.75f, Utils.InverseLerp(swoopType - 45f, swoopType, SubphaseTime)); + } + swoopVelocity.Y *= 0.5f; + + npc.velocity = Vector2.Lerp(npc.velocity, swoopVelocity, 0.25f); + + if (SubphaseTime >= swoopType) + { + AIState = HovercraftAIState.Searching; + SearchDirection = 0f; + SubphaseTime = 0f; + npc.netUpdate = true; + } + npc.rotation = npc.velocity.X / 12f; + } + npc.spriteDirection = (npc.velocity.X < 0).ToDirectionInt(); + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.playerSafe || spawnInfo.player.Calamity().ZoneSulphur) + return 0f; + return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.025f : 0.125f); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (!Main.dedServ) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 3, hitDirection, -1f, 0, default, 1f); + } + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 3, hitDirection, -1f, 0, default, 1f); + } + } + } + } + + public override void OnHitByItem(Player player, Item item, int damage, float knockback, bool crit) + { + StunTime = StunTimeMax; + npc.netUpdate = true; + } + + public override void NPCLoot() + { + DropHelper.DropItem(npc, ModContent.ItemType(), 2, 3); + } + } +} diff --git a/NPCs/NormalNPCs/WulfrumHovercraft.png b/NPCs/NormalNPCs/WulfrumHovercraft.png new file mode 100644 index 0000000000000000000000000000000000000000..b3df311349d390e81f1bc757a27f927d238397e0 GIT binary patch literal 3431 zcmZvfdo)yg|Hr?R$|>c9I+Ajo;Y21;6yhjk8&u;OgPJrd2B}HpmdA;4>10boDo-`; zmyB{78mfsVw=QF1W|%I9j9V8&jLWl~XZ_Y$zqOt}KKr}Z`tJSNpUeC6`mRkq;(BQP z+AV7V0P7(~J3O-L0kC4jFRPKe@he-+kp*=gf9L?H?AkhlJfscT*}7l4J${Fr?(Vg% zHDBR5R$;8V9V?*NhHE!@D=3|Xgbt{T)-5vSw7BcH=9J6VY^Uz3rRuG=DPEKD=6DLP z_EzDU2di`osCzP2Tuo4_@|MW^KMU2aYGGA9mXkdTjhqjkc+@!4@g#C0x54!MM90$1 zsmP%&VQ$orupdG;?^24V#h$$_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w>j&qe^DIAB>a`ku$y0-rU-WX z^X0Xy4hTeA~k=)nJvZZ*9&>ro>dF7CKnYMm0v~--ak}xhoDKrkGkKfuppZUMPznJytcI z7XM9nO#)wK&8UmSkx%AsO#aB4gukYg8d^l@+0b_PJ)15woaV5uEr{en`BQB74|o#( z2{HJWBeAp#l8!p=_wG{m)8;LlNGLM?yE;flEbNf%F$^$M~s z(Qe%8X&OK!JbfVY2vRkj_f!7J^RoFwRvG0j`WwZ+6=5oTD{h+RYW%G8K>Beif1xP$ zEE{6|+CDQsUnE4tda%b(dQk+fC$UrN(b}X4CS5D_RDVhhd50k*!q*&m>B{g)adjv< zikgY{HHVwnua>u|xl=!qLo+_Xj*bzm(PDoZU4>%xLW1jPVP?K|!gj@(?J8{bIiVR` z890789XhwVX{zQlFJrJeY|O~#;^DL{lSJc~a^htbh3c>}4eu3NOv*cshpx_aMoO%T ztWZ0ffRun!&`5W!APqj7ut60AnOSbHNdLyR=K(#MeDim+u!S4}b`^Kf+>2v%qw(*9 z4S1|g-kj{kx3q--PQQBiWeqvtTwj0-z!wYw-bA^m|Tqg zmztYQx}&2XoR;{ug|W3?|Z;?hB7S|EWV zj#K#rr_|H&9uWvhZBuZm>Z5-6aKE>~st58f&3_c%YgfQ56LiRvBHjJkQqmWF^F759 zybhQA1rmbt<5<6kb@17Vqp*-ZW%}mhej6H--sBjtKHt9f2*UsHGQ#fY-+=KVUtxfW zo^h^ak*`_Q`nhqaYEj{%5AF)4ZafbC{QNV~LFcHHgy6~KMK7j6!hQPe9M`SwYO4u2 zA}Ef|4<6zrv5rfbbi#yVQEbWOO}p<;|7&Da7qBs>o)4Uzj%Uyg5tNl^Xe^`~MzeEn zo8Xpc&~`@&C{CYXHfEI;GQj^GT*ST6*)X{cF npc.ai[0] != 0f; + set => npc.ai[0] = value.ToInt(); + } + public float ChargeRadius + { + get => npc.ai[1]; + set => npc.ai[1] = value; + } + public static List SuperchargableEnemies = new List() + { + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType() + }; + public const float ChargeRadiusMax = 200f; + public const float SuperchargeTime = 600f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wulfrum Pylon"); + Main.npcFrameCount[npc.type] = 6; + } + + public override void SetDefaults() + { + aiType = -1; + npc.aiStyle = -1; + npc.damage = 16; + npc.width = 44; + npc.height = 44; + npc.defense = 4; + npc.lifeMax = 49; + npc.knockBackResist = 0f; + npc.value = Item.buyPrice(0, 0, 1, 50); + npc.noGravity = false; + npc.noTileCollide = false; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath14; + npc.buffImmune[BuffID.Confused] = false; + banner = npc.type; + bannerItem = ModContent.ItemType(); + } + + public override void AI() + { + npc.TargetClosest(false); + + Player player = Main.player[npc.target]; + + if (!Charging && npc.Distance(player.Center) < ChargeRadiusMax * 0.667f) + { + Charging = true; + npc.netUpdate = true; + } + else if (Charging) + { + ChargeRadius = (int)MathHelper.Lerp(ChargeRadius, ChargeRadiusMax, 0.1f); + + if (Main.rand.NextBool(4)) + { + float dustCount = MathHelper.TwoPi * ChargeRadius / 5f; + for (int i = 0; i < dustCount; i++) + { + float angle = MathHelper.TwoPi * i / dustCount; + Dust dust = Dust.NewDustPerfect(npc.Center, 229); + dust.position = npc.Center + angle.ToRotationVector2() * ChargeRadius; + dust.noGravity = true; + dust.velocity = npc.velocity; + } + } + + for (int i = 0; i < Main.npc.Length; i++) + { + NPC npcAtIndex = Main.npc[i]; + if (!npcAtIndex.active) + continue; + + // For some strange reason, the Wulfrum Rover is not counted when it's added to a static list. + // What I assume is going on is that it hasn't been loaded yet since it's later alphabetically (Pylon is before Rover). + // As a result, they are checked separately. + if (!SuperchargableEnemies.Contains(npcAtIndex.type) && + npcAtIndex.type != ModContent.NPCType()) + continue; + if (npcAtIndex.ai[3] > 0f) + continue; + if (npc.Distance(npcAtIndex.Center) > ChargeRadius) + continue; + + npcAtIndex.ai[3] = SuperchargeTime; // Supercharge the npc for a while if isn't already supercharged. + npcAtIndex.netUpdate = true; + + // And emit some dust. + + // Dust doesn't need to be spawned for the server. + if (Main.dedServ) + continue; + + for (int j = 0; j < 10; j++) + { + Dust.NewDust(npcAtIndex.position, npcAtIndex.width, npcAtIndex.height, 226); + } + } + } + } + + public override void FindFrame(int frameHeight) + { + npc.frameCounter++; + int frame = (int)(npc.frameCounter / 8) % Main.npcFrameCount[npc.type]; + + npc.frame.Y = frame * frameHeight; + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.playerSafe || spawnInfo.player.Calamity().ZoneSulphur) + return 0f; + + // Only spawn in the other thirds of the world bounds. + if (spawnInfo.playerFloorX > Main.maxTilesX * 0.333f && spawnInfo.playerFloorX < Main.maxTilesX - Main.maxTilesX * 0.333f) + return 0f; + + return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.06f : 0.22f); + } + + public override void HitEffect(int hitDirection, double damage) + { + for (int k = 0; k < 3; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, DustID.GrassBlades, hitDirection, -1f, 0, default, 1f); + } + if (npc.life <= 0) + { + for (int k = 0; k < 15; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, DustID.GrassBlades, hitDirection, -1f, 0, default, 1f); + } + } + } + + public override void NPCLoot() + { + DropHelper.DropItem(npc, ModContent.ItemType(), 2, 3); + } + } +} diff --git a/NPCs/NormalNPCs/WulfrumPylon.png b/NPCs/NormalNPCs/WulfrumPylon.png new file mode 100644 index 0000000000000000000000000000000000000000..c578407dd3457bdf2eedb9f8085748718a475571 GIT binary patch literal 616 zcmeAS@N?(olHy`uVBq!ia0vp^dJGJVA{@*>R`SO$RX~cdILO_JVcj{Imq3nLfKP}k zkWTMRnZ3HyH#*qC!A-X{zA8E3+{smk{yXO#h~4%7r&diw%OQgbbv=eOV59p~ErKgCAQds_ZoA<=sdf&T>a z?)R;7=)5juy+?18!Ev_#S{n}}e<{vtd@yZl1;@T8RiaxLA4)DcSN%N8_+I&~O6KJ) zLhr5LuK1AY)%oD*!Rece^=}0}+Opx2%%PVD=N5Y{F33vFd=}<(*23I3`GY{x8r7Xg zeot|dXb;X})ZH9n#C88Phm2+To4bBH!uK>@RzATM|N2(gonsHyX6%&e&-Y$iAi*v# z!9IPh)0Nza9GTcXnk);s9t%7$;FDngWG=KgNm%T0Xr0tG&47n<{_N2Rcs%FN8!?T- ze*!5o=cXREn8*D1!6lJJxrdb=3p~tjUD2du)~Cn!*kX5K#J<|gpMv&$(E4DeBH6or zVMm5@*rR^SD-n+!c6_Zl#C2Sfo&B)Iw}Lr^1#1sjRQ!=S)+nPqWA~b5%j`^L;fFo0 zjfX8PB#v!te_SsUqiw(^*IuY_yzlIs)W+-Kv5Y|vZ;S0>T5?D}f4#E9{v+0l79B{G zsY#HDvCEYC5-8!$94hTYjq~-1LK;()78&qol`;+0B~^? A{r~^~ literal 0 HcmV?d00001 diff --git a/NPCs/NormalNPCs/WulfrumRover.cs b/NPCs/NormalNPCs/WulfrumRover.cs new file mode 100644 index 0000000000..04660e5eb3 --- /dev/null +++ b/NPCs/NormalNPCs/WulfrumRover.cs @@ -0,0 +1,141 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Banners; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.NPCs.NormalNPCs +{ + public class WulfrumRover : ModNPC + { + public float SuperchargeTimer + { + get => npc.ai[3]; + set => npc.ai[3] = value; + } + public const float PlayerTargetingThreshold = 90f; + public const float PlayerSearchDistance = 500f; + public const float StuckJumpPromptTime = 90f; + public const float MaxMovementSpeedX = 8f; + public bool Supercharged => SuperchargeTimer > 0; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wulfrum Rover"); + Main.npcFrameCount[npc.type] = 16; + } + + public override void SetDefaults() + { + aiType = -1; + npc.aiStyle = -1; + npc.damage = 10; + npc.width = 40; + npc.height = 40; + npc.defense = 4; + npc.lifeMax = 32; + npc.knockBackResist = 0.15f; + npc.value = Item.buyPrice(0, 0, 1, 15); + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath14; + banner = npc.type; + bannerItem = ModContent.ItemType(); + } + + public override void FindFrame(int frameHeight) + { + npc.frameCounter++; + int frame = (int)(npc.frameCounter / 5) % (Main.npcFrameCount[npc.type] / 2); + if (Supercharged) + frame += Main.npcFrameCount[npc.type] / 2; + + npc.frame.Y = frame * frameHeight; + } + + public override void AI() + { + npc.TargetClosest(false); + + if (Supercharged) + { + SuperchargeTimer--; + npc.defense = 13; + } + else if (!Supercharged) + { + npc.defense = 4; + } + + Player player = Main.player[npc.target]; + if (Collision.CanHitLine(player.position, player.width, player.height, npc.position, npc.width, npc.height) && + Math.Abs(player.Center.X - npc.Center.X) < PlayerSearchDistance && + Math.Abs(player.Center.X - npc.Center.X) > PlayerTargetingThreshold) + { + int direction = Math.Sign(player.Center.X - npc.Center.X); + if (npc.direction != direction) + { + npc.direction = direction; + npc.netUpdate = true; + } + } + else if (npc.collideX) + { + npc.direction *= -1; + npc.netUpdate = true; + } + + npc.spriteDirection = -npc.direction; + npc.velocity.X = MathHelper.Lerp(npc.velocity.X, MaxMovementSpeedX * npc.direction, 0.015f); + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.playerSafe || spawnInfo.player.Calamity().ZoneSulphur) + return 0f; + return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.05f : 0.2f); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (!Main.dedServ) + { + for (int k = 0; k < 4; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 3, hitDirection, -1f, 0, default, 1f); + } + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 3, hitDirection, -1f, 0, default, 1f); + } + } + } + } + + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + if (Supercharged) + { + Texture2D shieldTexture = ModContent.GetTexture("CalamityMod/NPCs/NormalNPCs/WulfrumRoverShield"); + Rectangle frame = shieldTexture.Frame(1, 11, 0, (int)(Main.GlobalTime * 8) % 11); + spriteBatch.Draw(shieldTexture, + npc.Center - Main.screenPosition + Vector2.UnitY * (npc.gfxOffY + 6f), + frame, + Color.White * 0.625f, + npc.rotation, + shieldTexture.Size() * 0.5f / new Vector2(1f, 11f), + npc.scale + (float)Math.Cos(Main.GlobalTime) * 0.1f, + SpriteEffects.None, + 0f); + } + } + + public override void NPCLoot() + { + DropHelper.DropItem(npc, ModContent.ItemType(), 1, 1); + } + } +} diff --git a/NPCs/NormalNPCs/WulfrumRover.png b/NPCs/NormalNPCs/WulfrumRover.png new file mode 100644 index 0000000000000000000000000000000000000000..aa460fa07cc987f06fd716baad4c0da9f55c0570 GIT binary patch literal 3622 zcmai1c{tST9)EGfa8=BWvUWPmRH&3KB8Ec_gA+IV7TFowh^$AGj*5!xGc+g5r0gb! zEDc%0kljeO?1r)p#&Umj?)KdKJom5neSgpIdA`f%`}us{H^$gdmybu72LQmQcTM{` zw8{X${+#;|v>SEHd$ukgl7;it~M@WO|?oCy)=Y{m18nJ zx&ZC=S}eAYQr-OI&F@jv5BAs^(kULtYZea8>nKiX()nk<8f!Ni^NY>gC?4_=v&uf^ zrcr(ZU0jfm^CoM!OPGah-;@9L-alN4d4+;xZnFrhlxbG5f4YB%8go6QBbY|%n7-0c z7>Qfh_?(;^y1S|rk-91y+LK*L{>$lxFrs9Y|By0xzDG!0ne4#0r^pTMHvJWhCQe5P zG4n%}lYQi74@nMYhB|TspD#x9Y+yPwJ-)#);$dR59W_ew6?#`-5l=V`>gtH|H8;i! z7N^)j+vDtYDR!R=V-31r7l$*8g*GkkCm`*NwglCelZ%X#0^YAHJ*Rpo~mr2f`1gTHU;D`B&qE0m*|T4Ky6BUIg3tYrRjbw{7n=q{fqq0u%L? z=VDue!9Y>CO_q}TQ0EQbU`PF80J9e?L>HH$bZa#<< zllEpMF$p5f9j~Pq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}2~a%Ha5VkWlZy_TuRdh^!(I_)%NqMH zC;QB?dyE_NRMi;``G+jWN5adu_&?w!Px81QUAyBAUi4C(d$D_;Ys>;av%7+ zRJIw+c(w)tjn*b600n&cu~_Ic%*7e?(9s2e{%CQ|qkD$O5Z2M>i&J~6!dfRjzr0=r zYq~%Lk(GxM^!)2@fw~9d5oBdrwysY1r{>lzNtVk?BmD)*3 zr33?4x6lrm<4o~vWVknNVM5DxCmRUKD*wZGd<_1}Y5p{x18Lg7MP2mxu}gS*!CIP_ z;X|Lm6ZFm7eSb%%313>NeY`r7{z2IV;n^K9`92sNAMtb^H&UUc!nk_*z3^%`K;-yX zZ9|DJmj$$xB*sgdToC N?`K2p0+fB!-vR7t0zd!& literal 0 HcmV?d00001 diff --git a/NPCs/NormalNPCs/WulfrumRoverShield.png b/NPCs/NormalNPCs/WulfrumRoverShield.png new file mode 100644 index 0000000000000000000000000000000000000000..9a824907ea4ebe8b0b8da493146c21d28d8690bc GIT binary patch literal 5552 zcmc(Dc~nySyT0aha>!$BhYd7k%qcwl2?DkUx_ zE+8NvWp>H<3UD?M5ZKZDhbZu_o!TM{oCHIzm>LO`b}CE*3t?|VOG5#H3ZewxO$1o) z47y|=A|SAfvi%aI1-|qY5IAtr%-HZM#(6%QK~x;PMyvN`u2%W~qgw&n<$*S_*paf9 zEBiq6iJ0JCRlPlz&tE!!P*vGnIJVgChm5hRK+J&Q!D7gs!!a_4?mbn1cS6qE_};$Q zpgGSr{19v*6gwxY>oKB#t?-|PSJ>HMm$LfVFN>z9uIVG1xHDviKG(Dn`#Kfand^<}jv6(uB6Cbhpo>-FiiHwuu1PH%G-s7OY(#cfO(O66q|G8mnSc=h@_ zo052mpVai{yt#&;Rvng}wb@iS1w#~qpOJkfXgm}C4nw?fGt&7gO5ykK+5BLFI%vld znIy^@{_`N??{rhvM01aTy~IIL5XsG*8Gg-U&#V5oz9lkI3-deFNAe!pmG!N;_9h3; zB|RRBg>vr%Fz2k_xWFZ-=IZWt^4!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*U-992W$k-^#|0pk{P69jN^Urahw~c@l=U^Fs@<~YiQ8febv+b&K|?ir z>Bo}UyFYf}h4<$5s*O;|k;@T2)MGsX49%Kvyzj~|IlM;hfsQKb&0Eag9npBSM&*xj z2Zz)TURKmFeVy%H=A#Suyn2{KOc^J;WVg?MjDn?;I6D_ise*aoZ~vH8YWIDaSliJr=#Sb_VGCJ!Eo(Cq`{EFUz&uDTdUT6Q~tCM8q&hT1l!CRn!;r$Rn z27Xve=^L`;F>ZcTjiRjihq~z(l%H|8P9lcK-4EX!hyOA6NKcr%cc(#|r!%IqkD`~@5 z^o_*jD_TF{501{}@Is#mQAHZ&0)E)dZb(-y+hT2(z*y^BObP*fYLg}4mr|U5Zo z{1s1qkn`fno&LF%zgcEF#+BJ}>g^IuK}baX(~o1V>_Q;qroV_3WCkvl-$OVMMWL0y z;8O_=ul9raFlngtis9r4)CY95TSqP6Zm&%P7pE1SP%SE-ft0$?`)t?$2cGcQG#Y`^ Y!)XJ0>A!nE0%*$sV*0Q~$N9hi0SbC-YXATM From 9ed6f4b472cf80713e26b69449e79fe4465ebe8f Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 4 Jul 2020 10:27:43 -0400 Subject: [PATCH 005/160] removed wulfrum drone from these files since it no longer uses Fighter AI --- NPCs/CalamityGlobalAI.cs | 7 ++----- NPCs/CalamityGlobalNPC.cs | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index c06a10bbd7..1cf3290364 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -17908,10 +17908,7 @@ namespace CalamityMod.NPCs { npc.direction *= -1; - if (npcType == ModContent.NPCType()) - npc.spriteDirection = (npc.direction > 0) ? 1 : -1; - else - npc.spriteDirection = npc.direction; + npc.spriteDirection = npc.direction; npc.ai[0] = 0f; } @@ -19898,7 +19895,7 @@ namespace CalamityMod.NPCs else { int alteredDirection = npc.spriteDirection; - if (npcType == NPCID.VortexRifleman || npcType == ModContent.NPCType()) + if (npcType == NPCID.VortexRifleman) { alteredDirection *= -1; } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 1bbe449db9..3a3b9a26eb 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -1866,7 +1866,7 @@ namespace CalamityMod.NPCs } break; case 3: - if (npc.type == NPCType() || npc.type == NPCType() || + if (npc.type == NPCType() || npc.type == NPCType() || npc.type == NPCType()) { return CalamityGlobalAI.BuffedFighterAI(npc, mod); From ffe445a4decebfdff2125d160bd220706cbef78c Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 4 Jul 2020 13:23:56 -0400 Subject: [PATCH 006/160] fixed parasea hitbox --- NPCs/Leviathan/Parasea.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/NPCs/Leviathan/Parasea.cs b/NPCs/Leviathan/Parasea.cs index 8d8be97359..3613b82eb0 100644 --- a/NPCs/Leviathan/Parasea.cs +++ b/NPCs/Leviathan/Parasea.cs @@ -22,8 +22,7 @@ namespace CalamityMod.NPCs.Leviathan npc.noTileCollide = true; npc.canGhostHeal = false; npc.damage = 50; - npc.width = 90; - npc.height = 20; + npc.width = npc.height = 30; npc.defense = 8; npc.lifeMax = 650; if (CalamityWorld.bossRushActive) @@ -63,6 +62,18 @@ namespace CalamityMod.NPCs.Leviathan npc.frame.Y = frame * frameHeight; } + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + Texture2D texture = Main.npcTexture[npc.type]; + int height = texture.Height / Main.npcFrameCount[npc.type]; + int width = texture.Width; + SpriteEffects spriteEffects = SpriteEffects.FlipHorizontally; + if (npc.spriteDirection == -1) + spriteEffects = SpriteEffects.None; + Main.spriteBatch.Draw(texture, npc.Center - Main.screenPosition + new Vector2(0f, npc.gfxOffY), npc.frame, npc.GetAlpha(drawColor), npc.rotation, new Vector2((float)width / 2f, (float)height / 2f), npc.scale, spriteEffects, 0f); + return false; + } + public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(BuffID.Wet, 60, true); From bff803b719b7009feb29b326c21fc525a9995820 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 4 Jul 2020 13:34:25 -0400 Subject: [PATCH 007/160] using directive fuck off --- NPCs/Leviathan/Parasea.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/NPCs/Leviathan/Parasea.cs b/NPCs/Leviathan/Parasea.cs index 3613b82eb0..9611a5fd0b 100644 --- a/NPCs/Leviathan/Parasea.cs +++ b/NPCs/Leviathan/Parasea.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; From a0ff41cf383bf531a1f96cf45a8f5b07c8eb1881 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 4 Jul 2020 16:26:12 -0400 Subject: [PATCH 008/160] doesn't work rn, will fuck around with it later --- ExtraTextures/Chains/PlantationChain.png | Bin 0 -> 239 bytes Projectiles/Summon/PlantSummon.cs | 34 ++++- Projectiles/Summon/PlantTentacle.cs | 163 +++++++++++++++++++++++ Projectiles/Summon/PlantTentacle.png | Bin 0 -> 1077 bytes 4 files changed, 192 insertions(+), 5 deletions(-) create mode 100644 ExtraTextures/Chains/PlantationChain.png create mode 100644 Projectiles/Summon/PlantTentacle.cs create mode 100644 Projectiles/Summon/PlantTentacle.png diff --git a/ExtraTextures/Chains/PlantationChain.png b/ExtraTextures/Chains/PlantationChain.png new file mode 100644 index 0000000000000000000000000000000000000000..0ce93ea713ebe7ee0f88ba882e184579c14533de GIT binary patch literal 239 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`+dN$yLn`JZCp0iQJ0Jev*4Fl4 zc-e=A36lkm{Z~`$`JecSC!>KiwjqSU{K21}pL=*fpjdHR#MXJ~2|!>F-gILAoN~rT zL2Mm1KDJ+D8Xiu{>hS$_vRqOE2ufrWK8e2^Xd3W7Zq9;QOowA6`Dy*XZuI dVfJ8U_!(^b=+H-I9iR^wJYD@<);T3K0RY_ZUVH!m literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/PlantSummon.cs b/Projectiles/Summon/PlantSummon.cs index 546481e402..90ddbc5b31 100644 --- a/Projectiles/Summon/PlantSummon.cs +++ b/Projectiles/Summon/PlantSummon.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ID; @@ -23,6 +24,7 @@ namespace CalamityMod.Projectiles.Summon Main.projFrames[projectile.type] = 8; ProjectileID.Sets.MinionSacrificable[projectile.type] = true; ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + ProjectileID.Sets.NeedsUUID[projectile.type] = true; } public override void SetDefaults() @@ -49,7 +51,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); CalamityGlobalProjectile modProj = projectile.Calamity(); - if (player.statLife <= (int)((double)player.statLifeMax2 * 0.5)) + if (player.statLife <= (int)(player.statLifeMax2 * 0.5)) { if (Main.myPlayer == projectile.owner) { @@ -69,6 +71,7 @@ namespace CalamityMod.Projectiles.Summon modProj.spawnedPlayerMinionDamageValue = player.MinionDamage(); modProj.spawnedPlayerMinionProjectileDamageValue = projectile.damage; SpawnDust(); + SpawnTentacles(); initialized = true; } if (player.MinionDamage() != modProj.spawnedPlayerMinionDamageValue) @@ -289,7 +292,7 @@ namespace CalamityMod.Projectiles.Summon for (int i = -8; i <= 8; i += 8) { Vector2 perturbedSpeed = projVelocity.RotatedBy(MathHelper.ToRadians(i)); - Projectile.NewProjectile(projectile.Center, perturbedSpeed, projType, projDmg, projectile.knockBack * 0.8f, player.whoAmI, Main.rand.Next(3), 1f); + Projectile.NewProjectile(projectile.Center, perturbedSpeed, projType, projDmg, projectile.knockBack * 0.8f, projectile.owner, Main.rand.Next(3), 1f); } } float chargeSpeed = 8f; @@ -401,9 +404,6 @@ namespace CalamityMod.Projectiles.Summon { projectile.rotation = projectile.velocity.ToRotation() + MathHelper.Pi; } - /*if (enraged) - projectile.rotation = (whereIsTarget - projectile.Center).ToRotation() + MathHelper.Pi; - else*/ } private void Framing() @@ -442,6 +442,18 @@ namespace CalamityMod.Projectiles.Summon } } + private void SpawnTentacles() + { + if (projectile.owner == Main.myPlayer) + { + int tentacleAmt = 6; + for (int tentacleIndex = 0; tentacleIndex < tentacleAmt; tentacleIndex++) + { + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, tentacleIndex, Projectile.GetByUUID(projectile.owner, projectile.whoAmI)); + } + } + } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.Poisoned, 300); @@ -455,5 +467,17 @@ namespace CalamityMod.Projectiles.Summon } public override bool CanDamage() => enraged; + + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + int height = texture.Height / Main.projFrames[projectile.type]; + int frameHeight = height * projectile.frame; + SpriteEffects spriteEffects = SpriteEffects.None; + if (projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture.Width / 2f, (float)height / 2f), projectile.scale, spriteEffects, 0f); + } } } diff --git a/Projectiles/Summon/PlantTentacle.cs b/Projectiles/Summon/PlantTentacle.cs new file mode 100644 index 0000000000..d1059f6a66 --- /dev/null +++ b/Projectiles/Summon/PlantTentacle.cs @@ -0,0 +1,163 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.IO; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class PlantTentacle : ModProjectile + { + private bool initialized = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tentacle"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = 30; + projectile.height = 30; + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minionSlots = 0f; + projectile.timeLeft = 18000; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.timeLeft *= 5; + projectile.minion = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 12; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + if (projectile.ai[1] < 0 || projectile.ai[1] >= Main.maxProjectiles) + { + projectile.Kill(); + return; + } + // If something has gone wrong with either the tentacle or the host plant, destroy the proj. + Projectile hostPlant = Main.projectile[(int)projectile.ai[1]]; + if (projectile.type != ModContent.ProjectileType() || !hostPlant.active || hostPlant.type != ModContent.ProjectileType()) + { + projectile.Kill(); + return; + } + + if (projectile.frameCounter++ % 6 == 0) + { + projectile.frame++; + } + if (projectile.frame >= Main.projFrames[projectile.type]) + { + projectile.frame = 0; + } + + if (!initialized) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + initialized = true; + } + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int trueDamage = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * + player.MinionDamage()); + projectile.damage = trueDamage; + } + + projectile.rotation = (projectile.Center - hostPlant.Center).ToRotation() + MathHelper.Pi; + + float radians = MathHelper.TwoPi / 6f; + float xOffset = hostPlant.Center.X + 150f; + Vector2 source = new Vector2(xOffset, hostPlant.Center.Y); + Vector2 goal = (source - hostPlant.Center).RotatedBy(radians * projectile.ai[0]); + + //Vector2 hourVector = (radians * projectile.ai[0]).ToRotationVector2(); + + Vector2 targetPos = goal - projectile.Center; + float targetDist = targetPos.Length(); + targetPos.Normalize(); + if (targetDist > 150f) + { + float speedMult = 8f; + targetPos *= speedMult; + projectile.velocity = (projectile.velocity * 40f + targetPos) / 41f; + } + else + { + float reverseSpeedMult = 4f; + targetPos *= -reverseSpeedMult; + projectile.velocity = (projectile.velocity * 40f + targetPos) / 41f; + } + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 10; i++) + { + Dust.NewDust(projectile.position, projectile.width, projectile.height, 107); + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (projectile.ai[1] < 0 || projectile.ai[1] >= Main.maxProjectiles) + { + return false; + } + + // If something has gone wrong with either the tentacle or the host plant, return. + Projectile hostPlant = Main.projectile[(int)projectile.ai[1]]; + if (projectile.type != ModContent.ProjectileType() || !hostPlant.active || hostPlant.type != ModContent.ProjectileType()) + { + return false; + } + + Vector2 source = hostPlant.Center; + Color transparent = Microsoft.Xna.Framework.Color.Transparent; + Texture2D chain = ModContent.GetTexture("CalamityMod/ExtraTextures/Chains/PlantationChain"); + Vector2 goal = projectile.Center; + Rectangle? sourceRectangle = null; + float textureHeight = (float)chain.Height; + Vector2 drawVector = source - goal; + float rotation = (float)Math.Atan2((double)drawVector.Y, (double)drawVector.X) - MathHelper.PiOver2; + bool shouldDraw = true; + if (float.IsNaN(goal.X) && float.IsNaN(goal.Y)) + { + shouldDraw = false; + } + if (float.IsNaN(drawVector.X) && float.IsNaN(drawVector.Y)) + { + shouldDraw = false; + } + while (shouldDraw) + { + if (drawVector.Length() < textureHeight + 1f) + { + shouldDraw = false; + } + else + { + Vector2 value2 = drawVector; + value2.Normalize(); + goal += value2 * textureHeight; + drawVector = source - goal; + Color color = Lighting.GetColor((int)goal.X / 16, (int)(goal.Y / 16f)); + Main.spriteBatch.Draw(chain, goal - Main.screenPosition, sourceRectangle, color, rotation, chain.Size() / 2f, 1f, SpriteEffects.None, 0f); + } + } + return true; + } + } +} diff --git a/Projectiles/Summon/PlantTentacle.png b/Projectiles/Summon/PlantTentacle.png new file mode 100644 index 0000000000000000000000000000000000000000..8cd8d46343fda3987c6a3a3b4165c0046a9a519c GIT binary patch literal 1077 zcmV-51j_q~P)W5Mj06vXv44vAvUqv#NiP(O=a|-}4H-%*3f zDN!)d006A-y@G1z!=Hot9A@65v;Sxm)1(y1boIqH0HCyaDRezJQm>`y008jo@S?gf zuI}OMdJX`P-yZ=0d@uB18n?Qd@?MTV{s;hgGJD_f@!e1>z%hV!;vy64_w#Efm?o`| zsVU*)!ae|?x;!D;cSZXF0AL+zRLjJ5eQ(oCDihW#H`Tkd>V>0^vbL{ZQ-A012Y`-I z+-Z8&>T24afe!j=mp1z_O zCQD^CD&KzI)op~@rRngDM7cY9Wnw9wz|4ilVrb#K1sjT2l-+&Y=`s`Hr zCfW8d6cff`+ONE+H}$68w13m6=q6UvxYZZvkZ5Oc;1xj!ptg`B^Lh0REN2~F$xZTw z8$SU6cb?VMtM0eHr%KT5!7G`N+k&btwz*NFxFyUEyfUGjdL>*$FRq*i&_+AigI98E zIHwcJqB@T-x{=8jR}{pO_t@d>zmU9cO5WNcma_t{dKH1BOrEG|uj)D@QF7g+xW1Z@ zth?~aG$V18%4F11`8R+p!K1SI)`0{?S9pMwLhTF1J(Egw-H}dF_jd#c8(aU6{ zD_b>4Ngzp?FdeHwci@!?y%xt+CkZ5(tZF%9hB39`x>Mm(GBG8AWP?!4g6SxC;g$Sp zL;^|KFBa3Jbt)j4h-p&tK+>C@ov8 Date: Sat, 4 Jul 2020 18:00:41 -0400 Subject: [PATCH 009/160] plantation thorn ball sprite --- Projectiles/Summon/PlantThornBall.cs | 1 - Projectiles/Summon/PlantThornBall.png | Bin 387 -> 561 bytes 2 files changed, 1 deletion(-) diff --git a/Projectiles/Summon/PlantThornBall.cs b/Projectiles/Summon/PlantThornBall.cs index be0abf75a2..07f4c8293b 100644 --- a/Projectiles/Summon/PlantThornBall.cs +++ b/Projectiles/Summon/PlantThornBall.cs @@ -17,7 +17,6 @@ namespace CalamityMod.Projectiles.Summon { projectile.width = 30; projectile.height = 30; - projectile.scale = 0.75f; projectile.friendly = true; projectile.penetrate = 3; projectile.timeLeft = 300; diff --git a/Projectiles/Summon/PlantThornBall.png b/Projectiles/Summon/PlantThornBall.png index 2b5de4b6aebd7b1abe27499dda00506422c6ed9c..b2ea5197ee108705392402d7e7a9b8e4e4b01e7b 100644 GIT binary patch literal 561 zcmV-10?z%3P)Px$>q$gGR7i=<)<0`gQ5eVZ&n+UMU?{QJR*0BEsE95W5xclMI5;?Ea?uyy;45$_ zz5&6>Q96ikz$H?|E``vdgMkhjiKRr4;NW$*KKa+AO+?83F3COTo^#Ld{GR7LCov_r zFWm*r&X*LH3M&b`{q%aOdFH15@c-ge{JDSi(L@8zEoQ$ue-p?+o!{f^G8L-v(IN)*Q zX()^69j7$ti)!>djx&Gud3?Eiq@Jd5Z6WhKqBV$o4Wd8)c|6?ES5MK4@+U7c1;fgN zP#RUOTH78uUyv)0Q%48; literal 387 zcmV-}0et?6P)J0=pM~8OjoMjgvU#r zx8V*9K%4ni7NyRMUWj`zPQ(GYg!|=Dq?MH8q%OoS7zff4#)4^n zUpI++Fb=qw^dgi3HvC{uM>7#@tJJ>_#()fP8m~kEgnj9EA`N)31K1rHZ(bw>!2NK2 z69CzdOPhSKx&_nPn@a%z4a@@MxF)DOFa|+jv^TdoZ+Z<#YXXjoc^}7!Td>qpBB2F@ z1r*z3#lb94PQV}*P_}c-4Vd*wg3SP0>56?TtASb99t)t_eXKfIyYsjI%3NUW?IQQ< h(Eq-VwKrH}JOLIs<(t@4<6i&(002ovPDHLkV1kJ)q7DE6 From 5d0ac7c7e96e2b4eb68e796f95ab082a729bcfc7 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 4 Jul 2020 18:10:54 -0400 Subject: [PATCH 010/160] deathhail lasers and knife typo fix --- CalPlayer/CalamityPlayerMiscEffects.cs | 2 +- Items/Weapons/Magic/DeathhailStaff.cs | 4 +- Items/Weapons/Typeless/YanmeisKnife.cs | 2 +- Projectiles/Magic/MagicNebulaShot.cs | 104 ++++++++++++------------- 4 files changed, 55 insertions(+), 57 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index b142dd257b..c7a70f66e4 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3669,7 +3669,7 @@ namespace CalamityMod.CalPlayer velocity.Y *= travelDist; velocity.X += Main.rand.Next(-50, 51) * 0.02f; velocity.Y += Main.rand.Next(-50, 51) * 0.02f; - int laser = Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), dmg, 4f, player.whoAmI, 0f, Main.rand.Next(10)); + int laser = Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), dmg, 4f, player.whoAmI, 0f, 0f); Main.projectile[laser].localNPCHitCooldown = 5; } Main.PlaySound(SoundID.Item12, player.position); diff --git a/Items/Weapons/Magic/DeathhailStaff.cs b/Items/Weapons/Magic/DeathhailStaff.cs index f65ded93fc..f0fca04e3a 100644 --- a/Items/Weapons/Magic/DeathhailStaff.cs +++ b/Items/Weapons/Magic/DeathhailStaff.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Magic { DisplayName.SetDefault("Deathhail Staff"); Tooltip.SetDefault("Rain death upon your foes!\n" + - "Casts a storm of nebula shots from the sky"); + "Casts a storm of nebula lasers from the sky"); Item.staff[item.type] = true; } @@ -101,7 +101,7 @@ namespace CalamityMod.Items.Weapons.Magic num79 *= num80; float speedX4 = num78 + (float)Main.rand.Next(-50, 51) * 0.02f; float speedY5 = num79 + (float)Main.rand.Next(-50, 51) * 0.02f; - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, num73, num74, i, 0f, (float)Main.rand.Next(10)); + Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, num73, num74, i, 0f, 0f); } return false; } diff --git a/Items/Weapons/Typeless/YanmeisKnife.cs b/Items/Weapons/Typeless/YanmeisKnife.cs index fabdacfe67..162fd7a9ad 100644 --- a/Items/Weapons/Typeless/YanmeisKnife.cs +++ b/Items/Weapons/Typeless/YanmeisKnife.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Typeless DisplayName.SetDefault("Yanmei's Knife"); Tooltip.SetDefault("When hitting a boss or its minions, you gain various boosts and cripple the enemy hit\n" + "A knife from an unknown world\n" + - "An owner who's heart is pure and free of taint\n" + + "An owner whose heart is pure and free of taint\n" + "A heart of iron and valor"); } diff --git a/Projectiles/Magic/MagicNebulaShot.cs b/Projectiles/Magic/MagicNebulaShot.cs index 43293cf1d2..1c8431dcac 100644 --- a/Projectiles/Magic/MagicNebulaShot.cs +++ b/Projectiles/Magic/MagicNebulaShot.cs @@ -1,64 +1,62 @@ +using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class MagicNebulaShot : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shot"); - } + public class MagicNebulaShot : BaseLaserbeamProjectile + { + private Color startingColor = new Color(119, 210, 255); + private Color secondColor = new Color(247, 119, 255); + public override float MaxScale => 0.7f; + public override float MaxLaserLength => 1599.999999f; + public override float Lifetime => 20f; + public override Color LaserOverlayColor => CalamityUtils.ColorSwap(startingColor, secondColor, 0.9f); + public override Color LightCastColor => LaserOverlayColor; + public override Texture2D LaserBeginTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UltimaRayStart"); + public override Texture2D LaserMiddleTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UltimaRayMid"); + public override Texture2D LaserEndTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UltimaRayEnd"); - public override void SetDefaults() - { - projectile.width = 4; - projectile.height = 4; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.magic = true; - projectile.tileCollide = false; - projectile.alpha = 255; - projectile.penetrate = -1; - projectile.extraUpdates = 5; - projectile.timeLeft = 200; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 2; - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nebula Shot"); + } - public override void AI() - { - if (projectile.ai[1] == 0f) - { - projectile.ai[1] = 1f; - Main.PlaySound(SoundID.Item12, projectile.position); - } - if (projectile.alpha > 0) - { - projectile.alpha -= 15; - } - if (projectile.alpha < 0) - { - projectile.alpha = 0; - } - Lighting.AddLight(projectile.Center, 0.4f, 0.2f, 0.4f); - for (int num121 = 0; num121 < 5; num121++) - { - Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, Main.rand.NextBool(3) ? 56 : 242, projectile.velocity.X, projectile.velocity.Y, 100, default, 1f)]; - dust4.velocity = Vector2.Zero; - dust4.position -= projectile.velocity / 5f * (float)num121; - dust4.noGravity = true; - dust4.scale = 0.8f; - dust4.noLight = true; - } - } + public override void SetDefaults() + { + projectile.width = projectile.height = 22; + projectile.friendly = true; + projectile.magic = true; + projectile.penetrate = -1; + projectile.alpha = 255; + projectile.localNPCHitCooldown = 2; + projectile.usesLocalNPCImmunity = true; + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.OnFire, 600); - target.AddBuff(BuffID.Frostburn, 600); - } - } + public override bool PreAI() + { + // Initialization. Using the AI hook would override the base laser's code, and we don't want that. + if (projectile.localAI[0] == 0f) + { + if (Main.rand.NextBool()) + { + secondColor = new Color(119, 210, 255); + startingColor = new Color(247, 119, 255); + } + } + return true; + } + + public override bool ShouldUpdatePosition() => false; + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.OnFire, 600); + target.AddBuff(BuffID.Frostburn, 600); + } + } } From 13e7e25f3a87a538f74d51e141f065c0342f4a59 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 4 Jul 2020 18:15:05 -0400 Subject: [PATCH 011/160] smaller tentacle --- Projectiles/Summon/PlantTentacle.png | Bin 1077 -> 1184 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Projectiles/Summon/PlantTentacle.png b/Projectiles/Summon/PlantTentacle.png index 8cd8d46343fda3987c6a3a3b4165c0046a9a519c..78dbdaa9f69486f870bb0ae0f8e46a60cf62917a 100644 GIT binary patch literal 1184 zcmV;R1Yi4!P)Px(T1iAfRA_J#J?){!iU$vRG+yh$ z9yt)g!J{6$+BETk2a{?%HZf6a>QanaY~99G{%A^5sW!`&!m{u@%>GzrcyB2rZ@|Rw zW#7!cH}5;Y{q20ezZr*Z@WLDEs^2foud2`6C9S_^yMcEL$LtV>;pY1Q9DckJfax5r z*8s^xoda;`Lf!>uwOrwcnuz4I>Ut0s<-oig+rgK0g zhQcf})S$H`za?v)dVNutyMZ!xx;lCQXgs7=sr$F;T=37&?|+)n+KaP_vCL?E^ezx& zjDNd%6@V@j^Y&EODZkkTXo(*H;J}M>o&zlW_&{9@>G^MOJ(ie98X^FMnpXfQ%)6fJ z@nhYN191CS^}Wp49%B%&KSp3hes|QR(9^ zsdwC%UeXv=)Y=>NeT7_H`)1t*7&)&PiaHBSwU+kY`HIdS*8wdQK`OxcaTij;2^`8laG0%L05lnMwn^`P}ua*Gz)<6~eSV71o$a497?BW})I6 zgsHRz_I(AQF%|zHj>z;A0{gx~E=)fm`3T-j1$*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ngzp?FdeHwci@!?y%xt+CkZ5(tZF%9hB39`x>Mm(GBG8AWP?!4g6SxC;g$Sp zL;^|KFBa3Jbt)j4h-p&tK+>C@ov8 Date: Sat, 4 Jul 2020 18:24:21 -0400 Subject: [PATCH 012/160] fixed toxicannon droplets doing rogue damage --- Projectiles/Ranged/ToxicannonDrop.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Ranged/ToxicannonDrop.cs b/Projectiles/Ranged/ToxicannonDrop.cs index 689a8b0d3e..c17c8d455e 100644 --- a/Projectiles/Ranged/ToxicannonDrop.cs +++ b/Projectiles/Ranged/ToxicannonDrop.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.tileCollide = true; projectile.ignoreWater = false; projectile.timeLeft = 420; - projectile.Calamity().rogue = true; + projectile.ranged = true; } public override void AI() { From 741327740f2a19201267a49152b709337fdd434e Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 4 Jul 2020 18:28:08 -0400 Subject: [PATCH 013/160] fixed alchemical flask bug --- Projectiles/CalamityGlobalProjectile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 7cc82d659d..f9bd61770b 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1306,7 +1306,7 @@ namespace CalamityMod.Projectiles player.ownedProjectileCounts[ProjectileType()] < 6) { int plague = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.25, 30), 0f, projectile.owner, 0f, 0f); - Main.projectile[plague].Calamity().forceTypeless = false; + Main.projectile[plague].Calamity().forceTypeless = true; } if (modPlayer.reaverBlast && projectile.melee) From 15df6be61c3172b9e417d14b8b9f160ffbdf92e3 Mon Sep 17 00:00:00 2001 From: DominicKarma42 <51094361+DominicKarma@users.noreply.github.com> Date: Sun, 5 Jul 2020 10:07:45 -0500 Subject: [PATCH 014/160] Tiny yanmei's knife fix + base laser tile collision method --- Items/Weapons/Typeless/YanmeisKnife.png | Bin 930 -> 739 bytes NPCs/CalamityGlobalNPC.cs | 2 + .../BaseLaserbeamProjectile.cs | 92 +++++++++++++----- 3 files changed, 69 insertions(+), 25 deletions(-) diff --git a/Items/Weapons/Typeless/YanmeisKnife.png b/Items/Weapons/Typeless/YanmeisKnife.png index 36c6bc6c069eeaf9179745b0823af6e779971d31..b7f214f8f4a07919907dab27c0d15ae78df71196 100644 GIT binary patch delta 716 zcmV;-0yF)h2jc~hBYy&_Nkl3nuQ8s z&_Y^7v`UahH*J(8aMB18HyX7MX<@4%Fc(3jE&@Xk1~)T?2rm3crO1sKp7A%ldz|Mu zAL!iYEardDx#!-w=f~eWZ!q8#`78LmYyaSgm8~Um(hEg?-hU&<3mnN5IH3vY?YF+{ zNh%(FYn+93;{)|F|73PS)H=eYy5mf7!%RdxMcrJ}m_dfTt|PA%Z#J|h_l5ZFuA914 zV*e9P+jaqxnaJ`H{wM6^SqPvI!=vO`kH@Kt-hZ7e*-T0>G|m!3{ZH6v*A+m_l`@8q zB>C_0R~bepet(FLZ1plFI=MS4I+gexr!+oc1|@Zt_tGa~o)~>sLiJaqVR<@3NV7g!A@rP5Cu>Hn{ho z4+w@r)<`;zqsb0+G)hS<7CZJ#))CIx!;r12xUAtB@%FD(BW~__WW*;W%OdLtAL|#o za;qj=eShVmOmD6ye;M3r?{t@^#@frD-}lR0CeNleI2`zwuqHeF?uGRHvj3FjL#BYyw^b5ch_0Itp)=>Px&TuDShRA_6HD*z==1%WB`1t|A{c$%Z3sEjQJnxF z6j2HwKPLx(wwF;G;M~6X094+q1$-zR7{D6aaqapmjhduvJ-W+Eddb@WZPif#R&1Z? zIzJw{3tuXD$P9$U0)ozq;T!05@K|2cRbJvH~9p z54uaF>I#W2Eos$v0Z?d#fb_D?$oo?prURKMET^rG>VIyarz>RV={w!`*5ujX!Y!aj zHhTXN0F^8QU|flwSH60KvA@**>qtG2iNbP@&7GH}z^G{(VDx!+S&7Ixv-asu0Ltdi zPymmfH2|3?EJ-|R0U&4nMB@&2tf~rtHiv9(c^LrF6#L2g7m>FBH10nMWRkG_XUqE3 z3c#H`ujpF94S=-Zthh zp1TnES6pgYlB#wkBVV{M90owOb^s7NeF1<~>ox-Lp!TsbUu2ze$}TUR1HkIdn-swH z#*eP+d?)PrJS?)oU=V5&RRZvY9HWTRx)yg)5%sP?_@_09yHcDrBlhyD4DGQ8k)3d zI$4STh11DOCOEDoscQMo{VTx0WhMR<9;ocwrY7S$94=A-&CQ>T=M=@o(-c7G_isS| zWq&396BgO*fIe0vEURC#IiZjO_!*0N`oPc4&4c;A{u2(6d?uE#EWo>LeqNpe_|c`G z>!m2PF?(_83nH-(n;D5_Xd?y?T27~$z)ZX6b6ZGMhmH1CM j9*+ayReHGNJK;a;n`y(FQonZq0000()] = false; } + if (YanmeisKnifeSlash.CanRecieveCoolEffectsFrom(npc)) + npc.buffImmune[BuffType()] = false; npc.buffImmune[BuffType()] = false; } #endregion diff --git a/Projectiles/BaseProjectiles/BaseLaserbeamProjectile.cs b/Projectiles/BaseProjectiles/BaseLaserbeamProjectile.cs index 2bdecf4355..3abf6c5637 100644 --- a/Projectiles/BaseProjectiles/BaseLaserbeamProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseLaserbeamProjectile.cs @@ -1,6 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; +using System.Linq; using Terraria; using Terraria.Enums; using Terraria.ModLoader; @@ -9,6 +10,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles { public abstract class BaseLaserbeamProjectile : ModProjectile { + #region Auto-Properties public float RotationalSpeed { get => projectile.ai[0]; @@ -24,6 +26,13 @@ namespace CalamityMod.Projectiles.BaseProjectiles get => projectile.localAI[1]; set => projectile.localAI[1] = value; } + #endregion + + #region Virtual Methods + + /// + /// Handles all AI logic for the laser. Can be overridden, but you probably won't need to do that. + /// public virtual void Behavior() { // Attach to some arbitrary thing/position optionally. (The ai[1] value is a reserved for this in vanilla's Phantasmal Deathray) @@ -49,18 +58,25 @@ namespace CalamityMod.Projectiles.BaseProjectiles DelegateMethods.v3_1 = LightCastColor.ToVector3(); Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * LaserLength, projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CastLight)); } + + /// + /// Handles movement logic for the laser. By default causes arcing/sweeping motiom. + /// public virtual void UpdateLaserMotion() { // This part is rather complicated at a glance. // What it's doing is converting the velocity to an angle, doing something with that angle, and changing it back into the velocity. - // In this case, "doing something with that angle" means incrementing it by a constant. + // In this case, "doing something with that angle" means incrementing it by a constant. This allows the laser to perform "arcing" motion. // You could attempt to make it intelligent by having it move towards the target like the Last Prism, but that's not done here. - // This allows one to cause an arcing motion. float updatedVelocityDirection = projectile.velocity.ToRotation() + RotationalSpeed; projectile.rotation = updatedVelocityDirection - MathHelper.PiOver2; // Pretty much all lasers have a vertical sheet. projectile.velocity = updatedVelocityDirection.ToRotationVector2(); } + + /// + /// Calculates the total scale of the laser. By default uses a clamped sine of time. + /// public virtual void DetermineScale() { projectile.scale = (float)Math.Sin(Time / Lifetime * MathHelper.Pi) * 6f * MaxScale; @@ -69,14 +85,49 @@ namespace CalamityMod.Projectiles.BaseProjectiles projectile.scale = MaxScale; } } - public virtual void AttachToSomething() { } // Does nothing by default. - public virtual float DetermineLaserLength() => MaxLaserLength; // Go with the default length and ignore any obstacles by default. + + /// + /// Handles direct attachment to things. The projectile.ai[1] array index is reserved for this. Does nothing by default. + /// + public virtual void AttachToSomething() { } + + /// + /// Calculates the current laser's length. By default does not collide with tiles. is a generic laser collision method if you want to do that. + /// + /// The laser length as a float. + public virtual float DetermineLaserLength() => MaxLaserLength; + + /// + /// An extra, empty by default method that exists so that a developer can add custom code after all typical AI logic is done. Think of it like PostAI. + /// public virtual void ExtraBehavior() { } + #endregion + + #region Helper Methods + + /// + /// Calculates the laser length while taking tiles into account. + /// + /// The amount of samples the ray uses. The higher this is, the more precision, but also more calculations done. + public float DetermineLaserLength_CollideWithTiles(int samplePointCount) + { + float[] laserLengthSamplePoints = new float[samplePointCount]; + Collision.LaserScan(projectile.Center, projectile.velocity, projectile.scale, MaxLaserLength, laserLengthSamplePoints); + return laserLengthSamplePoints.Average(); + } + #endregion + + #region Hook Overrides public override void AI() { Behavior(); ExtraBehavior(); } + public override void CutTiles() + { + DelegateMethods.tilecut_0 = TileCuttingContext.AttackMelee; + Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * LaserLength, projectile.Size.Length() * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { // This should never happen, but just in case- @@ -84,13 +135,13 @@ namespace CalamityMod.Projectiles.BaseProjectiles return false; // Start texture drawing. - spriteBatch.Draw(LaserBeginTexture, - projectile.Center - Main.screenPosition, + spriteBatch.Draw(LaserBeginTexture, + projectile.Center - Main.screenPosition, null, LaserOverlayColor, projectile.rotation, LaserBeginTexture.Size() / 2f, - projectile.scale, + projectile.scale, SpriteEffects.None, 0f); @@ -107,13 +158,13 @@ namespace CalamityMod.Projectiles.BaseProjectiles float incrementalBodyLength = 0f; while (incrementalBodyLength + 1f < laserBodyLength) { - spriteBatch.Draw(LaserMiddleTexture, - centerOnLaser - Main.screenPosition, - null, - LaserOverlayColor, + spriteBatch.Draw(LaserMiddleTexture, + centerOnLaser - Main.screenPosition, + null, + LaserOverlayColor, projectile.rotation, - LaserMiddleTexture.Width * 0.5f * Vector2.UnitX, - projectile.scale, + LaserMiddleTexture.Width * 0.5f * Vector2.UnitX, + projectile.scale, SpriteEffects.None, 0f); incrementalBodyLength += laserOffset; @@ -137,25 +188,16 @@ namespace CalamityMod.Projectiles.BaseProjectiles } return false; } - public override void CutTiles() - { - DelegateMethods.tilecut_0 = TileCuttingContext.AttackMelee; - Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * LaserLength, projectile.Size.Length() * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); - } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { if (projHitbox.Intersects(targetHitbox)) return true; float unused = 69420f; - if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center, projectile.Center + projectile.velocity * LaserLength, projectile.Size.Length() * projectile.scale, ref unused)) - { - return true; - } - return false; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center, projectile.Center + projectile.velocity * LaserLength, projectile.Size.Length() * projectile.scale, ref unused); } + #endregion - #region Virtual Values + #region Virtual Properties public virtual float Lifetime => 120f; public virtual float MaxScale => 1f; public virtual float MaxLaserLength => 2400f; // Be careful with this. Going too high will cause lag. From aec76e9e1b51da3ffd9d081a7f698dccb9114fc1 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 5 Jul 2020 12:34:19 -0400 Subject: [PATCH 015/160] plantation staff now has tentacles and works as intended --- Items/Weapons/Summon/PlantationStaff.cs | 6 +- Projectiles/Summon/PlantSummon.cs | 63 ++++++++----- Projectiles/Summon/PlantTentacle.cs | 120 ++++++++++++++++++++---- 3 files changed, 146 insertions(+), 43 deletions(-) diff --git a/Items/Weapons/Summon/PlantationStaff.cs b/Items/Weapons/Summon/PlantationStaff.cs index 50228da310..bd1f0c17ce 100644 --- a/Items/Weapons/Summon/PlantationStaff.cs +++ b/Items/Weapons/Summon/PlantationStaff.cs @@ -17,12 +17,12 @@ namespace CalamityMod.Items.Weapons.Summon "Fires seeds and spiky balls from afar to poison targets\n" + "Enrages when you get under 50% health and begins ramming enemies\n" + "While enraged, it will additionally start firing spore clouds\n" + - "Occupies 2 minion slots and there can only be one"); + "Occupies 3 minion slots and there can only be one"); } public override void SetDefaults() { - item.damage = 70; + item.damage = 75; item.mana = 10; item.width = 66; item.height = 70; @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Summon item.summon = true; } - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0 && player.maxMinions >= 2; + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0 && player.maxMinions >= 3; public override void AddRecipes() { diff --git a/Projectiles/Summon/PlantSummon.cs b/Projectiles/Summon/PlantSummon.cs index 90ddbc5b31..1eb19c2817 100644 --- a/Projectiles/Summon/PlantSummon.cs +++ b/Projectiles/Summon/PlantSummon.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Summon projectile.netImportant = true; projectile.friendly = true; projectile.ignoreWater = true; - projectile.minionSlots = 2f; + projectile.minionSlots = 3f; projectile.timeLeft = 18000; projectile.penetrate = -1; projectile.tileCollide = false; @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); CalamityGlobalProjectile modProj = projectile.Calamity(); - if (player.statLife <= (int)(player.statLifeMax2 * 0.5)) + if (player.statLife <= (int)(player.statLifeMax2 * 0.75)) { if (Main.myPlayer == projectile.owner) { @@ -176,10 +176,17 @@ namespace CalamityMod.Projectiles.Summon if (Main.myPlayer == projectile.owner) { Vector2 velocity = targetVec - projectile.Center; - velocity.Normalize(); - velocity *= projSpeed; - velocity *= speedMult; - Projectile.NewProjectile(projectile.Center, velocity, projType, projDmg, projectile.knockBack, projectile.owner, 0f, 0f); + if (projType != thornBall && Main.rand.NextBool(3)) + { + FireShotgun(velocity, 0.7f); + } + else + { + velocity.Normalize(); + velocity *= projSpeed; + velocity *= speedMult; + Projectile.NewProjectile(projectile.Center, velocity, projType, projDmg, projectile.knockBack, projectile.owner, 0f, 0f); + } projectile.netUpdate = true; } } @@ -277,23 +284,7 @@ namespace CalamityMod.Projectiles.Summon } if (Main.rand.NextBool(3)) { - float projSpeedMult = 3f; - if (Main.rand.NextBool(2) && CalamityUtils.CountProjectiles(sporeClouds) < 9) - { - projType = sporeClouds; - projSpeedMult = 10f; - } - else - { - projType = Main.rand.NextBool(2) ? greenSeed : pinkSeed; - } - int projDmg = (int)(projectile.damage * 0.8f); - Vector2 projVelocity = whereIsTarget * projSpeedMult; - for (int i = -8; i <= 8; i += 8) - { - Vector2 perturbedSpeed = projVelocity.RotatedBy(MathHelper.ToRadians(i)); - Projectile.NewProjectile(projectile.Center, perturbedSpeed, projType, projDmg, projectile.knockBack * 0.8f, projectile.owner, Main.rand.Next(3), 1f); - } + FireShotgun(whereIsTarget, 0.8f); } float chargeSpeed = 8f; projectile.velocity = whereIsTarget * chargeSpeed; @@ -394,6 +385,29 @@ namespace CalamityMod.Projectiles.Summon } } + private void FireShotgun(Vector2 whereIsTarget, float attackMult) + { + whereIsTarget.Normalize(); + float projSpeedMult = 3f; + int projType = pinkSeed; + if (Main.rand.NextBool(2) && CalamityUtils.CountProjectiles(sporeClouds) < 9) + { + projType = sporeClouds; + projSpeedMult = 10f; + } + else + { + projType = Main.rand.NextBool(2) ? greenSeed : pinkSeed; + } + int projDmg = (int)(projectile.damage * attackMult); + Vector2 projVelocity = whereIsTarget * projSpeedMult; + for (int i = -8; i <= 8; i += 8) + { + Vector2 perturbedSpeed = projVelocity.RotatedBy(MathHelper.ToRadians(i)); + Projectile.NewProjectile(projectile.Center, perturbedSpeed, projType, projDmg, projectile.knockBack * attackMult, projectile.owner, Main.rand.Next(3), 1f); + } + } + private void HandleRotation(bool targetFound, Vector2 whereIsTarget) { if (targetFound && !enraged) @@ -468,7 +482,7 @@ namespace CalamityMod.Projectiles.Summon public override bool CanDamage() => enraged; - public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = Main.projectileTexture[projectile.type]; int height = texture.Height / Main.projFrames[projectile.type]; @@ -478,6 +492,7 @@ namespace CalamityMod.Projectiles.Summon spriteEffects = SpriteEffects.FlipHorizontally; Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture.Width / 2f, (float)height / 2f), projectile.scale, spriteEffects, 0f); + return false; } } } diff --git a/Projectiles/Summon/PlantTentacle.cs b/Projectiles/Summon/PlantTentacle.cs index d1059f6a66..7764aeb626 100644 --- a/Projectiles/Summon/PlantTentacle.cs +++ b/Projectiles/Summon/PlantTentacle.cs @@ -11,6 +11,8 @@ namespace CalamityMod.Projectiles.Summon public class PlantTentacle : ModProjectile { private bool initialized = false; + private int counter = 0; + private float desiredDistance = 150f; public override void SetStaticDefaults() { @@ -22,8 +24,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { - projectile.width = 30; - projectile.height = 30; + projectile.width = 22; + projectile.height = 24; projectile.netImportant = true; projectile.friendly = true; projectile.ignoreWater = true; @@ -33,8 +35,8 @@ namespace CalamityMod.Projectiles.Summon projectile.tileCollide = false; projectile.timeLeft *= 5; projectile.minion = true; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 12; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 12; } public override void AI() @@ -71,35 +73,77 @@ namespace CalamityMod.Projectiles.Summon if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int trueDamage = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / - projectile.Calamity().spawnedPlayerMinionDamageValue * - player.MinionDamage()); + projectile.Calamity().spawnedPlayerMinionDamageValue * player.MinionDamage()); projectile.damage = trueDamage; } + if (player.Calamity().plantera) + { + projectile.timeLeft = 2; + } + projectile.rotation = (projectile.Center - hostPlant.Center).ToRotation() + MathHelper.Pi; - float radians = MathHelper.TwoPi / 6f; - float xOffset = hostPlant.Center.X + 150f; - Vector2 source = new Vector2(xOffset, hostPlant.Center.Y); - Vector2 goal = (source - hostPlant.Center).RotatedBy(radians * projectile.ai[0]); + projectile.MinionAntiClump(1f); - //Vector2 hourVector = (radians * projectile.ai[0]).ToRotationVector2(); - - Vector2 targetPos = goal - projectile.Center; + counter++; + if (counter % 30 == 0) //changes every half second + { + desiredDistance = Main.rand.NextFloat(175f, 225f); + } + Vector2 targetPos = hostPlant.Center - projectile.Center; float targetDist = targetPos.Length(); targetPos.Normalize(); - if (targetDist > 150f) + if (targetDist > desiredDistance) { - float speedMult = 8f; + float speedMult = 10f; + speedMult += (targetDist - desiredDistance) * 0.2f; //+0.2f for every 1f away from the desired distance targetPos *= speedMult; projectile.velocity = (projectile.velocity * 40f + targetPos) / 41f; } else { - float reverseSpeedMult = 4f; + float reverseSpeedMult = 5f; targetPos *= -reverseSpeedMult; projectile.velocity = (projectile.velocity * 40f + targetPos) / 41f; } + + if (targetDist > 2000f) + { + projectile.position.X = hostPlant.Center.X - (float)(projectile.width / 2); + projectile.position.Y = hostPlant.Center.Y - (float)(projectile.height / 2); + projectile.netUpdate = true; + } + + if (projectile.ai[0] >= 3f) + { + if (hostPlant.Center.X - projectile.Center.X > 0) + { + projectile.velocity.X += 0.05f; + } + } + else + { + if (hostPlant.Center.X - projectile.Center.X < 0) + { + projectile.velocity.X -= 0.05f; + } + } + + if (projectile.ai[0] % 2f == 0f) + { + if (hostPlant.Center.Y - projectile.Center.Y > 0) + { + projectile.velocity.Y += 0.05f; + } + } + else + { + if (hostPlant.Center.Y - projectile.Center.Y < 0) + { + projectile.velocity.Y -= 0.05f; + } + } } public override void Kill(int timeLeft) @@ -158,6 +202,50 @@ namespace CalamityMod.Projectiles.Summon } } return true; + } + + //It draws the host plant in here in order to have it draw over the tentacles + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + //Only 1 tentacle needs to draw this, the last one spawned because it's latest in the projectile array. + if (projectile.ai[0] < 5) + { + return; + } + + if (projectile.ai[1] < 0 || projectile.ai[1] >= Main.maxProjectiles) + { + return; + } + + // If something has gone wrong with either the tentacle or the host plant, return. + Projectile hostPlant = Main.projectile[(int)projectile.ai[1]]; + if (projectile.type != ModContent.ProjectileType() || !hostPlant.active || hostPlant.type != ModContent.ProjectileType()) + { + return; + } + + Texture2D texture = Main.projectileTexture[hostPlant.type]; + int height = texture.Height / Main.projFrames[hostPlant.type]; + int frameHeight = height * hostPlant.frame; + SpriteEffects spriteEffects = SpriteEffects.None; + if (hostPlant.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + Color color = Lighting.GetColor((int)hostPlant.Center.X / 16, (int)(hostPlant.Center.Y / 16f)); + + Main.spriteBatch.Draw(texture, hostPlant.Center - Main.screenPosition + new Vector2(0f, hostPlant.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), color, hostPlant.rotation, new Vector2((float)texture.Width / 2f, (float)height / 2f), hostPlant.scale, spriteEffects, 0f); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.Poisoned, 120); + target.AddBuff(BuffID.Venom, 120); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Poisoned, 120); + target.AddBuff(BuffID.Venom, 120); } } } From e7781bc8552d86c1f8935a13e9a62d289a10a8f2 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 9 Jul 2020 12:29:43 -0400 Subject: [PATCH 016/160] heat and cold protection tooltips now only show up in death mode cold divinity now gets protection in its tooltip --- Items/Accessories/AmbrosialAmpoule.cs | 21 +- Items/Accessories/AngelTreads.cs | 20 +- Items/Accessories/BlazingCore.cs | 20 +- Items/Accessories/ElementalGauntlet.cs | 20 +- Items/Accessories/FrigidBulwark.cs | 20 +- Items/Accessories/FrostBarrier.cs | 20 +- Items/Accessories/FrostFlare.cs | 20 +- Items/Accessories/PermafrostsConcoction.cs | 20 +- Items/Accessories/ProfanedSoulCrystal.cs | 29 ++- Items/Accessories/RampartofDeities.cs | 20 +- Items/Accessories/Sponge.cs | 20 +- Items/Accessories/TheAmalgam.cs | 20 +- Items/Accessories/TheCamper.cs | 24 ++- Items/Accessories/Vanity/Popo.cs | 20 +- Items/Accessories/VoidofExtinction.cs | 20 +- Items/Accessories/Wings/CelestialTracers.cs | 20 +- Items/Accessories/Wings/ElysianTracers.cs | 20 +- Items/Accessories/Wings/ElysianWings.cs | 20 +- Items/Accessories/Wings/InfinityBoots.cs | 20 +- Items/Accessories/Wings/SoulofCryogen.cs | 20 +- Items/Accessories/YharimsInsignia.cs | 20 +- Items/Armor/AtaxiaHeadgear.cs | 20 +- Items/Armor/AtaxiaHelm.cs | 20 +- Items/Armor/AtaxiaHelmet.cs | 20 +- Items/Armor/AtaxiaHood.cs | 20 +- Items/Armor/AtaxiaMask.cs | 20 +- Items/Armor/AuricTeslaBodyArmor.cs | 20 +- Items/Armor/BloodflareHelm.cs | 20 +- Items/Armor/BloodflareHelmet.cs | 20 +- Items/Armor/BloodflareHornedHelm.cs | 20 +- Items/Armor/BloodflareHornedMask.cs | 20 +- Items/Armor/BloodflareMask.cs | 20 +- Items/Armor/FearmongerGreathelm.cs | 15 +- Items/Armor/SilvaHelm.cs | 3 +- Items/Armor/SilvaHelmet.cs | 3 +- Items/Armor/SilvaHornedHelm.cs | 3 +- Items/Armor/SilvaMask.cs | 3 +- Items/Armor/SilvaMaskedCap.cs | 3 +- Items/Armor/TarragonBreastplate.cs | 6 +- Items/Armor/TarragonHelm.cs | 20 +- Items/Armor/TarragonHelmet.cs | 20 +- Items/Armor/TarragonHornedHelm.cs | 20 +- Items/Armor/TarragonMask.cs | 20 +- Items/Armor/TarragonVisage.cs | 20 +- Items/Armor/XerocCuisses.cs | 6 +- Items/Armor/XerocMask.cs | 24 ++- Items/Armor/XerocPlateMail.cs | 6 +- Items/CalamityGlobalItem.cs | 228 ++++++++++++++------ Items/Weapons/Summon/ColdDivinity.cs | 18 ++ 49 files changed, 902 insertions(+), 170 deletions(-) diff --git a/Items/Accessories/AmbrosialAmpoule.cs b/Items/Accessories/AmbrosialAmpoule.cs index 4623368c48..21235fc272 100644 --- a/Items/Accessories/AmbrosialAmpoule.cs +++ b/Items/Accessories/AmbrosialAmpoule.cs @@ -1,5 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -16,8 +18,7 @@ namespace CalamityMod.Items.Accessories "5% increased damage reduction and increased life regen\n" + "Poison, Freeze, Chill, Frostburn, and Venom immunity\n" + "Honey-like life regen with no speed penalty\n" + - "Most bee/hornet enemies and projectiles do 75% damage to you\n" + - "Provides cold protection in Death Mode"); + "Most bee/hornet enemies and projectiles do 75% damage to you"); } public override void SetDefaults() @@ -30,12 +31,26 @@ namespace CalamityMod.Items.Accessories item.accessory = true; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip5") + { + line2.text = "Most bee/hornet enemies and projectiles do 75% damage to you\n" + + "Provides cold protection in Death Mode"; + } + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.beeResist = true; modPlayer.aAmpoule = true; - } public override void AddRecipes() diff --git a/Items/Accessories/AngelTreads.cs b/Items/Accessories/AngelTreads.cs index beb02fbfac..26391d7720 100644 --- a/Items/Accessories/AngelTreads.cs +++ b/Items/Accessories/AngelTreads.cs @@ -1,5 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -17,8 +19,7 @@ namespace CalamityMod.Items.Accessories "Increased flight time\n" + "Greater mobility on ice\n" + "Water and lava walking\n" + - "Temporary immunity to lava\n" + - "Provides heat protection in Death Mode"); + "Temporary immunity to lava"); } public override void SetDefaults() @@ -30,6 +31,21 @@ namespace CalamityMod.Items.Accessories item.accessory = true; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip5") + { + line2.text = "Temporary immunity to lava\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/BlazingCore.cs b/Items/Accessories/BlazingCore.cs index 2e6a725cc5..eb25eb462c 100644 --- a/Items/Accessories/BlazingCore.cs +++ b/Items/Accessories/BlazingCore.cs @@ -1,4 +1,6 @@ using CalamityMod.CalPlayer; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; @@ -15,8 +17,7 @@ namespace CalamityMod.Items.Accessories "Being hit creates a miniature sun that lingers, dealing damage to nearby enemies\n" + "The sun will slowly drag enemies into it\n" + "Only one sun can be active at once\n" + - "Provides a moderate amount of light in the Abyss\n" + - "Provides heat and cold protection in Death Mode"); + "Provides a moderate amount of light in the Abyss"); Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 6)); } @@ -30,6 +31,21 @@ namespace CalamityMod.Items.Accessories item.value = CalamityGlobalItem.Rarity12BuyPrice; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip5") + { + line2.text = "Provides a moderate amount of light in the Abyss\n" + + "Provides heat and cold protection in Death Mode"; + } + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/ElementalGauntlet.cs b/Items/Accessories/ElementalGauntlet.cs index b63547e278..6204e7e09a 100644 --- a/Items/Accessories/ElementalGauntlet.cs +++ b/Items/Accessories/ElementalGauntlet.cs @@ -1,6 +1,8 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -18,8 +20,7 @@ namespace CalamityMod.Items.Accessories "Increased invincibility after taking damage\n" + "Temporary immunity to lava\n" + "Increased melee knockback\n" + - "Melee attacks have a chance to instantly kill normal enemies\n" + - "Provides heat and cold protection in Death Mode"); + "Melee attacks have a chance to instantly kill normal enemies"); } public override void SetDefaults() @@ -31,6 +32,21 @@ namespace CalamityMod.Items.Accessories item.Calamity().customRarity = CalamityRarity.DarkBlue; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip6") + { + line2.text = "Melee attacks have a chance to instantly kill normal enemies\n" + + "Provides heat and cold protection in Death Mode"; + } + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/FrigidBulwark.cs b/Items/Accessories/FrigidBulwark.cs index e0f561e3a5..781cffd5c5 100644 --- a/Items/Accessories/FrigidBulwark.cs +++ b/Items/Accessories/FrigidBulwark.cs @@ -1,5 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -15,8 +17,7 @@ namespace CalamityMod.Items.Accessories "Only active above 25% life\n" + "Grants immunity to knockback\n" + "Puts a shell around the owner when below 50% life that reduces damage\n" + - "The shell becomes more powerful when below 15% life and reduces damage even further\n" + - "Provides heat and cold protection in Death Mode"); + "The shell becomes more powerful when below 15% life and reduces damage even further"); } public override void SetDefaults() @@ -29,6 +30,21 @@ namespace CalamityMod.Items.Accessories item.accessory = true; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip4") + { + line2.text = "The shell becomes more powerful when below 15% life and reduces damage even further\n" + + "Provides heat and cold protection in Death Mode"; + } + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/FrostBarrier.cs b/Items/Accessories/FrostBarrier.cs index 8cab320dc5..95b82045cb 100644 --- a/Items/Accessories/FrostBarrier.cs +++ b/Items/Accessories/FrostBarrier.cs @@ -1,4 +1,6 @@ using CalamityMod.CalPlayer; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,8 +13,7 @@ namespace CalamityMod.Items.Accessories { DisplayName.SetDefault("Frost Barrier"); Tooltip.SetDefault("You will freeze enemies near you when you are struck\n" + - "You are immune to the chilled debuff\n" + - "Provides heat and cold protection in Death Mode"); + "You are immune to the chilled debuff"); } public override void SetDefaults() @@ -25,6 +26,21 @@ namespace CalamityMod.Items.Accessories item.accessory = true; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text = "You are immune to the chilled debuff\n" + + "Provides heat and cold protection in Death Mode"; + } + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/FrostFlare.cs b/Items/Accessories/FrostFlare.cs index 5e4c5660d3..17507e218b 100644 --- a/Items/Accessories/FrostFlare.cs +++ b/Items/Accessories/FrostFlare.cs @@ -1,4 +1,6 @@ using CalamityMod.CalPlayer; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; @@ -15,8 +17,7 @@ namespace CalamityMod.Items.Accessories "Resistant to cold attacks and +1 life regen\n" + "Being above 75% life grants the player 10% increased damage\n" + "Being below 25% life grants the player 10 defense and 15% increased max movement speed and acceleration\n" + - "Provides heat and cold protection in Death Mode\n" + - "Revengeance drop"); + "Revengeance drop"); Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 4)); } @@ -30,6 +31,21 @@ namespace CalamityMod.Items.Accessories item.accessory = true; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip5") + { + line2.text = "Provides heat and cold protection in Death Mode\n" + + "Revengeance drop"; + } + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/PermafrostsConcoction.cs b/Items/Accessories/PermafrostsConcoction.cs index bea2728aaf..fa2c7d887e 100644 --- a/Items/Accessories/PermafrostsConcoction.cs +++ b/Items/Accessories/PermafrostsConcoction.cs @@ -1,3 +1,5 @@ +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ModLoader; @@ -12,8 +14,7 @@ namespace CalamityMod.Items.Accessories Increases life regen as life decreases Increases life regen when afflicted with Poison, On Fire, or Brimstone Flames You will survive fatal damage and revive with 30% life on a 3 minute cooldown -You are encased in an ice barrier for 3 seconds when revived -Provides heat and cold protection in Death Mode"); +You are encased in an ice barrier for 3 seconds when revived"); } public override void SetDefaults() @@ -25,6 +26,21 @@ Provides heat and cold protection in Death Mode"); item.rare = 5; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip4") + { + line2.text = "You are encased in an ice barrier for 3 seconds when revived\n" + + "Provides heat and cold protection in Death Mode"; + } + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { player.Calamity().permafrostsConcoction = true; diff --git a/Items/Accessories/ProfanedSoulCrystal.cs b/Items/Accessories/ProfanedSoulCrystal.cs index 6f059f0239..36c2e250d0 100644 --- a/Items/Accessories/ProfanedSoulCrystal.cs +++ b/Items/Accessories/ProfanedSoulCrystal.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Accessories * bab spears being fired happens at the bottom of calplayer * Animation of legs is postupdate, animation of wings is frameeffects. * Projectiles transformed are ONLY affected by alldamage and summon damage bonuses, likewise the weapon's base damage/usetime is NOT taken into account. - * You enrage below below or at 50% hp. + * You enrage below or at 50% hp. */ public override void SetStaticDefaults() { @@ -39,9 +39,7 @@ namespace CalamityMod.Items.Accessories "Summons and empowers the profaned babs to fight alongside you\n" + "You are no longer affected by burn out when hit\n" + "Provides buffs depending on the time of day\n" + - "Provides heat and cold protection in Death Mode\n" + - "Thinking back, it was a boring life\n" + - "[c/FFBF49:And so we burn it all in the name of purity]"); + "This line is modified below"); Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); } @@ -97,6 +95,29 @@ namespace CalamityMod.Items.Accessories line.text = "[c/3a83e4:Transforms Magic attacks into a powerful splitting fireball for " + manaCost + " mana per cast]"; } } + if (CalamityWorld.death) + { + foreach (TooltipLine line in tooltips) + { + if (line.mod == "Terraria" && line.Name == "Tooltip11") + { + line.text = "Provides heat and cold protection in Death Mode\n" + + "Thinking back, it was a boring life\n" + + "[c/FFBF49:And so we burn it all in the name of purity]"; + } + } + } + else + { + foreach (TooltipLine line in tooltips) + { + if (line.mod == "Terraria" && line.Name == "Tooltip11") + { + line.text = "Thinking back, it was a boring life\n" + + "[c/FFBF49:And so we burn it all in the name of purity]"; + } + } + } } } diff --git a/Items/Accessories/RampartofDeities.cs b/Items/Accessories/RampartofDeities.cs index 449f87fd77..f705e4d062 100644 --- a/Items/Accessories/RampartofDeities.cs +++ b/Items/Accessories/RampartofDeities.cs @@ -1,6 +1,8 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ModLoader; @@ -19,8 +21,7 @@ namespace CalamityMod.Items.Accessories "Only active above 25% life\n" + "Grants immunity to knockback and reduces the cooldown of healing potions\n" + "Puts a shell around the owner when below 50% life that reduces damage\n" + - "The shell becomes more powerful when below 15% life and reduces damage even further\n" + - "Provides heat and cold protection in Death Mode"); + "The shell becomes more powerful when below 15% life and reduces damage even further"); } public override void SetDefaults() @@ -33,6 +34,21 @@ namespace CalamityMod.Items.Accessories item.Calamity().customRarity = CalamityRarity.DarkBlue; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip8") + { + line2.text = "The shell becomes more powerful when below 15% life and reduces damage even further\n" + + "Provides heat and cold protection in Death Mode"; + } + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/Sponge.cs b/Items/Accessories/Sponge.cs index 00b9534f64..3f051fdb75 100644 --- a/Items/Accessories/Sponge.cs +++ b/Items/Accessories/Sponge.cs @@ -1,9 +1,11 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; +using System.Collections.Generic; using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; @@ -30,8 +32,7 @@ namespace CalamityMod.Items.Accessories "Enemies take damage when they hit you\n" + "Taking a hit will make you move very fast for a short time\n" + "You emit a mushroom spore and spark explosion when you are hit\n" + - "Enemy attacks will have part of their damage absorbed and used to heal you\n" + - "Provides cold protection in Death Mode"); + "Enemy attacks will have part of their damage absorbed and used to heal you"); Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 30)); } @@ -45,6 +46,21 @@ namespace CalamityMod.Items.Accessories item.Calamity().customRarity = CalamityRarity.DarkBlue; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip12") + { + line2.text = "Enemy attacks will have part of their damage absorbed and used to heal you\n" + + "Provides cold protection in Death Mode"; + } + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index ea29214dd9..c039f47f0a 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -5,7 +5,9 @@ using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.World; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -35,8 +37,7 @@ namespace CalamityMod.Items.Accessories "75% increased movement speed, 10% increase to all damage, and plus 40 defense while submerged in any liquid\n" + "The above bonuses also apply when passing through the clump's poisonous seawater\n" + "Temporary immunity to lava, greatly reduces lava burn damage, and 15% increased damage while in lava\n" + - "You have a damaging aura that envenoms nearby enemies and increased movement in liquids\n" + - "Provides heat protection in Death Mode"); + "You have a damaging aura that envenoms nearby enemies and increased movement in liquids"); Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(9, 6)); } @@ -50,6 +51,21 @@ namespace CalamityMod.Items.Accessories item.accessory = true; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip8") + { + line2.text = "You have a damaging aura that envenoms nearby enemies and increased movement in liquids\n" + + "Provides cold protection in Death Mode"; + } + } + } + } + public override bool CanEquipAccessory(Player player, int slot) => !player.Calamity().fungalClump; public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/TheCamper.cs b/Items/Accessories/TheCamper.cs index 8decddc970..a1bc81a9f6 100644 --- a/Items/Accessories/TheCamper.cs +++ b/Items/Accessories/TheCamper.cs @@ -1,7 +1,9 @@ using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Typeless; +using CalamityMod.World; using Microsoft.Xna.Framework; using System; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -17,13 +19,12 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("The Camper"); - Tooltip.SetDefault("You deal no damage unless stationary\n" + + Tooltip.SetDefault("In rest may we find victory.\n" + + "You deal no damage unless stationary\n" + "Standing still grants buff(s) dependent on what weapon you're holding\n" + "Standing still provides a damaging aura around you\n" + "While moving, you regenerate health as if standing still\n" + - "Provides a small amount of light in the Abyss\n" + - "Provides cold protection in Death Mode\n" + - "In rest may we find victory."); + "Provides a small amount of light in the Abyss"); } public override void SetDefaults() @@ -36,6 +37,21 @@ namespace CalamityMod.Items.Accessories item.defense = 10; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip5") + { + line2.text = "Provides a small amount of light in the Abyss\n" + + "Provides cold protection in Death Mode"; + } + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/Vanity/Popo.cs b/Items/Accessories/Vanity/Popo.cs index e7e19e90e9..d07d44f54d 100644 --- a/Items/Accessories/Vanity/Popo.cs +++ b/Items/Accessories/Vanity/Popo.cs @@ -1,4 +1,6 @@ using CalamityMod.CalPlayer; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ModLoader; @@ -10,8 +12,7 @@ namespace CalamityMod.Items.Accessories.Vanity { DisplayName.SetDefault("Magic Scarf and Hat"); Tooltip.SetDefault("Don't let the demons steal your nose\n" + - "Transforms the holder into a snowman\n" + - "Provides heat and cold protection in Death Mode"); + "Transforms the holder into a snowman"); } public override void SetDefaults() @@ -23,6 +24,21 @@ namespace CalamityMod.Items.Accessories.Vanity item.rare = 5; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text = "Transforms the holder into a snowman\n" + + "Provides heat and cold protection in Death Mode"; + } + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/VoidofExtinction.cs b/Items/Accessories/VoidofExtinction.cs index ccbe436768..80fc806489 100644 --- a/Items/Accessories/VoidofExtinction.cs +++ b/Items/Accessories/VoidofExtinction.cs @@ -1,8 +1,10 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Typeless; +using CalamityMod.World; using Microsoft.Xna.Framework; using System; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -22,8 +24,7 @@ namespace CalamityMod.Items.Accessories "Drops brimstone fireballs from the sky occasionally\n" + "15% increase to all damage\n" + "Brimstone fire rains down while invincibility is active\n" + - "Temporary immunity to lava, greatly reduces lava burn damage, and 25% increased damage while in lava\n" + - "Provides heat protection in Death Mode"); + "Temporary immunity to lava, greatly reduces lava burn damage, and 25% increased damage while in lava"); } public override void SetDefaults() @@ -36,6 +37,21 @@ namespace CalamityMod.Items.Accessories item.accessory = true; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip4") + { + line2.text = "Temporary immunity to lava, greatly reduces lava burn damage, and 25% increased damage while in lava\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override bool CanEquipAccessory(Player player, int slot) => !player.Calamity().calamityRing; public override void AddRecipes() diff --git a/Items/Accessories/Wings/CelestialTracers.cs b/Items/Accessories/Wings/CelestialTracers.cs index 893f69bc72..c45d509d0b 100644 --- a/Items/Accessories/Wings/CelestialTracers.cs +++ b/Items/Accessories/Wings/CelestialTracers.cs @@ -1,7 +1,9 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.World; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.Graphics.Shaders; using Terraria.ModLoader; @@ -24,8 +26,7 @@ namespace CalamityMod.Items.Accessories.Wings "Greater mobility on ice\n" + "Water and lava walking\n" + "Temporary immunity to lava\n" + - "Being hit for over 200 damage will make you immune for an extended period of time\n" + - "Provides heat protection in Death Mode"); + "Being hit for over 200 damage will make you immune for an extended period of time"); } public override void SetDefaults() @@ -37,6 +38,21 @@ namespace CalamityMod.Items.Accessories.Wings item.Calamity().customRarity = CalamityRarity.Violet; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip10") + { + line2.text = "Being hit for over 200 damage will make you immune for an extended period of time\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { if (player.controlJump && player.wingTime > 0f && !player.jumpAgainCloud && player.jump == 0 && player.velocity.Y != 0f && !hideVisual) diff --git a/Items/Accessories/Wings/ElysianTracers.cs b/Items/Accessories/Wings/ElysianTracers.cs index c3f71e9410..58d77ee823 100644 --- a/Items/Accessories/Wings/ElysianTracers.cs +++ b/Items/Accessories/Wings/ElysianTracers.cs @@ -1,6 +1,8 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.World; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.Graphics.Shaders; using Terraria.ID; @@ -23,8 +25,7 @@ namespace CalamityMod.Items.Accessories.Wings "36% increased running acceleration\n" + "Greater mobility on ice\n" + "Water and lava walking\n" + - "Temporary immunity to lava\n" + - "Provides heat protection in Death Mode"); + "Temporary immunity to lava"); } public override void SetDefaults() @@ -36,6 +37,21 @@ namespace CalamityMod.Items.Accessories.Wings item.Calamity().customRarity = CalamityRarity.DarkBlue; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip9") + { + line2.text = "Temporary immunity to lava\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { if (player.controlJump && player.wingTime > 0f && !player.jumpAgainCloud && player.jump == 0 && player.velocity.Y != 0f && !hideVisual) diff --git a/Items/Accessories/Wings/ElysianWings.cs b/Items/Accessories/Wings/ElysianWings.cs index 56799e89e8..8730a980a7 100644 --- a/Items/Accessories/Wings/ElysianWings.cs +++ b/Items/Accessories/Wings/ElysianWings.cs @@ -1,4 +1,6 @@ using CalamityMod.CalPlayer; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ModLoader; @@ -15,8 +17,7 @@ namespace CalamityMod.Items.Accessories.Wings "Acceleration multiplier: 2.7\n" + "Great vertical speed\n" + "Flight time: 200\n" + - "Temporary immunity to lava and 40% increased movement speed\n" + - "Provides heat protection in Death Mode"); + "Temporary immunity to lava and 40% increased movement speed"); } public override void SetDefaults() @@ -29,6 +30,21 @@ namespace CalamityMod.Items.Accessories.Wings item.accessory = true; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip5") + { + line2.text = "Temporary immunity to lava and 40% increased movement speed\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/Wings/InfinityBoots.cs b/Items/Accessories/Wings/InfinityBoots.cs index 30e1beaae1..df7f25a3cd 100644 --- a/Items/Accessories/Wings/InfinityBoots.cs +++ b/Items/Accessories/Wings/InfinityBoots.cs @@ -1,6 +1,8 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.World; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.Graphics.Shaders; using Terraria.ID; @@ -23,8 +25,7 @@ namespace CalamityMod.Items.Accessories.Wings "24% increased running acceleration\n" + "Greater mobility on ice\n" + "Water and lava walking\n" + - "Temporary immunity to lava\n" + - "Provides heat protection in Death Mode"); + "Temporary immunity to lava"); } public override void SetDefaults() @@ -36,6 +37,21 @@ namespace CalamityMod.Items.Accessories.Wings item.Calamity().customRarity = CalamityRarity.Turquoise; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip9") + { + line2.text = "Temporary immunity to lava\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { if (player.controlJump && player.wingTime > 0f && !player.jumpAgainCloud && player.jump == 0 && player.velocity.Y != 0f && !hideVisual) diff --git a/Items/Accessories/Wings/SoulofCryogen.cs b/Items/Accessories/Wings/SoulofCryogen.cs index 22d6fa0d82..4edba47e34 100644 --- a/Items/Accessories/Wings/SoulofCryogen.cs +++ b/Items/Accessories/Wings/SoulofCryogen.cs @@ -1,5 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Rogue; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; @@ -20,8 +22,7 @@ namespace CalamityMod.Items.Accessories.Wings "Flight time: 120\n" + "7% increase to all damage\n" + "All melee attacks and projectiles inflict frostburn\n" + - "Icicles rain down as you fly\n" + - "Provides heat and cold protection in Death Mode"); + "Icicles rain down as you fly"); Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 3)); } @@ -35,6 +36,21 @@ namespace CalamityMod.Items.Accessories.Wings item.accessory = true; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip8") + { + line2.text = "Icicles rain down as you fly\n" + + "Provides heat and cold protection in Death Mode"; + } + } + } + } + public override void Update(ref float gravity, ref float maxFallSpeed) { float num = (float)Main.rand.Next(90, 111) * 0.01f; diff --git a/Items/Accessories/YharimsInsignia.cs b/Items/Accessories/YharimsInsignia.cs index ad5fdfa204..54df009ba7 100644 --- a/Items/Accessories/YharimsInsignia.cs +++ b/Items/Accessories/YharimsInsignia.cs @@ -1,5 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -17,8 +19,7 @@ namespace CalamityMod.Items.Accessories "Melee attacks and melee projectiles inflict holy fire\n" + "Increased invincibility after taking damage\n" + "Temporary immunity to lava\n" + - "Increased melee knockback\n" + - "Provides heat protection in Death Mode"); + "Increased melee knockback"); } public override void SetDefaults() @@ -30,6 +31,21 @@ namespace CalamityMod.Items.Accessories item.Calamity().customRarity = CalamityRarity.Turquoise; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip6") + { + line2.text = "Increased melee knockback\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Armor/AtaxiaHeadgear.cs b/Items/Armor/AtaxiaHeadgear.cs index fbba6b04f1..fefda8b5b4 100644 --- a/Items/Armor/AtaxiaHeadgear.cs +++ b/Items/Armor/AtaxiaHeadgear.cs @@ -1,5 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -13,8 +15,7 @@ namespace CalamityMod.Items.Armor { DisplayName.SetDefault("Hydrothermic Headgear"); Tooltip.SetDefault("12% increased ranged damage and 10% increased ranged critical strike chance\n" + - "Reduces ammo usage by 25%, temporary immunity to lava, and immunity to fire damage\n" + - "Provides heat protection in Death Mode"); + "Reduces ammo usage by 25%, temporary immunity to lava, and immunity to fire damage"); } public override void SetDefaults() @@ -26,6 +27,21 @@ namespace CalamityMod.Items.Armor item.defense = 15; //53 } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text = "Reduces ammo usage by 25%, temporary immunity to lava, and immunity to fire damage\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/AtaxiaHelm.cs b/Items/Armor/AtaxiaHelm.cs index 40fcb0cd07..2187c89c4d 100644 --- a/Items/Armor/AtaxiaHelm.cs +++ b/Items/Armor/AtaxiaHelm.cs @@ -1,5 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -15,8 +17,7 @@ namespace CalamityMod.Items.Armor Tooltip.SetDefault("12% increased melee damage and 10% increased melee critical strike chance\n" + "12% increased melee and movement speed\n" + "Melee attacks and melee projectiles inflict on fire\n" + - "Temporary immunity to lava and immunity to fire damage\n" + - "Provides heat protection in Death Mode"); + "Temporary immunity to lava and immunity to fire damage"); } public override void SetDefaults() @@ -28,6 +29,21 @@ namespace CalamityMod.Items.Armor item.defense = 25; //67 } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip3") + { + line2.text = "Temporary immunity to lava and immunity to fire damage\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/AtaxiaHelmet.cs b/Items/Armor/AtaxiaHelmet.cs index d29355e319..165ca43cc5 100644 --- a/Items/Armor/AtaxiaHelmet.cs +++ b/Items/Armor/AtaxiaHelmet.cs @@ -2,6 +2,8 @@ using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -16,8 +18,7 @@ namespace CalamityMod.Items.Armor DisplayName.SetDefault("Hydrothermic Helmet"); Tooltip.SetDefault("5% increased minion damage and increased minion knockback\n" + "+2 max minions\n" + - "Temporary immunity to lava and immunity to fire damage\n" + - "Provides heat protection in Death Mode"); + "Temporary immunity to lava and immunity to fire damage"); } public override void SetDefaults() @@ -29,6 +30,21 @@ namespace CalamityMod.Items.Armor item.defense = 6; //40 } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip2") + { + line2.text = "Temporary immunity to lava and immunity to fire damage\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/AtaxiaHood.cs b/Items/Armor/AtaxiaHood.cs index 23330ec8cd..df51b79164 100644 --- a/Items/Armor/AtaxiaHood.cs +++ b/Items/Armor/AtaxiaHood.cs @@ -1,5 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -14,8 +16,7 @@ namespace CalamityMod.Items.Armor DisplayName.SetDefault("Hydrothermic Hood"); Tooltip.SetDefault("12% increased rogue damage and 10% increased rogue critical strike chance\n" + "50% chance to not consume rogue items and 15% increased movement speed\n" + - "Temporary immunity to lava and immunity to fire damage\n" + - "Provides heat protection in Death Mode"); + "Temporary immunity to lava and immunity to fire damage"); } public override void SetDefaults() @@ -27,6 +28,21 @@ namespace CalamityMod.Items.Armor item.defense = 12; //49 } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip2") + { + line2.text = "Temporary immunity to lava and immunity to fire damage\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/AtaxiaMask.cs b/Items/Armor/AtaxiaMask.cs index 4299c241c8..339ae4ff52 100644 --- a/Items/Armor/AtaxiaMask.cs +++ b/Items/Armor/AtaxiaMask.cs @@ -1,5 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -13,8 +15,7 @@ namespace CalamityMod.Items.Armor { DisplayName.SetDefault("Hydrothermic Mask"); Tooltip.SetDefault("12% increased magic damage, reduces mana usage by 15%, and 10% increased magic critical strike chance\n" + - "+100 max mana, temporary immunity to lava, and immunity to fire damage\n" + - "Provides heat protection in Death Mode"); + "+100 max mana, temporary immunity to lava, and immunity to fire damage"); } public override void SetDefaults() @@ -26,6 +27,21 @@ namespace CalamityMod.Items.Armor item.defense = 9; //45 } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text = "Temporary immunity to lava and immunity to fire damage\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/AuricTeslaBodyArmor.cs b/Items/Armor/AuricTeslaBodyArmor.cs index 308688ea12..a64c4cc0ef 100644 --- a/Items/Armor/AuricTeslaBodyArmor.cs +++ b/Items/Armor/AuricTeslaBodyArmor.cs @@ -2,6 +2,8 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ModLoader; @@ -17,8 +19,7 @@ namespace CalamityMod.Items.Armor "25% increased movement speed\n" + "Attacks have a 2% chance to do no damage to you\n" + "8% increased damage and 5% increased critical strike chance\n" + - "You will freeze enemies near you when you are struck\n" + - "Provides heat and cold protection in Death Mode"); + "You will freeze enemies near you when you are struck"); } public override void SetDefaults() @@ -30,6 +31,21 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.Violet; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip4") + { + line2.text = "You will freeze enemies near you when you are struck\n" + + "Provides heat and cold protection in Death Mode"; + } + } + } + } + public override void UpdateEquip(Player player) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Armor/BloodflareHelm.cs b/Items/Armor/BloodflareHelm.cs index 5cb35e9c2f..b606d8a68a 100644 --- a/Items/Armor/BloodflareHelm.cs +++ b/Items/Armor/BloodflareHelm.cs @@ -1,5 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -13,8 +15,7 @@ namespace CalamityMod.Items.Armor { DisplayName.SetDefault("Bloodflare Imp Mask"); Tooltip.SetDefault("You can move freely through liquids and have temporary immunity to lava\n" + - "10% increased rogue damage and critical strike chance, 15% increased movement speed\n" + - "Provides heat protection in Death Mode"); + "10% increased rogue damage and critical strike chance, 15% increased movement speed"); } public override void SetDefaults() @@ -26,6 +27,21 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.PureGreen; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text = "10% increased rogue damage and critical strike chance, 15% increased movement speed\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/BloodflareHelmet.cs b/Items/Armor/BloodflareHelmet.cs index eced0d7cce..b3bb0eee2c 100644 --- a/Items/Armor/BloodflareHelmet.cs +++ b/Items/Armor/BloodflareHelmet.cs @@ -1,5 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -13,8 +15,7 @@ namespace CalamityMod.Items.Armor { DisplayName.SetDefault("Bloodflare Wyvern Helm"); Tooltip.SetDefault("You can move freely through liquids and have temporary immunity to lava\n" + - "+3 max minions\n" + - "Provides heat protection in Death Mode"); + "+3 max minions"); } public override void SetDefaults() @@ -26,6 +27,21 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.PureGreen; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text = "+3 max minions\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/BloodflareHornedHelm.cs b/Items/Armor/BloodflareHornedHelm.cs index 2169c9027f..44987146ec 100644 --- a/Items/Armor/BloodflareHornedHelm.cs +++ b/Items/Armor/BloodflareHornedHelm.cs @@ -1,5 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -13,8 +15,7 @@ namespace CalamityMod.Items.Armor { DisplayName.SetDefault("Bloodflare Horned Helm"); Tooltip.SetDefault("You can move freely through liquids and have temporary immunity to lava\n" + - "10% increased ranged damage and critical strike chance\n" + - "Provides heat protection in Death Mode"); + "10% increased ranged damage and critical strike chance"); } public override void SetDefaults() @@ -26,6 +27,21 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.PureGreen; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text = "10% increased ranged damage and critical strike chance\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/BloodflareHornedMask.cs b/Items/Armor/BloodflareHornedMask.cs index 0b9fcc6490..1e2cf84381 100644 --- a/Items/Armor/BloodflareHornedMask.cs +++ b/Items/Armor/BloodflareHornedMask.cs @@ -1,5 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -13,8 +15,7 @@ namespace CalamityMod.Items.Armor { DisplayName.SetDefault("Bloodflare Hydra Hood"); Tooltip.SetDefault("You can move freely through liquids and have temporary immunity to lava\n" + - "10% increased magic damage and critical strike chance, +100 max mana, and 17% reduced mana usage\n" + - "Provides heat protection in Death Mode"); + "10% increased magic damage and critical strike chance, +100 max mana, and 17% reduced mana usage"); } public override void SetDefaults() @@ -26,6 +27,21 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.PureGreen; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text = "10% increased magic damage and critical strike chance, +100 max mana, and 17% reduced mana usage\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/BloodflareMask.cs b/Items/Armor/BloodflareMask.cs index 6754860b83..563e01663c 100644 --- a/Items/Armor/BloodflareMask.cs +++ b/Items/Armor/BloodflareMask.cs @@ -1,5 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -13,8 +15,7 @@ namespace CalamityMod.Items.Armor { DisplayName.SetDefault("Bloodflare Ram Mask"); Tooltip.SetDefault("You can move freely through liquids and have temporary immunity to lava\n" + - "10% increased melee damage and critical strike chance\n" + - "Provides heat protection in Death Mode"); + "10% increased melee damage and critical strike chance"); } public override void SetDefaults() @@ -26,6 +27,21 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.PureGreen; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text = "10% increased melee damage and critical strike chance\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/FearmongerGreathelm.cs b/Items/Armor/FearmongerGreathelm.cs index 6d7d929d53..1224f14374 100644 --- a/Items/Armor/FearmongerGreathelm.cs +++ b/Items/Armor/FearmongerGreathelm.cs @@ -2,6 +2,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.World; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -52,13 +53,25 @@ namespace CalamityMod.Items.Armor public override void UpdateArmorSet(Player player) { - player.setBonus = @"30% increased minion damage + if (CalamityWorld.death) + { + player.setBonus = @"30% increased minion damage The minion damage nerf while wielding weaponry is reduced Immunity to all forms of frost and flame All minion attacks grant colossal life regeneration 15% increased damage reduction during the Pumpkin and Frost Moons This extra damage reduction ignores the soft cap Provides cold protection in Death Mode"; + } + else + { + player.setBonus = @"30% increased minion damage +The minion damage nerf while wielding weaponry is reduced +Immunity to all forms of frost and flame +All minion attacks grant colossal life regeneration +15% increased damage reduction during the Pumpkin and Frost Moons +This extra damage reduction ignores the soft cap"; + } // This bool encompasses cross-class nerf immunity, colossal life regen on minion attack, and the holiday moon DR player.Calamity().fearmongerSet = true; diff --git a/Items/Armor/SilvaHelm.cs b/Items/Armor/SilvaHelm.cs index 5f410f6923..6b76c3eec1 100644 --- a/Items/Armor/SilvaHelm.cs +++ b/Items/Armor/SilvaHelm.cs @@ -48,8 +48,7 @@ namespace CalamityMod.Items.Armor "Your max life will return to normal if you die\n" + "True melee strikes have a 25% chance to do five times damage\n" + "After the silva invincibility is over you will take 20% less contact damage\n" + - "Melee projectiles have a 25% chance to stun enemies for a very brief moment\n" + - "Provides cold protection in Death Mode"; + "Melee projectiles have a 25% chance to stun enemies for a very brief moment"; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/SilvaHelmet.cs b/Items/Armor/SilvaHelmet.cs index 4eaee1cce4..9cae6f926f 100644 --- a/Items/Armor/SilvaHelmet.cs +++ b/Items/Armor/SilvaHelmet.cs @@ -50,8 +50,7 @@ namespace CalamityMod.Items.Armor "This effect only triggers once per life and if you are reduced to 400 max life the invincibility effect will stop\n" + "Your max life will return to normal if you die\n" + "Summons an ancient leaf prism to blast your enemies with life energy\n" + - "After the silva invulnerability time your minions will deal 10% more damage and you will gain +2 max minions\n" + - "Provides cold protection in Death Mode"; + "After the silva invulnerability time your minions will deal 10% more damage and you will gain +2 max minions"; if (player.whoAmI == Main.myPlayer) { if (player.FindBuffIndex(ModContent.BuffType()) == -1) diff --git a/Items/Armor/SilvaHornedHelm.cs b/Items/Armor/SilvaHornedHelm.cs index 299fa4eeba..0fd7d507e9 100644 --- a/Items/Armor/SilvaHornedHelm.cs +++ b/Items/Armor/SilvaHornedHelm.cs @@ -47,8 +47,7 @@ namespace CalamityMod.Items.Armor "This effect only triggers once per life and if you are reduced to 400 max life the invincibility effect will stop\n" + "Your max life will return to normal if you die\n" + "Increases your rate of fire with all ranged weapons\n" + - "During the silva invulnerability time your ranged weapons will do 40% more damage\n" + - "Provides cold protection in Death Mode"; + "During the silva invulnerability time your ranged weapons will do 40% more damage"; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/SilvaMask.cs b/Items/Armor/SilvaMask.cs index f305f863c5..9d7829e77f 100644 --- a/Items/Armor/SilvaMask.cs +++ b/Items/Armor/SilvaMask.cs @@ -53,8 +53,7 @@ namespace CalamityMod.Items.Armor "Rogue stealth builds while not attacking and slower while moving, up to a max of 125\n" + "Once you have built max stealth, you will be able to perform a Stealth Strike\n" + "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + - "The higher your rogue stealth the higher your rogue damage, crit, and movement speed\n" + - "Provides cold protection in Death Mode"; + "The higher your rogue stealth the higher your rogue damage, crit, and movement speed"; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/SilvaMaskedCap.cs b/Items/Armor/SilvaMaskedCap.cs index 38dd271f2a..fe3aced15a 100644 --- a/Items/Armor/SilvaMaskedCap.cs +++ b/Items/Armor/SilvaMaskedCap.cs @@ -48,8 +48,7 @@ namespace CalamityMod.Items.Armor "This effect only triggers once per life and if you are reduced to 400 max life the invincibility effect will stop\n" + "Your max life will return to normal if you die\n" + "Magic projectiles have a 10% chance to cause a massive explosion on enemy hits\n" + - "After the silva invulnerability time your magic weapons will do 10% more damage\n" + - "Provides cold protection in Death Mode"; + "After the silva invulnerability time your magic weapons will do 10% more damage"; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/TarragonBreastplate.cs b/Items/Armor/TarragonBreastplate.cs index 209474037e..bbb980ad81 100644 --- a/Items/Armor/TarragonBreastplate.cs +++ b/Items/Armor/TarragonBreastplate.cs @@ -11,9 +11,9 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { DisplayName.SetDefault("Tarragon Breastplate"); - Tooltip.SetDefault("10% increased damage and 5% increased critical strike chance\n" + - "+2 life regen and +40 max life\n" + - "Breastplate of the exiler"); + Tooltip.SetDefault("Breastplate of the exiler\n" + + "10% increased damage and 5% increased critical strike chance\n" + + "+2 life regen and +40 max life"); } public override void SetDefaults() diff --git a/Items/Armor/TarragonHelm.cs b/Items/Armor/TarragonHelm.cs index 6e2c995c81..92116f98ca 100644 --- a/Items/Armor/TarragonHelm.cs +++ b/Items/Armor/TarragonHelm.cs @@ -1,5 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -16,8 +18,7 @@ namespace CalamityMod.Items.Armor "Temporary immunity to lava\n" + "Can move freely through liquids\n" + "5% increased damage reduction\n" + - "10% increased melee damage and critical strike chance\n" + - "Provides heat protection in Death Mode"); + "10% increased melee damage and critical strike chance"); } public override void SetDefaults() @@ -29,6 +30,21 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.Turquoise; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip4") + { + line2.text = "10% increased melee damage and critical strike chance\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/TarragonHelmet.cs b/Items/Armor/TarragonHelmet.cs index 9662474c07..ce0d17de40 100644 --- a/Items/Armor/TarragonHelmet.cs +++ b/Items/Armor/TarragonHelmet.cs @@ -1,5 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -15,8 +17,7 @@ namespace CalamityMod.Items.Armor Tooltip.SetDefault("Temporary immunity to lava\n" + "Can move freely through liquids and 12% increased movement speed\n" + "10% increased rogue damage and critical strike chance\n" + - "5% increased damage reduction\n" + - "Provides heat protection in Death Mode"); + "5% increased damage reduction"); } public override void SetDefaults() @@ -28,6 +29,21 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.Turquoise; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip3") + { + line2.text = "5% increased damage reduction\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/TarragonHornedHelm.cs b/Items/Armor/TarragonHornedHelm.cs index be2d471452..92498eb39a 100644 --- a/Items/Armor/TarragonHornedHelm.cs +++ b/Items/Armor/TarragonHornedHelm.cs @@ -1,5 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -14,8 +16,7 @@ namespace CalamityMod.Items.Armor DisplayName.SetDefault("Tarragon Horned Helm"); Tooltip.SetDefault("Temporary immunity to lava\n" + "Can move freely through liquids\n" + - "5% increased damage reduction and +3 max minions\n" + - "Provides heat protection in Death Mode"); + "5% increased damage reduction and +3 max minions"); } public override void SetDefaults() @@ -27,6 +28,21 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.Turquoise; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip2") + { + line2.text = "5% increased damage reduction and +3 max minions\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/TarragonMask.cs b/Items/Armor/TarragonMask.cs index 664773c85f..1f7b49b661 100644 --- a/Items/Armor/TarragonMask.cs +++ b/Items/Armor/TarragonMask.cs @@ -1,5 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -15,8 +17,7 @@ namespace CalamityMod.Items.Armor Tooltip.SetDefault("Temporary immunity to lava\n" + "Can move freely through liquids\n" + "10% increased magic damage and critical strike chance\n" + - "5% increased damage reduction, +100 max mana, and 15% reduced mana usage\n" + - "Provides heat protection in Death Mode"); + "5% increased damage reduction, +100 max mana, and 15% reduced mana usage"); } public override void SetDefaults() @@ -28,6 +29,21 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.Turquoise; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip3") + { + line2.text = "5% increased damage reduction, +100 max mana, and 15% reduced mana usage\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/TarragonVisage.cs b/Items/Armor/TarragonVisage.cs index 604e771624..acf2a59ff7 100644 --- a/Items/Armor/TarragonVisage.cs +++ b/Items/Armor/TarragonVisage.cs @@ -1,5 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -15,8 +17,7 @@ namespace CalamityMod.Items.Armor Tooltip.SetDefault("Temporary immunity to lava\n" + "Can move freely through liquids\n" + "10% increased ranged damage and critical strike chance\n" + - "5% increased damage reduction\n" + - "Provides heat protection in Death Mode"); + "5% increased damage reduction"); } public override void SetDefaults() @@ -28,6 +29,21 @@ namespace CalamityMod.Items.Armor item.Calamity().customRarity = CalamityRarity.Turquoise; } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip3") + { + line2.text = "5% increased damage reduction\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/XerocCuisses.cs b/Items/Armor/XerocCuisses.cs index c0ab2a23e2..6a568d2d42 100644 --- a/Items/Armor/XerocCuisses.cs +++ b/Items/Armor/XerocCuisses.cs @@ -11,9 +11,9 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { DisplayName.SetDefault("Empyrean Cuisses"); - Tooltip.SetDefault("5% increased rogue damage and critical strike chance\n" + - "20% increased movement speed\n" + - "Speed of the cosmos"); + Tooltip.SetDefault("Speed of the cosmos\n" + + "5% increased rogue damage and critical strike chance\n" + + "20% increased movement speed"); } public override void SetDefaults() diff --git a/Items/Armor/XerocMask.cs b/Items/Armor/XerocMask.cs index c1e064b27c..15e13c5c86 100644 --- a/Items/Armor/XerocMask.cs +++ b/Items/Armor/XerocMask.cs @@ -1,5 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.World; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -12,10 +14,9 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { DisplayName.SetDefault("Empyrean Mask"); - Tooltip.SetDefault("11% increased rogue damage and critical strike chance, 22% increased movement speed\n" + - "Temporary immunity to lava\n" + - "Provides heat protection in Death Mode\n" + - "Wrath of the cosmos"); + Tooltip.SetDefault("Wrath of the cosmos\n" + + "11% increased rogue damage and critical strike chance, 22% increased movement speed\n" + + "Temporary immunity to lava"); } public override void SetDefaults() @@ -27,6 +28,21 @@ namespace CalamityMod.Items.Armor item.defense = 20; //71 } + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip2") + { + line2.text = "Temporary immunity to lava\n" + + "Provides heat protection in Death Mode"; + } + } + } + } + public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/XerocPlateMail.cs b/Items/Armor/XerocPlateMail.cs index 3d5091ce9d..93da93177a 100644 --- a/Items/Armor/XerocPlateMail.cs +++ b/Items/Armor/XerocPlateMail.cs @@ -11,10 +11,10 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { DisplayName.SetDefault("Empyrean Cloak"); - Tooltip.SetDefault("+20 max life\n" + + Tooltip.SetDefault("Armor of the cosmos\n" + + "+20 max life\n" + "6% increased movement speed\n" + - "7% increased rogue damage and critical strike chance\n" + - "Armor of the cosmos"); + "7% increased rogue damage and critical strike chance"); } public override void SetDefaults() diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index a039cc81fe..7ed6d28520 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1325,14 +1325,27 @@ namespace CalamityMod.Items } if (item.type == ItemID.WarmthPotion) { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text += "\nMakes you immune to the Chilled, Frozen, and Glacial State debuffs\n" + - "Provides cold protection in Death Mode"; - } - } + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text += "\nMakes you immune to the Chilled, Frozen, and Glacial State debuffs\n" + + "Provides cold protection in Death Mode"; + } + } + } + else + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text += "\nMakes you immune to the Chilled, Frozen, and Glacial State debuffs"; + } + } + } } if (item.type == ItemID.FlaskofVenom) { @@ -1456,15 +1469,29 @@ namespace CalamityMod.Items } if (item.type == ItemID.FireGauntlet) { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip1") - { - line2.text = "14% increased melee damage and speed\n" + - "10% increased true melee damage\n" + - "Provides heat and cold protection in Death Mode"; - } - } + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text = "14% increased melee damage and speed\n" + + "10% increased true melee damage\n" + + "Provides heat and cold protection in Death Mode"; + } + } + } + else + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text = "14% increased melee damage and speed\n" + + "10% increased true melee damage"; + } + } + } } if (item.type == ItemID.SpectreHood) { @@ -1478,41 +1505,69 @@ namespace CalamityMod.Items } if (item.type == ItemID.ObsidianSkinPotion) { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Provides immunity to direct damage from touching lava\n" + - "Provides temporary immunity to lava burn damage\n" + - "Reduces lava burn damage\n" + - "Provides heat protection in Death Mode"; - } - } + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Provides immunity to direct damage from touching lava\n" + + "Provides temporary immunity to lava burn damage\n" + + "Reduces lava burn damage\n" + + "Provides heat protection in Death Mode"; + } + } + } + else + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Provides immunity to direct damage from touching lava\n" + + "Provides temporary immunity to lava burn damage\n" + + "Reduces lava burn damage"; + } + } + } } if (item.type == ItemID.ObsidianRose) { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Reduced direct damage from touching lava\n" + - "Greatly reduces lava burn damage\n" + - "Provides heat protection in Death Mode"; - } - } + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Reduced direct damage from touching lava\n" + + "Greatly reduces lava burn damage\n" + + "Provides heat protection in Death Mode"; + } + } + } + else + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Reduced direct damage from touching lava\n" + + "Greatly reduces lava burn damage"; + } + } + } } - if (item.type == ItemID.MagmaStone) + if (item.type == ItemID.MagmaStone && CalamityWorld.death) { foreach (TooltipLine line2 in tooltips) { if (line2.mod == "Terraria" && line2.Name == "Tooltip0") { - line2.text = "Inflicts fire damage on attack\n" + - "Provides heat and cold protection in Death Mode"; + line2.text += "\nProvides heat and cold protection in Death Mode"; } } } - if (item.type == ItemID.LavaCharm) + if (item.type == ItemID.LavaCharm && CalamityWorld.death) { foreach (TooltipLine line2 in tooltips) { @@ -1522,7 +1577,7 @@ namespace CalamityMod.Items } } } - if (item.type == ItemID.LavaWaders) + if (item.type == ItemID.LavaWaders && CalamityWorld.death) { foreach (TooltipLine line2 in tooltips) { @@ -1795,27 +1850,44 @@ namespace CalamityMod.Items } if (item.type == ItemID.MoltenHelmet || item.type == ItemID.MoltenBreastplate || item.type == ItemID.MoltenGreaves) { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "SetBonus") - { - line2.text = @"Set Bonus: 17% extra melee damage + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "SetBonus") + { + line2.text = @"Set Bonus: 17% extra melee damage 20% extra true melee damage Grants immunity to fire blocks, and temporary immunity to lava Provides heat and cold protection in Death Mode"; - } + } + } + } + else + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "SetBonus") + { + line2.text = @"Set Bonus: 17% extra melee damage +20% extra true melee damage +Grants immunity to fire blocks, and temporary immunity to lava"; + } + } } } if (item.type == ItemID.FrostHelmet || item.type == ItemID.FrostBreastplate || item.type == ItemID.FrostLeggings) { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "SetBonus") - { - line2.text = @"Set Bonus: Melee and ranged attacks cause frostburn -Provides heat and cold protection in Death Mode"; - } - } + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "SetBonus") + { + line2.text += "\nProvides heat and cold protection in Death Mode"; + } + } + } } if (item.type == ItemID.MagicQuiver) { @@ -2952,14 +3024,27 @@ Provides heat and cold protection in Death Mode"; player.statDefense += 2; player.fireWalk = true; player.lavaMax += 180; - player.setBonus = "+2 defense\n" + - "5% increased rogue damage and critical strike chance\n" + - "Grants immunity to fire blocks and temporary immunity to lava\n" + - "Rogue stealth builds while not attacking and not moving, up to a max of 80\n" + - "Once you have built max stealth, you will be able to perform a Stealth Strike\n" + - "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + - "The higher your rogue stealth the higher your rogue damage, crit, and movement speed\n" + - "Provides heat protection in Death Mode"; + if (CalamityWorld.death) + { + player.setBonus = "+2 defense\n" + + "5% increased rogue damage and critical strike chance\n" + + "Grants immunity to fire blocks and temporary immunity to lava\n" + + "Rogue stealth builds while not attacking and not moving, up to a max of 80\n" + + "Once you have built max stealth, you will be able to perform a Stealth Strike\n" + + "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + + "The higher your rogue stealth the higher your rogue damage, crit, and movement speed\n" + + "Provides heat protection in Death Mode"; + } + else + { + player.setBonus = "+2 defense\n" + + "5% increased rogue damage and critical strike chance\n" + + "Grants immunity to fire blocks and temporary immunity to lava\n" + + "Rogue stealth builds while not attacking and not moving, up to a max of 80\n" + + "Once you have built max stealth, you will be able to perform a Stealth Strike\n" + + "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + + "The higher your rogue stealth the higher your rogue damage, crit, and movement speed"; + } } else if (set == "Molten") { @@ -2971,10 +3056,19 @@ Provides heat and cold protection in Death Mode"; modPlayer.eskimoSet = true; player.buffImmune[BuffID.Frostburn] = true; player.buffImmune[ModContent.BuffType()] = true; - player.setBonus = "All ice-themed weapons receive a 10% damage bonus\n" + - "Cold enemies will deal reduced contact damage to the player\n" + - "Provides immunity to the Frostburn and Glacial State debuffs\n" + - "Provides cold immunity in Death Mode"; + if (CalamityWorld.death) + { + player.setBonus = "All ice-themed weapons receive a 10% damage bonus\n" + + "Cold enemies will deal reduced contact damage to the player\n" + + "Provides immunity to the Frostburn and Glacial State debuffs\n" + + "Provides cold immunity in Death Mode"; + } + else + { + player.setBonus = "All ice-themed weapons receive a 10% damage bonus\n" + + "Cold enemies will deal reduced contact damage to the player\n" + + "Provides immunity to the Frostburn and Glacial State debuffs"; + } } else if (set == "Meteor") { diff --git a/Items/Weapons/Summon/ColdDivinity.cs b/Items/Weapons/Summon/ColdDivinity.cs index 9252d4b813..0d9ec8ca41 100644 --- a/Items/Weapons/Summon/ColdDivinity.cs +++ b/Items/Weapons/Summon/ColdDivinity.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Summon; using CalamityMod.Projectiles.Summon; +using CalamityMod.World; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -41,6 +43,22 @@ namespace CalamityMod.Items.Weapons.Summon item.shootSpeed = 10f; item.summon = true; } + + public override void ModifyTooltips(List list) + { + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip6") + { + line2.text = "Provides heat and cold protection in Death Mode when in use\n" + + "Revengeance Drop"; + } + } + } + } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { damage = (int)(damage * player.MinionDamage()); From 419a176499790c3af2af73e022245abfe92a347a Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 9 Jul 2020 12:37:45 -0400 Subject: [PATCH 017/160] fixed firestorm cannon and pumpler --- Items/Weapons/Magic/FaceMelter.cs | 37 ++++++++++++------------- Items/Weapons/Ranged/FirestormCannon.cs | 17 +++++------- Items/Weapons/Ranged/Pumpler.cs | 11 +++++--- 3 files changed, 32 insertions(+), 33 deletions(-) diff --git a/Items/Weapons/Magic/FaceMelter.cs b/Items/Weapons/Magic/FaceMelter.cs index 1a68bc48c9..093acaed14 100644 --- a/Items/Weapons/Magic/FaceMelter.cs +++ b/Items/Weapons/Magic/FaceMelter.cs @@ -39,10 +39,7 @@ namespace CalamityMod.Items.Weapons.Magic item.shootSpeed = 20f; } - public override Vector2? HoldoutOffset() - { - return new Vector2(-15, 0); - } + public override Vector2? HoldoutOffset() => new Vector2(-15, 0); public override void AddRecipes() { @@ -58,31 +55,33 @@ namespace CalamityMod.Items.Weapons.Magic recipe.AddRecipe(); } - public override bool AltFunctionUse(Player player) + public override bool AltFunctionUse(Player player) => true; + + public override bool CanUseItem(Player player) { - return true; + if (player.altFunctionUse == 2) + { + item.useTime = 20; + item.useAnimation = 20; + } + else + { + item.useTime = 5; + item.useAnimation = 10; + } + return base.CanUseItem(player); } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { if (player.altFunctionUse == 2) { - position = Main.MouseWorld; - speedX = 0; - speedY = 0; - item.useTime = 20; - item.useAnimation = 20; - item.reuseDelay = 0; - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); + Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); return false; } else { - item.useTime = 5; - item.useAnimation = 10; - float SpeedX = speedX; - float SpeedY = speedY; - int note = Main.rand.Next(0, 2); + int note = Main.rand.Next(2); if (note == 0) { damage = (int)(damage * 1.5f); @@ -94,7 +93,7 @@ namespace CalamityMod.Items.Weapons.Magic SpeedY *= 1.5f; type = ModContent.ProjectileType(); } - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); return false; } } diff --git a/Items/Weapons/Ranged/FirestormCannon.cs b/Items/Weapons/Ranged/FirestormCannon.cs index a70fae6475..81dc8eafab 100644 --- a/Items/Weapons/Ranged/FirestormCannon.cs +++ b/Items/Weapons/Ranged/FirestormCannon.cs @@ -54,19 +54,16 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool CanUseItem(Player player) { - if (player.altFunctionUse == 2) - { - item.useTime = 27; - item.useAnimation = 27; - } - else - { - item.useTime = 9; - item.useAnimation = 9; - } return base.CanUseItem(player); } + public override float UseTimeMultiplier (Player player) + { + if (player.altFunctionUse == 2) + return (9f/27f); + return 1f; + } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { if (player.altFunctionUse == 2) diff --git a/Items/Weapons/Ranged/Pumpler.cs b/Items/Weapons/Ranged/Pumpler.cs index 1ef6a68d5a..5bad53be0c 100644 --- a/Items/Weapons/Ranged/Pumpler.cs +++ b/Items/Weapons/Ranged/Pumpler.cs @@ -48,19 +48,22 @@ namespace CalamityMod.Items.Weapons.Ranged { if (player.altFunctionUse == 2) { - item.useTime = 36; - item.useAnimation = 36; item.shootSpeed = 4f; } else { - item.useTime = 10; - item.useAnimation = 10; item.shootSpeed = 11f; } return base.CanUseItem(player); } + public override float UseTimeMultiplier (Player player) + { + if (player.altFunctionUse == 2) + return (10f/36f); + return 1f; + } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { if (player.altFunctionUse == 2) From 94ba00d111d7ba4648c3c8fff0554443618b5681 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 9 Jul 2020 13:00:39 -0400 Subject: [PATCH 018/160] fixed plasma caster --- Items/Weapons/DraedonsArsenal/PlasmaCaster.cs | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs index ba26d956f9..1085507fda 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { public class PlasmaCaster : ModItem { - private int BaseDamage = 2800; + private int BaseDamage = 933; public override void SetStaticDefaults() { @@ -42,28 +42,29 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.useAmmo = AmmoID.Bullet; } - public override bool AltFunctionUse(Player player) - { - return true; - } + public override bool AltFunctionUse(Player player) => true; - public override bool CanUseItem(Player player) - { + public override void GetWeaponKnockback(Player player, ref float knockback) + { if (player.altFunctionUse == 2) { - item.useAnimation = 15; - item.useTime = 15; - item.damage = BaseDamage / 3; - item.knockBack = 3f; + knockback *= (3f/7f); } - else - { - item.useAnimation = 45; - item.useTime = 45; - item.damage = BaseDamage; - item.knockBack = 7f; - } - return base.CanUseItem(player); + } + + public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) + { + float damageMult = 0f; + if (player.altFunctionUse != 2) + damageMult = 2f; + mult += damageMult; + } + + public override float UseTimeMultiplier (Player player) + { + if (player.altFunctionUse == 2) + return 3f; + return 1f; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) From b784d4a4b1d87ecd5f873059f6ff58e0b4660c56 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 9 Jul 2020 13:09:45 -0400 Subject: [PATCH 019/160] fixed animus, probably --- CalPlayer/CalamityPlayer.cs | 2 ++ CalPlayer/CalamityPlayerMiscEffects.cs | 5 ++++ Items/Weapons/Melee/Animus.cs | 35 +++++++++++++++----------- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 17d00381a7..859e19b8d0 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -116,6 +116,7 @@ namespace CalamityMod.CalPlayer public double contactDamageReduction = 0D; public double projectileDamageReduction = 0D; public bool brimlashBusterBoost = false; + public float animusBoost = 1f; #endregion #region External variables -- Only set by Mod.Call @@ -2297,6 +2298,7 @@ namespace CalamityMod.CalPlayer KameiBladeUseDelay = 0; lastProjectileHit = null; brimlashBusterBoost = false; + animusBoost = 1f; if (CalamityWorld.bossRushActive) { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index c7a70f66e4..6b636bd73a 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2676,6 +2676,11 @@ namespace CalamityMod.CalPlayer if (player.ActiveItem().type != ModContent.ItemType()) modPlayer.brimlashBusterBoost = false; } + if (modPlayer.animusBoost > 1f) + { + if (player.ActiveItem().type != ModContent.ItemType()) + modPlayer.animusBoost = 1f; + } if (modPlayer.etherealExtorter) { diff --git a/Items/Weapons/Melee/Animus.cs b/Items/Weapons/Melee/Animus.cs index a9a09b298b..217fda9a0d 100644 --- a/Items/Weapons/Melee/Animus.cs +++ b/Items/Weapons/Melee/Animus.cs @@ -43,63 +43,70 @@ namespace CalamityMod.Items.Weapons.Melee recipe.AddRecipe(); } + public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) + { + float damageMult = player.Calamity().animusBoost; + damageMult -= 1f; + mult += damageMult; + } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 6000); - int damageRan = Main.rand.Next(195); //0 to 195 + int damageRan = Main.rand.Next(195); //0 to 194 if (damageRan >= 50 && damageRan <= 99) //25% { - item.damage = 6000; + player.Calamity().animusBoost = 1.5f; } else if (damageRan >= 100 && damageRan <= 139) //20% { - item.damage = 9000; + player.Calamity().animusBoost = 2.25f; } else if (damageRan >= 140 && damageRan <= 169) //15% { - item.damage = 15000; + player.Calamity().animusBoost = 3.75f; } else if (damageRan >= 170 && damageRan <= 189) //10% { - item.damage = 30000; + player.Calamity().animusBoost = 7.5f; } else if (damageRan >= 190 && damageRan <= 194) //5% { - item.damage = 50000; + player.Calamity().animusBoost = 12.5f; } else { - item.damage = 4000; + player.Calamity().animusBoost = 1f; } } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType(), 6000); - int damageRan = Main.rand.Next(195); //0 to 195 + int damageRan = Main.rand.Next(195); //0 to 194 if (damageRan >= 50 && damageRan <= 99) //25% { - item.damage = 6000; + player.Calamity().animusBoost = 1.5f; } else if (damageRan >= 100 && damageRan <= 139) //20% { - item.damage = 9000; + player.Calamity().animusBoost = 2.25f; } else if (damageRan >= 140 && damageRan <= 169) //15% { - item.damage = 15000; + player.Calamity().animusBoost = 3.75f; } else if (damageRan >= 170 && damageRan <= 189) //10% { - item.damage = 30000; + player.Calamity().animusBoost = 7.5f; } else if (damageRan >= 190 && damageRan <= 194) //5% { - item.damage = 50000; + player.Calamity().animusBoost = 12.5f; } else { - item.damage = 4000; + player.Calamity().animusBoost = 1f; } } } From 92c8a441939dbbc5993e014088990edc097734d0 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 9 Jul 2020 13:13:21 -0400 Subject: [PATCH 020/160] compile fix --- Items/Weapons/Magic/FaceMelter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/Weapons/Magic/FaceMelter.cs b/Items/Weapons/Magic/FaceMelter.cs index 093acaed14..156297cc71 100644 --- a/Items/Weapons/Magic/FaceMelter.cs +++ b/Items/Weapons/Magic/FaceMelter.cs @@ -89,8 +89,8 @@ namespace CalamityMod.Items.Weapons.Magic } else { - SpeedX *= 1.5f; - SpeedY *= 1.5f; + speedX *= 1.5f; + speedY *= 1.5f; type = ModContent.ProjectileType(); } Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); From dfbd5b6ab7f23cedd054917b457cd2cacf9aa7d3 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 9 Jul 2020 13:15:40 -0400 Subject: [PATCH 021/160] fixed drat hopefully --- Items/Weapons/Ranged/Drataliornus.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Items/Weapons/Ranged/Drataliornus.cs b/Items/Weapons/Ranged/Drataliornus.cs index b6f437caf7..885b7d96e6 100644 --- a/Items/Weapons/Ranged/Drataliornus.cs +++ b/Items/Weapons/Ranged/Drataliornus.cs @@ -28,9 +28,9 @@ Right click to fire two devastating barrages of five empowered fireballs. item.knockBack = 1f; item.shootSpeed = 18f; item.useStyle = ItemUseStyleID.HoldingOut; - item.useAnimation = 10; - item.useTime = 10; - item.reuseDelay = 0; + item.useAnimation = 24; + item.useTime = 12; + item.reuseDelay = 48; item.width = 64; item.height = 84; item.UseSound = SoundID.Item5; @@ -56,16 +56,10 @@ Right click to fire two devastating barrages of five empowered fireballs. { if (player.altFunctionUse == 2) { - item.useAnimation = 24; - item.useTime = 12; - item.reuseDelay = 48; item.noUseGraphic = false; } else { - item.useAnimation = 9; - item.useTime = 9; - item.reuseDelay = 0; item.noUseGraphic = true; if (player.ownedProjectileCounts[item.shoot] > 0) { @@ -88,7 +82,7 @@ Right click to fire two devastating barrages of five empowered fireballs. { float num8 = index1 - (num4 - 1) / 2; Vector2 vector2_5 = spinningpoint.RotatedBy(num3 * num8, new Vector2()); - Projectile.NewProjectile(position.X + vector2_5.X, position.Y + vector2_5.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 1f, 0f); + Projectile.NewProjectile(position.X + vector2_5.X, position.Y + vector2_5.Y, speedX, speedY, ModContent.ProjectileType(), (int)(damage * 0.69), knockBack, player.whoAmI, 1f, 0f); } } else From e2af0e629f97585d800e1241521d2d1eb7e48e0d Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 9 Jul 2020 13:17:04 -0400 Subject: [PATCH 022/160] nerfed magnomaly cannon --- Items/Weapons/Ranged/MagnomalyCannon.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/MagnomalyCannon.cs b/Items/Weapons/Ranged/MagnomalyCannon.cs index ac425bae1e..4be8f3e949 100644 --- a/Items/Weapons/Ranged/MagnomalyCannon.cs +++ b/Items/Weapons/Ranged/MagnomalyCannon.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 1450; + item.damage = 1019; item.ranged = true; item.width = 84; item.height = 30; From bd4137fb3f89069140f4c642325743a7aa357277 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 9 Jul 2020 13:17:20 -0400 Subject: [PATCH 023/160] Revert "nerfed magnomaly cannon" This reverts commit e2af0e629f97585d800e1241521d2d1eb7e48e0d. --- Items/Weapons/Ranged/MagnomalyCannon.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/MagnomalyCannon.cs b/Items/Weapons/Ranged/MagnomalyCannon.cs index 4be8f3e949..ac425bae1e 100644 --- a/Items/Weapons/Ranged/MagnomalyCannon.cs +++ b/Items/Weapons/Ranged/MagnomalyCannon.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 1019; + item.damage = 1450; item.ranged = true; item.width = 84; item.height = 30; From 10c9eb0eccc6ac69a8ba7bb43441167c9af10870 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 9 Jul 2020 13:18:13 -0400 Subject: [PATCH 024/160] slight deepsea staff nerf --- Items/Weapons/Summon/DeepseaStaff.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Summon/DeepseaStaff.cs b/Items/Weapons/Summon/DeepseaStaff.cs index 5b0e65337e..4e341143a6 100644 --- a/Items/Weapons/Summon/DeepseaStaff.cs +++ b/Items/Weapons/Summon/DeepseaStaff.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 48; + item.damage = 42; item.mana = 10; item.width = 46; item.height = 46; From 45ce0f6a7e47deed21b1bc0cc8de447fc1e1b192 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 9 Jul 2020 13:18:52 -0400 Subject: [PATCH 025/160] nerfed star of destruction --- Items/Weapons/Rogue/StarofDestruction.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/StarofDestruction.cs b/Items/Weapons/Rogue/StarofDestruction.cs index 7187589b87..fb30175d44 100644 --- a/Items/Weapons/Rogue/StarofDestruction.cs +++ b/Items/Weapons/Rogue/StarofDestruction.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = item.height = 94; - item.damage = 175; + item.damage = 150; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 38; From 35d4d8aad745f40edf68fe6a7ce8a2b793dabe2a Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 9 Jul 2020 13:19:58 -0400 Subject: [PATCH 026/160] nerfed fabstaff --- Items/Weapons/Magic/Fabstaff.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Items/Weapons/Magic/Fabstaff.cs b/Items/Weapons/Magic/Fabstaff.cs index 12267f8077..a67186ab49 100644 --- a/Items/Weapons/Magic/Fabstaff.cs +++ b/Items/Weapons/Magic/Fabstaff.cs @@ -13,14 +13,13 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { DisplayName.SetDefault("Fabstaff"); - Tooltip.SetDefault("Casts a bouncing beam that splits when enemies are near it\n" + - "The splitting can trigger long after the beam has vanished"); + Tooltip.SetDefault("Casts a bouncing beam that splits when enemies are near it"); Item.staff[item.type] = true; } public override void SetDefaults() { - item.damage = 880; + item.damage = 616; item.magic = true; item.mana = 50; item.width = 84; From 89c615c2162ca80e78e612c5176308798ca78262 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 9 Jul 2020 13:41:42 -0400 Subject: [PATCH 027/160] fixed plasma caster and adjusted cold divinity --- Items/Weapons/DraedonsArsenal/PlasmaCaster.cs | 24 +++++-------------- Items/Weapons/Summon/ColdDivinity.cs | 8 ++++++- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs index 1085507fda..3912d841b3 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { public class PlasmaCaster : ModItem { - private int BaseDamage = 933; + private int BaseDamage = 2800; public override void SetStaticDefaults() { @@ -44,22 +44,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override bool AltFunctionUse(Player player) => true; - public override void GetWeaponKnockback(Player player, ref float knockback) - { - if (player.altFunctionUse == 2) - { - knockback *= (3f/7f); - } - } - - public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) - { - float damageMult = 0f; - if (player.altFunctionUse != 2) - damageMult = 2f; - mult += damageMult; - } - public override float UseTimeMultiplier (Player player) { if (player.altFunctionUse == 2) @@ -79,14 +63,18 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal int ammoConsumed = 20; float SpeedX = velocity.X + (float)Main.rand.Next(-3, 4) * 0.05f; float SpeedY = velocity.Y + (float)Main.rand.Next(-3, 4) * 0.05f; + float damageMult = 1f; + float kbMult = 1f; if (player.altFunctionUse == 2) { ammoConsumed = 5; SpeedX = velocity.X + (float)Main.rand.Next(-15, 16) * 0.05f; SpeedY = velocity.Y + (float)Main.rand.Next(-15, 16) * 0.05f; + damageMult = 0.3333f; + kbMult = 3f/7f; } - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), (int)(damage * damageMult), knockBack * kbMult, player.whoAmI, 0f, 0f); // Consume 20 or 5 ammo per shot CalamityGlobalItem.ConsumeAdditionalAmmo(player, item, ammoConsumed); diff --git a/Items/Weapons/Summon/ColdDivinity.cs b/Items/Weapons/Summon/ColdDivinity.cs index 0d9ec8ca41..3ab3b708b4 100644 --- a/Items/Weapons/Summon/ColdDivinity.cs +++ b/Items/Weapons/Summon/ColdDivinity.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Summon "These spikes accelerate rapidly towards a nearby enemy to inflict heavy damage\n" + "They take some time to regenerate after launching themselves at the target, however\n" + "On right click, summons a duplicate ring around the targeted enemy, which slowly converges before exploding\n" + + "Minion damage bonuses apply to this weapon twice for more damage\n" + "Revengeance Drop"); Item.staff[item.type] = true; } @@ -59,9 +60,14 @@ namespace CalamityMod.Items.Weapons.Summon } } + public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) + { + add += player.MinionDamage() - 1f; + } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - damage = (int)(damage * player.MinionDamage()); + //damage = (int)(damage * player.MinionDamage()); float totalMinionSlots = 0f; for (int i = 0; i < Main.projectile.Length; i++) { From f3408590feba85b8428223124f7132d3af6e8920 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 9 Jul 2020 13:43:36 -0400 Subject: [PATCH 028/160] probably should be mult based on the prior code --- Items/Weapons/Summon/ColdDivinity.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Summon/ColdDivinity.cs b/Items/Weapons/Summon/ColdDivinity.cs index 3ab3b708b4..5ed2268aed 100644 --- a/Items/Weapons/Summon/ColdDivinity.cs +++ b/Items/Weapons/Summon/ColdDivinity.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) { - add += player.MinionDamage() - 1f; + mult += player.MinionDamage() - 1f; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) From df2ac6ba7ad2db0fd9a8fde94c11398a0c144890 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 9 Jul 2020 14:40:04 -0400 Subject: [PATCH 029/160] fixed cold divinity tooltip --- Items/Weapons/Summon/ColdDivinity.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/Weapons/Summon/ColdDivinity.cs b/Items/Weapons/Summon/ColdDivinity.cs index 5ed2268aed..629807bda4 100644 --- a/Items/Weapons/Summon/ColdDivinity.cs +++ b/Items/Weapons/Summon/ColdDivinity.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Summon { DisplayName.SetDefault("Cold Divinity"); Tooltip.SetDefault("Legendary Drop\n" + - "Summons the power of the ancient ice castle\n" + + "Summons the power of the ancient ice castle\n" + "For each minion slot used, you will gain an additional orbiting shield spike\n" + "These spikes accelerate rapidly towards a nearby enemy to inflict heavy damage\n" + "They take some time to regenerate after launching themselves at the target, however\n" + @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons.Summon { foreach (TooltipLine line2 in list) { - if (line2.mod == "Terraria" && line2.Name == "Tooltip6") + if (line2.mod == "Terraria" && line2.Name == "Tooltip7") { line2.text = "Provides heat and cold protection in Death Mode when in use\n" + "Revengeance Drop"; From f769970436c62827dd1bdfc3ae9bd52b2cadc540 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 9 Jul 2020 20:18:53 -0400 Subject: [PATCH 030/160] fixed bugs with omega blue armor & inverse grav, eye of magnus not doing magic damage, and utensil poker firing too many butcher knives --- Items/Weapons/Rogue/UtensilPoker.cs | 17 +++++++++++------ Projectiles/CalamityGlobalProjectile.cs | 2 +- Projectiles/Magic/MagnusBeam.cs | 1 + Projectiles/Typeless/OmegaBlueTentacle.cs | 6 ------ 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Items/Weapons/Rogue/UtensilPoker.cs b/Items/Weapons/Rogue/UtensilPoker.cs index 700cb0d61e..8b3b8241ab 100644 --- a/Items/Weapons/Rogue/UtensilPoker.cs +++ b/Items/Weapons/Rogue/UtensilPoker.cs @@ -8,13 +8,14 @@ namespace CalamityMod.Items.Weapons.Rogue { public class UtensilPoker : RogueWeapon { + private int counter = 0; public override void SetStaticDefaults() { DisplayName.SetDefault("Utensil Poker"); - Tooltip.SetDefault("Fires random utensils in bursts of three\n" + + Tooltip.SetDefault("Space chickens, that is all.\n" + + "Fires random utensils in bursts of three\n" + "Grants Well Fed on enemy hits\n" + - "Stealth strikes launch an additional butcher knife\n" + - "'Space chickens, that is all.'"); + "Stealth strikes launch an additional butcher knife"); } public override void SafeSetDefaults() @@ -41,9 +42,9 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - if (player.Calamity().StealthStrikeAvailable()) + if (player.Calamity().StealthStrikeAvailable() && counter == 0) { - int stealth = Projectile.NewProjectile(position.X, position.Y, speedX * 1.2f, speedY * 1.2f, ModContent.ProjectileType(), (int)(damage * 1.4), knockBack, Main.myPlayer); + int stealth = Projectile.NewProjectile(position.X, position.Y, speedX * 1.2f, speedY * 1.2f, ModContent.ProjectileType(), (int)(damage * 1.4), knockBack, player.whoAmI); Main.projectile[stealth].Calamity().stealthStrike = true; } int utensil = item.shoot; @@ -69,7 +70,11 @@ namespace CalamityMod.Items.Weapons.Rogue default: break; } - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, utensil, (int)(damage * dmgMult), knockBack * kbMult, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, utensil, (int)(damage * dmgMult), knockBack * kbMult, player.whoAmI); + + counter++; + if (counter >= 3) + counter = 0; return false; } } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 0868ceda1d..10e7cbc28b 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1840,7 +1840,7 @@ namespace CalamityMod.Projectiles public static void DrawCenteredAndAfterimage(Projectile projectile, Color lightColor, int trailingMode, int afterimageCounter, Texture2D texture = null, bool drawCentered = true) { - if (texture == null) + if (texture is null) texture = Main.projectileTexture[projectile.type]; int frameHeight = texture.Height / Main.projFrames[projectile.type]; diff --git a/Projectiles/Magic/MagnusBeam.cs b/Projectiles/Magic/MagnusBeam.cs index d3a4e48a0d..91a963a290 100644 --- a/Projectiles/Magic/MagnusBeam.cs +++ b/Projectiles/Magic/MagnusBeam.cs @@ -23,6 +23,7 @@ namespace CalamityMod.Projectiles.Magic projectile.penetrate = 1; projectile.extraUpdates = 2; projectile.alpha = 0; + projectile.magic = true; } public override void AI() diff --git a/Projectiles/Typeless/OmegaBlueTentacle.cs b/Projectiles/Typeless/OmegaBlueTentacle.cs index c855387dae..b73386a9a5 100644 --- a/Projectiles/Typeless/OmegaBlueTentacle.cs +++ b/Projectiles/Typeless/OmegaBlueTentacle.cs @@ -232,9 +232,6 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp/*.PointWrap*/, DepthStencilState.Default, RasterizerState.CullNone, null, Main.GameViewMatrix.ZoomMatrix); - GameShaders.Armor.ApplySecondary(Main.player[projectile.owner].cBody, Main.player[projectile.owner], new DrawData?()); projectile.rotation = (projectile.Center - segment[5]).ToRotation(); Texture2D texture2D13 = Main.projectileTexture[projectile.type]; @@ -244,9 +241,6 @@ namespace CalamityMod.Projectiles.Typeless Main.spriteBatch.Draw(segmentSprite, segment[i] - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), segmentSprite.Bounds, projectile.GetAlpha(lightColor), 0f, segmentSprite.Bounds.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); } Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), texture2D13.Bounds, projectile.GetAlpha(lightColor), projectile.rotation, texture2D13.Bounds.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); - - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Main.GameViewMatrix.ZoomMatrix); return false; } } From 7f567dfce4aa2868308d1c0c32ee68c8ccb7470f Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 9 Jul 2020 20:59:16 -0400 Subject: [PATCH 031/160] fixed celestus being buggy w/o dark god's sheath or eclipse mirror, and fixed hypothermia only using one of the shard sprites --- Items/Weapons/Rogue/Celestus.cs | 30 ++++++++++++++++----------- Items/Weapons/Rogue/Hypothermia.cs | 4 ++-- Projectiles/Rogue/HypothermiaChunk.cs | 2 +- Projectiles/Rogue/HypothermiaShard.cs | 2 +- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/Items/Weapons/Rogue/Celestus.cs b/Items/Weapons/Rogue/Celestus.cs index 75c4160d02..4db6dd2104 100644 --- a/Items/Weapons/Rogue/Celestus.cs +++ b/Items/Weapons/Rogue/Celestus.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Items.Weapons.Rogue public class Celestus : RogueWeapon { private int counter = 0; + private bool stealthScythes = false; public override void SetStaticDefaults() { @@ -42,21 +43,26 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - counter++; - if (counter >= 3) - counter = 0; - if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage / 2, knockBack, player.whoAmI, 0f, 1f); - Main.projectile[stealth].Calamity().stealthStrike = true; - return false; - } - else if (counter == 1 || counter == 2) - { - return false; + stealthScythes = true; } - return true; + if (stealthScythes) + { + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage / 2, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth].Calamity().stealthStrike = true; + } + else if (counter == 0) + { + Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + } + counter++; + if (counter >= 3) + { + stealthScythes = false; + counter = 0; + } + return false; } public override void AddRecipes() diff --git a/Items/Weapons/Rogue/Hypothermia.cs b/Items/Weapons/Rogue/Hypothermia.cs index 889e1246ea..c9a14b79df 100644 --- a/Items/Weapons/Rogue/Hypothermia.cs +++ b/Items/Weapons/Rogue/Hypothermia.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons.Rogue justStealthStriked = true; return false; } - if (justStealthStriked == true) //this is Ben, no I don't know how what I did translates to what happened in game but we're rolling with it + if (justStealthStriked) //this is Ben, no I don't know how what I did translates to what happened in game but we're rolling with it { if (counter == 1 || counter == 2 || counter == 3 || counter == 4 || counter == 5 || counter == 6) { @@ -75,7 +75,7 @@ namespace CalamityMod.Items.Weapons.Rogue { float SpeedX = speedX + (float)Main.rand.Next(-40, 41) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-40, 41) * 0.05f; - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); + Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, Main.rand.Next(4), 0.0f); } } return false; diff --git a/Projectiles/Rogue/HypothermiaChunk.cs b/Projectiles/Rogue/HypothermiaChunk.cs index f52bc2a2b0..6f2a297435 100644 --- a/Projectiles/Rogue/HypothermiaChunk.cs +++ b/Projectiles/Rogue/HypothermiaChunk.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.tileCollide = true; } - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 191, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default, 0.8f); } diff --git a/Projectiles/Rogue/HypothermiaShard.cs b/Projectiles/Rogue/HypothermiaShard.cs index 583d5f1aca..8c9b3d1ae5 100644 --- a/Projectiles/Rogue/HypothermiaShard.cs +++ b/Projectiles/Rogue/HypothermiaShard.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Rogue counter += 0.25f; if (Main.rand.NextBool(10)) { - int num300 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 191, 0f, 0f, 0, default, 0.8f); + int num300 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 191, 0f, 0f, 0, default, 0.8f); Main.dust[num300].noGravity = true; Main.dust[num300].velocity *= 0.2f; } From 8e68d34bd5be9c0c50f2bd248af759c4ad817cc6 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 9 Jul 2020 21:01:40 -0400 Subject: [PATCH 032/160] changed how hypothermia works --- Items/Weapons/Rogue/Hypothermia.cs | 36 ++++++++---------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/Items/Weapons/Rogue/Hypothermia.cs b/Items/Weapons/Rogue/Hypothermia.cs index c9a14b79df..bcb55e7cf5 100644 --- a/Items/Weapons/Rogue/Hypothermia.cs +++ b/Items/Weapons/Rogue/Hypothermia.cs @@ -11,7 +11,6 @@ namespace CalamityMod.Items.Weapons.Rogue public class Hypothermia : RogueWeapon { private int counter = 0; - private bool justStealthStriked = false; public override void SetStaticDefaults() { @@ -46,38 +45,21 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - counter++; - if (counter >= 7) - counter = 0; - - if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + if (player.Calamity().StealthStrikeAvailable() && counter == 0) { int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[stealth].Calamity().stealthStrike = true; - justStealthStriked = true; - return false; } - if (justStealthStriked) //this is Ben, no I don't know how what I did translates to what happened in game but we're rolling with it + int projAmt = Main.rand.Next(1, 3); + for (int index = 0; index < projAmt; ++index) { - if (counter == 1 || counter == 2 || counter == 3 || counter == 4 || counter == 5 || counter == 6) - { - if (counter == 6) - { - justStealthStriked = false; - } - return false; - } + float SpeedX = speedX + (float)Main.rand.Next(-40, 41) * 0.05f; + float SpeedY = speedY + (float)Main.rand.Next(-40, 41) * 0.05f; + Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, Main.rand.Next(4), 0f); } - else - { - int num6 = Main.rand.Next(1, 3); - for (int index = 0; index < num6; ++index) - { - float SpeedX = speedX + (float)Main.rand.Next(-40, 41) * 0.05f; - float SpeedY = speedY + (float)Main.rand.Next(-40, 41) * 0.05f; - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, Main.rand.Next(4), 0.0f); - } - } + counter++; + if (counter >= 7) + counter = 0; return false; } From bccd7a56baa4eb2d5bb30f097a4d3ed21106b3f5 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 9 Jul 2020 21:02:16 -0400 Subject: [PATCH 033/160] tooltip to update hypothermia's change --- Items/Weapons/Rogue/Hypothermia.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/Hypothermia.cs b/Items/Weapons/Rogue/Hypothermia.cs index bcb55e7cf5..2fac1069c6 100644 --- a/Items/Weapons/Rogue/Hypothermia.cs +++ b/Items/Weapons/Rogue/Hypothermia.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Rogue { DisplayName.SetDefault("Hypothermia"); Tooltip.SetDefault("Fires a constant barrage of black ice shards\n" + - "Stealth strikes launch a chain short ranged ice chunks that shatter into ice shards"); + "Stealth strikes additionally launch a short-ranged ice chunk that shatters into ice shards"); } public override void SafeSetDefaults() From 6bb795461a0d0ad0384ff8826d19ae6b5435754e Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 9 Jul 2020 21:04:09 -0400 Subject: [PATCH 034/160] it's been 5 seconds and I changed my mind already --- Items/Weapons/Rogue/Hypothermia.cs | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/Items/Weapons/Rogue/Hypothermia.cs b/Items/Weapons/Rogue/Hypothermia.cs index 2fac1069c6..75a1075f72 100644 --- a/Items/Weapons/Rogue/Hypothermia.cs +++ b/Items/Weapons/Rogue/Hypothermia.cs @@ -11,12 +11,13 @@ namespace CalamityMod.Items.Weapons.Rogue public class Hypothermia : RogueWeapon { private int counter = 0; + private bool stealthChunks = false; public override void SetStaticDefaults() { DisplayName.SetDefault("Hypothermia"); Tooltip.SetDefault("Fires a constant barrage of black ice shards\n" + - "Stealth strikes additionally launch a short-ranged ice chunk that shatters into ice shards"); + "Stealth strikes launch a chain short ranged ice chunks that shatter into ice shards"); } public override void SafeSetDefaults() @@ -45,21 +46,31 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - if (player.Calamity().StealthStrikeAvailable() && counter == 0) + if (player.Calamity().StealthStrikeAvailable()) //setting up the stealth strikes + { + stealthChunks = true; + } + if (stealthChunks) { int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[stealth].Calamity().stealthStrike = true; } - int projAmt = Main.rand.Next(1, 3); - for (int index = 0; index < projAmt; ++index) + else { - float SpeedX = speedX + (float)Main.rand.Next(-40, 41) * 0.05f; - float SpeedY = speedY + (float)Main.rand.Next(-40, 41) * 0.05f; - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, Main.rand.Next(4), 0f); + int projAmt = Main.rand.Next(1, 3); + for (int index = 0; index < projAmt; ++index) + { + float SpeedX = speedX + (float)Main.rand.Next(-40, 41) * 0.05f; + float SpeedY = speedY + (float)Main.rand.Next(-40, 41) * 0.05f; + Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, Main.rand.Next(4), 0f); + } } counter++; if (counter >= 7) + { counter = 0; + stealthChunks = false; + } return false; } From 9b853cb8637795f45f90a9c5ddefbe1c7d0450bd Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 9 Jul 2020 21:05:54 -0400 Subject: [PATCH 035/160] removed some unnecessary stuff --- Projectiles/Rogue/HypothermiaChunk.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Rogue/HypothermiaChunk.cs b/Projectiles/Rogue/HypothermiaChunk.cs index 6f2a297435..24913c1d81 100644 --- a/Projectiles/Rogue/HypothermiaChunk.cs +++ b/Projectiles/Rogue/HypothermiaChunk.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Rogue } value15.Normalize(); value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int shard = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)((float)projectile.damage * 0.33f), projectile.knockBack * 0.75f, Main.myPlayer, Main.rand.Next(0,4), 1f); + int shard = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.33f), projectile.knockBack * 0.75f, Main.myPlayer, Main.rand.Next(4), 1f); } } } From 1372fbceb71aeb8e85b5abc67de269d29e20cc53 Mon Sep 17 00:00:00 2001 From: DominicKarma42 <51094361+DominicKarma@users.noreply.github.com> Date: Fri, 10 Jul 2020 06:33:12 -0500 Subject: [PATCH 036/160] Fixed omega blue tentacles messing with the game draw state in inverse gravity (again) --- Projectiles/Magic/SubsumingTentacle.cs | 8 ++++---- Projectiles/Typeless/OmegaBlueTentacle.cs | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Projectiles/Magic/SubsumingTentacle.cs b/Projectiles/Magic/SubsumingTentacle.cs index e6ab77c645..3374d189ea 100644 --- a/Projectiles/Magic/SubsumingTentacle.cs +++ b/Projectiles/Magic/SubsumingTentacle.cs @@ -111,8 +111,8 @@ namespace CalamityMod.Projectiles.Magic } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone, null, Main.GameViewMatrix.ZoomMatrix); + spriteBatch.End(); + spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); if (projectile.scale < 1f) { @@ -136,8 +136,8 @@ namespace CalamityMod.Projectiles.Magic } public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) { - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Main.GameViewMatrix.TransformationMatrix); + spriteBatch.End(); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Typeless/OmegaBlueTentacle.cs b/Projectiles/Typeless/OmegaBlueTentacle.cs index b73386a9a5..24bdf104aa 100644 --- a/Projectiles/Typeless/OmegaBlueTentacle.cs +++ b/Projectiles/Typeless/OmegaBlueTentacle.cs @@ -232,6 +232,9 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { + spriteBatch.End(); + spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + GameShaders.Armor.ApplySecondary(Main.player[projectile.owner].cBody, Main.player[projectile.owner], new DrawData?()); projectile.rotation = (projectile.Center - segment[5]).ToRotation(); Texture2D texture2D13 = Main.projectileTexture[projectile.type]; @@ -241,6 +244,9 @@ namespace CalamityMod.Projectiles.Typeless Main.spriteBatch.Draw(segmentSprite, segment[i] - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), segmentSprite.Bounds, projectile.GetAlpha(lightColor), 0f, segmentSprite.Bounds.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); } Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), texture2D13.Bounds, projectile.GetAlpha(lightColor), projectile.rotation, texture2D13.Bounds.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + + spriteBatch.End(); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); return false; } } From 545b1b410d81a57b80502c752b3f039999db493b Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 09:06:51 -0400 Subject: [PATCH 037/160] rtn now only halves defense if it's greater than zero --- CalPlayer/CalamityPlayerMiscEffects.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 6b636bd73a..6a5a5b2b00 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3214,7 +3214,8 @@ namespace CalamityMod.CalPlayer if (modPlayer.reaperToothNecklace) { player.allDamage += 0.25f; - player.statDefense /= 2; + if (player.statDefense > 0) + player.statDefense /= 2; } if (modPlayer.deepDiver) From e7c3609121f9a7ac4b73e0a95f6b5fe89ac5aa45 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 09:24:41 -0400 Subject: [PATCH 038/160] Adjusted heavenly gale --- Items/Weapons/Ranged/HeavenlyGale.cs | 192 +++++++++++++-------------- 1 file changed, 94 insertions(+), 98 deletions(-) diff --git a/Items/Weapons/Ranged/HeavenlyGale.cs b/Items/Weapons/Ranged/HeavenlyGale.cs index e9f0bb684b..fc59264604 100644 --- a/Items/Weapons/Ranged/HeavenlyGale.cs +++ b/Items/Weapons/Ranged/HeavenlyGale.cs @@ -5,109 +5,105 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; namespace CalamityMod.Items.Weapons.Ranged { - public class HeavenlyGale : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Heavenly Gale"); - Tooltip.SetDefault("Fires a barrage of 5 random exo arrows\n" + - "Green exo arrows explode into a tornado on death\n" + - "Blue exo arrows cause a second group of arrows to fire on enemy hits\n" + - "Orange exo arrows cause explosions on death\n" + - "Teal exo arrows ignore enemy immunity frames\n" + - "66% chance to not consume ammo"); - } + public class HeavenlyGale : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Heavenly Gale"); + Tooltip.SetDefault("Fires a barrage of 5 random exo arrows\n" + + "Green exo arrows explode into a tornado on death\n" + + "Blue exo arrows cause a second group of arrows to fire on enemy hits\n" + + "Orange exo arrows cause explosions on death\n" + + "Teal exo arrows ignore enemy immunity frames\n" + + "66% chance to not consume ammo"); + } - public override void SetDefaults() - { - item.damage = 720; - item.ranged = true; - item.width = 44; - item.height = 58; - item.useTime = 11; - item.useAnimation = 22; - item.useStyle = ItemUseStyleID.HoldingOut; - item.noMelee = true; - item.knockBack = 4f; - item.value = Item.buyPrice(2, 50, 0, 0); - item.rare = 10; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - item.shoot = ProjectileID.WoodenArrowFriendly; - item.shootSpeed = 17f; - item.useAmmo = 40; - item.Calamity().customRarity = CalamityRarity.Violet; - } + public override void SetDefaults() + { + item.damage = 720; + item.ranged = true; + item.width = 44; + item.height = 58; + item.useTime = 11; + item.useAnimation = 22; + item.useStyle = ItemUseStyleID.HoldingOut; + item.noMelee = true; + item.knockBack = 4f; + item.value = Item.buyPrice(2, 50, 0, 0); + item.rare = 10; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + item.shoot = ProjectileID.WoodenArrowFriendly; + item.shootSpeed = 17f; + item.useAmmo = AmmoID.Arrow; + item.Calamity().customRarity = CalamityRarity.Violet; + } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float dmg = 1f; - float num117 = 0.314159274f; - int num118 = 5; - Vector2 vector7 = new Vector2(speedX, speedY); - vector7.Normalize(); - vector7 *= 40f; - bool flag11 = Collision.CanHit(vector2, 0, 0, vector2 + vector7, 0, 0); - for (int num119 = 0; num119 < num118; num119++) - { - float num120 = (float)num119 - ((float)num118 - 1f) / 2f; - Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default); - if (!flag11) - { - value9 -= vector7; - } - switch (Main.rand.Next(10)) - { - case 0: - case 1: - case 2: - case 3: - type = ModContent.ProjectileType(); - dmg = 0.16f; - break; - case 4: - case 5: - case 6: - type = ModContent.ProjectileType(); - break; - case 7: - case 8: - type = ModContent.ProjectileType(); - break; - case 9: - type = ModContent.ProjectileType(); - dmg = 0.7f; - break; - } - Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, type, (int)(damage * dmg), knockBack, player.whoAmI, 0.0f, 0.0f); - } - return false; - } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); + float dmgMult = 1f; + float piOver10 = MathHelper.Pi * 0.1f; + int arrowAmt = 5; + Vector2 speed = new Vector2(speedX, speedY); + speed.Normalize(); + speed *= 40f; + bool canHit = Collision.CanHit(source, 0, 0, source + speed, 0, 0); + for (int i = 0; i < arrowAmt; i++) + { + float offsetAmt = i - (arrowAmt - 1f) / 2f; + Vector2 offset = speed.RotatedBy((double)(piOver10 * offsetAmt), default); + if (!canHit) + { + offset -= speed; + } + int arrow = Utils.SelectRandom(Main.rand, new int[] + { + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType() + }); + if (player.ownedProjectileCounts[ProjectileType()] + player.ownedProjectileCounts[ProjectileType()] > 5) + { + arrow = Utils.SelectRandom(Main.rand, new int[] + { + ProjectileType(), + ProjectileType(), + ProjectileType() + }); + } + if (arrow == ProjectileType()) + dmgMult = 0.5f; + Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, speedX, speedY, arrow, (int)(damage * dmgMult), knockBack, player.whoAmI); + } + return false; + } - public override bool ConsumeAmmo(Player player) - { - if (Main.rand.Next(0, 100) < 66) - return false; - return true; - } + public override bool ConsumeAmmo(Player player) + { + if (Main.rand.Next(0, 100) < 66) + return false; + return true; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 4); - recipe.AddTile(ModContent.TileType()); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemType()); + recipe.AddIngredient(ItemType()); + recipe.AddIngredient(ItemType()); + recipe.AddIngredient(ItemType()); + recipe.AddIngredient(ItemType()); + recipe.AddIngredient(ItemType()); + recipe.AddIngredient(ItemType(), 4); + recipe.AddTile(TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } From f518c24eda283067735c58d45c20de28701bd43d Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 09:59:09 -0400 Subject: [PATCH 039/160] archmage now only gives homeless text if he never found a home before --- NPCs/TownNPCs/DILF.cs | 20 +++++++++++--------- World/CalamityWorld.cs | 11 ++++++++--- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/NPCs/TownNPCs/DILF.cs b/NPCs/TownNPCs/DILF.cs index f1839bb6de..f042fc5f0c 100644 --- a/NPCs/TownNPCs/DILF.cs +++ b/NPCs/TownNPCs/DILF.cs @@ -52,19 +52,21 @@ namespace CalamityMod.NPCs.TownNPCs animationType = NPCID.Guide; } - public override bool CanTownNPCSpawn(int numTownNPCs, int money) - { - return CalamityWorld.downedCryogen; - } + public override void AI() + { + if (!CalamityWorld.foundHomePermafrost && !npc.homeless) + { + CalamityWorld.foundHomePermafrost = true; + } + } - public override string TownNPCName() - { - return "Permafrost"; - } + public override bool CanTownNPCSpawn(int numTownNPCs, int money) => CalamityWorld.downedCryogen; + + public override string TownNPCName() => "Permafrost"; public override string GetChat() { - if (npc.homeless) //not sure how to check if he has ever found a home before (to make this dialogue only run when he first spawns) + if (npc.homeless && !CalamityWorld.foundHomePermafrost) { if (Main.rand.NextBool(2)) return "I deeply appreciate you rescuing me from being trapped within my frozen castle... It's been many, many years..."; diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index 293e0294f2..69c5337500 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -138,6 +138,7 @@ namespace CalamityMod.World //Spawned NPCs public static bool spawnedBandit = false; public static bool spawnedCirrus = false; + public static bool foundHomePermafrost = false; #region Downed Bools public static bool downedBossAny = false; //Any boss @@ -218,6 +219,7 @@ namespace CalamityMod.World abyssSide = false; spawnedBandit = false; spawnedCirrus = false; + foundHomePermafrost = false; downedDesertScourge = false; downedAquaticScourge = false; downedHiveMind = false; @@ -362,6 +364,8 @@ namespace CalamityMod.World downed.Add("bandit"); if (spawnedCirrus) downed.Add("drunkPrincess"); + if (foundHomePermafrost) + downed.Add("archmageHome"); if (downedEoCAcidRain) downed.Add("eocRain"); if (downedAquaticScourgeAcidRain) @@ -446,6 +450,7 @@ namespace CalamityMod.World rainingAcid = downed.Contains("acidRain"); spawnedBandit = downed.Contains("bandit"); spawnedCirrus = downed.Contains("drunkPrincess"); + foundHomePermafrost = downed.Contains("archmageHome"); downedEoCAcidRain = downed.Contains("eocRain"); downedAquaticScourgeAcidRain = downed.Contains("hmRain"); triedToSummonOldDuke = downed.Contains("spawnedBoomer"); @@ -546,7 +551,7 @@ namespace CalamityMod.World forcedRainAlready = flags8[0]; forcedDownpourWithTear = flags8[1]; downedSecondSentinels = flags8[2]; - _ = flags8[3]; + foundHomePermafrost = flags8[3]; _ = flags8[4]; _ = flags8[5]; _ = flags8[6]; @@ -637,7 +642,7 @@ namespace CalamityMod.World flags8[0] = forcedRainAlready; flags8[1] = forcedDownpourWithTear; flags8[2] = downedSecondSentinels; - flags8[3] = false; + flags8[3] = foundHomePermafrost; flags8[4] = false; flags8[5] = false; flags8[6] = false; @@ -736,7 +741,7 @@ namespace CalamityMod.World forcedRainAlready = flags8[0]; forcedDownpourWithTear = flags8[1]; downedSecondSentinels = flags8[2]; - _ = flags8[3]; + foundHomePermafrost = flags8[3]; _ = flags8[4]; _ = flags8[5]; _ = flags8[6]; From 104219156381373048aa0f206c202b3a9926ee61 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 10:22:44 -0400 Subject: [PATCH 040/160] reworked blood pact to potentially actually be useful --- CalPlayer/CalamityPlayer.cs | 13 +++++++++++-- CalPlayer/CalamityPlayerLifeRegen.cs | 4 ++++ CalPlayer/CalamityPlayerMiscEffects.cs | 11 +++++++++++ Items/Accessories/BloodPact.cs | 4 +++- Items/Fishing/BrimstoneCragCatches/Bloodfin.cs | 7 ++++++- Items/Potions/Alcohol/GrapeBeer.cs | 7 ++++++- Items/Potions/Alcohol/Margarita.cs | 7 ++++++- Items/Potions/SunkenStew.cs | 7 ++++++- 8 files changed, 53 insertions(+), 7 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index b4188594c8..f84c23571a 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -472,6 +472,7 @@ namespace CalamityMod.CalPlayer public bool fleshTotem = false; public bool fleshTotemCooldown = false; public bool bloodPact = false; + public int bloodPactBuffTimer = 0; public bool bloodflareCore = false; public bool coreOfTheBloodGod = false; public bool elementalHeart = false; @@ -2005,6 +2006,7 @@ namespace CalamityMod.CalPlayer sulphurBubbleCooldown = 0; ladHearts = 0; prismaticLasers = 0; + bloodPactBuffTimer = 0; alcoholPoisoning = false; shadowflame = false; @@ -4127,6 +4129,8 @@ namespace CalamityMod.CalPlayer #region Get Heal Life public override void GetHealLife(Item item, bool quickHeal, ref int healValue) { + if (bloodPactBuffTimer > 0) + healValue = (int)(healValue * 1.5); if (CalamityWorld.ironHeart) healValue = 0; } @@ -7242,8 +7246,13 @@ namespace CalamityMod.CalPlayer (DoGLore ? 0.1 : 0.0) + ((player.beetleDefense && player.beetleOrbs > 0) ? (0.05 * player.beetleOrbs) : 0.0) + (enraged ? 0.25 : 0.0) + - ((CalamityWorld.defiled && Main.rand.NextBool(4)) ? 0.5 : 0.0) + - ((bloodPact && Main.rand.NextBool(4)) ? 1.5 : 0.0); + ((CalamityWorld.defiled && Main.rand.NextBool(4)) ? 0.5 : 0.0); + + if (bloodPact && Main.rand.NextBool(4)) + { + bloodPactBuffTimer = 600; + damageMult += 1.25; + } if (CalamityWorld.revenge) { diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 5899ddd699..0d28656bbb 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -691,6 +691,10 @@ namespace CalamityMod.CalPlayer player.lifeRegen += 2; } if (modPlayer.handWarmer && modPlayer.eskimoSet) + { + player.lifeRegen += 2; + } + if (modPlayer.bloodPactBuffTimer > 0) { player.lifeRegen += 2; } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 6a5a5b2b00..d5ede4a45a 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -988,6 +988,8 @@ namespace CalamityMod.CalPlayer modPlayer.dogTextCooldown--; if (modPlayer.titanCooldown > 0) modPlayer.titanCooldown--; + if (modPlayer.bloodPactBuffTimer > 0) + modPlayer.bloodPactBuffTimer--; // Silva invincibility effects if (modPlayer.silvaCountdown > 0 && modPlayer.hasSilvaEffect && modPlayer.silvaSet) @@ -2516,6 +2518,15 @@ namespace CalamityMod.CalPlayer player.magicQuiver = true; } + if (modPlayer.bloodPactBuffTimer > 0) + { + player.allDamage += 0.05f; + player.statDefense += 20; + player.endurance += 0.1f; + player.longInvince = true; + player.crimsonRegen = true; + } + if (modPlayer.fabsolVodka) { player.allDamage += 0.08f; diff --git a/Items/Accessories/BloodPact.cs b/Items/Accessories/BloodPact.cs index 3526c126d6..034f361058 100644 --- a/Items/Accessories/BloodPact.cs +++ b/Items/Accessories/BloodPact.cs @@ -10,7 +10,9 @@ namespace CalamityMod.Items.Accessories { DisplayName.SetDefault("Blood Pact"); Tooltip.SetDefault("Doubles your max HP\n" + - "Allows you to be critically hit 25% of the time"); + "Allows you to be critically hit 25% of the time\n" + + "After a critical hit, you gain various buffs for ten seconds\n" + + "Any healing potions consumed during this time period heal 50 percent more health"); } public override void SetDefaults() diff --git a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs index a7b68b1b4a..a6fb832623 100644 --- a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs +++ b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs @@ -40,6 +40,8 @@ The life regen boost is stronger if below 75% health"); public override void OnConsumeItem(Player player) { int healAmt = CalamityWorld.ironHeart ? 0 : 240; + if (player.Calamity().bloodPactBuffTimer > 0) + healAmt = (int)(healValue * 1.5); player.statLife += healAmt; if (player.statLife > player.statLifeMax2) { @@ -66,7 +68,10 @@ The life regen boost is stronger if below 75% health"); // Forces the "Restores X life" tooltip to display the actual life restored instead of zero (due to the previous function). public override void ModifyTooltips(List tooltips) { - tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : item.healLife) + " life"; + float healMult = 1f; + if (Main.player[Main.myPlayer].Calamity().bloodPactBuffTimer > 0) + healMult = 1.5f; + tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : (int)(item.healLife * healMult)) + " life"; } } } diff --git a/Items/Potions/Alcohol/GrapeBeer.cs b/Items/Potions/Alcohol/GrapeBeer.cs index 4f0a0bc2f4..6d404e85a1 100644 --- a/Items/Potions/Alcohol/GrapeBeer.cs +++ b/Items/Potions/Alcohol/GrapeBeer.cs @@ -42,6 +42,8 @@ Reduces defense by 2 and movement speed by 5%"); public override void OnConsumeItem(Player player) { int healAmt = CalamityWorld.ironHeart ? 0 : 100; + if (player.Calamity().bloodPactBuffTimer > 0) + healAmt = (int)(healValue * 1.5); player.statLife += healAmt; player.statMana += 100; if (player.statLife > player.statLifeMax2) @@ -71,7 +73,10 @@ Reduces defense by 2 and movement speed by 5%"); // Forces the "Restores X life" tooltip to display the actual life restored instead of zero (due to the previous function). public override void ModifyTooltips(List tooltips) { - tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : item.healLife) + " life"; + float healMult = 1f; + if (Main.player[Main.myPlayer].Calamity().bloodPactBuffTimer > 0) + healMult = 1.5f; + tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : (int)(item.healLife * healMult)) + " life"; } } } diff --git a/Items/Potions/Alcohol/Margarita.cs b/Items/Potions/Alcohol/Margarita.cs index 884fd01e9d..b132dde0bc 100644 --- a/Items/Potions/Alcohol/Margarita.cs +++ b/Items/Potions/Alcohol/Margarita.cs @@ -45,6 +45,8 @@ Reduces defense by 6 and life regen by 1"); public override void OnConsumeItem(Player player) { int healAmt = CalamityWorld.ironHeart ? 0 : 200; + if (player.Calamity().bloodPactBuffTimer > 0) + healAmt = (int)(healValue * 1.5); player.statLife += healAmt; player.statMana += 200; if (player.statLife > player.statLifeMax2) @@ -74,7 +76,10 @@ Reduces defense by 6 and life regen by 1"); // Forces the "Restores X life" tooltip to display the actual life restored instead of zero (due to the previous function). public override void ModifyTooltips(List tooltips) { - tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : item.healLife) + " life"; + float healMult = 1f; + if (Main.player[Main.myPlayer].Calamity().bloodPactBuffTimer > 0) + healMult = 1.5f; + tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : (int)(item.healLife * healMult)) + " life"; } } } diff --git a/Items/Potions/SunkenStew.cs b/Items/Potions/SunkenStew.cs index 3c4ec5bf6a..67e06541af 100644 --- a/Items/Potions/SunkenStew.cs +++ b/Items/Potions/SunkenStew.cs @@ -45,6 +45,8 @@ Grants Well Fed"); public override bool UseItem(Player player) { int healAmt = CalamityWorld.ironHeart ? 0 : 120; + if (player.Calamity().bloodPactBuffTimer > 0) + healAmt = (int)(healValue * 1.5); player.statLife += healAmt; player.statMana += 150; if (player.statLife > player.statLifeMax2) @@ -79,7 +81,10 @@ Grants Well Fed"); // Forces the "Restores X life" tooltip to display the actual life restored instead of zero (due to the previous function). public override void ModifyTooltips(List tooltips) { - tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : item.healLife) + " life"; + float healMult = 1f; + if (Main.player[Main.myPlayer].Calamity().bloodPactBuffTimer > 0) + healMult = 1.5f; + tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : (int)(item.healLife * healMult)) + " life"; } public override void AddRecipes() From 27ff2c40a95d61df5b9f2f33ba031dd1d8676e1e Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 10:25:27 -0400 Subject: [PATCH 041/160] nerfed ultima lasers --- Projectiles/Ranged/UltimaBowProjectile.cs | 2 +- Projectiles/Ranged/UltimaRay.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Projectiles/Ranged/UltimaBowProjectile.cs b/Projectiles/Ranged/UltimaBowProjectile.cs index c5f44980fe..a5b20419e8 100644 --- a/Projectiles/Ranged/UltimaBowProjectile.cs +++ b/Projectiles/Ranged/UltimaBowProjectile.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Ranged { type = ModContent.ProjectileType(); shotVelocity = shotVelocity.RotatedByRandom(0.03f); - damage *= 2; + damage = (int)(damage * 1.5); } // Sometimes fire little sparks if the bow is fully charged. if (Time >= Ultima.FullChargeTime * 0.7f && Main.rand.NextBool(6)) diff --git a/Projectiles/Ranged/UltimaRay.cs b/Projectiles/Ranged/UltimaRay.cs index 43742db73f..cb5707c52f 100644 --- a/Projectiles/Ranged/UltimaRay.cs +++ b/Projectiles/Ranged/UltimaRay.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.arrow = true; projectile.penetrate = -1; projectile.alpha = 255; - projectile.localNPCHitCooldown = 8; + projectile.localNPCHitCooldown = 10; projectile.usesLocalNPCImmunity = true; } public override bool PreAI() From 86ffbb9c6c80fa88c565dab8d800797e11a5f9e2 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 10:41:38 -0400 Subject: [PATCH 042/160] adjusted final dawn --- CalPlayer/CalamityPlayer.cs | 8 +++++++- Projectiles/Rogue/FinalDawnFireSlash.cs | 2 +- Projectiles/Rogue/FinalDawnHorizontalSlash.cs | 4 ++-- Projectiles/Rogue/FinalDawnProjectile.cs | 10 ++++++---- Projectiles/Rogue/FinalDawnThrow.cs | 2 +- Projectiles/Rogue/FinalDawnThrow2.cs | 4 ++-- 6 files changed, 19 insertions(+), 11 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index f84c23571a..677691a490 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -10729,8 +10729,14 @@ namespace CalamityMod.CalPlayer private float UpdateStealthGenStats() { + int finalDawnProjCount = player.ownedProjectileCounts[ModContent.ProjectileType()] + + player.ownedProjectileCounts[ModContent.ProjectileType()] + + player.ownedProjectileCounts[ModContent.ProjectileType()] + + player.ownedProjectileCounts[ModContent.ProjectileType()] + + player.ownedProjectileCounts[ModContent.ProjectileType()]; + // If you are actively using an item, you cannot gain stealth. - if (player.itemAnimation > 0) + if (player.itemAnimation > 0 || finalDawnProjCount > 0) return 0f; // Penumbra Potion provides various boosts to rogue stealth generation diff --git a/Projectiles/Rogue/FinalDawnFireSlash.cs b/Projectiles/Rogue/FinalDawnFireSlash.cs index 18e059abb4..ff28601aa3 100644 --- a/Projectiles/Rogue/FinalDawnFireSlash.cs +++ b/Projectiles/Rogue/FinalDawnFireSlash.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Rogue { Player player = Main.player[projectile.owner]; - if (player.dead || player is null || Main.myPlayer != projectile.owner) + if (player.dead || player is null) projectile.Kill(); player.direction = projectile.direction; diff --git a/Projectiles/Rogue/FinalDawnHorizontalSlash.cs b/Projectiles/Rogue/FinalDawnHorizontalSlash.cs index 5ed9d58eea..63e04254e4 100644 --- a/Projectiles/Rogue/FinalDawnHorizontalSlash.cs +++ b/Projectiles/Rogue/FinalDawnHorizontalSlash.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Rogue { Player player = Main.player[projectile.owner]; - if (player.dead || player is null || Main.myPlayer != projectile.owner) + if (player.dead || player is null) projectile.Kill(); projectile.Center = player.Center; @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.friendly = true; Main.PlaySound(SoundID.Item71, projectile.position); - if(projectile.owner == Main.myPlayer) + if (projectile.owner == Main.myPlayer) { Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage / 2, 0f, projectile.owner); } diff --git a/Projectiles/Rogue/FinalDawnProjectile.cs b/Projectiles/Rogue/FinalDawnProjectile.cs index a7e799af8d..6eba4bb801 100644 --- a/Projectiles/Rogue/FinalDawnProjectile.cs +++ b/Projectiles/Rogue/FinalDawnProjectile.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Rogue { Player player = Main.player[projectile.owner]; - if (player.dead || player is null || Main.myPlayer != projectile.owner) + if (player.dead || player is null) projectile.Kill(); if (Main.myPlayer == player.whoAmI) @@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.NewProjectile(player.Center, player.DirectionTo(Main.MouseWorld) * 38f, ModContent.ProjectileType(), - (int)(projectile.damage * 2.5f), + (int)(projectile.damage * 1.5f), projectile.knockBack, projectile.owner); player.Calamity().ConsumeStealthByAttacking(); @@ -111,6 +111,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.DirectionTo(Main.MouseWorld) * 38f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); + player.Calamity().ConsumeStealthByAttacking(); } } // Close range attack @@ -122,17 +123,18 @@ namespace CalamityMod.Projectiles.Rogue Projectile.NewProjectile(projectile.Center, projectile.velocity, ModContent.ProjectileType(), - (int)(projectile.damage * 2.5f), + (int)(projectile.damage * 1.5f), projectile.knockBack, projectile.owner); player.Calamity().ConsumeStealthByAttacking(); } else { + //This one doesn't consume stealth since it replenishes stealth on hits Projectile.NewProjectile(projectile.Center, projectile.velocity, ModContent.ProjectileType(), - (int)(projectile.damage * 1.5f), + projectile.damage, projectile.knockBack, projectile.owner); } diff --git a/Projectiles/Rogue/FinalDawnThrow.cs b/Projectiles/Rogue/FinalDawnThrow.cs index 9151e544a7..d09dc8400f 100644 --- a/Projectiles/Rogue/FinalDawnThrow.cs +++ b/Projectiles/Rogue/FinalDawnThrow.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Rogue { Player player = Main.player[projectile.owner]; - if (player.dead || player is null || Main.myPlayer != projectile.owner) + if (player.dead || player is null) projectile.Kill(); if (projectile.localAI[0] == 0) diff --git a/Projectiles/Rogue/FinalDawnThrow2.cs b/Projectiles/Rogue/FinalDawnThrow2.cs index 80aa357634..6bb8d51475 100644 --- a/Projectiles/Rogue/FinalDawnThrow2.cs +++ b/Projectiles/Rogue/FinalDawnThrow2.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Rogue Vector2 velocity = Utils.NextVector2Circular(Main.rand, 7.2f, 7.2f); Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), - (int)(projectile.damage * 0.8), projectile.knockBack, projectile.owner, 0f, + (int)(projectile.damage * 0.3), projectile.knockBack, projectile.owner, 0f, target.whoAmI); } HasHitEnemy = true; @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Rogue { Player player = Main.player[projectile.owner]; - if (player.dead || player is null || Main.myPlayer != projectile.owner) + if (player.dead || player is null) projectile.Kill(); if (projectile.localAI[0] == 0) From 4d521092c6aa1275addcc23609849b130ce44837 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 10:44:15 -0400 Subject: [PATCH 043/160] nerfed circlet tornado --- CalPlayer/CalamityPlayer.cs | 2 +- Items/Armor/ForbiddenCirclet.cs | 4 ++-- Projectiles/Rogue/CircletTornado.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 677691a490..27c4e9fcb6 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -2849,7 +2849,7 @@ namespace CalamityMod.CalPlayer plagueReaperCooldown = 1800; if (forbiddenCirclet && forbiddenCooldown <= 0) { - forbiddenCooldown = 20; + forbiddenCooldown = 45; int stormMana = (int)(ForbiddenCirclet.manaCost * player.manaCost); if (player.statMana < stormMana) { diff --git a/Items/Armor/ForbiddenCirclet.cs b/Items/Armor/ForbiddenCirclet.cs index 42a07d15bd..03898e6445 100644 --- a/Items/Armor/ForbiddenCirclet.cs +++ b/Items/Armor/ForbiddenCirclet.cs @@ -8,8 +8,8 @@ namespace CalamityMod.Items.Armor [AutoloadEquip(EquipType.Head)] public class ForbiddenCirclet : ModItem { - public const int manaCost = 50; - public const int tornadoBaseDmg = 100; + public const int manaCost = 60; + public const int tornadoBaseDmg = 80; public const float tornadoBaseKB = 1f; public override void SetStaticDefaults() diff --git a/Projectiles/Rogue/CircletTornado.cs b/Projectiles/Rogue/CircletTornado.cs index 54af35c75c..f3dba7b2d1 100644 --- a/Projectiles/Rogue/CircletTornado.cs +++ b/Projectiles/Rogue/CircletTornado.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.penetrate = -1; projectile.timeLeft = 1200; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 20; + projectile.localNPCHitCooldown = 30; } public override void AI() From d2ddbe55381590b5fa669faff69f394da934aa0f Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 10:50:36 -0400 Subject: [PATCH 044/160] buffed titan heart armor --- CalPlayer/CalamityPlayer.cs | 16 ++++++++++++++++ Items/Armor/TitanHeartBoots.cs | 3 ++- Items/Armor/TitanHeartMantle.cs | 2 +- Items/Armor/TitanHeartMask.cs | 3 ++- Items/Weapons/Rogue/RogueWeapon.cs | 2 +- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 27c4e9fcb6..f1950b8675 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -4519,6 +4519,10 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffID.Midas, 120, false); break;*/ } + if (titanHeartMask) + { + target.AddBuff(ModContent.BuffType(), 60 * Main.rand.Next(1,6), false); // 1 to 5 seconds + } } if (holyWrath) { @@ -4731,6 +4735,10 @@ namespace CalamityMod.CalPlayer target.AddBuff(ModContent.BuffType(), 240, false); } } + if (titanHeartMask) + { + target.AddBuff(ModContent.BuffType(), 60 * Main.rand.Next(1,6), false); // 1 to 5 seconds + } } if (vexation) { @@ -4859,6 +4867,10 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffID.Midas, 120, false); break;*/ } + if (titanHeartMask) + { + target.AddBuff(ModContent.BuffType(), 60 * Main.rand.Next(1,6), false); // 1 to 5 seconds + } } if (holyWrath) { @@ -5066,6 +5078,10 @@ namespace CalamityMod.CalPlayer target.AddBuff(ModContent.BuffType(), 240, false); } } + if (titanHeartMask) + { + target.AddBuff(ModContent.BuffType(), 60 * Main.rand.Next(1,6), false); // 1 to 5 seconds + } } if (vexation) { diff --git a/Items/Armor/TitanHeartBoots.cs b/Items/Armor/TitanHeartBoots.cs index 03bd012f0e..f8e9843ab2 100644 --- a/Items/Armor/TitanHeartBoots.cs +++ b/Items/Armor/TitanHeartBoots.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { DisplayName.SetDefault("Titan Heart Boots"); - Tooltip.SetDefault("10% increased rogue velocity and 5% boosted rogue knockback"); + Tooltip.SetDefault("4% increased rogue damage, 10% increased rogue velocity, and 5% increased rogue knockback"); } public override void SetDefaults() @@ -28,6 +28,7 @@ namespace CalamityMod.Items.Armor { player.Calamity().titanHeartBoots = true; player.Calamity().throwingVelocity += 0.1f; + modPlayer.throwingDamage += 0.04f; } public override void AddRecipes() diff --git a/Items/Armor/TitanHeartMantle.cs b/Items/Armor/TitanHeartMantle.cs index 1b38d8e86d..6b90544891 100644 --- a/Items/Armor/TitanHeartMantle.cs +++ b/Items/Armor/TitanHeartMantle.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Armor { DisplayName.SetDefault("Titan Heart Mantle"); Tooltip.SetDefault("45% chance to not consume rogue items\n" + - "5% boosted rogue knockback but 20% lowered rogue shoot speed"); + "5% boosted rogue knockback but 15% lowered rogue shoot speed"); } public override void SetDefaults() diff --git a/Items/Armor/TitanHeartMask.cs b/Items/Armor/TitanHeartMask.cs index cbba9c0f80..c427c49faf 100644 --- a/Items/Armor/TitanHeartMask.cs +++ b/Items/Armor/TitanHeartMask.cs @@ -13,7 +13,8 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { DisplayName.SetDefault("Titan Heart Mask"); - Tooltip.SetDefault("5% increased rogue damage and knockback"); + Tooltip.SetDefault("5% increased rogue damage and knockback\n" + + "Rogue weapons spread the astral infection"); } public override void SetDefaults() diff --git a/Items/Weapons/Rogue/RogueWeapon.cs b/Items/Weapons/Rogue/RogueWeapon.cs index 2b3318cd0d..c2fffcc0a7 100644 --- a/Items/Weapons/Rogue/RogueWeapon.cs +++ b/Items/Weapons/Rogue/RogueWeapon.cs @@ -93,7 +93,7 @@ namespace CalamityMod.Items.Weapons.Rogue if (player.Calamity().gloveOfRecklessness) rogueAS += 0.2f; if (player.Calamity().titanHeartMantle) - rogueAS -= 0.2f; + rogueAS -= 0.15f; return rogueAS; } From 98b8a9a52b71a1638615d37d7d9d75d842a097da Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 10:52:11 -0400 Subject: [PATCH 045/160] nerfed prismalline --- Items/Weapons/Rogue/Prismalline.cs | 4 ++-- Projectiles/Rogue/PrismallineProj.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Items/Weapons/Rogue/Prismalline.cs b/Items/Weapons/Rogue/Prismalline.cs index bb0c0bbc19..81ff9d8208 100644 --- a/Items/Weapons/Rogue/Prismalline.cs +++ b/Items/Weapons/Rogue/Prismalline.cs @@ -24,9 +24,9 @@ namespace CalamityMod.Items.Weapons.Rogue item.crit += 4; item.noMelee = true; item.noUseGraphic = true; - item.useAnimation = 14; + item.useAnimation = 16; item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 14; + item.useTime = 16; item.knockBack = 5f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Projectiles/Rogue/PrismallineProj.cs b/Projectiles/Rogue/PrismallineProj.cs index 280539286c..adc3098264 100644 --- a/Projectiles/Rogue/PrismallineProj.cs +++ b/Projectiles/Rogue/PrismallineProj.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Rogue speed *= (float)Main.rand.Next(30, 61) * 0.1f * 2f; if (numSpecProj < 2 && !hitEnemy) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speed.X, speed.Y, ModContent.ProjectileType(), (int)(projectile.damage * 1.25), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speed.X, speed.Y, ModContent.ProjectileType(), (int)(projectile.damage * 1.1), projectile.knockBack, projectile.owner, 0f, 0f); ++numSpecProj; } else @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Rogue } speed.Normalize(); speed *= (float)Main.rand.Next(30, 61) * 0.1f * 2f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speed.X, speed.Y, ModContent.ProjectileType(), (int)(projectile.damage * 1.25), projectile.knockBack, projectile.owner, 1f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speed.X, speed.Y, ModContent.ProjectileType(), (int)(projectile.damage * 1.15), projectile.knockBack, projectile.owner, 1f, 0f); } } } From 6b74c64c8c66716194cb6932b85faef4ec55a028 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 12:07:13 -0400 Subject: [PATCH 046/160] defense guardian is no longer immune to Oiled --- NPCs/Providence/ProvSpawnDefense.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/NPCs/Providence/ProvSpawnDefense.cs b/NPCs/Providence/ProvSpawnDefense.cs index f13cdc8d20..404e6df327 100644 --- a/NPCs/Providence/ProvSpawnDefense.cs +++ b/NPCs/Providence/ProvSpawnDefense.cs @@ -46,6 +46,7 @@ namespace CalamityMod.NPCs.Providence npc.buffImmune[BuffID.Ichor] = false; npc.buffImmune[BuffID.CursedInferno] = false; npc.buffImmune[BuffID.StardustMinionBleed] = false; + npc.buffImmune[BuffID.Oiled] = false; npc.buffImmune[BuffID.BetsysCurse] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; From b6ce11c8fb63ffd596aab3abb79a8aa96d33be52 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 12:12:23 -0400 Subject: [PATCH 047/160] adjusted debuff immunities on a few more enemies --- NPCs/Abyss/ColossalSquid.cs | 19 +++++++++++++++- NPCs/Abyss/Reaper.cs | 19 +++++++++++++++- NPCs/GreatSandShark/GreatSandShark.cs | 2 ++ NPCs/NormalNPCs/Horse.cs | 22 ++++++++++++++++++- .../PlaguebringerShade.cs | 1 + NPCs/Polterghast/PolterPhantom.cs | 1 + NPCs/Polterghast/Polterghast.cs | 1 + 7 files changed, 62 insertions(+), 3 deletions(-) diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index 248cd84d61..a8c338cbc4 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -44,7 +44,24 @@ namespace CalamityMod.NPCs.Abyss npc.buffImmune[k] = true; } npc.buffImmune[BuffID.Ichor] = false; - npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[BuffID.Frostburn] = false; + npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[BuffID.Daybreak] = false; + npc.buffImmune[BuffID.StardustMinionBleed] = false; + npc.buffImmune[BuffID.DryadsWardDebuff] = false; + npc.buffImmune[BuffID.Oiled] = false; + npc.buffImmune[BuffID.BetsysCurse] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.timeLeft = NPC.activeTime * 30; npc.value = Item.buyPrice(0, 25, 0, 0); npc.HitSound = SoundID.NPCHit20; diff --git a/NPCs/Abyss/Reaper.cs b/NPCs/Abyss/Reaper.cs index a569c8dadf..0ab539d84a 100644 --- a/NPCs/Abyss/Reaper.cs +++ b/NPCs/Abyss/Reaper.cs @@ -44,7 +44,24 @@ namespace CalamityMod.NPCs.Abyss npc.buffImmune[k] = true; } npc.buffImmune[BuffID.Ichor] = false; - npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[BuffID.Frostburn] = false; + npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[BuffID.Daybreak] = false; + npc.buffImmune[BuffID.StardustMinionBleed] = false; + npc.buffImmune[BuffID.DryadsWardDebuff] = false; + npc.buffImmune[BuffID.Oiled] = false; + npc.buffImmune[BuffID.BetsysCurse] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.timeLeft = NPC.activeTime * 30; npc.value = Item.buyPrice(0, 25, 0, 0); npc.HitSound = SoundID.NPCHit56; diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index 13f47fd4eb..ebc05a0905 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -53,6 +53,7 @@ namespace CalamityMod.NPCs.GreatSandShark npc.buffImmune[BuffID.StardustMinionBleed] = false; npc.buffImmune[BuffID.DryadsWardDebuff] = false; npc.buffImmune[BuffID.Oiled] = false; + npc.buffImmune[BuffID.BetsysCurse] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; @@ -62,6 +63,7 @@ namespace CalamityMod.NPCs.GreatSandShark npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.behindTiles = true; diff --git a/NPCs/NormalNPCs/Horse.cs b/NPCs/NormalNPCs/Horse.cs index cda681d088..aff5a9041d 100644 --- a/NPCs/NormalNPCs/Horse.cs +++ b/NPCs/NormalNPCs/Horse.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Tools.ClimateChange; @@ -40,7 +41,26 @@ namespace CalamityMod.NPCs.NormalNPCs npc.buffImmune[k] = true; } npc.buffImmune[BuffID.Ichor] = false; - npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[BuffID.Frostburn] = false; + npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[BuffID.Daybreak] = false; + npc.buffImmune[BuffID.StardustMinionBleed] = false; + npc.buffImmune[BuffID.DryadsWardDebuff] = false; + npc.buffImmune[BuffID.Oiled] = false; + npc.buffImmune[BuffID.BetsysCurse] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.knockBackResist = 0f; npc.value = Item.buyPrice(0, 1, 50, 0); npc.noGravity = true; diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs index b39009f77d..c239471a9a 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs @@ -61,6 +61,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.noGravity = true; diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index 1290ff6cfc..0de5edf868 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -44,6 +44,7 @@ namespace CalamityMod.NPCs.Polterghast npc.buffImmune[BuffID.CursedInferno] = false; npc.buffImmune[BuffID.Daybreak] = false; npc.buffImmune[BuffID.StardustMinionBleed] = false; + npc.buffImmune[BuffID.BetsysCurse] = false; npc.buffImmune[BuffID.Oiled] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 055755fe2c..d7f442946c 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -67,6 +67,7 @@ namespace CalamityMod.NPCs.Polterghast npc.buffImmune[BuffID.CursedInferno] = false; npc.buffImmune[BuffID.Daybreak] = false; npc.buffImmune[BuffID.StardustMinionBleed] = false; + npc.buffImmune[BuffID.BetsysCurse] = false; npc.buffImmune[BuffID.Oiled] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; From 827015fc15af3a988930d28009f3cc7035084072 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 12:17:54 -0400 Subject: [PATCH 048/160] most stuff susceptible to armor crunch now is susceptible to war cleave --- NPCs/AstrumAureus/AstrumAureus.cs | 1 + NPCs/BrimstoneElemental/Brimling.cs | 3 +++ NPCs/BrimstoneElemental/BrimstoneElemental.cs | 1 + NPCs/Bumblebirb/Bumblefuck.cs | 1 + NPCs/Bumblebirb/Bumblefuck2.cs | 1 + NPCs/Calamitas/Calamitas.cs | 1 + NPCs/Calamitas/CalamitasRun.cs | 1 + NPCs/Calamitas/CalamitasRun2.cs | 1 + NPCs/Calamitas/CalamitasRun3.cs | 1 + NPCs/Calamitas/SoulSeeker.cs | 1 + NPCs/Cryogen/Cryogen.cs | 1 + NPCs/Leviathan/Leviathan.cs | 1 + NPCs/Leviathan/Siren.cs | 1 + NPCs/NormalNPCs/ImpiousImmolator.cs | 1 + NPCs/NormalNPCs/ScornEater.cs | 1 + NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs | 1 + NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs | 1 + NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs | 1 + NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs | 1 + NPCs/Providence/ProvSpawnDefense.cs | 1 + NPCs/Providence/ProvSpawnHealer.cs | 1 + NPCs/Providence/ProvSpawnOffense.cs | 1 + NPCs/Providence/Providence.cs | 1 + NPCs/Ravager/RavagerBody.cs | 1 + NPCs/Ravager/RavagerClawLeft.cs | 1 + NPCs/Ravager/RavagerClawRight.cs | 1 + NPCs/Ravager/RavagerHead.cs | 1 + NPCs/Ravager/RavagerLegLeft.cs | 1 + NPCs/Ravager/RavagerLegRight.cs | 1 + NPCs/Signus/Signus.cs | 1 + 30 files changed, 32 insertions(+) diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index f2f4ab3a78..5e04094fc7 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -74,6 +74,7 @@ namespace CalamityMod.NPCs.AstrumAureus npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; diff --git a/NPCs/BrimstoneElemental/Brimling.cs b/NPCs/BrimstoneElemental/Brimling.cs index ac6ec63800..6393cead33 100644 --- a/NPCs/BrimstoneElemental/Brimling.cs +++ b/NPCs/BrimstoneElemental/Brimling.cs @@ -48,6 +48,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental npc.buffImmune[BuffID.StardustMinionBleed] = false; npc.buffImmune[BuffID.DryadsWardDebuff] = false; npc.buffImmune[BuffID.Oiled] = false; + npc.buffImmune[BuffID.BoneJavelin] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; @@ -57,8 +58,10 @@ namespace CalamityMod.NPCs.BrimstoneElemental npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.noGravity = true; npc.noTileCollide = true; npc.canGhostHeal = false; diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index d141e1810a..4e9be7f37f 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -74,6 +74,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; diff --git a/NPCs/Bumblebirb/Bumblefuck.cs b/NPCs/Bumblebirb/Bumblefuck.cs index e0a45e0a30..297cbd6d0c 100644 --- a/NPCs/Bumblebirb/Bumblefuck.cs +++ b/NPCs/Bumblebirb/Bumblefuck.cs @@ -68,6 +68,7 @@ namespace CalamityMod.NPCs.Bumblebirb npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.boss = true; diff --git a/NPCs/Bumblebirb/Bumblefuck2.cs b/NPCs/Bumblebirb/Bumblefuck2.cs index 5b55047eb6..7e0c591c6d 100644 --- a/NPCs/Bumblebirb/Bumblefuck2.cs +++ b/NPCs/Bumblebirb/Bumblefuck2.cs @@ -49,6 +49,7 @@ namespace CalamityMod.NPCs.Bumblebirb npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.lavaImmune = true; diff --git a/NPCs/Calamitas/Calamitas.cs b/NPCs/Calamitas/Calamitas.cs index 2c9a25d28b..92af87c878 100644 --- a/NPCs/Calamitas/Calamitas.cs +++ b/NPCs/Calamitas/Calamitas.cs @@ -64,6 +64,7 @@ namespace CalamityMod.NPCs.Calamitas npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; diff --git a/NPCs/Calamitas/CalamitasRun.cs b/NPCs/Calamitas/CalamitasRun.cs index 1d1618fbdb..5676b4eff7 100644 --- a/NPCs/Calamitas/CalamitasRun.cs +++ b/NPCs/Calamitas/CalamitasRun.cs @@ -64,6 +64,7 @@ namespace CalamityMod.NPCs.Calamitas npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; diff --git a/NPCs/Calamitas/CalamitasRun2.cs b/NPCs/Calamitas/CalamitasRun2.cs index b3f99c1857..59f73007db 100644 --- a/NPCs/Calamitas/CalamitasRun2.cs +++ b/NPCs/Calamitas/CalamitasRun2.cs @@ -66,6 +66,7 @@ namespace CalamityMod.NPCs.Calamitas npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; diff --git a/NPCs/Calamitas/CalamitasRun3.cs b/NPCs/Calamitas/CalamitasRun3.cs index 525a07add1..dab41f1c2a 100644 --- a/NPCs/Calamitas/CalamitasRun3.cs +++ b/NPCs/Calamitas/CalamitasRun3.cs @@ -78,6 +78,7 @@ namespace CalamityMod.NPCs.Calamitas npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; diff --git a/NPCs/Calamitas/SoulSeeker.cs b/NPCs/Calamitas/SoulSeeker.cs index b4158783dd..f9af2d32ea 100644 --- a/NPCs/Calamitas/SoulSeeker.cs +++ b/NPCs/Calamitas/SoulSeeker.cs @@ -63,6 +63,7 @@ namespace CalamityMod.NPCs.Calamitas npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 6ce5843b65..cf93d7848a 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -79,6 +79,7 @@ namespace CalamityMod.NPCs.Cryogen npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 50ba7c0d68..9f5346ecc2 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -69,6 +69,7 @@ namespace CalamityMod.NPCs.Leviathan npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; diff --git a/NPCs/Leviathan/Siren.cs b/NPCs/Leviathan/Siren.cs index c6253fab8e..65bad2ea29 100644 --- a/NPCs/Leviathan/Siren.cs +++ b/NPCs/Leviathan/Siren.cs @@ -69,6 +69,7 @@ namespace CalamityMod.NPCs.Leviathan npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; diff --git a/NPCs/NormalNPCs/ImpiousImmolator.cs b/NPCs/NormalNPCs/ImpiousImmolator.cs index abd4505594..5def4150d7 100644 --- a/NPCs/NormalNPCs/ImpiousImmolator.cs +++ b/NPCs/NormalNPCs/ImpiousImmolator.cs @@ -50,6 +50,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.value = Item.buyPrice(0, 0, 50, 0); diff --git a/NPCs/NormalNPCs/ScornEater.cs b/NPCs/NormalNPCs/ScornEater.cs index bf44d5a9bb..885319a7fe 100644 --- a/NPCs/NormalNPCs/ScornEater.cs +++ b/NPCs/NormalNPCs/ScornEater.cs @@ -45,6 +45,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.lavaImmune = true; diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 3b4a0d1001..14a4b61a6a 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -80,6 +80,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.noGravity = true; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs index f64a523829..9bd4a810ff 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs @@ -70,6 +70,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.value = Item.buyPrice(0, 25, 0, 0); diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs index 9c5eeadece..e49436ef05 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs @@ -63,6 +63,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.HitSound = SoundID.NPCHit52; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs index 5e20f63e61..08be31b070 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs @@ -63,6 +63,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.HitSound = SoundID.NPCHit52; diff --git a/NPCs/Providence/ProvSpawnDefense.cs b/NPCs/Providence/ProvSpawnDefense.cs index 404e6df327..693765e465 100644 --- a/NPCs/Providence/ProvSpawnDefense.cs +++ b/NPCs/Providence/ProvSpawnDefense.cs @@ -55,6 +55,7 @@ namespace CalamityMod.NPCs.Providence npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.HitSound = SoundID.NPCHit52; diff --git a/NPCs/Providence/ProvSpawnHealer.cs b/NPCs/Providence/ProvSpawnHealer.cs index cdff9f17c6..c96e2456f8 100644 --- a/NPCs/Providence/ProvSpawnHealer.cs +++ b/NPCs/Providence/ProvSpawnHealer.cs @@ -55,6 +55,7 @@ namespace CalamityMod.NPCs.Providence npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.HitSound = SoundID.NPCHit52; diff --git a/NPCs/Providence/ProvSpawnOffense.cs b/NPCs/Providence/ProvSpawnOffense.cs index c3817fdd76..f1d2ecf919 100644 --- a/NPCs/Providence/ProvSpawnOffense.cs +++ b/NPCs/Providence/ProvSpawnOffense.cs @@ -58,6 +58,7 @@ namespace CalamityMod.NPCs.Providence npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.HitSound = SoundID.NPCHit52; diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 8d8152b334..9fc142f7cd 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -91,6 +91,7 @@ namespace CalamityMod.NPCs.Providence npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.noGravity = true; diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index a03b512b93..0b96fbe8b6 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -77,6 +77,7 @@ namespace CalamityMod.NPCs.Ravager npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.boss = true; diff --git a/NPCs/Ravager/RavagerClawLeft.cs b/NPCs/Ravager/RavagerClawLeft.cs index a2b2b97661..75b6fbe069 100644 --- a/NPCs/Ravager/RavagerClawLeft.cs +++ b/NPCs/Ravager/RavagerClawLeft.cs @@ -48,6 +48,7 @@ namespace CalamityMod.NPCs.Ravager npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.noGravity = true; diff --git a/NPCs/Ravager/RavagerClawRight.cs b/NPCs/Ravager/RavagerClawRight.cs index d8ad21ba85..caeafb145c 100644 --- a/NPCs/Ravager/RavagerClawRight.cs +++ b/NPCs/Ravager/RavagerClawRight.cs @@ -48,6 +48,7 @@ namespace CalamityMod.NPCs.Ravager npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.noGravity = true; diff --git a/NPCs/Ravager/RavagerHead.cs b/NPCs/Ravager/RavagerHead.cs index 8bf80ad127..46d19d2639 100644 --- a/NPCs/Ravager/RavagerHead.cs +++ b/NPCs/Ravager/RavagerHead.cs @@ -47,6 +47,7 @@ namespace CalamityMod.NPCs.Ravager npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.noGravity = true; diff --git a/NPCs/Ravager/RavagerLegLeft.cs b/NPCs/Ravager/RavagerLegLeft.cs index 1fc5f5d55e..33f5f05a1c 100644 --- a/NPCs/Ravager/RavagerLegLeft.cs +++ b/NPCs/Ravager/RavagerLegLeft.cs @@ -46,6 +46,7 @@ namespace CalamityMod.NPCs.Ravager npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.noGravity = true; npc.canGhostHeal = false; diff --git a/NPCs/Ravager/RavagerLegRight.cs b/NPCs/Ravager/RavagerLegRight.cs index a9d8ab3e9d..c3d8445d1f 100644 --- a/NPCs/Ravager/RavagerLegRight.cs +++ b/NPCs/Ravager/RavagerLegRight.cs @@ -46,6 +46,7 @@ namespace CalamityMod.NPCs.Ravager npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.noGravity = true; npc.canGhostHeal = false; diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index e276f62f9f..affe7f70fd 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -81,6 +81,7 @@ namespace CalamityMod.NPCs.Signus npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.noGravity = true; From 8806221889c3d82a64272c79aada5d4a5d52a199 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 13:56:33 -0400 Subject: [PATCH 049/160] fixed compile errors --- Projectiles/CalamityGlobalProjectile.cs | 42 +++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 10e7cbc28b..827be3af22 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1199,6 +1199,30 @@ namespace CalamityMod.Projectiles player.HealEffect(1); } + bool otherHealTypes = modPlayer.auricSet || modPlayer.silvaSet || modPlayer.godSlayerMage || modPlayer.tarraMage || modPlayer.ataxiaMage; + + if (projectile.magic && player.ActiveItem().magic) + { + if (modPlayer.manaOverloader && otherHealTypes) + { + if (Main.rand.NextBool(2)) + { + float healMult = 0.2f; + healMult -= projectile.numHits * 0.05f; + float heal = projectile.damage * healMult * (player.statMana / (float)player.statManaMax2); + + if (heal > 50) + heal = 50; + + if (!CanSpawnLifeStealProjectile(projectile, healMult, heal)) + goto OTHEREFFECTS; + + SpawnLifeStealProjectile(projectile, player, heal, ProjectileType(), 1200f, 2f); + goto OTHEREFFECTS; + } + } + } + if (modPlayer.auricSet) { float healMult = 0.05f; @@ -1227,8 +1251,22 @@ namespace CalamityMod.Projectiles SpawnLifeStealProjectile(projectile, player, heal, ProjectileType(), 1200f, 3f); } - else if (projectile.magic) + else if (projectile.magic && player.ActiveItem().magic) { + if (modPlayer.manaOverloader) + { + float healMult = 0.2f; + healMult -= projectile.numHits * 0.05f; + float heal = projectile.damage * healMult * (player.statMana / (float)player.statManaMax2); + + if (heal > 50) + heal = 50; + + if (!CanSpawnLifeStealProjectile(projectile, healMult, heal)) + goto OTHEREFFECTS; + + SpawnLifeStealProjectile(projectile, player, heal, ProjectileType(), 1200f, 2f); + } if (modPlayer.godSlayerMage) { float healMult = 0.06f; @@ -1282,7 +1320,7 @@ namespace CalamityMod.Projectiles SpawnLifeStealProjectile(projectile, player, heal, ProjectileType(), 1200f, 2f); } - else if (modPlayer.manaOverloader && player.inventory[player.selectedItem].magic) + else if (modPlayer.manaOverloader) { float healMult = 0.2f; healMult -= projectile.numHits * 0.05f; From eae6c4980b6dba471dcedde3fbf82aff5ce484a9 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 13:57:12 -0400 Subject: [PATCH 050/160] I think I just swapped the commits and am dumb. Oops --- Items/Armor/TitanHeartBoots.cs | 2 +- Items/Fishing/BrimstoneCragCatches/Bloodfin.cs | 2 +- Items/Potions/Alcohol/GrapeBeer.cs | 2 +- Items/Potions/Alcohol/Margarita.cs | 2 +- Items/Potions/SunkenStew.cs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Items/Armor/TitanHeartBoots.cs b/Items/Armor/TitanHeartBoots.cs index f8e9843ab2..6f5db48111 100644 --- a/Items/Armor/TitanHeartBoots.cs +++ b/Items/Armor/TitanHeartBoots.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Armor { player.Calamity().titanHeartBoots = true; player.Calamity().throwingVelocity += 0.1f; - modPlayer.throwingDamage += 0.04f; + player.Calamity().throwingDamage += 0.04f; } public override void AddRecipes() diff --git a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs index a6fb832623..cda0ac35d7 100644 --- a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs +++ b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs @@ -41,7 +41,7 @@ The life regen boost is stronger if below 75% health"); { int healAmt = CalamityWorld.ironHeart ? 0 : 240; if (player.Calamity().bloodPactBuffTimer > 0) - healAmt = (int)(healValue * 1.5); + healAmt = (int)(healAmt * 1.5); player.statLife += healAmt; if (player.statLife > player.statLifeMax2) { diff --git a/Items/Potions/Alcohol/GrapeBeer.cs b/Items/Potions/Alcohol/GrapeBeer.cs index 6d404e85a1..cb0a8dfeec 100644 --- a/Items/Potions/Alcohol/GrapeBeer.cs +++ b/Items/Potions/Alcohol/GrapeBeer.cs @@ -43,7 +43,7 @@ Reduces defense by 2 and movement speed by 5%"); { int healAmt = CalamityWorld.ironHeart ? 0 : 100; if (player.Calamity().bloodPactBuffTimer > 0) - healAmt = (int)(healValue * 1.5); + healAmt = (int)(healAmt * 1.5); player.statLife += healAmt; player.statMana += 100; if (player.statLife > player.statLifeMax2) diff --git a/Items/Potions/Alcohol/Margarita.cs b/Items/Potions/Alcohol/Margarita.cs index b132dde0bc..ba6f67a029 100644 --- a/Items/Potions/Alcohol/Margarita.cs +++ b/Items/Potions/Alcohol/Margarita.cs @@ -46,7 +46,7 @@ Reduces defense by 6 and life regen by 1"); { int healAmt = CalamityWorld.ironHeart ? 0 : 200; if (player.Calamity().bloodPactBuffTimer > 0) - healAmt = (int)(healValue * 1.5); + healAmt = (int)(healAmt * 1.5); player.statLife += healAmt; player.statMana += 200; if (player.statLife > player.statLifeMax2) diff --git a/Items/Potions/SunkenStew.cs b/Items/Potions/SunkenStew.cs index 67e06541af..1acf2364fd 100644 --- a/Items/Potions/SunkenStew.cs +++ b/Items/Potions/SunkenStew.cs @@ -46,7 +46,7 @@ Grants Well Fed"); { int healAmt = CalamityWorld.ironHeart ? 0 : 120; if (player.Calamity().bloodPactBuffTimer > 0) - healAmt = (int)(healValue * 1.5); + healAmt = (int)(healAmt * 1.5); player.statLife += healAmt; player.statMana += 150; if (player.statLife > player.statLifeMax2) From 9d52aadda11f4228cd4c570a9115103c46951d9e Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 14:06:03 -0400 Subject: [PATCH 051/160] fixed placement of several "head" minions, specifically in inverse gravity --- Projectiles/Summon/CinderBlossom.cs | 6 +++--- Projectiles/Summon/DaedalusCrystal.cs | 13 ++++++------- Projectiles/Summon/FrostBlossom.cs | 6 +++--- Projectiles/Summon/MagicHat.cs | 9 ++++----- Projectiles/Summon/SilvaCrystal.cs | 11 +++++------ Projectiles/Summon/SiriusMinion.cs | 11 +++++------ Projectiles/Summon/SolarGod.cs | 11 +++++------ Projectiles/Summon/SolarPixie.cs | 11 +++++------ Projectiles/Summon/Urchin.cs | 17 ++++++++--------- 9 files changed, 44 insertions(+), 51 deletions(-) diff --git a/Projectiles/Summon/CinderBlossom.cs b/Projectiles/Summon/CinderBlossom.cs index 07467a2734..26a9de3aab 100644 --- a/Projectiles/Summon/CinderBlossom.cs +++ b/Projectiles/Summon/CinderBlossom.cs @@ -47,10 +47,10 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - projectile.Center = Main.player[projectile.owner].Center + Vector2.UnitY * (Main.player[projectile.owner].gfxOffY - 60f); - if (Main.player[projectile.owner].gravDir == -1f) + projectile.Center = player.Center + Vector2.UnitY * (player.gfxOffY - 60f); + if (player.gravDir == -1f) { - projectile.position.Y += 140f; + projectile.position.Y += 120f; } projectile.position.X = (int)projectile.position.X; projectile.position.Y = (int)projectile.position.Y; diff --git a/Projectiles/Summon/DaedalusCrystal.cs b/Projectiles/Summon/DaedalusCrystal.cs index fe02d3ce27..405944e80b 100644 --- a/Projectiles/Summon/DaedalusCrystal.cs +++ b/Projectiles/Summon/DaedalusCrystal.cs @@ -75,19 +75,18 @@ namespace CalamityMod.Projectiles.Summon projectile.damage = damage2; } Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.35f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.75f / 255f); - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2) + Main.player[projectile.owner].gfxOffY - 60f; - if (Main.player[projectile.owner].gravDir == -1f) + projectile.Center = player.Center + Vector2.UnitY * (player.gfxOffY - 60f); + if (player.gravDir == -1f) { - projectile.position.Y = projectile.position.Y + 120f; - projectile.rotation = 3.14f; + projectile.position.Y += 120f; + projectile.rotation = MathHelper.Pi; } else { projectile.rotation = 0f; } - projectile.position.X = (float)(int)projectile.position.X; - projectile.position.Y = (float)(int)projectile.position.Y; + projectile.position.X = (int)projectile.position.X; + projectile.position.Y = (int)projectile.position.Y; float num395 = (float)Main.mouseTextColor / 200f - 0.35f; num395 *= 0.2f; projectile.scale = num395 + 0.95f; diff --git a/Projectiles/Summon/FrostBlossom.cs b/Projectiles/Summon/FrostBlossom.cs index 5b560e459e..6f0b771a20 100644 --- a/Projectiles/Summon/FrostBlossom.cs +++ b/Projectiles/Summon/FrostBlossom.cs @@ -49,10 +49,10 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - projectile.Center = Main.player[projectile.owner].Center + Vector2.UnitY * (Main.player[projectile.owner].gfxOffY - 60f); - if (Main.player[projectile.owner].gravDir == -1f) + projectile.Center = player.Center + Vector2.UnitY * (player.gfxOffY - 60f); + if (player.gravDir == -1f) { - projectile.position.Y += 140f; + projectile.position.Y += 120f; projectile.rotation = MathHelper.Pi; } else diff --git a/Projectiles/Summon/MagicHat.cs b/Projectiles/Summon/MagicHat.cs index 366cb81758..72bd31429f 100644 --- a/Projectiles/Summon/MagicHat.cs +++ b/Projectiles/Summon/MagicHat.cs @@ -57,19 +57,18 @@ namespace CalamityMod.Projectiles.Summon } //projectile movement - projectile.position.X = player.Center.X - (float)(projectile.width / 2); - projectile.position.Y = player.Center.Y - (float)(projectile.height / 2) + player.gfxOffY - 60f; + projectile.Center = player.Center + Vector2.UnitY * (player.gfxOffY - 60f); if (player.gravDir == -1f) { - projectile.position.Y = projectile.position.Y + 150f; + projectile.position.Y += 120f; projectile.rotation = MathHelper.Pi; } else { projectile.rotation = 0f; } - projectile.position.X = (float)(int)projectile.position.X; - projectile.position.Y = (float)(int)projectile.position.Y; + projectile.position.X = (int)projectile.position.X; + projectile.position.Y = (int)projectile.position.Y; //Change the summons scale size a little bit to make it pulse in and out float num395 = (float)Main.mouseTextColor / 200f - 0.35f; diff --git a/Projectiles/Summon/SilvaCrystal.cs b/Projectiles/Summon/SilvaCrystal.cs index c5282b01c8..b6261124df 100644 --- a/Projectiles/Summon/SilvaCrystal.cs +++ b/Projectiles/Summon/SilvaCrystal.cs @@ -67,19 +67,18 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - projectile.position.X = player.Center.X - (float)(projectile.width / 2); - projectile.position.Y = player.Center.Y - (float)(projectile.height / 2) + player.gfxOffY - 60f; + projectile.Center = player.Center + Vector2.UnitY * (player.gfxOffY - 60f); if (player.gravDir == -1f) { - projectile.position.Y = projectile.position.Y + 120f; - projectile.rotation = 3.14f; + projectile.position.Y += 120f; + projectile.rotation = MathHelper.Pi; } else { projectile.rotation = 0f; } - projectile.position.X = (float)(int)projectile.position.X; - projectile.position.Y = (float)(int)projectile.position.Y; + projectile.position.X = (int)projectile.position.X; + projectile.position.Y = (int)projectile.position.Y; float num1072 = 1500f; projectile.velocity = Vector2.Zero; projectile.alpha -= 5; diff --git a/Projectiles/Summon/SiriusMinion.cs b/Projectiles/Summon/SiriusMinion.cs index 44c0368aaf..722fbd2a94 100644 --- a/Projectiles/Summon/SiriusMinion.cs +++ b/Projectiles/Summon/SiriusMinion.cs @@ -50,19 +50,18 @@ namespace CalamityMod.Projectiles.Summon } } projectile.minionSlots = projectile.ai[0]; - projectile.position.X = player.Center.X - (float)(projectile.width / 2); - projectile.position.Y = player.Center.Y - (float)(projectile.height / 2) + player.gfxOffY - 60f; + projectile.Center = player.Center + Vector2.UnitY * (player.gfxOffY - 60f); if (player.gravDir == -1f) { - projectile.position.Y = projectile.position.Y + 150f; - projectile.rotation = 3.14f; + projectile.position.Y += 120f; + projectile.rotation = MathHelper.Pi; } else { projectile.rotation = 0f; } - projectile.position.X = (float)(int)projectile.position.X; - projectile.position.Y = (float)(int)projectile.position.Y; + projectile.position.X = (int)projectile.position.X; + projectile.position.Y = (int)projectile.position.Y; float num395 = (float)Main.mouseTextColor / 200f - 0.35f; num395 *= 0.2f; projectile.scale = num395 + 0.95f; diff --git a/Projectiles/Summon/SolarGod.cs b/Projectiles/Summon/SolarGod.cs index f8ae893fd7..3cae1c7956 100644 --- a/Projectiles/Summon/SolarGod.cs +++ b/Projectiles/Summon/SolarGod.cs @@ -49,19 +49,18 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - projectile.position.X = player.Center.X - (float)(projectile.width / 2); - projectile.position.Y = player.Center.Y - (float)(projectile.height / 2) + player.gfxOffY - 60f; + projectile.Center = player.Center + Vector2.UnitY * (player.gfxOffY - 60f); if (player.gravDir == -1f) { - projectile.position.Y = projectile.position.Y + 150f; - projectile.rotation = 3.14f; + projectile.position.Y += 120f; + projectile.rotation = MathHelper.Pi; } else { projectile.rotation = 0f; } - projectile.position.X = (float)(int)projectile.position.X; - projectile.position.Y = (float)(int)projectile.position.Y; + projectile.position.X = (int)projectile.position.X; + projectile.position.Y = (int)projectile.position.Y; float num395 = (float)Main.mouseTextColor / 200f - 0.35f; num395 *= 0.2f; projectile.scale = num395 + 0.95f; diff --git a/Projectiles/Summon/SolarPixie.cs b/Projectiles/Summon/SolarPixie.cs index 307d0f1830..d234d214b2 100644 --- a/Projectiles/Summon/SolarPixie.cs +++ b/Projectiles/Summon/SolarPixie.cs @@ -49,19 +49,18 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - projectile.position.X = player.Center.X - (float)(projectile.width / 2); - projectile.position.Y = player.Center.Y - (float)(projectile.height / 2) + player.gfxOffY - 60f; + projectile.Center = player.Center + Vector2.UnitY * (player.gfxOffY - 60f); if (player.gravDir == -1f) { - projectile.position.Y = projectile.position.Y + 140f; - projectile.rotation = 3.14f; + projectile.position.Y += 120f; + projectile.rotation = MathHelper.Pi; } else { projectile.rotation = 0f; } - projectile.position.X = (float)(int)projectile.position.X; - projectile.position.Y = (float)(int)projectile.position.Y; + projectile.position.X = (int)projectile.position.X; + projectile.position.Y = (int)projectile.position.Y; float num395 = (float)Main.mouseTextColor / 200f - 0.35f; num395 *= 0.2f; projectile.scale = num395 + 0.95f; diff --git a/Projectiles/Summon/Urchin.cs b/Projectiles/Summon/Urchin.cs index 225bfe34ea..905143753e 100644 --- a/Projectiles/Summon/Urchin.cs +++ b/Projectiles/Summon/Urchin.cs @@ -73,22 +73,21 @@ namespace CalamityMod.Projectiles.Summon player.MinionDamage()); projectile.damage = damage2; } - float num395 = (float)Main.mouseTextColor / 200f - 0.35f; - num395 *= 0.2f; - projectile.scale = num395 + 0.95f; - projectile.position.X = player.Center.X - (float)(projectile.width / 2); - projectile.position.Y = player.Center.Y - (float)(projectile.height / 2) + player.gfxOffY - 60f; + float scalar = (float)Main.mouseTextColor / 200f - 0.35f; + scalar *= 0.2f; + projectile.scale = scalar + 0.95f; + projectile.Center = player.Center + Vector2.UnitY * (player.gfxOffY - 60f); if (player.gravDir == -1f) { - projectile.position.Y = projectile.position.Y + 120f; - projectile.rotation = 3.14f; + projectile.position.Y += 120f; + projectile.rotation = MathHelper.Pi; } else { projectile.rotation = 0f; } - projectile.position.X = (float)(int)projectile.position.X; - projectile.position.Y = (float)(int)projectile.position.Y; + projectile.position.X = (int)projectile.position.X; + projectile.position.Y = (int)projectile.position.Y; if (projectile.owner == Main.myPlayer) { if (projectile.ai[0] != 0f) From d4be089bf4705e01b69063682156192421375dba Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 15:09:43 -0400 Subject: [PATCH 052/160] fixed bug where minions don't do anything if the targeted NPC can't be attacked --- Projectiles/Summon/ApexShark.cs | 2 +- Projectiles/Summon/AstralProbeRound.cs | 39 ++++++++++----- Projectiles/Summon/AstralProbeSummon.cs | 7 ++- Projectiles/Summon/AureusBomber.cs | 2 +- Projectiles/Summon/BabyPlaguebringer.cs | 2 +- Projectiles/Summon/BlackHawkSummon.cs | 2 +- Projectiles/Summon/BloodClotMinion.cs | 2 +- .../Summon/BrimstoneElementalMinion.cs | 4 +- Projectiles/Summon/CalamariInk.cs | 18 ++++++- Projectiles/Summon/CalamariMinion.cs | 8 ++-- Projectiles/Summon/Calamitamini.cs | 2 +- Projectiles/Summon/Cataclymini.cs | 2 +- Projectiles/Summon/ChaosSpirit.cs | 2 +- Projectiles/Summon/CosmicBlast.cs | 42 ++++++++++++++++- Projectiles/Summon/CosmicBlastBig.cs | 43 ++++++++++++++++- Projectiles/Summon/CosmicViperHomingRocket.cs | 16 ++++++- .../Summon/CosmicViperSplittingRocket.cs | 39 ++++++++++++++- Projectiles/Summon/CosmicViperSummon.cs | 7 ++- Projectiles/Summon/CosmilampMinion.cs | 2 +- Projectiles/Summon/DaedalusCrystal.cs | 2 +- Projectiles/Summon/DankCreeperMinion.cs | 2 +- Projectiles/Summon/Dreadmine.cs | 2 +- Projectiles/Summon/DreadmineTurret.cs | 4 +- Projectiles/Summon/EndoCooperBody.cs | 2 +- Projectiles/Summon/EndoIceShard.cs | 2 +- Projectiles/Summon/EnergyOrb.cs | 2 +- Projectiles/Summon/FlameBlast.cs | 42 ++++++++++++++++- Projectiles/Summon/FlameBurst.cs | 42 ++++++++++++++++- Projectiles/Summon/ForbiddenCircletEater.cs | 2 +- Projectiles/Summon/FungalClumpMinion.cs | 2 +- Projectiles/Summon/GastricBelcher.cs | 2 +- Projectiles/Summon/GigaFlareFriendly.cs | 5 +- Projectiles/Summon/HauntedDishes.cs | 2 +- Projectiles/Summon/HermitCrabMinion.cs | 2 +- Projectiles/Summon/Hive.cs | 2 +- Projectiles/Summon/Hiveling.cs | 47 +++++++++++++++++-- Projectiles/Summon/HowlsHeartFireball.cs | 19 +++++++- Projectiles/Summon/HowlsHeartHowl.cs | 5 +- Projectiles/Summon/LanternFlame.cs | 2 +- Projectiles/Summon/MagicAxe.cs | 2 +- Projectiles/Summon/MagicBat.cs | 2 +- Projectiles/Summon/MagicBird.cs | 2 +- Projectiles/Summon/MagicHat.cs | 2 +- Projectiles/Summon/MagicRifle.cs | 2 +- Projectiles/Summon/MagicUmbrella.cs | 4 +- Projectiles/Summon/MiniGuardianAttack.cs | 8 ++-- Projectiles/Summon/MiniGuardianDefense.cs | 8 ++-- Projectiles/Summon/PhantomGuy.cs | 2 +- Projectiles/Summon/PinkButterfly.cs | 7 ++- Projectiles/Summon/PlaguePrincess.cs | 2 +- Projectiles/Summon/PlantSummon.cs | 2 +- Projectiles/Summon/ProfanedEnergy.cs | 2 +- Projectiles/Summon/ReaverOrb.cs | 1 + Projectiles/Summon/SakuraBullet.cs | 16 ++++++- Projectiles/Summon/SandElementalMinion.cs | 2 +- Projectiles/Summon/SandnadoMinion.cs | 2 +- Projectiles/Summon/Shellfish.cs | 2 +- Projectiles/Summon/SiriusMinion.cs | 2 +- Projectiles/Summon/SolarGod.cs | 2 +- Projectiles/Summon/SolarPixie.cs | 2 +- Projectiles/Summon/Spikecrag.cs | 1 + Projectiles/Summon/Urchin.cs | 1 + Projectiles/Summon/VileFeederProjectile.cs | 2 +- Projectiles/Summon/VileFeederSummon.cs | 2 +- Projectiles/Summon/WaterElementalMinion.cs | 2 +- Utilities/CalamityUtils.cs | 4 +- 66 files changed, 416 insertions(+), 101 deletions(-) diff --git a/Projectiles/Summon/ApexShark.cs b/Projectiles/Summon/ApexShark.cs index 3a062aa18b..d42ac52fac 100644 --- a/Projectiles/Summon/ApexShark.cs +++ b/Projectiles/Summon/ApexShark.cs @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag25) { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { diff --git a/Projectiles/Summon/AstralProbeRound.cs b/Projectiles/Summon/AstralProbeRound.cs index 85e23d5049..c16233ed9c 100644 --- a/Projectiles/Summon/AstralProbeRound.cs +++ b/Projectiles/Summon/AstralProbeRound.cs @@ -35,17 +35,13 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { Lighting.AddLight(projectile.Center, 0.3f, 0.5f, 0.1f); - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; if (Main.rand.NextBool(3)) { - int randomDust = Main.rand.Next(2); - if (randomDust == 0) - { - randomDust = ModContent.DustType(); - } - else - { - randomDust = ModContent.DustType(); + int randomDust = Utils.SelectRandom(Main.rand, new int[] + { + ModContent.DustType(), + ModContent.DustType() } int num137 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), 1, 1, randomDust, 0f, 0f, 0, default, 0.5f); Main.dust[num137].alpha = projectile.alpha; @@ -61,9 +57,9 @@ namespace CalamityMod.Projectiles.Summon NPC npc = Main.npc[Main.player[projectile.owner].MinionAttackTargetNPC]; if (npc.CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, npc.Center, 1, 1)) { - float num476 = npc.position.X + (float)(npc.width / 2); - float num477 = npc.position.Y + (float)(npc.height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + float num476 = npc.Center.X; + float num477 = npc.Center.Y; + float num478 = Math.Abs(projectile.Center.X - num476) + Math.Abs(projectile.Center.Y - num477); if (num478 < num474) { num474 = num478; @@ -73,7 +69,24 @@ namespace CalamityMod.Projectiles.Summon } } } - else + else if (projectile.ai[0] != -1f && Main.npc[projectile.ai[0]].active) + { + NPC npc = Main.npc[projectile.ai[0]]; + if (npc.CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, npc.Center, 1, 1)) + { + float num476 = npc.Center.X; + float num477 = npc.Center.Y; + float num478 = Math.Abs(projectile.Center.X - num476) + Math.Abs(projectile.Center.Y - num477); + if (num478 < num474) + { + num474 = num478; + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + if (!flag17) { for (int target = 0; target < Main.npc.Length; target++) { diff --git a/Projectiles/Summon/AstralProbeSummon.cs b/Projectiles/Summon/AstralProbeSummon.cs index dcc163d511..1dc3e65293 100644 --- a/Projectiles/Summon/AstralProbeSummon.cs +++ b/Projectiles/Summon/AstralProbeSummon.cs @@ -79,6 +79,7 @@ namespace CalamityMod.Projectiles.Summon float range = 1000f; Vector2 targetVec = projectile.position; bool foundTarget = false; + int targetIndex = -1; if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; @@ -89,10 +90,11 @@ namespace CalamityMod.Projectiles.Summon { targetVec = npc.Center; foundTarget = true; + targetIndex = npc.whoAmI; } } } - else + if (!foundTarget) { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { @@ -104,6 +106,7 @@ namespace CalamityMod.Projectiles.Summon { targetVec = npc.Center; foundTarget = true; + targetIndex = num645; } } } @@ -147,7 +150,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 velocity = targetVec - projectile.Center; velocity.Normalize(); velocity *= speedMult; - Projectile.NewProjectile(projectile.Center, velocity, projType, projectile.damage, 0f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center, velocity, projType, projectile.damage, 0f, projectile.owner, targetIndex, 0f); projectile.netUpdate = true; } } diff --git a/Projectiles/Summon/AureusBomber.cs b/Projectiles/Summon/AureusBomber.cs index a4be169099..1347dfcbc3 100644 --- a/Projectiles/Summon/AureusBomber.cs +++ b/Projectiles/Summon/AureusBomber.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Summon float idleDistance = vectorToIdlePosition.Length(); //dust effects - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { int index = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0.0f, 0.0f, 100, Color.Transparent, 2f); Main.dust[index].velocity *= 0.3f; diff --git a/Projectiles/Summon/BabyPlaguebringer.cs b/Projectiles/Summon/BabyPlaguebringer.cs index 8355493836..24154ac42b 100644 --- a/Projectiles/Summon/BabyPlaguebringer.cs +++ b/Projectiles/Summon/BabyPlaguebringer.cs @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag25) { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { diff --git a/Projectiles/Summon/BlackHawkSummon.cs b/Projectiles/Summon/BlackHawkSummon.cs index 40336956f6..b507f288dd 100644 --- a/Projectiles/Summon/BlackHawkSummon.cs +++ b/Projectiles/Summon/BlackHawkSummon.cs @@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!foundTarget) { for (int npcIndex = 0; npcIndex < Main.maxNPCs; npcIndex++) { diff --git a/Projectiles/Summon/BloodClotMinion.cs b/Projectiles/Summon/BloodClotMinion.cs index 982d7bd55b..122ab949fa 100644 --- a/Projectiles/Summon/BloodClotMinion.cs +++ b/Projectiles/Summon/BloodClotMinion.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag19) { for (int num542 = 0; num542 < Main.maxNPCs; num542++) { diff --git a/Projectiles/Summon/BrimstoneElementalMinion.cs b/Projectiles/Summon/BrimstoneElementalMinion.cs index 72b6832176..258574dd22 100644 --- a/Projectiles/Summon/BrimstoneElementalMinion.cs +++ b/Projectiles/Summon/BrimstoneElementalMinion.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Summon float num = (float)Main.rand.Next(90, 111) * 0.01f; num *= Main.essScale; Lighting.AddLight(projectile.Center, 1.25f * num, 0f * num, 0.5f * num); - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + if (Math.Abs(projectile.velocity.X) > 0.2f) { projectile.spriteDirection = -projectile.direction; } @@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag25) { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { diff --git a/Projectiles/Summon/CalamariInk.cs b/Projectiles/Summon/CalamariInk.cs index c0c366f779..f0e94cdf87 100644 --- a/Projectiles/Summon/CalamariInk.cs +++ b/Projectiles/Summon/CalamariInk.cs @@ -60,12 +60,26 @@ namespace CalamityMod.Projectiles.Summon } } } - else + else if (Main.npc[projectile.ai[0]].active && projectile.ai[0] != -1f) + { + NPC npc = Main.npc[projectile.ai[0]]; + if (npc.CanBeChasedBy(projectile, false)) + { + float dist = (projectile.Center - npc.Center).Length(); + if (dist < maxHomingRange) + { + targetIdx = projectile.ai[0]; + maxHomingRange = dist; + hasHomingTarget = true; + } + } + } + if (!hasHomingTarget) { for (int i = 0; i < Main.npc.Length; ++i) { NPC npc = Main.npc[i]; - if (npc == null || !npc.active) + if (npc is null || !npc.active) continue; if (npc.CanBeChasedBy(projectile, false)) diff --git a/Projectiles/Summon/CalamariMinion.cs b/Projectiles/Summon/CalamariMinion.cs index e7d201fed8..1dc958cacf 100644 --- a/Projectiles/Summon/CalamariMinion.cs +++ b/Projectiles/Summon/CalamariMinion.cs @@ -141,6 +141,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 center = Main.player[projectile.owner].Center; Vector2 value = new Vector2(0.5f); value.Y = 0f; + int targetIndex = -1; if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; @@ -152,11 +153,11 @@ namespace CalamityMod.Projectiles.Summon { vector = vector2; flag = true; - int num11 = npc.whoAmI; + targetIndex = npc.whoAmI; } } } - else + if (!flag) { for (int k = 0; k < Main.maxNPCs; k++) { @@ -170,6 +171,7 @@ namespace CalamityMod.Projectiles.Summon num10 = num13; vector = vector3; flag = true; + targetIndex = k; } } } @@ -321,7 +323,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 vector7 = vector - projectile.Center; vector7.Normalize(); vector7 *= scaleFactor4; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y + 20, vector7.X, vector7.Y, num28, projectile.damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y + 20, vector7.X, vector7.Y, num28, projectile.damage, 0f, Main.myPlayer, targetIndex, 0f); projectile.netUpdate = true; } } diff --git a/Projectiles/Summon/Calamitamini.cs b/Projectiles/Summon/Calamitamini.cs index e4b66fa0da..cf84bd6ab6 100644 --- a/Projectiles/Summon/Calamitamini.cs +++ b/Projectiles/Summon/Calamitamini.cs @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag25) { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { diff --git a/Projectiles/Summon/Cataclymini.cs b/Projectiles/Summon/Cataclymini.cs index d2a9fcd293..dd725c2304 100644 --- a/Projectiles/Summon/Cataclymini.cs +++ b/Projectiles/Summon/Cataclymini.cs @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag25) { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { diff --git a/Projectiles/Summon/ChaosSpirit.cs b/Projectiles/Summon/ChaosSpirit.cs index d166103b26..3f611ea370 100644 --- a/Projectiles/Summon/ChaosSpirit.cs +++ b/Projectiles/Summon/ChaosSpirit.cs @@ -129,7 +129,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!foundTarget) { for (int k = 0; k < Main.maxNPCs; k++) { diff --git a/Projectiles/Summon/CosmicBlast.cs b/Projectiles/Summon/CosmicBlast.cs index ed589327a3..5e57626bca 100644 --- a/Projectiles/Summon/CosmicBlast.cs +++ b/Projectiles/Summon/CosmicBlast.cs @@ -56,11 +56,27 @@ namespace CalamityMod.Projectiles.Summon float num474 = 1200f; bool flag17 = false; int target = (int)projectile.ai[0]; - if (Main.npc[target].CanBeChasedBy(projectile, false)) + if (player.HasMinionAttackTargetNPC) + { + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false)) + { + float num476 = npc.position.X + (float)(npc.width / 2); + float num477 = npc.position.Y + (float)(npc.height / 2); + float num478 = Math.Abs(projectile.Center.X - num476) + Math.Abs(projectile.Center.Y - num477); + if (num478 < num474) + { + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + else if (Main.npc[target].CanBeChasedBy(projectile, false)) { float num476 = Main.npc[target].position.X + (float)(Main.npc[target].width / 2); float num477 = Main.npc[target].position.Y + (float)(Main.npc[target].height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + float num478 = Math.Abs(projectile.Center.X - num476) + Math.Abs(projectile.Center.Y - num477); if (num478 < num474) { num472 = num476; @@ -68,6 +84,28 @@ namespace CalamityMod.Projectiles.Summon flag17 = true; } } + if (!flag17) + { + for (int i = 0; i < Main.maxNPCs; ++i) + { + NPC npc = Main.npc[i]; + if (npc is null || !npc.active) + continue; + + if (npc.CanBeChasedBy(projectile, false)) + { + float num476 = npc.position.X + (float)(npc.width / 2); + float num477 = npc.position.Y + (float)(npc.height / 2); + float num478 = Math.Abs(projectile.Center.X - num476) + Math.Abs(projectile.Center.Y - num477); + if (num478 < num474) + { + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + } if (flag17) { float num483 = 40f; diff --git a/Projectiles/Summon/CosmicBlastBig.cs b/Projectiles/Summon/CosmicBlastBig.cs index fb140b945c..f9c0eedc9b 100644 --- a/Projectiles/Summon/CosmicBlastBig.cs +++ b/Projectiles/Summon/CosmicBlastBig.cs @@ -30,6 +30,7 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; if (projectile.soundDelay == 0) { projectile.soundDelay = 20 + Main.rand.Next(40); @@ -70,11 +71,27 @@ namespace CalamityMod.Projectiles.Summon float num474 = 600f; bool flag17 = false; int target = (int)projectile.ai[0]; - if (Main.npc[target].CanBeChasedBy(projectile, false)) + if (player.HasMinionAttackTargetNPC) + { + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false)) + { + float num476 = npc.position.X + (float)(npc.width / 2); + float num477 = npc.position.Y + (float)(npc.height / 2); + float num478 = Math.Abs(projectile.Center.X - num476) + Math.Abs(projectile.Center.Y - num477); + if (num478 < num474) + { + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + else if (Main.npc[target].CanBeChasedBy(projectile, false)) { float num476 = Main.npc[target].position.X + (float)(Main.npc[target].width / 2); float num477 = Main.npc[target].position.Y + (float)(Main.npc[target].height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + float num478 = Math.Abs(projectile.Center.X - num476) + Math.Abs(projectile.Center.Y - num477); if (num478 < num474) { num472 = num476; @@ -82,6 +99,28 @@ namespace CalamityMod.Projectiles.Summon flag17 = true; } } + if (!flag17) + { + for (int i = 0; i < Main.maxNPCs; ++i) + { + NPC npc = Main.npc[i]; + if (npc is null || !npc.active) + continue; + + if (npc.CanBeChasedBy(projectile, false)) + { + float num476 = npc.position.X + (float)(npc.width / 2); + float num477 = npc.position.Y + (float)(npc.height / 2); + float num478 = Math.Abs(projectile.Center.X - num476) + Math.Abs(projectile.Center.Y - num477); + if (num478 < num474) + { + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + } if (flag17) { float num483 = 45f; diff --git a/Projectiles/Summon/CosmicViperHomingRocket.cs b/Projectiles/Summon/CosmicViperHomingRocket.cs index 0c7f58939b..5ab0f6a362 100644 --- a/Projectiles/Summon/CosmicViperHomingRocket.cs +++ b/Projectiles/Summon/CosmicViperHomingRocket.cs @@ -71,7 +71,21 @@ namespace CalamityMod.Projectiles.Summon } } } - else + else if (Main.npc[projectile.ai[0]].active && projectile.ai[0] != -1f) + { + NPC npc = Main.npc[projectile.ai[0]]; + if (npc.CanBeChasedBy(projectile, false)) + { + float extraDistance = (float)(npc.width / 2) + (float)(npc.height / 2); + + if (Vector2.Distance(npc.Center, projectile.Center) < (maxDistance + extraDistance)) + { + center = npc.Center; + homeIn = true; + } + } + } + if (!homeIn) { for (int i = 0; i < Main.maxNPCs; i++) { diff --git a/Projectiles/Summon/CosmicViperSplittingRocket.cs b/Projectiles/Summon/CosmicViperSplittingRocket.cs index c02d45b6e2..519a7581e3 100644 --- a/Projectiles/Summon/CosmicViperSplittingRocket.cs +++ b/Projectiles/Summon/CosmicViperSplittingRocket.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Summon } speed.Normalize(); speed *= (float)Main.rand.Next(30, 61) * 0.1f * 2f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speed.X, speed.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.25), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speed.X, speed.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.25), projectile.knockBack, projectile.owner, 0f, 0f); } } Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); @@ -76,7 +76,42 @@ namespace CalamityMod.Projectiles.Summon } } } - else + else if (Main.npc[projectile.ai[0]].active && projectile.ai[0] != -1f) + { + NPC npc = Main.npc[projectile.ai[0]]; + if (npc.CanBeChasedBy(projectile, false)) + { + float extraDistance = (float)(npc.width / 2) + (float)(npc.height / 2); + + if (Vector2.Distance(npc.Center, projectile.Center) < (explode + extraDistance)) + { + int numProj = 4; + if (projectile.owner == Main.myPlayer) + { + for (int i = 0; i < numProj; i++) + { + Vector2 speed = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); + while (speed.X == 0f && speed.Y == 0f) + { + speed = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); + } + speed.Normalize(); + speed *= (float)Main.rand.Next(30, 61) * 0.1f * 2f; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speed.X, speed.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.25), projectile.knockBack, projectile.owner, 0f, 0f); + } + } + Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); + projectile.Kill(); + return; + } + else if (Vector2.Distance(npc.Center, projectile.Center) < (maxDistance + extraDistance)) + { + center = npc.Center; + homeIn = true; + } + } + } + if (!homeIn) { for (int npcIndex = 0; npcIndex < Main.maxNPCs; npcIndex++) { diff --git a/Projectiles/Summon/CosmicViperSummon.cs b/Projectiles/Summon/CosmicViperSummon.cs index 48d29995ab..460e7dadfc 100644 --- a/Projectiles/Summon/CosmicViperSummon.cs +++ b/Projectiles/Summon/CosmicViperSummon.cs @@ -97,6 +97,7 @@ namespace CalamityMod.Projectiles.Summon float detectRange = 700f; Vector2 targetVec = projectile.position; bool foundTarget = false; + int targetIndex = -1; if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; @@ -108,10 +109,11 @@ namespace CalamityMod.Projectiles.Summon detectRange = targetDist; targetVec = npc.Center; foundTarget = true; + targetIndex = npc.whoAmI; } } } - else + if (!foundTarget) { for (int npcIndex = 0; npcIndex < Main.maxNPCs; npcIndex++) { @@ -124,6 +126,7 @@ namespace CalamityMod.Projectiles.Summon detectRange = targetDist; targetVec = npc.Center; foundTarget = true; + targetIndex = npcIndex; } } } @@ -261,7 +264,7 @@ namespace CalamityMod.Projectiles.Summon velocity.Y += Main.rand.NextFloat(-30f, 30f) * 0.05f; velocity.X += Main.rand.NextFloat(-30f, 30f) * 0.05f; - Projectile.NewProjectile(projectile.Center, velocity, projType, (int)(projectile.damage * dmgMult), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center, velocity, projType, (int)(projectile.damage * dmgMult), projectile.knockBack, projectile.owner, targetIndex, 0f); projectile.netUpdate = true; } } diff --git a/Projectiles/Summon/CosmilampMinion.cs b/Projectiles/Summon/CosmilampMinion.cs index 17203f10dc..acc142b16c 100644 --- a/Projectiles/Summon/CosmilampMinion.cs +++ b/Projectiles/Summon/CosmilampMinion.cs @@ -115,7 +115,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag19) { for (int num542 = 0; num542 < Main.maxNPCs; num542++) { diff --git a/Projectiles/Summon/DaedalusCrystal.cs b/Projectiles/Summon/DaedalusCrystal.cs index 405944e80b..7bd5688e0c 100644 --- a/Projectiles/Summon/DaedalusCrystal.cs +++ b/Projectiles/Summon/DaedalusCrystal.cs @@ -117,7 +117,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag18) { for (int num512 = 0; num512 < Main.maxNPCs; num512++) { diff --git a/Projectiles/Summon/DankCreeperMinion.cs b/Projectiles/Summon/DankCreeperMinion.cs index 0b171bea53..e90f537e7e 100644 --- a/Projectiles/Summon/DankCreeperMinion.cs +++ b/Projectiles/Summon/DankCreeperMinion.cs @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag19) { for (int num542 = 0; num542 < Main.maxNPCs; num542++) { diff --git a/Projectiles/Summon/Dreadmine.cs b/Projectiles/Summon/Dreadmine.cs index dcc5001ecc..ada00ded8a 100644 --- a/Projectiles/Summon/Dreadmine.cs +++ b/Projectiles/Summon/Dreadmine.cs @@ -140,7 +140,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag49) { for (int num949 = 0; num949 < Main.npc.Length; num949++) { diff --git a/Projectiles/Summon/DreadmineTurret.cs b/Projectiles/Summon/DreadmineTurret.cs index eac916c79e..efe4bb76c8 100644 --- a/Projectiles/Summon/DreadmineTurret.cs +++ b/Projectiles/Summon/DreadmineTurret.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Summon if (Main.rand.NextBool(15)) { int num = 0; - for (int i = 0; i < Main.projectile.Length; i++) + for (int i = 0; i < Main.maxProjectiles; i++) { if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == ModContent.ProjectileType()) { @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Summon } if (flag) { - for (int k = 0; k < 1000; k++) + for (int k = 0; k < Main.maxProjectiles; k++) { if (Main.projectile[k].active && Main.projectile[k].owner == Main.myPlayer && Main.projectile[k].type == ModContent.ProjectileType() && (center - Main.projectile[k].Center).Length() < 48f) diff --git a/Projectiles/Summon/EndoCooperBody.cs b/Projectiles/Summon/EndoCooperBody.cs index 17e694bac3..9294fffd71 100644 --- a/Projectiles/Summon/EndoCooperBody.cs +++ b/Projectiles/Summon/EndoCooperBody.cs @@ -179,7 +179,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!gotoenemy) { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { diff --git a/Projectiles/Summon/EndoIceShard.cs b/Projectiles/Summon/EndoIceShard.cs index 90f8f87571..965991c921 100644 --- a/Projectiles/Summon/EndoIceShard.cs +++ b/Projectiles/Summon/EndoIceShard.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!hasHomingTarget) { for (int i = 0; i < Main.npc.Length; ++i) { diff --git a/Projectiles/Summon/EnergyOrb.cs b/Projectiles/Summon/EnergyOrb.cs index 419c224307..8f324ed043 100644 --- a/Projectiles/Summon/EnergyOrb.cs +++ b/Projectiles/Summon/EnergyOrb.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag17) { for (int num475 = 0; num475 < Main.maxNPCs; num475++) { diff --git a/Projectiles/Summon/FlameBlast.cs b/Projectiles/Summon/FlameBlast.cs index 8f2869d03f..48a6fd7a06 100644 --- a/Projectiles/Summon/FlameBlast.cs +++ b/Projectiles/Summon/FlameBlast.cs @@ -72,11 +72,27 @@ namespace CalamityMod.Projectiles.Summon float num474 = 300f; bool flag17 = false; int target = (int)projectile.ai[0]; - if (Main.npc[target].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[target].Center, 1, 1)) + if (player.HasMinionAttackTargetNPC) + { + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false)) + { + float num476 = npc.position.X + (float)(npc.width / 2); + float num477 = npc.position.Y + (float)(npc.height / 2); + float num478 = Math.Abs(projectile.Center.X - num476) + Math.Abs(projectile.Center.Y - num477); + if (num478 < num474) + { + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + else if (Main.npc[target].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[target].Center, 1, 1)) { float num476 = Main.npc[target].position.X + (float)(Main.npc[target].width / 2); float num477 = Main.npc[target].position.Y + (float)(Main.npc[target].height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + float num478 = Math.Abs(projectile.Center.X - num476) + Math.Abs(projectile.Center.Y - num477); if (num478 < num474) { num472 = num476; @@ -84,6 +100,28 @@ namespace CalamityMod.Projectiles.Summon flag17 = true; } } + if (!flag17) + { + for (int i = 0; i < Main.maxNPCs; ++i) + { + NPC npc = Main.npc[i]; + if (npc is null || !npc.active) + continue; + + if (npc.CanBeChasedBy(projectile, false)) + { + float num476 = npc.position.X + (float)(npc.width / 2); + float num477 = npc.position.Y + (float)(npc.height / 2); + float num478 = Math.Abs(projectile.Center.X - num476) + Math.Abs(projectile.Center.Y - num477); + if (num478 < num474) + { + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + } if (flag17) { float num483 = 25f; diff --git a/Projectiles/Summon/FlameBurst.cs b/Projectiles/Summon/FlameBurst.cs index e544b740bf..534e6a92ec 100644 --- a/Projectiles/Summon/FlameBurst.cs +++ b/Projectiles/Summon/FlameBurst.cs @@ -72,11 +72,27 @@ namespace CalamityMod.Projectiles.Summon float num474 = 1200f; bool flag17 = false; int target = (int)projectile.ai[0]; - if (Main.npc[target].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[target].Center, 1, 1)) + if (player.HasMinionAttackTargetNPC) + { + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false)) + { + float num476 = npc.position.X + (float)(npc.width / 2); + float num477 = npc.position.Y + (float)(npc.height / 2); + float num478 = Math.Abs(projectile.Center.X - num476) + Math.Abs(projectile.Center.Y - num477); + if (num478 < num474) + { + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + else if (Main.npc[target].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[target].Center, 1, 1)) { float num476 = Main.npc[target].position.X + (float)(Main.npc[target].width / 2); float num477 = Main.npc[target].position.Y + (float)(Main.npc[target].height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + float num478 = Math.Abs(projectile.Center.X - num476) + Math.Abs(projectile.Center.Y - num477); if (num478 < num474) { num472 = num476; @@ -84,6 +100,28 @@ namespace CalamityMod.Projectiles.Summon flag17 = true; } } + if (!flag17) + { + for (int i = 0; i < Main.maxNPCs; ++i) + { + NPC npc = Main.npc[i]; + if (npc is null || !npc.active) + continue; + + if (npc.CanBeChasedBy(projectile, false)) + { + float num476 = npc.position.X + (float)(npc.width / 2); + float num477 = npc.position.Y + (float)(npc.height / 2); + float num478 = Math.Abs(projectile.Center.X - num476) + Math.Abs(projectile.Center.Y - num477); + if (num478 < num474) + { + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + } if (flag17) { float num483 = 20f; diff --git a/Projectiles/Summon/ForbiddenCircletEater.cs b/Projectiles/Summon/ForbiddenCircletEater.cs index dc793f422f..90ef9f9969 100644 --- a/Projectiles/Summon/ForbiddenCircletEater.cs +++ b/Projectiles/Summon/ForbiddenCircletEater.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag10) { for (int num376 = 0; num376 < Main.maxNPCs; num376++) { diff --git a/Projectiles/Summon/FungalClumpMinion.cs b/Projectiles/Summon/FungalClumpMinion.cs index 56c2114325..71356927dd 100644 --- a/Projectiles/Summon/FungalClumpMinion.cs +++ b/Projectiles/Summon/FungalClumpMinion.cs @@ -142,7 +142,7 @@ namespace CalamityMod.Projectiles.Summon } } //If no npc is specifically targetted, check through the entire array - else + if (!npcFound) { for (int npcIndex = 0; npcIndex < Main.maxNPCs; npcIndex++) { diff --git a/Projectiles/Summon/GastricBelcher.cs b/Projectiles/Summon/GastricBelcher.cs index e189e999c6..cb0bb7b127 100644 --- a/Projectiles/Summon/GastricBelcher.cs +++ b/Projectiles/Summon/GastricBelcher.cs @@ -131,7 +131,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!foundTarget) { for (int npcIndex = 0; npcIndex < Main.maxNPCs; npcIndex++) { diff --git a/Projectiles/Summon/GigaFlareFriendly.cs b/Projectiles/Summon/GigaFlareFriendly.cs index 586b346ed6..7025b4b3be 100644 --- a/Projectiles/Summon/GigaFlareFriendly.cs +++ b/Projectiles/Summon/GigaFlareFriendly.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Summon float num473 = projectile.Center.Y; float num474 = 400f; bool flag17 = false; - for (int num475 = 0; num475 < 200; num475++) + for (int num475 = 0; num475 < Main.maxNPCs; num475++) { if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) { @@ -93,10 +93,9 @@ namespace CalamityMod.Projectiles.Summon double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; double offsetAngle; - int i; if (projectile.owner == Main.myPlayer) { - for (i = 0; i < 2; i++) + for (int i = 0; i < 2; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); diff --git a/Projectiles/Summon/HauntedDishes.cs b/Projectiles/Summon/HauntedDishes.cs index d02acf13f2..70ffa18b50 100644 --- a/Projectiles/Summon/HauntedDishes.cs +++ b/Projectiles/Summon/HauntedDishes.cs @@ -355,7 +355,7 @@ namespace CalamityMod.Projectiles.Summon { projectile.ai[1] = attackCooldown; double num11 = 12.0; - Vector2 vector2 = new Vector2(projectile.position.X + (float) projectile.width * 0.5f, (float) ((double) projectile.position.Y + (double) (projectile.height / 2) - 8.0)); + Vector2 vector2 = new Vector2(projectile.Center.X, projectile.Center.Y - 8f); float num12 = num5 - vector2.X + (float) Main.rand.Next(-10, 11); float num14 = (float) ((double) (Math.Abs(num12) * 0.1f) * (double) Main.rand.Next(0, 100) * (1.0 / 1000.0)); float num15 = num6 - vector2.Y + (float) Main.rand.Next(-10, 11) - num14; diff --git a/Projectiles/Summon/HermitCrabMinion.cs b/Projectiles/Summon/HermitCrabMinion.cs index 6e7e375163..58aa77bc25 100644 --- a/Projectiles/Summon/HermitCrabMinion.cs +++ b/Projectiles/Summon/HermitCrabMinion.cs @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!chaseNPC) { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { diff --git a/Projectiles/Summon/Hive.cs b/Projectiles/Summon/Hive.cs index a5ef59097b..ee8779e206 100644 --- a/Projectiles/Summon/Hive.cs +++ b/Projectiles/Summon/Hive.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag25) { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { diff --git a/Projectiles/Summon/Hiveling.cs b/Projectiles/Summon/Hiveling.cs index 018f06728e..922d1c146f 100644 --- a/Projectiles/Summon/Hiveling.cs +++ b/Projectiles/Summon/Hiveling.cs @@ -50,11 +50,28 @@ namespace CalamityMod.Projectiles.Summon float num474 = 1200f; bool homeIn = false; int target = (int)projectile.ai[0]; - if (Main.npc[target].CanBeChasedBy(projectile, false)) + + if (player.HasMinionAttackTargetNPC) { - float num476 = Main.npc[target].position.X + (float)(Main.npc[target].width / 2); - float num477 = Main.npc[target].position.Y + (float)(Main.npc[target].height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false)) + { + float num476 = npc.Center.X; + float num477 = npc.Center.Y; + float num478 = Math.Abs(projectile.Center.X - num476) + Math.Abs(projectile.Center.Y - num477); + if (num478 < num474) + { + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + else if (Main.npc[target].CanBeChasedBy(projectile, false)) + { + float num476 = Main.npc[target].Center.X; + float num477 = Main.npc[target].Center.Y; + float num478 = Math.Abs(projectile.Center.X - num476) + Math.Abs(projectile.Center.Y - num477); if (num478 < num474) { centerX = num476; @@ -62,6 +79,28 @@ namespace CalamityMod.Projectiles.Summon homeIn = true; } } + if (!homeIn) + { + for (int i = 0; i < Main.maxNPCs; ++i) + { + NPC npc = Main.npc[i]; + if (npc is null || !npc.active) + continue; + + if (npc.CanBeChasedBy(projectile, false)) + { + float num476 = npc.Center.X; + float num477 = npc.Center.Y; + float num478 = Math.Abs(projectile.Center.X - num476) + Math.Abs(projectile.Center.Y - num477); + if (num478 < num474) + { + centerX = num476; + centerY = num477; + homeIn = true; + } + } + } + } if (homeIn) { float num483 = 10f; diff --git a/Projectiles/Summon/HowlsHeartFireball.cs b/Projectiles/Summon/HowlsHeartFireball.cs index 6c640d5fd7..8dc31d65be 100644 --- a/Projectiles/Summon/HowlsHeartFireball.cs +++ b/Projectiles/Summon/HowlsHeartFireball.cs @@ -45,6 +45,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 center = projectile.Center; float maxDistance = 500f; bool homeIn = false; + int target = (int)projectile.ai[0]; if (player.HasMinionAttackTargetNPC) { @@ -64,7 +65,23 @@ namespace CalamityMod.Projectiles.Summon } } } - else + else if (Main.npc[target].CanBeChasedBy(projectile, false)) + { + NPC npc = Main.npc[target]; + + float extraDistance = (npc.width / 2) + (npc.height / 2); + + bool canHit = true; + if (extraDistance < maxDistance) + canHit = Collision.CanHit(projectile.Center, 1, 1, npc.Center, 1, 1); + + if (Vector2.Distance(npc.Center, projectile.Center) < (maxDistance + extraDistance) && canHit) + { + center = npc.Center; + homeIn = true; + } + } + if (!homeIn) { for (int i = 0; i < Main.maxNPCs; i++) { diff --git a/Projectiles/Summon/HowlsHeartHowl.cs b/Projectiles/Summon/HowlsHeartHowl.cs index caf409d2de..d867ef7943 100644 --- a/Projectiles/Summon/HowlsHeartHowl.cs +++ b/Projectiles/Summon/HowlsHeartHowl.cs @@ -93,6 +93,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 targetPos = projectile.position; float maxRange = 900f; bool foundEnemy = false; + int targetIndex = -1; //If the player has targetted an enemy, choose that one NPC target = projectile.OwnerMinionAttackTargetNPC; if (target != null && target.CanBeChasedBy(projectile, false)) @@ -103,6 +104,7 @@ namespace CalamityMod.Projectiles.Summon maxRange = targetDist; targetPos = target.Center; foundEnemy = true; + targetIndex = npc.whoAmI; } } //else, search through all available NPCs @@ -119,6 +121,7 @@ namespace CalamityMod.Projectiles.Summon maxRange = targetDist; targetPos = npc.Center; foundEnemy = true; + targetIndex = index; } } } @@ -272,7 +275,7 @@ namespace CalamityMod.Projectiles.Summon targetVec.Normalize(); targetVec *= speedMult; Main.PlaySound(SoundID.Item20, projectile.position); - int fireball = Projectile.NewProjectile(projectile.Center, targetVec, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + int fireball = Projectile.NewProjectile(projectile.Center, targetVec, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, targetIndex, 0f); Main.projectile[fireball].netUpdate = true; Main.projectile[fireball].frame = Main.rand.Next(4); projectile.netUpdate = true; diff --git a/Projectiles/Summon/LanternFlame.cs b/Projectiles/Summon/LanternFlame.cs index 6605f77c63..4a83651bd5 100644 --- a/Projectiles/Summon/LanternFlame.cs +++ b/Projectiles/Summon/LanternFlame.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag17) { for (int num475 = 0; num475 < Main.npc.Length; num475++) { diff --git a/Projectiles/Summon/MagicAxe.cs b/Projectiles/Summon/MagicAxe.cs index c1c75c88fd..61e111e760 100644 --- a/Projectiles/Summon/MagicAxe.cs +++ b/Projectiles/Summon/MagicAxe.cs @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!homeIn) { for (int num645 = 0; num645 < Main.npc.Length; num645++) { diff --git a/Projectiles/Summon/MagicBat.cs b/Projectiles/Summon/MagicBat.cs index ed58a72851..651e618f1d 100644 --- a/Projectiles/Summon/MagicBat.cs +++ b/Projectiles/Summon/MagicBat.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver4; } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Summon/MagicBird.cs b/Projectiles/Summon/MagicBird.cs index 60d1c89402..05bc217a9f 100644 --- a/Projectiles/Summon/MagicBird.cs +++ b/Projectiles/Summon/MagicBird.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!hasHomingTarget) { for (int i = 0; i < Main.npc.Length; ++i) { diff --git a/Projectiles/Summon/MagicHat.cs b/Projectiles/Summon/MagicHat.cs index 72bd31429f..a713f5d45b 100644 --- a/Projectiles/Summon/MagicHat.cs +++ b/Projectiles/Summon/MagicHat.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!enemyDetected) { for (int index = 0; index < Main.npc.Length; index++) { diff --git a/Projectiles/Summon/MagicRifle.cs b/Projectiles/Summon/MagicRifle.cs index e59667cb4c..97b294b3a4 100644 --- a/Projectiles/Summon/MagicRifle.cs +++ b/Projectiles/Summon/MagicRifle.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!foundTarget) { for (int npcIndex = 0; npcIndex < Main.maxNPCs; npcIndex++) { diff --git a/Projectiles/Summon/MagicUmbrella.cs b/Projectiles/Summon/MagicUmbrella.cs index 6ee1a99dbe..2367bc2b61 100644 --- a/Projectiles/Summon/MagicUmbrella.cs +++ b/Projectiles/Summon/MagicUmbrella.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Summon if (counter <= 30) { counter++; - canHome = true; + canHome = false; } else { @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag25) { for (int num645 = 0; num645 < Main.npc.Length; num645++) { diff --git a/Projectiles/Summon/MiniGuardianAttack.cs b/Projectiles/Summon/MiniGuardianAttack.cs index 33161fc7c2..047bedfc93 100644 --- a/Projectiles/Summon/MiniGuardianAttack.cs +++ b/Projectiles/Summon/MiniGuardianAttack.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Summon if (projectile.ai[1] == 0f) { float num550 = 24f; //12 - Vector2 vector43 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 vector43 = projectile.Center; float num551 = num535 - vector43.X; float num552 = num536 - vector43.Y; float num553 = (float)Math.Sqrt((double)(num551 * num551 + num552 * num552)); @@ -85,9 +85,9 @@ namespace CalamityMod.Projectiles.Summon float num16 = 0.5f; projectile.tileCollide = false; int num17 = 100; - Vector2 vector3 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num18 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector3.X; - float num19 = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - vector3.Y; + Vector2 vector3 = projectile.Center; + float num18 = Main.player[projectile.owner].Center.X - vector3.X; + float num19 = Main.player[projectile.owner].Center.Y - vector3.Y; num19 += (float)Main.rand.Next(-10, 21); num18 += (float)Main.rand.Next(-10, 21); num18 += (float)(60 * -(float)Main.player[projectile.owner].direction); diff --git a/Projectiles/Summon/MiniGuardianDefense.cs b/Projectiles/Summon/MiniGuardianDefense.cs index 1adb554fc5..5719d88996 100644 --- a/Projectiles/Summon/MiniGuardianDefense.cs +++ b/Projectiles/Summon/MiniGuardianDefense.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Summon if (projectile.ai[1] == 0f) { float num550 = 24f; //12 - Vector2 vector43 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 vector43 = projectile.Center; float num551 = num535 - vector43.X; float num552 = num536 - vector43.Y; float num553 = (float)Math.Sqrt((double)(num551 * num551 + num552 * num552)); @@ -83,9 +83,9 @@ namespace CalamityMod.Projectiles.Summon float num16 = 0.5f; projectile.tileCollide = false; int num17 = 100; - Vector2 vector3 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num18 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector3.X; - float num19 = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - vector3.Y; + Vector2 vector3 = projectile.Center; + float num18 = Main.player[projectile.owner].Center.X - vector3.X; + float num19 = Main.player[projectile.owner].Center.Y - vector3.Y; num19 += (float)Main.rand.Next(-10, 21); num18 += (float)Main.rand.Next(-10, 21); num18 += (float)(60 * -(float)Main.player[projectile.owner].direction); diff --git a/Projectiles/Summon/PhantomGuy.cs b/Projectiles/Summon/PhantomGuy.cs index 4f1247aec7..0f8d79935f 100644 --- a/Projectiles/Summon/PhantomGuy.cs +++ b/Projectiles/Summon/PhantomGuy.cs @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag25) { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { diff --git a/Projectiles/Summon/PinkButterfly.cs b/Projectiles/Summon/PinkButterfly.cs index 7f9af97df4..322ec34f58 100644 --- a/Projectiles/Summon/PinkButterfly.cs +++ b/Projectiles/Summon/PinkButterfly.cs @@ -100,6 +100,7 @@ namespace CalamityMod.Projectiles.Summon } Vector2 vector46 = projectile.position; bool flag25 = false; + int targetIndex = -1; if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; @@ -110,10 +111,11 @@ namespace CalamityMod.Projectiles.Summon { vector46 = npc.Center; flag25 = true; + targetIndex = npc.whoAmI; } } } - else + if (!flag25) { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { @@ -126,6 +128,7 @@ namespace CalamityMod.Projectiles.Summon num633 = num646; vector46 = nPC2.Center; flag25 = true; + targetIndex = num645; } } } @@ -235,7 +238,7 @@ namespace CalamityMod.Projectiles.Summon for (int i = 0; i < numProj + 1; i++) { Vector2 perturbedSpeed = value19.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, projectileType, projectile.damage / 2, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, projectileType, projectile.damage / 2, projectile.knockBack * 0.5f, projectile.owner, targetIndex, 0f); } projectile.netUpdate = true; } diff --git a/Projectiles/Summon/PlaguePrincess.cs b/Projectiles/Summon/PlaguePrincess.cs index b8fd4170ea..3217086e3b 100644 --- a/Projectiles/Summon/PlaguePrincess.cs +++ b/Projectiles/Summon/PlaguePrincess.cs @@ -194,7 +194,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!targetFound) { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { diff --git a/Projectiles/Summon/PlantSummon.cs b/Projectiles/Summon/PlantSummon.cs index 1eb19c2817..0e2390794d 100644 --- a/Projectiles/Summon/PlantSummon.cs +++ b/Projectiles/Summon/PlantSummon.cs @@ -233,7 +233,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!foundTarget) { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { diff --git a/Projectiles/Summon/ProfanedEnergy.cs b/Projectiles/Summon/ProfanedEnergy.cs index 503059565f..a13f89d86e 100644 --- a/Projectiles/Summon/ProfanedEnergy.cs +++ b/Projectiles/Summon/ProfanedEnergy.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag18) { for (int num512 = 0; num512 < Main.maxNPCs; num512++) { diff --git a/Projectiles/Summon/ReaverOrb.cs b/Projectiles/Summon/ReaverOrb.cs index d803995de9..467deb8d7a 100644 --- a/Projectiles/Summon/ReaverOrb.cs +++ b/Projectiles/Summon/ReaverOrb.cs @@ -108,6 +108,7 @@ namespace CalamityMod.Projectiles.Summon { num508 = num515; flag18 = true; + break; } } } diff --git a/Projectiles/Summon/SakuraBullet.cs b/Projectiles/Summon/SakuraBullet.cs index 13a6f07c97..1f05c302cc 100644 --- a/Projectiles/Summon/SakuraBullet.cs +++ b/Projectiles/Summon/SakuraBullet.cs @@ -51,7 +51,21 @@ namespace CalamityMod.Projectiles.Summon } } } - else + else if (projectile.ai[0] != -1f) + { + NPC npc = Main.npc[projectile.ai[0]]; + if ((npc.CanBeChasedBy(projectile, false) || npc.type == NPCID.DukeFishron) && npc.active) + { + float extraDistance = (npc.width / 2) + (npc.height / 2); + + if (Vector2.Distance(npc.Center, projectile.Center) < (maxDistance + extraDistance)) + { + center = npc.Center; + homeIn = true; + } + } + } + if (!homeIn) { for (int i = 0; i < Main.maxNPCs; i++) { diff --git a/Projectiles/Summon/SandElementalMinion.cs b/Projectiles/Summon/SandElementalMinion.cs index 36bc62dd9e..b9793548d7 100644 --- a/Projectiles/Summon/SandElementalMinion.cs +++ b/Projectiles/Summon/SandElementalMinion.cs @@ -117,7 +117,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag25) { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { diff --git a/Projectiles/Summon/SandnadoMinion.cs b/Projectiles/Summon/SandnadoMinion.cs index 0e6118b2db..c39f019a34 100644 --- a/Projectiles/Summon/SandnadoMinion.cs +++ b/Projectiles/Summon/SandnadoMinion.cs @@ -115,7 +115,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag) { for (int k = 0; k < Main.maxNPCs; k++) { diff --git a/Projectiles/Summon/Shellfish.cs b/Projectiles/Summon/Shellfish.cs index 8f0f6249e4..06b00ba9bb 100644 --- a/Projectiles/Summon/Shellfish.cs +++ b/Projectiles/Summon/Shellfish.cs @@ -139,7 +139,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!chaseNPC) { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { diff --git a/Projectiles/Summon/SiriusMinion.cs b/Projectiles/Summon/SiriusMinion.cs index 722fbd2a94..6d4ee54d00 100644 --- a/Projectiles/Summon/SiriusMinion.cs +++ b/Projectiles/Summon/SiriusMinion.cs @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag11) { for (int num399 = 0; num399 < Main.npc.Length; num399++) { diff --git a/Projectiles/Summon/SolarGod.cs b/Projectiles/Summon/SolarGod.cs index 3cae1c7956..25edbb53b3 100644 --- a/Projectiles/Summon/SolarGod.cs +++ b/Projectiles/Summon/SolarGod.cs @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag11) { for (int num399 = 0; num399 < Main.maxNPCs; num399++) { diff --git a/Projectiles/Summon/SolarPixie.cs b/Projectiles/Summon/SolarPixie.cs index d234d214b2..4a2288c4e2 100644 --- a/Projectiles/Summon/SolarPixie.cs +++ b/Projectiles/Summon/SolarPixie.cs @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag11) { for (int num399 = 0; num399 < Main.maxNPCs; num399++) { diff --git a/Projectiles/Summon/Spikecrag.cs b/Projectiles/Summon/Spikecrag.cs index c047fb1e4f..c211265560 100644 --- a/Projectiles/Summon/Spikecrag.cs +++ b/Projectiles/Summon/Spikecrag.cs @@ -78,6 +78,7 @@ namespace CalamityMod.Projectiles.Summon if (Vector2.Distance(Main.npc[i].Center, projectile.Center) < (maxDistance + extraDistance)) { homeIn = true; + break; } } } diff --git a/Projectiles/Summon/Urchin.cs b/Projectiles/Summon/Urchin.cs index 905143753e..98ed8bf83c 100644 --- a/Projectiles/Summon/Urchin.cs +++ b/Projectiles/Summon/Urchin.cs @@ -108,6 +108,7 @@ namespace CalamityMod.Projectiles.Summon { num508 = num515; flag18 = true; + break; } } } diff --git a/Projectiles/Summon/VileFeederProjectile.cs b/Projectiles/Summon/VileFeederProjectile.cs index 1cc1503570..320bb5d722 100644 --- a/Projectiles/Summon/VileFeederProjectile.cs +++ b/Projectiles/Summon/VileFeederProjectile.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag10) { for (int num376 = 0; num376 < Main.maxNPCs; num376++) { diff --git a/Projectiles/Summon/VileFeederSummon.cs b/Projectiles/Summon/VileFeederSummon.cs index f226988dca..01428ee118 100644 --- a/Projectiles/Summon/VileFeederSummon.cs +++ b/Projectiles/Summon/VileFeederSummon.cs @@ -143,7 +143,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!targetFound) { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { diff --git a/Projectiles/Summon/WaterElementalMinion.cs b/Projectiles/Summon/WaterElementalMinion.cs index 76041204bb..1fe87bae84 100644 --- a/Projectiles/Summon/WaterElementalMinion.cs +++ b/Projectiles/Summon/WaterElementalMinion.cs @@ -130,7 +130,7 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!flag18) { for (int num512 = 0; num512 < Main.maxNPCs; num512++) { diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 873c5f4bff..eaa6a24b8d 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -1068,8 +1068,8 @@ namespace CalamityMod } } } - //If no npc is specifically targetted, check through the entire array - else + //If no npc is specifically targetted or the selected enemy can't be found, check through the entire array + if (!foundTarget) { for (int npcIndex = 0; npcIndex < Main.maxNPCs; npcIndex++) { From a606fc8d960eff027d501a1ec88e00409ab9b36c Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 15:14:28 -0400 Subject: [PATCH 053/160] cleaned up some magic hat code --- Projectiles/Summon/MagicHat.cs | 66 +++++++++++----------------------- 1 file changed, 21 insertions(+), 45 deletions(-) diff --git a/Projectiles/Summon/MagicHat.cs b/Projectiles/Summon/MagicHat.cs index a713f5d45b..d9f6ba8ee1 100644 --- a/Projectiles/Summon/MagicHat.cs +++ b/Projectiles/Summon/MagicHat.cs @@ -71,9 +71,9 @@ namespace CalamityMod.Projectiles.Summon projectile.position.Y = (int)projectile.position.Y; //Change the summons scale size a little bit to make it pulse in and out - float num395 = (float)Main.mouseTextColor / 200f - 0.35f; - num395 *= 0.2f; - projectile.scale = num395 + 0.95f; + float scalar = (float)Main.mouseTextColor / 200f - 0.35f; + scalar *= 0.2f; + projectile.scale = scalar + 0.95f; //on summon dust and flexible damage if (projectile.localAI[0] == 0f) @@ -96,54 +96,30 @@ namespace CalamityMod.Projectiles.Summon projectile.damage = damage2; } - //finding an enemy, then shooting projectiles at it + //finding an enemy, then shooting projectiles if it's detected if (projectile.owner == Main.myPlayer) { - float projPosX = projectile.position.X; - float projPosY = projectile.position.Y; float detectionRange = Range; bool enemyDetected = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float xDist = npc.position.X + (float)(npc.width / 2); - float yDist = npc.position.Y + (float)(npc.height / 2); - float enemyDist = Math.Abs(projPosX + (float)(projectile.width / 2) - xDist) + Math.Abs(projPosY + (float)(projectile.height / 2) - yDist); - if (enemyDist < detectionRange) - { - detectionRange = enemyDist; - projPosX = xDist; - projPosY = yDist; - enemyDetected = true; - } - } - } - if (!enemyDetected) - { - for (int index = 0; index < Main.npc.Length; index++) - { - NPC target = Main.npc[index]; - if (target.CanBeChasedBy(projectile, false)) - { - float xDist = target.position.X + (float)(target.width / 2); - float yDist = target.position.Y + (float)(target.height / 2); - float enemyDist = Math.Abs(projPosX + (float)(projectile.width / 2) - xDist) + Math.Abs(projPosY + (float)(projectile.height / 2) - yDist); - if (enemyDist < detectionRange) - { - detectionRange = enemyDist; - projPosX = xDist; - projPosY = yDist; - enemyDetected = true; - } - } - } - } + + for (int i = 0; i < Main.maxNPCs; i++) + { + NPC npc = Main.npc[i]; + if (npc.CanBeChasedBy(projectile, false)) + { + float extraDistance = (npc.width / 2) + (npc.height / 2); + + if (Vector2.Distance(npc.Center, projectile.Center) < (detectionRange + extraDistance)) + { + enemyDetected = true; + break; + } + } + } if (enemyDetected) { projectile.ai[1] += 1f; - if ((projectile.ai[1] % 5f) == 0f) + if (projectile.ai[1] % 5f == 0f) { int amount = Main.rand.Next(1, 2); for (int i = 0; i < amount; i++) @@ -158,7 +134,7 @@ namespace CalamityMod.Projectiles.Summon }); float velocityX = Main.rand.NextFloat(-10f, 10f); float velocityY = Main.rand.NextFloat(-15f, -8f); - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), velocityX, velocityY, projType, projectile.damage, 0f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), velocityX, velocityY, projType, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } } } From e7750ef241ba47f0cd73488ecb716d280d2b07c0 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 17:37:43 -0400 Subject: [PATCH 054/160] refactors of temporal umbrella and eclipse's fall --- Items/Weapons/Rogue/EclipsesFall.cs | 47 ++--- Items/Weapons/Summon/BensUmbrella.cs | 27 ++- Projectiles/Rogue/EclipsesFallMain.cs | 50 ++--- Projectiles/Rogue/EclipsesSmol.cs | 39 ++-- Projectiles/Rogue/EclipsesStealth.cs | 7 +- Projectiles/Summon/CloudElementalMinion.cs | 2 +- Projectiles/Summon/MagicAxe.cs | 172 +--------------- Projectiles/Summon/MagicBird.cs | 20 +- Projectiles/Summon/MagicHammer.cs | 91 ++++----- Projectiles/Summon/MagicRifle.cs | 16 +- Projectiles/Summon/MagicUmbrella.cs | 227 +++------------------ Utilities/CalamityUtils.cs | 4 +- 12 files changed, 180 insertions(+), 522 deletions(-) diff --git a/Items/Weapons/Rogue/EclipsesFall.cs b/Items/Weapons/Rogue/EclipsesFall.cs index 50ab8f9f39..38c1d153a7 100644 --- a/Items/Weapons/Rogue/EclipsesFall.cs +++ b/Items/Weapons/Rogue/EclipsesFall.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; +using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -19,46 +20,42 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { - item.width = 72; item.damage = 1060; + item.knockBack = 3.5f; + item.useAnimation = item.useTime = 21; + item.autoReuse = true; + item.Calamity().rogue = true; + item.shootSpeed = 15f; + item.shoot = ModContent.ProjectileType(); + + item.useStyle = ItemUseStyleID.SwingThrow; + item.width = item.height = 72; item.noMelee = true; item.noUseGraphic = true; - item.useAnimation = 21; - item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 21; - item.knockBack = 3.5f; item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 72; item.value = Item.buyPrice(2, 50, 0, 0); item.rare = 10; item.Calamity().customRarity = CalamityRarity.Violet; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 15f; - item.Calamity().rogue = true; } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - if (player.Calamity().StealthStrikeAvailable()) - { - int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); - Main.projectile[p].Calamity().stealthStrike = true; - } - else - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); - } - return false; - } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.Calamity().StealthStrikeAvailable()) + { + type = ModContent.ProjectileType(); + } + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 1); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ModContent.ItemType(), 6); - recipe.AddTile(TileID.LunarCraftingStation); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Weapons/Summon/BensUmbrella.cs b/Items/Weapons/Summon/BensUmbrella.cs index d53d17fc6e..deb68215dc 100644 --- a/Items/Weapons/Summon/BensUmbrella.cs +++ b/Items/Weapons/Summon/BensUmbrella.cs @@ -22,39 +22,38 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.mana = 99; item.damage = 963; + item.knockBack = 1f; + item.mana = 99; + item.useTime = item.useAnimation = 10; + item.summon = true; + item.shootSpeed = 0f; + item.shoot = ModContent.ProjectileType(); + item.useStyle = ItemUseStyleID.SwingThrow; item.width = 74; item.height = 72; - item.useTime = item.useAnimation = 10; item.noMelee = true; - item.knockBack = 1f; - item.value = Item.buyPrice(5, 0, 0, 0); - item.Calamity().customRarity = CalamityRarity.ItemSpecific; - item.rare = 10; item.UseSound = SoundID.Item68; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 10f; - item.summon = true; + item.value = Item.buyPrice(5, 0, 0, 0); + item.rare = 10; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0 && player.maxMinions >= 5; public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - position = Main.MouseWorld; - speedX = 0; - speedY = 0; - for (int x = 0; x < Main.projectile.Length; x++) + for (int x = 0; x < Main.maxProjectiles; x++) { Projectile projectile = Main.projectile[x]; if (projectile.active && projectile.owner == player.whoAmI && projectile.type == type) { projectile.Kill(); + break; } } - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI); + Projectile.NewProjectile(player.Center, Vector2.Zero, type, damage, knockBack, player.whoAmI); return false; } diff --git a/Projectiles/Rogue/EclipsesFallMain.cs b/Projectiles/Rogue/EclipsesFallMain.cs index 5969e11d6e..afa7481f67 100644 --- a/Projectiles/Rogue/EclipsesFallMain.cs +++ b/Projectiles/Rogue/EclipsesFallMain.cs @@ -33,50 +33,40 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 138, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver4; } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - for (int n = 0; n < Main.rand.Next(3, 6); n++) //3 to 5 spears - { - float x = target.position.X + (float)Main.rand.Next(-400, 400); - float y = target.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num13 = target.position.X + (float)(target.width / 2) - vector.X; - float num14 = target.position.Y + (float)(target.height / 2) - vector.Y; - num13 += (float)Main.rand.Next(-100, 101); - int num15 = 29; - float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); - num16 = (float)num15 / num16; - num13 *= num16; - num14 *= num16; - Projectile.NewProjectile(x, y, num13, num14, ModContent.ProjectileType(), (int)(projectile.damage * 0.08f * Main.rand.NextFloat(4f, 7f)), (int)(projectile.knockBack * 0.1f * Main.rand.NextFloat(7f, 10f)), projectile.owner, 0f, 0f); - } + SpawnSpears(target.Center); } public override void OnHitPvp(Player target, int damage, bool crit) { + SpawnSpears(target.Center); + } + + private void SpawnSpears(Vector2 targetPos) + { for (int n = 0; n < Main.rand.Next(3, 6); n++) //3 to 5 spears { - float x = target.position.X + (float)Main.rand.Next(-400, 400); - float y = target.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num13 = target.position.X + (float)(target.width / 2) - vector.X; - float num14 = target.position.Y + (float)(target.height / 2) - vector.Y; - num13 += (float)Main.rand.Next(-100, 101); - int num15 = 29; - float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); - num16 = (float)num15 / num16; - num13 *= num16; - num14 *= num16; - Projectile.NewProjectile(x, y, num13, num14, ModContent.ProjectileType(), (int)(projectile.damage * 0.08f * Main.rand.NextFloat(4f, 7f)), (int)(projectile.knockBack * 0.1f * Main.rand.NextFloat(7f, 10f)), projectile.owner, 0f, 0f); + float x = targetPos.X + Main.rand.Next(-400, 401); + float y = targetPos.Y - Main.rand.Next(500, 801); + Vector2 source = new Vector2(x, y); + Vector2 velocity = targetPos - source; + velocity.X += Main.rand.Next(-100, 101); + float speed = 29f; + float targetDist = velocity.Length(); + targetDist = speed / targetDist; + velocity.X *= targetDist; + velocity.Y *= targetDist; + Projectile.NewProjectile(source, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.08f * Main.rand.NextFloat(4f, 7f)), (int)(projectile.knockBack * 0.1f * Main.rand.NextFloat(7f, 10f)), projectile.owner, 0f, 0f); } - } + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { diff --git a/Projectiles/Rogue/EclipsesSmol.cs b/Projectiles/Rogue/EclipsesSmol.cs index fa9ad85291..0da5447707 100644 --- a/Projectiles/Rogue/EclipsesSmol.cs +++ b/Projectiles/Rogue/EclipsesSmol.cs @@ -18,7 +18,6 @@ namespace CalamityMod.Projectiles.Rogue projectile.width = 20; projectile.height = 20; projectile.friendly = true; - projectile.penetrate = 1; projectile.tileCollide = false; projectile.ignoreWater = true; projectile.timeLeft = 150; @@ -28,36 +27,30 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver4; CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 400f, 24f, 20f); } public override void Kill(int timeLeft) { - Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); - for (int num621 = 0; num621 < 20; num621++) + Main.PlaySound(SoundID.Item14, projectile.Center); + for (int i = 0; i < 2; i++) { - if (Main.rand.NextBool(10)) - { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 138, 0f, 0f, 100, default, 1.2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } + int dustInt = Dust.NewDust(projectile.position, projectile.width, projectile.height, 138, 0f, 0f, 100, default, 1.2f); + Main.dust[dustInt].velocity *= 3f; + if (Main.rand.NextBool(2)) + { + Main.dust[dustInt].scale = 0.5f; + Main.dust[dustInt].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } } - for (int num623 = 0; num623 < 35; num623++) + for (int j = 0; j < 3; j++) { - if (Main.rand.NextBool(10)) - { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 138, 0f, 0f, 100, default, 1.7f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 138, 0f, 0f, 100, default, 1f); - Main.dust[num624].velocity *= 2f; - } + int moreDust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 138, 0f, 0f, 100, default, 1.7f); + Main.dust[moreDust].noGravity = true; + Main.dust[moreDust].velocity *= 5f; + moreDust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 138, 0f, 0f, 100, default, 1f); + Main.dust[moreDust].velocity *= 2f; } } diff --git a/Projectiles/Rogue/EclipsesStealth.cs b/Projectiles/Rogue/EclipsesStealth.cs index 748254fc39..f08ba0a765 100644 --- a/Projectiles/Rogue/EclipsesStealth.cs +++ b/Projectiles/Rogue/EclipsesStealth.cs @@ -56,19 +56,24 @@ namespace CalamityMod.Projectiles.Rogue } } } + + //Behavior when not sticking to anything if (projectile.ai[0] == 0f) { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver4; if (Main.rand.NextBool(8)) //dust { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 138, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } } + + //Ensures that a spear will last 15 seconds after it hits something if (projectile.ai[0] == 1f && !changedTimeLeft) { projectile.timeLeft = 900; changedTimeLeft = true; } + //Sticky Behaviour projectile.StickyProjAI(15); } diff --git a/Projectiles/Summon/CloudElementalMinion.cs b/Projectiles/Summon/CloudElementalMinion.cs index 757990b8bf..28ae075ac1 100644 --- a/Projectiles/Summon/CloudElementalMinion.cs +++ b/Projectiles/Summon/CloudElementalMinion.cs @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Summon projectile.frame = 0; } - projectile.ChargingMinionAI(500f, 800f, 1200f, 400f, 0, 30f, 8f, -4f, 40f, 8f, false, true); + projectile.ChargingMinionAI(500f, 800f, 1200f, 400f, 0, 30f, 8f, -4f, 40f, 8f, false, true, 1); } } } diff --git a/Projectiles/Summon/MagicAxe.cs b/Projectiles/Summon/MagicAxe.cs index 61e111e760..1b0a2be506 100644 --- a/Projectiles/Summon/MagicAxe.cs +++ b/Projectiles/Summon/MagicAxe.cs @@ -41,176 +41,22 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - projectile.rotation += 0.075f; projectile.alpha -= 50; - float num634 = 1200f; - float num635 = 2500f; - projectile.MinionAntiClump(); - if (projectile.ai[1] <= 30) + counter++; + if (counter == 30) + { + projectile.netUpdate = true; + } + else if (counter < 30) { - projectile.ai[1]++; return; } - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - counter += 1; - projectile.extraUpdates = 4; - if (counter > 30) - { - counter = 1; - projectile.ai[0] = 0f; - projectile.extraUpdates = 1; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - float homingRange = MagicHat.Range; - bool homeIn = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!homeIn && num646 < homingRange) - { - homingRange = num646; - vector46 = npc.Center; - homeIn = true; - } - } - } - if (!homeIn) - { - for (int num645 = 0; num645 < Main.npc.Length; num645++) - { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (!homeIn && num646 < homingRange) - { - homingRange = num646; - vector46 = nPC2.Center; - homeIn = true; - } - } - } - } - float num647 = num634; - if (homeIn) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (homeIn && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 24f; //8 - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 12f; //4 - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; //41 - } - } - else - { - bool flag26 = false; - float num636 = 400f; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; - if (flag26) - { - num650 = 15f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); - float playerDist = vector48.Length(); - if (playerDist > 200f && num650 < 8f) - { - num650 = 8f; - } - if (playerDist < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (playerDist > 2000f) - { - projectile.position.X = player.Center.X - (float)(projectile.width / 2); - projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (playerDist > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } - if (counter > 0) - { - counter += Main.rand.Next(1, 4); - } - if (counter > 30) - { - counter = 0; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (counter == 0 && homeIn && homingRange < 500f) - { - counter += 1; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 16f; //8 - projectile.netUpdate = true; - } - } - } + + projectile.ChargingMinionAI(MagicHat.Range, 1200f, 2500f, 400f, 1, 30f, 24f, -12f, 30f, 16f, true, true, 3); } - public override Color? GetAlpha(Color lightColor) - { - return new Color(0, 255, 111, projectile.alpha); - } + public override Color? GetAlpha(Color lightColor) => new Color(0, 255, 111, projectile.alpha); public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { diff --git a/Projectiles/Summon/MagicBird.cs b/Projectiles/Summon/MagicBird.cs index 05bc217a9f..eca8ff4e74 100644 --- a/Projectiles/Summon/MagicBird.cs +++ b/Projectiles/Summon/MagicBird.cs @@ -35,8 +35,8 @@ namespace CalamityMod.Projectiles.Summon { projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); - projectile.frameCounter++; - if (projectile.frameCounter > 6) + + if (projectile.frameCounter++ % 6 == 0) { projectile.frame++; projectile.frameCounter = 0; @@ -45,19 +45,18 @@ namespace CalamityMod.Projectiles.Summon { projectile.frame = 0; } - projectile.ai[0]++; - projectile.ai[1]++; - if (projectile.ai[0] >= 20f) + + if (projectile.ai[0]++ % 20f == 0f) { Vector2 dspeed = projectile.velocity * Main.rand.NextFloat(0.3f,0.6f); int dust = Dust.NewDust(projectile.Center, 1, 1, 67, dspeed.X, dspeed.Y, 50, default, 1.2f); Main.dust[dust].noGravity = true; - projectile.ai[0] = 0f; } //Homing - if (projectile.ai[1] > 30f) + if (projectile.ai[1]++ > 30f) HomingAI(); + //Fade in if (projectile.alpha > 0) { @@ -94,7 +93,7 @@ namespace CalamityMod.Projectiles.Summon for (int i = 0; i < Main.npc.Length; ++i) { NPC npc = Main.npc[i]; - if (npc == null || !npc.active) + if (npc is null || !npc.active) continue; if (npc.CanBeChasedBy(projectile, false)) @@ -130,10 +129,7 @@ namespace CalamityMod.Projectiles.Summon } } - public override Color? GetAlpha(Color lightColor) - { - return new Color(255, 239, 0, projectile.alpha); - } + public override Color? GetAlpha(Color lightColor) => new Color(255, 239, 0, projectile.alpha); public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { diff --git a/Projectiles/Summon/MagicHammer.cs b/Projectiles/Summon/MagicHammer.cs index afddf9d1a4..d1740b14db 100644 --- a/Projectiles/Summon/MagicHammer.cs +++ b/Projectiles/Summon/MagicHammer.cs @@ -44,15 +44,22 @@ namespace CalamityMod.Projectiles.Summon projectile.alpha = 50; } } + projectile.rotation += 0.075f; - if (counter <= 30) + + counter++; + if (counter == 30) + { + projectile.netUpdate = true; + } + else if (counter < 30) { - counter++; return; } - int num716 = -1; - Vector2 vector59 = projectile.Center; - float num717 = MagicHat.Range; + + int targetIndex = -1; + Vector2 targetVec = projectile.Center; + float maxDistance = MagicHat.Range; if (projectile.localAI[0] > 0f) { projectile.localAI[0] -= 1f; @@ -63,39 +70,35 @@ namespace CalamityMod.Projectiles.Summon if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false) && (projectile.ai[0] == 0f || projectile.ai[0] == (float)(player.MinionAttackTargetNPC + 1))) + if (npc.CanBeChasedBy(projectile, false) && (projectile.ai[0] == 0f || projectile.ai[0] == player.MinionAttackTargetNPC + 1f)) { - Vector2 center4 = npc.Center; - float num719 = Vector2.Distance(center4, vector59); - if (num719 < num717) + float targetDist = Vector2.Distance(npc.Center, targetVec); + if (targetDist < maxDistance) { - num717 = num719; - vector59 = center4; - num716 = player.MinionAttackTargetNPC; + targetVec = npc.Center; + targetIndex = player.MinionAttackTargetNPC; } } } else { - for (int num718 = 0; num718 < Main.npc.Length; num718++) + for (int i = 0; i < Main.npc.Length; i++) { - NPC nPC6 = Main.npc[num718]; - if (nPC6.CanBeChasedBy(projectile, false) && (projectile.ai[0] == 0f || projectile.ai[0] == (float)(num718 + 1))) + NPC npc = Main.npc[i]; + if (npc.CanBeChasedBy(projectile, false) && (projectile.ai[0] == 0f || projectile.ai[0] == i + 1f)) { - Vector2 center4 = nPC6.Center; - float num719 = Vector2.Distance(center4, vector59); - if (num719 < num717) + float targetDist = Vector2.Distance(npc.Center, targetVec); + if (targetDist < maxDistance) { - num717 = num719; - vector59 = center4; - num716 = num718; + targetVec = npc.Center; + targetIndex = i; } } } } - if (num716 >= 0) + if (targetIndex >= 0) { - projectile.ai[0] = (float)(num716 + 1); + projectile.ai[0] = targetIndex + 1f; projectile.netUpdate = true; } } @@ -103,40 +106,39 @@ namespace CalamityMod.Projectiles.Summon { projectile.localAI[0] = 30f; } - bool flag32 = false; + bool canHome = false; if (projectile.ai[0] != 0f) { - int num720 = (int)(projectile.ai[0] - 1f); - if (Main.npc[num720].active && !Main.npc[num720].dontTakeDamage && Main.npc[num720].immune[projectile.owner] == 0) + int target = (int)(projectile.ai[0] - 1f); + NPC npc = Main.npc[target]; + if (npc.CanBeChasedBy(projectile, false) && npc.immune[projectile.owner] == 0) { - float num721 = Main.npc[num720].position.X + (float)(Main.npc[num720].width / 2); - float num722 = Main.npc[num720].position.Y + (float)(Main.npc[num720].height / 2); - float num723 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num721) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num722); - if (num723 < MagicHat.Range * 1.25f) + float targetDist = Vector2.Distance(npc.Center, targetVec); + if (targetDist < maxDistance * 1.25f) { - flag32 = true; - vector59 = Main.npc[num720].Center; + canHome = true; + targetVec = npc.Center; } } else { projectile.ai[0] = 0f; - flag32 = false; + canHome = false; projectile.netUpdate = true; } } - if (flag32) + if (canHome) { - Vector2 v = vector59 - projectile.Center; - float num724 = projectile.velocity.ToRotation(); - float num725 = v.ToRotation(); - float num726 = num725 - num724; - num726 = MathHelper.WrapAngle(num726); - projectile.velocity = projectile.velocity.RotatedBy(num726 * 0.25, default); + Vector2 velocity = targetVec - projectile.Center; + float trajectory = projectile.velocity.ToRotation(); + float target = velocity.ToRotation(); + float rotateAmt = target - trajectory; + rotateAmt = MathHelper.WrapAngle(rotateAmt); + projectile.velocity = projectile.velocity.RotatedBy(rotateAmt * 0.25, default); } - float num727 = projectile.velocity.Length(); + float speed = projectile.velocity.Length(); projectile.velocity.Normalize(); - projectile.velocity *= num727 + 0.0025f; + projectile.velocity *= speed + 0.0025f; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) @@ -145,10 +147,7 @@ namespace CalamityMod.Projectiles.Summon return false; } - public override Color? GetAlpha(Color lightColor) - { - return new Color(255, 56, 0, projectile.alpha); - } + public override Color? GetAlpha(Color lightColor) => new Color(255, 56, 0, projectile.alpha); public override void Kill(int timeLeft) { diff --git a/Projectiles/Summon/MagicRifle.cs b/Projectiles/Summon/MagicRifle.cs index 97b294b3a4..8f20a75ca5 100644 --- a/Projectiles/Summon/MagicRifle.cs +++ b/Projectiles/Summon/MagicRifle.cs @@ -9,7 +9,6 @@ namespace CalamityMod.Projectiles.Summon public class MagicRifle : ModProjectile { private int counter = 0; - private bool canHome = false; public override void SetStaticDefaults() { DisplayName.SetDefault("Rifle"); @@ -39,11 +38,16 @@ namespace CalamityMod.Projectiles.Summon projectile.MinionAntiClump(); //Try not to do anything at first - if (counter <= 30) + counter++; + if (counter == 30) { - counter++; - canHome = true; + projectile.netUpdate = true; } + else if (counter < 30) + { + return; + } + float homingRange = MagicHat.Range; Vector2 targetVec = projectile.position; Vector2 half = new Vector2(0.5f); @@ -52,7 +56,7 @@ namespace CalamityMod.Projectiles.Summon if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false) && canHome) + if (npc.CanBeChasedBy(projectile, false)) { //Adding a check on the NPC's size allows it to target big things like Providence Vector2 sizeCheck = npc.position + npc.Size * half; @@ -71,7 +75,7 @@ namespace CalamityMod.Projectiles.Summon for (int npcIndex = 0; npcIndex < Main.maxNPCs; npcIndex++) { NPC npc = Main.npc[npcIndex]; - if (npc.CanBeChasedBy(projectile, false) && canHome) + if (npc.CanBeChasedBy(projectile, false)) { Vector2 sizeCheck = npc.position + npc.Size * half; float targetDist = Vector2.Distance(npc.Center, projectile.Center); diff --git a/Projectiles/Summon/MagicUmbrella.cs b/Projectiles/Summon/MagicUmbrella.cs index 2367bc2b61..71cbd42f06 100644 --- a/Projectiles/Summon/MagicUmbrella.cs +++ b/Projectiles/Summon/MagicUmbrella.cs @@ -10,7 +10,6 @@ namespace CalamityMod.Projectiles.Summon public class MagicUmbrella : ModProjectile { private int counter = 0; - private bool canHome = false; public override void SetStaticDefaults() { DisplayName.SetDefault("Umbrella"); @@ -38,182 +37,22 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { - Player player = Main.player[projectile.owner]; projectile.rotation += 0.075f; projectile.alpha -= 50; - float num633 = MagicHat.Range; - float num634 = 1600f; - float num635 = 2200f; - float num636 = 150f; - projectile.MinionAntiClump(); - if (counter <= 30) + counter++; + if (counter == 30) { - counter++; - canHome = false; + projectile.netUpdate = true; } - else + else if (counter < 30) { - canHome = true; + return; } - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - projectile.ai[1] += 1f; - projectile.extraUpdates = 1; - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 0; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - if (!canHome) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false) && canHome) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - if (!flag25) - { - for (int num645 = 0; num645 < Main.npc.Length; num645++) - { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false) && canHome) - { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = nPC2.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 9f; //8 - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 4f; - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - } - else - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; - if (flag26) - { - num650 = 15f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 8f) - { - num650 = 8f; - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = player.Center.X - (float)(projectile.width / 2); - projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 500f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 9f; //8 - projectile.netUpdate = true; - } - } - } + + projectile.ChargingMinionAI(MagicHat.Range, 1600f, 2200f, 150f, 0, 40f, 9f, -4f, 40f, 9f, true, true); } - public override Color? GetAlpha(Color lightColor) - { - return new Color(75, 255, 255, projectile.alpha); - } + public override Color? GetAlpha(Color lightColor) => new Color(75, 255, 255, projectile.alpha); public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { @@ -235,21 +74,7 @@ namespace CalamityMod.Projectiles.Summon { if (Main.rand.NextBool(4)) { - for (int n = 0; n < Main.rand.Next(1, 3); n++) //1 to 2 baseball bats - { - float x = target.position.X + (float)Main.rand.Next(-400, 400); - float y = target.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num13 = target.position.X + (float)(target.width / 2) - vector.X; - float num14 = target.position.Y + (float)(target.height / 2) - vector.Y; - num13 += (float)Main.rand.Next(-100, 101); - int num15 = 29; - float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); - num16 = (float)num15 / num16; - num13 *= num16; - num14 *= num16; - Projectile.NewProjectile(x, y, num13, num14, ModContent.ProjectileType(), (int)(projectile.damage * Main.rand.NextFloat(0.3f, 0.6f)), projectile.knockBack * Main.rand.NextFloat(0.7f, 1f), projectile.owner, 0f, 0f); - } + SpawnBaseballBats(target.Center); } } @@ -257,22 +82,26 @@ namespace CalamityMod.Projectiles.Summon { if (Main.rand.NextBool(4)) { - for (int n = 0; n < Main.rand.Next(1, 3); n++) //1 to 2 baseball bats - { - float x = target.position.X + (float)Main.rand.Next(-400, 400); - float y = target.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num13 = target.position.X + (float)(target.width / 2) - vector.X; - float num14 = target.position.Y + (float)(target.height / 2) - vector.Y; - num13 += (float)Main.rand.Next(-100, 101); - int num15 = 29; - float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); - num16 = (float)num15 / num16; - num13 *= num16; - num14 *= num16; - Projectile.NewProjectile(x, y, num13, num14, ModContent.ProjectileType(), (int)(projectile.damage * Main.rand.NextFloat(0.3f, 0.6f)), projectile.knockBack * Main.rand.NextFloat(0.7f, 1f), projectile.owner, 0f, 0f); - } + SpawnBaseballBats(target.Center); } } + + private void SpawnBaseballBats(Vector2 targetPos) + { + for (int n = 0; n < Main.rand.Next(1, 3); n++) //1 to 2 baseball bats + { + float x = targetPos.X + Main.rand.Next(-400, 401); + float y = targetPos.Y - Main.rand.Next(500, 801); + Vector2 source = new Vector2(x, y); + Vector2 velocity = targetPos - source; + velocity.X += Main.rand.Next(-100, 101); + float speed = 29f; + float targetDist = velocity.Length(); + targetDist = speed / targetDist; + velocity.X *= targetDist; + velocity.Y *= targetDist; + Projectile.NewProjectile(source, velocity, ModContent.ProjectileType(), (int)(projectile.damage * Main.rand.NextFloat(0.3f, 0.6f)), projectile.knockBack * Main.rand.NextFloat(0.7f, 1f), projectile.owner, 0f, 0f); + } + } } } diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index eaa6a24b8d..224134ff26 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -1008,7 +1008,7 @@ namespace CalamityMod } } - public static void ChargingMinionAI(this Projectile projectile, float range, float maxPlayerDist, float extraMaxPlayerDist, float safeDist, int initialUpdates, float chargeDelayTime, float goToSpeed, float goBackSpeed, float chargeCounterMax, float chargeSpeed, bool tileVision, bool ignoreTilesWhenCharging) + public static void ChargingMinionAI(this Projectile projectile, float range, float maxPlayerDist, float extraMaxPlayerDist, float safeDist, int initialUpdates, float chargeDelayTime, float goToSpeed, float goBackSpeed, float chargeCounterMax, float chargeSpeed, bool tileVision, bool ignoreTilesWhenCharging, int updateDifference = 1) { Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); @@ -1021,7 +1021,7 @@ namespace CalamityMod if (projectile.ai[0] == 2f) { projectile.ai[1] += 1f; - projectile.extraUpdates = initialUpdates + (projectile.type == ModContent.ProjectileType() ? 2 : 1); + projectile.extraUpdates = initialUpdates + updateDifference; if (projectile.ai[1] > chargeDelayTime) { projectile.ai[1] = 1f; From 511aea2144f4681f019f682357c6b1b90f6c8b78 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 17:45:28 -0400 Subject: [PATCH 055/160] fixed compile errors --- Projectiles/Summon/AstralProbeRound.cs | 14 +++++++------- Projectiles/Summon/CalamariInk.cs | 6 +++--- Projectiles/Summon/CosmicBlast.cs | 3 ++- Projectiles/Summon/CosmicViperHomingRocket.cs | 4 ++-- Projectiles/Summon/CosmicViperSplittingRocket.cs | 4 ++-- Projectiles/Summon/FlameBlast.cs | 1 + Projectiles/Summon/FlameBurst.cs | 1 + Projectiles/Summon/Hiveling.cs | 7 ++++--- Projectiles/Summon/HowlsHeartHowl.cs | 2 +- Projectiles/Summon/SakuraBullet.cs | 2 +- 10 files changed, 24 insertions(+), 20 deletions(-) diff --git a/Projectiles/Summon/AstralProbeRound.cs b/Projectiles/Summon/AstralProbeRound.cs index c16233ed9c..8ec459fb29 100644 --- a/Projectiles/Summon/AstralProbeRound.cs +++ b/Projectiles/Summon/AstralProbeRound.cs @@ -42,11 +42,11 @@ namespace CalamityMod.Projectiles.Summon { ModContent.DustType(), ModContent.DustType() - } - int num137 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), 1, 1, randomDust, 0f, 0f, 0, default, 0.5f); - Main.dust[num137].alpha = projectile.alpha; - Main.dust[num137].velocity *= 0f; - Main.dust[num137].noGravity = true; + }; + int astral = Dust.NewDust(projectile.position, 1, 1, randomDust, 0f, 0f, 0, default, 0.5f); + Main.dust[astral].alpha = projectile.alpha; + Main.dust[astral].velocity *= 0f; + Main.dust[astral].noGravity = true; } float num472 = projectile.Center.X; float num473 = projectile.Center.Y; @@ -69,9 +69,9 @@ namespace CalamityMod.Projectiles.Summon } } } - else if (projectile.ai[0] != -1f && Main.npc[projectile.ai[0]].active) + else if (projectile.ai[0] != -1f && Main.npc[(int)projectile.ai[0]].active) { - NPC npc = Main.npc[projectile.ai[0]]; + NPC npc = Main.npc[(int)projectile.ai[0]]; if (npc.CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, npc.Center, 1, 1)) { float num476 = npc.Center.X; diff --git a/Projectiles/Summon/CalamariInk.cs b/Projectiles/Summon/CalamariInk.cs index f0e94cdf87..5ee1bbd833 100644 --- a/Projectiles/Summon/CalamariInk.cs +++ b/Projectiles/Summon/CalamariInk.cs @@ -60,15 +60,15 @@ namespace CalamityMod.Projectiles.Summon } } } - else if (Main.npc[projectile.ai[0]].active && projectile.ai[0] != -1f) + else if (Main.npc[(int)projectile.ai[0]].active && projectile.ai[0] != -1f) { - NPC npc = Main.npc[projectile.ai[0]]; + NPC npc = Main.npc[(int)projectile.ai[0]]; if (npc.CanBeChasedBy(projectile, false)) { float dist = (projectile.Center - npc.Center).Length(); if (dist < maxHomingRange) { - targetIdx = projectile.ai[0]; + targetIdx = (int)projectile.ai[0]; maxHomingRange = dist; hasHomingTarget = true; } diff --git a/Projectiles/Summon/CosmicBlast.cs b/Projectiles/Summon/CosmicBlast.cs index 5e57626bca..e079ae4079 100644 --- a/Projectiles/Summon/CosmicBlast.cs +++ b/Projectiles/Summon/CosmicBlast.cs @@ -32,7 +32,8 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + Player player = Main.player[projectile.owner]; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; projectile.frameCounter++; if (projectile.frameCounter > 4) { diff --git a/Projectiles/Summon/CosmicViperHomingRocket.cs b/Projectiles/Summon/CosmicViperHomingRocket.cs index 5ab0f6a362..31c43114e3 100644 --- a/Projectiles/Summon/CosmicViperHomingRocket.cs +++ b/Projectiles/Summon/CosmicViperHomingRocket.cs @@ -71,9 +71,9 @@ namespace CalamityMod.Projectiles.Summon } } } - else if (Main.npc[projectile.ai[0]].active && projectile.ai[0] != -1f) + else if (Main.npc[(int)projectile.ai[0]].active && projectile.ai[0] != -1f) { - NPC npc = Main.npc[projectile.ai[0]]; + NPC npc = Main.npc[(int)projectile.ai[0]]; if (npc.CanBeChasedBy(projectile, false)) { float extraDistance = (float)(npc.width / 2) + (float)(npc.height / 2); diff --git a/Projectiles/Summon/CosmicViperSplittingRocket.cs b/Projectiles/Summon/CosmicViperSplittingRocket.cs index 519a7581e3..96eb17d447 100644 --- a/Projectiles/Summon/CosmicViperSplittingRocket.cs +++ b/Projectiles/Summon/CosmicViperSplittingRocket.cs @@ -76,9 +76,9 @@ namespace CalamityMod.Projectiles.Summon } } } - else if (Main.npc[projectile.ai[0]].active && projectile.ai[0] != -1f) + else if (Main.npc[(int)projectile.ai[0]].active && projectile.ai[0] != -1f) { - NPC npc = Main.npc[projectile.ai[0]]; + NPC npc = Main.npc[(int)projectile.ai[0]]; if (npc.CanBeChasedBy(projectile, false)) { float extraDistance = (float)(npc.width / 2) + (float)(npc.height / 2); diff --git a/Projectiles/Summon/FlameBlast.cs b/Projectiles/Summon/FlameBlast.cs index 48a6fd7a06..3339600f83 100644 --- a/Projectiles/Summon/FlameBlast.cs +++ b/Projectiles/Summon/FlameBlast.cs @@ -29,6 +29,7 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; if (count == 0f) { Main.PlaySound(SoundID.Item73, projectile.position); diff --git a/Projectiles/Summon/FlameBurst.cs b/Projectiles/Summon/FlameBurst.cs index 534e6a92ec..795bf3520a 100644 --- a/Projectiles/Summon/FlameBurst.cs +++ b/Projectiles/Summon/FlameBurst.cs @@ -29,6 +29,7 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; if (count == 0f) { Main.PlaySound(SoundID.Item73, projectile.position); diff --git a/Projectiles/Summon/Hiveling.cs b/Projectiles/Summon/Hiveling.cs index 922d1c146f..fb4b693fb2 100644 --- a/Projectiles/Summon/Hiveling.cs +++ b/Projectiles/Summon/Hiveling.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; projectile.frameCounter++; if (projectile.frameCounter > 3) { @@ -61,9 +62,9 @@ namespace CalamityMod.Projectiles.Summon float num478 = Math.Abs(projectile.Center.X - num476) + Math.Abs(projectile.Center.Y - num477); if (num478 < num474) { - num472 = num476; - num473 = num477; - flag17 = true; + centerX = num476; + centerY = num477; + homeIn = true; } } } diff --git a/Projectiles/Summon/HowlsHeartHowl.cs b/Projectiles/Summon/HowlsHeartHowl.cs index d867ef7943..e1db603533 100644 --- a/Projectiles/Summon/HowlsHeartHowl.cs +++ b/Projectiles/Summon/HowlsHeartHowl.cs @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Summon maxRange = targetDist; targetPos = target.Center; foundEnemy = true; - targetIndex = npc.whoAmI; + targetIndex = target.whoAmI; } } //else, search through all available NPCs diff --git a/Projectiles/Summon/SakuraBullet.cs b/Projectiles/Summon/SakuraBullet.cs index 1f05c302cc..06852ff327 100644 --- a/Projectiles/Summon/SakuraBullet.cs +++ b/Projectiles/Summon/SakuraBullet.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Summon } else if (projectile.ai[0] != -1f) { - NPC npc = Main.npc[projectile.ai[0]]; + NPC npc = Main.npc[(int)projectile.ai[0]]; if ((npc.CanBeChasedBy(projectile, false) || npc.type == NPCID.DukeFishron) && npc.active) { float extraDistance = (npc.width / 2) + (npc.height / 2); From f221bf059d13616a0ef21cfd711f8d96467ae75d Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 17:59:37 -0400 Subject: [PATCH 056/160] refactored Halley's Inferno and Spark Spreader --- Items/Weapons/Ranged/HalleysInferno.cs | 90 ++++++++++---------- Items/Weapons/Ranged/SparkSpreader.cs | 87 +++++++++----------- Items/Weapons/Rogue/EclipsesFall.cs | 74 ++++++++--------- Items/Weapons/Summon/BensUmbrella.cs | 104 ++++++++++++------------ Projectiles/Ranged/HalleysComet.cs | 34 ++++---- Projectiles/Ranged/SparkSpreaderFire.cs | 76 ++++++++--------- Projectiles/Summon/AstralProbeRound.cs | 2 +- 7 files changed, 223 insertions(+), 244 deletions(-) diff --git a/Items/Weapons/Ranged/HalleysInferno.cs b/Items/Weapons/Ranged/HalleysInferno.cs index f313f0ea94..d30aae8053 100644 --- a/Items/Weapons/Ranged/HalleysInferno.cs +++ b/Items/Weapons/Ranged/HalleysInferno.cs @@ -8,53 +8,53 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged { - public class HalleysInferno : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Halley's Inferno"); - Tooltip.SetDefault("Halley came sooner than expected\n" + - "Fires a flaming comet\n" + - "50% chance to not consume gel\n" + - "Right click to zoom out"); - } + public class HalleysInferno : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Halley's Inferno"); + Tooltip.SetDefault("Halley came sooner than expected\n" + + "Fires a flaming comet\n" + + "50% chance to not consume gel\n" + + "Right click to zoom out"); + } - public override void SetDefaults() - { - item.damage = 1666; - item.crit += 20; - item.ranged = true; - item.width = 84; - item.height = 34; - item.useTime = 30; - item.useAnimation = 30; - item.useStyle = ItemUseStyleID.HoldingOut; - item.noMelee = true; - item.knockBack = 5f; - item.UseSound = SoundID.Item34; - item.value = Item.buyPrice(1, 40, 0, 0); - item.rare = 10; - item.Calamity().customRarity = CalamityRarity.PureGreen; - item.autoReuse = true; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 14.6f; - item.useAmmo = 23; - } + public override void SetDefaults() + { + item.damage = 1666; + item.crit += 20; + item.knockBack = 5f; + item.ranged = true; + item.useTime = item.useAnimation = 30; + item.autoReuse = true; + item.useAmmo = AmmoID.Gel; + item.shootSpeed = 14.6f; + item.shoot = ModContent.ProjectileType(); - public override Vector2? HoldoutOffset() => new Vector2(-15, 0); + item.width = 84; + item.height = 34; + item.useStyle = ItemUseStyleID.HoldingOut; + item.noMelee = true; + item.UseSound = SoundID.Item34; + item.value = Item.buyPrice(1, 40, 0, 0); + item.rare = 10; + item.Calamity().customRarity = CalamityRarity.PureGreen; + } - public override bool ConsumeAmmo(Player player) => Main.rand.Next(100) >= 50; + public override Vector2? HoldoutOffset() => new Vector2(-15, 0); - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 6); - recipe.AddIngredient(ModContent.ItemType(), 4); - recipe.AddIngredient(ModContent.ItemType(), 12); - recipe.AddIngredient(ItemID.SniperScope); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + public override bool ConsumeAmmo(Player player) => Main.rand.Next(100) >= 50; + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 6); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddIngredient(ModContent.ItemType(), 12); + recipe.AddIngredient(ItemID.SniperScope); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } diff --git a/Items/Weapons/Ranged/SparkSpreader.cs b/Items/Weapons/Ranged/SparkSpreader.cs index 5b9e319afc..449eae6502 100644 --- a/Items/Weapons/Ranged/SparkSpreader.cs +++ b/Items/Weapons/Ranged/SparkSpreader.cs @@ -6,55 +6,48 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged { - public class SparkSpreader : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Spark Spreader"); - Tooltip.SetDefault("20% chance to not consume gel"); - } + public class SparkSpreader : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spark Spreader"); + Tooltip.SetDefault("20% chance to not consume gel"); + } - public override void SetDefaults() - { - item.damage = 7; - item.ranged = true; - item.width = 52; - item.height = 20; - item.useTime = 10; - item.useAnimation = 30; - item.useStyle = ItemUseStyleID.HoldingOut; - item.noMelee = true; - item.knockBack = 1f; - item.UseSound = SoundID.Item34; - item.value = Item.buyPrice(0, 1, 0, 0); - item.rare = 1; - item.autoReuse = true; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 5f; - item.useAmmo = 23; - } + public override void SetDefaults() + { + item.damage = 7; + item.knockBack = 1f; + item.ranged = true; + item.autoReuse = true; + item.useTime = 10; + item.useAnimation = 30; + item.useAmmo = AmmoID.Gel; + item.shootSpeed = 5f; + item.shoot = ModContent.ProjectileType(); - public override Vector2? HoldoutOffset() - { - return new Vector2(-4, 0); - } + item.width = 52; + item.height = 20; + item.useStyle = ItemUseStyleID.HoldingOut; + item.noMelee = true; + item.UseSound = SoundID.Item34; + item.value = Item.buyPrice(0, 1, 0, 0); + item.rare = 1; + } - public override bool ConsumeAmmo(Player player) - { - if (Main.rand.Next(0, 100) < 20) - return false; - return true; - } + public override Vector2? HoldoutOffset() => new Vector2(-4, 0); - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.FlareGun, 1); - recipe.AddIngredient(ItemID.Ruby, 1); - recipe.AddIngredient(ItemID.Gel, 12); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + public override bool ConsumeAmmo(Player player) => Main.rand.Next(100) >= 20; + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.FlareGun); + recipe.AddIngredient(ItemID.Ruby); + recipe.AddIngredient(ItemID.Gel, 12); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } diff --git a/Items/Weapons/Rogue/EclipsesFall.cs b/Items/Weapons/Rogue/EclipsesFall.cs index 38c1d153a7..8afad26224 100644 --- a/Items/Weapons/Rogue/EclipsesFall.cs +++ b/Items/Weapons/Rogue/EclipsesFall.cs @@ -8,35 +8,35 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class EclipsesFall : RogueWeapon - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Eclipse's Fall"); - Tooltip.SetDefault("When the sun goes dark, you will know judgment\n" + - "Summons spears from the sky on hit\n" + - "Stealth strikes impale enemies and summon a constant barrage of spears over time"); - } + public class EclipsesFall : RogueWeapon + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eclipse's Fall"); + Tooltip.SetDefault("When the sun goes dark, you will know judgment\n" + + "Summons spears from the sky on hit\n" + + "Stealth strikes impale enemies and summon a constant barrage of spears over time"); + } - public override void SafeSetDefaults() - { - item.damage = 1060; - item.knockBack = 3.5f; - item.useAnimation = item.useTime = 21; - item.autoReuse = true; - item.Calamity().rogue = true; - item.shootSpeed = 15f; - item.shoot = ModContent.ProjectileType(); + public override void SafeSetDefaults() + { + item.damage = 1060; + item.knockBack = 3.5f; + item.useAnimation = item.useTime = 21; + item.autoReuse = true; + item.Calamity().rogue = true; + item.shootSpeed = 15f; + item.shoot = ModContent.ProjectileType(); - item.useStyle = ItemUseStyleID.SwingThrow; - item.width = item.height = 72; - item.noMelee = true; - item.noUseGraphic = true; - item.UseSound = SoundID.Item1; - item.value = Item.buyPrice(2, 50, 0, 0); - item.rare = 10; - item.Calamity().customRarity = CalamityRarity.Violet; - } + item.useStyle = ItemUseStyleID.SwingThrow; + item.width = item.height = 72; + item.noMelee = true; + item.noUseGraphic = true; + item.UseSound = SoundID.Item1; + item.value = Item.buyPrice(2, 50, 0, 0); + item.rare = 10; + item.Calamity().customRarity = CalamityRarity.Violet; + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { @@ -49,15 +49,15 @@ namespace CalamityMod.Items.Weapons.Rogue return false; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 15); - recipe.AddIngredient(ModContent.ItemType(), 6); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ModContent.ItemType(), 6); recipe.AddTile(ModContent.TileType()); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } diff --git a/Items/Weapons/Summon/BensUmbrella.cs b/Items/Weapons/Summon/BensUmbrella.cs index deb68215dc..dee041c074 100644 --- a/Items/Weapons/Summon/BensUmbrella.cs +++ b/Items/Weapons/Summon/BensUmbrella.cs @@ -9,65 +9,65 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { public class BensUmbrella : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Temporal Umbrella"); - Tooltip.SetDefault("Surprisingly sturdy, I reckon this could defeat the Mafia in a single blow\n" + + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Temporal Umbrella"); + Tooltip.SetDefault("Surprisingly sturdy, I reckon this could defeat the Mafia in a single blow\n" + "Summons a magic hat to hover above your head\n" + - "The hat will release a variety of objects to assault your foes\n" + - "Requires 5 minion slots to use\n" + - "There can only be one"); - } + "The hat will release a variety of objects to assault your foes\n" + + "Requires 5 minion slots to use\n" + + "There can only be one"); + } - public override void SetDefaults() - { - item.damage = 963; - item.knockBack = 1f; - item.mana = 99; - item.useTime = item.useAnimation = 10; - item.summon = true; - item.shootSpeed = 0f; - item.shoot = ModContent.ProjectileType(); + public override void SetDefaults() + { + item.damage = 963; + item.knockBack = 1f; + item.mana = 99; + item.useTime = item.useAnimation = 10; + item.summon = true; + item.shootSpeed = 0f; + item.shoot = ModContent.ProjectileType(); - item.useStyle = ItemUseStyleID.SwingThrow; - item.width = 74; - item.height = 72; - item.noMelee = true; - item.UseSound = SoundID.Item68; - item.value = Item.buyPrice(5, 0, 0, 0); - item.rare = 10; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; - } + item.useStyle = ItemUseStyleID.SwingThrow; + item.width = 74; + item.height = 72; + item.noMelee = true; + item.UseSound = SoundID.Item68; + item.value = Item.buyPrice(5, 0, 0, 0); + item.rare = 10; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; + } - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0 && player.maxMinions >= 5; + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0 && player.maxMinions >= 5; - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - for (int x = 0; x < Main.maxProjectiles; x++) - { - Projectile projectile = Main.projectile[x]; - if (projectile.active && projectile.owner == player.whoAmI && projectile.type == type) - { - projectile.Kill(); + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int x = 0; x < Main.maxProjectiles; x++) + { + Projectile projectile = Main.projectile[x]; + if (projectile.active && projectile.owner == player.whoAmI && projectile.type == type) + { + projectile.Kill(); break; - } - } - Projectile.NewProjectile(player.Center, Vector2.Zero, type, damage, knockBack, player.whoAmI); - return false; - } + } + } + Projectile.NewProjectile(player.Center, Vector2.Zero, type, damage, knockBack, player.whoAmI); + return false; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ItemID.Umbrella); - recipe.AddIngredient(ItemID.TopHat); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.Umbrella); + recipe.AddIngredient(ItemID.TopHat); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.AddTile(ModContent.TileType()); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } diff --git a/Projectiles/Ranged/HalleysComet.cs b/Projectiles/Ranged/HalleysComet.cs index fa16faba6b..4f36c704cf 100644 --- a/Projectiles/Ranged/HalleysComet.cs +++ b/Projectiles/Ranged/HalleysComet.cs @@ -13,8 +13,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetDefaults() { - projectile.width = 12; - projectile.height = 12; + projectile.width = projectile.height = 12; projectile.friendly = true; projectile.ignoreWater = true; projectile.ranged = true; @@ -29,32 +28,30 @@ namespace CalamityMod.Projectiles.Ranged { projectile.scale *= 1.01f; } + Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.35f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.45f / 255f); - if (projectile.timeLeft > 600) + + if (projectile.ai[0]++ > 5f) { - projectile.timeLeft = 600; - } - if (projectile.ai[0] > 5f) - { - float num296 = 1f; + float dustScaleSize = 1f; if (projectile.ai[0] == 6f) { - num296 = 0.25f; + dustScaleSize = 0.25f; } else if (projectile.ai[0] == 7f) { - num296 = 0.5f; + dustScaleSize = 0.5f; } else if (projectile.ai[0] == 8f) { - num296 = 0.75f; + dustScaleSize = 0.75f; } projectile.ai[0] += 1f; - int num297 = 176; - for (int num298 = 0; num298 < 3; num298++) + int dustType = 176; + for (int i = 0; i < 3; i++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 1, default, 1f); - Dust dust = Main.dust[num299]; + int fire = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 1, default, 1f); + Dust dust = Main.dust[fire]; if (Main.rand.NextBool(3)) { dust.noGravity = true; @@ -68,7 +65,7 @@ namespace CalamityMod.Projectiles.Ranged } dust.velocity.X *= 1.2f; dust.velocity.Y *= 1.2f; - dust.scale *= num296; + dust.scale *= dustScaleSize; dust.velocity += projectile.velocity; if (!dust.noGravity) { @@ -76,10 +73,7 @@ namespace CalamityMod.Projectiles.Ranged } } } - else - { - projectile.ai[0] += 1f; - } + projectile.rotation += 0.3f * (float)projectile.direction; } diff --git a/Projectiles/Ranged/SparkSpreaderFire.cs b/Projectiles/Ranged/SparkSpreaderFire.cs index 4fede1d4eb..9ee590766e 100644 --- a/Projectiles/Ranged/SparkSpreaderFire.cs +++ b/Projectiles/Ranged/SparkSpreaderFire.cs @@ -14,8 +14,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetDefaults() { - projectile.width = 12; - projectile.height = 12; + projectile.width = projectile.height = 12; projectile.friendly = true; projectile.ranged = true; projectile.penetrate = 3; @@ -28,65 +27,58 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.05f / 255f, (255 - projectile.alpha) * 0.45f / 255f, (255 - projectile.alpha) * 0.05f / 255f); - if (projectile.timeLeft > 60) - { - projectile.timeLeft = 60; - } + if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); } - if (Main.rand.Next(3) == 0) + + if (Main.rand.NextBool(3)) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 35, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 80, default, 0.75f); - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 50, default, 0.75f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, 35, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 80, default, 0.75f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, 55, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 50, default, 0.75f); } - if (projectile.ai[0] > 7f) + + if (projectile.ai[0]++ > 7f) { - float num296 = 1f; + float dustScaleSize = 1f; if (projectile.ai[0] == 8f) { - num296 = 0.25f; + dustScaleSize = 0.25f; } else if (projectile.ai[0] == 9f) { - num296 = 0.5f; + dustScaleSize = 0.5f; } else if (projectile.ai[0] == 10f) { - num296 = 0.75f; + dustScaleSize = 0.75f; } projectile.ai[0] += 1f; - int num297 = 6; - if (Main.rand.Next(1) == 0) - { - for (int num298 = 0; num298 < 2; num298++) - { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 10, default, 0.75f); - Dust dust = Main.dust[num299]; - if (Main.rand.Next(3) == 0) - { - dust.noGravity = true; - dust.scale *= 1.75f; - dust.velocity.X *= 2f; - dust.velocity.Y *= 2f; - } - else - { - dust.noGravity = true; - dust.scale *= 0.5f; - } - dust.velocity.X *= 1.2f; - dust.velocity.Y *= 1.2f; - dust.scale *= num296; - dust.velocity += projectile.velocity; - } + int dustType = DustID.Fire; + for (int i = 0; i < 2; i++) + { + int fire = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 10, default, 0.75f); + Dust dust = Main.dust[fire]; + if (Main.rand.Next(3) == 0) + { + dust.noGravity = true; + dust.scale *= 1.75f; + dust.velocity.X *= 2f; + dust.velocity.Y *= 2f; + } + else + { + dust.noGravity = true; + dust.scale *= 0.5f; + } + dust.velocity.X *= 1.2f; + dust.velocity.Y *= 1.2f; + dust.scale *= dustScaleSize; + dust.velocity += projectile.velocity; } } - else - { - projectile.ai[0] += 1f; - } + projectile.rotation += 0.3f * (float)projectile.direction; } diff --git a/Projectiles/Summon/AstralProbeRound.cs b/Projectiles/Summon/AstralProbeRound.cs index 8ec459fb29..09f08b9890 100644 --- a/Projectiles/Summon/AstralProbeRound.cs +++ b/Projectiles/Summon/AstralProbeRound.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Summon { ModContent.DustType(), ModContent.DustType() - }; + }); int astral = Dust.NewDust(projectile.position, 1, 1, randomDust, 0f, 0f, 0, default, 0.5f); Main.dust[astral].alpha = projectile.alpha; Main.dust[astral].velocity *= 0f; From 55ee74f99df59efb1976ae0063927a32122ada9a Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 18:07:33 -0400 Subject: [PATCH 057/160] Refactored bloodsoaked crasher --- Items/Weapons/Rogue/BloodsoakedCrasher.cs | 92 ++++----- Projectiles/Ranged/HalleysComet.cs | 7 +- Projectiles/Ranged/SparkSpreaderFire.cs | 5 + Projectiles/Rogue/BloodsoakedCrashax.cs | 233 +++++++++++----------- 4 files changed, 166 insertions(+), 171 deletions(-) diff --git a/Items/Weapons/Rogue/BloodsoakedCrasher.cs b/Items/Weapons/Rogue/BloodsoakedCrasher.cs index fc756358c2..55c542f890 100644 --- a/Items/Weapons/Rogue/BloodsoakedCrasher.cs +++ b/Items/Weapons/Rogue/BloodsoakedCrasher.cs @@ -7,56 +7,52 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class BloodsoakedCrasher : RogueWeapon //This weapon has been coded by Achilles|Termi|Ben + public class BloodsoakedCrasher : RogueWeapon //This weapon has been coded by Ben || Termi { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bloodsoaked Crasher"); - Tooltip.SetDefault("Slows down when hitting an enemy. Speeds up otherwise\n" + - "Heals on enemy hits\n" + - "Stealth strikes spawn homing blood on enemy hits"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bloodsoaked Crasher"); + Tooltip.SetDefault("Slows down when hitting an enemy. Speeds up otherwise\n" + + "Heals on enemy hits\n" + + "Stealth strikes spawn homing blood on enemy hits"); + } - public override void SafeSetDefaults() - { - item.width = 66; - item.damage = 300; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 18; - item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 18; - item.knockBack = 3f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 64; - item.value = Item.buyPrice(1, 40, 0, 0); - item.rare = 10; - item.Calamity().customRarity = CalamityRarity.PureGreen; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 15f; - item.Calamity().rogue = true; - } + public override void SafeSetDefaults() + { + item.damage = 300; + item.knockBack = 3f; + item.autoReuse = true; + item.Calamity().rogue = true; + item.useAnimation = item.useTime = 18; + item.shootSpeed = 15f; + item.shoot = ModContent.ProjectileType(); - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike - { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 1f); - Main.projectile[stealth].Calamity().stealthStrike = true; - return false; - } - return true; - } + item.width = 66; + item.height = 64; + item.noMelee = true; + item.noUseGraphic = true; + item.useStyle = ItemUseStyleID.SwingThrow; + item.UseSound = SoundID.Item1; + item.value = Item.buyPrice(1, 40, 0, 0); + item.rare = 10; + item.Calamity().customRarity = CalamityRarity.PureGreen; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); //post-Prov rogue weapon - recipe.AddIngredient(ModContent.ItemType(), 1); - recipe.AddIngredient(ModContent.ItemType(), 12); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); //setting the stealth strike + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); //post-Prov rogue weapon + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 12); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } diff --git a/Projectiles/Ranged/HalleysComet.cs b/Projectiles/Ranged/HalleysComet.cs index 4f36c704cf..791ce568d8 100644 --- a/Projectiles/Ranged/HalleysComet.cs +++ b/Projectiles/Ranged/HalleysComet.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Ranged int dustType = 176; for (int i = 0; i < 3; i++) { - int fire = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 1, default, 1f); + int fire = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 1, default, 1f); Dust dust = Main.dust[fire]; if (Main.rand.NextBool(3)) { @@ -80,6 +80,11 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 300); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 300); } } } diff --git a/Projectiles/Ranged/SparkSpreaderFire.cs b/Projectiles/Ranged/SparkSpreaderFire.cs index 9ee590766e..97f9a05507 100644 --- a/Projectiles/Ranged/SparkSpreaderFire.cs +++ b/Projectiles/Ranged/SparkSpreaderFire.cs @@ -85,6 +85,11 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.OnFire, 60 * Main.rand.Next(1, 4)); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.OnFire, 60 * Main.rand.Next(1, 4)); } } } diff --git a/Projectiles/Rogue/BloodsoakedCrashax.cs b/Projectiles/Rogue/BloodsoakedCrashax.cs index 802f3d0811..c214516c1e 100644 --- a/Projectiles/Rogue/BloodsoakedCrashax.cs +++ b/Projectiles/Rogue/BloodsoakedCrashax.cs @@ -7,133 +7,122 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class BloodsoakedCrashax : ModProjectile - { - private int bounce = 3; //number of times it bounces - private int grind = 0; //used to know when to slow down + public class BloodsoakedCrashax : ModProjectile + { + private int bounce = 3; //number of times it bounces + private int grind = 0; //used to know when to slow down - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bloodsoaked Crasher"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bloodsoaked Crasher"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } - public override void SetDefaults() - { - projectile.width = 30; - projectile.height = 30; - projectile.friendly = true; - projectile.penetrate = 10; - projectile.aiStyle = 2; - projectile.timeLeft = 600; //10 seconds and counting - aiType = ProjectileID.ThrowingKnife; //Throwing Knife AI - projectile.Calamity().rogue = true; - projectile.usesIDStaticNPCImmunity = true; - projectile.idStaticNPCHitCooldown = 5; - projectile.extraUpdates = 1; - } + public override void SetDefaults() + { + projectile.width = projectile.height = 30; + projectile.friendly = true; + projectile.penetrate = 10; + projectile.timeLeft = 600; //10 seconds and counting + projectile.aiStyle = 2; + aiType = ProjectileID.ThrowingKnife; //Throwing Knife AI + projectile.Calamity().rogue = true; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 5; + projectile.extraUpdates = 1; + } - public override void AI() - { - grind--; - if (grind <= 0) - { - grind = 0; - } - if (grind >= 1) - { - projectile.extraUpdates = 0; //stop, you're touching an enemy - projectile.velocity.X *= 0.75f; - projectile.velocity.Y *= 0.75f; - } - else - { - projectile.velocity.X *= 1.005f; //you broke up, time to yeet yourself out - projectile.velocity.Y *= 1.005f; - if (projectile.velocity.X > 16f) - { - projectile.velocity.X = 16f; - } - if (projectile.velocity.Y > 16f) - { - projectile.velocity.Y = 16f; - } - projectile.extraUpdates = 1; - } - } + public override void AI() + { + if (grind > 0) + { + grind--; + } + if (grind >= 1) + { + projectile.extraUpdates = 0; //stop, you're touching an enemy + projectile.velocity.X *= 0.75f; + projectile.velocity.Y *= 0.75f; + } + else + { + projectile.velocity.X *= 1.005f; //you broke up, time to yeet yourself out + projectile.velocity.Y *= 1.005f; + if (projectile.velocity.X > 16f) + { + projectile.velocity.X = 16f; + } + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } + projectile.extraUpdates = 1; + } + } - public override bool OnTileCollide(Vector2 oldVelocity) - { - bounce--; - if (bounce <= 0) - { - projectile.Kill(); //you can only bounce so much 'til death - } - else - { - if (projectile.velocity.X != oldVelocity.X) - { - projectile.velocity.X = -oldVelocity.X; - } - if (projectile.velocity.Y != oldVelocity.Y) - { - projectile.velocity.Y = -oldVelocity.Y; - } - } - return false; - } + public override bool OnTileCollide(Vector2 oldVelocity) + { + bounce--; + if (bounce <= 0) + { + projectile.Kill(); //you can only bounce so much 'til death + } + else + { + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + } + return false; + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - grind += 5; //THE GRIND NEVER STOPS - if (grind >= 10) - { - grind = 10; - } - Player player = Main.player[projectile.owner]; - target.AddBuff(ModContent.BuffType(), 300); - if (projectile.ai[1] == 1f && projectile.owner == Main.myPlayer && grind >= 1) //stealth strike attack - { - int stealth = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - Main.projectile[stealth].Calamity().forceRogue = true; - } - if (!target.canGhostHeal || player.moonLeech) //canGhostHeal be like lol - { - return; - } - if (Main.rand.NextBool(2)) - { - player.statLife += 1; //Trello said 2 hp per hit. Sounds like a fat balancing problem. - player.HealEffect(1); - } - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 300); + OnHitEffects(); + } - public override void OnHitPvp(Player target, int damage, bool crit) - { - grind += 5; //THE GRIND NEVER STOPS - if (grind >= 10) - { - grind = 10; - } - Player player = Main.player[projectile.owner]; - target.AddBuff(ModContent.BuffType(), 300); - if (projectile.ai[1] == 1f && projectile.owner == Main.myPlayer && grind >= 1) //stealth strike attack - { - int stealth = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - Main.projectile[stealth].Calamity().forceRogue = true; - } - if (Main.rand.NextBool(2)) - { - player.statLife += 1; //Trello said 2 hp per hit. Sounds like a fat balancing problem. - player.HealEffect(1); - } - } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 300); + OnHitEffects(); + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) //afterimages - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - } + private void OnHitEffects() + { + if (grind < 10) + { + grind += 5; //THE GRIND NEVER STOPS + } + + if (projectile.Calamity().stealthStrike && projectile.owner == Main.myPlayer) //stealth strike attack + { + int stealth = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Main.projectile[stealth].Calamity().forceRogue = true; + } + + Player player = Main.player[projectile.owner]; + if (!target.canGhostHeal || player.moonLeech) //canGhostHeal be like lol + { + return; + } + if (Main.rand.NextBool(2)) + { + player.statLife += 1; //Trello said 2 hp per hit. Sounds like a fat balancing problem. + player.HealEffect(1); + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) //afterimages + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + } } From b8e292b29cda0f562d95cfc2ab45e5cbd755d7b8 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 18:33:30 -0400 Subject: [PATCH 058/160] fixed compile error --- Projectiles/Rogue/BloodsoakedCrashax.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Projectiles/Rogue/BloodsoakedCrashax.cs b/Projectiles/Rogue/BloodsoakedCrashax.cs index c214516c1e..d871f158a9 100644 --- a/Projectiles/Rogue/BloodsoakedCrashax.cs +++ b/Projectiles/Rogue/BloodsoakedCrashax.cs @@ -85,16 +85,16 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 300); - OnHitEffects(); + OnHitEffects(!target.canGhostHeal || Main.player[projectile.owner].moonLeech); } public override void OnHitPvp(Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType(), 300); - OnHitEffects(); + OnHitEffects(Main.player[projectile.owner].moonLeech); } - private void OnHitEffects() + private void OnHitEffects(bool cannotLifesteal) { if (grind < 10) { @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Rogue } Player player = Main.player[projectile.owner]; - if (!target.canGhostHeal || player.moonLeech) //canGhostHeal be like lol + if (cannotLifesteal) //canGhostHeal be like lol { return; } From e965c7ccafce2abfe1de2b88823b94a16eea517a Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 19:23:05 -0400 Subject: [PATCH 059/160] refactored Rotom Pet --- Buffs/Pets/RotomBuff.cs | 41 ++--- Items/Pets/RotomRemote.cs | 80 +++++----- Projectiles/Pets/RotomPet.cs | 258 ++++++++++++++++++-------------- Projectiles/Summon/MagicBird.cs | 1 - 4 files changed, 204 insertions(+), 176 deletions(-) diff --git a/Buffs/Pets/RotomBuff.cs b/Buffs/Pets/RotomBuff.cs index e667577316..fe3f71b6cb 100644 --- a/Buffs/Pets/RotomBuff.cs +++ b/Buffs/Pets/RotomBuff.cs @@ -1,28 +1,29 @@ using CalamityMod.Projectiles.Pets; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Pets { - public class RotomBuff : ModBuff - { - public override void SetDefaults() - { - DisplayName.SetDefault("Electric Troublemaker"); - Description.SetDefault("Lightning never strikes the same place twice"); - Main.buffNoTimeDisplay[Type] = true; - Main.vanityPet[Type] = true; - } + public class RotomBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Electric Troublemaker"); + Description.SetDefault("Lightning never strikes the same place twice"); + Main.buffNoTimeDisplay[Type] = true; + Main.vanityPet[Type] = true; + } - public override void Update(Player player, ref int buffIndex) - { - player.buffTime[buffIndex] = 18000; - player.Calamity().rotomPet = true; - bool PetProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0; - if (PetProjectileNotSpawned && player.whoAmI == Main.myPlayer) - { - Projectile.NewProjectile(player.position.X + (player.width / 2), player.position.Y + (player.height / 2), 0f, 0f, ModContent.ProjectileType(), 0, 0f, player.whoAmI, 50f, 0f); - } - } - } + public override void Update(Player player, ref int buffIndex) + { + player.buffTime[buffIndex] = 18000; + player.Calamity().rotomPet = true; + bool PetProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0; + if (PetProjectileNotSpawned && player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); + } + } + } } diff --git a/Items/Pets/RotomRemote.cs b/Items/Pets/RotomRemote.cs index a1c7771531..6122e39750 100644 --- a/Items/Pets/RotomRemote.cs +++ b/Items/Pets/RotomRemote.cs @@ -10,39 +10,39 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Pets { - public class RotomRemote : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Triboluminescent Etomer"); - Tooltip.SetDefault("Summons an electric troublemaker\n" + + public class RotomRemote : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Triboluminescent Etomer"); + Tooltip.SetDefault("Summons an electric troublemaker\n" + "A little note is attached:\n" + "Thank you, Aloe! Very much appreciated from Ben"); - } + } - public override void SetDefaults() - { - item.damage = 0; - item.useTime = 20; - item.useAnimation = 20; - item.useStyle = ItemUseStyleID.SwingThrow; - item.noMelee = true; - item.width = 30; - item.height = 34; - item.value = Item.buyPrice(0, 4, 0, 0); - item.UseSound = SoundID.Item113; - item.shoot = ModContent.ProjectileType(); - item.buffType = ModContent.BuffType(); - item.rare = 3; - } + public override void SetDefaults() + { + item.damage = 0; + item.useTime = item.useAnimation = 20; + item.shoot = ModContent.ProjectileType(); + item.buffType = ModContent.BuffType(); - public override void UseStyle(Player player) - { - if (player.whoAmI == Main.myPlayer && player.itemTime == 0) - { - player.AddBuff(item.buffType, 3600, true); - } - } + item.width = 30; + item.height = 34; + item.useStyle = ItemUseStyleID.SwingThrow; + item.noMelee = true; + item.UseSound = SoundID.Item113; + item.value = Item.buyPrice(0, 4, 0, 0); + item.rare = 3; + } + + public override void UseStyle(Player player) + { + if (player.whoAmI == Main.myPlayer && player.itemTime == 0) + { + player.AddBuff(item.buffType, 3600, true); + } + } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { @@ -51,15 +51,15 @@ namespace CalamityMod.Items.Pets spriteBatch.Draw(texture, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddRecipeGroup("AnyGoldBar", 8); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddRecipeGroup("AnyGoldBar", 8); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } diff --git a/Projectiles/Pets/RotomPet.cs b/Projectiles/Pets/RotomPet.cs index 241890e028..8a476517d6 100644 --- a/Projectiles/Pets/RotomPet.cs +++ b/Projectiles/Pets/RotomPet.cs @@ -6,138 +6,166 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Pets { public class RotomPet : ModProjectile - { - private int biome = 0; - private float dust = 0f; + { + private bool initialized = false; + private int form = 0; + private const int Normal = 0; + private const int Dex = 1; + private const int Wash = 2; + private const int Heat = 3; + private const int Frost = 4; + private const int Mow = 5; + private const int Fan = 6; - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rotom"); - Main.projFrames[projectile.type] = 4; - Main.projPet[projectile.type] = true; - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rotom"); + Main.projFrames[projectile.type] = 4; + Main.projPet[projectile.type] = true; + } - public override void SetDefaults() - { - projectile.netImportant = true; - projectile.width = 30; - projectile.height = 30; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.timeLeft *= 5; - } + public override void SetDefaults() + { + projectile.netImportant = true; + projectile.width = projectile.height = 30; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.timeLeft *= 5; + } - public override void AI() - { - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); + public override void AI() + { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); - if (CalamityPlayer.areThereAnyDamnBosses) - biome = 1; //dex - else if (player.ZoneBeach || player.Calamity().ZoneSunkenSea || player.Calamity().ZoneSulphur || player.Calamity().ZoneAbyss) - biome = 2; //wash - else if (player.ZoneTowerSolar || player.ZoneDesert || player.ZoneUndergroundDesert || player.ZoneUnderworldHeight || player.Calamity().ZoneCalamity) - biome = 3; //heat - else if (player.ZoneSnow || Main.snowMoon) - biome = 4; //frost - else if (player.ZoneJungle) - biome = 5; //mow - else if (player.ZoneSkyHeight || player.ZoneMeteor || player.Calamity().ZoneAstral) - biome = 6; //fan - else - biome = 0; //anything else + if (!player.active) + { + projectile.active = false; + return; + } + if (player.dead) + { + modPlayer.rotomPet = false; + } + if (modPlayer.rotomPet) + { + projectile.timeLeft = 2; + } - if (!player.active) - { - projectile.active = false; - return; - } - if (player.dead) - { - modPlayer.rotomPet = false; - } - if (modPlayer.rotomPet) - { - projectile.timeLeft = 2; - } + if (!initialized) + { + DustEffects(); + initialized = true; + } - if (dust == 0f) - { - int num501 = 25; - for (int num502 = 0; num502 < num501; num502++) - { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 132, 0f, 0f, 0, default, 1f); - Main.dust[num503].velocity *= 2f; - Main.dust[num503].scale *= 1.15f; - } - dust += 1f; - } + UpdateForm(player); + UpdateFrames(); projectile.FloatingPetAI(true, 0.05f); + } - projectile.frameCounter++; - if (projectile.frameCounter > 6) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame >= 4) - { - projectile.frame = 0; - } - } + private void UpdateForm(Player player) + { + if (CalamityPlayer.areThereAnyDamnBosses) + form = Dex; + else if (player.ZoneBeach || player.InSunkenSea() || player.InSulphur() || player.InAbyss()) + form = Wash; + else if (player.ZoneTowerSolar || player.ZoneDesert || player.ZoneUndergroundDesert || player.ZoneUnderworldHeight || player.InCalamity()) + form = Heat; + else if (player.ZoneSnow || Main.snowMoon) + form = Frost; + else if (player.ZoneJungle) + form = Mow; + else if (player.ZoneSkyHeight || player.ZoneMeteor || player.InAstral()) + form = Fan; + else + form = Normal; + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D texture = Main.projectileTexture[projectile.type]; - if (biome == 1) - texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomDex"); - if (biome == 2) - texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomWash"); - if (biome == 3) - texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomHeat"); - if (biome == 4) - texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomFrost"); - if (biome == 5) - texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomMow"); - if (biome == 6) - texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomFan"); - int height = texture.Height / Main.projFrames[projectile.type]; - int frameHeight = height * projectile.frame; - SpriteEffects spriteEffects = SpriteEffects.None; - if (projectile.spriteDirection == -1) - spriteEffects = SpriteEffects.FlipHorizontally; - Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture.Width / 2f, (float)height / 2f), projectile.scale, spriteEffects, 0f); - return false; - } + private void DustEffects() + { + int dustAmt = 25; + for (int i = 0; i < dustAmt; i++) + { + int electric = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 132, 0f, 0f, 0, default, 1f); + Main.dust[electric].velocity *= 2f; + Main.dust[electric].scale *= 1.15f; + } + } + + private void UpdateFrames() + { + if (projectile.frameCounter % 6 == 0) + { + projectile.frame++; + } + if (projectile.frame >= 4) + { + projectile.frame = 0; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Drawing(spriteBatch, lightColor, + Main.projectileTexture[projectile.type], + ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomDex"), + ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomWash"), + ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomHeat"), + ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomFrost"), + ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomMow"), + ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomFan")); + return false; + } public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) { - Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomPetGlow"); - if (biome == 1) - texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomDexGlow"); - if (biome == 2) - texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomWashGlow"); - if (biome == 3) - texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomHeatGlow"); - if (biome == 4) - texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomFrostGlow"); - if (biome == 5) - texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomMowGlow"); - if (biome == 6) - texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomFanGlow"); - int num214 = texture.Height / Main.projFrames[projectile.type]; - int y6 = num214 * projectile.frame; + Drawing(spriteBatch, Color.White, + ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomPetGlow"), + ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomDexGlow"), + ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomWashGlow"), + ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomHeatGlow"), + ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomFrostGlow"), + ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomMowGlow"), + ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomFanGlow")); + } + + private void Drawing(SpriteBatch spriteBatch, Color color, Texture2D normal, Texture2D dex, Texture2D wash, Texture2D heat, Texture2D frost, Texture2D mow, Texture2D fan) + { + Texture2D texture = normal; + switch (form) + { + case Dex: + texture = dex; + break; + case Wash: + texture = wash; + break; + case Heat: + texture = heat; + break; + case Frost: + texture = frost; + break; + case Mow: + texture = mow; + break; + case Fan: + texture = fan; + break; + default: + break; + } + + int height = texture.Height / Main.projFrames[projectile.type]; + int frameHeight = height * projectile.frame; SpriteEffects spriteEffects = SpriteEffects.None; if (projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; - spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Color.White, projectile.rotation, new Vector2((float)texture.Width / 2f, (float)num214 / 2f), projectile.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), color, projectile.rotation, new Vector2(texture.Width / 2f, height / 2f), projectile.scale, spriteEffects, 0f); } - public override bool CanDamage() - { - return false; - } - } + public override bool CanDamage() => false; + } } diff --git a/Projectiles/Summon/MagicBird.cs b/Projectiles/Summon/MagicBird.cs index eca8ff4e74..288deed720 100644 --- a/Projectiles/Summon/MagicBird.cs +++ b/Projectiles/Summon/MagicBird.cs @@ -39,7 +39,6 @@ namespace CalamityMod.Projectiles.Summon if (projectile.frameCounter++ % 6 == 0) { projectile.frame++; - projectile.frameCounter = 0; } if (projectile.frame >= 7) { From 51db7dcba6648f828406bd2940e87b8fb0cd9f71 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 19:46:55 -0400 Subject: [PATCH 060/160] refactored mad alchemist's cocktail & fixed a bug with the clouds --- Projectiles/Magic/MadAlchemistsCocktailAlt.cs | 195 +++++++++--------- .../Magic/MadAlchemistsCocktailBlue.cs | 28 +-- .../Magic/MadAlchemistsCocktailGasCloud.cs | 41 ++-- .../Magic/MadAlchemistsCocktailGreen.cs | 39 ++-- .../Magic/MadAlchemistsCocktailPurple.cs | 22 +- Projectiles/Magic/MadAlchemistsCocktailRed.cs | 83 +++----- .../Magic/MadAlchemistsCocktailShrapnel.cs | 33 ++- 7 files changed, 196 insertions(+), 245 deletions(-) diff --git a/Projectiles/Magic/MadAlchemistsCocktailAlt.cs b/Projectiles/Magic/MadAlchemistsCocktailAlt.cs index 4f67a37f6f..e919f45390 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailAlt.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailAlt.cs @@ -6,108 +6,103 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class MadAlchemistsCocktailAlt : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mad Alchemist's Cocktail"); - } + public class MadAlchemistsCocktailAlt : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mad Alchemist's Cocktail"); + } - public override void SetDefaults() - { - projectile.width = 24; - projectile.height = 24; - projectile.friendly = true; - projectile.magic = true; - projectile.ignoreWater = true; - projectile.penetrate = 1; - } + public override void SetDefaults() + { + projectile.width = 24; + projectile.height = 24; + projectile.friendly = true; + projectile.magic = true; + projectile.ignoreWater = true; + projectile.penetrate = 1; + } - public override void AI() - { - projectile.rotation += Math.Abs(projectile.velocity.X) * 0.04f * (float)projectile.direction; - projectile.ai[0] += 1f; - if (projectile.ai[0] >= 90f) - { - projectile.velocity.Y = projectile.velocity.Y + 0.4f; - projectile.velocity.X = projectile.velocity.X * 0.97f; - } - if (projectile.velocity.Y > 16f) - { - projectile.velocity.Y = 16f; - } - } + public override void AI() + { + MadAlchemistsCocktailBlue.FlaskAI(); + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(BuffID.Poisoned, 300); - target.AddBuff(BuffID.OnFire, 300); - target.AddBuff(BuffID.CursedInferno, 180); - target.AddBuff(BuffID.Frostburn, 300); - target.AddBuff(BuffID.Venom, 300); - target.AddBuff(BuffID.ShadowFlame, 300); - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(BuffID.Poisoned, 300); + target.AddBuff(BuffID.OnFire, 300); + target.AddBuff(BuffID.CursedInferno, 180); + target.AddBuff(BuffID.Frostburn, 300); + target.AddBuff(BuffID.Venom, 300); + target.AddBuff(BuffID.ShadowFlame, 300); + } - public override void Kill(int timeLeft) - { - Main.PlaySound(SoundID.Item107, projectile.position); - Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 704, 1f); - Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 705, 1f); - int height = 120; - float num51 = 1.8f; - float num52 = 2.5f; - Vector2 value3 = (0f - 1.57079637f).ToRotationVector2(); - Vector2 value4 = value3 * projectile.velocity.Length() * (float)projectile.MaxUpdates; - Main.PlaySound(SoundID.Item20, projectile.Center); - projectile.position = projectile.Center; - projectile.width = projectile.height = height; - projectile.Center = projectile.position; - projectile.maxPenetrate = -1; - projectile.penetrate = -1; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; - projectile.damage *= 2; - projectile.Damage(); - int num3; - for (int num53 = 0; num53 < 40; num53 = num3 + 1) - { - int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 200, default, num52); - Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; - Main.dust[num54].noGravity = true; - Dust dust = Main.dust[num54]; - dust.velocity *= 4f; - dust = Main.dust[num54]; - dust.velocity += value4 * Main.rand.NextFloat(); - num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 100, default, num51); - Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; - dust = Main.dust[num54]; - dust.velocity *= 3f; - Main.dust[num54].noGravity = true; - num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 100, default, num51); - Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; - dust = Main.dust[num54]; - dust.velocity *= 2f; - Main.dust[num54].noGravity = true; - Main.dust[num54].fadeIn = 1f; - Main.dust[num54].color = Color.Green * 0.5f; - dust = Main.dust[num54]; - dust.velocity += value4 * Main.rand.NextFloat(); - num3 = num53; - } - for (int num55 = 0; num55 < 20; num55 = num3 + 1) - { - int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 0, default, num52); - Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 3f; - Main.dust[num56].noGravity = true; - Dust dust = Main.dust[num56]; - dust.velocity *= 0.5f; - dust = Main.dust[num56]; - dust.velocity += value4 * (0.6f + 0.6f * Main.rand.NextFloat()); - num3 = num55; - } - } - } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(BuffID.Poisoned, 300); + target.AddBuff(BuffID.OnFire, 300); + target.AddBuff(BuffID.CursedInferno, 180); + target.AddBuff(BuffID.Frostburn, 300); + target.AddBuff(BuffID.Venom, 300); + target.AddBuff(BuffID.ShadowFlame, 300); + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item107, projectile.position); + Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 704, 1f); + Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 705, 1f); + int height = 120; + float dustScaleA = 2.5f; + float dustScaleB = 1.8f; + Vector2 dustDirection = (-MathHelper.PiOver2).ToRotationVector2(); + Vector2 dustVel = dustDirection * projectile.velocity.Length() * projectile.MaxUpdates; + Main.PlaySound(SoundID.Item20, projectile.Center); + projectile.position = projectile.Center; + projectile.width = projectile.height = height; + projectile.Center = projectile.position; + projectile.maxPenetrate = -1; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.damage *= 2; + projectile.Damage(); + for (int i = 0; i < 40; i++) + { + int prettyEffects = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 200, default, dustScaleA); + Dust dust = Main.dust[prettyEffects]; + dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; + dust.noGravity = true; + dust.velocity *= 4f; + dust.velocity += dustVel * Main.rand.NextFloat(); + prettyEffects = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 100, default, dustScaleB); + dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; + dust.velocity *= 3f; + dust.noGravity = true; + prettyEffects = Dust.NewDust(projectile.position, projectile.width, projectile.height, 229, 0f, 0f, 100, default, dustScaleB); + dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; + dust.velocity *= 2f; + dust.noGravity = true; + dust.fadeIn = 1f; + dust.color = Color.Green * 0.5f; + dust.velocity += dustVel * Main.rand.NextFloat(); + } + for (int j = 0; j < 20; j++) + { + int dusty = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 0, default, num52); + Dust dust = Main.dust[dusty]; + dust.position = projectile.Center + Vector2.UnitX.RotatedByRandom(Math.PI).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 3f; + dust.noGravity = true; + dust.velocity *= 0.5f; + dust.velocity += dustVel * (0.6f + 0.6f * Main.rand.NextFloat()); + } + } + } } diff --git a/Projectiles/Magic/MadAlchemistsCocktailBlue.cs b/Projectiles/Magic/MadAlchemistsCocktailBlue.cs index 801fa20a18..fae5e77400 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailBlue.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailBlue.cs @@ -25,33 +25,37 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - projectile.rotation += Math.Abs(projectile.velocity.X) * 0.04f * (float)projectile.direction; - projectile.ai[0] += 1f; - if (projectile.ai[0] >= 90f) + FlaskAI(); + } + + public static void FlaskAI() + { + projectile.rotation += Math.Abs(projectile.velocity.X) * 0.04f * projectile.direction; + if (projectile.ai[0]++ >= 90f) { - projectile.velocity.Y = projectile.velocity.Y + 0.4f; - projectile.velocity.X = projectile.velocity.X * 0.97f; + projectile.velocity.Y += 0.4f; + projectile.velocity.X *= 0.97f; } if (projectile.velocity.Y > 16f) { projectile.velocity.Y = 16f; } - } + } public override void Kill(int timeLeft) { Main.PlaySound(SoundID.Item107, projectile.position); Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 705, 1f); - int num220 = Main.rand.Next(20, 31); + int projAmt = Main.rand.Next(20, 31); if (projectile.owner == Main.myPlayer) { - for (int num221 = 0; num221 < num220; num221++) + for (int i = 0; i < projAmt; i++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value17.X, value17.Y, ModContent.ProjectileType(), projectile.damage / 4, 0f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + Vector2 velocity = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); + velocity.Normalize(); + velocity *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage / 4, 0f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } diff --git a/Projectiles/Magic/MadAlchemistsCocktailGasCloud.cs b/Projectiles/Magic/MadAlchemistsCocktailGasCloud.cs index d4d16ef5e5..7e75163b43 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailGasCloud.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailGasCloud.cs @@ -39,37 +39,40 @@ namespace CalamityMod.Projectiles.Magic projectile.rotation += projectile.velocity.X * 0.1f; projectile.rotation += (float)projectile.direction * 0.003f; projectile.velocity *= 0.96f; - Rectangle rectangle5 = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); - int num3; - for (int num894 = 0; num894 < 1000; num894 = num3 + 1) + + Rectangle cloudHitbox = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); + for (int i = 0; i < Main.maxProjectiles; i++) { - if (num894 != projectile.whoAmI && Main.projectile[num894].active) + Projectile otherProj = Main.projectile[i]; + // Short circuits to make the loop as fast as possible + if (!otherProj.active || otherProj.owner != projectile.owner || !otherProj.minion || i == projectile.whoAmI) + continue; + + if (otherProj.type == projectile.type) { - Rectangle value43 = new Rectangle((int)Main.projectile[num894].position.X, (int)Main.projectile[num894].position.Y, Main.projectile[num894].width, Main.projectile[num894].height); - if (rectangle5.Intersects(value43)) + Rectangle otherProjHitbox = new Rectangle((int)otherProj.position.X, (int)otherProj.position.Y, otherProj.width, otherProj.height); + if (cloudHitbox.Intersects(otherProjHitbox)) { - Vector2 vector105 = Main.projectile[num894].Center - projectile.Center; - if (vector105.X == 0f && vector105.Y == 0f) + Vector2 projDistance = otherProj.Center - projectile.Center; + if (projDistance.X == 0f && projDistance.Y == 0f) { - if (num894 < projectile.whoAmI) + if (i < projectile.whoAmI) { - vector105.X = -1f; - vector105.Y = 1f; + projDistance.X = -1f; + projDistance.Y = 1f; } else { - vector105.X = 1f; - vector105.Y = -1f; + projDistance.X = 1f; + projDistance.Y = -1f; } } - vector105.Normalize(); - vector105 *= 0.005f; - projectile.velocity -= vector105; - Projectile projectile2 = Main.projectile[num894]; - projectile2.velocity += vector105; + projDistance.Normalize(); + projDistance *= 0.005f; + projectile.velocity -= projDistance; + otherProj.velocity += projDistance; } } - num3 = num894; } } } diff --git a/Projectiles/Magic/MadAlchemistsCocktailGreen.cs b/Projectiles/Magic/MadAlchemistsCocktailGreen.cs index dc1add9ccf..abbb577c5d 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailGreen.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailGreen.cs @@ -25,17 +25,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - projectile.rotation += Math.Abs(projectile.velocity.X) * 0.04f * (float)projectile.direction; - projectile.ai[0] += 1f; - if (projectile.ai[0] >= 90f) - { - projectile.velocity.Y = projectile.velocity.Y + 0.4f; - projectile.velocity.X = projectile.velocity.X * 0.97f; - } - if (projectile.velocity.Y > 16f) - { - projectile.velocity.Y = 16f; - } + MadAlchemistsCocktailBlue.FlaskAI(); } public override void Kill(int timeLeft) @@ -44,23 +34,22 @@ namespace CalamityMod.Projectiles.Magic Main.PlaySound(SoundID.Item88, projectile.position); Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 705, 1f); - for (int num118 = 0; num118 < 3; num118++) + for (int i = 0; i < 3; i++) { - float x = projectile.position.X + (float)Main.rand.Next(-100, 100); - float y = projectile.position.Y - (float)Main.rand.Next(500, 600); - Vector2 vector = new Vector2(x, y); - float num15 = projectile.position.X + (float)(projectile.width / 2) - vector.X; - float num16 = projectile.position.Y + (float)(projectile.height / 2) - vector.Y; - num15 += (float)Main.rand.Next(-100, 101); - int num17 = 25; - float num18 = (float)Math.Sqrt((double)(num15 * num15 + num16 * num16)); - num18 = (float)num17 / num18; - num15 *= num18; - num16 *= num18; + float x = projectile.Center.X + Main.rand.Next(-100, 100); + float y = projectile.Center.Y - Main.rand.Next(500, 600); + Vector2 source = new Vector2(x, y); + Vector2 velocity = projectile.Center - source; + velocity.X += Main.rand.Next(-100, 101); + float speed = 25f; + float targetDist = velocity.Length(); + targetDist = speed / targetDist; + velocity.X *= targetDist; + velocity.Y *= targetDist; - float ai2 = num16 + projectile.position.Y; + float ai2 = velocity.Y + projectile.position.Y; if (projectile.owner == Main.myPlayer) - Projectile.NewProjectile(x, y, num15, num16, ProjectileID.LunarFlare, projectile.damage / 2, 5f, projectile.owner, 0f, ai2); + Projectile.NewProjectile(source, velocity, ProjectileID.LunarFlare, projectile.damage / 2, projectile.knockBack * 2f, projectile.owner, 0f, ai2); } } } diff --git a/Projectiles/Magic/MadAlchemistsCocktailPurple.cs b/Projectiles/Magic/MadAlchemistsCocktailPurple.cs index 7188ea80f2..7ad2daf8c2 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailPurple.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailPurple.cs @@ -25,17 +25,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - projectile.rotation += Math.Abs(projectile.velocity.X) * 0.04f * (float)projectile.direction; - projectile.ai[0] += 1f; - if (projectile.ai[0] >= 90f) - { - projectile.velocity.Y = projectile.velocity.Y + 0.4f; - projectile.velocity.X = projectile.velocity.X * 0.97f; - } - if (projectile.velocity.Y > 16f) - { - projectile.velocity.Y = 16f; - } + MadAlchemistsCocktailBlue.FlaskAI(); } public override void Kill(int timeLeft) @@ -45,12 +35,12 @@ namespace CalamityMod.Projectiles.Magic Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 705, 1f); if (projectile.owner == Main.myPlayer) { - for (int num221 = 0; num221 < 4; num221++) + for (int i = 0; i < 4; i++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value17.X, value17.Y, ModContent.ProjectileType(), projectile.damage / 3, 0f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + Vector2 velocity = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); + velocity.Normalize(); + velocity *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage / 3, 0f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } diff --git a/Projectiles/Magic/MadAlchemistsCocktailRed.cs b/Projectiles/Magic/MadAlchemistsCocktailRed.cs index b7946e54e1..1e8c561156 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailRed.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailRed.cs @@ -25,27 +25,17 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - projectile.rotation += Math.Abs(projectile.velocity.X) * 0.04f * (float)projectile.direction; - projectile.ai[0] += 1f; - if (projectile.ai[0] >= 90f) - { - projectile.velocity.Y = projectile.velocity.Y + 0.4f; - projectile.velocity.X = projectile.velocity.X * 0.97f; - } - if (projectile.velocity.Y > 16f) - { - projectile.velocity.Y = 16f; - } + MadAlchemistsCocktailBlue.FlaskAI(); } public override void Kill(int timeLeft) { int height = 480; - float num50 = 3f; - float num51 = 2.4f; - float num52 = 3.8f; - Vector2 value3 = (0f - 1.57079637f).ToRotationVector2(); - Vector2 value4 = value3 * projectile.velocity.Length() * (float)projectile.MaxUpdates; + float dustScaleA = 3f; + float dustScaleB = 2.4f; + float dustScaleC = 3.8f; + Vector2 dustDirection = (-MathHelper.PiOver2).ToRotationVector2(); + Vector2 dustVel = dustDirection * projectile.velocity.Length() * projectile.MaxUpdates; Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 20, 2f, 0f); Main.PlaySound(SoundID.Item107, projectile.position); Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 704, 1f); @@ -59,55 +49,44 @@ namespace CalamityMod.Projectiles.Magic projectile.localNPCHitCooldown = 10; projectile.damage *= 3; projectile.Damage(); - int num3; - for (int num53 = 0; num53 < 60; num53 = num3 + 1) + for (int i = 0; i < 60; i++) { - int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 200, default, num50); - Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; - Main.dust[num54].noGravity = true; - Dust dust = Main.dust[num54]; + int red = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 200, default, dustScaleA); + Dust dust = Main.dust[red]; + dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; + dust.noGravity = true; dust.velocity *= 8f; - dust = Main.dust[num54]; dust.velocity += value4 * Main.rand.NextFloat(); - num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 100, default, num51); - Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; - dust = Main.dust[num54]; + red = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 100, default, dustScaleB); + dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; dust.velocity *= 6f; - Main.dust[num54].noGravity = true; - Main.dust[num54].fadeIn = 1f; - Main.dust[num54].color = Color.Crimson * 0.5f; - dust = Main.dust[num54]; + dust.noGravity = true; + dust.fadeIn = 1f; + dust.color = Color.Crimson * 0.5f; dust.velocity += value4 * Main.rand.NextFloat(); - num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 100, default, num51); - Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; - dust = Main.dust[num54]; + red = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 100, default, dustScaleB); + dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; dust.velocity *= 4f; - Main.dust[num54].noGravity = true; - Main.dust[num54].fadeIn = 1f; - Main.dust[num54].color = Color.Crimson * 0.5f; - dust = Main.dust[num54]; + dust.noGravity = true; + dust.fadeIn = 1f; + dust.color = Color.Crimson * 0.5f; dust.velocity += value4 * Main.rand.NextFloat(); - num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 100, default, num51); - Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; - dust = Main.dust[num54]; + red = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 100, default, dustScaleB); + dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; dust.velocity *= 2f; - Main.dust[num54].noGravity = true; - Main.dust[num54].fadeIn = 1f; - Main.dust[num54].color = Color.Crimson * 0.5f; - dust = Main.dust[num54]; + dust.noGravity = true; + dust.fadeIn = 1f; + dust.color = Color.Crimson * 0.5f; dust.velocity += value4 * Main.rand.NextFloat(); - num3 = num53; } - for (int num55 = 0; num55 < 30; num55 = num3 + 1) + for (int j = 0; j < 30; j++) { - int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 0, default, num52); - Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 3f; - Main.dust[num56].noGravity = true; - Dust dust = Main.dust[num56]; + int crimson = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 0, default, dustScaleC); + Dust dust = Main.dust[crimson]; + dust.position = projectile.Center + Vector2.UnitX.RotatedByRandom(Math.PI).RotatedBy((double)projectile.velocity.ToRotation(), default) * projectile.width / 3f; + dust.noGravity = true; dust.velocity *= 0.5f; - dust = Main.dust[num56]; dust.velocity += value4 * (0.6f + 0.6f * Main.rand.NextFloat()); - num3 = num55; } } } diff --git a/Projectiles/Magic/MadAlchemistsCocktailShrapnel.cs b/Projectiles/Magic/MadAlchemistsCocktailShrapnel.cs index 0cd115e19d..523bac558b 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailShrapnel.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailShrapnel.cs @@ -24,27 +24,18 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - Vector2 value7 = new Vector2(6f, 12f); - projectile.localAI[0] += 1f; - if (projectile.localAI[0] == 48f) - { - projectile.localAI[0] = 0f; - } - else - { - for (int num41 = 0; num41 < 2; num41++) - { - Vector2 value8 = Vector2.UnitX * -15f; - value8 = -Vector2.UnitY.RotatedBy((double)(projectile.localAI[0] * 0.1308997f + (float)num41 * 3.14159274f), default) * value7 * 0.75f; - int num42 = Dust.NewDust(projectile.Center, 0, 0, 173, 0f, 0f, 160, default, 0.75f); - Main.dust[num42].noGravity = true; - Main.dust[num42].position = projectile.Center + value8; - Main.dust[num42].velocity = projectile.velocity; - } - } - - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1f); - Main.dust[num458].noGravity = true; + Vector2 adjustVec = new Vector2(6f, 12f); + for (int i = 0; i < 2; i++) + { + Vector2 offset = Vector2.UnitX * -15f; + offset = -Vector2.UnitY.RotatedBy((double)(projectile.localAI[0] * 0.1308997f + i * MathHelper.Pi), default) * adjustVec * 0.75f; + int shrapnel = Dust.NewDust(projectile.Center, 0, 0, 173, 0f, 0f, 160, default, 0.75f); + Main.dust[shrapnel].noGravity = true; + Main.dust[shrapnel].position = projectile.Center + offset; + Main.dust[shrapnel].velocity = projectile.velocity; + } + int violet = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1f); + Main.dust[violet].noGravity = true; CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 500f, 12f, 20f); } From cd0651339c44400064820aed96998b6b3c52035e Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 20:07:59 -0400 Subject: [PATCH 061/160] more adjustments --- Projectiles/Magic/MadAlchemistsCocktailAlt.cs | 10 ++++----- .../Magic/MadAlchemistsCocktailBlue.cs | 13 ++++++----- .../Magic/MadAlchemistsCocktailGreen.cs | 10 ++++----- .../Magic/MadAlchemistsCocktailPurple.cs | 6 ++--- Projectiles/Magic/MadAlchemistsCocktailRed.cs | 22 +++++++++---------- Projectiles/Pets/RotomPet.cs | 4 +++- Projectiles/Summon/MagicBird.cs | 4 +++- 7 files changed, 37 insertions(+), 32 deletions(-) diff --git a/Projectiles/Magic/MadAlchemistsCocktailAlt.cs b/Projectiles/Magic/MadAlchemistsCocktailAlt.cs index e919f45390..0e6798b3e3 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailAlt.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailAlt.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - MadAlchemistsCocktailBlue.FlaskAI(); + MadAlchemistsCocktailBlue.FlaskAI(projectile); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) @@ -78,16 +78,16 @@ namespace CalamityMod.Projectiles.Magic { int prettyEffects = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 200, default, dustScaleA); Dust dust = Main.dust[prettyEffects]; - dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; + dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * (float)projectile.width / 2f; dust.noGravity = true; dust.velocity *= 4f; dust.velocity += dustVel * Main.rand.NextFloat(); prettyEffects = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 100, default, dustScaleB); - dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; + dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * (float)projectile.width / 2f; dust.velocity *= 3f; dust.noGravity = true; prettyEffects = Dust.NewDust(projectile.position, projectile.width, projectile.height, 229, 0f, 0f, 100, default, dustScaleB); - dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; + dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * (float)projectile.width / 2f; dust.velocity *= 2f; dust.noGravity = true; dust.fadeIn = 1f; @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Magic } for (int j = 0; j < 20; j++) { - int dusty = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 0, default, num52); + int dusty = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 0, default, dustScaleA); Dust dust = Main.dust[dusty]; dust.position = projectile.Center + Vector2.UnitX.RotatedByRandom(Math.PI).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 3f; dust.noGravity = true; diff --git a/Projectiles/Magic/MadAlchemistsCocktailBlue.cs b/Projectiles/Magic/MadAlchemistsCocktailBlue.cs index fae5e77400..02437c1e9f 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailBlue.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailBlue.cs @@ -25,13 +25,14 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - FlaskAI(); + FlaskAI(projectile); } - public static void FlaskAI() + public static void FlaskAI(Projectile projectile) { projectile.rotation += Math.Abs(projectile.velocity.X) * 0.04f * projectile.direction; - if (projectile.ai[0]++ >= 90f) + projectile.ai[0] += 1f; + if (projectile.ai[0] >= 90f) { projectile.velocity.Y += 0.4f; projectile.velocity.X *= 0.97f; @@ -52,10 +53,10 @@ namespace CalamityMod.Projectiles.Magic { for (int i = 0; i < projAmt; i++) { - Vector2 velocity = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); + Vector2 velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); velocity.Normalize(); - velocity *= Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage / 4, 0f, projectile.owner, 0f, Main.rand.Next(-45, 1)); + velocity *= (float)Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage / 4, 0f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); } } } diff --git a/Projectiles/Magic/MadAlchemistsCocktailGreen.cs b/Projectiles/Magic/MadAlchemistsCocktailGreen.cs index abbb577c5d..a3ba3735a4 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailGreen.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailGreen.cs @@ -25,13 +25,13 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - MadAlchemistsCocktailBlue.FlaskAI(); + MadAlchemistsCocktailBlue.FlaskAI(projectile); } public override void Kill(int timeLeft) { - Main.PlaySound(SoundID.Item107, projectile.position); - Main.PlaySound(SoundID.Item88, projectile.position); + Main.PlaySound(SoundID.Item107, projectile.Center); + Main.PlaySound(SoundID.Item88, projectile.Center); Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 705, 1f); for (int i = 0; i < 3; i++) @@ -40,14 +40,14 @@ namespace CalamityMod.Projectiles.Magic float y = projectile.Center.Y - Main.rand.Next(500, 600); Vector2 source = new Vector2(x, y); Vector2 velocity = projectile.Center - source; - velocity.X += Main.rand.Next(-100, 101); + velocity.X += (float)Main.rand.Next(-100, 101); float speed = 25f; float targetDist = velocity.Length(); targetDist = speed / targetDist; velocity.X *= targetDist; velocity.Y *= targetDist; - float ai2 = velocity.Y + projectile.position.Y; + float ai2 = velocity.Y + projectile.Center.Y; if (projectile.owner == Main.myPlayer) Projectile.NewProjectile(source, velocity, ProjectileID.LunarFlare, projectile.damage / 2, projectile.knockBack * 2f, projectile.owner, 0f, ai2); } diff --git a/Projectiles/Magic/MadAlchemistsCocktailPurple.cs b/Projectiles/Magic/MadAlchemistsCocktailPurple.cs index 7ad2daf8c2..3bd5c523b3 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailPurple.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailPurple.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - MadAlchemistsCocktailBlue.FlaskAI(); + MadAlchemistsCocktailBlue.FlaskAI(projectile); } public override void Kill(int timeLeft) @@ -37,9 +37,9 @@ namespace CalamityMod.Projectiles.Magic { for (int i = 0; i < 4; i++) { - Vector2 velocity = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); + Vector2 velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); velocity.Normalize(); - velocity *= Main.rand.Next(10, 201) * 0.01f; + velocity *= (float)Main.rand.Next(10, 201) * 0.01f; Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage / 3, 0f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } diff --git a/Projectiles/Magic/MadAlchemistsCocktailRed.cs b/Projectiles/Magic/MadAlchemistsCocktailRed.cs index 1e8c561156..a8bdafa60c 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailRed.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailRed.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - MadAlchemistsCocktailBlue.FlaskAI(); + MadAlchemistsCocktailBlue.FlaskAI(projectile); } public override void Kill(int timeLeft) @@ -53,40 +53,40 @@ namespace CalamityMod.Projectiles.Magic { int red = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 200, default, dustScaleA); Dust dust = Main.dust[red]; - dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; + dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * (float)projectile.width / 2f; dust.noGravity = true; dust.velocity *= 8f; - dust.velocity += value4 * Main.rand.NextFloat(); + dust.velocity += dustVel * Main.rand.NextFloat(); red = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 100, default, dustScaleB); - dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; + dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * (float)projectile.width / 2f; dust.velocity *= 6f; dust.noGravity = true; dust.fadeIn = 1f; dust.color = Color.Crimson * 0.5f; - dust.velocity += value4 * Main.rand.NextFloat(); + dust.velocity += dustVel * Main.rand.NextFloat(); red = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 100, default, dustScaleB); - dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; + dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * (float)projectile.width / 2f; dust.velocity *= 4f; dust.noGravity = true; dust.fadeIn = 1f; dust.color = Color.Crimson * 0.5f; - dust.velocity += value4 * Main.rand.NextFloat(); + dust.velocity += dustVel * Main.rand.NextFloat(); red = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 100, default, dustScaleB); - dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; + dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * (float)projectile.width / 2f; dust.velocity *= 2f; dust.noGravity = true; dust.fadeIn = 1f; dust.color = Color.Crimson * 0.5f; - dust.velocity += value4 * Main.rand.NextFloat(); + dust.velocity += dustVel * Main.rand.NextFloat(); } for (int j = 0; j < 30; j++) { int crimson = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 0, default, dustScaleC); Dust dust = Main.dust[crimson]; - dust.position = projectile.Center + Vector2.UnitX.RotatedByRandom(Math.PI).RotatedBy((double)projectile.velocity.ToRotation(), default) * projectile.width / 3f; + dust.position = projectile.Center + Vector2.UnitX.RotatedByRandom(Math.PI).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 3f; dust.noGravity = true; dust.velocity *= 0.5f; - dust.velocity += value4 * (0.6f + 0.6f * Main.rand.NextFloat()); + dust.velocity += dustVel * (0.6f + 0.6f * Main.rand.NextFloat()); } } } diff --git a/Projectiles/Pets/RotomPet.cs b/Projectiles/Pets/RotomPet.cs index 8a476517d6..ef5c3e8378 100644 --- a/Projectiles/Pets/RotomPet.cs +++ b/Projectiles/Pets/RotomPet.cs @@ -95,9 +95,11 @@ namespace CalamityMod.Projectiles.Pets private void UpdateFrames() { - if (projectile.frameCounter % 6 == 0) + projectile.frameCounter++; + if (projectile.frameCounter > 6) { projectile.frame++; + projectile.frameCounter = 0; } if (projectile.frame >= 4) { diff --git a/Projectiles/Summon/MagicBird.cs b/Projectiles/Summon/MagicBird.cs index 288deed720..64b185c573 100644 --- a/Projectiles/Summon/MagicBird.cs +++ b/Projectiles/Summon/MagicBird.cs @@ -36,9 +36,11 @@ namespace CalamityMod.Projectiles.Summon projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); - if (projectile.frameCounter++ % 6 == 0) + projectile.frameCounter++; + if (projectile.frameCounter > 6) { projectile.frame++; + projectile.frameCounter = 0; } if (projectile.frame >= 7) { From 2fd21a6ce48174192b82279dcebf7c27e3a0073e Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 20:20:25 -0400 Subject: [PATCH 062/160] Revert "more adjustments" This reverts commit cd0651339c44400064820aed96998b6b3c52035e. --- Projectiles/Magic/MadAlchemistsCocktailAlt.cs | 10 ++++----- .../Magic/MadAlchemistsCocktailBlue.cs | 13 +++++------ .../Magic/MadAlchemistsCocktailGreen.cs | 10 ++++----- .../Magic/MadAlchemistsCocktailPurple.cs | 6 ++--- Projectiles/Magic/MadAlchemistsCocktailRed.cs | 22 +++++++++---------- Projectiles/Pets/RotomPet.cs | 4 +--- Projectiles/Summon/MagicBird.cs | 4 +--- 7 files changed, 32 insertions(+), 37 deletions(-) diff --git a/Projectiles/Magic/MadAlchemistsCocktailAlt.cs b/Projectiles/Magic/MadAlchemistsCocktailAlt.cs index 0e6798b3e3..e919f45390 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailAlt.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailAlt.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - MadAlchemistsCocktailBlue.FlaskAI(projectile); + MadAlchemistsCocktailBlue.FlaskAI(); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) @@ -78,16 +78,16 @@ namespace CalamityMod.Projectiles.Magic { int prettyEffects = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 200, default, dustScaleA); Dust dust = Main.dust[prettyEffects]; - dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * (float)projectile.width / 2f; + dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; dust.noGravity = true; dust.velocity *= 4f; dust.velocity += dustVel * Main.rand.NextFloat(); prettyEffects = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 100, default, dustScaleB); - dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * (float)projectile.width / 2f; + dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; dust.velocity *= 3f; dust.noGravity = true; prettyEffects = Dust.NewDust(projectile.position, projectile.width, projectile.height, 229, 0f, 0f, 100, default, dustScaleB); - dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * (float)projectile.width / 2f; + dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; dust.velocity *= 2f; dust.noGravity = true; dust.fadeIn = 1f; @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Magic } for (int j = 0; j < 20; j++) { - int dusty = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 0, default, dustScaleA); + int dusty = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 0, default, num52); Dust dust = Main.dust[dusty]; dust.position = projectile.Center + Vector2.UnitX.RotatedByRandom(Math.PI).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 3f; dust.noGravity = true; diff --git a/Projectiles/Magic/MadAlchemistsCocktailBlue.cs b/Projectiles/Magic/MadAlchemistsCocktailBlue.cs index 02437c1e9f..fae5e77400 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailBlue.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailBlue.cs @@ -25,14 +25,13 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - FlaskAI(projectile); + FlaskAI(); } - public static void FlaskAI(Projectile projectile) + public static void FlaskAI() { projectile.rotation += Math.Abs(projectile.velocity.X) * 0.04f * projectile.direction; - projectile.ai[0] += 1f; - if (projectile.ai[0] >= 90f) + if (projectile.ai[0]++ >= 90f) { projectile.velocity.Y += 0.4f; projectile.velocity.X *= 0.97f; @@ -53,10 +52,10 @@ namespace CalamityMod.Projectiles.Magic { for (int i = 0; i < projAmt; i++) { - Vector2 velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 velocity = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); velocity.Normalize(); - velocity *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage / 4, 0f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + velocity *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage / 4, 0f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } diff --git a/Projectiles/Magic/MadAlchemistsCocktailGreen.cs b/Projectiles/Magic/MadAlchemistsCocktailGreen.cs index a3ba3735a4..abbb577c5d 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailGreen.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailGreen.cs @@ -25,13 +25,13 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - MadAlchemistsCocktailBlue.FlaskAI(projectile); + MadAlchemistsCocktailBlue.FlaskAI(); } public override void Kill(int timeLeft) { - Main.PlaySound(SoundID.Item107, projectile.Center); - Main.PlaySound(SoundID.Item88, projectile.Center); + Main.PlaySound(SoundID.Item107, projectile.position); + Main.PlaySound(SoundID.Item88, projectile.position); Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 705, 1f); for (int i = 0; i < 3; i++) @@ -40,14 +40,14 @@ namespace CalamityMod.Projectiles.Magic float y = projectile.Center.Y - Main.rand.Next(500, 600); Vector2 source = new Vector2(x, y); Vector2 velocity = projectile.Center - source; - velocity.X += (float)Main.rand.Next(-100, 101); + velocity.X += Main.rand.Next(-100, 101); float speed = 25f; float targetDist = velocity.Length(); targetDist = speed / targetDist; velocity.X *= targetDist; velocity.Y *= targetDist; - float ai2 = velocity.Y + projectile.Center.Y; + float ai2 = velocity.Y + projectile.position.Y; if (projectile.owner == Main.myPlayer) Projectile.NewProjectile(source, velocity, ProjectileID.LunarFlare, projectile.damage / 2, projectile.knockBack * 2f, projectile.owner, 0f, ai2); } diff --git a/Projectiles/Magic/MadAlchemistsCocktailPurple.cs b/Projectiles/Magic/MadAlchemistsCocktailPurple.cs index 3bd5c523b3..7ad2daf8c2 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailPurple.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailPurple.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - MadAlchemistsCocktailBlue.FlaskAI(projectile); + MadAlchemistsCocktailBlue.FlaskAI(); } public override void Kill(int timeLeft) @@ -37,9 +37,9 @@ namespace CalamityMod.Projectiles.Magic { for (int i = 0; i < 4; i++) { - Vector2 velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 velocity = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); velocity.Normalize(); - velocity *= (float)Main.rand.Next(10, 201) * 0.01f; + velocity *= Main.rand.Next(10, 201) * 0.01f; Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage / 3, 0f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } diff --git a/Projectiles/Magic/MadAlchemistsCocktailRed.cs b/Projectiles/Magic/MadAlchemistsCocktailRed.cs index a8bdafa60c..1e8c561156 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailRed.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailRed.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - MadAlchemistsCocktailBlue.FlaskAI(projectile); + MadAlchemistsCocktailBlue.FlaskAI(); } public override void Kill(int timeLeft) @@ -53,40 +53,40 @@ namespace CalamityMod.Projectiles.Magic { int red = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 200, default, dustScaleA); Dust dust = Main.dust[red]; - dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * (float)projectile.width / 2f; + dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; dust.noGravity = true; dust.velocity *= 8f; - dust.velocity += dustVel * Main.rand.NextFloat(); + dust.velocity += value4 * Main.rand.NextFloat(); red = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 100, default, dustScaleB); - dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * (float)projectile.width / 2f; + dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; dust.velocity *= 6f; dust.noGravity = true; dust.fadeIn = 1f; dust.color = Color.Crimson * 0.5f; - dust.velocity += dustVel * Main.rand.NextFloat(); + dust.velocity += value4 * Main.rand.NextFloat(); red = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 100, default, dustScaleB); - dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * (float)projectile.width / 2f; + dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; dust.velocity *= 4f; dust.noGravity = true; dust.fadeIn = 1f; dust.color = Color.Crimson * 0.5f; - dust.velocity += dustVel * Main.rand.NextFloat(); + dust.velocity += value4 * Main.rand.NextFloat(); red = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 100, default, dustScaleB); - dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * (float)projectile.width / 2f; + dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; dust.velocity *= 2f; dust.noGravity = true; dust.fadeIn = 1f; dust.color = Color.Crimson * 0.5f; - dust.velocity += dustVel * Main.rand.NextFloat(); + dust.velocity += value4 * Main.rand.NextFloat(); } for (int j = 0; j < 30; j++) { int crimson = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 0, default, dustScaleC); Dust dust = Main.dust[crimson]; - dust.position = projectile.Center + Vector2.UnitX.RotatedByRandom(Math.PI).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 3f; + dust.position = projectile.Center + Vector2.UnitX.RotatedByRandom(Math.PI).RotatedBy((double)projectile.velocity.ToRotation(), default) * projectile.width / 3f; dust.noGravity = true; dust.velocity *= 0.5f; - dust.velocity += dustVel * (0.6f + 0.6f * Main.rand.NextFloat()); + dust.velocity += value4 * (0.6f + 0.6f * Main.rand.NextFloat()); } } } diff --git a/Projectiles/Pets/RotomPet.cs b/Projectiles/Pets/RotomPet.cs index ef5c3e8378..8a476517d6 100644 --- a/Projectiles/Pets/RotomPet.cs +++ b/Projectiles/Pets/RotomPet.cs @@ -95,11 +95,9 @@ namespace CalamityMod.Projectiles.Pets private void UpdateFrames() { - projectile.frameCounter++; - if (projectile.frameCounter > 6) + if (projectile.frameCounter % 6 == 0) { projectile.frame++; - projectile.frameCounter = 0; } if (projectile.frame >= 4) { diff --git a/Projectiles/Summon/MagicBird.cs b/Projectiles/Summon/MagicBird.cs index 64b185c573..288deed720 100644 --- a/Projectiles/Summon/MagicBird.cs +++ b/Projectiles/Summon/MagicBird.cs @@ -36,11 +36,9 @@ namespace CalamityMod.Projectiles.Summon projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); - projectile.frameCounter++; - if (projectile.frameCounter > 6) + if (projectile.frameCounter++ % 6 == 0) { projectile.frame++; - projectile.frameCounter = 0; } if (projectile.frame >= 7) { From 8de56632579db65dc9178f9d2b2de4efe83ced00 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 20:20:38 -0400 Subject: [PATCH 063/160] Revert "refactored mad alchemist's cocktail & fixed a bug with the clouds" This reverts commit 51db7dcba6648f828406bd2940e87b8fb0cd9f71. --- Projectiles/Magic/MadAlchemistsCocktailAlt.cs | 195 +++++++++--------- .../Magic/MadAlchemistsCocktailBlue.cs | 28 ++- .../Magic/MadAlchemistsCocktailGasCloud.cs | 41 ++-- .../Magic/MadAlchemistsCocktailGreen.cs | 39 ++-- .../Magic/MadAlchemistsCocktailPurple.cs | 22 +- Projectiles/Magic/MadAlchemistsCocktailRed.cs | 83 +++++--- .../Magic/MadAlchemistsCocktailShrapnel.cs | 33 +-- 7 files changed, 245 insertions(+), 196 deletions(-) diff --git a/Projectiles/Magic/MadAlchemistsCocktailAlt.cs b/Projectiles/Magic/MadAlchemistsCocktailAlt.cs index e919f45390..4f67a37f6f 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailAlt.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailAlt.cs @@ -6,103 +6,108 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class MadAlchemistsCocktailAlt : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mad Alchemist's Cocktail"); - } + public class MadAlchemistsCocktailAlt : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mad Alchemist's Cocktail"); + } - public override void SetDefaults() - { - projectile.width = 24; - projectile.height = 24; - projectile.friendly = true; - projectile.magic = true; - projectile.ignoreWater = true; - projectile.penetrate = 1; - } + public override void SetDefaults() + { + projectile.width = 24; + projectile.height = 24; + projectile.friendly = true; + projectile.magic = true; + projectile.ignoreWater = true; + projectile.penetrate = 1; + } - public override void AI() - { - MadAlchemistsCocktailBlue.FlaskAI(); - } + public override void AI() + { + projectile.rotation += Math.Abs(projectile.velocity.X) * 0.04f * (float)projectile.direction; + projectile.ai[0] += 1f; + if (projectile.ai[0] >= 90f) + { + projectile.velocity.Y = projectile.velocity.Y + 0.4f; + projectile.velocity.X = projectile.velocity.X * 0.97f; + } + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(BuffID.Poisoned, 300); - target.AddBuff(BuffID.OnFire, 300); - target.AddBuff(BuffID.CursedInferno, 180); - target.AddBuff(BuffID.Frostburn, 300); - target.AddBuff(BuffID.Venom, 300); - target.AddBuff(BuffID.ShadowFlame, 300); - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(BuffID.Poisoned, 300); + target.AddBuff(BuffID.OnFire, 300); + target.AddBuff(BuffID.CursedInferno, 180); + target.AddBuff(BuffID.Frostburn, 300); + target.AddBuff(BuffID.Venom, 300); + target.AddBuff(BuffID.ShadowFlame, 300); + } - public override void OnHitPvp(Player target, int damage, bool crit) - { - target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(BuffID.Poisoned, 300); - target.AddBuff(BuffID.OnFire, 300); - target.AddBuff(BuffID.CursedInferno, 180); - target.AddBuff(BuffID.Frostburn, 300); - target.AddBuff(BuffID.Venom, 300); - target.AddBuff(BuffID.ShadowFlame, 300); - } - - public override void Kill(int timeLeft) - { - Main.PlaySound(SoundID.Item107, projectile.position); - Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 704, 1f); - Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 705, 1f); - int height = 120; - float dustScaleA = 2.5f; - float dustScaleB = 1.8f; - Vector2 dustDirection = (-MathHelper.PiOver2).ToRotationVector2(); - Vector2 dustVel = dustDirection * projectile.velocity.Length() * projectile.MaxUpdates; - Main.PlaySound(SoundID.Item20, projectile.Center); - projectile.position = projectile.Center; - projectile.width = projectile.height = height; - projectile.Center = projectile.position; - projectile.maxPenetrate = -1; - projectile.penetrate = -1; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; - projectile.damage *= 2; - projectile.Damage(); - for (int i = 0; i < 40; i++) - { - int prettyEffects = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 200, default, dustScaleA); - Dust dust = Main.dust[prettyEffects]; - dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; - dust.noGravity = true; - dust.velocity *= 4f; - dust.velocity += dustVel * Main.rand.NextFloat(); - prettyEffects = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 100, default, dustScaleB); - dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; - dust.velocity *= 3f; - dust.noGravity = true; - prettyEffects = Dust.NewDust(projectile.position, projectile.width, projectile.height, 229, 0f, 0f, 100, default, dustScaleB); - dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; - dust.velocity *= 2f; - dust.noGravity = true; - dust.fadeIn = 1f; - dust.color = Color.Green * 0.5f; - dust.velocity += dustVel * Main.rand.NextFloat(); - } - for (int j = 0; j < 20; j++) - { - int dusty = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 0, default, num52); - Dust dust = Main.dust[dusty]; - dust.position = projectile.Center + Vector2.UnitX.RotatedByRandom(Math.PI).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 3f; - dust.noGravity = true; - dust.velocity *= 0.5f; - dust.velocity += dustVel * (0.6f + 0.6f * Main.rand.NextFloat()); - } - } - } + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item107, projectile.position); + Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 704, 1f); + Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 705, 1f); + int height = 120; + float num51 = 1.8f; + float num52 = 2.5f; + Vector2 value3 = (0f - 1.57079637f).ToRotationVector2(); + Vector2 value4 = value3 * projectile.velocity.Length() * (float)projectile.MaxUpdates; + Main.PlaySound(SoundID.Item20, projectile.Center); + projectile.position = projectile.Center; + projectile.width = projectile.height = height; + projectile.Center = projectile.position; + projectile.maxPenetrate = -1; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.damage *= 2; + projectile.Damage(); + int num3; + for (int num53 = 0; num53 < 40; num53 = num3 + 1) + { + int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 200, default, num52); + Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; + Main.dust[num54].noGravity = true; + Dust dust = Main.dust[num54]; + dust.velocity *= 4f; + dust = Main.dust[num54]; + dust.velocity += value4 * Main.rand.NextFloat(); + num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 100, default, num51); + Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; + dust = Main.dust[num54]; + dust.velocity *= 3f; + Main.dust[num54].noGravity = true; + num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 100, default, num51); + Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; + dust = Main.dust[num54]; + dust.velocity *= 2f; + Main.dust[num54].noGravity = true; + Main.dust[num54].fadeIn = 1f; + Main.dust[num54].color = Color.Green * 0.5f; + dust = Main.dust[num54]; + dust.velocity += value4 * Main.rand.NextFloat(); + num3 = num53; + } + for (int num55 = 0; num55 < 20; num55 = num3 + 1) + { + int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 0, default, num52); + Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 3f; + Main.dust[num56].noGravity = true; + Dust dust = Main.dust[num56]; + dust.velocity *= 0.5f; + dust = Main.dust[num56]; + dust.velocity += value4 * (0.6f + 0.6f * Main.rand.NextFloat()); + num3 = num55; + } + } + } } diff --git a/Projectiles/Magic/MadAlchemistsCocktailBlue.cs b/Projectiles/Magic/MadAlchemistsCocktailBlue.cs index fae5e77400..801fa20a18 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailBlue.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailBlue.cs @@ -25,37 +25,33 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - FlaskAI(); - } - - public static void FlaskAI() - { - projectile.rotation += Math.Abs(projectile.velocity.X) * 0.04f * projectile.direction; - if (projectile.ai[0]++ >= 90f) + projectile.rotation += Math.Abs(projectile.velocity.X) * 0.04f * (float)projectile.direction; + projectile.ai[0] += 1f; + if (projectile.ai[0] >= 90f) { - projectile.velocity.Y += 0.4f; - projectile.velocity.X *= 0.97f; + projectile.velocity.Y = projectile.velocity.Y + 0.4f; + projectile.velocity.X = projectile.velocity.X * 0.97f; } if (projectile.velocity.Y > 16f) { projectile.velocity.Y = 16f; } - } + } public override void Kill(int timeLeft) { Main.PlaySound(SoundID.Item107, projectile.position); Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 705, 1f); - int projAmt = Main.rand.Next(20, 31); + int num220 = Main.rand.Next(20, 31); if (projectile.owner == Main.myPlayer) { - for (int i = 0; i < projAmt; i++) + for (int num221 = 0; num221 < num220; num221++) { - Vector2 velocity = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); - velocity.Normalize(); - velocity *= Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage / 4, 0f, projectile.owner, 0f, Main.rand.Next(-45, 1)); + Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value17.Normalize(); + value17 *= (float)Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value17.X, value17.Y, ModContent.ProjectileType(), projectile.damage / 4, 0f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); } } } diff --git a/Projectiles/Magic/MadAlchemistsCocktailGasCloud.cs b/Projectiles/Magic/MadAlchemistsCocktailGasCloud.cs index 7e75163b43..d4d16ef5e5 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailGasCloud.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailGasCloud.cs @@ -39,40 +39,37 @@ namespace CalamityMod.Projectiles.Magic projectile.rotation += projectile.velocity.X * 0.1f; projectile.rotation += (float)projectile.direction * 0.003f; projectile.velocity *= 0.96f; - - Rectangle cloudHitbox = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); - for (int i = 0; i < Main.maxProjectiles; i++) + Rectangle rectangle5 = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); + int num3; + for (int num894 = 0; num894 < 1000; num894 = num3 + 1) { - Projectile otherProj = Main.projectile[i]; - // Short circuits to make the loop as fast as possible - if (!otherProj.active || otherProj.owner != projectile.owner || !otherProj.minion || i == projectile.whoAmI) - continue; - - if (otherProj.type == projectile.type) + if (num894 != projectile.whoAmI && Main.projectile[num894].active) { - Rectangle otherProjHitbox = new Rectangle((int)otherProj.position.X, (int)otherProj.position.Y, otherProj.width, otherProj.height); - if (cloudHitbox.Intersects(otherProjHitbox)) + Rectangle value43 = new Rectangle((int)Main.projectile[num894].position.X, (int)Main.projectile[num894].position.Y, Main.projectile[num894].width, Main.projectile[num894].height); + if (rectangle5.Intersects(value43)) { - Vector2 projDistance = otherProj.Center - projectile.Center; - if (projDistance.X == 0f && projDistance.Y == 0f) + Vector2 vector105 = Main.projectile[num894].Center - projectile.Center; + if (vector105.X == 0f && vector105.Y == 0f) { - if (i < projectile.whoAmI) + if (num894 < projectile.whoAmI) { - projDistance.X = -1f; - projDistance.Y = 1f; + vector105.X = -1f; + vector105.Y = 1f; } else { - projDistance.X = 1f; - projDistance.Y = -1f; + vector105.X = 1f; + vector105.Y = -1f; } } - projDistance.Normalize(); - projDistance *= 0.005f; - projectile.velocity -= projDistance; - otherProj.velocity += projDistance; + vector105.Normalize(); + vector105 *= 0.005f; + projectile.velocity -= vector105; + Projectile projectile2 = Main.projectile[num894]; + projectile2.velocity += vector105; } } + num3 = num894; } } } diff --git a/Projectiles/Magic/MadAlchemistsCocktailGreen.cs b/Projectiles/Magic/MadAlchemistsCocktailGreen.cs index abbb577c5d..dc1add9ccf 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailGreen.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailGreen.cs @@ -25,7 +25,17 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - MadAlchemistsCocktailBlue.FlaskAI(); + projectile.rotation += Math.Abs(projectile.velocity.X) * 0.04f * (float)projectile.direction; + projectile.ai[0] += 1f; + if (projectile.ai[0] >= 90f) + { + projectile.velocity.Y = projectile.velocity.Y + 0.4f; + projectile.velocity.X = projectile.velocity.X * 0.97f; + } + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } } public override void Kill(int timeLeft) @@ -34,22 +44,23 @@ namespace CalamityMod.Projectiles.Magic Main.PlaySound(SoundID.Item88, projectile.position); Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 705, 1f); - for (int i = 0; i < 3; i++) + for (int num118 = 0; num118 < 3; num118++) { - float x = projectile.Center.X + Main.rand.Next(-100, 100); - float y = projectile.Center.Y - Main.rand.Next(500, 600); - Vector2 source = new Vector2(x, y); - Vector2 velocity = projectile.Center - source; - velocity.X += Main.rand.Next(-100, 101); - float speed = 25f; - float targetDist = velocity.Length(); - targetDist = speed / targetDist; - velocity.X *= targetDist; - velocity.Y *= targetDist; + float x = projectile.position.X + (float)Main.rand.Next(-100, 100); + float y = projectile.position.Y - (float)Main.rand.Next(500, 600); + Vector2 vector = new Vector2(x, y); + float num15 = projectile.position.X + (float)(projectile.width / 2) - vector.X; + float num16 = projectile.position.Y + (float)(projectile.height / 2) - vector.Y; + num15 += (float)Main.rand.Next(-100, 101); + int num17 = 25; + float num18 = (float)Math.Sqrt((double)(num15 * num15 + num16 * num16)); + num18 = (float)num17 / num18; + num15 *= num18; + num16 *= num18; - float ai2 = velocity.Y + projectile.position.Y; + float ai2 = num16 + projectile.position.Y; if (projectile.owner == Main.myPlayer) - Projectile.NewProjectile(source, velocity, ProjectileID.LunarFlare, projectile.damage / 2, projectile.knockBack * 2f, projectile.owner, 0f, ai2); + Projectile.NewProjectile(x, y, num15, num16, ProjectileID.LunarFlare, projectile.damage / 2, 5f, projectile.owner, 0f, ai2); } } } diff --git a/Projectiles/Magic/MadAlchemistsCocktailPurple.cs b/Projectiles/Magic/MadAlchemistsCocktailPurple.cs index 7ad2daf8c2..7188ea80f2 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailPurple.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailPurple.cs @@ -25,7 +25,17 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - MadAlchemistsCocktailBlue.FlaskAI(); + projectile.rotation += Math.Abs(projectile.velocity.X) * 0.04f * (float)projectile.direction; + projectile.ai[0] += 1f; + if (projectile.ai[0] >= 90f) + { + projectile.velocity.Y = projectile.velocity.Y + 0.4f; + projectile.velocity.X = projectile.velocity.X * 0.97f; + } + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } } public override void Kill(int timeLeft) @@ -35,12 +45,12 @@ namespace CalamityMod.Projectiles.Magic Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 705, 1f); if (projectile.owner == Main.myPlayer) { - for (int i = 0; i < 4; i++) + for (int num221 = 0; num221 < 4; num221++) { - Vector2 velocity = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); - velocity.Normalize(); - velocity *= Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage / 3, 0f, projectile.owner, 0f, Main.rand.Next(-45, 1)); + Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value17.Normalize(); + value17 *= (float)Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value17.X, value17.Y, ModContent.ProjectileType(), projectile.damage / 3, 0f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); } } } diff --git a/Projectiles/Magic/MadAlchemistsCocktailRed.cs b/Projectiles/Magic/MadAlchemistsCocktailRed.cs index 1e8c561156..b7946e54e1 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailRed.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailRed.cs @@ -25,17 +25,27 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - MadAlchemistsCocktailBlue.FlaskAI(); + projectile.rotation += Math.Abs(projectile.velocity.X) * 0.04f * (float)projectile.direction; + projectile.ai[0] += 1f; + if (projectile.ai[0] >= 90f) + { + projectile.velocity.Y = projectile.velocity.Y + 0.4f; + projectile.velocity.X = projectile.velocity.X * 0.97f; + } + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } } public override void Kill(int timeLeft) { int height = 480; - float dustScaleA = 3f; - float dustScaleB = 2.4f; - float dustScaleC = 3.8f; - Vector2 dustDirection = (-MathHelper.PiOver2).ToRotationVector2(); - Vector2 dustVel = dustDirection * projectile.velocity.Length() * projectile.MaxUpdates; + float num50 = 3f; + float num51 = 2.4f; + float num52 = 3.8f; + Vector2 value3 = (0f - 1.57079637f).ToRotationVector2(); + Vector2 value4 = value3 * projectile.velocity.Length() * (float)projectile.MaxUpdates; Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 20, 2f, 0f); Main.PlaySound(SoundID.Item107, projectile.position); Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 704, 1f); @@ -49,44 +59,55 @@ namespace CalamityMod.Projectiles.Magic projectile.localNPCHitCooldown = 10; projectile.damage *= 3; projectile.Damage(); - for (int i = 0; i < 60; i++) + int num3; + for (int num53 = 0; num53 < 60; num53 = num3 + 1) { - int red = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 200, default, dustScaleA); - Dust dust = Main.dust[red]; - dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; - dust.noGravity = true; + int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 200, default, num50); + Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; + Main.dust[num54].noGravity = true; + Dust dust = Main.dust[num54]; dust.velocity *= 8f; + dust = Main.dust[num54]; dust.velocity += value4 * Main.rand.NextFloat(); - red = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 100, default, dustScaleB); - dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; + num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 100, default, num51); + Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; + dust = Main.dust[num54]; dust.velocity *= 6f; - dust.noGravity = true; - dust.fadeIn = 1f; - dust.color = Color.Crimson * 0.5f; + Main.dust[num54].noGravity = true; + Main.dust[num54].fadeIn = 1f; + Main.dust[num54].color = Color.Crimson * 0.5f; + dust = Main.dust[num54]; dust.velocity += value4 * Main.rand.NextFloat(); - red = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 100, default, dustScaleB); - dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; + num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 100, default, num51); + Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; + dust = Main.dust[num54]; dust.velocity *= 4f; - dust.noGravity = true; - dust.fadeIn = 1f; - dust.color = Color.Crimson * 0.5f; + Main.dust[num54].noGravity = true; + Main.dust[num54].fadeIn = 1f; + Main.dust[num54].color = Color.Crimson * 0.5f; + dust = Main.dust[num54]; dust.velocity += value4 * Main.rand.NextFloat(); - red = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 100, default, dustScaleB); - dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * projectile.width / 2f; + num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 100, default, num51); + Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; + dust = Main.dust[num54]; dust.velocity *= 2f; - dust.noGravity = true; - dust.fadeIn = 1f; - dust.color = Color.Crimson * 0.5f; + Main.dust[num54].noGravity = true; + Main.dust[num54].fadeIn = 1f; + Main.dust[num54].color = Color.Crimson * 0.5f; + dust = Main.dust[num54]; dust.velocity += value4 * Main.rand.NextFloat(); + num3 = num53; } - for (int j = 0; j < 30; j++) + for (int num55 = 0; num55 < 30; num55 = num3 + 1) { - int crimson = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 0, default, dustScaleC); - Dust dust = Main.dust[crimson]; - dust.position = projectile.Center + Vector2.UnitX.RotatedByRandom(Math.PI).RotatedBy((double)projectile.velocity.ToRotation(), default) * projectile.width / 3f; - dust.noGravity = true; + int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 0, default, num52); + Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 3f; + Main.dust[num56].noGravity = true; + Dust dust = Main.dust[num56]; dust.velocity *= 0.5f; + dust = Main.dust[num56]; dust.velocity += value4 * (0.6f + 0.6f * Main.rand.NextFloat()); + num3 = num55; } } } diff --git a/Projectiles/Magic/MadAlchemistsCocktailShrapnel.cs b/Projectiles/Magic/MadAlchemistsCocktailShrapnel.cs index 523bac558b..0cd115e19d 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailShrapnel.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailShrapnel.cs @@ -24,18 +24,27 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - Vector2 adjustVec = new Vector2(6f, 12f); - for (int i = 0; i < 2; i++) - { - Vector2 offset = Vector2.UnitX * -15f; - offset = -Vector2.UnitY.RotatedBy((double)(projectile.localAI[0] * 0.1308997f + i * MathHelper.Pi), default) * adjustVec * 0.75f; - int shrapnel = Dust.NewDust(projectile.Center, 0, 0, 173, 0f, 0f, 160, default, 0.75f); - Main.dust[shrapnel].noGravity = true; - Main.dust[shrapnel].position = projectile.Center + offset; - Main.dust[shrapnel].velocity = projectile.velocity; - } - int violet = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1f); - Main.dust[violet].noGravity = true; + Vector2 value7 = new Vector2(6f, 12f); + projectile.localAI[0] += 1f; + if (projectile.localAI[0] == 48f) + { + projectile.localAI[0] = 0f; + } + else + { + for (int num41 = 0; num41 < 2; num41++) + { + Vector2 value8 = Vector2.UnitX * -15f; + value8 = -Vector2.UnitY.RotatedBy((double)(projectile.localAI[0] * 0.1308997f + (float)num41 * 3.14159274f), default) * value7 * 0.75f; + int num42 = Dust.NewDust(projectile.Center, 0, 0, 173, 0f, 0f, 160, default, 0.75f); + Main.dust[num42].noGravity = true; + Main.dust[num42].position = projectile.Center + value8; + Main.dust[num42].velocity = projectile.velocity; + } + } + + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1f); + Main.dust[num458].noGravity = true; CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 500f, 12f, 20f); } From 7c108715257581584f126e8eb7b8abbb198bd5ae Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 20:21:59 -0400 Subject: [PATCH 064/160] fixed cloud bug --- .../Magic/MadAlchemistsCocktailGasCloud.cs | 41 ++++++++++--------- Projectiles/Pets/RotomPet.cs | 10 +++-- Projectiles/Summon/MagicBird.cs | 4 +- 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/Projectiles/Magic/MadAlchemistsCocktailGasCloud.cs b/Projectiles/Magic/MadAlchemistsCocktailGasCloud.cs index d4d16ef5e5..7e75163b43 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailGasCloud.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailGasCloud.cs @@ -39,37 +39,40 @@ namespace CalamityMod.Projectiles.Magic projectile.rotation += projectile.velocity.X * 0.1f; projectile.rotation += (float)projectile.direction * 0.003f; projectile.velocity *= 0.96f; - Rectangle rectangle5 = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); - int num3; - for (int num894 = 0; num894 < 1000; num894 = num3 + 1) + + Rectangle cloudHitbox = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); + for (int i = 0; i < Main.maxProjectiles; i++) { - if (num894 != projectile.whoAmI && Main.projectile[num894].active) + Projectile otherProj = Main.projectile[i]; + // Short circuits to make the loop as fast as possible + if (!otherProj.active || otherProj.owner != projectile.owner || !otherProj.minion || i == projectile.whoAmI) + continue; + + if (otherProj.type == projectile.type) { - Rectangle value43 = new Rectangle((int)Main.projectile[num894].position.X, (int)Main.projectile[num894].position.Y, Main.projectile[num894].width, Main.projectile[num894].height); - if (rectangle5.Intersects(value43)) + Rectangle otherProjHitbox = new Rectangle((int)otherProj.position.X, (int)otherProj.position.Y, otherProj.width, otherProj.height); + if (cloudHitbox.Intersects(otherProjHitbox)) { - Vector2 vector105 = Main.projectile[num894].Center - projectile.Center; - if (vector105.X == 0f && vector105.Y == 0f) + Vector2 projDistance = otherProj.Center - projectile.Center; + if (projDistance.X == 0f && projDistance.Y == 0f) { - if (num894 < projectile.whoAmI) + if (i < projectile.whoAmI) { - vector105.X = -1f; - vector105.Y = 1f; + projDistance.X = -1f; + projDistance.Y = 1f; } else { - vector105.X = 1f; - vector105.Y = -1f; + projDistance.X = 1f; + projDistance.Y = -1f; } } - vector105.Normalize(); - vector105 *= 0.005f; - projectile.velocity -= vector105; - Projectile projectile2 = Main.projectile[num894]; - projectile2.velocity += vector105; + projDistance.Normalize(); + projDistance *= 0.005f; + projectile.velocity -= projDistance; + otherProj.velocity += projDistance; } } - num3 = num894; } } } diff --git a/Projectiles/Pets/RotomPet.cs b/Projectiles/Pets/RotomPet.cs index 8a476517d6..c9c30336f8 100644 --- a/Projectiles/Pets/RotomPet.cs +++ b/Projectiles/Pets/RotomPet.cs @@ -95,10 +95,12 @@ namespace CalamityMod.Projectiles.Pets private void UpdateFrames() { - if (projectile.frameCounter % 6 == 0) - { - projectile.frame++; - } + projectile.frameCounter++; + if (projectile.frameCounter > 6) + { + projectile.frame++; + projectile.frameCounter = 0; + } if (projectile.frame >= 4) { projectile.frame = 0; diff --git a/Projectiles/Summon/MagicBird.cs b/Projectiles/Summon/MagicBird.cs index 288deed720..64b185c573 100644 --- a/Projectiles/Summon/MagicBird.cs +++ b/Projectiles/Summon/MagicBird.cs @@ -36,9 +36,11 @@ namespace CalamityMod.Projectiles.Summon projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); - if (projectile.frameCounter++ % 6 == 0) + projectile.frameCounter++; + if (projectile.frameCounter > 6) { projectile.frame++; + projectile.frameCounter = 0; } if (projectile.frame >= 7) { From e24de27b038f6ea128906b435966bf1025156891 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 21:37:37 -0400 Subject: [PATCH 065/160] fixed plantation staff tooltip --- Items/Weapons/Summon/PlantationStaff.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Items/Weapons/Summon/PlantationStaff.cs b/Items/Weapons/Summon/PlantationStaff.cs index bd1f0c17ce..06c686dad1 100644 --- a/Items/Weapons/Summon/PlantationStaff.cs +++ b/Items/Weapons/Summon/PlantationStaff.cs @@ -14,9 +14,8 @@ namespace CalamityMod.Items.Weapons.Summon { DisplayName.SetDefault("Plantation Staff"); Tooltip.SetDefault("Summons a miniature plantera to protect you\n" + - "Fires seeds and spiky balls from afar to poison targets\n" + - "Enrages when you get under 50% health and begins ramming enemies\n" + - "While enraged, it will additionally start firing spore clouds\n" + + "Fires seeds, spiky balls, and spore clouds from afar to poison targets\n" + + "Enrages when you get under 75% health and begins ramming enemies\n" + "Occupies 3 minion slots and there can only be one"); } From 73333c57746c328590c30e57fbf11f3c7770d7b3 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 22:10:52 -0400 Subject: [PATCH 066/160] nerfed plantation staff base dmg --- Items/Weapons/Summon/PlantationStaff.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Summon/PlantationStaff.cs b/Items/Weapons/Summon/PlantationStaff.cs index 06c686dad1..539ef97bb1 100644 --- a/Items/Weapons/Summon/PlantationStaff.cs +++ b/Items/Weapons/Summon/PlantationStaff.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 75; + item.damage = 69; item.mana = 10; item.width = 66; item.height = 70; From 8a49c47e72db497d08e1c964366668a48fc4e2b2 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 10 Jul 2020 23:17:16 -0400 Subject: [PATCH 067/160] capped fungal clump heals --- Projectiles/Summon/FungalClumpMinion.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Projectiles/Summon/FungalClumpMinion.cs b/Projectiles/Summon/FungalClumpMinion.cs index 71356927dd..b48421bd07 100644 --- a/Projectiles/Summon/FungalClumpMinion.cs +++ b/Projectiles/Summon/FungalClumpMinion.cs @@ -260,6 +260,8 @@ namespace CalamityMod.Projectiles.Summon { return; } + if (healAmt > 50f) + healAmt = 50f; CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ModContent.ProjectileType(), 1200f, 1f); } From 5a619a6ebb3fe3bfbf0f98e5e5449278b6728826 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 11 Jul 2020 13:53:41 -0400 Subject: [PATCH 068/160] refactored buffed antlion AI --- NPCs/CalamityGlobalAI.cs | 256 +++++++++++++++++++++------------------ 1 file changed, 137 insertions(+), 119 deletions(-) diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index 16d0f35db7..345ec002f9 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -22505,132 +22505,149 @@ namespace CalamityMod.NPCs } #endregion - #region Antlion AI - public static bool BuffedAntlionAI(NPC npc, Mod mod) - { - npc.TargetClosest(true); + #region Antlion AI + public static bool BuffedAntlionAI(NPC npc, Mod mod) + { + npc.TargetClosest(true); - float num270 = 12f; - Vector2 vector32 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num271 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector32.X; - float num272 = Main.player[npc.target].position.Y - vector32.Y; - float num273 = (float)Math.Sqrt((double)(num271 * num271 + num272 * num272)); + //Calculate speed and velocity of the sand balls + float speed = 12f; + float xVel = Main.player[npc.target].Center.X - npc.Center.X; + float yVel = Main.player[npc.target].position.Y - npc.Center.Y; + Vector2 velocity = new Vector2(xVel, yVel); + float targetDist = velocity.Length(); - num273 = num270 / num273; - num271 *= num273; - num272 *= num273; + targetDist = speed / targetDist; + velocity.X *= targetDist; + velocity.Y *= targetDist; - bool flag17 = false; - if (npc.directionY < 0) - { - npc.rotation = (float)(Math.Atan2((double)num272, (double)num271) + MathHelper.PiOver2); - flag17 = ((double)npc.rotation >= -1.2 && (double)npc.rotation <= 1.2); - if ((double)npc.rotation < -0.8) - { - npc.rotation = -0.8f; - } - else if ((double)npc.rotation > 0.8) - { - npc.rotation = 0.8f; - } - if (npc.velocity.X != 0f) - { - npc.velocity.X = npc.velocity.X * 0.9f; - if ((double)npc.velocity.X > -0.1 || (double)npc.velocity.X < 0.1) - { - npc.netUpdate = true; - npc.velocity.X = 0f; - } - } - } + //Adjust rotation and velocity + bool canShoot = false; + if (npc.directionY < 0) + { + //Set rotation based on the target location + npc.rotation = velocity.ToRotation() + MathHelper.PiOver2; + //Antlions can only shoot if rotated between a certain cone of spread based on the target location + canShoot = Math.Abs(npc.rotation) <= 1.2f; - if (npc.ai[0] > 0f) - { - if (npc.ai[0] == 200f) - { - Main.PlaySound(SoundID.NPCDeath13, npc.position); - } - npc.ai[0] -= 1f; - } + //Hardcap rotation so it doesn't look weird, but since the above calculation happens first, it ignores this cap + if (npc.rotation < -0.8f) + { + npc.rotation = -0.8f; + } + else if (npc.rotation > 0.8f) + { + npc.rotation = 0.8f; + } - if (Main.netMode != NetmodeID.MultiplayerClient && flag17 && npc.ai[0] == 0f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - npc.ai[0] = 200f; - int damage = 10; - int projType = ProjectileID.SandBallFalling; + //Antlions generally don't move horizontally so prevent that as needed + if (npc.velocity.X != 0f) + { + npc.velocity.X *= 0.9f; + if (Math.Abs(npc.velocity.X) < 0.1f) + { + npc.netUpdate = true; + npc.velocity.X = 0f; + } + } + } - int projAmt = Main.rand.Next(8, 14); - if (Main.rand.NextBool(1000)) - projAmt = Main.rand.Next(80, 131); + //Decrement the firing cooldown, play a sound if at full meaning it just fired + if (npc.ai[0] > 0f) + { + if (npc.ai[0] == 200f) + { + Main.PlaySound(SoundID.NPCDeath13, npc.position); + } + npc.ai[0] -= 1f; + } - for (int i = 0; i < projAmt; i++) - { - num271 += (float)Main.rand.Next(-30, 31) * 0.05f; - num272 += (float)Main.rand.Next(-30, 31) * 0.05f; - int num276 = Projectile.NewProjectile(vector32.X, vector32.Y, num271, num272, projType, damage, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[num276].ai[0] = 2f; - Main.projectile[num276].timeLeft = 300; - Main.projectile[num276].friendly = false; - NetMessage.SendData(MessageID.SyncProjectile, -1, -1, null, num276, 0f, 0f, 0f, 0, 0, 0); - } - npc.netUpdate = true; - } + //Antlions should only fire if the target is in the shooting cone and has a line of sight as well as not being on cooldown. + bool lineofSight = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height); + if (Main.netMode != NetmodeID.MultiplayerClient && canShoot && npc.ai[0] == 0f && lineofSight) + { + //Reset the firing cooldown to 3.3333 seconds + npc.ai[0] = 200f; - try - { - int num277 = (int)npc.position.X / 16; - int num278 = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int num279 = (int)(npc.position.X + (float)npc.width) / 16; - int num280 = (int)(npc.position.Y + (float)npc.height) / 16; - bool flag18 = false; - if (Main.tile[num277, num280] == null) - { - Main.tile[num277, num280] = new Tile(); - } - if (Main.tile[num278, num280] == null) - { - Main.tile[num277, num280] = new Tile(); - } - if (Main.tile[num279, num280] == null) - { - Main.tile[num277, num280] = new Tile(); - } - if ((Main.tile[num277, num280].nactive() && Main.tileSolid[(int)Main.tile[num277, num280].type]) || (Main.tile[num278, num280].nactive() && Main.tileSolid[(int)Main.tile[num278, num280].type]) || (Main.tile[num279, num280].nactive() && Main.tileSolid[(int)Main.tile[num279, num280].type])) - { - flag18 = true; - } - if (flag18) - { - npc.noGravity = true; - npc.noTileCollide = true; - npc.velocity.Y = -0.2f; - } - else - { - npc.noGravity = false; - npc.noTileCollide = false; - if (Main.rand.Next(2) == 0) - { - int num281 = Dust.NewDust(new Vector2(npc.position.X - 4f, npc.position.Y + (float)npc.height - 8f), npc.width + 8, 24, 32, 0f, npc.velocity.Y / 2f, 0, default(Color), 1f); - Dust var_9_DC3B_cp_0_cp_0 = Main.dust[num281]; - var_9_DC3B_cp_0_cp_0.velocity.X = var_9_DC3B_cp_0_cp_0.velocity.X * 0.4f; - Dust var_9_DC5F_cp_0_cp_0 = Main.dust[num281]; - var_9_DC5F_cp_0_cp_0.velocity.Y = var_9_DC5F_cp_0_cp_0.velocity.Y * -1f; - if (Main.rand.Next(2) == 0) - { - Main.dust[num281].noGravity = true; - Dust dust = Main.dust[num281]; - dust.scale += 0.2f; - } - } - } - } - catch - { - } - return false; - } - #endregion + //With the Rev and Death damage calculations, this becomes 56 damage. + int damage = 10; + + int projType = ProjectileID.SandBallFalling; + int projAmt = Main.rand.Next(8, 14); + if (Main.rand.NextBool(1000)) + projAmt = Main.rand.Next(80, 131); + + for (int i = 0; i < projAmt; i++) + { + //Adjust the velocity to make it a shotgun-like spread + velocity.X += (float)Main.rand.Next(-30, 31) * 0.05f; + velocity.Y += (float)Main.rand.Next(-30, 31) * 0.05f; + + int sandBall = Projectile.NewProjectile(npc.Center, velocity, projType, damage, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[sandBall].ai[0] = 2f; + Main.projectile[sandBall].timeLeft = 300; + Main.projectile[sandBall].friendly = false; + NetMessage.SendData(MessageID.SyncProjectile, -1, -1, null, sandBall, 0f, 0f, 0f, 0, 0, 0); + } + npc.netUpdate = true; + } + + try + { + //This tile checking behavior is used for when Antlions cover themselves in sand and need to rise upward to get to the surface + int xLeft = (int)npc.position.X / 16; + int xCenter = (int)npc.Center.X / 16; + int xRight = (int)(npc.position.X + (float)npc.width) / 16; + int y = (int)(npc.position.Y + (float)npc.height) / 16; + bool tileClimbing = false; + if (Main.tile[xLeft, y] is null) + { + Main.tile[xLeft, y] = new Tile(); + } + if (Main.tile[xCenter, y] is null) + { + Main.tile[xLeft, y] = new Tile(); + } + if (Main.tile[xRight, y] is null) + { + Main.tile[xLeft, y] = new Tile(); + } + if ((Main.tile[xLeft, y].nactive() && Main.tileSolid[(int)Main.tile[xLeft, y].type]) || (Main.tile[xCenter, y].nactive() && Main.tileSolid[(int)Main.tile[xCenter, y].type]) || (Main.tile[xRight, y].nactive() && Main.tileSolid[(int)Main.tile[xRight, y].type])) + { + tileClimbing = true; + } + if (tileClimbing) + { + npc.noGravity = true; + npc.noTileCollide = true; + npc.velocity.Y = -0.2f; + } + + //If not rising up through tiles, occasionally spawn some dust + else + { + npc.noGravity = false; + npc.noTileCollide = false; + if (Main.rand.NextBool(2)) + { + int sand = Dust.NewDust(new Vector2(npc.position.X - 4f, npc.position.Y + (float)npc.height - 8f), npc.width + 8, 24, 32, 0f, npc.velocity.Y / 2f, 0, default(Color), 1f); + Dust dust = Main.dust[sand]; + dust.velocity.X *= 0.4f; + dust.velocity.Y *= -1f; + if (Main.rand.NextBool(2)) + { + dust.noGravity = true; + dust.scale += 0.2f; + } + } + } + } + catch + { + } + return false; + } + #endregion #region Spike Ball AI public static bool BuffedSpikeBallAI(NPC npc, Mod mod) @@ -22778,6 +22795,7 @@ namespace CalamityMod.NPCs int proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vector255.X, vector255.Y, ProjectileID.FlamesTrap, 20, 0f, Main.myPlayer, 0f, 0f); Main.projectile[proj].tileCollide = false; Main.projectile[proj].friendly = false; + Main.projectile[proj].trap = false; } } } @@ -24816,7 +24834,7 @@ namespace CalamityMod.NPCs { for (int j = npcY - 1; j <= npcY + 1; j++) { - if (Main.tile[i, j] == null) + if (Main.tile[i, j] is null) { return false; } From c16a2454ae8bfd0b7e7943698fd2dcc1aafe4915 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 11 Jul 2020 15:51:49 -0400 Subject: [PATCH 069/160] nerfed hadal mantle and adjusted ice barrage --- Items/Accessories/Wings/DiscordianWings.cs | 4 +-- Items/CalamityGlobalItem.cs | 2 +- Projectiles/Magic/IceBarrageMain.cs | 41 ++++++---------------- 3 files changed, 13 insertions(+), 34 deletions(-) diff --git a/Items/Accessories/Wings/DiscordianWings.cs b/Items/Accessories/Wings/DiscordianWings.cs index cd414cbf12..7d5f86056d 100644 --- a/Items/Accessories/Wings/DiscordianWings.cs +++ b/Items/Accessories/Wings/DiscordianWings.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories.Wings "Acceleration multiplier: 1.5\n" + "Average vertical speed\n" + "Flight time: 180\n" + - "10% increased damage while wearing the Hydrothermic Armor"); + "5% increased damage while wearing the Hydrothermic Armor"); } public override void SetDefaults() @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Accessories.Wings player.armor[0].type == ModContent.ItemType()) && player.armor[1].type == ModContent.ItemType() && player.armor[2].type == ModContent.ItemType()) { - player.allDamage += 0.1f; + player.allDamage += 0.05f; } if (player.controlJump && player.wingTime > 0f && !player.jumpAgainCloud && player.jump == 0 && player.velocity.Y != 0f && !hideVisual) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 7ed6d28520..d7f00cdcb7 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -2280,7 +2280,7 @@ Grants immunity to fire blocks, and temporary immunity to lava"; "Acceleration multiplier: 0\n" + "Average vertical speed\n" + "Flight time: 160\n" + - "+5 defense, 5% increased damage, " + + "+5 defense, 5% increased damage,\n" + "10% increased movement speed and 24% increased jump speed"; } } diff --git a/Projectiles/Magic/IceBarrageMain.cs b/Projectiles/Magic/IceBarrageMain.cs index c8b926209a..016ab4e72c 100644 --- a/Projectiles/Magic/IceBarrageMain.cs +++ b/Projectiles/Magic/IceBarrageMain.cs @@ -32,58 +32,37 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - float maxDistance = 500f; - bool bossFound = false; - - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC npc = Main.npc[i]; - if (!npc.active || npc.type == NPCID.TargetDummy) - continue; - - // If we've found a valid boss target, ignore ALL targets which aren't bosses. - if (bossFound && !npc.boss) - continue; - - if (npc.CanBeChasedBy(projectile, false)) - { - float extraDistance = (float)(npc.width / 2) + (float)(npc.height / 2); - - if (Vector2.Distance(npc.Center, projectile.Center) < (maxDistance + extraDistance)) - { - if (npc.boss) - bossFound = true; - projectile.Center = npc.Center; - break; - } - } - } + NPC closestTarget = projectile.Center.ClosestNPCAt(500f, true, true); + if (closestTarget != null) + { + projectile.Center = closestTarget.Center; + } projectile.ai[0]++; projectile.ai[1]++; for (int j = 0; j < 3; j++) { - int num297 = Main.rand.NextBool(2) ? 68 : 67; + int dustType = Main.rand.NextBool(2) ? 68 : 67; if (Main.rand.NextBool(4)) { - num297 = 80; + dustType = 80; } if (projectile.ai[0] < 140f) { Vector2 direction = new Vector2(Main.rand.NextFloat(-4f, 4f), Main.rand.NextFloat(-4f, 4f)); - int dust = Dust.NewDust(projectile.Center, 1, 1, num297, direction.X, direction.Y, 50, default, 1.3f); + int dust = Dust.NewDust(projectile.Center, 1, 1, dustType, direction.X, direction.Y, 50, default, 1.3f); Main.dust[dust].noGravity = true; } else { int direct = Main.rand.NextBool(2) ? 1 : -1; Vector2 dir1 = new Vector2(0f, 10f) * direct; - int dust1 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num297, dir1.X, dir1.Y, 50, default, 1.3f); + int dust1 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, dir1.X, dir1.Y, 50, default, 1.3f); Main.dust[dust1].noGravity = true; Main.dust[dust1].velocity = dir1; int direct2 = Main.rand.NextBool(2) ? 1 : -1; Vector2 dir2 = new Vector2(10f, 0f) * direct2; - int dust2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num297, dir2.X, dir2.Y, 50, default, 1.3f); + int dust2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, dir2.X, dir2.Y, 50, default, 1.3f); Main.dust[dust2].noGravity = true; Main.dust[dust2].velocity = dir2; } From 117ab3ca9f32a5568e77b0c0f08c3ae60bb066de Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 11 Jul 2020 18:16:29 -0400 Subject: [PATCH 070/160] several scal/yharon drops are now instanced in expert mode --- NPCs/SupremeCalamitas/SupremeCalamitas.cs | 8 ++++---- NPCs/Yharon/Yharon.cs | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 09b830060a..d2c0353269 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -2197,7 +2197,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Weapons // All non-hybrid weapons are listed twice so that the drop rates are actually equal between each unique weapon - DropHelper.DropItemFromSetCondition(npc, Main.expertMode, + DropHelper.DropItemFromSetCondition(npc, true, Main.expertMode, ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), @@ -2219,11 +2219,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas ModContent.ItemType(), ModContent.ItemType(), //Temporal Umbrella ModContent.ItemType(), ModContent.ItemType() ); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.revenge); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, CalamityWorld.revenge); // Vanity - DropHelper.DropItem(npc, ModContent.ItemType()); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.death); + DropHelper.DropItem(npc, ModContent.ItemType(), Main.expertMode); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, CalamityWorld.death); // Other DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index a62f35ca93..c09aff7958 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -2832,11 +2832,11 @@ namespace CalamityMod.NPCs.Yharon DropHelper.DropItem(npc, ModContent.ItemType(), true, soulFragMin, soulFragMax); // Equipment - DropHelper.DropItem(npc, ModContent.ItemType()); + DropHelper.DropItem(npc, ModContent.ItemType(), Main.expertMode); // Weapons - DropHelper.DropItemChance(npc, ModContent.ItemType(), DropHelper.RareVariantDropRateInt); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 100); //not affected by defiled and not a leggie + DropHelper.DropItemChance(npc, ModContent.ItemType(), Main.expertMode, DropHelper.RareVariantDropRateInt); + DropHelper.DropItemChance(npc, ModContent.ItemType(), Main.expertMode, 100); //not affected by defiled and not a leggie // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); From 105867a77d975ed9aaf14a0bbecbbd7a34e530b7 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 11 Jul 2020 18:16:50 -0400 Subject: [PATCH 071/160] m --- NPCs/SupremeCalamitas/SupremeCalamitas.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index d2c0353269..c30c0230da 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -2223,7 +2223,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Vanity DropHelper.DropItem(npc, ModContent.ItemType(), Main.expertMode); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, CalamityWorld.death); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.death); // Other DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); From 4121f08f3d433be1892cb94b393500067d4d02e5 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 11 Jul 2020 20:51:29 -0400 Subject: [PATCH 072/160] updated doggo's healing potion drop amts to match others --- NPCs/DevourerofGods/DevourerofGodsHeadS.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs index a16e97dd5d..8168ff6ca9 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs @@ -1000,7 +1000,7 @@ namespace CalamityMod.NPCs.DevourerofGods DropHelper.DropBags(npc); - DropHelper.DropItem(npc, ModContent.ItemType(), 8, 14); + DropHelper.DropItem(npc, ModContent.ItemType(), 5, 15); DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedDoG); DropHelper.DropResidentEvilAmmo(npc, CalamityWorld.downedDoG, 6, 3, 2); From 0c835fd37d76611d5d601457241522160fac66b5 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 12 Jul 2020 09:39:01 -0400 Subject: [PATCH 073/160] bandit now sells tiger climbing gear --- NPCs/TownNPCs/THIEF.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NPCs/TownNPCs/THIEF.cs b/NPCs/TownNPCs/THIEF.cs index f4a75b7319..9d7f9910ce 100644 --- a/NPCs/TownNPCs/THIEF.cs +++ b/NPCs/TownNPCs/THIEF.cs @@ -252,6 +252,8 @@ namespace CalamityMod.NPCs.TownNPCs shop.item[nextSlot].SetDefaults(ModContent.ItemType()); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 40, 0, 0); nextSlot++; + shop.item[nextSlot].SetDefaults(ItemID.TigerClimbingGear); + nextSlot++; if (CalamityWorld.downedSlimeGod) { shop.item[nextSlot].SetDefaults(ModContent.ItemType()); From e93caf173f0a2df6f44c85679fd7c0525d971f7a Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 12 Jul 2020 10:04:43 -0400 Subject: [PATCH 074/160] refactored ultra liquidator a bit and updated its recipe --- Items/Weapons/Magic/UltraLiquidator.cs | 143 ++++++++++++------------- 1 file changed, 69 insertions(+), 74 deletions(-) diff --git a/Items/Weapons/Magic/UltraLiquidator.cs b/Items/Weapons/Magic/UltraLiquidator.cs index 7f3db174f7..b0b720d2ff 100644 --- a/Items/Weapons/Magic/UltraLiquidator.cs +++ b/Items/Weapons/Magic/UltraLiquidator.cs @@ -8,82 +8,77 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Magic { public class UltraLiquidator : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ultra Liquidator"); - Tooltip.SetDefault("Summons liquidation blades that summon more blades on enemy hits\n" + - "The blades inflict ichor, cursed inferno, on fire, and frostburn"); - Item.staff[item.type] = true; - } + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ultra Liquidator"); + Tooltip.SetDefault("Summons liquidation blades that summon more blades on enemy hits\n" + + "The blades inflict ichor, cursed inferno, on fire, and frostburn"); + Item.staff[item.type] = true; + } - public override void SetDefaults() - { - item.damage = 145; - item.magic = true; - item.mana = 25; - item.width = 16; - item.height = 16; - item.useAnimation = 15; - item.useTime = 3; - item.reuseDelay = item.useAnimation; - item.crit = 30; - item.useStyle = ItemUseStyleID.HoldingOut; - item.noMelee = true; - item.knockBack = 7f; - item.value = Item.buyPrice(1, 20, 0, 0); - item.rare = 10; - item.UseSound = SoundID.Item9; - item.autoReuse = true; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 16f; - item.Calamity().customRarity = CalamityRarity.Turquoise; - } + public override void SetDefaults() + { + item.damage = 145; + item.crit = 30; + item.knockBack = 7f; + item.useTime = 3; + item.reuseDelay = item.useAnimation = 15; + item.mana = 25; + item.magic = true; + item.autoReuse = true; + item.shootSpeed = 16f; + item.shoot = ModContent.ProjectileType(); - public override Vector2? HoldoutOrigin() - { - return new Vector2(15, 15); - } + item.width = item.height = 16; + item.useStyle = ItemUseStyleID.HoldingOut; + item.noMelee = true; + item.UseSound = SoundID.Item9; + item.value = Item.buyPrice(1, 20, 0, 0); + item.rare = 10; + item.Calamity().customRarity = CalamityRarity.Turquoise; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ItemID.AquaScepter); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ItemID.LunarBar, 5); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - } + public override Vector2? HoldoutOrigin() => new Vector2(15, 15); - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num72 = item.shootSpeed; - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - float f = Main.rand.NextFloat() * 6.28318548f; - float value12 = 20f; - float value13 = 60f; - Vector2 vector13 = vector2 + f.ToRotationVector2() * MathHelper.Lerp(value12, value13, Main.rand.NextFloat()); - for (int num202 = 0; num202 < 50; num202++) - { - vector13 = vector2 + f.ToRotationVector2() * MathHelper.Lerp(value12, value13, Main.rand.NextFloat()); - if (Collision.CanHit(vector2, 0, 0, vector13 + (vector13 - vector2).SafeNormalize(Vector2.UnitX) * 8f, 0, 0)) - { - break; - } - f = Main.rand.NextFloat() * 6.28318548f; - } - Vector2 mouseWorld = Main.MouseWorld; - Vector2 vector14 = mouseWorld - vector13; - Vector2 vector15 = new Vector2(num78, num79).SafeNormalize(Vector2.UnitY) * num72; - vector14 = vector14.SafeNormalize(vector15) * num72; - vector14 = Vector2.Lerp(vector14, vector15, 0.25f); - Projectile.NewProjectile(vector13, vector14, type, damage, knockBack, player.whoAmI, 0f, 0f); - return false; - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddRecipeGroup("CursedFlameIchor", 20); + recipe.AddIngredient(ItemID.AquaScepter); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ItemID.LunarBar, 5); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Vector2 playerPos = player.RotatedRelativePoint(player.MountedCenter, true); + float speed = item.shootSpeed; + float xVec = (float)Main.mouseX + Main.screenPosition.X - playerPos.X; + float yVec = (float)Main.mouseY + Main.screenPosition.Y - playerPos.Y; + float f = Main.rand.NextFloat() * MathHelper.TwoPi; + float lowerBoundOffset = 20f; + float upperBoundOffset = 60f; + Vector2 source = playerPos + f.ToRotationVector2() * MathHelper.Lerp(lowerBoundOffset, upperBoundOffset, Main.rand.NextFloat()); + for (int i = 0; i < 50; i++) + { + source = playerPos + f.ToRotationVector2() * MathHelper.Lerp(lowerBoundOffset, upperBoundOffset, Main.rand.NextFloat()); + if (Collision.CanHit(playerPos, 0, 0, source + (source - playerPos).SafeNormalize(Vector2.UnitX) * 8f, 0, 0)) + { + break; + } + f = Main.rand.NextFloat() * MathHelper.TwoPi; + } + Vector2 velocity = Main.MouseWorld - source; + Vector2 upperVelocityLimit = new Vector2(xVec, yVec).SafeNormalize(Vector2.UnitY) * speed; + velocity = velocity.SafeNormalize(upperVelocityLimit) * speed; + velocity = Vector2.Lerp(velocity, upperVelocityLimit, 0.25f); + Projectile.NewProjectile(source, velocity, type, damage, knockBack, player.whoAmI, 0f, 0f); + return false; + } + } } From c716da8e9baadc6702fe0e8d7e44bfe4265a1558 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 10:21:59 -0400 Subject: [PATCH 075/160] trivial giant pearl lightning thingy --- Items/Accessories/GiantPearl.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Accessories/GiantPearl.cs b/Items/Accessories/GiantPearl.cs index fc2a940535..c2e119ac94 100644 --- a/Items/Accessories/GiantPearl.cs +++ b/Items/Accessories/GiantPearl.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.giantPearl = true; - Lighting.AddLight((int)(player.position.X + (float)(player.width / 2)) / 16, (int)(player.position.Y + (float)(player.height / 2)) / 16, 0.45f, 0.8f, 0.8f); + Lighting.AddLight((int)player.Center.X / 16, (int)player.Center.Y / 16, 0.45f, 0.8f, 0.8f); } } } From 718e028538006c7d06c149f7ea81d75c1c824b9f Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 11:01:16 -0400 Subject: [PATCH 076/160] nerfed shifting sands, abyss blade, saros possession, and eclipse's fall SS. Buffed midnight sun beacon. Adjusted crystyl crusher --- Items/Tools/CrystylCrusher.cs | 31 +-- Items/Weapons/Magic/ShiftingSands.cs | 89 ++++--- Items/Weapons/Melee/AbyssBlade.cs | 6 +- Items/Weapons/Melee/NeptunesBounty.cs | 2 +- Items/Weapons/Summon/MidnightSunBeacon.cs | 2 +- Items/Weapons/Summon/SarosPossession.cs | 2 +- Items/Weapons/Summon/SunGodStaff.cs | 2 +- Projectiles/CalamityGlobalProjectile.cs | 3 +- Projectiles/Magic/ShiftingSandsProj.cs | 298 +++++++++++----------- Projectiles/Melee/DepthOrb.cs | 4 +- Projectiles/Rogue/EclipsesStealth.cs | 159 ++++++------ 11 files changed, 303 insertions(+), 295 deletions(-) diff --git a/Items/Tools/CrystylCrusher.cs b/Items/Tools/CrystylCrusher.cs index f577715850..875f237fc3 100644 --- a/Items/Tools/CrystylCrusher.cs +++ b/Items/Tools/CrystylCrusher.cs @@ -31,8 +31,7 @@ namespace CalamityMod.Items.Tools item.crit += 25; item.width = 70; item.height = 70; - item.useTime = 20; - item.useAnimation = 20; + item.useTime = item.useAnimation = 2; item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 9f; item.shootSpeed = 14f; @@ -50,10 +49,7 @@ namespace CalamityMod.Items.Tools return new Vector2(10, 10); } - public override bool AltFunctionUse(Player player) - { - return true; - } + public override bool AltFunctionUse(Player player) => true; public override bool CanUseItem(Player player) { @@ -65,8 +61,6 @@ namespace CalamityMod.Items.Tools item.tileBoost = 50; item.UseSound = SoundID.Item1; item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 2; - item.useAnimation = 2; item.useTurn = true; item.autoReuse = true; item.noMelee = false; @@ -80,8 +74,6 @@ namespace CalamityMod.Items.Tools item.tileBoost = 0; item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/CrystylCharge"); item.useStyle = ItemUseStyleID.HoldingOut; - item.useTime = 20; - item.useAnimation = 20; item.useTurn = false; item.autoReuse = false; item.noMelee = true; @@ -97,20 +89,13 @@ namespace CalamityMod.Items.Tools if (Main.rand.NextBool(3)) { - int num307 = Main.rand.Next(3); - if (num307 == 0) + int dustType = Utils.SelectRandom(Main.rand, new int[] { - num307 = 173; - } - else if (num307 == 1) - { - num307 = 57; - } - else - { - num307 = 58; - } - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, num307); + 173, + 57, + 58 + }); + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, dustType); } } diff --git a/Items/Weapons/Magic/ShiftingSands.cs b/Items/Weapons/Magic/ShiftingSands.cs index 7e69a5dbaa..8e2fe3b012 100644 --- a/Items/Weapons/Magic/ShiftingSands.cs +++ b/Items/Weapons/Magic/ShiftingSands.cs @@ -6,45 +6,58 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Magic { - public class ShiftingSands : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shifting Sands"); - Tooltip.SetDefault("Casts a sand shard that follows the mouse cursor"); - } + public class ShiftingSands : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shifting Sands"); + Tooltip.SetDefault("Casts a sand shard that follows the mouse cursor"); + } - public override void SetDefaults() - { - item.damage = 85; - item.magic = true; - item.channel = true; - item.mana = 20; - item.width = 58; - item.height = 58; - item.useTime = 30; - item.useAnimation = 30; - item.useStyle = ItemUseStyleID.SwingThrow; - item.noMelee = true; - item.knockBack = 5f; - item.value = Item.buyPrice(0, 60, 0, 0); - item.rare = 7; - item.UseSound = SoundID.Item20; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 7f; + public override void SetDefaults() + { + item.damage = 85; + item.knockBack = 5f; + item.useTime = item.useAnimation = 30; + item.mana = 20; + item.magic = true; + item.channel = true; item.autoReuse = true; - } + item.shootSpeed = 7f; + item.shoot = ModContent.ProjectileType(); - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MagicMissile); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ItemID.AncientBattleArmorMaterial, 2); - recipe.AddIngredient(ItemID.SpectreBar, 5); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + item.width = item.height = 58; + item.useStyle = ItemUseStyleID.SwingThrow; + item.noMelee = true; + item.UseSound = SoundID.Item20; + item.value = Item.buyPrice(0, 60, 0, 0); + item.rare = 7; + } + + public override bool CanUseItem(Player player) + { + int projCount = 0; + for (int x = 0; x < Main.maxProjectiles; x++) + { + Projectile proj = Main.projectile[x]; + if (proj.active && proj.owner == player.whoAmI && proj.type == item.shoot && proj.ai[0] <= 0f) + { + projCount++; + } + } + return projCount <= 0; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MagicMissile); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.AncientBattleArmorMaterial, 2); + recipe.AddIngredient(ItemID.SpectreBar, 5); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } diff --git a/Items/Weapons/Melee/AbyssBlade.cs b/Items/Weapons/Melee/AbyssBlade.cs index 6ca2dd8606..895c05577b 100644 --- a/Items/Weapons/Melee/AbyssBlade.cs +++ b/Items/Weapons/Melee/AbyssBlade.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee { item.width = 74; item.height = 74; - item.damage = 100; + item.damage = 90; item.melee = true; item.useAnimation = 26; item.useTime = 26; @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Melee public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 0.8), knockBack, player.whoAmI); + Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 0.75), knockBack, player.whoAmI); return false; } @@ -61,7 +61,7 @@ namespace CalamityMod.Items.Weapons.Melee { if (Main.rand.NextBool(3)) { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 33); + Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 33); } } diff --git a/Items/Weapons/Melee/NeptunesBounty.cs b/Items/Weapons/Melee/NeptunesBounty.cs index 12435c830a..e195edaca8 100644 --- a/Items/Weapons/Melee/NeptunesBounty.cs +++ b/Items/Weapons/Melee/NeptunesBounty.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons.Melee { if (Main.rand.NextBool(3)) { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 33); + Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 33); } } diff --git a/Items/Weapons/Summon/MidnightSunBeacon.cs b/Items/Weapons/Summon/MidnightSunBeacon.cs index 18e914fde0..bd4d3be5a7 100644 --- a/Items/Weapons/Summon/MidnightSunBeacon.cs +++ b/Items/Weapons/Summon/MidnightSunBeacon.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 200; + item.damage = 240; item.mana = 12; item.width = item.height = 32; item.useTime = item.useAnimation = 10; diff --git a/Items/Weapons/Summon/SarosPossession.cs b/Items/Weapons/Summon/SarosPossession.cs index e1e49715f2..932650edd9 100644 --- a/Items/Weapons/Summon/SarosPossession.cs +++ b/Items/Weapons/Summon/SarosPossession.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Summon item.summon = true; item.mana = 100; - item.damage = 640; + item.damage = 426; item.knockBack = 4f; item.useTime = item.useAnimation = 10; item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Summon/SunGodStaff.cs b/Items/Weapons/Summon/SunGodStaff.cs index 4da962d734..c856eada29 100644 --- a/Items/Weapons/Summon/SunGodStaff.cs +++ b/Items/Weapons/Summon/SunGodStaff.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Summon for (int x = 0; x < Main.maxProjectiles; x++) { Projectile projectile = Main.projectile[x]; - if (projectile.active && projectile.owner == player.whoAmI && projectile.type == ModContent.ProjectileType()) + if (projectile.active && projectile.owner == player.whoAmI && projectile.type == item.shoot) { projectile.Kill(); } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 438eeb6741..0b036b174c 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1384,8 +1384,7 @@ namespace CalamityMod.Projectiles Main.PlaySound(SoundID.Zombie, (int)projectile.position.X, (int)projectile.position.Y, 103); projectile.position = projectile.Center; projectile.width = projectile.height = 96; - projectile.position.X -= projectile.width / 2; - projectile.position.Y -= projectile.height / 2; + projectile.Center = projectile.position; for (int num193 = 0; num193 < 3; num193++) { Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.5f); diff --git a/Projectiles/Magic/ShiftingSandsProj.cs b/Projectiles/Magic/ShiftingSandsProj.cs index 9e729a55f0..2b842424c7 100644 --- a/Projectiles/Magic/ShiftingSandsProj.cs +++ b/Projectiles/Magic/ShiftingSandsProj.cs @@ -7,158 +7,158 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class ShiftingSandsProj : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shifting Sands"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } + public class ShiftingSandsProj : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shifting Sands"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } - public override void SetDefaults() - { - projectile.width = 18; - projectile.height = 18; - projectile.friendly = true; - projectile.penetrate = 5; - projectile.magic = true; + public override void SetDefaults() + { + projectile.width = 18; + projectile.height = 18; + projectile.friendly = true; + projectile.penetrate = 5; + projectile.magic = true; projectile.extraUpdates = 2; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; - } + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + } - public override void AI() - { - if (projectile.soundDelay == 0 && Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y) > 2f) - { - projectile.soundDelay = 10; - Main.PlaySound(SoundID.Item20, projectile.position); - } - int num114 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default, 2f); - Dust dust = Main.dust[num114]; - dust.velocity *= 0.3f; - Main.dust[num114].position.X = projectile.position.X + (float)(projectile.width / 2) + 4f + (float)Main.rand.Next(-4, 5); - Main.dust[num114].position.Y = projectile.position.Y + (float)(projectile.height / 2) + (float)Main.rand.Next(-4, 5); - Main.dust[num114].noGravity = true; - if (Main.myPlayer == projectile.owner && projectile.ai[0] <= 0f) - { - if (Main.player[projectile.owner].channel) - { - float num115 = 18f; - Vector2 vector10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num116 = (float)Main.mouseX + Main.screenPosition.X - vector10.X; - float num117 = (float)Main.mouseY + Main.screenPosition.Y - vector10.Y; - if (Main.player[projectile.owner].gravDir == -1f) - { - num117 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector10.Y; - } - float num118 = (float)Math.Sqrt((double)(num116 * num116 + num117 * num117)); - num118 = (float)Math.Sqrt((double)(num116 * num116 + num117 * num117)); - if (projectile.ai[0] < 0f) - { - projectile.ai[0] += 1f; - } - if (num118 > num115) - { - num118 = num115 / num118; - num116 *= num118; - num117 *= num118; - int num119 = (int)(num116 * 1000f); - int num120 = (int)(projectile.velocity.X * 1000f); - int num121 = (int)(num117 * 1000f); - int num122 = (int)(projectile.velocity.Y * 1000f); - if (num119 != num120 || num121 != num122) - { - projectile.netUpdate = true; - } - projectile.velocity.X = num116; - projectile.velocity.Y = num117; - } - else - { - int num123 = (int)(num116 * 1000f); - int num124 = (int)(projectile.velocity.X * 1000f); - int num125 = (int)(num117 * 1000f); - int num126 = (int)(projectile.velocity.Y * 1000f); - if (num123 != num124 || num125 != num126) - { - projectile.netUpdate = true; - } - projectile.velocity.X = num116; - projectile.velocity.Y = num117; - } - } - else if (projectile.ai[0] <= 0f) - { - projectile.netUpdate = true; - float num127 = 12f; - Vector2 vector11 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num128 = (float)Main.mouseX + Main.screenPosition.X - vector11.X; - float num129 = (float)Main.mouseY + Main.screenPosition.Y - vector11.Y; - if (Main.player[projectile.owner].gravDir == -1f) - { - num129 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector11.Y; - } - float num130 = (float)Math.Sqrt((double)(num128 * num128 + num129 * num129)); - if (num130 == 0f || projectile.ai[0] < 0f) - { - vector11 = new Vector2(Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2), Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2)); - num128 = projectile.position.X + (float)projectile.width * 0.5f - vector11.X; - num129 = projectile.position.Y + (float)projectile.height * 0.5f - vector11.Y; - num130 = (float)Math.Sqrt((double)(num128 * num128 + num129 * num129)); - } - num130 = num127 / num130; - num128 *= num130; - num129 *= num130; - projectile.velocity.X = num128; - projectile.velocity.Y = num129; - if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.Kill(); - } - projectile.ai[0] = 1f; - } - } - if (projectile.velocity.X != 0f || projectile.velocity.Y != 0f) - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - } - if (projectile.velocity.Y > 16f) - { - projectile.velocity.Y = 16f; - } - } + public override void AI() + { + if (projectile.soundDelay == 0 && Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y) > 2f) + { + projectile.soundDelay = 10; + Main.PlaySound(SoundID.Item20, projectile.Center); + } + int sand = Dust.NewDust(projectile.position, projectile.width, projectile.height, 85, 0f, 0f, 100, default, 2f); + Dust dust = Main.dust[sand]; + dust.velocity *= 0.3f; + dust.position.X = projectile.Center.X + 4f + (float)Main.rand.Next(-4, 5); + dust.position.Y = projectile.Center.Y + (float)Main.rand.Next(-4, 5); + dust.noGravity = true; - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } + if (Main.myPlayer == projectile.owner && projectile.ai[0] <= 0f) + { + Player player = Main.player[projectile.owner]; + if (player.channel) + { + float speed = 18f; + float mouseDistX = (float)Main.mouseX + Main.screenPosition.X - projectile.Center.X; + float mouseDistY = (float)Main.mouseY + Main.screenPosition.Y - projectile.Center.Y; + if (player.gravDir == -1f) + { + mouseDistY = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - projectile.Center.Y; + } + Vector2 mouseVec = new Vector2(mouseDistX, mouseDistY); + float mouseDist = mouseVec.Length(); + if (projectile.ai[0] < 0f) + { + projectile.ai[0] += 1f; + } + if (mouseDist > speed) + { + mouseDist = speed / mouseDist; + mouseVec.X *= mouseDist; + mouseVec.Y *= mouseDist; + int mouseSpeedX = (int)(mouseVec.X * 1000f); + int projSpeedX = (int)(projectile.velocity.X * 1000f); + int mouseSpeedY = (int)(mouseVec.Y * 1000f); + int projSpeedY = (int)(projectile.velocity.Y * 1000f); + if (mouseSpeedX != projSpeedX || mouseSpeedY != projSpeedY) + { + projectile.netUpdate = true; + } + projectile.velocity.X = mouseVec.X; + projectile.velocity.Y = mouseVec.Y; + } + else + { + int mouseSpeedX = (int)(mouseVec.X * 1000f); + int projSpeedX = (int)(projectile.velocity.X * 1000f); + int mouseSpeedY = (int)(mouseVec.Y * 1000f); + int projSpeedY = (int)(projectile.velocity.Y * 1000f); + if (mouseSpeedX != projSpeedX || mouseSpeedY != projSpeedY) + { + projectile.netUpdate = true; + } + projectile.velocity.X = mouseVec.X; + projectile.velocity.Y = mouseVec.Y; + } + } + else if (projectile.ai[0] <= 0f) + { + projectile.netUpdate = true; + float speed = 12f; + Vector2 projCenter = projectile.Center; + float mouseDistX = (float)Main.mouseX + Main.screenPosition.X - projCenter.X; + float mouseDistY = (float)Main.mouseY + Main.screenPosition.Y - projCenter.Y; + if (player.gravDir == -1f) + { + mouseDistY = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - projCenter.Y; + } + Vector2 mouseVec = new Vector2(mouseDistX, mouseDistY); + float mouseDist = mouseVec.Length(); + if (mouseDist == 0f || projectile.ai[0] < 0f) + { + projCenter = player.Center; + mouseVec = projectile.Center - projCenter; + mouseDist = mouseVec.Length(); + } + mouseDist = speed / mouseDist; + mouseVec.X *= mouseDist; + mouseVec.Y *= mouseDist; + projectile.velocity.X = mouseVec.X; + projectile.velocity.Y = mouseVec.Y; + if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) + { + projectile.Kill(); + } + projectile.ai[0] = 1f; + } + } + if (projectile.velocity.X != 0f || projectile.velocity.Y != 0f) + { + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + } + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } + } - public override void Kill(int timeLeft) - { - 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(); - Main.PlaySound(SoundID.Item14, projectile.position); - int num226 = 36; - for (int num227 = 0; num227 < num226; num227++) - { - Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; - Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 85, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.2f); - Main.dust[num228].noGravity = true; - Main.dust[num228].noLight = true; - Main.dust[num228].velocity = vector7; - } - } - } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void Kill(int timeLeft) + { + projectile.position = projectile.Center; + projectile.width = projectile.height = 64; + projectile.Center = projectile.position; + projectile.maxPenetrate = -1; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.Damage(); + Main.PlaySound(SoundID.Item14, projectile.Center); + int dustAmt = 36; + for (int index = 0; index < dustAmt; index++) + { + Vector2 dustPos = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; + dustPos = dustPos.RotatedBy((double)((float)(index - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + projectile.Center; + Vector2 dustVel = dustPos - projectile.Center; + int sand = Dust.NewDust(dustPos + dustVel, 0, 0, 85, dustVel.X * 1.5f, dustVel.Y * 1.5f, 100, default, 1.2f); + Main.dust[sand].noGravity = true; + Main.dust[sand].noLight = true; + Main.dust[sand].velocity = dustVel; + } + } + } } diff --git a/Projectiles/Melee/DepthOrb.cs b/Projectiles/Melee/DepthOrb.cs index 820ef425cf..84fd73405c 100644 --- a/Projectiles/Melee/DepthOrb.cs +++ b/Projectiles/Melee/DepthOrb.cs @@ -55,8 +55,7 @@ namespace CalamityMod.Projectiles.Melee Main.PlaySound(SoundID.Item10, projectile.position); 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.Center = projectile.position; for (int dustIndex = 0; dustIndex < 30; dustIndex++) { float num463 = (float)Main.rand.Next(-10, 11); @@ -80,6 +79,7 @@ namespace CalamityMod.Projectiles.Melee projectile.penetrate = -1; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; + projectile.damage /= 2; projectile.Damage(); } diff --git a/Projectiles/Rogue/EclipsesStealth.cs b/Projectiles/Rogue/EclipsesStealth.cs index f08ba0a765..ef8a5494a6 100644 --- a/Projectiles/Rogue/EclipsesStealth.cs +++ b/Projectiles/Rogue/EclipsesStealth.cs @@ -7,95 +7,106 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class EclipsesStealth : ModProjectile - { + public class EclipsesStealth : ModProjectile + { private bool changedTimeLeft = false; - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Eclipse's Stealth"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eclipse's Stealth"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } - public override void SetDefaults() - { - projectile.width = 25; - projectile.height = 25; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.timeLeft = 300; - projectile.ignoreWater = true; - projectile.tileCollide = false; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 30; - projectile.Calamity().rogue = true; - } + public override void SetDefaults() + { + projectile.width = 25; + projectile.height = 25; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.timeLeft = 300; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = -1; + projectile.Calamity().rogue = true; + } - public override void AI() - { - if (projectile.timeLeft % 5 == 0) //congrats Pinkie... every 5 ticks - { - if (Main.rand.NextBool(2) && Main.myPlayer == projectile.owner) - { - float dmgKBMult = Main.rand.NextFloat(0.32f, 0.56f); - int spearAmt = Main.rand.Next(1, 4); //1 to 3 spears - for (int n = 0; n < spearAmt; n++) - { - float xStart = projectile.position.X + Main.rand.Next(-400, 400); - float yStart = projectile.position.Y - Main.rand.Next(500, 800); - Vector2 startPos = new Vector2(xStart, yStart); + public override void AI() + { + if (projectile.timeLeft % 5 == 0) //congrats Pinkie... every 5 ticks + { + if (Main.rand.NextBool(2) && Main.myPlayer == projectile.owner) + { + float dmgKBMult = Main.rand.NextFloat(0.3f, 0.5f); + int spearAmt = Main.rand.Next(1, 3); //1 to 2 spears + for (int n = 0; n < spearAmt; n++) + { + float xStart = projectile.position.X + Main.rand.Next(-400, 400); + float yStart = projectile.position.Y - Main.rand.Next(500, 800); + Vector2 startPos = new Vector2(xStart, yStart); Vector2 velocity = projectile.Center - startPos; - velocity.X += (float)Main.rand.Next(-100, 101); + velocity.X += (float)Main.rand.Next(-100, 101); float travelDist = velocity.Length(); - float spearSpeed = 29f; - travelDist = spearSpeed / travelDist; - velocity.X *= travelDist; - velocity.Y *= travelDist; - Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), (int)(projectile.damage * dmgKBMult), projectile.knockBack * dmgKBMult, projectile.owner, 0f, 0f); - } - } - } + float spearSpeed = 29f; + travelDist = spearSpeed / travelDist; + velocity.X *= travelDist; + velocity.Y *= travelDist; + Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), (int)(projectile.damage * dmgKBMult), projectile.knockBack * dmgKBMult, projectile.owner, 0f, 0f); + } + } + } //Behavior when not sticking to anything - if (projectile.ai[0] == 0f) - { - projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver4; - if (Main.rand.NextBool(8)) //dust - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 138, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } - } + if (projectile.ai[0] == 0f) + { + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver4; + if (Main.rand.NextBool(8)) //dust + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 138, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + } - //Ensures that a spear will last 15 seconds after it hits something + //Ensures that a spear will last 10 seconds after it hits something if (projectile.ai[0] == 1f && !changedTimeLeft) { - projectile.timeLeft = 900; + projectile.timeLeft = 600; changedTimeLeft = true; } - //Sticky Behaviour - projectile.StickyProjAI(15); - } + //Sticky Behaviour + projectile.StickyProjAI(10); + } - public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - projectile.ModifyHitNPCSticky(1, true); - } + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + projectile.ModifyHitNPCSticky(1, true); + } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) - { - if (targetHitbox.Width > 8 && targetHitbox.Height > 8) - { - targetHitbox.Inflate(-targetHitbox.Width / 8, -targetHitbox.Height / 8); - } - return null; - } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (targetHitbox.Width > 8 && targetHitbox.Height > 8) + { + targetHitbox.Inflate(-targetHitbox.Width / 8, -targetHitbox.Height / 8); + } + return null; + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override bool? CanHitNPC(NPC target) + { + if (projectile.ai[0] == 1f) + { + return false; + } + return null; + } + + public override bool CanHitPvp(Player target) => projectile.ai[0] != 1f; + } } From e586734cb2e2def221282f635a7d44d5cd28f96a Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 11:48:24 -0400 Subject: [PATCH 077/160] lastProjectileHit is now checked globally and fixed rubico prime bug --- Projectiles/Boss/BrimstoneBarrage.cs | 5 ----- Projectiles/Boss/BrimstoneFireblast.cs | 5 ----- Projectiles/Boss/BrimstoneGigaBlast.cs | 5 ----- Projectiles/Boss/BrimstoneHellblast.cs | 5 ----- Projectiles/Boss/BrimstoneHellblast2.cs | 5 ----- Projectiles/Boss/BrimstoneMonster.cs | 5 ----- Projectiles/Boss/BrimstoneRay.cs | 5 ----- Projectiles/Boss/BrimstoneTargetRay.cs | 5 ----- Projectiles/Boss/BrimstoneWave.cs | 5 ----- Projectiles/Boss/DarkEnergyBall.cs | 5 ----- Projectiles/Boss/DarkOrb.cs | 5 ----- Projectiles/Boss/DoGBeam.cs | 5 ----- Projectiles/Boss/DoGBeamPortal.cs | 5 ----- Projectiles/Boss/DoGDeath.cs | 5 ----- Projectiles/Boss/DoGFire.cs | 5 ----- Projectiles/Boss/DoGNebulaShot.cs | 5 ----- Projectiles/Boss/EssenceDust.cs | 5 ----- Projectiles/Boss/FlareBomb.cs | 5 ----- Projectiles/Boss/FlareDust.cs | 5 ----- Projectiles/Boss/FlareDust2.cs | 5 ----- Projectiles/Boss/Flarenado.cs | 5 ----- Projectiles/Boss/HolyBlast.cs | 5 ----- Projectiles/Boss/HolyBomb.cs | 5 ----- Projectiles/Boss/HolyFire.cs | 5 ----- Projectiles/Boss/HolyFire2.cs | 5 ----- Projectiles/Boss/HolyFlare.cs | 5 ----- Projectiles/Boss/HolySpear.cs | 5 ----- Projectiles/Boss/Infernado.cs | 5 ----- Projectiles/Boss/Infernado2.cs | 5 ----- Projectiles/Boss/InfernadoRevenge.cs | 5 ----- Projectiles/Boss/MoltenBlast.cs | 5 ----- Projectiles/Boss/MoltenBlob.cs | 5 ----- Projectiles/Boss/OldDukeGore.cs | 5 ----- Projectiles/Boss/OldDukeVortex.cs | 5 ----- Projectiles/Boss/PhantomBlast.cs | 5 ----- Projectiles/Boss/PhantomBlast2.cs | 5 ----- Projectiles/Boss/PhantomGhostShot.cs | 5 ----- Projectiles/Boss/PhantomHookShot.cs | 5 ----- Projectiles/Boss/PhantomMine.cs | 5 ----- Projectiles/Boss/PhantomShot.cs | 5 ----- Projectiles/Boss/PhantomShot2.cs | 5 ----- Projectiles/Boss/ProfanedSpear.cs | 5 ----- Projectiles/Boss/ProvidenceCrystal.cs | 5 ----- Projectiles/Boss/ProvidenceCrystalShard.cs | 5 ----- Projectiles/Boss/ProvidenceHolyRay.cs | 5 ----- Projectiles/Boss/RedLightning.cs | 5 ----- Projectiles/Boss/RedLightningFeather.cs | 5 ----- Projectiles/Boss/SignusScythe.cs | 5 ----- Projectiles/Boss/SkyFlare.cs | 5 ----- Projectiles/Boss/SkyFlareRevenge.cs | 5 ----- Projectiles/Boss/YharonFireball.cs | 5 ----- Projectiles/Boss/YharonFireball2.cs | 5 ----- Projectiles/CalamityGlobalProjectile.cs | 22 +++++++++++++++++++++- Projectiles/Ranged/ImpactRound.cs | 14 -------------- 54 files changed, 21 insertions(+), 275 deletions(-) diff --git a/Projectiles/Boss/BrimstoneBarrage.cs b/Projectiles/Boss/BrimstoneBarrage.cs index 8bbb9d2785..ef6fc357dc 100644 --- a/Projectiles/Boss/BrimstoneBarrage.cs +++ b/Projectiles/Boss/BrimstoneBarrage.cs @@ -70,10 +70,5 @@ namespace CalamityMod.Projectiles.Boss CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); return false; } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/BrimstoneFireblast.cs b/Projectiles/Boss/BrimstoneFireblast.cs index bf53bdbcdb..cc378b32d5 100644 --- a/Projectiles/Boss/BrimstoneFireblast.cs +++ b/Projectiles/Boss/BrimstoneFireblast.cs @@ -125,10 +125,5 @@ namespace CalamityMod.Projectiles.Boss Main.dust[redFire].noGravity = true; } } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/BrimstoneGigaBlast.cs b/Projectiles/Boss/BrimstoneGigaBlast.cs index 4134292304..73d03e5ef9 100644 --- a/Projectiles/Boss/BrimstoneGigaBlast.cs +++ b/Projectiles/Boss/BrimstoneGigaBlast.cs @@ -136,10 +136,5 @@ namespace CalamityMod.Projectiles.Boss Main.dust[redFire].noGravity = true; } } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/BrimstoneHellblast.cs b/Projectiles/Boss/BrimstoneHellblast.cs index 709c1db06c..0200d16f85 100644 --- a/Projectiles/Boss/BrimstoneHellblast.cs +++ b/Projectiles/Boss/BrimstoneHellblast.cs @@ -86,10 +86,5 @@ namespace CalamityMod.Projectiles.Boss Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f); } } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/BrimstoneHellblast2.cs b/Projectiles/Boss/BrimstoneHellblast2.cs index be51d96d10..c410cefc81 100644 --- a/Projectiles/Boss/BrimstoneHellblast2.cs +++ b/Projectiles/Boss/BrimstoneHellblast2.cs @@ -79,10 +79,5 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(ModContent.BuffType(), 180); target.AddBuff(ModContent.BuffType(), 120, true); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/BrimstoneMonster.cs b/Projectiles/Boss/BrimstoneMonster.cs index 0bd500e3be..d7d7864a75 100644 --- a/Projectiles/Boss/BrimstoneMonster.cs +++ b/Projectiles/Boss/BrimstoneMonster.cs @@ -190,10 +190,5 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(ModContent.BuffType(), 900); target.AddBuff(ModContent.BuffType(), 300, true); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/BrimstoneRay.cs b/Projectiles/Boss/BrimstoneRay.cs index c16c04b578..1c30540c42 100644 --- a/Projectiles/Boss/BrimstoneRay.cs +++ b/Projectiles/Boss/BrimstoneRay.cs @@ -194,10 +194,5 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 300); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/BrimstoneTargetRay.cs b/Projectiles/Boss/BrimstoneTargetRay.cs index 4b3c4c25c1..d478512f1a 100644 --- a/Projectiles/Boss/BrimstoneTargetRay.cs +++ b/Projectiles/Boss/BrimstoneTargetRay.cs @@ -175,10 +175,5 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 300); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/BrimstoneWave.cs b/Projectiles/Boss/BrimstoneWave.cs index a03037bcec..91b1021e2e 100644 --- a/Projectiles/Boss/BrimstoneWave.cs +++ b/Projectiles/Boss/BrimstoneWave.cs @@ -88,10 +88,5 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(ModContent.BuffType(), 180); target.AddBuff(ModContent.BuffType(), 120, true); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/DarkEnergyBall.cs b/Projectiles/Boss/DarkEnergyBall.cs index 7892710b88..153e21122e 100644 --- a/Projectiles/Boss/DarkEnergyBall.cs +++ b/Projectiles/Boss/DarkEnergyBall.cs @@ -92,10 +92,5 @@ namespace CalamityMod.Projectiles.Boss Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 90, 0f, 0f); } } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/DarkOrb.cs b/Projectiles/Boss/DarkOrb.cs index 67272b90c9..3739197acb 100644 --- a/Projectiles/Boss/DarkOrb.cs +++ b/Projectiles/Boss/DarkOrb.cs @@ -559,10 +559,5 @@ namespace CalamityMod.Projectiles.Boss CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); return false; } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/DoGBeam.cs b/Projectiles/Boss/DoGBeam.cs index 2a4bac8ce4..817348e1c1 100644 --- a/Projectiles/Boss/DoGBeam.cs +++ b/Projectiles/Boss/DoGBeam.cs @@ -81,10 +81,5 @@ namespace CalamityMod.Projectiles.Boss } return new Color(255, 255, 255, 100); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/DoGBeamPortal.cs b/Projectiles/Boss/DoGBeamPortal.cs index 89e6fa7364..d7bcbdd076 100644 --- a/Projectiles/Boss/DoGBeamPortal.cs +++ b/Projectiles/Boss/DoGBeamPortal.cs @@ -144,10 +144,5 @@ namespace CalamityMod.Projectiles.Boss } return new Color(255, 255, 255, 100); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/DoGDeath.cs b/Projectiles/Boss/DoGDeath.cs index 23dbe65792..60b8178591 100644 --- a/Projectiles/Boss/DoGDeath.cs +++ b/Projectiles/Boss/DoGDeath.cs @@ -97,11 +97,6 @@ namespace CalamityMod.Projectiles.Boss return new Color(255, 255, 255, projectile.alpha); } - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { if (TelegraphDelay >= TelegraphTotalTime) diff --git a/Projectiles/Boss/DoGFire.cs b/Projectiles/Boss/DoGFire.cs index f93343d7cc..f69323b21a 100644 --- a/Projectiles/Boss/DoGFire.cs +++ b/Projectiles/Boss/DoGFire.cs @@ -124,10 +124,5 @@ namespace CalamityMod.Projectiles.Boss } projectile.Damage(); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/DoGNebulaShot.cs b/Projectiles/Boss/DoGNebulaShot.cs index 5c1e55803b..c3835410db 100644 --- a/Projectiles/Boss/DoGNebulaShot.cs +++ b/Projectiles/Boss/DoGNebulaShot.cs @@ -108,10 +108,5 @@ namespace CalamityMod.Projectiles.Boss } return false; } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/EssenceDust.cs b/Projectiles/Boss/EssenceDust.cs index f82bff0d80..8a188fb82a 100644 --- a/Projectiles/Boss/EssenceDust.cs +++ b/Projectiles/Boss/EssenceDust.cs @@ -69,10 +69,5 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 180); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/FlareBomb.cs b/Projectiles/Boss/FlareBomb.cs index 678ce0689a..a09ab5e721 100644 --- a/Projectiles/Boss/FlareBomb.cs +++ b/Projectiles/Boss/FlareBomb.cs @@ -167,10 +167,5 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 180); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/FlareDust.cs b/Projectiles/Boss/FlareDust.cs index 8f5553b635..4a53058da3 100644 --- a/Projectiles/Boss/FlareDust.cs +++ b/Projectiles/Boss/FlareDust.cs @@ -152,10 +152,5 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 180); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/FlareDust2.cs b/Projectiles/Boss/FlareDust2.cs index 2443e6de78..d484beb5fd 100644 --- a/Projectiles/Boss/FlareDust2.cs +++ b/Projectiles/Boss/FlareDust2.cs @@ -160,10 +160,5 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 180); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/Flarenado.cs b/Projectiles/Boss/Flarenado.cs index 1829441a28..3992498345 100644 --- a/Projectiles/Boss/Flarenado.cs +++ b/Projectiles/Boss/Flarenado.cs @@ -158,10 +158,5 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 300); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index abce937794..9589f81796 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -125,10 +125,5 @@ namespace CalamityMod.Projectiles.Boss int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 240); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/HolyBomb.cs b/Projectiles/Boss/HolyBomb.cs index d11ae92d40..f2c9c04a3b 100644 --- a/Projectiles/Boss/HolyBomb.cs +++ b/Projectiles/Boss/HolyBomb.cs @@ -120,10 +120,5 @@ namespace CalamityMod.Projectiles.Boss int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 180); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/HolyFire.cs b/Projectiles/Boss/HolyFire.cs index 2708403b29..5dfbd0bfdd 100644 --- a/Projectiles/Boss/HolyFire.cs +++ b/Projectiles/Boss/HolyFire.cs @@ -115,10 +115,5 @@ namespace CalamityMod.Projectiles.Boss int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 120); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/HolyFire2.cs b/Projectiles/Boss/HolyFire2.cs index a913902aa2..a2b5af9edf 100644 --- a/Projectiles/Boss/HolyFire2.cs +++ b/Projectiles/Boss/HolyFire2.cs @@ -104,10 +104,5 @@ namespace CalamityMod.Projectiles.Boss int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 120); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/HolyFlare.cs b/Projectiles/Boss/HolyFlare.cs index 541ad69c39..c9925d6b38 100644 --- a/Projectiles/Boss/HolyFlare.cs +++ b/Projectiles/Boss/HolyFlare.cs @@ -112,10 +112,5 @@ namespace CalamityMod.Projectiles.Boss int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 120); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/HolySpear.cs b/Projectiles/Boss/HolySpear.cs index 7eb1df79a1..7ca0372578 100644 --- a/Projectiles/Boss/HolySpear.cs +++ b/Projectiles/Boss/HolySpear.cs @@ -172,10 +172,5 @@ namespace CalamityMod.Projectiles.Boss int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 120); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/Infernado.cs b/Projectiles/Boss/Infernado.cs index 8aeb0720a9..4feff31fd2 100644 --- a/Projectiles/Boss/Infernado.cs +++ b/Projectiles/Boss/Infernado.cs @@ -159,10 +159,5 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 420); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/Infernado2.cs b/Projectiles/Boss/Infernado2.cs index 13b5e3550e..387aaa9948 100644 --- a/Projectiles/Boss/Infernado2.cs +++ b/Projectiles/Boss/Infernado2.cs @@ -159,10 +159,5 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 420); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/InfernadoRevenge.cs b/Projectiles/Boss/InfernadoRevenge.cs index ffa2e253ae..e94d493a88 100644 --- a/Projectiles/Boss/InfernadoRevenge.cs +++ b/Projectiles/Boss/InfernadoRevenge.cs @@ -147,10 +147,5 @@ namespace CalamityMod.Projectiles.Boss { target.KillMe(PlayerDeathReason.ByOther(11), 1000.0, 0, false); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index c22cb912a6..30d3edc2e3 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -144,10 +144,5 @@ namespace CalamityMod.Projectiles.Boss int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 180); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/MoltenBlob.cs b/Projectiles/Boss/MoltenBlob.cs index cbab067719..97a8403976 100644 --- a/Projectiles/Boss/MoltenBlob.cs +++ b/Projectiles/Boss/MoltenBlob.cs @@ -114,10 +114,5 @@ namespace CalamityMod.Projectiles.Boss int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 90); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/OldDukeGore.cs b/Projectiles/Boss/OldDukeGore.cs index e51fb94960..04e32c20eb 100644 --- a/Projectiles/Boss/OldDukeGore.cs +++ b/Projectiles/Boss/OldDukeGore.cs @@ -92,11 +92,6 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(ModContent.BuffType(), 180); } - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Boss/OldDukeVortex.cs b/Projectiles/Boss/OldDukeVortex.cs index 37d32ae461..8e7b4e2d82 100644 --- a/Projectiles/Boss/OldDukeVortex.cs +++ b/Projectiles/Boss/OldDukeVortex.cs @@ -163,10 +163,5 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 600); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/PhantomBlast.cs b/Projectiles/Boss/PhantomBlast.cs index 4ee028bf2b..81430ea803 100644 --- a/Projectiles/Boss/PhantomBlast.cs +++ b/Projectiles/Boss/PhantomBlast.cs @@ -134,10 +134,5 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 180); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/PhantomBlast2.cs b/Projectiles/Boss/PhantomBlast2.cs index c87d356339..e818b4f805 100644 --- a/Projectiles/Boss/PhantomBlast2.cs +++ b/Projectiles/Boss/PhantomBlast2.cs @@ -134,10 +134,5 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 180); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/PhantomGhostShot.cs b/Projectiles/Boss/PhantomGhostShot.cs index bd7c433b0b..0c6d067ea0 100644 --- a/Projectiles/Boss/PhantomGhostShot.cs +++ b/Projectiles/Boss/PhantomGhostShot.cs @@ -72,10 +72,5 @@ namespace CalamityMod.Projectiles.Boss { return new Color(100, 250, 250, projectile.alpha); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/PhantomHookShot.cs b/Projectiles/Boss/PhantomHookShot.cs index f7354d7961..e1757d15db 100644 --- a/Projectiles/Boss/PhantomHookShot.cs +++ b/Projectiles/Boss/PhantomHookShot.cs @@ -72,10 +72,5 @@ namespace CalamityMod.Projectiles.Boss { return new Color(100, 250, 250, projectile.alpha); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/PhantomMine.cs b/Projectiles/Boss/PhantomMine.cs index d7dacfd160..c2d4e0c8db 100644 --- a/Projectiles/Boss/PhantomMine.cs +++ b/Projectiles/Boss/PhantomMine.cs @@ -73,10 +73,5 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(ModContent.BuffType(), 180); target.AddBuff(ModContent.BuffType(), 180); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/PhantomShot.cs b/Projectiles/Boss/PhantomShot.cs index ad79d9e30f..6a4c0e068a 100644 --- a/Projectiles/Boss/PhantomShot.cs +++ b/Projectiles/Boss/PhantomShot.cs @@ -94,10 +94,5 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 120); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/PhantomShot2.cs b/Projectiles/Boss/PhantomShot2.cs index a4d8559c89..6e7f867e70 100644 --- a/Projectiles/Boss/PhantomShot2.cs +++ b/Projectiles/Boss/PhantomShot2.cs @@ -94,10 +94,5 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 120); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/ProfanedSpear.cs b/Projectiles/Boss/ProfanedSpear.cs index 062f25ed52..55f71dfebf 100644 --- a/Projectiles/Boss/ProfanedSpear.cs +++ b/Projectiles/Boss/ProfanedSpear.cs @@ -95,10 +95,5 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 120); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/ProvidenceCrystal.cs b/Projectiles/Boss/ProvidenceCrystal.cs index 5680c48c3d..da933096ae 100644 --- a/Projectiles/Boss/ProvidenceCrystal.cs +++ b/Projectiles/Boss/ProvidenceCrystal.cs @@ -124,10 +124,5 @@ namespace CalamityMod.Projectiles.Boss } return false; } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/ProvidenceCrystalShard.cs b/Projectiles/Boss/ProvidenceCrystalShard.cs index d95955e4c7..f63b2ef5a0 100644 --- a/Projectiles/Boss/ProvidenceCrystalShard.cs +++ b/Projectiles/Boss/ProvidenceCrystalShard.cs @@ -199,10 +199,5 @@ namespace CalamityMod.Projectiles.Boss { return new Color(255 - projectile.alpha, 255 - projectile.alpha, 255 - projectile.alpha, 0); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/ProvidenceHolyRay.cs b/Projectiles/Boss/ProvidenceHolyRay.cs index 820bdb9bcf..b3594f0c89 100644 --- a/Projectiles/Boss/ProvidenceHolyRay.cs +++ b/Projectiles/Boss/ProvidenceHolyRay.cs @@ -201,10 +201,5 @@ namespace CalamityMod.Projectiles.Boss int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 300); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/RedLightning.cs b/Projectiles/Boss/RedLightning.cs index 93ce2b4b0f..f10c371228 100644 --- a/Projectiles/Boss/RedLightning.cs +++ b/Projectiles/Boss/RedLightning.cs @@ -172,11 +172,6 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(BuffID.Electrified, 120); } - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Vector2 end = projectile.position + new Vector2((float)projectile.width, (float)projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; diff --git a/Projectiles/Boss/RedLightningFeather.cs b/Projectiles/Boss/RedLightningFeather.cs index ff79ea25e8..d6f0de9cce 100644 --- a/Projectiles/Boss/RedLightningFeather.cs +++ b/Projectiles/Boss/RedLightningFeather.cs @@ -145,10 +145,5 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(BuffID.Electrified, 60); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/SignusScythe.cs b/Projectiles/Boss/SignusScythe.cs index b367ebcf9b..aaf9398c33 100644 --- a/Projectiles/Boss/SignusScythe.cs +++ b/Projectiles/Boss/SignusScythe.cs @@ -144,10 +144,5 @@ namespace CalamityMod.Projectiles.Boss Main.dust[num624].velocity *= 2f; } } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/SkyFlare.cs b/Projectiles/Boss/SkyFlare.cs index 457fdc6e5f..e0d9cae535 100644 --- a/Projectiles/Boss/SkyFlare.cs +++ b/Projectiles/Boss/SkyFlare.cs @@ -121,10 +121,5 @@ namespace CalamityMod.Projectiles.Boss } } } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/SkyFlareRevenge.cs b/Projectiles/Boss/SkyFlareRevenge.cs index 7a65e48579..4eaf5a23ab 100644 --- a/Projectiles/Boss/SkyFlareRevenge.cs +++ b/Projectiles/Boss/SkyFlareRevenge.cs @@ -72,10 +72,5 @@ namespace CalamityMod.Projectiles.Boss Main.projectile[num236].netUpdate = true; } } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/YharonFireball.cs b/Projectiles/Boss/YharonFireball.cs index 6644565178..cdda190992 100644 --- a/Projectiles/Boss/YharonFireball.cs +++ b/Projectiles/Boss/YharonFireball.cs @@ -117,10 +117,5 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 180); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/Boss/YharonFireball2.cs b/Projectiles/Boss/YharonFireball2.cs index 26cb43809f..85ece5314e 100644 --- a/Projectiles/Boss/YharonFireball2.cs +++ b/Projectiles/Boss/YharonFireball2.cs @@ -129,10 +129,5 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 180); } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } } } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 0b036b174c..d595a93032 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1058,7 +1058,12 @@ namespace CalamityMod.Projectiles } #endregion - #region ModifyHitNPC + #region ModifyHit + public override void ModifyHitPlayer(Projectile projectile, Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } + public override void ModifyHitNPC(Projectile projectile, NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { Player player = Main.player[projectile.owner]; @@ -1101,6 +1106,21 @@ namespace CalamityMod.Projectiles if (rogue && stealthStrike && modPlayer.stealthStrikeAlwaysCrits) crit = true; + + //Done here since crit calcs are overridden here + if (projectile.type == ProjectileType()) + { + double damageMult = 1D; + if (crit) + { + damageMult += 0.25; + } + if (target.Inorganic()) + { + damageMult += 0.1; + } + damage = (int)(damage * damageMult); + } } } #endregion diff --git a/Projectiles/Ranged/ImpactRound.cs b/Projectiles/Ranged/ImpactRound.cs index c471d98944..77be1dd621 100644 --- a/Projectiles/Ranged/ImpactRound.cs +++ b/Projectiles/Ranged/ImpactRound.cs @@ -43,19 +43,5 @@ namespace CalamityMod.Projectiles.Ranged } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) => projectile.timeLeft < 600; - - public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - double damageMult = 1D; - if (crit) - { - damageMult += 0.25; - } - if (target.Inorganic()) - { - damageMult += 0.1; - } - damage = (int)(damage * damageMult); - } } } From 7702783de65b250c8fd62e177f6908b557c5f883 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 11:51:57 -0400 Subject: [PATCH 078/160] stupid ass using directive --- Projectiles/CalamityGlobalProjectile.cs | 40 +++++++++++++------------ 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index d595a93032..c1bb8f933b 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -9,6 +9,7 @@ using CalamityMod.Projectiles.Hybrid; using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Melee.Yoyos; +using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; @@ -78,13 +79,13 @@ namespace CalamityMod.Projectiles public bool overridesMinionDamagePrevention = false; #region SetDefaults - public override void SetDefaults(Projectile projectile) - { + public override void SetDefaults(Projectile projectile) + { if (CalamityMod.trueMeleeProjectileList.Contains(projectile.type)) trueMelee = true; - switch (projectile.type) - { + switch (projectile.type) + { case ProjectileID.ShadowBeamHostile: projectile.timeLeft = 60; break; @@ -97,23 +98,24 @@ namespace CalamityMod.Projectiles projectile.extraUpdates = 1; break; - case ProjectileID.StarWrath: - projectile.penetrate = projectile.maxPenetrate = 1; - break; + case ProjectileID.StarWrath: + projectile.penetrate = projectile.maxPenetrate = 1; + break; - case ProjectileID.Spazmamini: - case ProjectileID.Retanimini: - case ProjectileID.MiniRetinaLaser: - projectile.localNPCHitCooldown = 10; - projectile.usesLocalNPCImmunity = true; - break; - default: - break; - } + case ProjectileID.Spazmamini: + case ProjectileID.Retanimini: + case ProjectileID.MiniRetinaLaser: + projectile.localNPCHitCooldown = 10; + projectile.usesLocalNPCImmunity = true; + projectile.usesIDStaticNPCImmunity = false; + break; + default: + break; + } - // Disable Lunatic Cultist's homing resistance globally - ProjectileID.Sets.Homing[projectile.type] = false; - } + // Disable Lunatic Cultist's homing resistance globally + ProjectileID.Sets.Homing[projectile.type] = false; + } #endregion #region PreAI From 94ef3e8ce558eef2c2125854e78331232ec16702 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 11:58:09 -0400 Subject: [PATCH 079/160] since it was commented out in yharon's file --- ModSupport/WeakReferenceSupport.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 42a01ddd1c..9877ceaf25 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -522,7 +522,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("Yharon", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), /*ItemType(), */ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}] in the Jungle Biome"; // TODO -- this setup code is only run once, so the despawn message can't be changed post-eclipse. Find a way around this. From 35efede8b3a7d521f2369e543181db1225eb2511 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 12:04:26 -0400 Subject: [PATCH 080/160] attempted to stop flickering stealth bar --- UI/StealthUI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/StealthUI.cs b/UI/StealthUI.cs index 84ae2c116c..9a54e251b1 100644 --- a/UI/StealthUI.cs +++ b/UI/StealthUI.cs @@ -20,7 +20,7 @@ namespace CalamityMod.UI DrawPosition.Y = Main.screenHeight / 2 + Main.LocalPlayer.height / 2f + 24f; } CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.stealthUIAlpha <= 0f || !CalamityConfig.Instance.StealthBar || modPlayer.rogueStealthMax <= 0) + if (modPlayer.stealthUIAlpha <= 0f || !CalamityConfig.Instance.StealthBar || modPlayer.rogueStealthMax <= 0f || !modPlayer.wearingRogueArmor) { if (CalamityConfig.Instance.StealthMeterPosX != DrawPosition.X) { From a949ca7252452e972a91b180b240fd11d4e377fa Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 12:53:18 -0400 Subject: [PATCH 081/160] defective sphere bug fix --- Projectiles/CalamityGlobalProjectile.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index c1bb8f933b..3c71b05887 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1102,14 +1102,13 @@ namespace CalamityMod.Projectiles crit = Main.rand.NextBool(6); } - //Needs to be done in here. If done in the projectile file, it's overridden by the thing above - if (projectile.type == ProjectileType() && projectile.ai[0] == 1f) - crit = true; - if (rogue && stealthStrike && modPlayer.stealthStrikeAlwaysCrits) crit = true; - //Done here since crit calcs are overridden here + //Following things need to be done in here. If done in the projectile file, it's overridden by the thing above + if (projectile.type == ProjectileType() && projectile.ai[0] == 1f) + crit = true; + if (projectile.type == ProjectileType()) { double damageMult = 1D; @@ -1123,6 +1122,13 @@ namespace CalamityMod.Projectiles } damage = (int)(damage * damageMult); } + + if (projectile.type == ProjectileType()) + { + damage = (int)(damage * 1.2); + if (!crit) + crit = Main.rand.NextBool(10); + } } } #endregion From 14a2189b4554cfd8a63885136aca335e65cffd5e Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 13:39:15 -0400 Subject: [PATCH 082/160] fixed a bug with multiple ammo items ignoring unlimited pouches --- Items/CalamityGlobalItem.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 3c5b09601a..0fbee3f3eb 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -3576,7 +3576,7 @@ Grants immunity to fire blocks, and temporary immunity to lava"; for (int i = 54; i < Main.maxInventory; i++) { - if (player.inventory[i].ammo == item.useAmmo && player.inventory[i].stack >= ammoConsumed) + if (player.inventory[i].ammo == item.useAmmo && (player.inventory[i].stack >= ammoConsumed || !player.inventory[i].consumable)) { itemAmmo = player.inventory[i]; flag = true; @@ -3588,7 +3588,7 @@ Grants immunity to fire blocks, and temporary immunity to lava"; { for (int j = 0; j < 54; j++) { - if (player.inventory[j].ammo == item.useAmmo && player.inventory[j].stack >= ammoConsumed) + if (player.inventory[j].ammo == item.useAmmo && (player.inventory[j].stack >= ammoConsumed || !player.inventory[j].consumable)) { itemAmmo = player.inventory[j]; break; From c6b8aa542b30ecb96346322e0b365ff83c7e146a Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 13:41:10 -0400 Subject: [PATCH 083/160] slightly buffed Eclipse's Fall SS --- Projectiles/Rogue/EclipsesStealth.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Rogue/EclipsesStealth.cs b/Projectiles/Rogue/EclipsesStealth.cs index ef8a5494a6..b672b832dc 100644 --- a/Projectiles/Rogue/EclipsesStealth.cs +++ b/Projectiles/Rogue/EclipsesStealth.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Rogue { if (Main.rand.NextBool(2) && Main.myPlayer == projectile.owner) { - float dmgKBMult = Main.rand.NextFloat(0.3f, 0.5f); + float dmgKBMult = Main.rand.NextFloat(0.4f, 0.6f); int spearAmt = Main.rand.Next(1, 3); //1 to 2 spears for (int n = 0; n < spearAmt; n++) { From c61d9daea83f6c8817007714890fea8a685f2535 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 13:47:01 -0400 Subject: [PATCH 084/160] fixed minor crystalline visual bug --- Projectiles/Rogue/Crystalline2.cs | 8 +++++--- Projectiles/Rogue/CrystallineProj.cs | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Projectiles/Rogue/Crystalline2.cs b/Projectiles/Rogue/Crystalline2.cs index 6aaabebe15..993bca11aa 100644 --- a/Projectiles/Rogue/Crystalline2.cs +++ b/Projectiles/Rogue/Crystalline2.cs @@ -28,10 +28,10 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { projectile.localAI[0]++; - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.ToRadians(135f); if (projectile.spriteDirection == -1) { - projectile.rotation -= 1.57f; + projectile.rotation -= MathHelper.PiOver2; } if (projectile.localAI[0] == 10f && projectile.ai[1] == 1f) { @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Rogue for (int i = 0; i < numProj + 1; i++) { Vector2 perturbedSpeed = new Vector2(projectile.velocity.X * 0.8f, projectile.velocity.Y * 0.8f).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); - int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5f), projectile.knockBack, projectile.owner, 0f, 2f); + int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.5f), projectile.knockBack, projectile.owner, 0f, 2f); Main.projectile[proj].timeLeft = 20; } } @@ -51,6 +51,8 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { + if (projectile.timeLeft == (projectile.ai[1] == 2f ? 20 : 30)) + return false; Texture2D tex = Main.projectileTexture[projectile.type]; spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); return false; diff --git a/Projectiles/Rogue/CrystallineProj.cs b/Projectiles/Rogue/CrystallineProj.cs index d5e35bf284..14b3066e8b 100644 --- a/Projectiles/Rogue/CrystallineProj.cs +++ b/Projectiles/Rogue/CrystallineProj.cs @@ -27,10 +27,10 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.ToRadians(135f); if (projectile.spriteDirection == -1) { - projectile.rotation -= 1.57f; + projectile.rotation -= MathHelper.PiOver2; } projectile.ai[1] += 1f; if (projectile.ai[1] == 30f) @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Rogue { float AI1 = projectile.Calamity().stealthStrike ? 1f : 0f; Vector2 perturbedSpeed = new Vector2(projectile.velocity.X, projectile.velocity.Y).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5f), projectile.knockBack, projectile.owner, 0f, AI1); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.5f), projectile.knockBack, projectile.owner, 0f, AI1); } } } From 24cc5289f21fdaba5ed4a0925792ae7e66c35ec0 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 14:12:33 -0400 Subject: [PATCH 085/160] fixed final dawn - venerated locket shenanigans --- CalPlayer/CalamityPlayer.cs | 7 +- Projectiles/Rogue/FinalDawnProjectile.cs | 306 ++++++++++++----------- 2 files changed, 159 insertions(+), 154 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 55b47645ca..499aa0c010 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -7150,9 +7150,12 @@ namespace CalamityMod.CalPlayer num79 *= num80; float speedX4 = num78 + (float)Main.rand.Next(-30, 31) * 0.02f; float speedY5 = num79 + (float)Main.rand.Next(-30, 31) * 0.02f; - int p = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, (int)(damage * 0.15f), (int)(knockBack), player.whoAmI, 0f, (float)Main.rand.Next(15)); - Main.projectile[p].knockBack /= 2; + int p = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, (int)(damage * 0.15f), knockBack * 0.5f, player.whoAmI); Main.projectile[p].Calamity().forceRogue = true; //in case melee/rogue variants bug out + if (item.type == ModContent.ItemType()) + { + Main.projectile[p].ai[1] = 1f; + } if (StealthStrikeAvailable()) { int knifeCount = 15; diff --git a/Projectiles/Rogue/FinalDawnProjectile.cs b/Projectiles/Rogue/FinalDawnProjectile.cs index 6eba4bb801..36e42761d0 100644 --- a/Projectiles/Rogue/FinalDawnProjectile.cs +++ b/Projectiles/Rogue/FinalDawnProjectile.cs @@ -7,171 +7,173 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class FinalDawnProjectile : ModProjectile - { - public const float MaxChargeTime = 20f; - public override void SetStaticDefaults() + public class FinalDawnProjectile : ModProjectile + { + public const float MaxChargeTime = 20f; + public override void SetStaticDefaults() { DisplayName.SetDefault("The Final Dawn"); + Main.projFrames[projectile.type] = 2; } - public override void SetDefaults() - { - projectile.width = 16; - projectile.height = 16; - projectile.friendly = false; - projectile.Calamity().rogue = true; - projectile.penetrate = -1; - projectile.tileCollide = false; - Main.projFrames[projectile.type] = 2; - //projectile.extraUpdates = 2; - } - public override bool ShouldUpdatePosition() => false; - public override void AI() + public override void SetDefaults() { - Player player = Main.player[projectile.owner]; + projectile.width = 16; + projectile.height = 16; + projectile.friendly = false; + projectile.Calamity().rogue = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + //projectile.extraUpdates = 2; + } + public override bool ShouldUpdatePosition() => false; + public override void AI() + { + Player player = Main.player[projectile.owner]; if (player.dead || player is null) projectile.Kill(); - if (Main.myPlayer == player.whoAmI) - { - projectile.velocity = Main.MouseWorld - player.Center; - projectile.velocity.Normalize(); - } - player.direction = projectile.direction; - player.heldProj = projectile.whoAmI; - projectile.Center = player.Center; - projectile.position.Y -= 44; - projectile.position.X -= 46 * player.direction; - player.bodyFrame.Y = player.bodyFrame.Height; + if (Main.myPlayer == player.whoAmI) + { + projectile.velocity = Main.MouseWorld - player.Center; + projectile.velocity.Normalize(); + } + player.direction = projectile.direction; + player.heldProj = projectile.whoAmI; + projectile.Center = player.Center; + projectile.position.Y -= 44; + projectile.position.X -= 46 * player.direction; + player.bodyFrame.Y = player.bodyFrame.Height; - if (projectile.ai[0] < MaxChargeTime) - { - // Charging dust - Vector2 dustCenter = new Vector2(projectile.Center.X, projectile.Center.Y - 40); - int flame = Dust.NewDust(dustCenter, projectile.width, projectile.height, ModContent.DustType(), 0, 0, 100, default, 2f); - Main.dust[flame].noGravity = true; - Main.dust[flame].fadeIn = 1.5f; - Main.dust[flame].scale = 1.4f; - Vector2 offsetVector = Utils.NextVector2CircularEdge(Main.rand, 100f, 100f); - Main.dust[flame].position = dustCenter - offsetVector; - Vector2 newVelocity = dustCenter - Main.dust[flame].position; - Main.dust[flame].velocity = newVelocity * 0.1f; - } - if (projectile.ai[0] == MaxChargeTime) - { - int dustCount = 36; - for (int i = 0; i < dustCount; i++) - { - Vector2 startingPosition = projectile.Center + new Vector2(0, -40); - Vector2 offset = Vector2.UnitX * projectile.width * 0.1875f; - offset = offset.RotatedBy((i - (dustCount / 2 - 1)) * MathHelper.TwoPi / dustCount); - int dustIdx = Dust.NewDust(startingPosition + offset, 0, 0, ModContent.DustType(), offset.X * 2f, offset.Y * 2f, 100, default, 3.4f); - Main.dust[dustIdx].noGravity = true; - Main.dust[dustIdx].noLight = true; - Main.dust[dustIdx].velocity = Vector2.Normalize(offset) * 5f; - } - projectile.frame = 1; - } - projectile.ai[0]++; + if (projectile.ai[0] < MaxChargeTime) + { + // Charging dust + Vector2 dustCenter = new Vector2(projectile.Center.X, projectile.Center.Y - 40); + int flame = Dust.NewDust(dustCenter, projectile.width, projectile.height, ModContent.DustType(), 0, 0, 100, default, 2f); + Main.dust[flame].noGravity = true; + Main.dust[flame].fadeIn = 1.5f; + Main.dust[flame].scale = 1.4f; + Vector2 offsetVector = Utils.NextVector2CircularEdge(Main.rand, 100f, 100f); + Main.dust[flame].position = dustCenter - offsetVector; + Vector2 newVelocity = dustCenter - Main.dust[flame].position; + Main.dust[flame].velocity = newVelocity * 0.1f; + } + if (projectile.ai[0] == MaxChargeTime) + { + int dustCount = 36; + for (int i = 0; i < dustCount; i++) + { + Vector2 startingPosition = projectile.Center + new Vector2(0, -40); + Vector2 offset = Vector2.UnitX * projectile.width * 0.1875f; + offset = offset.RotatedBy((i - (dustCount / 2 - 1)) * MathHelper.TwoPi / dustCount); + int dustIdx = Dust.NewDust(startingPosition + offset, 0, 0, ModContent.DustType(), offset.X * 2f, offset.Y * 2f, 100, default, 3.4f); + Main.dust[dustIdx].noGravity = true; + Main.dust[dustIdx].noLight = true; + Main.dust[dustIdx].velocity = Vector2.Normalize(offset) * 5f; + } + projectile.frame = 1; + } + projectile.ai[0]++; - projectile.spriteDirection = (projectile.velocity.X > 0).ToDirectionInt(); + projectile.spriteDirection = (projectile.velocity.X > 0).ToDirectionInt(); - if (Main.myPlayer == projectile.owner) - { - if (!player.channel || player.noItems || player.CCed) - { - AttemptExecuteAttacks(player); - projectile.Kill(); - } - } - } + if (Main.myPlayer == projectile.owner) + { + if (!player.channel || player.noItems || player.CCed) + { + AttemptExecuteAttacks(player); + projectile.Kill(); + } + } + } - public void AttemptExecuteAttacks(Player player) - { - if (projectile.ai[0] >= MaxChargeTime && !player.noItems && !player.CCed) - { - // Far range attack - if (player.controlUp) - { - // Stealth Strike - if (player.Calamity().StealthStrikeAvailable()) - { - Projectile.NewProjectile(player.Center, - player.DirectionTo(Main.MouseWorld) * 38f, - ModContent.ProjectileType(), - (int)(projectile.damage * 1.5f), - projectile.knockBack, - projectile.owner); - player.Calamity().ConsumeStealthByAttacking(); - } - else - { - Projectile.NewProjectile(projectile.Center, - projectile.DirectionTo(Main.MouseWorld) * 38f, - ModContent.ProjectileType(), projectile.damage, - projectile.knockBack, projectile.owner); - player.Calamity().ConsumeStealthByAttacking(); - } - } - // Close range attack - else - { - // Stealth - if (player.Calamity().StealthStrikeAvailable()) - { - Projectile.NewProjectile(projectile.Center, - projectile.velocity, - ModContent.ProjectileType(), - (int)(projectile.damage * 1.5f), - projectile.knockBack, - projectile.owner); - player.Calamity().ConsumeStealthByAttacking(); - } - else - { + public void AttemptExecuteAttacks(Player player) + { + //projectile.ai[1] == 1f if spawned via Venerated Locket + if (projectile.ai[0] >= MaxChargeTime && !player.noItems && !player.CCed) + { + // Far range attack + if (player.controlUp) + { + // Stealth Strike + if (player.Calamity().StealthStrikeAvailable() && projectile.ai[1] != 1f) + { + Projectile.NewProjectile(player.Center, + player.DirectionTo(Main.MouseWorld) * 38f, + ModContent.ProjectileType(), + (int)(projectile.damage * 1.5f), + projectile.knockBack, + projectile.owner); + player.Calamity().ConsumeStealthByAttacking(); + } + else + { + Projectile.NewProjectile(projectile.Center, + projectile.DirectionTo(Main.MouseWorld) * 38f, + ModContent.ProjectileType(), projectile.damage, + projectile.knockBack, projectile.owner); + if (projectile.ai[1] != 1f) + player.Calamity().ConsumeStealthByAttacking(); + } + } + // Close range attack + else + { + // Stealth + if (player.Calamity().StealthStrikeAvailable() && projectile.ai[1] != 1f) + { + Projectile.NewProjectile(projectile.Center, + projectile.velocity, + ModContent.ProjectileType(), + (int)(projectile.damage * 1.5f), + projectile.knockBack, + projectile.owner); + player.Calamity().ConsumeStealthByAttacking(); + } + else + { //This one doesn't consume stealth since it replenishes stealth on hits - Projectile.NewProjectile(projectile.Center, - projectile.velocity, - ModContent.ProjectileType(), - projectile.damage, - projectile.knockBack, - projectile.owner); - } - } - } - } + Projectile.NewProjectile(projectile.Center, + projectile.velocity, + ModContent.ProjectileType(), + projectile.damage, + projectile.knockBack, + projectile.owner); + } + } + } + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D scytheTexture = Main.projectileTexture[projectile.type]; - Texture2D glowmask = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/FinalDawnProjectile_Glow"); - int height = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; - int yStart = height * projectile.frame; - Main.spriteBatch.Draw(scytheTexture, - projectile.Center - Main.screenPosition + Vector2.UnitY * projectile.gfxOffY, - new Rectangle?(new Rectangle(0, yStart, scytheTexture.Width, height)), - projectile.GetAlpha(lightColor), - projectile.rotation, - new Vector2(scytheTexture.Width / 2f, height / 2f), - projectile.scale, - projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, - 0f); - Main.spriteBatch.Draw(glowmask, - projectile.Center - Main.screenPosition + Vector2.UnitY * projectile.gfxOffY, - new Rectangle?(new Rectangle(0, yStart, scytheTexture.Width, height)), - projectile.GetAlpha(Color.White), - projectile.rotation, - new Vector2(scytheTexture.Width / 2f, height / 2f), - projectile.scale, - projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, - 0f); - return false; - } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D scytheTexture = Main.projectileTexture[projectile.type]; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/FinalDawnProjectile_Glow"); + int height = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + int yStart = height * projectile.frame; + Main.spriteBatch.Draw(scytheTexture, + projectile.Center - Main.screenPosition + Vector2.UnitY * projectile.gfxOffY, + new Rectangle?(new Rectangle(0, yStart, scytheTexture.Width, height)), + projectile.GetAlpha(lightColor), + projectile.rotation, + new Vector2(scytheTexture.Width / 2f, height / 2f), + projectile.scale, + projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, + 0f); + Main.spriteBatch.Draw(glowmask, + projectile.Center - Main.screenPosition + Vector2.UnitY * projectile.gfxOffY, + new Rectangle?(new Rectangle(0, yStart, scytheTexture.Width, height)), + projectile.GetAlpha(Color.White), + projectile.rotation, + new Vector2(scytheTexture.Width / 2f, height / 2f), + projectile.scale, + projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, + 0f); + return false; + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 600); - } - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 600); + } + } } \ No newline at end of file From 8f14c16d2be1d5a7ecab98494cc0afa3c4959d21 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 14:17:34 -0400 Subject: [PATCH 086/160] increased ultima laser range --- Projectiles/Ranged/UltimaRay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Ranged/UltimaRay.cs b/Projectiles/Ranged/UltimaRay.cs index cb5707c52f..5f2b6287d4 100644 --- a/Projectiles/Ranged/UltimaRay.cs +++ b/Projectiles/Ranged/UltimaRay.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Ranged set => projectile.ai[1] = value; } public override float MaxScale => 0.7f; - public override float MaxLaserLength => 1599.999999f; + public override float MaxLaserLength => 2400f; public override float Lifetime => 50f; public override Color LaserOverlayColor => Main.hslToRgb((float)Math.Sin(Main.GlobalTime * 2.3f + HueOffset) * 0.5f + 0.5f, 1f, 0.775f) * Utils.InverseLerp(Lifetime, 0f, Time, true); public override Color LightCastColor => LaserOverlayColor; From 8483ada05319924e2ebdcff9f01c0a0aa5214c5d Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 15:04:11 -0400 Subject: [PATCH 087/160] plasma grenade no longer should have any i frame issues --- Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs b/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs index e2a3bdc19b..5c4f2eeaee 100644 --- a/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs +++ b/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs @@ -74,6 +74,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal else { CalamityGlobalProjectile.ExpandHitboxBy(projectile, 240); + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; projectile.Damage(); if (!Main.dedServ) { From 224a20a81e3fd7e21d29a35e2ab8f4f4d954358b Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 15:37:21 -0400 Subject: [PATCH 088/160] Moved TFO to post-PBG --- Items/Weapons/Melee/TrueForbiddenOathblade.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Items/Weapons/Melee/TrueForbiddenOathblade.cs b/Items/Weapons/Melee/TrueForbiddenOathblade.cs index 47a0e58a32..301bc8de9b 100644 --- a/Items/Weapons/Melee/TrueForbiddenOathblade.cs +++ b/Items/Weapons/Melee/TrueForbiddenOathblade.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Melee for (int i = -index; i <= index; i += index) { Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(i)); - Projectile.NewProjectile(position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage / 2, knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position, perturbedSpeed, type, damage / 2, knockBack, player.whoAmI, 0f, 0f); } return false; } @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Melee ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 3); - recipe.AddIngredient(ModContent.ItemType(), 3); + recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddIngredient(ItemID.BrokenHeroSword); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); @@ -81,9 +81,8 @@ namespace CalamityMod.Items.Weapons.Melee float num52 = 2f; Vector2 value3 = (target.rotation - MathHelper.PiOver2).ToRotationVector2(); Vector2 value4 = value3 * target.velocity.Length(); - Main.PlaySound(SoundID.Item14, target.position); - int num3; - for (int num53 = 0; num53 < 40; num53 = num3 + 1) + Main.PlaySound(SoundID.Item14, target.Center); + for (int num53 = 0; num53 < 40; num53++) { int num54 = Dust.NewDust(target.position, target.width, target.height, 173, 0f, 0f, 200, default, num50); Dust dust = Main.dust[num54]; @@ -100,9 +99,8 @@ namespace CalamityMod.Items.Weapons.Melee dust.fadeIn = 1f; dust.color = Color.Crimson * 0.5f; dust.velocity += value4 * Main.rand.NextFloat(); - num3 = num53; } - for (int num55 = 0; num55 < 20; num55 = num3 + 1) + for (int num55 = 0; num55 < 20; num55++) { int num56 = Dust.NewDust(target.position, target.width, target.height, 173, 0f, 0f, 0, default, num52); Dust dust = Main.dust[num56]; @@ -111,7 +109,6 @@ namespace CalamityMod.Items.Weapons.Melee dust.velocity.Y -= 1.5f; dust.velocity *= 0.5f; dust.velocity += value4 * (0.6f + 0.6f * Main.rand.NextFloat()); - num3 = num55; } } } From 2c95e8d7a8da8926816507a0b9da7a40402bbd06 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 16:40:22 -0400 Subject: [PATCH 089/160] fixed midnight sun beacon doing classless damage --- Projectiles/Summon/MidnightSunBeam.cs | 2 ++ Projectiles/Summon/MidnightSunSkyBeam.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Projectiles/Summon/MidnightSunBeam.cs b/Projectiles/Summon/MidnightSunBeam.cs index 9bbc978cb7..987dbf137b 100644 --- a/Projectiles/Summon/MidnightSunBeam.cs +++ b/Projectiles/Summon/MidnightSunBeam.cs @@ -30,6 +30,8 @@ namespace CalamityMod.Projectiles.Summon projectile.alpha = 255; projectile.penetrate = -1; projectile.tileCollide = false; + projectile.minion = true; + projectile.minionSlots = 0f; projectile.timeLeft = TrueTimeLeft; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 6; diff --git a/Projectiles/Summon/MidnightSunSkyBeam.cs b/Projectiles/Summon/MidnightSunSkyBeam.cs index 6c3d5b5132..c8f86e8e5a 100644 --- a/Projectiles/Summon/MidnightSunSkyBeam.cs +++ b/Projectiles/Summon/MidnightSunSkyBeam.cs @@ -30,6 +30,8 @@ namespace CalamityMod.Projectiles.Summon projectile.alpha = 255; projectile.penetrate = -1; projectile.tileCollide = false; + projectile.minion = true; + projectile.minionSlots = 0f; projectile.timeLeft = TrueTimeLeft; projectile.usesIDStaticNPCImmunity = true; projectile.idStaticNPCHitCooldown = 30; From cf34e8bb44f9a980487bf0e5f3a6fef19e72a9fb Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 17:24:59 -0400 Subject: [PATCH 090/160] added a hardmode clam downed bool --- Items/Fishing/SunkenSeaCatches/SunkenCrate.cs | 2 +- NPCs/SunkenSea/GiantClam.cs | 1 + World/CalamityWorld.cs | 11 ++++++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs b/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs index ca9397f4e0..e9125f2355 100644 --- a/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs +++ b/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches } // Weapons - DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedCLAM && Main.hardMode, 0.2f, + DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedCLAMHardmode, 0.2f, ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index c2d3aa4716..06e046783c 100644 --- a/NPCs/SunkenSea/GiantClam.cs +++ b/NPCs/SunkenSea/GiantClam.cs @@ -427,6 +427,7 @@ namespace CalamityMod.NPCs.SunkenSea // Mark Giant Clam as dead CalamityWorld.downedCLAM = true; + CalamityWorld.downedCLAMHardmode = Main.hardMode; CalamityMod.UpdateServerBoolean(); } } diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index c3d1f6af6b..e5475fa30b 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -174,6 +174,7 @@ namespace CalamityMod.World public static bool downedSCal = false; public static bool downedGSS = false; public static bool downedCLAM = false; + public static bool downedCLAMHardMode = false; public static bool downedBetsy = false; //Betsy public static bool downedEoCAcidRain = false; @@ -242,6 +243,7 @@ namespace CalamityMod.World buffedEclipse = false; downedSCal = false; downedCLAM = false; + downedCLAMHardMode = false; downedBumble = false; downedCrabulon = false; downedBetsy = false; @@ -357,6 +359,8 @@ namespace CalamityMod.World downed.Add("bossRushActive"); if (downedCLAM) downed.Add("clam"); + if (downedCLAMHardMode) + downed.Add("clamHardmode"); if (dragonScalesBought) downed.Add("scales"); if (rainingAcid) @@ -447,6 +451,7 @@ namespace CalamityMod.World abyssSide = downed.Contains("abyssSide"); bossRushActive = downed.Contains("bossRushActive"); downedCLAM = downed.Contains("clam"); + downedCLAMHardMode = downed.Contains("clamHardmode"); dragonScalesBought = downed.Contains("scales"); rainingAcid = downed.Contains("acidRain"); spawnedBandit = downed.Contains("bandit"); @@ -553,7 +558,7 @@ namespace CalamityMod.World forcedDownpourWithTear = flags8[1]; downedSecondSentinels = flags8[2]; foundHomePermafrost = flags8[3]; - _ = flags8[4]; + downedCLAMHardMode = flags8[4]; _ = flags8[5]; _ = flags8[6]; _ = flags8[7]; @@ -644,7 +649,7 @@ namespace CalamityMod.World flags8[1] = forcedDownpourWithTear; flags8[2] = downedSecondSentinels; flags8[3] = foundHomePermafrost; - flags8[4] = false; + flags8[4] = downedCLAMHardMode; flags8[5] = false; flags8[6] = false; flags8[7] = false; @@ -743,7 +748,7 @@ namespace CalamityMod.World forcedDownpourWithTear = flags8[1]; downedSecondSentinels = flags8[2]; foundHomePermafrost = flags8[3]; - _ = flags8[4]; + downedCLAMHardMode = flags8[4]; _ = flags8[5]; _ = flags8[6]; _ = flags8[7]; From 8c20ed394f68dd5eba8aaafc15fc755acfd8b557 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 20:23:58 -0400 Subject: [PATCH 091/160] Undid lastProjectileHit change cuz it broke --- Projectiles/Boss/BrimstoneBarrage.cs | 5 +++++ Projectiles/Boss/BrimstoneFireblast.cs | 5 +++++ Projectiles/Boss/BrimstoneGigaBlast.cs | 5 +++++ Projectiles/Boss/BrimstoneHellblast.cs | 5 +++++ Projectiles/Boss/BrimstoneHellblast2.cs | 5 +++++ Projectiles/Boss/BrimstoneMonster.cs | 5 +++++ Projectiles/Boss/BrimstoneRay.cs | 5 +++++ Projectiles/Boss/BrimstoneTargetRay.cs | 5 +++++ Projectiles/Boss/BrimstoneWave.cs | 5 +++++ Projectiles/Boss/DarkEnergyBall.cs | 5 +++++ Projectiles/Boss/DarkOrb.cs | 5 +++++ Projectiles/Boss/DoGBeam.cs | 5 +++++ Projectiles/Boss/DoGBeamPortal.cs | 5 +++++ Projectiles/Boss/DoGDeath.cs | 5 +++++ Projectiles/Boss/DoGFire.cs | 5 +++++ Projectiles/Boss/DoGNebulaShot.cs | 5 +++++ Projectiles/Boss/EssenceDust.cs | 5 +++++ Projectiles/Boss/FlareBomb.cs | 5 +++++ Projectiles/Boss/FlareDust.cs | 5 +++++ Projectiles/Boss/FlareDust2.cs | 5 +++++ Projectiles/Boss/Flarenado.cs | 5 +++++ Projectiles/Boss/HolyBlast.cs | 5 +++++ Projectiles/Boss/HolyBomb.cs | 5 +++++ Projectiles/Boss/HolyFire.cs | 5 +++++ Projectiles/Boss/HolyFire2.cs | 5 +++++ Projectiles/Boss/HolyFlare.cs | 5 +++++ Projectiles/Boss/HolySpear.cs | 5 +++++ Projectiles/Boss/Infernado.cs | 5 +++++ Projectiles/Boss/Infernado2.cs | 5 +++++ Projectiles/Boss/InfernadoRevenge.cs | 5 +++++ Projectiles/Boss/MoltenBlast.cs | 5 +++++ Projectiles/Boss/MoltenBlob.cs | 5 +++++ Projectiles/Boss/OldDukeGore.cs | 5 +++++ Projectiles/Boss/OldDukeVortex.cs | 5 +++++ Projectiles/Boss/PhantomBlast.cs | 5 +++++ Projectiles/Boss/PhantomBlast2.cs | 5 +++++ Projectiles/Boss/PhantomGhostShot.cs | 5 +++++ Projectiles/Boss/PhantomHookShot.cs | 5 +++++ Projectiles/Boss/PhantomMine.cs | 5 +++++ Projectiles/Boss/PhantomShot.cs | 5 +++++ Projectiles/Boss/PhantomShot2.cs | 5 +++++ Projectiles/Boss/ProfanedSpear.cs | 5 +++++ Projectiles/Boss/ProvidenceCrystal.cs | 5 +++++ Projectiles/Boss/ProvidenceCrystalShard.cs | 5 +++++ Projectiles/Boss/ProvidenceHolyRay.cs | 5 +++++ Projectiles/Boss/RedLightning.cs | 5 +++++ Projectiles/Boss/RedLightningFeather.cs | 5 +++++ Projectiles/Boss/SignusScythe.cs | 5 +++++ Projectiles/Boss/SkyFlare.cs | 5 +++++ Projectiles/Boss/SkyFlareRevenge.cs | 5 +++++ Projectiles/Boss/YharonFireball.cs | 5 +++++ Projectiles/Boss/YharonFireball2.cs | 5 +++++ Projectiles/CalamityGlobalProjectile.cs | 7 +------ 53 files changed, 261 insertions(+), 6 deletions(-) diff --git a/Projectiles/Boss/BrimstoneBarrage.cs b/Projectiles/Boss/BrimstoneBarrage.cs index ef6fc357dc..8bbb9d2785 100644 --- a/Projectiles/Boss/BrimstoneBarrage.cs +++ b/Projectiles/Boss/BrimstoneBarrage.cs @@ -70,5 +70,10 @@ namespace CalamityMod.Projectiles.Boss CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); return false; } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/BrimstoneFireblast.cs b/Projectiles/Boss/BrimstoneFireblast.cs index cc378b32d5..bf53bdbcdb 100644 --- a/Projectiles/Boss/BrimstoneFireblast.cs +++ b/Projectiles/Boss/BrimstoneFireblast.cs @@ -125,5 +125,10 @@ namespace CalamityMod.Projectiles.Boss Main.dust[redFire].noGravity = true; } } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/BrimstoneGigaBlast.cs b/Projectiles/Boss/BrimstoneGigaBlast.cs index 73d03e5ef9..4134292304 100644 --- a/Projectiles/Boss/BrimstoneGigaBlast.cs +++ b/Projectiles/Boss/BrimstoneGigaBlast.cs @@ -136,5 +136,10 @@ namespace CalamityMod.Projectiles.Boss Main.dust[redFire].noGravity = true; } } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/BrimstoneHellblast.cs b/Projectiles/Boss/BrimstoneHellblast.cs index 0200d16f85..709c1db06c 100644 --- a/Projectiles/Boss/BrimstoneHellblast.cs +++ b/Projectiles/Boss/BrimstoneHellblast.cs @@ -86,5 +86,10 @@ namespace CalamityMod.Projectiles.Boss Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f); } } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/BrimstoneHellblast2.cs b/Projectiles/Boss/BrimstoneHellblast2.cs index c410cefc81..be51d96d10 100644 --- a/Projectiles/Boss/BrimstoneHellblast2.cs +++ b/Projectiles/Boss/BrimstoneHellblast2.cs @@ -79,5 +79,10 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(ModContent.BuffType(), 180); target.AddBuff(ModContent.BuffType(), 120, true); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/BrimstoneMonster.cs b/Projectiles/Boss/BrimstoneMonster.cs index d7d7864a75..0bd500e3be 100644 --- a/Projectiles/Boss/BrimstoneMonster.cs +++ b/Projectiles/Boss/BrimstoneMonster.cs @@ -190,5 +190,10 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(ModContent.BuffType(), 900); target.AddBuff(ModContent.BuffType(), 300, true); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/BrimstoneRay.cs b/Projectiles/Boss/BrimstoneRay.cs index 1c30540c42..c16c04b578 100644 --- a/Projectiles/Boss/BrimstoneRay.cs +++ b/Projectiles/Boss/BrimstoneRay.cs @@ -194,5 +194,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 300); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/BrimstoneTargetRay.cs b/Projectiles/Boss/BrimstoneTargetRay.cs index d478512f1a..4b3c4c25c1 100644 --- a/Projectiles/Boss/BrimstoneTargetRay.cs +++ b/Projectiles/Boss/BrimstoneTargetRay.cs @@ -175,5 +175,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 300); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/BrimstoneWave.cs b/Projectiles/Boss/BrimstoneWave.cs index 91b1021e2e..a03037bcec 100644 --- a/Projectiles/Boss/BrimstoneWave.cs +++ b/Projectiles/Boss/BrimstoneWave.cs @@ -88,5 +88,10 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(ModContent.BuffType(), 180); target.AddBuff(ModContent.BuffType(), 120, true); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/DarkEnergyBall.cs b/Projectiles/Boss/DarkEnergyBall.cs index 153e21122e..7892710b88 100644 --- a/Projectiles/Boss/DarkEnergyBall.cs +++ b/Projectiles/Boss/DarkEnergyBall.cs @@ -92,5 +92,10 @@ namespace CalamityMod.Projectiles.Boss Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 90, 0f, 0f); } } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/DarkOrb.cs b/Projectiles/Boss/DarkOrb.cs index 3739197acb..67272b90c9 100644 --- a/Projectiles/Boss/DarkOrb.cs +++ b/Projectiles/Boss/DarkOrb.cs @@ -559,5 +559,10 @@ namespace CalamityMod.Projectiles.Boss CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); return false; } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/DoGBeam.cs b/Projectiles/Boss/DoGBeam.cs index 817348e1c1..2a4bac8ce4 100644 --- a/Projectiles/Boss/DoGBeam.cs +++ b/Projectiles/Boss/DoGBeam.cs @@ -81,5 +81,10 @@ namespace CalamityMod.Projectiles.Boss } return new Color(255, 255, 255, 100); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/DoGBeamPortal.cs b/Projectiles/Boss/DoGBeamPortal.cs index d7bcbdd076..89e6fa7364 100644 --- a/Projectiles/Boss/DoGBeamPortal.cs +++ b/Projectiles/Boss/DoGBeamPortal.cs @@ -144,5 +144,10 @@ namespace CalamityMod.Projectiles.Boss } return new Color(255, 255, 255, 100); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/DoGDeath.cs b/Projectiles/Boss/DoGDeath.cs index 60b8178591..23dbe65792 100644 --- a/Projectiles/Boss/DoGDeath.cs +++ b/Projectiles/Boss/DoGDeath.cs @@ -97,6 +97,11 @@ namespace CalamityMod.Projectiles.Boss return new Color(255, 255, 255, projectile.alpha); } + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { if (TelegraphDelay >= TelegraphTotalTime) diff --git a/Projectiles/Boss/DoGFire.cs b/Projectiles/Boss/DoGFire.cs index f69323b21a..f93343d7cc 100644 --- a/Projectiles/Boss/DoGFire.cs +++ b/Projectiles/Boss/DoGFire.cs @@ -124,5 +124,10 @@ namespace CalamityMod.Projectiles.Boss } projectile.Damage(); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/DoGNebulaShot.cs b/Projectiles/Boss/DoGNebulaShot.cs index c3835410db..5c1e55803b 100644 --- a/Projectiles/Boss/DoGNebulaShot.cs +++ b/Projectiles/Boss/DoGNebulaShot.cs @@ -108,5 +108,10 @@ namespace CalamityMod.Projectiles.Boss } return false; } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/EssenceDust.cs b/Projectiles/Boss/EssenceDust.cs index 8a188fb82a..f82bff0d80 100644 --- a/Projectiles/Boss/EssenceDust.cs +++ b/Projectiles/Boss/EssenceDust.cs @@ -69,5 +69,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 180); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/FlareBomb.cs b/Projectiles/Boss/FlareBomb.cs index a09ab5e721..678ce0689a 100644 --- a/Projectiles/Boss/FlareBomb.cs +++ b/Projectiles/Boss/FlareBomb.cs @@ -167,5 +167,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 180); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/FlareDust.cs b/Projectiles/Boss/FlareDust.cs index 4a53058da3..8f5553b635 100644 --- a/Projectiles/Boss/FlareDust.cs +++ b/Projectiles/Boss/FlareDust.cs @@ -152,5 +152,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 180); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/FlareDust2.cs b/Projectiles/Boss/FlareDust2.cs index d484beb5fd..2443e6de78 100644 --- a/Projectiles/Boss/FlareDust2.cs +++ b/Projectiles/Boss/FlareDust2.cs @@ -160,5 +160,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 180); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/Flarenado.cs b/Projectiles/Boss/Flarenado.cs index 3992498345..1829441a28 100644 --- a/Projectiles/Boss/Flarenado.cs +++ b/Projectiles/Boss/Flarenado.cs @@ -158,5 +158,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 300); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index 9589f81796..abce937794 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -125,5 +125,10 @@ namespace CalamityMod.Projectiles.Boss int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 240); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/HolyBomb.cs b/Projectiles/Boss/HolyBomb.cs index f2c9c04a3b..d11ae92d40 100644 --- a/Projectiles/Boss/HolyBomb.cs +++ b/Projectiles/Boss/HolyBomb.cs @@ -120,5 +120,10 @@ namespace CalamityMod.Projectiles.Boss int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 180); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/HolyFire.cs b/Projectiles/Boss/HolyFire.cs index 5dfbd0bfdd..2708403b29 100644 --- a/Projectiles/Boss/HolyFire.cs +++ b/Projectiles/Boss/HolyFire.cs @@ -115,5 +115,10 @@ namespace CalamityMod.Projectiles.Boss int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 120); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/HolyFire2.cs b/Projectiles/Boss/HolyFire2.cs index a2b5af9edf..a913902aa2 100644 --- a/Projectiles/Boss/HolyFire2.cs +++ b/Projectiles/Boss/HolyFire2.cs @@ -104,5 +104,10 @@ namespace CalamityMod.Projectiles.Boss int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 120); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/HolyFlare.cs b/Projectiles/Boss/HolyFlare.cs index c9925d6b38..541ad69c39 100644 --- a/Projectiles/Boss/HolyFlare.cs +++ b/Projectiles/Boss/HolyFlare.cs @@ -112,5 +112,10 @@ namespace CalamityMod.Projectiles.Boss int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 120); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/HolySpear.cs b/Projectiles/Boss/HolySpear.cs index 7ca0372578..7eb1df79a1 100644 --- a/Projectiles/Boss/HolySpear.cs +++ b/Projectiles/Boss/HolySpear.cs @@ -172,5 +172,10 @@ namespace CalamityMod.Projectiles.Boss int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 120); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/Infernado.cs b/Projectiles/Boss/Infernado.cs index 4feff31fd2..8aeb0720a9 100644 --- a/Projectiles/Boss/Infernado.cs +++ b/Projectiles/Boss/Infernado.cs @@ -159,5 +159,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 420); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/Infernado2.cs b/Projectiles/Boss/Infernado2.cs index 387aaa9948..13b5e3550e 100644 --- a/Projectiles/Boss/Infernado2.cs +++ b/Projectiles/Boss/Infernado2.cs @@ -159,5 +159,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 420); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/InfernadoRevenge.cs b/Projectiles/Boss/InfernadoRevenge.cs index e94d493a88..ffa2e253ae 100644 --- a/Projectiles/Boss/InfernadoRevenge.cs +++ b/Projectiles/Boss/InfernadoRevenge.cs @@ -147,5 +147,10 @@ namespace CalamityMod.Projectiles.Boss { target.KillMe(PlayerDeathReason.ByOther(11), 1000.0, 0, false); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index 30d3edc2e3..c22cb912a6 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -144,5 +144,10 @@ namespace CalamityMod.Projectiles.Boss int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 180); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/MoltenBlob.cs b/Projectiles/Boss/MoltenBlob.cs index 97a8403976..cbab067719 100644 --- a/Projectiles/Boss/MoltenBlob.cs +++ b/Projectiles/Boss/MoltenBlob.cs @@ -114,5 +114,10 @@ namespace CalamityMod.Projectiles.Boss int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 90); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/OldDukeGore.cs b/Projectiles/Boss/OldDukeGore.cs index 04e32c20eb..e51fb94960 100644 --- a/Projectiles/Boss/OldDukeGore.cs +++ b/Projectiles/Boss/OldDukeGore.cs @@ -92,6 +92,11 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(ModContent.BuffType(), 180); } + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Boss/OldDukeVortex.cs b/Projectiles/Boss/OldDukeVortex.cs index 8e7b4e2d82..37d32ae461 100644 --- a/Projectiles/Boss/OldDukeVortex.cs +++ b/Projectiles/Boss/OldDukeVortex.cs @@ -163,5 +163,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 600); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/PhantomBlast.cs b/Projectiles/Boss/PhantomBlast.cs index 81430ea803..4ee028bf2b 100644 --- a/Projectiles/Boss/PhantomBlast.cs +++ b/Projectiles/Boss/PhantomBlast.cs @@ -134,5 +134,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 180); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/PhantomBlast2.cs b/Projectiles/Boss/PhantomBlast2.cs index e818b4f805..c87d356339 100644 --- a/Projectiles/Boss/PhantomBlast2.cs +++ b/Projectiles/Boss/PhantomBlast2.cs @@ -134,5 +134,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 180); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/PhantomGhostShot.cs b/Projectiles/Boss/PhantomGhostShot.cs index 0c6d067ea0..bd7c433b0b 100644 --- a/Projectiles/Boss/PhantomGhostShot.cs +++ b/Projectiles/Boss/PhantomGhostShot.cs @@ -72,5 +72,10 @@ namespace CalamityMod.Projectiles.Boss { return new Color(100, 250, 250, projectile.alpha); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/PhantomHookShot.cs b/Projectiles/Boss/PhantomHookShot.cs index e1757d15db..f7354d7961 100644 --- a/Projectiles/Boss/PhantomHookShot.cs +++ b/Projectiles/Boss/PhantomHookShot.cs @@ -72,5 +72,10 @@ namespace CalamityMod.Projectiles.Boss { return new Color(100, 250, 250, projectile.alpha); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/PhantomMine.cs b/Projectiles/Boss/PhantomMine.cs index c2d4e0c8db..d7dacfd160 100644 --- a/Projectiles/Boss/PhantomMine.cs +++ b/Projectiles/Boss/PhantomMine.cs @@ -73,5 +73,10 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(ModContent.BuffType(), 180); target.AddBuff(ModContent.BuffType(), 180); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/PhantomShot.cs b/Projectiles/Boss/PhantomShot.cs index 6a4c0e068a..ad79d9e30f 100644 --- a/Projectiles/Boss/PhantomShot.cs +++ b/Projectiles/Boss/PhantomShot.cs @@ -94,5 +94,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 120); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/PhantomShot2.cs b/Projectiles/Boss/PhantomShot2.cs index 6e7f867e70..a4d8559c89 100644 --- a/Projectiles/Boss/PhantomShot2.cs +++ b/Projectiles/Boss/PhantomShot2.cs @@ -94,5 +94,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 120); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/ProfanedSpear.cs b/Projectiles/Boss/ProfanedSpear.cs index 55f71dfebf..062f25ed52 100644 --- a/Projectiles/Boss/ProfanedSpear.cs +++ b/Projectiles/Boss/ProfanedSpear.cs @@ -95,5 +95,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 120); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/ProvidenceCrystal.cs b/Projectiles/Boss/ProvidenceCrystal.cs index da933096ae..5680c48c3d 100644 --- a/Projectiles/Boss/ProvidenceCrystal.cs +++ b/Projectiles/Boss/ProvidenceCrystal.cs @@ -124,5 +124,10 @@ namespace CalamityMod.Projectiles.Boss } return false; } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/ProvidenceCrystalShard.cs b/Projectiles/Boss/ProvidenceCrystalShard.cs index f63b2ef5a0..d95955e4c7 100644 --- a/Projectiles/Boss/ProvidenceCrystalShard.cs +++ b/Projectiles/Boss/ProvidenceCrystalShard.cs @@ -199,5 +199,10 @@ namespace CalamityMod.Projectiles.Boss { return new Color(255 - projectile.alpha, 255 - projectile.alpha, 255 - projectile.alpha, 0); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/ProvidenceHolyRay.cs b/Projectiles/Boss/ProvidenceHolyRay.cs index b3594f0c89..820bdb9bcf 100644 --- a/Projectiles/Boss/ProvidenceHolyRay.cs +++ b/Projectiles/Boss/ProvidenceHolyRay.cs @@ -201,5 +201,10 @@ namespace CalamityMod.Projectiles.Boss int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 300); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/RedLightning.cs b/Projectiles/Boss/RedLightning.cs index f10c371228..93ce2b4b0f 100644 --- a/Projectiles/Boss/RedLightning.cs +++ b/Projectiles/Boss/RedLightning.cs @@ -172,6 +172,11 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(BuffID.Electrified, 120); } + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Vector2 end = projectile.position + new Vector2((float)projectile.width, (float)projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; diff --git a/Projectiles/Boss/RedLightningFeather.cs b/Projectiles/Boss/RedLightningFeather.cs index d6f0de9cce..ff79ea25e8 100644 --- a/Projectiles/Boss/RedLightningFeather.cs +++ b/Projectiles/Boss/RedLightningFeather.cs @@ -145,5 +145,10 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(BuffID.Electrified, 60); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/SignusScythe.cs b/Projectiles/Boss/SignusScythe.cs index aaf9398c33..b367ebcf9b 100644 --- a/Projectiles/Boss/SignusScythe.cs +++ b/Projectiles/Boss/SignusScythe.cs @@ -144,5 +144,10 @@ namespace CalamityMod.Projectiles.Boss Main.dust[num624].velocity *= 2f; } } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/SkyFlare.cs b/Projectiles/Boss/SkyFlare.cs index e0d9cae535..457fdc6e5f 100644 --- a/Projectiles/Boss/SkyFlare.cs +++ b/Projectiles/Boss/SkyFlare.cs @@ -121,5 +121,10 @@ namespace CalamityMod.Projectiles.Boss } } } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/SkyFlareRevenge.cs b/Projectiles/Boss/SkyFlareRevenge.cs index 4eaf5a23ab..7a65e48579 100644 --- a/Projectiles/Boss/SkyFlareRevenge.cs +++ b/Projectiles/Boss/SkyFlareRevenge.cs @@ -72,5 +72,10 @@ namespace CalamityMod.Projectiles.Boss Main.projectile[num236].netUpdate = true; } } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/YharonFireball.cs b/Projectiles/Boss/YharonFireball.cs index cdda190992..6644565178 100644 --- a/Projectiles/Boss/YharonFireball.cs +++ b/Projectiles/Boss/YharonFireball.cs @@ -117,5 +117,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 180); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/YharonFireball2.cs b/Projectiles/Boss/YharonFireball2.cs index 85ece5314e..26cb43809f 100644 --- a/Projectiles/Boss/YharonFireball2.cs +++ b/Projectiles/Boss/YharonFireball2.cs @@ -129,5 +129,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 180); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 3c71b05887..23a97c74f1 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1060,12 +1060,7 @@ namespace CalamityMod.Projectiles } #endregion - #region ModifyHit - public override void ModifyHitPlayer(Projectile projectile, Player target, ref int damage, ref bool crit) - { - target.Calamity().lastProjectileHit = projectile; - } - + #region ModifyHitNPC public override void ModifyHitNPC(Projectile projectile, NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { Player player = Main.player[projectile.owner]; From c6615af7add7e249e6b1620226960b347ff27b33 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 21:44:43 -0400 Subject: [PATCH 092/160] removed power reqs on several fishing items --- CalPlayer/CalamityPlayerFishing.cs | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/CalPlayer/CalamityPlayerFishing.cs b/CalPlayer/CalamityPlayerFishing.cs index d42c7755f3..9678efa889 100644 --- a/CalPlayer/CalamityPlayerFishing.cs +++ b/CalPlayer/CalamityPlayerFishing.cs @@ -438,14 +438,14 @@ namespace CalamityMod.CalPlayer } } - if (power >= 60 && player.FindBuffIndex(BuffID.Gills) > -1 && CalamityWorld.downedCalamitas && Main.rand.NextBool(25) && power < 160) + if (player.FindBuffIndex(BuffID.Gills) > -1 && CalamityWorld.downedCalamitas && Main.rand.NextBool(25)) { caughtType = ModContent.ItemType(); } if (junk) { - if (canSulphurFish && power < 40) + if (canSulphurFish) { caughtType = ModContent.ItemType(); } @@ -474,23 +474,17 @@ namespace CalamityMod.CalPlayer if (canSulphurFish) { - if (power >= 40) + if (Main.rand.NextBool(15)) { - if (Main.rand.NextBool(15) && power < 80) - { - caughtType = ModContent.ItemType(); - } - if (Main.rand.NextBool(25) && power < 160) - { - caughtType = ModContent.ItemType(); - } - if (power >= 110) - { - if (Main.rand.NextBool(25) && power < 240) - { - caughtType = ModContent.ItemType(); - } - } + caughtType = ModContent.ItemType(); + } + if (Main.rand.NextBool(25)) + { + caughtType = ModContent.ItemType(); + } + if (Main.rand.NextBool(25)) + { + caughtType = ModContent.ItemType(); } if (player.cratePotion && Main.rand.NextBool(5)) // 20% { From a02fb0e92b73e359fd011f8d39b30814f241aa85 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 21:49:41 -0400 Subject: [PATCH 093/160] compile fixes --- CalPlayer/CalamityPlayer.cs | 1 + Items/Fishing/SunkenSeaCatches/SunkenCrate.cs | 2 +- NPCs/SunkenSea/GiantClam.cs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 499aa0c010..8d4a916dd4 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -14,6 +14,7 @@ using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; using CalamityMod.Items.Weapons.Typeless; using CalamityMod.NPCs; diff --git a/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs b/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs index e9125f2355..f085d1a405 100644 --- a/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs +++ b/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches } // Weapons - DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedCLAMHardmode, 0.2f, + DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedCLAMHardMode, 0.2f, ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index 06e046783c..c8e45cb028 100644 --- a/NPCs/SunkenSea/GiantClam.cs +++ b/NPCs/SunkenSea/GiantClam.cs @@ -427,7 +427,7 @@ namespace CalamityMod.NPCs.SunkenSea // Mark Giant Clam as dead CalamityWorld.downedCLAM = true; - CalamityWorld.downedCLAMHardmode = Main.hardMode; + CalamityWorld.downedCLAMHardMode = Main.hardMode; CalamityMod.UpdateServerBoolean(); } } From 6b34230bdd35c79caf9431c1846506fd03abfa3e Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 22:05:00 -0400 Subject: [PATCH 094/160] added a utility for the boss spawning message --- Items/SummonItems/AncientMedallion.cs | 1 + Items/SummonItems/AstralChunk.cs | 1 + Items/SummonItems/DecapoditaSprout.cs | 1 + Items/SummonItems/EidolonTablet.cs | 1 + Items/SummonItems/ProfanedCore.cs | 1 + Items/SummonItems/ProfanedCoreUnlimited.cs | 1 + Items/SummonItems/Teratoma.cs | 1 + NPCs/CalamityGlobalNPC.cs | 17 +---------------- NPCs/Leviathan/LeviathanStart.cs | 3 ++- NPCs/Leviathan/Siren.cs | 3 ++- Utilities/CalamityUtils.cs | 19 ++++++++++++++++++- 11 files changed, 30 insertions(+), 19 deletions(-) diff --git a/Items/SummonItems/AncientMedallion.cs b/Items/SummonItems/AncientMedallion.cs index b92a0af850..d2c0f24bae 100644 --- a/Items/SummonItems/AncientMedallion.cs +++ b/Items/SummonItems/AncientMedallion.cs @@ -37,6 +37,7 @@ namespace CalamityMod.Items.SummonItems { int npc = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-100, 101)), (int)(player.position.Y - 250f), ModContent.NPCType(), 1); Main.npc[npc].timeLeft *= 20; + CalamityUtils.BossAwakenMessage(npc); } else NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); diff --git a/Items/SummonItems/AstralChunk.cs b/Items/SummonItems/AstralChunk.cs index bbcab930d0..0c77219aaa 100644 --- a/Items/SummonItems/AstralChunk.cs +++ b/Items/SummonItems/AstralChunk.cs @@ -38,6 +38,7 @@ namespace CalamityMod.Items.SummonItems { int npc = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-50, 50)), (int)(player.position.Y - 150f), ModContent.NPCType(), 1); Main.npc[npc].timeLeft *= 20; + CalamityUtils.BossAwakenMessage(npc); } else NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); diff --git a/Items/SummonItems/DecapoditaSprout.cs b/Items/SummonItems/DecapoditaSprout.cs index eef52006d3..44ae8f77dd 100644 --- a/Items/SummonItems/DecapoditaSprout.cs +++ b/Items/SummonItems/DecapoditaSprout.cs @@ -36,6 +36,7 @@ namespace CalamityMod.Items.SummonItems { int npc = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-50, 51)), (int)(player.position.Y - 50f), ModContent.NPCType(), 1); Main.npc[npc].timeLeft *= 20; + CalamityUtils.BossAwakenMessage(npc); } else NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); diff --git a/Items/SummonItems/EidolonTablet.cs b/Items/SummonItems/EidolonTablet.cs index 11a05971d9..6bf6978418 100644 --- a/Items/SummonItems/EidolonTablet.cs +++ b/Items/SummonItems/EidolonTablet.cs @@ -36,6 +36,7 @@ namespace CalamityMod.Items.SummonItems int npc = NPC.NewNPC((int)player.Center.X + 30, (int)player.Center.Y - 90, NPCID.CultistBoss, 1); Main.npc[npc].direction = Main.npc[npc].spriteDirection = Math.Sign(player.Center.X - player.Center.X - 30f); Main.npc[npc].timeLeft *= 20; + CalamityUtils.BossAwakenMessage(npc); } else NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, NPCID.CultistBoss); diff --git a/Items/SummonItems/ProfanedCore.cs b/Items/SummonItems/ProfanedCore.cs index c71c860b59..bafef3f868 100644 --- a/Items/SummonItems/ProfanedCore.cs +++ b/Items/SummonItems/ProfanedCore.cs @@ -41,6 +41,7 @@ namespace CalamityMod.Items.SummonItems { int npc = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-500, 501)), (int)(player.position.Y - 250f), ModContent.NPCType(), 1); Main.npc[npc].timeLeft *= 20; + CalamityUtils.BossAwakenMessage(npc); } else NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); diff --git a/Items/SummonItems/ProfanedCoreUnlimited.cs b/Items/SummonItems/ProfanedCoreUnlimited.cs index 0d668f0cf4..c323f9b4f6 100644 --- a/Items/SummonItems/ProfanedCoreUnlimited.cs +++ b/Items/SummonItems/ProfanedCoreUnlimited.cs @@ -42,6 +42,7 @@ namespace CalamityMod.Items.SummonItems { int npc = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-500, 501)), (int)(player.position.Y - 250f), ModContent.NPCType(), 1); Main.npc[npc].timeLeft *= 20; + CalamityUtils.BossAwakenMessage(npc); } else NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); diff --git a/Items/SummonItems/Teratoma.cs b/Items/SummonItems/Teratoma.cs index 97c0b66c08..6fc0084733 100644 --- a/Items/SummonItems/Teratoma.cs +++ b/Items/SummonItems/Teratoma.cs @@ -38,6 +38,7 @@ namespace CalamityMod.Items.SummonItems { int npc = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-100, 100)), (int)(player.position.Y - 150f), ModContent.NPCType(), 1); Main.npc[npc].timeLeft *= 20; + CalamityUtils.BossAwakenMessage(npc); } else NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index af217a1cc1..303c417e82 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -6162,22 +6162,7 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient) { int num8 = NPC.NewNPC((int)projectile.Center.X, (int)projectile.Center.Y + 100, type); - string typeName2 = Main.npc[num8].TypeName; - - if (Main.netMode == NetmodeID.SinglePlayer) - { - Main.NewText(Language.GetTextValue("Announcement.HasAwoken", typeName2), new Color(175, 75, 255)); - return; - } - - if (Main.netMode == NetmodeID.Server) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", new object[] - { - Main.npc[num8].GetTypeNetName() - }), new Color(175, 75, 255)); - return; - } + CalamityUtils.BossAwakenMessage(num8); } else { diff --git a/NPCs/Leviathan/LeviathanStart.cs b/NPCs/Leviathan/LeviathanStart.cs index 0df8a30735..1739ce90ad 100644 --- a/NPCs/Leviathan/LeviathanStart.cs +++ b/NPCs/Leviathan/LeviathanStart.cs @@ -107,7 +107,8 @@ namespace CalamityMod.NPCs.Leviathan } if (Main.netMode != NetmodeID.MultiplayerClient) { - NPC.NewNPC((int)npc.Center.X, (int)npc.position.Y + npc.height, ModContent.NPCType(), npc.whoAmI, 0f, 0f, 0f, 0f, 255); + int siren = NPC.NewNPC((int)npc.Center.X, (int)npc.position.Y + npc.height, ModContent.NPCType(), npc.whoAmI, 0f, 0f, 0f, 0f, 255); + CalamityUtils.BossAwakenMessage(siren); } } } diff --git a/NPCs/Leviathan/Siren.cs b/NPCs/Leviathan/Siren.cs index b647d1ce43..fb4d6d511c 100644 --- a/NPCs/Leviathan/Siren.cs +++ b/NPCs/Leviathan/Siren.cs @@ -156,7 +156,8 @@ namespace CalamityMod.NPCs.Leviathan else music = MusicID.Boss3; - NPC.NewNPC((int)vector.X, (int)vector.Y + 480, ModContent.NPCType(), 1); + int levi = NPC.NewNPC((int)vector.X, (int)vector.Y + 480, ModContent.NPCType(), 1); + CalamityUtils.BossAwakenMessage(levi); spawnedLevi = true; } } diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index f01515cad5..148fe7a799 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -539,7 +539,24 @@ namespace CalamityMod } return false; } - #endregion + + /// + /// Shortcut for the generic boss summon message. + /// + /// The whoAmI index of the summoned npc. + public static void BossAwakenMessage(int npcIndex) + { + string typeName = Main.npc[npcIndex].TypeName; + if (Main.netMode == NetmodeID.SinglePlayer) + { + Main.NewText(Language.GetTextValue("Announcement.HasAwoken", typeName), new Color(175, 75, 255)); + } + else if (Main.netMode == NetmodeID.Server) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", new object[]{Main.npc[npcIndex].GetTypeNetName()}), new Color(175, 75, 255)); + } + } + #endregion #region Item Utilities public static bool IsPostML(this CalamityRarity calrare) From ccea5c116665835b96ad3f2e1b5719bbac61b888 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 23:42:23 -0400 Subject: [PATCH 095/160] made a projectile rain utility --- CalPlayer/CalamityPlayer.cs | 126 ++---------------- CalPlayer/CalamityPlayerMiscEffects.cs | 16 +-- Items/Accessories/AmalgamatedBrain.cs | 21 +-- Items/Accessories/CalamityRing.cs | 13 +- Items/Accessories/RottenBrain.cs | 21 +-- Items/Accessories/TheAmalgam.cs | 20 +-- Items/Accessories/VoidofExtinction.cs | 16 +-- Items/Armor/PlagueReaperMask.cs | 18 +-- Projectiles/Magic/AuroraAustralis.cs | 171 ++++++++++++------------- Projectiles/Rogue/EclipsesFallMain.cs | 14 +- Projectiles/Rogue/EclipsesStealth.cs | 12 +- Utilities/CalamityUtils.cs | 64 +++++++++ 12 files changed, 172 insertions(+), 340 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 8d4a916dd4..4868a73cbb 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -5283,25 +5283,13 @@ namespace CalamityMod.CalPlayer astralStarRainCooldown = 60; for (int n = 0; n < 3; n++) { - float x = target.position.X + (float)Main.rand.Next(-400, 400); - float y = target.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num13 = target.position.X + (float)(target.width / 2) - vector.X; - float num14 = target.position.Y + (float)(target.height / 2) - vector.Y; - num13 += (float)Main.rand.Next(-100, 101); - float speed = 25f; int projectileType = Utils.SelectRandom(Main.rand, new int[] { ModContent.ProjectileType(), ProjectileID.HallowStar, ModContent.ProjectileType() }); - float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); - num16 = speed / num16; - num13 *= num16; - num14 *= num16; - int num17 = Projectile.NewProjectile(x, y, num13, num14, projectileType, 120, 5f, player.whoAmI, 0f, 0f); - Main.projectile[num17].Calamity().forceTypeless = true; + CalamityUtils.ProjectileRain(target.Center, 400f, 100f, 500f, 800f, 25f, projectileType, (int)(120 * player.AverageDamage()), 5f, player.whoAmI, 6); } } if (bloodflareMelee && item.melee) @@ -5720,25 +5708,13 @@ namespace CalamityMod.CalPlayer astralStarRainCooldown = 60; for (int n = 0; n < 3; n++) { - float x = target.position.X + (float)Main.rand.Next(-400, 400); - float y = target.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num13 = target.position.X + (float)(target.width / 2) - vector.X; - float num14 = target.position.Y + (float)(target.height / 2) - vector.Y; - num13 += (float)Main.rand.Next(-100, 101); - float speed = 25f; int projectileType = Utils.SelectRandom(Main.rand, new int[] { ModContent.ProjectileType(), ProjectileID.HallowStar, ModContent.ProjectileType() }); - float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); - num16 = speed / num16; - num13 *= num16; - num14 *= num16; - int num17 = Projectile.NewProjectile(x, y, num13, num14, projectileType, 120, 5f, player.whoAmI, 0f, 0f); - Main.projectile[num17].Calamity().forceTypeless = true; + CalamityUtils.ProjectileRain(target.Center, 400f, 100f, 500f, 800f, 25f, projectileType, (int)(120 * player.AverageDamage()), 5f, player.whoAmI, 6); } } if (tarraRanged && crit && proj.ranged) @@ -7746,18 +7722,7 @@ namespace CalamityMod.CalPlayer { for (int n = 0; n < 4; n++) { - float x = player.position.X + (float)Main.rand.Next(-400, 400); - float y = player.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num13 = player.position.X + (float)(player.width / 2) - vector.X; - float num14 = player.position.Y + (float)(player.height / 2) - vector.Y; - num13 += (float)Main.rand.Next(-100, 101); - int num15 = 20; - float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); - num16 = (float)num15 / num16; - num13 *= num16; - num14 *= num16; - int num17 = Projectile.NewProjectile(x, y, num13, num14, ModContent.ProjectileType(), (int)(20 * player.AverageDamage()), 1f, player.whoAmI, 0f, 0f); + CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 20f, ModContent.ProjectileType(), (int)(20 * player.AverageDamage()), 1f, player.whoAmI); } } } @@ -7771,39 +7736,14 @@ namespace CalamityMod.CalPlayer int starAmt = aBulwarkRare ? 12 : 5; for (int n = 0; n < starAmt; n++) { - float x = player.position.X + (float)Main.rand.Next(-400, 400); - float y = player.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num13 = player.position.X + (float)(player.width / 2) - vector.X; - float num14 = player.position.Y + (float)(player.height / 2) - vector.Y; - num13 += (float)Main.rand.Next(-100, 101); - int num15 = 29; - float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); - num16 = (float)num15 / num16; - num13 *= num16; - num14 *= num16; - int num17 = Projectile.NewProjectile(x, y, num13, num14, ModContent.ProjectileType(), (int)(320 * player.AverageDamage()), 5f, player.whoAmI, 0f, 0f); + CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 29f, ModContent.ProjectileType(), (int)(320 * player.AverageDamage()), 5f, player.whoAmI); } } if (dAmulet) { for (int n = 0; n < 3; n++) { - float x = player.position.X + (float)Main.rand.Next(-400, 400); - float y = player.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num13 = player.position.X + (float)(player.width / 2) - vector.X; - float num14 = player.position.Y + (float)(player.height / 2) - vector.Y; - num13 += (float)Main.rand.Next(-100, 101); - int num15 = 29; - float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); - num16 = (float)num15 / num16; - num13 *= num16; - num14 *= num16; - int star = Projectile.NewProjectile(x, y, num13, num14, ProjectileID.HallowStar, (int)(130 * player.AverageDamage()), 4f, player.whoAmI, 0f, 0f); - Main.projectile[star].usesLocalNPCImmunity = true; - Main.projectile[star].localNPCHitCooldown = 5; - Main.projectile[star].Calamity().forceTypeless = true; + CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 29f, ProjectileID.HallowStar, (int)(130 * player.AverageDamage()), 4f, player.whoAmI, 6, 1, 5); } /*int num = 1; @@ -7824,21 +7764,7 @@ namespace CalamityMod.CalPlayer { for (int n = 0; n < 3; n++) { - float x = player.position.X + (float)Main.rand.Next(-400, 400); - float y = player.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num13 = player.position.X + (float)(player.width / 2) - vector.X; - float num14 = player.position.Y + (float)(player.height / 2) - vector.Y; - num13 += (float)Main.rand.Next(-100, 101); - int num15 = 29; - float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); - num16 = (float)num15 / num16; - num13 *= num16; - num14 *= num16; - int star = Projectile.NewProjectile(x, y, num13, num14, ProjectileID.HallowStar, (int)(150 * player.AverageDamage()), 4f, player.whoAmI, 0f, 0f); - Main.projectile[star].usesLocalNPCImmunity = true; - Main.projectile[star].localNPCHitCooldown = 5; - Main.projectile[star].Calamity().forceTypeless = true; + CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 29f, ProjectileID.HallowStar, (int)(150 * player.AverageDamage()), 4f, player.whoAmI, 6, 1, 5); } int num = 1; if (Main.rand.NextBool(3)) @@ -7959,11 +7885,10 @@ namespace CalamityMod.CalPlayer double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; double offsetAngle; - int i; int sDamage = (int)(27 * player.RangedDamage()); //daedalus ranged helm if (player.whoAmI == Main.myPlayer) { - for (i = 0; i < 8; i++) + for (int i = 0; i < 8; i++) { float randomSpeed = (float)Main.rand.Next(1, 7); float randomSpeed2 = (float)Main.rand.Next(1, 7); @@ -8013,10 +7938,9 @@ namespace CalamityMod.CalPlayer double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; double offsetAngle; - int i; if (player.whoAmI == Main.myPlayer) { - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)(900 * player.MeleeDamage()), 5f, player.whoAmI, 0f, 0f); @@ -8042,41 +7966,11 @@ namespace CalamityMod.CalPlayer { for (int l = 0; l < 2; l++) { - float x = player.position.X + (float)Main.rand.Next(-400, 400); - float y = player.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num15 = player.position.X + (float)(player.width / 2) - vector.X; - float num16 = player.position.Y + (float)(player.height / 2) - vector.Y; - num15 += (float)Main.rand.Next(-100, 101); - int num17 = 22; - float num18 = (float)Math.Sqrt((double)(num15 * num15 + num16 * num16)); - num18 = (float)num17 / num18; - num15 *= num18; - num16 *= num18; - int num19 = Projectile.NewProjectile(x, y, num15, num16, ProjectileID.ShadowBeamFriendly, (int)(3000 * player.AverageDamage()), 7f, player.whoAmI, 0f, 0f); - Main.projectile[num19].ai[1] = player.position.Y; - Main.projectile[num19].usesLocalNPCImmunity = true; - Main.projectile[num19].localNPCHitCooldown = 10; - Main.projectile[num19].Calamity().forceTypeless = true; + CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, ProjectileID.ShadowBeamFriendly, (int)(3000 * player.AverageDamage()), 7f, player.whoAmI, 6, 1); } for (int l = 0; l < 5; l++) { - float x = player.position.X + (float)Main.rand.Next(-400, 400); - float y = player.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num15 = player.position.X + (float)(player.width / 2) - vector.X; - float num16 = player.position.Y + (float)(player.height / 2) - vector.Y; - num15 += (float)Main.rand.Next(-100, 101); - int num17 = 22; - float num18 = (float)Math.Sqrt((double)(num15 * num15 + num16 * num16)); - num18 = (float)num17 / num18; - num15 *= num18; - num16 *= num18; - int num19 = Projectile.NewProjectile(x, y, num15, num16, ProjectileID.DemonScythe, (int)(5000 * player.AverageDamage()), 7f, player.whoAmI, 0f, 0f); - Main.projectile[num19].ai[1] = player.position.Y; - Main.projectile[num19].usesLocalNPCImmunity = true; - Main.projectile[num19].localNPCHitCooldown = 10; - Main.projectile[num19].Calamity().forceTypeless = true; + CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, ProjectileID.DemonScythe, (int)(5000 * player.AverageDamage()), 7f, player.whoAmI, 6, 1); } } } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 40ed8ea236..5bb46d9d68 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -483,9 +483,9 @@ namespace CalamityMod.CalPlayer { if (modPlayer.hydrothermalSmoke) { - if ((double)player.velocity.X > 0 || (double)player.velocity.Y > 0 || (double)player.velocity.X < -0.1 || (double)player.velocity.Y < -0.1) + if (player.velocity.X > 0f || player.velocity.Y > 0f || player.velocity.X < -0.1f || player.velocity.Y < -0.1f) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI, 0f, 0f); } } //trying to find a workaround because apparently putting the bool in ResetEffects prevents it from working @@ -632,7 +632,7 @@ namespace CalamityMod.CalPlayer Vector2 velocity = new Vector2(windVelocity * 0.2f, 3f * Main.rand.NextFloat()); if (player.miscCounter % divisor == 0 && Main.rand.NextBool(3)) - Projectile.NewProjectile(spawnPoint.X, spawnPoint.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), 20, 0f, player.whoAmI, 2f, 0f); + Projectile.NewProjectile(spawnPoint, velocity, ModContent.ProjectileType(), 20, 0f, player.whoAmI, 2f, 0f); } } else @@ -1463,7 +1463,7 @@ namespace CalamityMod.CalPlayer } if (flag && Main.myPlayer == player.whoAmI) - Projectile.NewProjectile(center.X, center.Y, 0f, 0f, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(center, Vector2.Zero, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); } } } @@ -3330,7 +3330,7 @@ namespace CalamityMod.CalPlayer value15.Normalize(); value15 *= (float)Main.rand.Next(30, 61) * 0.1f; - int spark = Projectile.NewProjectile(nPC.Center.X, nPC.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), damage / 2, 0f, player.whoAmI, 0f, 0f); + int spark = Projectile.NewProjectile(nPC.Center, value15, ModContent.ProjectileType(), damage / 2, 0f, player.whoAmI, 0f, 0f); Main.projectile[spark].Calamity().forceTypeless = true; Main.projectile[spark].localNPCHitCooldown = -2; Main.projectile[spark].penetrate = 5; @@ -3444,7 +3444,7 @@ namespace CalamityMod.CalPlayer player.AddBuff(ModContent.BuffType(), 3600, true); if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 2) - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(232f * player.MinionDamage()), 2f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(232f * player.MinionDamage()), 2f, Main.myPlayer, 0f, 0f); } } @@ -3590,7 +3590,7 @@ namespace CalamityMod.CalPlayer if (player.whoAmI == Main.myPlayer) { if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(30 * player.RogueDamage()), 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(30 * player.RogueDamage()), 0f, player.whoAmI, 0f, 0f); } } else if (player.ownedProjectileCounts[ModContent.ProjectileType()] != 0) @@ -3623,7 +3623,7 @@ namespace CalamityMod.CalPlayer } //Summon the aura if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(10 * player.AverageDamage()), 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(10 * player.AverageDamage()), 0f, player.whoAmI, 0f, 0f); } } else if (player.ownedProjectileCounts[ModContent.ProjectileType()] != 0) diff --git a/Items/Accessories/AmalgamatedBrain.cs b/Items/Accessories/AmalgamatedBrain.cs index 333cd53aaa..6b9bc6ed25 100644 --- a/Items/Accessories/AmalgamatedBrain.cs +++ b/Items/Accessories/AmalgamatedBrain.cs @@ -38,26 +38,7 @@ namespace CalamityMod.Items.Accessories { if (player.whoAmI == Main.myPlayer) { - for (int l = 0; l < 1; l++) - { - float x = player.position.X + (float)Main.rand.Next(-400, 400); - float y = player.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num15 = player.position.X + (float)(player.width / 2) - vector.X; - float num16 = player.position.Y + (float)(player.height / 2) - vector.Y; - num15 += (float)Main.rand.Next(-100, 101); - int num17 = 22; - float num18 = (float)Math.Sqrt((double)(num15 * num15 + num16 * num16)); - num18 = (float)num17 / num18; - num15 *= num18; - num16 *= num18; - int num19 = Projectile.NewProjectile(x, y, num15, num16, ModContent.ProjectileType(), (int)(60 * player.AverageDamage()), 2f, player.whoAmI, 0f, 0f); - Main.projectile[num19].ai[1] = player.position.Y; - Main.projectile[num19].tileCollide = false; - Main.projectile[num19].usesLocalNPCImmunity = true; - Main.projectile[num19].localNPCHitCooldown = 10; - Main.projectile[num19].Calamity().forceTypeless = true; - } + CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), (int)(60 * player.AverageDamage()), 2f, player.whoAmI, 6, 1); } } } diff --git a/Items/Accessories/CalamityRing.cs b/Items/Accessories/CalamityRing.cs index 168d2e83cf..e96d9921a1 100644 --- a/Items/Accessories/CalamityRing.cs +++ b/Items/Accessories/CalamityRing.cs @@ -41,18 +41,7 @@ namespace CalamityMod.Items.Accessories { if (Main.rand.NextBool(10)) { - float x = player.position.X + (float)Main.rand.Next(-400, 400); - float y = player.position.Y - (float)Main.rand.Next(500, 800); - Vector2 source = new Vector2(x, y); - Vector2 velocity = player.Center - source; - velocity.X += (float)Main.rand.Next(-100, 101); - float speed = 22f; - float targetDist = velocity.Length(); - targetDist = speed / targetDist; - velocity.X *= targetDist; - velocity.Y *= targetDist; - int fire = Projectile.NewProjectile(source, velocity, ModContent.ProjectileType(), (int)(30 * player.AverageDamage()), 5f, player.whoAmI, 0f, 0f); - Main.projectile[fire].ai[1] = player.position.Y; + CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), (int)(30 * player.AverageDamage()), 5f, player.whoAmI); } } } diff --git a/Items/Accessories/RottenBrain.cs b/Items/Accessories/RottenBrain.cs index 1f338e495d..45740206fc 100644 --- a/Items/Accessories/RottenBrain.cs +++ b/Items/Accessories/RottenBrain.cs @@ -33,26 +33,7 @@ namespace CalamityMod.Items.Accessories { if (player.whoAmI == Main.myPlayer) { - for (int l = 0; l < 1; l++) - { - float x = player.position.X + (float)Main.rand.Next(-400, 400); - float y = player.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num15 = player.position.X + (float)(player.width / 2) - vector.X; - float num16 = player.position.Y + (float)(player.height / 2) - vector.Y; - num15 += (float)Main.rand.Next(-100, 101); - int num17 = 22; - float num18 = (float)Math.Sqrt((double)(num15 * num15 + num16 * num16)); - num18 = (float)num17 / num18; - num15 *= num18; - num16 *= num18; - int num19 = Projectile.NewProjectile(x, y, num15, num16, ModContent.ProjectileType(), (int)(18 * player.AverageDamage()), 2f, player.whoAmI, 0f, 0f); - Main.projectile[num19].ai[1] = player.position.Y; - Main.projectile[num19].tileCollide = false; - Main.projectile[num19].usesLocalNPCImmunity = true; - Main.projectile[num19].localNPCHitCooldown = 10; - Main.projectile[num19].Calamity().forceTypeless = true; - } + CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), (int)(18 * player.AverageDamage()), 2f, player.whoAmI, 6, 1); } } } diff --git a/Items/Accessories/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index c039f47f0a..3291ec1cac 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -131,26 +131,8 @@ namespace CalamityMod.Items.Accessories { if (player.whoAmI == Main.myPlayer) { - float x = player.position.X + Main.rand.NextFloat(-400, 400); - float y = player.position.Y - Main.rand.NextFloat(500, 800); - Vector2 projOrigin = new Vector2(x, y); - float xDist = player.Center.X - projOrigin.X; - float yDist = player.Center.Y - projOrigin.Y; - xDist += Main.rand.NextFloat(-100, 100); - float speed = 22f; - Vector2 playerVector = new Vector2(xDist, yDist); - float playerDist = playerVector.Length(); - playerDist = speed / playerDist; - playerVector.X *= playerDist; - playerVector.Y *= playerDist; int type = Main.rand.NextBool(2) ? ProjectileType() : ProjectileType(); - int rain = Projectile.NewProjectile(projOrigin, playerVector, type, (int)(ProjectileDamage * player.AverageDamage()), 1f, player.whoAmI, 0f, 0f); - Projectile proj = Main.projectile[rain]; - proj.tileCollide = false; - proj.usesLocalNPCImmunity = true; - proj.localNPCHitCooldown = 10; - proj.usesIDStaticNPCImmunity = false; - proj.Calamity().forceTypeless = true; + CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, type, (int)(ProjectileDamage * player.AverageDamage()), 5f, player.whoAmI, 6, 1); } } } diff --git a/Items/Accessories/VoidofExtinction.cs b/Items/Accessories/VoidofExtinction.cs index 80fc806489..04e20bbf6c 100644 --- a/Items/Accessories/VoidofExtinction.cs +++ b/Items/Accessories/VoidofExtinction.cs @@ -85,21 +85,7 @@ namespace CalamityMod.Items.Accessories { if (player.whoAmI == Main.myPlayer) { - float x = player.position.X + (float)Main.rand.Next(-400, 400); - float y = player.position.Y - (float)Main.rand.Next(500, 800); - Vector2 source = new Vector2(x, y); - Vector2 velocity = player.Center - source; - velocity.X += (float)Main.rand.Next(-100, 101); - float speed = 22f; - float targetDist = velocity.Length(); - targetDist = speed / targetDist; - velocity.X *= targetDist; - velocity.Y *= targetDist; - int fire = Projectile.NewProjectile(source, velocity, ModContent.ProjectileType(), (int)(30 * player.AverageDamage()), 5f, player.whoAmI, 0f, 0f); - Main.projectile[fire].ai[1] = player.position.Y; - Main.projectile[fire].usesLocalNPCImmunity = true; - Main.projectile[fire].localNPCHitCooldown = 60; - Main.projectile[fire].usesIDStaticNPCImmunity = false; + CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), (int)(30 * player.AverageDamage()), 5f, player.whoAmI, 0, 1, 60); } } } diff --git a/Items/Armor/PlagueReaperMask.cs b/Items/Armor/PlagueReaperMask.cs index 8e665a4118..22915a3866 100644 --- a/Items/Armor/PlagueReaperMask.cs +++ b/Items/Armor/PlagueReaperMask.cs @@ -82,23 +82,7 @@ namespace CalamityMod.Items.Armor { if (Main.rand.NextBool(10)) { - for (int l = 0; l < 1; l++) - { - float x = player.position.X + (float)Main.rand.Next(-400, 400); - float y = player.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num15 = player.position.X + (float)(player.width / 2) - vector.X; - float num16 = player.position.Y + (float)(player.height / 2) - vector.Y; - num15 += (float)Main.rand.Next(-100, 101); - int num17 = 22; - float num18 = (float)Math.Sqrt((double)(num15 * num15 + num16 * num16)); - num18 = (float)num17 / num18; - num15 *= num18; - num16 *= num18; - int num19 = Projectile.NewProjectile(x, y, num15, num16, ModContent.ProjectileType(), (int)(40 * player.RangedDamage()),4f, player.whoAmI, 0f, 0f); - Main.projectile[num19].Calamity().rogue = false; - Main.projectile[num19].ai[1] = player.position.Y; - } + CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), (int)(40 * player.RangedDamage()), 4f, player.whoAmI, 6); } } } diff --git a/Projectiles/Magic/AuroraAustralis.cs b/Projectiles/Magic/AuroraAustralis.cs index cd166051f1..96cf9cf290 100644 --- a/Projectiles/Magic/AuroraAustralis.cs +++ b/Projectiles/Magic/AuroraAustralis.cs @@ -7,115 +7,104 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { public class AuroraAustralis : ModProjectile - { - private static float CosFrequency = 0.05f; - private static float CosAmplitude = 0.008f; + { + private static float CosFrequency = 0.05f; + private static float CosAmplitude = 0.008f; public int[] dustTypes = new int[] { ModContent.DustType(), ModContent.DustType() }; - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Aurora Australis"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Aurora Australis"); + } - public override void SetDefaults() - { - projectile.width = 10; - projectile.height = 10; - projectile.friendly = true; - projectile.penetrate = 1; - projectile.tileCollide = false; - projectile.timeLeft = 300; - projectile.magic = true; + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.tileCollide = false; + projectile.timeLeft = 300; + projectile.magic = true; projectile.alpha = 255; - CosFrequency = 0.15f; - CosAmplitude = 0.06f; - } + CosFrequency = 0.15f; + CosAmplitude = 0.06f; + } - public override void AI() - { - // On-spawn effects - if (projectile.ai[0] == 0) - { - // Store the X and Y of the spawn velocity so it can be used for trig calculations - projectile.localAI[0] = projectile.velocity.X; - projectile.localAI[1] = projectile.velocity.Y; - } + public override void AI() + { + // On-spawn effects + if (projectile.ai[0] == 0) + { + // Store the X and Y of the spawn velocity so it can be used for trig calculations + projectile.localAI[0] = projectile.velocity.X; + projectile.localAI[1] = projectile.velocity.Y; + } - // Doesn't collide with tiles for the first 2 frames - projectile.tileCollide = projectile.ai[0] > 2f; + // Doesn't collide with tiles for the first 2 frames + projectile.tileCollide = projectile.ai[0] > 2f; - // Apply fancy cosine movement, then slight gravity, then cap velocity. - // Original velocity is reconstructed so that it can be used in the calculation - Vector2 originalVelocity = new Vector2(projectile.localAI[0], projectile.localAI[1]); - ApplyCosVelocity(originalVelocity); - float currentSpeed = projectile.velocity.Length(); - float maxSpeed = 1.4f * originalVelocity.Length(); - if (currentSpeed > maxSpeed) - projectile.velocity *= maxSpeed / currentSpeed; + // Apply fancy cosine movement, then slight gravity, then cap velocity. + // Original velocity is reconstructed so that it can be used in the calculation + Vector2 originalVelocity = new Vector2(projectile.localAI[0], projectile.localAI[1]); + ApplyCosVelocity(originalVelocity); + float currentSpeed = projectile.velocity.Length(); + float maxSpeed = 1.4f * originalVelocity.Length(); + if (currentSpeed > maxSpeed) + projectile.velocity *= maxSpeed / currentSpeed; - // spawn dust - if (Main.rand.NextBool(5)) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, Main.rand.Next(dustTypes), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } - int rainbow = Dust.NewDust(projectile.Center, projectile.width, projectile.height, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f); - Dust dust = Main.dust[rainbow]; - dust.velocity *= 0.1f; - dust.velocity += projectile.velocity * 0.2f; - dust.position.X = projectile.Center.X + 4f + Main.rand.Next(-2, 3); - dust.position.Y = projectile.Center.Y + Main.rand.Next(-2, 3); - dust.noGravity = true; + // spawn dust + if (Main.rand.NextBool(5)) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, Main.rand.Next(dustTypes), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + int rainbow = Dust.NewDust(projectile.Center, projectile.width, projectile.height, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f); + Dust dust = Main.dust[rainbow]; + dust.velocity *= 0.1f; + dust.velocity += projectile.velocity * 0.2f; + dust.position.X = projectile.Center.X + 4f + Main.rand.Next(-2, 3); + dust.position.Y = projectile.Center.Y + Main.rand.Next(-2, 3); + dust.noGravity = true; - if (projectile.timeLeft % 10 == 0 && Main.myPlayer == projectile.owner) //spawn stars every 10 ticks - { - if (Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 30) - { + if (projectile.timeLeft % 10 == 0 && Main.myPlayer == projectile.owner) //spawn stars every 10 ticks + { + if (Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 30) + { float dmgKBMult = Main.rand.NextFloat(0.25f, 0.75f); - float xStart = projectile.Center.X + projectile.velocity.X; - float yStart = projectile.Center.Y - Main.rand.Next(500, 800); - Vector2 startPos = new Vector2(xStart, yStart); - Vector2 velocity = projectile.Center - startPos; - velocity.X += (float)Main.rand.Next(-100, 101); - float travelDist = velocity.Length(); - float starSpeed = Main.rand.NextFloat(10f, 20f); - travelDist = starSpeed / travelDist; - velocity.X *= travelDist; - velocity.Y *= travelDist; - int star = Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), (int)(projectile.damage * dmgKBMult), projectile.knockBack * dmgKBMult, projectile.owner, 0f, 0f); - Main.projectile[star].timeLeft = 120; - } - } + CalamityUtils.ProjectileRain(projectile.Center, projectile.velocity.X, 100f, 500f, 800f, Main.rand.NextFloat(10f, 20f), ModContent.ProjectileType(), (int)(projectile.damage * dmgKBMult), projectile.knockBack * dmgKBMult, projectile.owner); + } + } - projectile.ai[0]++; - } + projectile.ai[0]++; + } - private void ApplyCosVelocity(Vector2 baseVelocity) - { - float radians = -(-MathHelper.PiOver2 + CosFrequency * projectile.ai[0]); - projectile.velocity += CosAmplitude * baseVelocity.RotatedBy(radians); - } + private void ApplyCosVelocity(Vector2 baseVelocity) + { + float radians = -(-MathHelper.PiOver2 + CosFrequency * projectile.ai[0]); + projectile.velocity += CosAmplitude * baseVelocity.RotatedBy(radians); + } - public override void Kill(int timeLeft) - { - for (int i = 0; i <= 5; i++) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, Main.rand.Next(dustTypes), projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); - } - } + public override void Kill(int timeLeft) + { + for (int i = 0; i <= 5; i++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, Main.rand.Next(dustTypes), projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 180); - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 180); + } - public override void OnHitPvp(Player target, int damage, bool crit) - { - target.AddBuff(ModContent.BuffType(), 180); - } - } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 180); + } + } } diff --git a/Projectiles/Rogue/EclipsesFallMain.cs b/Projectiles/Rogue/EclipsesFallMain.cs index afa7481f67..bbe31e0aee 100644 --- a/Projectiles/Rogue/EclipsesFallMain.cs +++ b/Projectiles/Rogue/EclipsesFallMain.cs @@ -54,17 +54,9 @@ namespace CalamityMod.Projectiles.Rogue { for (int n = 0; n < Main.rand.Next(3, 6); n++) //3 to 5 spears { - float x = targetPos.X + Main.rand.Next(-400, 401); - float y = targetPos.Y - Main.rand.Next(500, 801); - Vector2 source = new Vector2(x, y); - Vector2 velocity = targetPos - source; - velocity.X += Main.rand.Next(-100, 101); - float speed = 29f; - float targetDist = velocity.Length(); - targetDist = speed / targetDist; - velocity.X *= targetDist; - velocity.Y *= targetDist; - Projectile.NewProjectile(source, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.08f * Main.rand.NextFloat(4f, 7f)), (int)(projectile.knockBack * 0.1f * Main.rand.NextFloat(7f, 10f)), projectile.owner, 0f, 0f); + float dmgMult = 0.08f * Main.rand.NextFloat(4f, 7f); + float kBMult = 0.1f * Main.rand.NextFloat(7f, 10f); + CalamityUtils.ProjectileRain(targetPos, 400f, 100f, 500f, 800f, 29f, ModContent.ProjectileType(), (int)(projectile.damage * dmgMult), projectile.knockBack * kBMult, projectile.owner); } } diff --git a/Projectiles/Rogue/EclipsesStealth.cs b/Projectiles/Rogue/EclipsesStealth.cs index b672b832dc..4dfec90536 100644 --- a/Projectiles/Rogue/EclipsesStealth.cs +++ b/Projectiles/Rogue/EclipsesStealth.cs @@ -42,17 +42,7 @@ namespace CalamityMod.Projectiles.Rogue int spearAmt = Main.rand.Next(1, 3); //1 to 2 spears for (int n = 0; n < spearAmt; n++) { - float xStart = projectile.position.X + Main.rand.Next(-400, 400); - float yStart = projectile.position.Y - Main.rand.Next(500, 800); - Vector2 startPos = new Vector2(xStart, yStart); - Vector2 velocity = projectile.Center - startPos; - velocity.X += (float)Main.rand.Next(-100, 101); - float travelDist = velocity.Length(); - float spearSpeed = 29f; - travelDist = spearSpeed / travelDist; - velocity.X *= travelDist; - velocity.Y *= travelDist; - Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), (int)(projectile.damage * dmgKBMult), projectile.knockBack * dmgKBMult, projectile.owner, 0f, 0f); + CalamityUtils.ProjectileRain(projectile.Center, 400f, 100f, 500f, 800f, 29f, ModContent.ProjectileType(), (int)(projectile.damage * dmgKBMult), projectile.knockBack * dmgKBMult, projectile.owner); } } } diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 148fe7a799..02f8c2e12f 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -29,6 +29,7 @@ using CalamityMod.NPCs.StormWeaver; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.Yharon; using CalamityMod.Projectiles; +using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Summon; using CalamityMod.Tiles; using CalamityMod.Tiles.Abyss; @@ -986,6 +987,69 @@ namespace CalamityMod } } + public static void ProjectileRain(Vector2 targetPos, float xLimit, float xVariance, float yLimitLower, float yLimitUpper, float projSpeed, int projType, int damage, float knockback, int owner, int forceType = 0, int immunitySetting = 0, int cooldown = 10) + { + float x = targetPos.X + Main.rand.NextFloat(-xLimit, xLimit + 1f); + if (projType == ModContent.ProjectileType()) + x = targetPos.X + xLimit; + float y = targetPos.Y - Main.rand.NextFloat(yLimitLower, yLimitUpper + 1f); + Vector2 source = new Vector2(x, y); + Vector2 velocity = targetPos - source; + velocity.X += Main.rand.NextFloat(-xVariance, xVariance + 1f); + float speed = projSpeed; + float targetDist = velocity.Length(); + targetDist = speed / targetDist; + velocity.X *= targetDist; + velocity.Y *= targetDist; + int index = Projectile.NewProjectile(source, velocity, projType, damage, knockback, owner, 0f, 0f); + Projectile proj = Main.projectile[index]; + CalamityGlobalProjectile modProj = proj.Calamity(); + if (projType == ModContent.ProjectileType()) + proj.timeLeft = 120; + if (projType == ModContent.ProjectileType()) + proj.tileCollide = false; + if (forceType > 0) + { + switch (forceType) + { + case 1: + modProj.forceMelee = true; + break; + case 2: + modProj.forceRanged = true; + break; + case 3: + modProj.forceMagic = true; + break; + case 4: + modProj.forceMinion = true; + break; + case 5: + modProj.forceRogue = true; + break; + case 6: + modProj.forceTypeless = true; + break; + } + } + if (immunitySetting > 0) + { + switch (forceType) + { + case 1: + proj.usesLocalNPCImmunity = true; + proj.localNPCHitCooldown = cooldown; + proj.usesIDStaticNPCImmunity = false; + break; + case 2: + proj.usesLocalNPCImmunity = false; + proj.idStaticNPCHitCooldown = cooldown; + proj.usesIDStaticNPCImmunity = true; + break; + } + } + } + public static int DamageSoftCap(double dmgInput, int cap) { int newDamage = (int)(dmgInput); From 55cd953159f3f3821b41d1259d38c574600aa84f Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 14 Jul 2020 23:42:39 -0400 Subject: [PATCH 096/160] m --- Utilities/CalamityUtils.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 02f8c2e12f..26222de1f5 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -989,13 +989,13 @@ namespace CalamityMod public static void ProjectileRain(Vector2 targetPos, float xLimit, float xVariance, float yLimitLower, float yLimitUpper, float projSpeed, int projType, int damage, float knockback, int owner, int forceType = 0, int immunitySetting = 0, int cooldown = 10) { - float x = targetPos.X + Main.rand.NextFloat(-xLimit, xLimit + 1f); + float x = targetPos.X + Main.rand.NextFloat(-xLimit, xLimit); if (projType == ModContent.ProjectileType()) x = targetPos.X + xLimit; - float y = targetPos.Y - Main.rand.NextFloat(yLimitLower, yLimitUpper + 1f); + float y = targetPos.Y - Main.rand.NextFloat(yLimitLower, yLimitUpper); Vector2 source = new Vector2(x, y); Vector2 velocity = targetPos - source; - velocity.X += Main.rand.NextFloat(-xVariance, xVariance + 1f); + velocity.X += Main.rand.NextFloat(-xVariance, xVariance); float speed = projSpeed; float targetDist = velocity.Length(); targetDist = speed / targetDist; From 058c07f6821d41b5ae3d77a15ec1dc99e9f086cd Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 15 Jul 2020 10:46:30 -0400 Subject: [PATCH 097/160] renamed lots of variables and added a standing still utility --- CalPlayer/CalamityPlayer.cs | 16 +- CalPlayer/CalamityPlayerLifeRegen.cs | 6 +- CalPlayer/CalamityPlayerMiscEffects.cs | 417 ++++++++++++------------- Items/Accessories/RampartofDeities.cs | 1 + Utilities/CalamityUtils.cs | 1 + 5 files changed, 207 insertions(+), 234 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 4868a73cbb..05290be605 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -7051,7 +7051,7 @@ namespace CalamityMod.CalPlayer #region Can Hit public override bool? CanHitNPC(Item item, NPC target) { - if (camper && ((double)Math.Abs(player.velocity.X) > 0.05 || (double)Math.Abs(player.velocity.Y) > 0.05)) + if (camper && player.StandingStill()) { return false; } @@ -7060,7 +7060,7 @@ namespace CalamityMod.CalPlayer public override bool? CanHitNPCWithProj(Projectile proj, NPC target) { - if (camper && ((double)Math.Abs(player.velocity.X) > 0.05 || (double)Math.Abs(player.velocity.Y) > 0.05)) + if (camper && player.StandingStill()) { return false; } @@ -10181,7 +10181,7 @@ namespace CalamityMod.CalPlayer } if (IBoots) { - if (((double)Math.Abs(player.velocity.X) > 0.05 || (double)Math.Abs(player.velocity.Y) > 0.05) && !player.mount.Active) + if (player.velocity.Length() > 0.05f && !player.mount.Active) { if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) { @@ -10201,7 +10201,7 @@ namespace CalamityMod.CalPlayer } if (elysianFire) { - if (((double)Math.Abs(player.velocity.X) > 0.05 || (double)Math.Abs(player.velocity.Y) > 0.05) && !player.mount.Active) + if (player.velocity.Length() > 0.05f && !player.mount.Active) { if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) { @@ -10221,7 +10221,7 @@ namespace CalamityMod.CalPlayer } if (dsSetBonus) { - if (((double)Math.Abs(player.velocity.X) > 0.05 || (double)Math.Abs(player.velocity.Y) > 0.05) && !player.mount.Active) + if (player.velocity.Length() > 0.05f && !player.mount.Active) { if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) { @@ -10241,7 +10241,7 @@ namespace CalamityMod.CalPlayer } if (auricSet) { - if (((double)Math.Abs(player.velocity.X) > 0.05 || (double)Math.Abs(player.velocity.Y) > 0.05) && !player.mount.Active) + if (player.velocity.Length() > 0.05f && !player.mount.Active) { if (drawInfo.shadow == 0f) { @@ -10471,7 +10471,7 @@ namespace CalamityMod.CalPlayer fullBright = true; } } - if (draedonsHeart && !shadeRegen && !cFreeze && (double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0) + if (draedonsHeart && !shadeRegen && !cFreeze && player.StandingStill() && player.itemAnimation == 0) { if (noRogueStealth) { @@ -10801,7 +10801,7 @@ namespace CalamityMod.CalPlayer // You get 100% stealth regen while standing still and not on a mount. Otherwise, you get your stealth regeneration while moving. // Stealth only regenerates at 1/3 speed while moving. - bool standstill = Math.Abs(player.velocity.X) < 0.1f && Math.Abs(player.velocity.Y) < 0.1f && !player.mount.Active; + bool standstill = player.StandingStill(0.1f) && !player.mount.Active; return standstill ? stealthGenStandstill : stealthGenMoving * 0.333333f * stealthAcceleration; } diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 0d28656bbb..3df4ecdc25 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -596,7 +596,7 @@ namespace CalamityMod.CalPlayer if (modPlayer.absorber) { - if (Math.Abs(player.velocity.X) < 0.05f && Math.Abs(player.velocity.Y) < 0.05f && player.itemAnimation == 0) + if (player.StandingStill() && player.itemAnimation == 0) player.lifeRegen += 2; } @@ -723,7 +723,7 @@ namespace CalamityMod.CalPlayer int lifeRegenMaxBoost = CalamityPlayer.areThereAnyDamnBosses ? 1 : 4; float lifeRegenLifeRegenTimeMaxBoost = CalamityPlayer.areThereAnyDamnBosses ? 8f : 30f; - if (Math.Abs(player.velocity.X) < 0.05f && Math.Abs(player.velocity.Y) < 0.05f && player.itemAnimation == 0) + if (player.StandingStill() && player.itemAnimation == 0) { bool boostedRegen = false; bool noSunlight = false; @@ -869,7 +869,7 @@ namespace CalamityMod.CalPlayer if (player.statLife < modPlayer.actualMaxLife) { bool noLifeRegenCap = (player.shinyStone || modPlayer.draedonsHeart || modPlayer.cFreeze || modPlayer.shadeRegen || modPlayer.photosynthesis || modPlayer.camper) && - Math.Abs(player.velocity.X) < 0.05f && Math.Abs(player.velocity.Y) < 0.05f && player.itemAnimation == 0; + player.StandingStill() && player.itemAnimation == 0; if (!noLifeRegenCap) { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 5bb46d9d68..bf338ce7dd 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -465,10 +465,10 @@ namespace CalamityMod.CalPlayer { if (CalamityWorld.rainingAcid && modPlayer.ZoneSulphur && !CalamityPlayer.areThereAnyDamnBosses && player.Center.Y < Main.worldSurface * 16f + 800f) { - int acidRainDropRate = (int)(MathHelper.Clamp(Main.invasionSize * 0.4f, 13.5f, 50) * 2.25); + int slimeRainRate = (int)(MathHelper.Clamp(Main.invasionSize * 0.4f, 13.5f, 50) * 2.25); Vector2 spawnPoint = new Vector2(player.Center.X + Main.rand.Next(-1000, 1001), player.Center.Y - Main.rand.Next(700, 801)); - if (player.miscCounter % acidRainDropRate == 0f) + if (player.miscCounter % slimeRainRate == 0f) { if (CalamityWorld.downedAquaticScourge && !CalamityWorld.downedPolterghast && Main.rand.NextBool(12)) { @@ -483,12 +483,12 @@ namespace CalamityMod.CalPlayer { if (modPlayer.hydrothermalSmoke) { - if (player.velocity.X > 0f || player.velocity.Y > 0f || player.velocity.X < -0.1f || player.velocity.Y < -0.1f) + if (Math.Abs(player.velocity.X) > 0.1f || Math.Abs(player.velocity.Y) > 0.1f) { - Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); } } - //trying to find a workaround because apparently putting the bool in ResetEffects prevents it from working + //Trying to find a workaround because apparently putting the bool in ResetEffects prevents it from working if (!player.armorEffectDrawOutlines) { modPlayer.hydrothermalSmoke = false; @@ -556,12 +556,12 @@ namespace CalamityMod.CalPlayer // Thorn and spike effects // 10 = crimson/corruption thorns, 17 = jungle thorns, 40 = dungeon spikes, 60 = temple spikes - Vector2 vector; + Vector2 tileType; if (!player.mount.Active || !player.mount.Cart) - vector = Collision.HurtTiles(player.position, player.velocity, player.width, player.height, player.fireWalk); + tileType = Collision.HurtTiles(player.position, player.velocity, player.width, player.height, player.fireWalk); else - vector = Collision.HurtTiles(player.position, player.velocity, player.width, player.height - 16, player.fireWalk); - switch ((int)vector.Y) + tileType = Collision.HurtTiles(player.position, player.velocity, player.width, player.height - 16, player.fireWalk); + switch ((int)tileType.Y) { case 10: player.AddBuff(BuffID.Weak, 300, false); @@ -610,7 +610,7 @@ namespace CalamityMod.CalPlayer // Ice shards, lightning and sharknadoes bool nearPillar = player.PillarZone(); - if (player.ZoneOverworldHeight && !CalamityPlayer.areThereAnyDamnBosses && Main.invasionType == InvasionID.None && NPC.MoonLordCountdown == 0 && !player.InSpace() && !DD2Event.Ongoing && !nearPillar) + if (player.ZoneOverworldHeight && !CalamityPlayer.areThereAnyDamnBosses && !CalamityPlayer.areThereAnyDamnEvents && NPC.MoonLordCountdown == 0 && !player.InSpace()) { Vector2 sharknadoSpawnPoint = new Vector2(player.Center.X - Main.rand.Next(300, 701), player.Center.Y - Main.rand.Next(700, 801)); if (point.X > Main.maxTilesX / 2) @@ -643,31 +643,31 @@ namespace CalamityMod.CalPlayer if (player.miscCounter == 280 && Main.rand.NextBool(randomFrequency) && player.ownedProjectileCounts[ProjectileID.Cthulunado] < 1) { Main.PlaySound(SoundID.NPCDeath19, (int)sharknadoSpawnPoint.X, (int)sharknadoSpawnPoint.Y); - int num331 = (int)(sharknadoSpawnPoint.Y / 16f); - int num332 = (int)(sharknadoSpawnPoint.X / 16f); - int num333 = 100; - if (num332 < 10) - num332 = 10; - if (num332 > Main.maxTilesX - 10) - num332 = Main.maxTilesX - 10; - if (num331 < 10) - num331 = 10; - if (num331 > Main.maxTilesY - num333 - 10) - num331 = Main.maxTilesY - num333 - 10; + int y = (int)(sharknadoSpawnPoint.Y / 16f); + int x = (int)(sharknadoSpawnPoint.X / 16f); + int yAdjust = 100; + if (x < 10) + x = 10; + if (x > Main.maxTilesX - 10) + x = Main.maxTilesX - 10; + if (y < 10) + y = 10; + if (y > Main.maxTilesY - yAdjust - 10) + y = Main.maxTilesY - yAdjust - 10; - int spawnAreaY = Main.maxTilesY - num331; - for (int num334 = num331; num334 < num331 + spawnAreaY; num334++) + int spawnAreaY = Main.maxTilesY - y; + for (int j = y; j < y + spawnAreaY; j++) { - Tile tile = Main.tile[num332, num334]; + Tile tile = Main.tile[x, j]; if ((tile.active() && Main.tileSolid[tile.type]) || tile.liquid >= 200) { - num331 = num334; + y = j; break; } } - int num336 = Projectile.NewProjectile(num332 * 16 + 8, num331 * 16 - 24, 0f, 0f, ProjectileID.Cthulunado, 50, 4f, player.whoAmI, 16f, 24f); - Main.projectile[num336].netUpdate = true; + int tornado = Projectile.NewProjectile(x * 16 + 8, y * 16 - 24, 0f, 0f, ProjectileID.Cthulunado, 50, 4f, player.whoAmI, 16f, 24f); + Main.projectile[tornado].netUpdate = true; } } @@ -680,8 +680,8 @@ namespace CalamityMod.CalPlayer { float randomVelocity = Main.rand.NextFloat() - 0.5f; Vector2 fireTo = new Vector2(spawnPoint.X + 100f * randomVelocity, spawnPoint.Y + 900f); - Vector2 ai0 = fireTo - spawnPoint; - Vector2 velocity = Vector2.Normalize(ai0) * 12f; + Vector2 direction = fireTo - spawnPoint; + Vector2 velocity = Vector2.Normalize(direction) * 12f; Projectile.NewProjectile(spawnPoint.X, spawnPoint.Y, 0f, velocity.Y, ModContent.ProjectileType(), 0, 0f, player.whoAmI, 0f, 0f); } } @@ -693,32 +693,32 @@ namespace CalamityMod.CalPlayer { if (player.miscCounter == 280 && Main.rand.NextBool(10) && player.ownedProjectileCounts[ProjectileID.Sharknado] < 1) { - Main.PlaySound(SoundID.NPCDeath19, (int)sharknadoSpawnPoint.X, (int)sharknadoSpawnPoint.Y); - int num331 = (int)(sharknadoSpawnPoint.Y / 16f); - int num332 = (int)(sharknadoSpawnPoint.X / 16f); + Main.PlaySound(SoundID.NPCDeath19, sharknadoSpawnPoint); + int y = (int)(sharknadoSpawnPoint.Y / 16f); + int x = (int)(sharknadoSpawnPoint.X / 16f); int num333 = 100; - if (num332 < 10) - num332 = 10; - if (num332 > Main.maxTilesX - 10) - num332 = Main.maxTilesX - 10; - if (num331 < 10) - num331 = 10; - if (num331 > Main.maxTilesY - num333 - 10) - num331 = Main.maxTilesY - num333 - 10; + if (x < 10) + x = 10; + if (x > Main.maxTilesX - 10) + x = Main.maxTilesX - 10; + if (y < 10) + y = 10; + if (y > Main.maxTilesY - num333 - 10) + y = Main.maxTilesY - num333 - 10; - int spawnAreaY = Main.maxTilesY - num331; - for (int num334 = num331; num334 < num331 + spawnAreaY; num334++) + int spawnAreaY = Main.maxTilesY - y; + for (int j = y; j < y + spawnAreaY; j++) { - Tile tile = Main.tile[num332, num334]; + Tile tile = Main.tile[x, j]; if ((tile.active() && Main.tileSolid[tile.type]) || tile.liquid >= 200) { - num331 = num334; + y = j; break; } } - int num336 = Projectile.NewProjectile(num332 * 16 + 8, num331 * 16 - 24, 0.01f, 0f, ProjectileID.Sharknado, 25, 4f, player.whoAmI, 16f, 15f); - Main.projectile[num336].netUpdate = true; + int tornado = Projectile.NewProjectile(x * 16 + 8, y * 16 - 24, 0.01f, 0f, ProjectileID.Sharknado, 25, 4f, player.whoAmI, 16f, 15f); + Main.projectile[tornado].netUpdate = true; } } } @@ -825,7 +825,7 @@ namespace CalamityMod.CalPlayer if (modPlayer.omegaBlueSet) { // Add tentacles - if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 6) + if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 6 && Main.myPlayer == player.whoAmI) { bool[] tentaclesPresent = new bool[6]; for (int i = 0; i < Main.maxProjectiles; i++) @@ -856,7 +856,7 @@ namespace CalamityMod.CalPlayer player.allDamage += damageUp; modPlayer.AllCritBoost(critUp); } - bool canProvideBuffs = player.Calamity().profanedCrystalBuffs || (!modPlayer.profanedCrystal && modPlayer.pArtifact) || (player.Calamity().profanedCrystal && CalamityWorld.downedSCal); + bool canProvideBuffs = modPlayer.profanedCrystalBuffs || (!modPlayer.profanedCrystal && modPlayer.pArtifact) || (modPlayer.profanedCrystal && CalamityWorld.downedSCal); bool attack = player.ownedProjectileCounts[ModContent.ProjectileType()] > 0; // Guardian bonuses if not burnt out if (!modPlayer.bOut && canProvideBuffs) @@ -870,8 +870,8 @@ namespace CalamityMod.CalPlayer if (modPlayer.healCounter <= 0) { - bool enrage = player.statLife <= (int)((double)player.statLifeMax2 * 0.5); - modPlayer.healCounter = (!enrage && player.Calamity().profanedCrystalBuffs) ? 360 : 300; + bool enrage = player.statLife <= (int)(player.statLifeMax2 * 0.5); + modPlayer.healCounter = (!enrage && modPlayer.profanedCrystalBuffs) ? 360 : 300; if (player.whoAmI == Main.myPlayer) { int healAmount = 5 + @@ -1000,19 +1000,19 @@ namespace CalamityMod.CalPlayer player.buffImmune[ModContent.BuffType()] = true; modPlayer.silvaCountdown -= modPlayer.auricSet ? 2 : 1; if (modPlayer.silvaCountdown <= 0) - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SilvaDispel"), (int)player.position.X, (int)player.position.Y); + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SilvaDispel"), player.Center); for (int j = 0; j < 2; j++) { - int num = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 2f); - Main.dust[num].position.X += (float)Main.rand.Next(-20, 21); - Main.dust[num].position.Y += (float)Main.rand.Next(-20, 21); - Main.dust[num].velocity *= 0.9f; - Main.dust[num].noGravity = true; - Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; - Main.dust[num].shader = GameShaders.Armor.GetSecondaryShader(player.cWaist, player); + int green = Dust.NewDust(player.position, player.width, player.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 2f); + Main.dust[green].position.X += (float)Main.rand.Next(-20, 21); + Main.dust[green].position.Y += (float)Main.rand.Next(-20, 21); + Main.dust[green].velocity *= 0.9f; + Main.dust[green].noGravity = true; + Main.dust[green].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; + Main.dust[green].shader = GameShaders.Armor.GetSecondaryShader(player.cWaist, player); if (Main.rand.NextBool(2)) - Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; + Main.dust[green].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; } } @@ -1029,8 +1029,8 @@ namespace CalamityMod.CalPlayer for (int j = 0; j < 2; j++) { - int num = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 2f); - Dust dust = Main.dust[num]; + int green = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 2f); + Dust dust = Main.dust[green]; dust.position.X += (float)Main.rand.Next(-20, 21); dust.position.Y += (float)Main.rand.Next(-20, 21); dust.velocity *= 0.9f; @@ -1109,8 +1109,8 @@ namespace CalamityMod.CalPlayer for (int j = 0; j < 2; j++) { - int num = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, DustID.Blood, 0f, 0f, 100, default, 2f); - Dust dust = Main.dust[num]; + int blood = Dust.NewDust(player.position, player.width, player.height, DustID.Blood, 0f, 0f, 100, default, 2f); + Dust dust = Main.dust[blood]; dust.position.X += (float)Main.rand.Next(-20, 21); dust.position.Y += (float)Main.rand.Next(-20, 21); dust.velocity *= 0.9f; @@ -1162,7 +1162,7 @@ namespace CalamityMod.CalPlayer player.thorns += 0.5f; player.endurance += 0.05f; - if (Math.Abs(player.velocity.X) < 0.05f && Math.Abs(player.velocity.Y) < 0.05f && player.itemAnimation == 0) + if (player.StandingStill() && player.itemAnimation == 0) player.manaRegenBonus += 2; } @@ -1209,7 +1209,7 @@ namespace CalamityMod.CalPlayer if (modPlayer.draedonsHeart) { player.allDamage += 0.05f; - if (Math.Abs(player.velocity.X) < 0.05f && Math.Abs(player.velocity.Y) < 0.05f && player.itemAnimation == 0) + if (player.StandingStill() && player.itemAnimation == 0) player.statDefense += 25; } @@ -1304,9 +1304,9 @@ namespace CalamityMod.CalPlayer player.velocity.X = 0f; player.velocity.Y = -0.4f; //should negate gravity - int d = Dust.NewDust(player.position, player.width, player.height, 88); - Main.dust[d].noGravity = true; - Main.dust[d].velocity *= 2f; + int ice = Dust.NewDust(player.position, player.width, player.height, 88); + Main.dust[ice].noGravity = true; + Main.dust[ice].velocity *= 2f; player.buffImmune[BuffID.Frozen] = true; player.buffImmune[BuffID.Chilled] = true; @@ -1316,20 +1316,19 @@ namespace CalamityMod.CalPlayer // Cosmic Discharge Cosmic Freeze buff, gives surrounding enemies the Glacial State debuff if (modPlayer.cFreeze) { - int num = ModContent.BuffType(); - float num2 = 200f; - int random = Main.rand.Next(5); + int buffType = ModContent.BuffType(); + float freezeDist = 200f; if (player.whoAmI == Main.myPlayer) { - if (random == 0) + if (Main.rand.NextBool(5)) { for (int l = 0; l < Main.maxNPCs; l++) { - NPC nPC = Main.npc[l]; - if (nPC.active && !nPC.friendly && nPC.damage > 0 && !nPC.dontTakeDamage && !nPC.buffImmune[num] && Vector2.Distance(player.Center, nPC.Center) <= num2) + NPC npc = Main.npc[l]; + if (npc.active && !npc.friendly && npc.damage > 0 && !npc.dontTakeDamage && !npc.buffImmune[buffType] && Vector2.Distance(player.Center, npc.Center) <= freezeDist) { - if (nPC.FindBuffIndex(num) == -1) - nPC.AddBuff(num, 120, false); + if (npc.FindBuffIndex(buffType) == -1) + npc.AddBuff(buffType, 120, false); } } } @@ -1405,25 +1404,25 @@ namespace CalamityMod.CalPlayer float knockBack = 1f; if (Main.rand.NextBool(15)) { - int num = 0; + int projCount = 0; for (int i = 0; i < Main.maxProjectiles; i++) { if (Main.projectile[i].active && Main.projectile[i].owner == player.whoAmI && Main.projectile[i].type == ModContent.ProjectileType()) - num++; + projCount++; } - if (Main.rand.Next(15) >= num && num < 6) + if (Main.rand.Next(15) >= projCount && projCount < 6) { - int num2 = 50; + int loopAmt = 50; int num3 = 24; int num4 = 90; - for (int j = 0; j < num2; j++) + for (int j = 0; j < loopAmt; j++) { - int num5 = Main.rand.Next(200 - j * 2, 400 + j * 2); + int sourceVariance = Main.rand.Next(200 - j * 2, 400 + j * 2); Vector2 center = player.Center; - center.X += (float)Main.rand.Next(-num5, num5 + 1); - center.Y += (float)Main.rand.Next(-num5, num5 + 1); + center.X += (float)Main.rand.Next(-sourceVariance, sourceVariance + 1); + center.Y += (float)Main.rand.Next(-sourceVariance, sourceVariance + 1); if (!Collision.SolidCollision(center, num3, num3) && !Collision.WetCollision(center, num3, num3)) { @@ -1432,12 +1431,12 @@ namespace CalamityMod.CalPlayer if (Collision.CanHit(new Vector2(player.Center.X, player.position.Y), 1, 1, center, 1, 1) || Collision.CanHit(new Vector2(player.Center.X, player.position.Y - 50f), 1, 1, center, 1, 1)) { - int num6 = (int)center.X / 16; - int num7 = (int)center.Y / 16; - bool flag = false; + int xSpawn = (int)center.X / 16; + int ySpawn = (int)center.Y / 16; + bool shouldSpawn = false; - if (Main.rand.NextBool(3) && Main.tile[num6, num7] != null && Main.tile[num6, num7].wall > 0) - flag = true; + if (Main.rand.NextBool(3) && Main.tile[xSpawn, ySpawn] != null && Main.tile[xSpawn, ySpawn].wall > 0) + shouldSpawn = true; else { center.X -= (float)(num4 / 2); @@ -1447,22 +1446,22 @@ namespace CalamityMod.CalPlayer { center.X += (float)(num4 / 2); center.Y += (float)(num4 / 2); - flag = true; + shouldSpawn = true; } } - if (flag) + if (shouldSpawn) { for (int k = 0; k < Main.maxProjectiles; k++) { if (Main.projectile[k].active && Main.projectile[k].owner == player.whoAmI && Main.projectile[k].type == ModContent.ProjectileType() && (center - Main.projectile[k].Center).Length() < 48f) { - flag = false; + shouldSpawn = false; break; } } - if (flag && Main.myPlayer == player.whoAmI) + if (shouldSpawn && Main.myPlayer == player.whoAmI) Projectile.NewProjectile(center, Vector2.Zero, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); } } @@ -1520,34 +1519,36 @@ namespace CalamityMod.CalPlayer if (player.spelunkerTimer >= 10) { player.spelunkerTimer = 0; - int num65 = 30; - int num66 = (int)player.Center.X / 16; - int num67 = (int)player.Center.Y / 16; + int distance = 30; + int i = (int)player.Center.X / 16; + int j = (int)player.Center.Y / 16; - for (int num68 = num66 - num65; num68 <= num66 + num65; num68++) + for (int x = i - distance; x <= i + distance; x++) { - for (int num69 = num67 - num65; num69 <= num67 + num65; num69++) + for (int y = j - distance; y <= j + distance; y++) { + Tile tile = Main.tile[x, y]; if (Main.rand.NextBool(4)) { - Vector2 vector = new Vector2((float)(num66 - num68), (float)(num67 - num69)); - if (vector.Length() < (float)num65 && num68 > 0 && num68 < Main.maxTilesX - 1 && num69 > 0 && num69 < Main.maxTilesY - 1 && Main.tile[num68, num69] != null && Main.tile[num68, num69].active()) + Vector2 vector = new Vector2((float)(i - x), (float)(j - y)); + if (vector.Length() < (float)distance && x > 0 && x < Main.maxTilesX - 1 && y > 0 && y < Main.maxTilesY - 1 && tile != null && tile.active()) { - bool flag7 = false; - if (Main.tile[num68, num69].type == 185 && Main.tile[num68, num69].frameY == 18) + bool shouldSpawnDust = false; + //These checks are for money piles. They share a sheet with other background objects so it checks for frames. + if (tile.type == TileID.SmallPiles && tile.frameY == 18) { - if (Main.tile[num68, num69].frameX >= 576 && Main.tile[num68, num69].frameX <= 882) - flag7 = true; + if (tile.frameX >= 576 && tile.frameX <= 882) + shouldSpawnDust = true; } - else if (Main.tile[num68, num69].type == 186 && Main.tile[num68, num69].frameX >= 864 && Main.tile[num68, num69].frameX <= 1170) - flag7 = true; + else if (tile.type == TileID.LargePiles && tile.frameX >= 864 && tile.frameX <= 1170) + shouldSpawnDust = true; - if (flag7 || Main.tileSpelunker[(int)Main.tile[num68, num69].type] || (Main.tileAlch[(int)Main.tile[num68, num69].type] && Main.tile[num68, num69].type != 82)) + if (shouldSpawnDust || Main.tileSpelunker[tile.type] || (Main.tileAlch[tile.type] && tile.type != TileID.ImmatureHerbs)) { - int num70 = Dust.NewDust(new Vector2((float)(num68 * 16), (float)(num69 * 16)), 16, 16, 204, 0f, 0f, 150, default, 0.3f); - Main.dust[num70].fadeIn = 0.75f; - Main.dust[num70].velocity *= 0.1f; - Main.dust[num70].noLight = true; + int sparkle = Dust.NewDust(new Vector2((x * 16f), (y * 16f)), 16, 16, 204, 0f, 0f, 150, default, 0.3f); + Main.dust[sparkle].fadeIn = 0.75f; + Main.dust[sparkle].velocity *= 0.1f; + Main.dust[sparkle].noLight = true; } } } @@ -1565,7 +1566,7 @@ namespace CalamityMod.CalPlayer } if (modPlayer.golemLore) { - if (Math.Abs(player.velocity.X) < 0.05f && Math.Abs(player.velocity.Y) < 0.05f && player.itemAnimation == 0) + if (player.StandingStill() && player.itemAnimation == 0) player.statDefense += 10; } if (modPlayer.dukeFishronLore) @@ -1617,59 +1618,52 @@ namespace CalamityMod.CalPlayer { for (int j = 0; j < Main.maxItems; j++) { - if (Main.item[j].active && Main.item[j].noGrabDelay == 0 && Main.item[j].owner == player.whoAmI) + Item item = Main.item[j]; + if (item.active && item.noGrabDelay == 0 && item.owner == player.whoAmI) { - Main.item[j].beingGrabbed = true; - if ((double)player.position.X + (double)player.width * 0.5 > (double)Main.item[j].position.X + (double)Main.item[j].width * 0.5) + item.beingGrabbed = true; + if (player.Center.X > item.Center.X) { - if (Main.item[j].velocity.X < 90f + player.velocity.X) + if (item.velocity.X < 90f + player.velocity.X) { - Item item = Main.item[j]; item.velocity.X += 9f; } - if (Main.item[j].velocity.X < 0f) + if (item.velocity.X < 0f) { - Item item = Main.item[j]; item.velocity.X += 9f * 0.75f; } } else { - if (Main.item[j].velocity.X > -90f + player.velocity.X) + if (item.velocity.X > -90f + player.velocity.X) { - Item item = Main.item[j]; item.velocity.X -= 9f; } - if (Main.item[j].velocity.X > 0f) + if (item.velocity.X > 0f) { - Item item = Main.item[j]; item.velocity.X -= 9f * 0.75f; } } - if ((double)player.position.Y + (double)player.height * 0.5 > (double)Main.item[j].position.Y + (double)Main.item[j].height * 0.5) + if (player.Center.Y > item.Center.Y) { - if (Main.item[j].velocity.Y < 90f) + if (item.velocity.Y < 90f) { - Item item = Main.item[j]; item.velocity.Y += 9f; } - if (Main.item[j].velocity.Y < 0f) + if (item.velocity.Y < 0f) { - Item item = Main.item[j]; item.velocity.Y += 9f * 0.75f; } } else { - if (Main.item[j].velocity.Y > -90f) + if (item.velocity.Y > -90f) { - Item item = Main.item[j]; item.velocity.Y -= 9f; } - if (Main.item[j].velocity.Y > 0f) + if (item.velocity.Y > 0f) { - Item item = Main.item[j]; item.velocity.Y -= 9f * 0.75f; } } @@ -1680,14 +1674,14 @@ namespace CalamityMod.CalPlayer // Spectral Veil effects if (modPlayer.spectralVeil && modPlayer.spectralVeilImmunity > 0) { - Rectangle sVeilRectangle = new Rectangle((int)((double)player.position.X + (double)player.velocity.X * 0.5 - 4.0), (int)((double)player.position.Y + (double)player.velocity.Y * 0.5 - 4.0), player.width + 8, player.height + 8); + Rectangle sVeilRectangle = new Rectangle((int)(player.position.X + player.velocity.X * 0.5f - 4f), (int)(player.position.Y + player.velocity.Y * 0.5f - 4f), player.width + 8, player.height + 8); for (int i = 0; i < Main.maxNPCs; i++) { - if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && !Main.npc[i].friendly && !Main.npc[i].townNPC && Main.npc[i].immune[player.whoAmI] <= 0 && Main.npc[i].damage > 0) + NPC npc = Main.npc[i]; + if (npc.active && !npc.dontTakeDamage && !npc.friendly && !npc.townNPC && npc.immune[player.whoAmI] <= 0 && npc.damage > 0) { - NPC nPC = Main.npc[i]; - Rectangle rect = nPC.getRect(); - if (sVeilRectangle.Intersects(rect) && (nPC.noTileCollide || player.CanHit(nPC))) + Rectangle rect = npc.getRect(); + if (sVeilRectangle.Intersects(rect) && (npc.noTileCollide || player.CanHit(npc))) { if (player.whoAmI == Main.myPlayer) { @@ -1712,7 +1706,7 @@ namespace CalamityMod.CalPlayer Main.dust[sVeilDustIndex2].noLight = false; } - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SilvaDispel"), (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y); + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SilvaDispel"), player.Center); } break; } @@ -1721,9 +1715,9 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < Main.maxProjectiles; i++) { - if (Main.projectile[i].active && !Main.projectile[i].friendly && Main.projectile[i].hostile && Main.projectile[i].damage > 0) + Projectile proj = Main.projectile[i]; + if (proj.active && !proj.friendly && proj.hostile && proj.damage > 0) { - Projectile proj = Main.projectile[i]; Rectangle rect = proj.getRect(); if (sVeilRectangle.Intersects(rect)) { @@ -1750,7 +1744,7 @@ namespace CalamityMod.CalPlayer Main.dust[sVeilDustIndex2].noLight = false; } - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SilvaDispel"), (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y); + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SilvaDispel"), player.Center); } break; } @@ -1759,7 +1753,7 @@ namespace CalamityMod.CalPlayer } // Plagued Fuel Pack effects - if (modPlayer.plaguedFuelPackDash > 0) + if (modPlayer.plaguedFuelPackDash > 0 && player.whoAmI == Main.myPlayer) { int velocityMult = modPlayer.plaguedFuelPackDash > 1 ? 25 : 5; player.velocity = new Vector2(modPlayer.plaguedFuelPackDirection, -1) * velocityMult; @@ -1784,7 +1778,7 @@ namespace CalamityMod.CalPlayer } // Blunder Booster effects - if (modPlayer.blunderBoosterDash > 0) + if (modPlayer.blunderBoosterDash > 0 && player.whoAmI == Main.myPlayer) { int velocityMult = modPlayer.blunderBoosterDash > 1 ? 35 : 5; player.velocity = new Vector2(modPlayer.blunderBoosterDirection, -1) * velocityMult; @@ -1809,7 +1803,7 @@ namespace CalamityMod.CalPlayer } // Gravistar Sabaton effects - if (modPlayer.gSabaton) + if (modPlayer.gSabaton && player.whoAmI == Main.myPlayer) { if (modPlayer.gSabatonCooldown <= 0 && !player.mount.Active) { @@ -2135,7 +2129,7 @@ namespace CalamityMod.CalPlayer modPlayer.chiBuffTimer = 0; } - if (Math.Abs(player.velocity.X) < 0.1f && Math.Abs(player.velocity.Y) < 0.1f && !player.mount.Active) + if (player.StandingStill(0.1f) && !player.mount.Active) { if (modPlayer.chiBuffTimer < 120) modPlayer.chiBuffTimer++; @@ -2157,7 +2151,7 @@ namespace CalamityMod.CalPlayer if (modPlayer.aquaticBoost > 0f) { modPlayer.aquaticBoost -= 0.0002f; // 0.015 - if ((double)modPlayer.aquaticBoost <= 0.0) + if (modPlayer.aquaticBoost <= 0f) { modPlayer.aquaticBoost = 0f; if (Main.netMode == NetmodeID.MultiplayerClient) @@ -2186,7 +2180,7 @@ namespace CalamityMod.CalPlayer if (player.itemAnimation > 0) modPlayer.modStealthTimer = 5; - if (Math.Abs(player.velocity.X) < 0.1f && Math.Abs(player.velocity.Y) < 0.1f && !player.mount.Active) + if (player.StandingStill(0.1f) && !player.mount.Active) { if (modPlayer.modStealthTimer == 0 && modPlayer.modStealth > 0f) { @@ -2201,8 +2195,8 @@ namespace CalamityMod.CalPlayer } else { - float num27 = Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y); - modPlayer.modStealth += num27 * 0.0075f; + float playerVel = Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y); + modPlayer.modStealth += playerVel * 0.0075f; if (modPlayer.modStealth > 1f) modPlayer.modStealth = 1f; if (player.mount.Active) @@ -2225,12 +2219,12 @@ namespace CalamityMod.CalPlayer if (player.itemAnimation > 0) modPlayer.modStealthTimer = 5; - if (Math.Abs(player.velocity.X) < 0.1f && Math.Abs(player.velocity.Y) < 0.1f && !player.mount.Active) + if (player.StandingStill(0.1f) && !player.mount.Active) { if (modPlayer.modStealthTimer == 0 && modPlayer.modStealth > 0f) { modPlayer.modStealth -= 0.015f; - if ((double)modPlayer.modStealth <= 0.0) + if (modPlayer.modStealth <= 0f) { modPlayer.modStealth = 0f; if (Main.netMode == NetmodeID.MultiplayerClient) @@ -2240,8 +2234,8 @@ namespace CalamityMod.CalPlayer } else { - float num27 = Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y); - modPlayer.modStealth += num27 * 0.0075f; + float playerVel = Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y); + modPlayer.modStealth += playerVel * 0.0075f; if (modPlayer.modStealth > 1f) modPlayer.modStealth = 1f; if (player.mount.Active) @@ -2264,7 +2258,7 @@ namespace CalamityMod.CalPlayer { if (modPlayer.elysianAegis) { - bool flag14 = false; + bool spawnDust = false; // Activate buff if (modPlayer.elysianGuard) @@ -2272,14 +2266,14 @@ namespace CalamityMod.CalPlayer if (player.whoAmI == Main.myPlayer) player.AddBuff(ModContent.BuffType(), 2, false); - float num29 = modPlayer.shieldInvinc; + float shieldBoostInitial = modPlayer.shieldInvinc; modPlayer.shieldInvinc -= 0.08f; if (modPlayer.shieldInvinc < 0f) modPlayer.shieldInvinc = 0f; else - flag14 = true; + spawnDust = true; - if (modPlayer.shieldInvinc == 0f && num29 != modPlayer.shieldInvinc && Main.netMode == NetmodeID.MultiplayerClient) + if (modPlayer.shieldInvinc == 0f && shieldBoostInitial != modPlayer.shieldInvinc && Main.netMode == NetmodeID.MultiplayerClient) NetMessage.SendData(MessageID.PlayerStealth, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); float damageBoost = (5f - modPlayer.shieldInvinc) * 0.03f; @@ -2299,38 +2293,38 @@ namespace CalamityMod.CalPlayer // Remove buff else { - float num30 = modPlayer.shieldInvinc; + float shieldBoostInitial = modPlayer.shieldInvinc; modPlayer.shieldInvinc += 0.08f; if (modPlayer.shieldInvinc > 5f) modPlayer.shieldInvinc = 5f; else - flag14 = true; + spawnDust = true; - if (modPlayer.shieldInvinc == 5f && num30 != modPlayer.shieldInvinc && Main.netMode == NetmodeID.MultiplayerClient) + if (modPlayer.shieldInvinc == 5f && shieldBoostInitial != modPlayer.shieldInvinc && Main.netMode == NetmodeID.MultiplayerClient) NetMessage.SendData(MessageID.PlayerStealth, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); } // Emit dust - if (flag14) + if (spawnDust) { if (Main.rand.NextBool(2)) { - Vector2 vector = Vector2.UnitY.RotatedByRandom(6.2831854820251465); + Vector2 vector = Vector2.UnitY.RotatedByRandom(Math.PI * 2D); Dust dust = Main.dust[Dust.NewDust(player.Center - vector * 30f, 0, 0, (int)CalamityDusts.ProfanedFire, 0f, 0f, 0, default, 1f)]; dust.noGravity = true; dust.position = player.Center - vector * (float)Main.rand.Next(5, 11); - dust.velocity = vector.RotatedBy(1.5707963705062866, default) * 4f; + dust.velocity = vector.RotatedBy(Math.PI / 2D, default) * 4f; dust.scale = 0.5f + Main.rand.NextFloat(); dust.fadeIn = 0.5f; } if (Main.rand.NextBool(2)) { - Vector2 vector2 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); + Vector2 vector2 = Vector2.UnitY.RotatedByRandom(Math.PI * 2D); Dust dust2 = Main.dust[Dust.NewDust(player.Center - vector2 * 30f, 0, 0, 246, 0f, 0f, 0, default, 1f)]; dust2.noGravity = true; dust2.position = player.Center - vector2 * 12f; - dust2.velocity = vector2.RotatedBy(-1.5707963705062866, default) * 2f; + dust2.velocity = vector2.RotatedBy(-Math.PI / 2D, default) * 2f; dust2.scale = 0.5f + Main.rand.NextFloat(); dust2.fadeIn = 0.5f; } @@ -2717,7 +2711,7 @@ namespace CalamityMod.CalPlayer if (modPlayer.ZoneAstral) { if (player.wingTimeMax > 0) - player.wingTimeMax = (int)((double)player.wingTimeMax * 1.05); + player.wingTimeMax = (int)(player.wingTimeMax * 1.05); } if (player.ZoneJungle && CalamityMod.natureWeaponList.Contains(player.ActiveItem().type)) @@ -3101,35 +3095,10 @@ namespace CalamityMod.CalPlayer { player.panic = true; player.pStone = true; - player.armorPenetration += 10; + player.armorPenetration += modPlayer.rampartOfDeities ? 20 : 10; } - if (modPlayer.rampartOfDeities) - { - player.armorPenetration += 10; - player.noKnockback = true; - if (player.statLife > (int)(player.statLifeMax2 * 0.25)) - { - player.hasPaladinShield = true; - if (player.whoAmI != Main.myPlayer && player.miscCounter % 10 == 0) - { - int myPlayer = Main.myPlayer; - if (Main.player[myPlayer].team == player.team && player.team != 0) - { - Vector2 otherPlayerPos = player.position - Main.player[myPlayer].position; - - if (otherPlayerPos.Length() < 800f) - Main.player[myPlayer].AddBuff(BuffID.PaladinsShield, 20, true); - } - } - } - - if (player.statLife <= (int)(player.statLifeMax2 * 0.5)) - player.AddBuff(BuffID.IceBarrier, 5, true); - if (player.statLife <= (int)(player.statLifeMax2 * 0.15)) - player.endurance += 0.05f; - } - else if (modPlayer.fBulwark) + if (modPlayer.fBulwark) { player.noKnockback = true; if (player.statLife > (int)(player.statLifeMax2 * 0.25)) @@ -3287,12 +3256,12 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < Main.maxNPCs; ++i) { - NPC nPC = Main.npc[i]; - if (!nPC.active || nPC.friendly || nPC.damage <= 0 || nPC.dontTakeDamage) + NPC npc = Main.npc[i]; + if (!npc.active || npc.friendly || npc.damage <= 0 || npc.dontTakeDamage) continue; - if (Vector2.Distance(player.Center, nPC.Center) <= range) - Projectile.NewProjectileDirect(nPC.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, i); + if (Vector2.Distance(player.Center, npc.Center) <= range) + Projectile.NewProjectileDirect(npc.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, i); } } } @@ -3314,23 +3283,23 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < Main.maxNPCs; ++i) { - NPC nPC = Main.npc[i]; - if (!nPC.active || nPC.friendly || nPC.damage <= 0 || nPC.dontTakeDamage) + NPC npc = Main.npc[i]; + if (!npc.active || npc.friendly || npc.damage <= 0 || npc.dontTakeDamage) continue; - if (Vector2.Distance(player.Center, nPC.Center) <= range) - Projectile.NewProjectileDirect(nPC.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, i); + if (Vector2.Distance(player.Center, npc.Center) <= range) + Projectile.NewProjectileDirect(npc.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, i); // Occasionally spawn cute sparks so it looks like an electrical aura if (Main.rand.NextBool(10)) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); - while (value15.X == 0f && value15.Y == 0f) - value15 = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); + Vector2 velocity = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); + while (velocity.X == 0f && velocity.Y == 0f) + velocity = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); - value15.Normalize(); - value15 *= (float)Main.rand.Next(30, 61) * 0.1f; - int spark = Projectile.NewProjectile(nPC.Center, value15, ModContent.ProjectileType(), damage / 2, 0f, player.whoAmI, 0f, 0f); + velocity.Normalize(); + velocity *= (float)Main.rand.Next(30, 61) * 0.1f; + int spark = Projectile.NewProjectile(npc.Center, velocity, ModContent.ProjectileType(), damage / 2, 0f, player.whoAmI, 0f, 0f); Main.projectile[spark].Calamity().forceTypeless = true; Main.projectile[spark].localNPCHitCooldown = -2; Main.projectile[spark].penetrate = 5; @@ -3357,15 +3326,15 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < Main.maxNPCs; ++i) { - NPC nPC = Main.npc[i]; - if (!nPC.active || nPC.friendly || nPC.damage <= 0 || nPC.dontTakeDamage) + NPC npc = Main.npc[i]; + if (!npc.active || npc.friendly || npc.damage <= 0 || npc.dontTakeDamage) continue; - if (Vector2.Distance(player.Center, nPC.Center) <= range) + if (Vector2.Distance(player.Center, npc.Center) <= range) { - nPC.AddBuff(ModContent.BuffType(), 120); + npc.AddBuff(ModContent.BuffType(), 120); if (modPlayer.brimLoreInfernoTimer == 0) - Projectile.NewProjectileDirect(nPC.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, i); + Projectile.NewProjectileDirect(npc.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, i); } } } @@ -3456,6 +3425,8 @@ namespace CalamityMod.CalPlayer player.AddBuff(ModContent.BuffType(), 3600, true); bool crystal = modPlayer.profanedCrystal && !modPlayer.profanedCrystalForce; + bool summonSet = modPlayer.tarraSummon || modPlayer.bloodflareSummon || modPlayer.godSlayerSummon || modPlayer.silvaSummon || modPlayer.dsSetBonus || modPlayer.omegaBlueSet || modPlayer.fearmongerSet; + if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -6f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, 0f); @@ -3467,7 +3438,7 @@ namespace CalamityMod.CalPlayer Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -3f, ModContent.ProjectileType(), 1, 1f, Main.myPlayer, 0f, 0f); } - if (crystal || (modPlayer.tarraSummon || modPlayer.bloodflareSummon || modPlayer.godSlayerSummon || modPlayer.silvaSummon || modPlayer.dsSetBonus || modPlayer.omegaBlueSet || modPlayer.fearmongerSet)) + if (crystal || summonSet) { player.Calamity().gOffense = true; @@ -3517,10 +3488,10 @@ namespace CalamityMod.CalPlayer bool special = player.name == "Amber" || player.name == "Nincity" || player.name == "IbanPlay" || player.name == "Chen"; //People who either helped create the item or test it. for (int i = 0; i < 3; i++) { - int num469 = Dust.NewDust(player.position, player.width, player.height, special ? 231 : (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, special ? Color.DarkRed : default, 1f); - Main.dust[num469].scale = special ? 1.169f : 2f; - Main.dust[num469].noGravity = true; - Main.dust[num469].velocity *= special ? 10f : 6.9f; + int fire = Dust.NewDust(player.position, player.width, player.height, special ? 231 : (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, special ? Color.DarkRed : default, 1f); + Main.dust[fire].scale = special ? 1.169f : 2f; + Main.dust[fire].noGravity = true; + Main.dust[fire].velocity *= special ? 10f : 6.9f; } } } @@ -3688,7 +3659,7 @@ namespace CalamityMod.CalPlayer int laser = Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), dmg, 4f, player.whoAmI, 0f, 0f); Main.projectile[laser].localNPCHitCooldown = 5; } - Main.PlaySound(SoundID.Item12, player.position); + Main.PlaySound(SoundID.Item12, player.Center); } if (modPlayer.prismaticLasers == 1800) { @@ -3716,13 +3687,13 @@ namespace CalamityMod.CalPlayer new Color(255, 0, 255, 50), //Fuschia new Color(255, 0, 128, 50) //Hot Pink }); - Vector2 vector6 = Vector2.Normalize(player.velocity) * new Vector2(player.width / 2f, player.height) * 0.75f; - vector6 = vector6.RotatedBy((dustIndex - (dustAmt / 2 - 1)) * MathHelper.TwoPi / dustAmt, default) + player.Center; - Vector2 vector7 = vector6 - player.Center; - int dusty = Dust.NewDust(vector6 + vector7, 0, 0, 267, vector7.X * 1f, vector7.Y * 1f, 100, color, 1f); + Vector2 source = Vector2.Normalize(player.velocity) * new Vector2(player.width / 2f, player.height) * 0.75f; + source = source.RotatedBy((dustIndex - (dustAmt / 2 - 1)) * MathHelper.TwoPi / dustAmt, default) + player.Center; + Vector2 dustVel = source - player.Center; + int dusty = Dust.NewDust(source + dustVel, 0, 0, 267, dustVel.X * 1f, dustVel.Y * 1f, 100, color, 1f); Main.dust[dusty].noGravity = true; Main.dust[dusty].noLight = true; - Main.dust[dusty].velocity = vector7; + Main.dust[dusty].velocity = dustVel; } } diff --git a/Items/Accessories/RampartofDeities.cs b/Items/Accessories/RampartofDeities.cs index f705e4d062..6be7867887 100644 --- a/Items/Accessories/RampartofDeities.cs +++ b/Items/Accessories/RampartofDeities.cs @@ -54,6 +54,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.dAmulet = true; modPlayer.rampartOfDeities = true; + modPlayer.fBulwark = true; modPlayer.jellyfishNecklace = true; } diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 26222de1f5..295ae9b0a2 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -95,6 +95,7 @@ namespace CalamityMod public static float AverageDamage(this Player player) => player.allDamage + (player.meleeDamage + player.rangedDamage + player.magicDamage + player.minionDamage + player.Calamity().throwingDamage - 5f) / 5f; public static bool IsUnderwater(this Player player) => Collision.DrownCollision(player.position, player.width, player.height, player.gravDir); + public static bool StandingStill(this Player player, float velocity = 0.05f) => player.velocity.Length() < velocity; public static bool InSpace(this Player player) { float x = Main.maxTilesX / 4200f; From 06d32ab52ff97f073116d356c58afc459af75ef6 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 15 Jul 2020 11:06:14 -0400 Subject: [PATCH 098/160] Projectile Rain now returns a projectile --- Items/Accessories/AmalgamatedBrain.cs | 3 ++- Items/Accessories/RottenBrain.cs | 3 ++- Items/Accessories/TheAmalgam.cs | 4 +++- Projectiles/Magic/AuroraAustralis.cs | 3 ++- Utilities/CalamityUtils.cs | 10 +++------- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Items/Accessories/AmalgamatedBrain.cs b/Items/Accessories/AmalgamatedBrain.cs index 6b9bc6ed25..031d0cea48 100644 --- a/Items/Accessories/AmalgamatedBrain.cs +++ b/Items/Accessories/AmalgamatedBrain.cs @@ -38,7 +38,8 @@ namespace CalamityMod.Items.Accessories { if (player.whoAmI == Main.myPlayer) { - CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), (int)(60 * player.AverageDamage()), 2f, player.whoAmI, 6, 1); + Projectile rain = CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), (int)(60 * player.AverageDamage()), 2f, player.whoAmI, 6, 1); + rain.tileCollide = false; } } } diff --git a/Items/Accessories/RottenBrain.cs b/Items/Accessories/RottenBrain.cs index 45740206fc..6ada62f8f1 100644 --- a/Items/Accessories/RottenBrain.cs +++ b/Items/Accessories/RottenBrain.cs @@ -33,7 +33,8 @@ namespace CalamityMod.Items.Accessories { if (player.whoAmI == Main.myPlayer) { - CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), (int)(18 * player.AverageDamage()), 2f, player.whoAmI, 6, 1); + Projectile rain = CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), (int)(18 * player.AverageDamage()), 2f, player.whoAmI, 6, 1); + rain.tileCollide = false; } } } diff --git a/Items/Accessories/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index 3291ec1cac..d6caba2720 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -132,7 +132,9 @@ namespace CalamityMod.Items.Accessories if (player.whoAmI == Main.myPlayer) { int type = Main.rand.NextBool(2) ? ProjectileType() : ProjectileType(); - CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, type, (int)(ProjectileDamage * player.AverageDamage()), 5f, player.whoAmI, 6, 1); + Projectile rain = CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, type, (int)(ProjectileDamage * player.AverageDamage()), 5f, player.whoAmI, 6, 1); + if (type == ProjectileType()) + rain.tileCollide = false; } } } diff --git a/Projectiles/Magic/AuroraAustralis.cs b/Projectiles/Magic/AuroraAustralis.cs index 96cf9cf290..38887a0bda 100644 --- a/Projectiles/Magic/AuroraAustralis.cs +++ b/Projectiles/Magic/AuroraAustralis.cs @@ -76,7 +76,8 @@ namespace CalamityMod.Projectiles.Magic if (Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 30) { float dmgKBMult = Main.rand.NextFloat(0.25f, 0.75f); - CalamityUtils.ProjectileRain(projectile.Center, projectile.velocity.X, 100f, 500f, 800f, Main.rand.NextFloat(10f, 20f), ModContent.ProjectileType(), (int)(projectile.damage * dmgKBMult), projectile.knockBack * dmgKBMult, projectile.owner); + Projectile star = CalamityUtils.ProjectileRain(projectile.Center, projectile.velocity.X, 100f, 500f, 800f, Main.rand.NextFloat(10f, 20f), ModContent.ProjectileType(), (int)(projectile.damage * dmgKBMult), projectile.knockBack * dmgKBMult, projectile.owner); + star.timeLeft = 120; } } diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 295ae9b0a2..6e122c890b 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -988,7 +988,7 @@ namespace CalamityMod } } - public static void ProjectileRain(Vector2 targetPos, float xLimit, float xVariance, float yLimitLower, float yLimitUpper, float projSpeed, int projType, int damage, float knockback, int owner, int forceType = 0, int immunitySetting = 0, int cooldown = 10) + public static Projectile ProjectileRain(Vector2 targetPos, float xLimit, float xVariance, float yLimitLower, float yLimitUpper, float projSpeed, int projType, int damage, float knockback, int owner, int forceType = 0, int immunitySetting = 0, int cooldown = 10) { float x = targetPos.X + Main.rand.NextFloat(-xLimit, xLimit); if (projType == ModContent.ProjectileType()) @@ -1002,13 +1002,8 @@ namespace CalamityMod targetDist = speed / targetDist; velocity.X *= targetDist; velocity.Y *= targetDist; - int index = Projectile.NewProjectile(source, velocity, projType, damage, knockback, owner, 0f, 0f); - Projectile proj = Main.projectile[index]; + Projectile proj = Projectile.NewProjectileDirect(source, velocity, projType, damage, knockback, owner, 0f, 0f); CalamityGlobalProjectile modProj = proj.Calamity(); - if (projType == ModContent.ProjectileType()) - proj.timeLeft = 120; - if (projType == ModContent.ProjectileType()) - proj.tileCollide = false; if (forceType > 0) { switch (forceType) @@ -1049,6 +1044,7 @@ namespace CalamityMod break; } } + return proj; } public static int DamageSoftCap(double dmgInput, int cap) From 43eef06722749268fde913ce78b3dd279f6b3027 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 15 Jul 2020 14:24:51 -0400 Subject: [PATCH 099/160] removed static refiner from boss checklist --- ModSupport/WeakReferenceSupport.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 9877ceaf25..e037e4d520 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -272,7 +272,7 @@ namespace CalamityMod List bosses = new List() { NPCType(), NPCType(), NPCType() }; int summon = ItemType(); List loot = new List() { ItemType(), ItemID.Gel, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.HealingPotion }; - List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}]"; string despawn = CalamityUtils.ColorMessage("The gelatinous monstrosity achieved vengeance for its brethren.", new Color(0xBA, 0x55, 0x33)); AddBoss(bossChecklist, calamity, "Slime God", order, bosses, DownedSlimeGod, summon, loot, collection, instructions, despawn); From 278e7517ffe27f0d5c76962599c2a517a0599c0d Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 15 Jul 2020 18:39:48 -0400 Subject: [PATCH 100/160] renamed xeroc pitchfork to Antumbra Transpiercer --- Items/Weapons/Rogue/XerocPitchfork.cs | 7 +++---- Projectiles/Rogue/XerocPitchforkProjectile.cs | 10 +++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Items/Weapons/Rogue/XerocPitchfork.cs b/Items/Weapons/Rogue/XerocPitchfork.cs index a395ed989f..5f4ccf1ec6 100644 --- a/Items/Weapons/Rogue/XerocPitchfork.cs +++ b/Items/Weapons/Rogue/XerocPitchfork.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Rogue { public override void SetStaticDefaults() { - DisplayName.SetDefault("Xeroc Pitchfork"); + DisplayName.SetDefault("Antumbra Transpiercer"); Tooltip.SetDefault("Stealth strikes leave homing stars in their wake"); } @@ -41,11 +41,10 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); Main.projectile[stealth].Calamity().stealthStrike = true; - return false; } - return true; + return !player.Calamity().StealthStrikeAvailable(); } public override void AddRecipes() diff --git a/Projectiles/Rogue/XerocPitchforkProjectile.cs b/Projectiles/Rogue/XerocPitchforkProjectile.cs index 38d1edc8b2..186fdcd827 100644 --- a/Projectiles/Rogue/XerocPitchforkProjectile.cs +++ b/Projectiles/Rogue/XerocPitchforkProjectile.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Rogue { public override void SetStaticDefaults() { - DisplayName.SetDefault("Pitchfork"); + DisplayName.SetDefault("Antumbra Transpiercer"); ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; ProjectileID.Sets.TrailingMode[projectile.type] = 0; } @@ -33,13 +33,13 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { projectile.rotation = projectile.velocity.ToRotation() + MathHelper.ToRadians(135f); - if (Main.rand.NextBool(3)) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 62, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } if (projectile.spriteDirection == -1) { projectile.rotation -= 1.57f; + } + if (Main.rand.NextBool(3)) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 62, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } if (projectile.timeLeft % 12 == 0) { From 4bb54d26f424fef4ae40490f0dea4750d35a08aa Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 15 Jul 2020 21:27:27 -0400 Subject: [PATCH 101/160] Fixed brimstone crate using the wrong chance value w/ enchanted pearl/stbfs --- CalPlayer/CalamityPlayerFishing.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CalPlayer/CalamityPlayerFishing.cs b/CalPlayer/CalamityPlayerFishing.cs index 9678efa889..50523224b6 100644 --- a/CalPlayer/CalamityPlayerFishing.cs +++ b/CalPlayer/CalamityPlayerFishing.cs @@ -168,7 +168,7 @@ namespace CalamityMod.CalPlayer { if (Main.rand.Next(100) < chanceForCrates) { - if (Main.rand.NextBool(chanceForRareItems) && modPlayer.enchantedPearl && modPlayer.fishingStation && player.cratePotion) + if (Main.rand.NextBool(chanceForBiomeCrate)) { if (modPlayer.ZoneCalamity) caughtType = ModContent.ItemType(); From 9ba9dbdd50b38b791b1a1deab945ee710452420e Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 15 Jul 2020 21:44:39 -0400 Subject: [PATCH 102/160] Fixed Evasion Scarf tooltip listing the wrong number --- Items/Accessories/EvasionScarf.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Accessories/EvasionScarf.cs b/Items/Accessories/EvasionScarf.cs index 7c7b45012c..9907cb2e8c 100644 --- a/Items/Accessories/EvasionScarf.cs +++ b/Items/Accessories/EvasionScarf.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Evasion Scarf"); - Tooltip.SetDefault("True melee strikes deal 30% more damage\n" + + Tooltip.SetDefault("True melee strikes deal 25% more damage\n" + "Grants the ability to dash; dashing into an attack will cause you to dodge it\n" + "After a dodge you will be granted a buff to all damage, melee speed, and all crit chance for a short time\n" + "After a successful dodge you must wait 13 seconds before you can dodge again\n" + From b3935ea771f132a824430dbb4917e09894342ef8 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 16 Jul 2020 10:00:11 -0400 Subject: [PATCH 103/160] weapon balancing --- CalPlayer/CalamityPlayer.cs | 2 +- Items/Armor/ForbiddenCirclet.cs | 1 - .../Weapons/DraedonsArsenal/MountedScanner.cs | 4 +- Items/Weapons/DraedonsArsenal/PoleWarper.cs | 2 +- Items/Weapons/DraedonsArsenal/SnakeEyes.cs | 2 +- Items/Weapons/Magic/EventHorizon.cs | 2 +- Items/Weapons/Magic/ShiftingSands.cs | 2 +- Items/Weapons/Ranged/Galeforce.cs | 6 +- Items/Weapons/Ranged/HeavenlyGale.cs | 2 +- Items/Weapons/Summon/PlantationStaff.cs | 2 +- NPCs/CalamityGlobalNPC.cs | 10 +- .../DraedonsArsenal/StarSwallowerSummon.cs | 2 +- Projectiles/Summon/RadiantResolutionAura.cs | 2 +- Projectiles/Summon/RadiantResolutionFire.cs | 1 + Projectiles/Summon/SiriusMinion.cs | 101 +++++++++--------- 15 files changed, 70 insertions(+), 71 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 05290be605..ee1294c47b 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -5618,7 +5618,7 @@ namespace CalamityMod.CalPlayer // Forbidden armor reduces said nerf when holding the respective helmet's preferred weapon type // Profaned Soul Crystal encourages use of other weapons, nerfing the damage would not make sense. bool forbidden = player.head == ArmorIDs.Head.AncientBattleArmor && player.body == ArmorIDs.Body.AncientBattleArmor && player.legs == ArmorIDs.Legs.AncientBattleArmor; - bool reducedNerf = fearmongerSet || (forbidden && heldItem.magic) || (forbiddenCirclet && heldItem.Calamity().rogue); + bool reducedNerf = fearmongerSet || (forbidden && heldItem.magic); double summonNerfMult = 0.5; if (reducedNerf) summonNerfMult = 0.75; diff --git a/Items/Armor/ForbiddenCirclet.cs b/Items/Armor/ForbiddenCirclet.cs index 03898e6445..4f1fdde063 100644 --- a/Items/Armor/ForbiddenCirclet.cs +++ b/Items/Armor/ForbiddenCirclet.cs @@ -48,7 +48,6 @@ namespace CalamityMod.Items.Armor player.setBonus = "Press " + hotkey + " to call an ancient storm to the cursor location\n" + "The ancient storm costs " + stormMana + " mana and benefits from both summon and rogue bonuses\n" + "Rogue stealth strikes spawn homing eaters on enemy hits\n" + - "The minion damage nerf is reduced while wielding rogue weapons\n" + "Rogue and summon attacks will scale off of the stat with a higher boost\n" + "Rogue stealth builds while not attacking and slower while moving, up to a max of 100\n" + "Once you have built max stealth, you will be able to perform a Stealth Strike\n" + diff --git a/Items/Weapons/DraedonsArsenal/MountedScanner.cs b/Items/Weapons/DraedonsArsenal/MountedScanner.cs index 20e8094772..ec797b4f22 100644 --- a/Items/Weapons/DraedonsArsenal/MountedScanner.cs +++ b/Items/Weapons/DraedonsArsenal/MountedScanner.cs @@ -19,9 +19,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.width = 26; item.height = 26; item.summon = true; - item.damage = 27; + item.damage = 15; item.knockBack = 2f; - item.useTime = item.useAnimation = 35; + item.useTime = item.useAnimation = 25; item.autoReuse = true; item.useStyle = ItemUseStyleID.HoldingUp; diff --git a/Items/Weapons/DraedonsArsenal/PoleWarper.cs b/Items/Weapons/DraedonsArsenal/PoleWarper.cs index 50a14fae93..e6e01fec47 100644 --- a/Items/Weapons/DraedonsArsenal/PoleWarper.cs +++ b/Items/Weapons/DraedonsArsenal/PoleWarper.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void SetDefaults() { item.shootSpeed = 10f; - item.damage = 38; + item.damage = 34; item.mana = 12; item.width = 38; item.height = 24; diff --git a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs index 8c7e89c90c..767b94fc46 100644 --- a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs +++ b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void SetDefaults() { item.shootSpeed = 10f; - item.damage = 15; + item.damage = 9; item.mana = 12; item.width = 38; item.height = 24; diff --git a/Items/Weapons/Magic/EventHorizon.cs b/Items/Weapons/Magic/EventHorizon.cs index cc8c8b10fe..bb5632a978 100644 --- a/Items/Weapons/Magic/EventHorizon.cs +++ b/Items/Weapons/Magic/EventHorizon.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic item.width = 28; item.height = 30; - item.damage = 231; + item.damage = 369; item.knockBack = 3.5f; item.noMelee = true; item.magic = true; diff --git a/Items/Weapons/Magic/ShiftingSands.cs b/Items/Weapons/Magic/ShiftingSands.cs index 8e2fe3b012..e17a447727 100644 --- a/Items/Weapons/Magic/ShiftingSands.cs +++ b/Items/Weapons/Magic/ShiftingSands.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 85; + item.damage = 61; item.knockBack = 5f; item.useTime = item.useAnimation = 30; item.mana = 20; diff --git a/Items/Weapons/Ranged/Galeforce.cs b/Items/Weapons/Ranged/Galeforce.cs index f6524c3c2e..8036a8c90f 100644 --- a/Items/Weapons/Ranged/Galeforce.cs +++ b/Items/Weapons/Ranged/Galeforce.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 18; + item.damage = 16; item.ranged = true; item.width = 32; item.height = 52; @@ -30,9 +30,9 @@ namespace CalamityMod.Items.Weapons.Ranged item.rare = 3; item.UseSound = SoundID.Item5; item.autoReuse = true; - item.shoot = ProjectileID.PurificationPowder; + item.shoot = ProjectileID.WoodenArrowFriendly; item.shootSpeed = 20f; - item.useAmmo = 40; + item.useAmmo = AmmoID.Arrow; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Ranged/HeavenlyGale.cs b/Items/Weapons/Ranged/HeavenlyGale.cs index fc59264604..9cd820a391 100644 --- a/Items/Weapons/Ranged/HeavenlyGale.cs +++ b/Items/Weapons/Ranged/HeavenlyGale.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 720; + item.damage = 600; item.ranged = true; item.width = 44; item.height = 58; diff --git a/Items/Weapons/Summon/PlantationStaff.cs b/Items/Weapons/Summon/PlantationStaff.cs index 539ef97bb1..ffcf474c10 100644 --- a/Items/Weapons/Summon/PlantationStaff.cs +++ b/Items/Weapons/Summon/PlantationStaff.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 69; + item.damage = 60; item.mana = 10; item.width = 66; item.height = 70; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 303c417e82..f427f9161d 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -3575,15 +3575,15 @@ namespace CalamityMod.NPCs { damage = (int)(damage * 0.2); } - else if (ProjectileID.Sets.StardustDragon[projectile.type] || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileID.Electrosphere) + else if (ProjectileID.Sets.StardustDragon[projectile.type] || projectile.type == ProjectileType() || projectile.type == ProjectileType()) { - damage = (int)(damage * 0.4); + damage = (int)(damage * 0.25); } - else if (projectile.type == ProjectileType()) + else if (projectile.type == ProjectileID.DD2BetsyArrow || projectile.type == ProjectileType() || projectile.type == ProjectileType()) { damage = (int)(damage * 0.5); } - else if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileID.InfernoFriendlyBolt || projectile.type == ProjectileID.InfernoFriendlyBlast || projectile.type == ProjectileID.RainbowFront || projectile.type == ProjectileID.RainbowBack || projectile.type == ProjectileType() || projectile.type == ProjectileID.DD2BetsyArrow || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileID.ChargedBlasterLaser) + else if (projectile.type == ProjectileType() || projectile.type == ProjectileID.InfernoFriendlyBolt || projectile.type == ProjectileID.InfernoFriendlyBlast || projectile.type == ProjectileID.RainbowFront || projectile.type == ProjectileID.RainbowBack || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileID.ChargedBlasterLaser || projectile.type == ProjectileID.Electrosphere) { damage = (int)(damage * 0.75); } @@ -3652,7 +3652,7 @@ namespace CalamityMod.NPCs { damage = (int)(damage * 0.9); } - if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) + if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) { damage = (int)(damage * 0.5); } diff --git a/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs b/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs index 1114bca9e6..e98b4534fa 100644 --- a/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs +++ b/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs @@ -240,7 +240,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { Vector2 spawnPosition = projectile.Center + Vector2.UnitX * 8f * projectile.spriteDirection; - float shootSpeed = 9f; + float shootSpeed = 14f; float gravity = -StarSwallowerAcid.Gravity; float distance = Vector2.Distance(spawnPosition, potentialTarget.Center); float angle = 0.5f * (float)Math.Asin(MathHelper.Clamp(gravity * distance / (float)Math.Pow(shootSpeed, 2), -1f, 1f)); diff --git a/Projectiles/Summon/RadiantResolutionAura.cs b/Projectiles/Summon/RadiantResolutionAura.cs index 4c7a35c685..5051154e9d 100644 --- a/Projectiles/Summon/RadiantResolutionAura.cs +++ b/Projectiles/Summon/RadiantResolutionAura.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Summon float allocatedSlots = projectile.ai[0]; projectile.rotation += MathHelper.ToRadians(3f) + MathHelper.ToRadians(allocatedSlots * 0.85f); - int radiantOrbDamage = (int)(projectile.damage * Math.Log(allocatedSlots + 1f, 1.75)); + int radiantOrbDamage = (int)(projectile.damage * (Math.Log(allocatedSlots, 2.5) + 1f)); int radiantOrbAppearRate = (int)(124 * Math.Pow(0.9, allocatedSlots)); if (radiantOrbAppearRate < 7) diff --git a/Projectiles/Summon/RadiantResolutionFire.cs b/Projectiles/Summon/RadiantResolutionFire.cs index e069758014..4b9fdc04b9 100644 --- a/Projectiles/Summon/RadiantResolutionFire.cs +++ b/Projectiles/Summon/RadiantResolutionFire.cs @@ -48,6 +48,7 @@ namespace CalamityMod.Projectiles.Summon projectile.penetrate = -1; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 5; + projectile.damage /= 2; projectile.Damage(); Main.PlaySound(SoundID.Item14, projectile.position); for (int i = 0; i < 20; i++) diff --git a/Projectiles/Summon/SiriusMinion.cs b/Projectiles/Summon/SiriusMinion.cs index 6d4ee54d00..bbf4898f32 100644 --- a/Projectiles/Summon/SiriusMinion.cs +++ b/Projectiles/Summon/SiriusMinion.cs @@ -33,12 +33,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { - Lighting.AddLight(projectile.Center, 1f, 0.5f, 5f); - bool flag64 = projectile.type == ModContent.ProjectileType(); Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - player.AddBuff(ModContent.BuffType(), 3600); - if (flag64) + + bool correctMinion = projectile.type == ModContent.ProjectileType(); + if (correctMinion) { if (player.dead) { @@ -49,7 +48,11 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } + player.AddBuff(ModContent.BuffType(), 3600); + projectile.minionSlots = projectile.ai[0]; + Lighting.AddLight(projectile.Center, 1f, 0.5f, 5f); + projectile.Center = player.Center + Vector2.UnitY * (player.gfxOffY - 60f); if (player.gravDir == -1f) { @@ -62,27 +65,29 @@ namespace CalamityMod.Projectiles.Summon } projectile.position.X = (int)projectile.position.X; projectile.position.Y = (int)projectile.position.Y; - float num395 = (float)Main.mouseTextColor / 200f - 0.35f; - num395 *= 0.2f; - projectile.scale = num395 + 0.95f; + + float scalar = (float)Main.mouseTextColor / 200f - 0.35f; + scalar *= 0.2f; + projectile.scale = scalar + 0.95f; + if (projectile.localAI[0] == 0f) { projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; - int num501 = 50; - for (int num502 = 0; num502 < num501; num502++) + int dustAmt = 50; + for (int d = 0; d < dustAmt; d++) { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 20, 0f, 0f, 0, default, 1f); - Main.dust[num503].velocity *= 2f; - Main.dust[num503].scale *= 1.15f; + int sirius = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 20, 0f, 0f, 0, default, 1f); + Main.dust[sirius].velocity *= 2f; + Main.dust[sirius].scale *= 1.15f; } projectile.localAI[0] += 1f; } + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / - projectile.Calamity().spawnedPlayerMinionDamageValue * - player.MinionDamage()); + projectile.Calamity().spawnedPlayerMinionDamageValue * player.MinionDamage()); projectile.damage = damage2; } if (projectile.owner == Main.myPlayer) @@ -92,57 +97,51 @@ namespace CalamityMod.Projectiles.Summon projectile.ai[1] -= 1f; return; } - float num396 = projectile.position.X; - float num397 = projectile.position.Y; - float minDistance = 7000f; - bool flag11 = false; + Vector2 targetVec = projectile.position; + float maxDistance = 7000f; + bool hasTarget = false; if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; if (npc.CanBeChasedBy(projectile, false)) { - float num539 = npc.position.X + (float)(npc.width / 2); - float num540 = npc.position.Y + (float)(npc.height / 2); - float num541 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num539) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num540); - if (num541 < minDistance) - { - num396 = num539; - num397 = num540; - flag11 = true; + float extraDistance = (npc.width / 2) + (npc.height / 2); + + if (Vector2.Distance(npc.Center, projectile.Center) < (maxDistance + extraDistance)) + { + targetVec = npc.Center; + hasTarget = true; } } } - if (!flag11) + if (!hasTarget) { - for (int num399 = 0; num399 < Main.npc.Length; num399++) + for (int i = 0; i < Main.maxNPCs; i++) { - if (Main.npc[num399].CanBeChasedBy(projectile, false)) - { - float num400 = Main.npc[num399].position.X + (float)(Main.npc[num399].width / 2); - float num401 = Main.npc[num399].position.Y + (float)(Main.npc[num399].height / 2); - float num402 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num400) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num401); - if (num402 < minDistance) - { - minDistance = num402; - num396 = num400; - num397 = num401; - flag11 = true; - } - } + NPC npc = Main.npc[i]; + if (npc.CanBeChasedBy(projectile, false)) + { + float extraDistance = (npc.width / 2) + (npc.height / 2); + + if (Vector2.Distance(npc.Center, projectile.Center) < (maxDistance + extraDistance)) + { + targetVec = npc.Center; + hasTarget = true; + } + } } } - if (flag11) + if (hasTarget) { - float num403 = 15f; - Vector2 vector29 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num404 = num396 - vector29.X; - float num405 = num397 - vector29.Y; - float num406 = (float)Math.Sqrt((double)(num404 * num404 + num405 * num405)); - num406 = num403 / num406; - num404 *= num406; - num405 *= num406; + float projSpeed = 15f; + Vector2 source = new Vector2(projectile.Center.X - 4f, projectile.Center.Y); + Vector2 velocity = targetVec - projectile.Center; + float targetDist = velocity.Length(); + targetDist = projSpeed / targetDist; + velocity.X *= targetDist; + velocity.Y *= targetDist; float damageMult = ((float)Math.Log(projectile.ai[0], MathHelper.E)) + 1f; - int beam = Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, num404, num405, ModContent.ProjectileType(), (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner); + int beam = Projectile.NewProjectile(source, velocity, ModContent.ProjectileType(), (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner); Main.projectile[beam].penetrate = (int)projectile.ai[0]; projectile.ai[1] = 30f; } From 0186fbab10c4fe13ed1a20434befb347f6b61afc Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 16 Jul 2020 10:56:38 -0400 Subject: [PATCH 104/160] slime god lore now slows you down if you down --- CalPlayer/CalamityPlayerMiscEffects.cs | 3 +-- Items/LoreItems/KnowledgeSlimeGod.cs | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index bf338ce7dd..f07cac14bf 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3515,8 +3515,7 @@ namespace CalamityMod.CalPlayer int damage = (int)(30 * player.MinionDamage()); for (int index = 0; index < beeCount; ++index) { - int bee = Projectile.NewProjectile(player.Center.X, player.Center.Y, Main.rand.NextFloat(-35f, 35f) * 0.02f, Main.rand.NextFloat(-35f, 35f) * 0.02f, (Main.rand.NextBool(4) ? ModContent.ProjectileType() : player.beeType()), damage, player.beeKB(0f), player.whoAmI, 0f, 0f); - Main.projectile[bee].Calamity().forceMinion = true; + int bee = Projectile.NewProjectile(player.Center.X, player.Center.Y, Main.rand.NextFloat(-35f, 35f) * 0.02f, Main.rand.NextFloat(-35f, 35f) * 0.02f, (Main.rand.NextBool(4) ? ModContent.ProjectileType() : player.beeType()), damage, player.beeKB(0f), player.whoAmI, 0f, 0f); Main.projectile[bee].usesLocalNPCImmunity = true; Main.projectile[bee].localNPCHitCooldown = 10; Main.projectile[bee].penetrate = 2; diff --git a/Items/LoreItems/KnowledgeSlimeGod.cs b/Items/LoreItems/KnowledgeSlimeGod.cs index 358c2b67b7..6ae2464151 100644 --- a/Items/LoreItems/KnowledgeSlimeGod.cs +++ b/Items/LoreItems/KnowledgeSlimeGod.cs @@ -1,3 +1,4 @@ +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; @@ -35,7 +36,7 @@ namespace CalamityMod.Items.LoreItems if (player.mount.Active || !item.favorited) return; - if (player.dashDelay < 0) + if (player.dashDelay < 0 || (player.velocity.Length() >= 11f && CalamityPlayer.areThereAnyDamnBosses)) //If you go over 52.8 mph player.velocity.X *= 0.9f; player.slippy2 = true; From b0de887676479028e3f678a1114cea08de5d8ae8 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 16 Jul 2020 11:10:24 -0400 Subject: [PATCH 105/160] gladiuses now use projectilerain util & stellar striker no longer repeats thingy --- Items/Weapons/Melee/ExoGladius.cs | 28 ++----------- Items/Weapons/Melee/GalileoGladius.cs | 21 +++------- Items/Weapons/Melee/StellarStriker.cs | 57 +++++---------------------- 3 files changed, 18 insertions(+), 88 deletions(-) diff --git a/Items/Weapons/Melee/ExoGladius.cs b/Items/Weapons/Melee/ExoGladius.cs index 543f56e7e1..adcf894846 100644 --- a/Items/Weapons/Melee/ExoGladius.cs +++ b/Items/Weapons/Melee/ExoGladius.cs @@ -91,20 +91,10 @@ namespace CalamityMod.Items.Weapons.Melee target.AddBuff(BuffID.OnFire, 120); target.AddBuff(BuffID.Ichor, 120); - float x = target.Center.X + (float)Main.rand.Next(-400, 400); - float y = target.Center.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num15 = target.Center.X + (float)(target.width / 2) - vector.X; - float num16 = target.Center.Y + (float)(target.height / 2) - vector.Y; - num15 += (float)Main.rand.Next(-100, 101); - int num17 = 25; - float num18 = (float)Math.Sqrt((double)(num15 * num15 + num16 * num16)); - num18 = (float)num17 / num18; - num15 *= num18; - num16 *= num18; if (player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(x, y, num15, num16, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), 15f, player.whoAmI, 0f, 0f); + int damage = player.GetWeaponDamage(player.ActiveItem()); + CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 25f, ModContent.ProjectileType(), damage, 15f, projectile.owner); } } @@ -131,20 +121,10 @@ namespace CalamityMod.Items.Weapons.Melee target.AddBuff(BuffID.OnFire, 120); target.AddBuff(BuffID.Ichor, 120); - float x = target.Center.X + (float)Main.rand.Next(-400, 400); - float y = target.Center.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num15 = target.Center.X + (float)(target.width / 2) - vector.X; - float num16 = target.Center.Y + (float)(target.height / 2) - vector.Y; - num15 += (float)Main.rand.Next(-100, 101); - int num17 = 25; - float num18 = (float)Math.Sqrt((double)(num15 * num15 + num16 * num16)); - num18 = (float)num17 / num18; - num15 *= num18; - num16 *= num18; if (player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(x, y, num15, num16, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), 15f, player.whoAmI, 0f, 0f); + int damage = player.GetWeaponDamage(player.ActiveItem()); + CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 25f, ModContent.ProjectileType(), damage, 15f, projectile.owner); } } } diff --git a/Items/Weapons/Melee/GalileoGladius.cs b/Items/Weapons/Melee/GalileoGladius.cs index fbdac3cadb..34fe8cc98f 100644 --- a/Items/Weapons/Melee/GalileoGladius.cs +++ b/Items/Weapons/Melee/GalileoGladius.cs @@ -81,25 +81,14 @@ namespace CalamityMod.Items.Weapons.Melee } private void SpawnMeteor(Player player) - { - float x = player.Center.X + (float)Main.rand.Next(-400, 400); - float y = player.Center.Y - (float)Main.rand.Next(500, 800); - Vector2 startPos = new Vector2(x, y); - Vector2 velocity = player.Center - startPos; - velocity.X += (float)Main.rand.Next(-100, 101); - float speed = 25f; - float targetDist = velocity.Length(); - targetDist = speed / targetDist; - velocity.X *= targetDist; - velocity.Y *= targetDist; + { if (player.whoAmI == Main.myPlayer) { if (player.Calamity().galileoCooldown <= 0) - { - int damage = player.GetWeaponDamage(player.ActiveItem()) * 2; - int meteor = Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), damage, 15f, player.whoAmI); - Main.projectile[meteor].ai[1] = player.position.Y; - player.Calamity().galileoCooldown = 15; + { + int damage = player.GetWeaponDamage(player.ActiveItem()) * 2; + CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 25f, ModContent.ProjectileType(), damage, 15f, projectile.owner); + player.Calamity().galileoCooldown = 15; } } } diff --git a/Items/Weapons/Melee/StellarStriker.cs b/Items/Weapons/Melee/StellarStriker.cs index aad8f52610..32b4378aaf 100644 --- a/Items/Weapons/Melee/StellarStriker.cs +++ b/Items/Weapons/Melee/StellarStriker.cs @@ -39,56 +39,17 @@ namespace CalamityMod.Items.Weapons.Melee { return; } - Main.PlaySound(SoundID.Item88, player.position); - int i = Main.myPlayer; - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - - int num112 = 2; - for (int num113 = 0; num113 < num112; num113++) - { - vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - vector2.Y -= (float)(100 * num113); - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X + (float)Main.rand.Next(-40, 41) * 0.03f; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) - { - num79 *= -1f; - } - if (num79 < 20f) - { - num79 = 20f; - } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float num114 = num78; - float num115 = num79 + (float)Main.rand.Next(-80, 81) * 0.02f; - int proj = Projectile.NewProjectile(vector2.X, vector2.Y, num114, num115, ProjectileID.LunarFlare, (int)(item.damage * player.MeleeDamage() * 0.5), knockback, i, 0f, (float)Main.rand.Next(3)); - Main.projectile[proj].Calamity().forceMelee = true; - } + if (player.whoAmI == Main.myPlayer) + SpawnFlares(player, knockback); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) + { + if (player.whoAmI == Main.myPlayer) + SpawnFlares(player, item.knockBack); + } + + public static void SpawnFlares(Player player, float knockBack) { Main.PlaySound(SoundID.Item88, player.position); int i = Main.myPlayer; @@ -134,7 +95,7 @@ namespace CalamityMod.Items.Weapons.Melee num79 *= num80; float num114 = num78; float num115 = num79 + (float)Main.rand.Next(-80, 81) * 0.02f; - int proj = Projectile.NewProjectile(vector2.X, vector2.Y, num114, num115, ProjectileID.LunarFlare, (int)(item.damage * player.MeleeDamage() * 0.5), item.knockBack, i, 0f, (float)Main.rand.Next(3)); + int proj = Projectile.NewProjectile(vector2.X, vector2.Y, num114, num115, ProjectileID.LunarFlare, (int)(item.damage * player.MeleeDamage() * 0.5), knockBack, i, 0f, (float)Main.rand.Next(3)); Main.projectile[proj].Calamity().forceMelee = true; } } From a5cd1785f573fbaa26596bc37c4e7f35866ba5c4 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 16 Jul 2020 11:13:34 -0400 Subject: [PATCH 106/160] fixes to gladius --- Items/Weapons/Melee/ExoGladius.cs | 47 ++++++++++----------------- Items/Weapons/Melee/GalileoGladius.cs | 2 +- 2 files changed, 19 insertions(+), 30 deletions(-) diff --git a/Items/Weapons/Melee/ExoGladius.cs b/Items/Weapons/Melee/ExoGladius.cs index adcf894846..11afd909f0 100644 --- a/Items/Weapons/Melee/ExoGladius.cs +++ b/Items/Weapons/Melee/ExoGladius.cs @@ -70,17 +70,6 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (!player.immune) - { - player.immune = true; - if (player.immuneTime < 10) - player.immuneTime = 10; - if (player.hurtCooldowns[0] < 10) - player.hurtCooldowns[0] = 10; - if (player.hurtCooldowns[1] < 10) - player.hurtCooldowns[1] = 10; - } - target.AddBuff(ModContent.BuffType(), 30); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); @@ -91,26 +80,11 @@ namespace CalamityMod.Items.Weapons.Melee target.AddBuff(BuffID.OnFire, 120); target.AddBuff(BuffID.Ichor, 120); - if (player.whoAmI == Main.myPlayer) - { - int damage = player.GetWeaponDamage(player.ActiveItem()); - CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 25f, ModContent.ProjectileType(), damage, 15f, projectile.owner); - } + OnHitEffects(player); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - if (!player.immune) - { - player.immune = true; - if (player.immuneTime < 10) - player.immuneTime = 10; - if (player.hurtCooldowns[0] < 10) - player.hurtCooldowns[0] = 10; - if (player.hurtCooldowns[1] < 10) - player.hurtCooldowns[1] = 10; - } - target.AddBuff(ModContent.BuffType(), 30); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); @@ -121,11 +95,26 @@ namespace CalamityMod.Items.Weapons.Melee target.AddBuff(BuffID.OnFire, 120); target.AddBuff(BuffID.Ichor, 120); + OnHitEffects(player); + } + + private void OnHitEffects(Player player) + { + if (!player.immune) + { + player.immune = true; + if (player.immuneTime < 10) + player.immuneTime = 10; + if (player.hurtCooldowns[0] < 10) + player.hurtCooldowns[0] = 10; + if (player.hurtCooldowns[1] < 10) + player.hurtCooldowns[1] = 10; + } + if (player.whoAmI == Main.myPlayer) { int damage = player.GetWeaponDamage(player.ActiveItem()); - CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 25f, ModContent.ProjectileType(), damage, 15f, projectile.owner); + CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 25f, ModContent.ProjectileType(), damage, 15f, player.whoAmI); } } - } } diff --git a/Items/Weapons/Melee/GalileoGladius.cs b/Items/Weapons/Melee/GalileoGladius.cs index 34fe8cc98f..910ce6c587 100644 --- a/Items/Weapons/Melee/GalileoGladius.cs +++ b/Items/Weapons/Melee/GalileoGladius.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Items.Weapons.Melee if (player.Calamity().galileoCooldown <= 0) { int damage = player.GetWeaponDamage(player.ActiveItem()) * 2; - CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 25f, ModContent.ProjectileType(), damage, 15f, projectile.owner); + CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 25f, ModContent.ProjectileType(), damage, 15f, player.whoAmI); player.Calamity().galileoCooldown = 15; } } From 90a44631d7b2852a8503fa618f9bcae9746490bd Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 16 Jul 2020 20:53:58 -0400 Subject: [PATCH 107/160] renamed some variables & redid ExplosionGores util --- CalPlayer/CalamityPlayer.cs | 291 ++++++++---------- NPCs/Astral/AstralProbe.cs | 33 +- NPCs/NormalNPCs/Horse.cs | 2 +- NPCs/StormWeaver/StasisProbe.cs | 2 +- NPCs/StormWeaver/StasisProbeNaked.cs | 2 +- Projectiles/Boss/FlareBomb.cs | 8 +- Projectiles/Boss/FlareDust.cs | 8 +- Projectiles/Boss/FlareDust2.cs | 8 +- Projectiles/Boss/HiveBombGoliath.cs | 12 +- Projectiles/Boss/ScavengerNuke.cs | 8 +- Projectiles/Enemy/EarthRockBig.cs | 8 +- Projectiles/Enemy/EarthRockSmall.cs | 8 +- Projectiles/Melee/DragonRageProj.cs | 8 +- Projectiles/Melee/Earth3.cs | 8 +- Projectiles/Melee/GalileosPlanet.cs | 2 +- Projectiles/Ranged/BeeRPG.cs | 12 +- Projectiles/Ranged/BigNuke.cs | 8 +- Projectiles/Ranged/CardDiamond.cs | 34 +- Projectiles/Ranged/ElysianArrowProj.cs | 8 +- Projectiles/Ranged/GoliathRocket.cs | 12 +- Projectiles/Ranged/HandheldTankShell.cs | 4 +- Projectiles/Ranged/HiveBomb.cs | 12 +- Projectiles/Ranged/HiveMissile.cs | 12 +- Projectiles/Ranged/MagnomalyRocket.cs | 112 ++++--- Projectiles/Ranged/MiniRocket.cs | 8 +- Projectiles/Ranged/MortarRoundProj.cs | 8 +- Projectiles/Ranged/NapalmArrowProj.cs | 2 +- Projectiles/Ranged/Nuke.cs | 8 +- Projectiles/Ranged/RubberMortarRoundProj.cs | 14 +- Projectiles/Rogue/BallisticPoisonBombProj.cs | 8 +- Projectiles/Rogue/BettyExplosion.cs | 4 +- Projectiles/Rogue/CraniumSMASH.cs | 4 +- Projectiles/Rogue/CraniumSmasherExplosive.cs | 4 +- Projectiles/Rogue/CraniumSmasherStealth.cs | 4 +- Projectiles/Rogue/DestructionBolt.cs | 8 +- Projectiles/Rogue/DragonShit.cs | 8 +- Projectiles/Rogue/PlaguenadeProj.cs | 8 +- Projectiles/Rogue/SeafoamBombProj.cs | 2 +- .../Rogue/ShatteredSunScorchedBlade.cs | 12 +- Projectiles/Rogue/SupernovaBomb.cs | 8 +- Projectiles/Summon/Dreadmine.cs | 8 +- Projectiles/Summon/GigaFlareFriendly.cs | 8 +- Projectiles/Summon/PrincessMissile.cs | 12 +- Projectiles/Typeless/SkyFlareFriendly.cs | 8 +- Utilities/CalamityUtils.cs | 117 +++---- 45 files changed, 408 insertions(+), 477 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index ee1294c47b..fadedcc50d 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -4344,112 +4344,105 @@ namespace CalamityMod.CalPlayer player.itemAnimation == (int)(player.itemAnimationMax * 0.7) || player.itemAnimation == (int)(player.itemAnimationMax * 0.9)) { - float num339 = 0f; - float num340 = 0f; - float num341 = 0f; - float num342 = 0f; + float yVel = 0f; + float xVel = 0f; + float yOffset = 0f; + float xOffset = 0f; if (player.itemAnimation == (int)(player.itemAnimationMax * 0.9)) { - num339 = -7f; + yVel = -7f; } if (player.itemAnimation == (int)(player.itemAnimationMax * 0.7)) { - num339 = -6f; - num340 = 2f; + yVel = -6f; + xVel = 2f; } if (player.itemAnimation == (int)(player.itemAnimationMax * 0.5)) { - num339 = -4f; - num340 = 4f; + yVel = -4f; + xVel = 4f; } if (player.itemAnimation == (int)(player.itemAnimationMax * 0.3)) { - num339 = -2f; - num340 = 6f; + yVel = -2f; + xVel = 6f; } if (player.itemAnimation == (int)(player.itemAnimationMax * 0.1)) { - num340 = 7f; + xVel = 7f; } if (player.itemAnimation == (int)(player.itemAnimationMax * 0.7)) { - num342 = 26f; + xOffset = 26f; } if (player.itemAnimation == (int)(player.itemAnimationMax * 0.3)) { - num342 -= 4f; - num341 -= 20f; + xOffset -= 4f; + yOffset -= 20f; } if (player.itemAnimation == (int)(player.itemAnimationMax * 0.1)) { - num341 += 6f; + yOffset += 6f; } if (player.direction == -1) { if (player.itemAnimation == (int)(player.itemAnimationMax * 0.9)) { - num342 -= 8f; + xOffset -= 8f; } if (player.itemAnimation == (int)(player.itemAnimationMax * 0.7)) { - num342 -= 6f; + xOffset -= 6f; } } - num339 *= 1.5f; - num340 *= 1.5f; - num342 *= (float)player.direction; - num341 *= player.gravDir; - Projectile.NewProjectile((float)(hitbox.X + hitbox.Width / 2) + num342, (float)(hitbox.Y + hitbox.Height / 2) + num341, (float)player.direction * num340, num339 * player.gravDir, ProjectileID.Mushroom, (int)(item.damage * 0.25f * player.MeleeDamage()), 0f, player.whoAmI, 0f, 0f); + yVel *= 1.5f; + xVel *= 1.5f; + xOffset *= (float)player.direction; + yOffset *= player.gravDir; + Projectile.NewProjectile((float)(hitbox.X + hitbox.Width / 2) + xOffset, (float)(hitbox.Y + hitbox.Height / 2) + yOffset, (float)player.direction * xVel, yVel * player.gravDir, ProjectileID.Mushroom, (int)(item.damage * 0.25f * player.MeleeDamage()), 0f, player.whoAmI, 0f, 0f); } } if (aWeapon) { if (Main.rand.NextBool(3)) { - int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, ModContent.DustType(), player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default, 0.75f); - } - } - if (aChicken) - { - if (Main.rand.NextBool(3)) - { - int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 244, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default, 0.75f); + Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, ModContent.DustType(), player.velocity.X * 0.2f + player.direction * 3f, player.velocity.Y * 0.2f, 100, default, 0.75f); } } if (eGauntlet) { if (Main.rand.NextBool(3)) { - int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 66, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.25f); - Main.dust[num280].noGravity = true; + int element = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 66, player.velocity.X * 0.2f + player.direction * 3f, player.velocity.Y * 0.2f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.25f); + Main.dust[element].noGravity = true; } } if (cryogenSoul) { if (Main.rand.NextBool(3)) { - int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 67, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default, 0.75f); + Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 67, player.velocity.X * 0.2f + player.direction * 3f, player.velocity.Y * 0.2f, 100, default, 0.75f); } } if (xerocSet) { if (Main.rand.NextBool(3)) { - int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 58, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default, 1.25f); + Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 58, player.velocity.X * 0.2f + player.direction * 3f, player.velocity.Y * 0.2f, 100, default, 1.25f); } } if (reaverBlast) { if (Main.rand.NextBool(3)) { - int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 74, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default, 0.75f); + Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 74, player.velocity.X * 0.2f + player.direction * 3f, player.velocity.Y * 0.2f, 100, default, 0.75f); } } if (dsSetBonus) { if (Main.rand.NextBool(3)) { - int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 27, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default, 2.5f); + Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27, player.velocity.X * 0.2f + player.direction * 3f, player.velocity.Y * 0.2f, 100, default, 2.5f); } } } @@ -4472,11 +4465,8 @@ namespace CalamityMod.CalPlayer } } } - if (!item.melee && (int) player.meleeEnchant == 7) - Projectile.NewProjectile(target.Center.X, target.Center.Y, target.velocity.X, target.velocity.Y, ProjectileID.ConfettiMelee, 0, 0f, player.whoAmI, 0f, 0f); - - if (item.melee) - titanBoost = 600; + if (!item.melee && player.meleeEnchant == 7) + Projectile.NewProjectile(target.Center, target.velocity, ProjectileID.ConfettiMelee, 0, 0f, player.whoAmI, 0f, 0f); if (omegaBlueChestplate) target.AddBuff(ModContent.BuffType(), 240); @@ -4499,6 +4489,7 @@ namespace CalamityMod.CalPlayer if (item.melee) //prevents Deep Sea Dumbell from snagging true melee debuff memes { + titanBoost = 600; if (eGauntlet) { int duration = 90; @@ -4574,9 +4565,9 @@ namespace CalamityMod.CalPlayer case 8: target.AddBuff(BuffID.Poisoned, 60 * Main.rand.Next(5, 10), false); break; - /*case 4: + case 4: target.AddBuff(BuffID.Midas, 120, false); - break;*/ + break; } if (titanHeartMask) { @@ -4770,9 +4761,9 @@ namespace CalamityMod.CalPlayer case 8: target.AddBuff(BuffID.Poisoned, 60 * Main.rand.Next(5, 10), false); break; - /*case 4: + case 4: target.AddBuff(BuffID.Midas, 120, false); - break;*/ + break; } if (etherealExtorter) { @@ -4831,11 +4822,8 @@ namespace CalamityMod.CalPlayer } } - if (!item.melee && (int) player.meleeEnchant == 7) - Projectile.NewProjectile(target.Center.X, target.Center.Y, target.velocity.X, target.velocity.Y, ProjectileID.ConfettiMelee, 0, 0f, player.whoAmI, 0f, 0f); - - if (item.melee) - titanBoost = 600; + if (!item.melee && player.meleeEnchant == 7) + Projectile.NewProjectile(target.Center, target.velocity, ProjectileID.ConfettiMelee, 0, 0f, player.whoAmI, 0f, 0f); if (omegaBlueChestplate) target.AddBuff(ModContent.BuffType(), 240); @@ -4858,6 +4846,7 @@ namespace CalamityMod.CalPlayer if (item.melee) { + titanBoost = 600; if (eGauntlet) { int duration = 90; @@ -5260,22 +5249,22 @@ namespace CalamityMod.CalPlayer { if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 3) { - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(damage * 0.15), 2f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(damage * 0.15), 2f, player.whoAmI, 0f, 0f); } } } if (unstablePrism && crit) { - for (int num252 = 0; num252 < 3; num252++) + for (int s = 0; s < 3; s++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); - while (value15.X == 0f && value15.Y == 0f) + Vector2 velocity = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); + while (velocity.X == 0f && velocity.Y == 0f) { - value15 = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); + velocity = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); } - value15.Normalize(); - value15 *= (float)Main.rand.Next(30, 61) * 0.1f; - Projectile.NewProjectile(target.Center.X, target.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(damage * 0.15), 0f, player.whoAmI, 0f, 0f); + velocity.Normalize(); + velocity *= (float)Main.rand.Next(30, 61) * 0.1f; + Projectile.NewProjectile(target.Center, velocity, ModContent.ProjectileType(), (int)(damage * 0.15), 0f, player.whoAmI); } } if (astralStarRain && crit && astralStarRainCooldown <= 0) @@ -5441,7 +5430,7 @@ namespace CalamityMod.CalPlayer if (randomChance < 15) randomChance = 15; - if (Main.rand.Next(randomChance) == 0) + if (Main.rand.NextBool(randomChance)) damageMult += 1.0; } if (silvaCountdown > 0 && hasSilvaEffect && silvaRanged && proj.ranged) @@ -5671,36 +5660,36 @@ namespace CalamityMod.CalPlayer { if (theBee && player.statLife >= player.statLifeMax2) { - Main.PlaySound(SoundID.Item, (int)proj.position.X, (int)proj.position.Y, 110); + Main.PlaySound(SoundID.Item110, proj.Center); } if (unstablePrism && crit) { - for (int num252 = 0; num252 < 3; num252++) + for (int s = 0; s < 3; s++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); - while (value15.X == 0f && value15.Y == 0f) + Vector2 velocity = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); + while (velocity.X == 0f && velocity.Y == 0f) { - value15 = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); + velocity = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); } - value15.Normalize(); - value15 *= (float)Main.rand.Next(30, 61) * 0.1f; - Projectile.NewProjectile(proj.oldPosition.X + (float)(proj.width / 2), proj.oldPosition.Y + (float)(proj.height / 2), value15.X, value15.Y, ModContent.ProjectileType(), (int)(damage * 0.15), 0f, player.whoAmI, 0f, 0f); + velocity.Normalize(); + velocity *= (float)Main.rand.Next(30, 61) * 0.1f; + Projectile.NewProjectile(target.Center, velocity, ModContent.ProjectileType(), (int)(damage * 0.15), 0f, player.whoAmI); } } if (electricianGlove && proj.Calamity().stealthStrike && proj.Calamity().rogue) { - for (int num252 = 0; num252 < 3; num252++) + for (int s = 0; s < 3; s++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); - while (value15.X == 0f && value15.Y == 0f) + Vector2 velocity = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); + while (velocity.X == 0f && velocity.Y == 0f) { - value15 = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); + velocity = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); } - value15.Normalize(); - value15 *= (float)Main.rand.Next(30, 61) * 0.1f; - int num17 = Projectile.NewProjectile(proj.oldPosition.X + (float)(proj.width / 2), proj.oldPosition.Y + (float)(proj.height / 2), value15.X, value15.Y, ModContent.ProjectileType(), (int)(damage * 0.1), 0f, player.whoAmI, 0f, 0f); - Main.projectile[num17].Calamity().forceRogue = true; - Main.projectile[num17].localNPCHitCooldown = -1; + velocity.Normalize(); + velocity *= (float)Main.rand.Next(30, 61) * 0.1f; + int spark = Projectile.NewProjectile(target.Center, velocity, ModContent.ProjectileType(), (int)(damage * 0.1), 0f, player.whoAmI); + Main.projectile[spark].Calamity().forceRogue = true; + Main.projectile[spark].localNPCHitCooldown = -1; } } if (astralStarRain && crit && astralStarRainCooldown <= 0) @@ -5719,18 +5708,17 @@ namespace CalamityMod.CalPlayer } if (tarraRanged && crit && proj.ranged) { - int num251 = Main.rand.Next(2, 4); - for (int num252 = 0; num252 < num251; num252++) + int leafAmt = Main.rand.Next(2, 4); + for (int l = 0; l < leafAmt; l++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) + Vector2 velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (velocity.X == 0f && velocity.Y == 0f) { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int FUCKYOU = Projectile.NewProjectile(target.position.X + (float)(target.width / 2), target.position.Y + (float)(target.height / 2), - value15.X, value15.Y, ProjectileID.Leaf, (int)(damage * 0.25), 0f, player.whoAmI, 0f, 0f); + velocity.Normalize(); + velocity *= (float)Main.rand.Next(70, 101) * 0.1f; + int FUCKYOU = Projectile.NewProjectile(target.Center, velocity, ProjectileID.Leaf, (int)(damage * 0.25), 0f, player.whoAmI); Main.projectile[FUCKYOU].Calamity().forceTypeless = true; Main.projectile[FUCKYOU].netUpdate = true; } @@ -5739,22 +5727,22 @@ namespace CalamityMod.CalPlayer { if (target.canGhostHeal) { - float num11 = 0.03f; - num11 -= (float)proj.numHits * 0.015f; - if (num11 < 0f) + float projHitMult = 0.03f; + projHitMult -= (float)proj.numHits * 0.015f; + if (projHitMult < 0f) { - num11 = 0f; + projHitMult = 0f; } - float num12 = (float)proj.damage * num11; - if (num12 < 0f) + float cooldownMult = proj.damage * projHitMult; + if (cooldownMult < 0f) { - num12 = 0f; + cooldownMult = 0f; } if (player.lifeSteal > 0f) { player.statLife += 1; player.HealEffect(1); - player.lifeSteal -= num12 * 2f; + player.lifeSteal -= cooldownMult * 2f; } } } @@ -5763,22 +5751,21 @@ namespace CalamityMod.CalPlayer bloodflareMageCooldown = 120; for (int i = 0; i < 3; i++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) + Vector2 velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (velocity.X == 0f && velocity.Y == 0f) { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int fire = Projectile.NewProjectile(target.position.X + (float)(target.width / 2), target.position.Y + (float)(target.height / 2), - value15.X, value15.Y, ProjectileID.BallofFire, (int)(damage * 0.5), 0f, player.whoAmI, 0f, 0f); + velocity.Normalize(); + velocity *= (float)Main.rand.Next(70, 101) * 0.1f; + int fire = Projectile.NewProjectile(target.Center, velocity, ProjectileID.BallofFire, (int)(damage * 0.5), 0f, player.whoAmI); Main.projectile[fire].Calamity().forceTypeless = true; Main.projectile[fire].netUpdate = true; } } if (umbraphileSet && proj.Calamity().rogue && (Main.rand.NextBool(4) || proj.Calamity().stealthStrike) && proj.type != ModContent.ProjectileType()) { - Projectile.NewProjectile(proj.Center.X, proj.Center.Y, 0f, 0f, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(proj.damage * 0.25, 50), 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(proj.Center, Vector2.Zero, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(proj.damage * 0.25, 50), 0f, player.whoAmI); } if (bloodflareMelee && isTrueMelee) { @@ -6945,7 +6932,7 @@ namespace CalamityMod.CalPlayer { if (sulfurSet && !proj.friendly) { - if (Main.player[proj.owner] == null) + if (Main.player[proj.owner] is null) { if (!Main.npc[proj.owner].friendly) Main.npc[proj.owner].AddBuff(BuffID.Poisoned, 120); @@ -7487,76 +7474,48 @@ namespace CalamityMod.CalPlayer { Main.PlaySound(SoundID.NPCKilled, (int)player.position.X, (int)player.position.Y, 14); player.AddBuff(ModContent.BuffType(), 10830); - for (int num621 = 0; num621 < 20; num621++) + for (int d = 0; d < 20; d++) { - int num622 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 31, 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 3f; + int dust = Dust.NewDust(player.position, player.width, player.height, 31, 0f, 0f, 100, default, 2f); + Main.dust[dust].velocity *= 3f; if (Main.rand.NextBool(2)) { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[dust].scale = 0.5f; + Main.dust[dust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - for (int num623 = 0; num623 < 35; num623++) + for (int d = 0; d < 35; d++) { - int num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 6, 0f, 0f, 100, default, 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 6, 0f, 0f, 100, default, 2f); - Main.dust[num624].velocity *= 2f; - } - for (int num625 = 0; num625 < 3; num625++) - { - float scaleFactor10 = 0.33f; - if (num625 == 1) - { - scaleFactor10 = 0.66f; - } - if (num625 == 2) - { - scaleFactor10 = 1f; - } - int num626 = Gore.NewGore(new Vector2(player.position.X + (float)(player.width / 2) - 24f, player.position.Y + (float)(player.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Gore gore = Main.gore[num626]; - gore.velocity *= scaleFactor10; - gore.velocity.X += 1f; - gore.velocity.Y += 1f; - num626 = Gore.NewGore(new Vector2(player.position.X + (float)(player.width / 2) - 24f, player.position.Y + (float)(player.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - gore.velocity *= scaleFactor10; - gore.velocity.X -= 1f; - gore.velocity.Y += 1f; - num626 = Gore.NewGore(new Vector2(player.position.X + (float)(player.width / 2) - 24f, player.position.Y + (float)(player.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - gore.velocity *= scaleFactor10; - gore.velocity.X += 1f; - gore.velocity.Y -= 1f; - num626 = Gore.NewGore(new Vector2(player.position.X + (float)(player.width / 2) - 24f, player.position.Y + (float)(player.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - gore.velocity *= scaleFactor10; - gore.velocity.X -= 1f; - gore.velocity.Y -= 1f; + int fire = Dust.NewDust(player.position, player.width, player.height, DustID.Fire, 0f, 0f, 100, default, 3f); + Main.dust[fire].noGravity = true; + Main.dust[fire].velocity *= 5f; + fire = Dust.NewDust(player.position, player.width, player.height, DustID.Fire, 0f, 0f, 100, default, 2f); + Main.dust[fire].velocity *= 2f; } + CalamityUtils.ExplosionGores(player.Center, 3); } } if (sirenIce) { - Main.PlaySound(SoundID.NPCKilled, (int)player.position.X, (int)player.position.Y, 7); + Main.PlaySound(SoundID.NPCKilled7, player.Center); player.AddBuff(ModContent.BuffType(), 1800); - for (int num621 = 0; num621 < 10; num621++) + for (int d = 0; d < 10; d++) { - int num622 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 67, 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 3f; + int ice = Dust.NewDust(player.position, player.width, player.height, 67, 0f, 0f, 100, default, 2f); + Main.dust[ice].velocity *= 3f; if (Main.rand.NextBool(2)) { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[ice].scale = 0.5f; + Main.dust[ice].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - for (int num623 = 0; num623 < 15; num623++) + for (int d = 0; d < 15; d++) { - int num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 67, 0f, 0f, 100, default, 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 67, 0f, 0f, 100, default, 2f); - Main.dust[num624].velocity *= 2f; + int ice = Dust.NewDust(player.position, player.width, player.height, 67, 0f, 0f, 100, default, 3f); + Main.dust[ice].noGravity = true; + Main.dust[ice].velocity *= 5f; + ice = Dust.NewDust(player.position, player.width, player.height, 67, 0f, 0f, 100, default, 2f); + Main.dust[ice].velocity *= 2f; } } if (tarraMelee) @@ -7582,24 +7541,24 @@ namespace CalamityMod.CalPlayer { if (Main.npc[m].active && !Main.npc[m].friendly) { - float distance = (Main.npc[m].Center - player.Center).Length(); - float num10 = (float)Main.rand.Next(200 + (int)damage / 2, 301 + (int)damage * 2); - if (num10 > 500f) + float npcDist = (Main.npc[m].Center - player.Center).Length(); + float freezeDist = (float)Main.rand.Next(200 + (int)damage / 2, 301 + (int)damage * 2); + if (freezeDist > 500f) { - num10 = 500f + (num10 - 500f) * 0.75f; + freezeDist = 500f + (freezeDist - 500f) * 0.75f; } - if (num10 > 700f) + if (freezeDist > 700f) { - num10 = 700f + (num10 - 700f) * 0.5f; + freezeDist = 700f + (freezeDist - 700f) * 0.5f; } - if (num10 > 900f) + if (freezeDist > 900f) { - num10 = 900f + (num10 - 900f) * 0.25f; + freezeDist = 900f + (freezeDist - 900f) * 0.25f; } - if (distance < num10) + if (npcDist < freezeDist) { - float num11 = (float)Main.rand.Next(90 + (int)damage / 3, 240 + (int)damage / 2); - Main.npc[m].AddBuff(ModContent.BuffType(), (int)num11, false); + float duration = (float)Main.rand.Next(90 + (int)damage / 3, 240 + (int)damage / 2); + Main.npc[m].AddBuff(ModContent.BuffType(), (int)duration, false); } } } diff --git a/NPCs/Astral/AstralProbe.cs b/NPCs/Astral/AstralProbe.cs index f3e28b000e..a89a6f9d38 100644 --- a/NPCs/Astral/AstralProbe.cs +++ b/NPCs/Astral/AstralProbe.cs @@ -251,31 +251,28 @@ namespace CalamityMod.NPCs.Astral if (npc.life <= 0) { - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); - npc.width = 30; - npc.height = 30; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); - for (int num621 = 0; num621 < 5; num621++) + npc.position = npc.Center; + npc.width = npc.height = 30; + npc.Center = npc.position; + for (int d = 0; d < 5; d++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 3f; + int purple = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); + Main.dust[purple].velocity *= 3f; if (Main.rand.NextBool(2)) { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[purple].scale = 0.5f; + Main.dust[purple].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - for (int num623 = 0; num623 < 10; num623++) + for (int d = 0; d < 10; d++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); - Main.dust[num624].velocity *= 2f; + int cosmos = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 3f); + Main.dust[cosmos].noGravity = true; + Main.dust[cosmos].velocity *= 5f; + cosmos = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); + Main.dust[cosmos].velocity *= 2f; } - npc.ExplosionGores(3); + CalamityUtils.ExplosionGores(npc.Center, 3); } } diff --git a/NPCs/NormalNPCs/Horse.cs b/NPCs/NormalNPCs/Horse.cs index aff5a9041d..8c4860a721 100644 --- a/NPCs/NormalNPCs/Horse.cs +++ b/NPCs/NormalNPCs/Horse.cs @@ -156,7 +156,7 @@ namespace CalamityMod.NPCs.NormalNPCs num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Fire, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - npc.ExplosionGores(3); + CalamityUtils.ExplosionGores(npc.Center, 3); } } diff --git a/NPCs/StormWeaver/StasisProbe.cs b/NPCs/StormWeaver/StasisProbe.cs index db38ddb1e9..1e63414de2 100644 --- a/NPCs/StormWeaver/StasisProbe.cs +++ b/NPCs/StormWeaver/StasisProbe.cs @@ -235,7 +235,7 @@ namespace CalamityMod.NPCs.StormWeaver Main.dust[num624].velocity *= 2f; } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StasisProbe1"),1f); - npc.ExplosionGores(1); + CalamityUtils.ExplosionGores(npc.Center, 1); } } diff --git a/NPCs/StormWeaver/StasisProbeNaked.cs b/NPCs/StormWeaver/StasisProbeNaked.cs index b62fc886a2..09e1aa93b4 100644 --- a/NPCs/StormWeaver/StasisProbeNaked.cs +++ b/NPCs/StormWeaver/StasisProbeNaked.cs @@ -235,7 +235,7 @@ namespace CalamityMod.NPCs.StormWeaver Main.dust[num624].velocity *= 2f; } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StasisProbeNaked1"), 1f); - npc.ExplosionGores(1); + CalamityUtils.ExplosionGores(npc.Center, 1); } } diff --git a/Projectiles/Boss/FlareBomb.cs b/Projectiles/Boss/FlareBomb.cs index 678ce0689a..00b8164505 100644 --- a/Projectiles/Boss/FlareBomb.cs +++ b/Projectiles/Boss/FlareBomb.cs @@ -144,7 +144,7 @@ namespace CalamityMod.Projectiles.Boss projectile.Damage(); for (int num621 = 0; num621 < 3; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -154,13 +154,13 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 5; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } public override void OnHitPlayer(Player target, int damage, bool crit) diff --git a/Projectiles/Boss/FlareDust.cs b/Projectiles/Boss/FlareDust.cs index 8f5553b635..ef1fb85b8e 100644 --- a/Projectiles/Boss/FlareDust.cs +++ b/Projectiles/Boss/FlareDust.cs @@ -127,7 +127,7 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 2; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -137,13 +137,13 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 4; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); projectile.damage = Main.expertMode ? 75 : 90; projectile.Damage(); } diff --git a/Projectiles/Boss/FlareDust2.cs b/Projectiles/Boss/FlareDust2.cs index 2443e6de78..ff2ed24cc2 100644 --- a/Projectiles/Boss/FlareDust2.cs +++ b/Projectiles/Boss/FlareDust2.cs @@ -137,7 +137,7 @@ namespace CalamityMod.Projectiles.Boss projectile.Damage(); for (int num621 = 0; num621 < 2; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -147,13 +147,13 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 4; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } public override void OnHitPlayer(Player target, int damage, bool crit) diff --git a/Projectiles/Boss/HiveBombGoliath.cs b/Projectiles/Boss/HiveBombGoliath.cs index 706050c1d3..383f5dfa4a 100644 --- a/Projectiles/Boss/HiveBombGoliath.cs +++ b/Projectiles/Boss/HiveBombGoliath.cs @@ -62,13 +62,13 @@ namespace CalamityMod.Projectiles.Boss } else if (Main.rand.NextBool(4)) { - int num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 0.5f); + int num252 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 0.5f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2)).RotatedBy((double)projectile.rotation, default) * 1.1f; Main.rand.Next(2); - num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); + num252 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default) * 1.1f; @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Boss Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 8; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -107,13 +107,13 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 89, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } public override void OnHitPlayer(Player target, int damage, bool crit) diff --git a/Projectiles/Boss/ScavengerNuke.cs b/Projectiles/Boss/ScavengerNuke.cs index 9b78527422..7eb944406a 100644 --- a/Projectiles/Boss/ScavengerNuke.cs +++ b/Projectiles/Boss/ScavengerNuke.cs @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Boss projectile.Damage(); for (int num621 = 0; num621 < 30; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -114,13 +114,13 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 40; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } } } diff --git a/Projectiles/Enemy/EarthRockBig.cs b/Projectiles/Enemy/EarthRockBig.cs index 5da084e7a8..d1d35e7c7f 100644 --- a/Projectiles/Enemy/EarthRockBig.cs +++ b/Projectiles/Enemy/EarthRockBig.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Enemy projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 15; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 8, 0f, 0f, 100, default, 1.2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 8, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -71,13 +71,13 @@ namespace CalamityMod.Projectiles.Enemy } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 1, 0f, 0f, 100, default, 1.7f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 1, 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 8, 0f, 0f, 100, default, 1f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 8, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } public override void OnHitPlayer(Player target, int damage, bool crit) diff --git a/Projectiles/Enemy/EarthRockSmall.cs b/Projectiles/Enemy/EarthRockSmall.cs index 98e51b084c..23f4b6378d 100644 --- a/Projectiles/Enemy/EarthRockSmall.cs +++ b/Projectiles/Enemy/EarthRockSmall.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Enemy projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 8, 0f, 0f, 100, default, 1.2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 8, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -50,13 +50,13 @@ namespace CalamityMod.Projectiles.Enemy } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 1, 0f, 0f, 100, default, 1.7f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 1, 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 8, 0f, 0f, 100, default, 1f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 8, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } public override void OnHitPlayer(Player target, int damage, bool crit) diff --git a/Projectiles/Melee/DragonRageProj.cs b/Projectiles/Melee/DragonRageProj.cs index 671018b52f..b38af4fda1 100644 --- a/Projectiles/Melee/DragonRageProj.cs +++ b/Projectiles/Melee/DragonRageProj.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Melee projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 6; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -84,13 +84,13 @@ namespace CalamityMod.Projectiles.Melee } for (int num623 = 0; num623 < 9; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } } } diff --git a/Projectiles/Melee/Earth3.cs b/Projectiles/Melee/Earth3.cs index 5cadbb8afb..c80c727a88 100644 --- a/Projectiles/Melee/Earth3.cs +++ b/Projectiles/Melee/Earth3.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Melee projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -105,13 +105,13 @@ namespace CalamityMod.Projectiles.Melee } for (int num623 = 0; num623 < 35; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/GalileosPlanet.cs b/Projectiles/Melee/GalileosPlanet.cs index 800ba661f9..3853e7760b 100644 --- a/Projectiles/Melee/GalileosPlanet.cs +++ b/Projectiles/Melee/GalileosPlanet.cs @@ -130,7 +130,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num21].velocity *= 2; } } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Ranged/BeeRPG.cs b/Projectiles/Ranged/BeeRPG.cs index a5d6284419..715177685a 100644 --- a/Projectiles/Ranged/BeeRPG.cs +++ b/Projectiles/Ranged/BeeRPG.cs @@ -52,13 +52,13 @@ namespace CalamityMod.Projectiles.Ranged } else if (Main.rand.NextBool(2)) { - int num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 1f); + int num252 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2)).RotatedBy((double)projectile.rotation, default) * 1.1f; Main.rand.Next(2); - num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); + num252 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default) * 1.1f; @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Ranged Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 14); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -134,13 +134,13 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Ranged/BigNuke.cs b/Projectiles/Ranged/BigNuke.cs index 616e02a28b..ded24101f6 100644 --- a/Projectiles/Ranged/BigNuke.cs +++ b/Projectiles/Ranged/BigNuke.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Ranged Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 14); for (int num621 = 0; num621 < 90; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -81,13 +81,13 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 180; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(9); + CalamityUtils.ExplosionGores(projectile.Center, 9); } } } diff --git a/Projectiles/Ranged/CardDiamond.cs b/Projectiles/Ranged/CardDiamond.cs index 2fdbf43907..ccc514c942 100644 --- a/Projectiles/Ranged/CardDiamond.cs +++ b/Projectiles/Ranged/CardDiamond.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.spriteDirection = projectile.direction; if (Main.rand.NextBool(2)) { - int num137 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), 1, 1, 30, 0f, 0f, 0, default, 0.5f); + int num137 = Dust.NewDust(projectile.position, 1, 1, 30, 0f, 0f, 0, default, 0.5f); Main.dust[num137].velocity *= 0f; Main.dust[num137].noGravity = true; } @@ -53,33 +53,31 @@ namespace CalamityMod.Projectiles.Ranged { projectile.position = projectile.Center; projectile.width = projectile.height = 50; - 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.Center = projectile.position; + projectile.maxPenetrate = projectile.penetrate = -1; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(SoundID.Item14, (int)projectile.Center.X, (int)projectile.Center.Y); - for (int num621 = 0; num621 < 10; num621++) + Main.PlaySound(SoundID.Item14, projectile.Center); + for (int d = 0; d < 10; d++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 30, 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 3f; + int paper = Dust.NewDust(projectile.position, projectile.width, projectile.height, 30, 0f, 0f, 100, default, 2f); + Main.dust[paper].velocity *= 3f; if (Main.rand.NextBool(2)) { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[paper].scale = 0.5f; + Main.dust[paper].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - for (int num623 = 0; num623 < 15; num623++) + for (int d = 0; d < 15; d++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 30, 0f, 0f, 100, default, 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 30, 0f, 0f, 100, default, 2f); - Main.dust[num624].velocity *= 2f; + int paper = Dust.NewDust(projectile.position, projectile.width, projectile.height, 30, 0f, 0f, 100, default, 3f); + Main.dust[paper].noGravity = true; + Main.dust[paper].velocity *= 5f; + paper = Dust.NewDust(projectile.position, projectile.width, projectile.height, 30, 0f, 0f, 100, default, 2f); + Main.dust[paper].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Ranged/ElysianArrowProj.cs b/Projectiles/Ranged/ElysianArrowProj.cs index c1549dff6d..484e84d68c 100644 --- a/Projectiles/Ranged/ElysianArrowProj.cs +++ b/Projectiles/Ranged/ElysianArrowProj.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.Damage(); for (int num621 = 0; num621 < 2; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -67,13 +67,13 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 6; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); float x = projectile.position.X + (float)Main.rand.Next(-400, 400); float y = projectile.position.Y - (float)Main.rand.Next(500, 800); Vector2 vector = new Vector2(x, y); diff --git a/Projectiles/Ranged/GoliathRocket.cs b/Projectiles/Ranged/GoliathRocket.cs index ec81057cfc..1d7a314a2e 100644 --- a/Projectiles/Ranged/GoliathRocket.cs +++ b/Projectiles/Ranged/GoliathRocket.cs @@ -67,13 +67,13 @@ namespace CalamityMod.Projectiles.Ranged } else if (Main.rand.NextBool(2)) { - int num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 1f); + int num252 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2)).RotatedBy((double)projectile.rotation, default) * 1.1f; Main.rand.Next(2); - num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); + num252 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default) * 1.1f; @@ -140,7 +140,7 @@ namespace CalamityMod.Projectiles.Ranged Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -150,13 +150,13 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Ranged/HandheldTankShell.cs b/Projectiles/Ranged/HandheldTankShell.cs index 45df4038f5..428e03643e 100644 --- a/Projectiles/Ranged/HandheldTankShell.cs +++ b/Projectiles/Ranged/HandheldTankShell.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Ranged void SpawnExplosionDust() { // Sparks and such - Vector2 corner = new Vector2(projectile.position.X, projectile.position.Y); + Vector2 corner = projectile.position; for (int i = 0; i < 40; i++) { int idx = Dust.NewDust(corner, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); @@ -127,7 +127,7 @@ namespace CalamityMod.Projectiles.Ranged } // Smoke, which counts as a Gore - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } } } diff --git a/Projectiles/Ranged/HiveBomb.cs b/Projectiles/Ranged/HiveBomb.cs index 5505a6dfe6..40452af1b9 100644 --- a/Projectiles/Ranged/HiveBomb.cs +++ b/Projectiles/Ranged/HiveBomb.cs @@ -67,13 +67,13 @@ namespace CalamityMod.Projectiles.Ranged } else if (Main.rand.NextBool(2)) { - int num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 1f); + int num252 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2)).RotatedBy((double)projectile.rotation, default) * 1.1f; Main.rand.Next(2); - num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); + num252 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default) * 1.1f; @@ -140,7 +140,7 @@ namespace CalamityMod.Projectiles.Ranged Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -150,13 +150,13 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 89, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Ranged/HiveMissile.cs b/Projectiles/Ranged/HiveMissile.cs index d906d4be11..f765cf2c87 100644 --- a/Projectiles/Ranged/HiveMissile.cs +++ b/Projectiles/Ranged/HiveMissile.cs @@ -67,13 +67,13 @@ namespace CalamityMod.Projectiles.Ranged } else if (Main.rand.NextBool(2)) { - int num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 1f); + int num252 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2)).RotatedBy((double)projectile.rotation, default) * 1.1f; Main.rand.Next(2); - num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); + num252 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default) * 1.1f; @@ -140,7 +140,7 @@ namespace CalamityMod.Projectiles.Ranged Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 90, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 90, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -150,13 +150,13 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 90, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 90, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 90, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 90, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } } } diff --git a/Projectiles/Ranged/MagnomalyRocket.cs b/Projectiles/Ranged/MagnomalyRocket.cs index 358748903c..9f417ae7ac 100644 --- a/Projectiles/Ranged/MagnomalyRocket.cs +++ b/Projectiles/Ranged/MagnomalyRocket.cs @@ -21,10 +21,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetDefaults() { - projectile.width = 22; - projectile.height = 22; + projectile.width = projectile.height = 22; projectile.friendly = true; - projectile.penetrate = 1; projectile.timeLeft = 300; projectile.ranged = true; projectile.tileCollide = false; @@ -42,7 +40,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.frame++; projectile.frameCounter = 0; } - if (projectile.frame >= 4) + if (projectile.frame >= Main.projFrames[projectile.type]) { projectile.frame = 0; } @@ -51,33 +49,33 @@ namespace CalamityMod.Projectiles.Ranged projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + MathHelper.ToRadians(90) * projectile.direction; - int num297 = Main.rand.NextBool(2) ? 107 : 234; + int dustType = Main.rand.NextBool(2) ? 107 : 234; if (Main.rand.NextBool(4)) { - num297 = 269; + dustType = 269; } if (projectile.owner == Main.myPlayer && !spawnedAura) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(projectile.damage * 0.5f), projectile.knockBack * 0.5f, projectile.owner, projectile.identity, 0f); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.5f), projectile.knockBack * 0.5f, projectile.owner, projectile.identity, 0f); spawnedAura = true; } - float num247 = projectile.velocity.X * 0.5f; - float num248 = projectile.velocity.Y * 0.5f; + float dustOffsetX = projectile.velocity.X * 0.5f; + float dustOffsetY = projectile.velocity.Y * 0.5f; if (Main.rand.NextBool(2)) { - int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, num297, 0f, 0f, 100, default, 0.5f); - Main.dust[num249].scale *= (float)Main.rand.Next(10) * 0.1f; - Main.dust[num249].velocity *= 0.2f; - Main.dust[num249].noGravity = true; - Main.dust[num249].noLight = true; + int exo = Dust.NewDust(new Vector2(projectile.position.X + 3f + dustOffsetX, projectile.position.Y + 3f + dustOffsetY) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, dustType, 0f, 0f, 100, default, 0.5f); + Main.dust[exo].scale *= (float)Main.rand.Next(10) * 0.1f; + Main.dust[exo].velocity *= 0.2f; + Main.dust[exo].noGravity = true; + Main.dust[exo].noLight = true; } else { - int dust2 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, num297, 0f, 0f, 100, default, 0.25f); - Main.dust[dust2].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; - Main.dust[dust2].velocity *= 0.05f; - Main.dust[dust2].noGravity = true; - Main.dust[dust2].noLight = true; + int exo = Dust.NewDust(new Vector2(projectile.position.X + 3f + dustOffsetX, projectile.position.Y + 3f + dustOffsetY) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, dustType, 0f, 0f, 100, default, 0.25f); + Main.dust[exo].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; + Main.dust[exo].velocity *= 0.05f; + Main.dust[exo].noGravity = true; + Main.dust[exo].noLight = true; } CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 600f, 16f, 20f); } @@ -88,39 +86,38 @@ namespace CalamityMod.Projectiles.Ranged { projectile.position = projectile.Center; projectile.width = projectile.height = 192; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.Center = projectile.position; Main.PlaySound(SoundID.Item14, projectile.position); //DO NOT REMOVE THIS PROJECTILE - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - int num298 = Main.rand.NextBool(2) ? 107 : 234; + int dustType = Main.rand.NextBool(2) ? 107 : 234; if (Main.rand.NextBool(4)) { - num298 = 269; + dustType = 269; } - for (int num621 = 0; num621 < 30; num621++) + for (int d = 0; d < 30; d++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num298, 0f, 0f, 100, default, 1f); - Main.dust[num622].velocity *= 3f; - Main.dust[num622].noGravity = true; - Main.dust[num622].noLight = true; + int exo = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 1f); + Main.dust[exo].velocity *= 3f; + Main.dust[exo].noGravity = true; + Main.dust[exo].noLight = true; if (Main.rand.NextBool(2)) { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[exo].scale = 0.5f; + Main.dust[exo].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - for (int num623 = 0; num623 < 40; num623++) + for (int d = 0; d < 40; d++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num298, 0f, 0f, 100, default, 0.5f); - Main.dust[num624].noGravity = true; - Main.dust[num624].noLight = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num298, 0f, 0f, 100, default, 0.75f); - Main.dust[num624].velocity *= 2f; + int exo = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 0.5f); + Main.dust[exo].noGravity = true; + Main.dust[exo].noLight = true; + Main.dust[exo].velocity *= 5f; + exo = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 0.75f); + Main.dust[exo].velocity *= 2f; } - projectile.ExplosionGores(10); + CalamityUtils.ExplosionGores(projectile.Center, 9); } } @@ -131,6 +128,34 @@ namespace CalamityMod.Projectiles.Ranged } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + OnHitEffects(); + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + + public override void OnHitPvp(NPC target, int damage, bool crit) + { + OnHitEffects(); + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + + private void OnHitEffects() { if (projectile.owner == Main.myPlayer) { @@ -145,15 +170,6 @@ namespace CalamityMod.Projectiles.Ranged int proj2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage / 4, projectile.knockBack / 4, projectile.owner, 0f, 1f); } } - target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.Ichor, 120); } } } diff --git a/Projectiles/Ranged/MiniRocket.cs b/Projectiles/Ranged/MiniRocket.cs index a627006b3f..4f328eebd1 100644 --- a/Projectiles/Ranged/MiniRocket.cs +++ b/Projectiles/Ranged/MiniRocket.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Ranged Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -88,13 +88,13 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } } } diff --git a/Projectiles/Ranged/MortarRoundProj.cs b/Projectiles/Ranged/MortarRoundProj.cs index e5c727f691..6c6ff512d8 100644 --- a/Projectiles/Ranged/MortarRoundProj.cs +++ b/Projectiles/Ranged/MortarRoundProj.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Ranged Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -99,13 +99,13 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); if (projectile.owner == Main.myPlayer) { int num814 = 5; diff --git a/Projectiles/Ranged/NapalmArrowProj.cs b/Projectiles/Ranged/NapalmArrowProj.cs index 61d1a7012e..c9bed216bd 100644 --- a/Projectiles/Ranged/NapalmArrowProj.cs +++ b/Projectiles/Ranged/NapalmArrowProj.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Ranged fire = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Fire, 0f, 0f, 100, default, 2f); Main.dust[fire].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); if (projectile.owner == Main.myPlayer) { for (int i = 0; i < 3; i++) diff --git a/Projectiles/Ranged/Nuke.cs b/Projectiles/Ranged/Nuke.cs index d29d635ad9..304f24dcad 100644 --- a/Projectiles/Ranged/Nuke.cs +++ b/Projectiles/Ranged/Nuke.cs @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Ranged Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -113,13 +113,13 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 60; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(10); + CalamityUtils.ExplosionGores(projectile.Center, 10); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Ranged/RubberMortarRoundProj.cs b/Projectiles/Ranged/RubberMortarRoundProj.cs index 0ed94ee191..644d747b8b 100644 --- a/Projectiles/Ranged/RubberMortarRoundProj.cs +++ b/Projectiles/Ranged/RubberMortarRoundProj.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Ranged Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -99,13 +99,13 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); if (projectile.owner == Main.myPlayer) { int num814 = 5; @@ -229,7 +229,7 @@ namespace CalamityMod.Projectiles.Ranged Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -239,10 +239,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) diff --git a/Projectiles/Rogue/BallisticPoisonBombProj.cs b/Projectiles/Rogue/BallisticPoisonBombProj.cs index 2cd7f8ad45..767b344b2b 100644 --- a/Projectiles/Rogue/BallisticPoisonBombProj.cs +++ b/Projectiles/Rogue/BallisticPoisonBombProj.cs @@ -136,7 +136,7 @@ namespace CalamityMod.Projectiles.Rogue } for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 14, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 14, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -146,13 +146,13 @@ namespace CalamityMod.Projectiles.Rogue } for (int num623 = 0; num623 < 9; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Rogue/BettyExplosion.cs b/Projectiles/Rogue/BettyExplosion.cs index d0d71d8722..29f5e8bfc3 100644 --- a/Projectiles/Rogue/BettyExplosion.cs +++ b/Projectiles/Rogue/BettyExplosion.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Rogue void SpawnExplosionDust() { // Sparks and such - Vector2 corner = new Vector2(projectile.position.X, projectile.position.Y); + Vector2 corner = projectile.position; for (int i = 0; i < 15; i++) { int idx = Dust.NewDust(corner, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Rogue } // Smoke, which counts as a Gore - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } } diff --git a/Projectiles/Rogue/CraniumSMASH.cs b/Projectiles/Rogue/CraniumSMASH.cs index 33c2da5aa8..7da9b66221 100644 --- a/Projectiles/Rogue/CraniumSMASH.cs +++ b/Projectiles/Rogue/CraniumSMASH.cs @@ -36,10 +36,10 @@ namespace CalamityMod.Projectiles.Rogue void SpawnExplosionDust() { Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); for (int num194 = 0; num194 < 25; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 135, 0f, 0f, 100, default, 2f); + int num195 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 135, 0f, 0f, 100, default, 2f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 0f; } diff --git a/Projectiles/Rogue/CraniumSmasherExplosive.cs b/Projectiles/Rogue/CraniumSmasherExplosive.cs index 98e1f41f97..41d1d816d9 100644 --- a/Projectiles/Rogue/CraniumSmasherExplosive.cs +++ b/Projectiles/Rogue/CraniumSmasherExplosive.cs @@ -47,10 +47,10 @@ namespace CalamityMod.Projectiles.Rogue projectile.localNPCHitCooldown = 10; projectile.Damage(); Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); for (int num194 = 0; num194 < 25; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 135, 0f, 0f, 100, default, 2f); + int num195 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 135, 0f, 0f, 100, default, 2f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 0f; } diff --git a/Projectiles/Rogue/CraniumSmasherStealth.cs b/Projectiles/Rogue/CraniumSmasherStealth.cs index 6b68e13ac9..7e616a124d 100644 --- a/Projectiles/Rogue/CraniumSmasherStealth.cs +++ b/Projectiles/Rogue/CraniumSmasherStealth.cs @@ -68,10 +68,10 @@ namespace CalamityMod.Projectiles.Rogue projectile.localNPCHitCooldown = 10; projectile.Damage(); Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); for (int num194 = 0; num194 < 25; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 135, 0f, 0f, 100, default, 2f); + int num195 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 135, 0f, 0f, 100, default, 2f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 0f; } diff --git a/Projectiles/Rogue/DestructionBolt.cs b/Projectiles/Rogue/DestructionBolt.cs index e0fd35b20f..f90577c3fa 100644 --- a/Projectiles/Rogue/DestructionBolt.cs +++ b/Projectiles/Rogue/DestructionBolt.cs @@ -151,7 +151,7 @@ namespace CalamityMod.Projectiles.Rogue Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -161,13 +161,13 @@ namespace CalamityMod.Projectiles.Rogue } for (int num623 = 0; num623 < 45; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(9); + CalamityUtils.ExplosionGores(projectile.Center, 9); } } } diff --git a/Projectiles/Rogue/DragonShit.cs b/Projectiles/Rogue/DragonShit.cs index 9786df44db..1c098b42a1 100644 --- a/Projectiles/Rogue/DragonShit.cs +++ b/Projectiles/Rogue/DragonShit.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -97,13 +97,13 @@ namespace CalamityMod.Projectiles.Rogue } for (int num623 = 0; num623 < 8; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); diff --git a/Projectiles/Rogue/PlaguenadeProj.cs b/Projectiles/Rogue/PlaguenadeProj.cs index 99e82b2e9e..3ff3bbec5e 100644 --- a/Projectiles/Rogue/PlaguenadeProj.cs +++ b/Projectiles/Rogue/PlaguenadeProj.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.Damage(); for (int i = 0; i < 10; i++) { - int smoke = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); + int smoke = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[smoke].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -105,13 +105,13 @@ namespace CalamityMod.Projectiles.Rogue } for (int j = 0; j < 15; j++) { - int plague = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 3f); + int plague = Dust.NewDust(projectile.position, projectile.width, projectile.height, 89, 0f, 0f, 100, default, 3f); Main.dust[plague].noGravity = true; Main.dust[plague].velocity *= 5f; - int fire = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, DustID.Fire, 0f, 0f, 100, default, 2f); + int fire = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Fire, 0f, 0f, 100, default, 2f); Main.dust[fire].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } } diff --git a/Projectiles/Rogue/SeafoamBombProj.cs b/Projectiles/Rogue/SeafoamBombProj.cs index 7bfc7c6cab..f2b34c0c49 100644 --- a/Projectiles/Rogue/SeafoamBombProj.cs +++ b/Projectiles/Rogue/SeafoamBombProj.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.NewProjectile(posX, posY, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.4), 0f, projectile.owner, 0f, 0f); } - projectile.ExplosionGores((projectile.Calamity().stealthStrike ? 6 : 3)); + CalamityUtils.ExplosionGores(projectile.Center, (projectile.Calamity().stealthStrike ? 6 : 3)); } } } diff --git a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs index 0493a92685..2120ecd134 100644 --- a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs +++ b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs @@ -62,10 +62,10 @@ namespace CalamityMod.Projectiles.Rogue int timesToSpawnDust = projectile.Calamity().stealthStrike ? 2 : 1; for (int i = 0; i < timesToSpawnDust; i++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, projectile.Calamity().stealthStrike ? 1.8f : 1.3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 127, 0f, 0f, 100, default, projectile.Calamity().stealthStrike ? 1.8f : 1.3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, projectile.Calamity().stealthStrike ? 1.8f : 1.3f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 127, 0f, 0f, 100, default, projectile.Calamity().stealthStrike ? 1.8f : 1.3f); Main.dust[num624].velocity *= 2f; } } @@ -191,7 +191,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 4; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -201,14 +201,14 @@ namespace CalamityMod.Projectiles.Rogue } for (int num623 = 0; num623 < 12; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } } } diff --git a/Projectiles/Rogue/SupernovaBomb.cs b/Projectiles/Rogue/SupernovaBomb.cs index 8895f911ff..fa4ad25eee 100644 --- a/Projectiles/Rogue/SupernovaBomb.cs +++ b/Projectiles/Rogue/SupernovaBomb.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Rogue } for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num298, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num298, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -131,15 +131,15 @@ namespace CalamityMod.Projectiles.Rogue } for (int num623 = 0; num623 < 9; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } //gore cloud effects - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Summon/Dreadmine.cs b/Projectiles/Summon/Dreadmine.cs index ada00ded8a..3f1566d0e4 100644 --- a/Projectiles/Summon/Dreadmine.cs +++ b/Projectiles/Summon/Dreadmine.cs @@ -186,7 +186,7 @@ namespace CalamityMod.Projectiles.Summon Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -196,13 +196,13 @@ namespace CalamityMod.Projectiles.Summon } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } } } diff --git a/Projectiles/Summon/GigaFlareFriendly.cs b/Projectiles/Summon/GigaFlareFriendly.cs index 7025b4b3be..3629f9c71b 100644 --- a/Projectiles/Summon/GigaFlareFriendly.cs +++ b/Projectiles/Summon/GigaFlareFriendly.cs @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Summon projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -121,13 +121,13 @@ namespace CalamityMod.Projectiles.Summon } for (int num623 = 0; num623 < 35; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Summon/PrincessMissile.cs b/Projectiles/Summon/PrincessMissile.cs index aa74bc0fb1..ef67769255 100644 --- a/Projectiles/Summon/PrincessMissile.cs +++ b/Projectiles/Summon/PrincessMissile.cs @@ -61,13 +61,13 @@ namespace CalamityMod.Projectiles.Summon } else if (Main.rand.NextBool(4)) { - int num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 0.5f); + int num252 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 0.5f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2)).RotatedBy((double)projectile.rotation, default) * 1.1f; Main.rand.Next(2); - num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); + num252 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default) * 1.1f; @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Summon Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 8; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -108,13 +108,13 @@ namespace CalamityMod.Projectiles.Summon } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 89, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Typeless/SkyFlareFriendly.cs b/Projectiles/Typeless/SkyFlareFriendly.cs index 818f5d7898..185f408433 100644 --- a/Projectiles/Typeless/SkyFlareFriendly.cs +++ b/Projectiles/Typeless/SkyFlareFriendly.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Typeless projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 4; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -71,13 +71,13 @@ namespace CalamityMod.Projectiles.Typeless } for (int num623 = 0; num623 < 12; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - projectile.ExplosionGores(3); + CalamityUtils.ExplosionGores(projectile.Center, 3); } } } diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 6e122c890b..ba65d066b7 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -457,45 +457,6 @@ namespace CalamityMod return true; } - /// - /// Call this function in the Kill function of your npc to spawn cloud-like gores. - /// - /// The npc you're adding explosion clouds to - /// Number of times it loops to spawn gores - public static void ExplosionGores (this NPC npc, int goreAmt) - { - Vector2 goreVec = new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f); - for (int goreIndex = 0; goreIndex < goreAmt; goreIndex++) - { - float velocityMult = 0.33f; - if (goreIndex < (int)(goreAmt/3)) - { - velocityMult = 0.66f; - } - if (goreIndex >= (int)((2*goreAmt)/3)) - { - velocityMult = 1f; - } - int smoke = Gore.NewGore(goreVec, default, Main.rand.Next(61, 64), 1f); - Gore gore = Main.gore[smoke]; - gore.velocity *= velocityMult; - gore.velocity.X += 1f; - gore.velocity.Y += 1f; - smoke = Gore.NewGore(goreVec, default, Main.rand.Next(61, 64), 1f); - gore.velocity *= velocityMult; - gore.velocity.X -= 1f; - gore.velocity.Y += 1f; - smoke = Gore.NewGore(goreVec, default, Main.rand.Next(61, 64), 1f); - gore.velocity *= velocityMult; - gore.velocity.X += 1f; - gore.velocity.Y -= 1f; - smoke = Gore.NewGore(goreVec, default, Main.rand.Next(61, 64), 1f); - gore.velocity *= velocityMult; - gore.velocity.X -= 1f; - gore.velocity.Y -= 1f; - } - } - /// /// Check if an NPC is organic /// @@ -792,45 +753,6 @@ namespace CalamityMod } } - /// - /// Call this function in the Kill function of your projectile to spawn cloud-like gores. Used primarily for explosions - /// - /// The projectile you're adding explosion clouds to - /// Number of times it loops to spawn gores - public static void ExplosionGores (this Projectile projectile, int goreAmt) - { - Vector2 goreVec = new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f); - for (int goreIndex = 0; goreIndex < goreAmt; goreIndex++) - { - float velocityMult = 0.33f; - if (goreIndex < (int)(goreAmt/3)) - { - velocityMult = 0.66f; - } - if (goreIndex >= (int)((2*goreAmt)/3)) - { - velocityMult = 1f; - } - int smoke = Gore.NewGore(goreVec, default, Main.rand.Next(61, 64), 1f); - Gore gore = Main.gore[smoke]; - gore.velocity *= velocityMult; - gore.velocity.X += 1f; - gore.velocity.Y += 1f; - smoke = Gore.NewGore(goreVec, default, Main.rand.Next(61, 64), 1f); - gore.velocity *= velocityMult; - gore.velocity.X -= 1f; - gore.velocity.Y += 1f; - smoke = Gore.NewGore(goreVec, default, Main.rand.Next(61, 64), 1f); - gore.velocity *= velocityMult; - gore.velocity.X += 1f; - gore.velocity.Y -= 1f; - smoke = Gore.NewGore(goreVec, default, Main.rand.Next(61, 64), 1f); - gore.velocity *= velocityMult; - gore.velocity.X -= 1f; - gore.velocity.Y -= 1f; - } - } - /// /// Call this function in the ai of your projectile so it can stick to enemies, also requires ModifyHitNPCSticky to be called in ModifyHitNPC /// @@ -3460,6 +3382,45 @@ namespace CalamityMod public static int SecondsToFrames(float seconds) => (int)(seconds * 60); + /// + /// Call this function in the Kill function of your npc to spawn cloud-like gores. + /// + /// The spot to spawn the explosion clouds + /// Number of times it loops to spawn gores + public static void ExplosionGores (Vector2 goreSource, int goreAmt) + { + Vector2 source = new Vector2(goreSource.X - 24f, goreSource.Y - 24f); + for (int goreIndex = 0; goreIndex < goreAmt; goreIndex++) + { + float velocityMult = 0.33f; + if (goreIndex < (int)(goreAmt/3)) + { + velocityMult = 0.66f; + } + if (goreIndex >= (int)((2*goreAmt)/3)) + { + velocityMult = 1f; + } + int smoke = Gore.NewGore(source, default, Main.rand.Next(61, 64), 1f); + Gore gore = Main.gore[smoke]; + gore.velocity *= velocityMult; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; + smoke = Gore.NewGore(source, default, Main.rand.Next(61, 64), 1f); + gore.velocity *= velocityMult; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; + smoke = Gore.NewGore(source, default, Main.rand.Next(61, 64), 1f); + gore.velocity *= velocityMult; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; + smoke = Gore.NewGore(source, default, Main.rand.Next(61, 64), 1f); + gore.velocity *= velocityMult; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; + } + } + // REMOVE THIS IN CALAMITY 1.4, it's a 1.4 Main.cs function public static float GetLerpValue(float from, float to, float t, bool clamped = false) { From 4afd41ceea8d19b74a083f2a23d6d041c6d7f05c Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 16 Jul 2020 20:55:28 -0400 Subject: [PATCH 108/160] Xplizzy bandit name (patron) --- NPCs/TownNPCs/THIEF.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NPCs/TownNPCs/THIEF.cs b/NPCs/TownNPCs/THIEF.cs index 9d7f9910ce..417d4f3a62 100644 --- a/NPCs/TownNPCs/THIEF.cs +++ b/NPCs/TownNPCs/THIEF.cs @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.TownNPCs "Penelope", "Marisa", "Maribel", "Valerie", "Jessica", "Rowan", "Jessie", "Jade", "Hearn", - "Amber", "Anne", "Indiana", + "Amber", "Anne", "Indiana", "Xplizzy" }; public override void SetStaticDefaults() From 4d54e7c5d11dc10173206ad1bb2bac340af45777 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 16 Jul 2020 20:58:52 -0400 Subject: [PATCH 109/160] compile fixes --- CalPlayer/CalamityPlayer.cs | 2 +- Items/Weapons/Melee/ExoGladius.cs | 1 + Items/Weapons/Melee/StellarStriker.cs | 4 ++-- NPCs/CalamityGlobalNPC.cs | 1 + Projectiles/Ranged/MagnomalyRocket.cs | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index fadedcc50d..8ef86d3f32 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -7497,7 +7497,7 @@ namespace CalamityMod.CalPlayer } if (sirenIce) { - Main.PlaySound(SoundID.NPCKilled7, player.Center); + Main.PlaySound(SoundID.NPCKilled, (int)player.Center.X, (int)player.Center.Y, 7); player.AddBuff(ModContent.BuffType(), 1800); for (int d = 0; d < 10; d++) { diff --git a/Items/Weapons/Melee/ExoGladius.cs b/Items/Weapons/Melee/ExoGladius.cs index 11afd909f0..328ad39152 100644 --- a/Items/Weapons/Melee/ExoGladius.cs +++ b/Items/Weapons/Melee/ExoGladius.cs @@ -117,4 +117,5 @@ namespace CalamityMod.Items.Weapons.Melee CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 25f, ModContent.ProjectileType(), damage, 15f, player.whoAmI); } } + } } diff --git a/Items/Weapons/Melee/StellarStriker.cs b/Items/Weapons/Melee/StellarStriker.cs index 32b4378aaf..64b5f6c5f2 100644 --- a/Items/Weapons/Melee/StellarStriker.cs +++ b/Items/Weapons/Melee/StellarStriker.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Weapons.Melee SpawnFlares(player, item.knockBack); } - public static void SpawnFlares(Player player, float knockBack) + private void SpawnFlares(Player player, float knockBack) { Main.PlaySound(SoundID.Item88, player.position); int i = Main.myPlayer; @@ -76,7 +76,7 @@ namespace CalamityMod.Items.Weapons.Melee int num112 = 2; for (int num113 = 0; num113 < num112; num113++) { - vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + vector2 = new Vector2(player.Center.X + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); vector2.Y -= (float)(100 * num113); num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X + (float)Main.rand.Next(-40, 41) * 0.03f; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index f427f9161d..a3ccd7d38c 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -49,6 +49,7 @@ using CalamityMod.NPCs.SulphurousSea; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.TownNPCs; using CalamityMod.NPCs.Yharon; +using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Ranged; diff --git a/Projectiles/Ranged/MagnomalyRocket.cs b/Projectiles/Ranged/MagnomalyRocket.cs index 9f417ae7ac..907b60ffe4 100644 --- a/Projectiles/Ranged/MagnomalyRocket.cs +++ b/Projectiles/Ranged/MagnomalyRocket.cs @@ -141,7 +141,7 @@ namespace CalamityMod.Projectiles.Ranged target.AddBuff(BuffID.Ichor, 120); } - public override void OnHitPvp(NPC target, int damage, bool crit) + public override void OnHitPvp(Player target, int damage, bool crit) { OnHitEffects(); target.AddBuff(ModContent.BuffType(), 30); From b314792923509ace0397a32338d708bc6f7b021a Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 16 Jul 2020 22:50:48 -0400 Subject: [PATCH 110/160] made another util for blood bath and illustrious knife type weapons --- CalPlayer/CalamityPlayer.cs | 45 +-------- Items/Weapons/Magic/AsteroidStaff.cs | 46 +-------- Items/Weapons/Magic/AstralachneaStaff.cs | 24 +---- Items/Weapons/Magic/BittercoldStaff.cs | 32 +----- Items/Weapons/Magic/BloodBath.cs | 50 +--------- Items/Weapons/Magic/DeathhailStaff.cs | 52 +--------- Items/Weapons/Magic/ParasiticSceptor.cs | 40 +------- Items/Weapons/Magic/PhoenixFlameBarrage.cs | 51 +--------- Items/Weapons/Magic/PlagueStaff.cs | 29 +----- Items/Weapons/Magic/ShadowdropStaff.cs | 45 +-------- Items/Weapons/Magic/SkyGlaze.cs | 45 +-------- Items/Weapons/Melee/Devastation.cs | 52 ++-------- Items/Weapons/Melee/EmpyreanKnives.cs | 49 ++-------- Items/Weapons/Melee/Greentide.cs | 103 ++------------------ Items/Weapons/Melee/MonstrousKnives.cs | 38 +------- Items/Weapons/Melee/RoyalKnivesMelee.cs | 51 ++-------- Items/Weapons/Melee/StellarStriker.cs | 50 +--------- Items/Weapons/Rogue/EmpyreanKnivesThrown.cs | 52 ++-------- Items/Weapons/Rogue/LunarKunai.cs | 61 +----------- Items/Weapons/Rogue/RoyalKnives.cs | 51 ++-------- Utilities/CalamityUtils.cs | 102 +++++++++++++++++++ 21 files changed, 182 insertions(+), 886 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 8ef86d3f32..741477388d 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -7075,50 +7075,11 @@ namespace CalamityMod.CalPlayer { if (item.Calamity().rogue) { - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - - vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - vector2.Y -= 100f; - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) - { - num79 *= -1f; - } - if (num79 < 20f) - { - num79 = 20f; - } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float speedX4 = num78 + (float)Main.rand.Next(-30, 31) * 0.02f; - float speedY5 = num79 + (float)Main.rand.Next(-30, 31) * 0.02f; - int p = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, (int)(damage * 0.15f), knockBack * 0.5f, player.whoAmI); - Main.projectile[p].Calamity().forceRogue = true; //in case melee/rogue variants bug out + Projectile proj = CalamityUtils.ProjectileToMouse(player, 1, item.shootSpeed, 0f, 15f, type, (int)(damage * 0.15f), knockBack * 0.5f, player.whoAmI, true); + proj.Calamity().forceRogue = true; //in case melee/rogue variants bug out if (item.type == ModContent.ItemType()) { - Main.projectile[p].ai[1] = 1f; + proj.ai[1] = 1f; } if (StealthStrikeAvailable()) { diff --git a/Items/Weapons/Magic/AsteroidStaff.cs b/Items/Weapons/Magic/AsteroidStaff.cs index 4a2883c6f1..ea83002e89 100644 --- a/Items/Weapons/Magic/AsteroidStaff.cs +++ b/Items/Weapons/Magic/AsteroidStaff.cs @@ -54,50 +54,8 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - - int num112 = 3; - for (int num113 = 0; num113 < num112; num113++) - { - vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - vector2.Y -= (float)(100 * num113); - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X + (float)Main.rand.Next(-40, 41) * 0.03f; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) - { - num79 *= -1f; - } - if (num79 < 20f) - { - num79 = 20f; - } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float num114 = num78; - float num115 = num79 + (float)Main.rand.Next(-40, 41) * 0.02f; - Projectile.NewProjectile(vector2.X, vector2.Y, num114 * 0.75f, num115 * 0.75f, type, damage, knockBack, player.whoAmI, 0f, 0.5f + (float)Main.rand.NextDouble() * 0.3f); - } + Projectile asteroid = CalamityUtils.ProjectileToMouse(player, 3, item.shootSpeed, 0.03f, 40f, type, damage, knockBack, player.whoAmI, true, 40f); + asteroid.ai[1] = 0.5f + (float)Main.rand.NextDouble() * 0.3f; return false; } } diff --git a/Items/Weapons/Magic/AstralachneaStaff.cs b/Items/Weapons/Magic/AstralachneaStaff.cs index 06e1de8eb6..529e7c3cb8 100644 --- a/Items/Weapons/Magic/AstralachneaStaff.cs +++ b/Items/Weapons/Magic/AstralachneaStaff.cs @@ -43,14 +43,6 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - int i = Main.myPlayer; - float num72 = item.shootSpeed; - int num73 = damage; - float num74 = knockBack; - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); int spikeAmount = 4; if (Main.rand.NextBool(3)) { @@ -64,21 +56,7 @@ namespace CalamityMod.Items.Weapons.Magic { spikeAmount += 2; } - for (int num131 = 0; num131 < spikeAmount; num131++) - { - float num132 = num78; - float num133 = num79; - float num134 = 0.05f * (float)num131; - num132 += (float)Main.rand.Next(-400, 400) * num134; - num133 += (float)Main.rand.Next(-400, 400) * num134; - num80 = (float)Math.Sqrt((double)(num132 * num132 + num133 * num133)); - num80 = num72 / num80; - num132 *= num80; - num133 *= num80; - float x2 = vector2.X; - float y2 = vector2.Y; - Projectile.NewProjectile(x2, y2, num132, num133, ModContent.ProjectileType(), num73, num74, i, 0f, 0f); - } + CalamityUtils.ProjectileToMouse(player, spikeAmount, item.shootSpeed, 0.05f, 400f, type, damage, knockBack, player.whoAmI, false); return false; } } diff --git a/Items/Weapons/Magic/BittercoldStaff.cs b/Items/Weapons/Magic/BittercoldStaff.cs index 6e4f1250e8..0bcc06a93b 100644 --- a/Items/Weapons/Magic/BittercoldStaff.cs +++ b/Items/Weapons/Magic/BittercoldStaff.cs @@ -43,42 +43,20 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - int i = Main.myPlayer; - float num72 = item.shootSpeed; - int num73 = damage; - float num74 = knockBack; - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - int num130 = 2; + int spikeAmt = 2; if (Main.rand.NextBool(3)) { - num130++; + spikeAmt++; } if (Main.rand.NextBool(4)) { - num130++; + spikeAmt++; } if (Main.rand.NextBool(5)) { - num130++; - } - for (int num131 = 0; num131 < num130; num131++) - { - float num132 = num78; - float num133 = num79; - float num134 = 0.05f * (float)num131; - num132 += (float)Main.rand.Next(-100, 100) * num134; - num133 += (float)Main.rand.Next(-100, 100) * num134; - num80 = (float)Math.Sqrt((double)(num132 * num132 + num133 * num133)); - num80 = num72 / num80; - num132 *= num80; - num133 *= num80; - float x2 = vector2.X; - float y2 = vector2.Y; - Projectile.NewProjectile(x2, y2, num132, num133, ModContent.ProjectileType(), num73, num74, i, 0f, 0f); + spikeAmt++; } + CalamityUtils.ProjectileToMouse(player, spikeAmt, item.shootSpeed, 0.05f, 100f, type, damage, knockBack, player.whoAmI, false); return false; } } diff --git a/Items/Weapons/Magic/BloodBath.cs b/Items/Weapons/Magic/BloodBath.cs index b332e3186a..e5adf442cb 100644 --- a/Items/Weapons/Magic/BloodBath.cs +++ b/Items/Weapons/Magic/BloodBath.cs @@ -55,58 +55,16 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - - int num107 = 2; + int bloodDropAmt = 2; if (Main.rand.NextBool(3)) { - num107++; + bloodDropAmt++; } if (Main.rand.NextBool(3)) { - num107++; - } - for (int num108 = 0; num108 < num107; num108++) - { - vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - vector2.Y -= (float)(100 * num108); - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) - { - num79 *= -1f; - } - if (num79 < 20f) - { - num79 = 20f; - } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float speedX4 = num78 + (float)Main.rand.Next(-30, 31) * 0.02f; - float speedY5 = num79 + (float)Main.rand.Next(-30, 31) * 0.02f; - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(15)); + bloodDropAmt++; } + CalamityUtils.ProjectileToMouse(player, bloodDropAmt, item.shootSpeed, 0f, 30f, type, damage, knockBack, player.whoAmI, true); return false; } } diff --git a/Items/Weapons/Magic/DeathhailStaff.cs b/Items/Weapons/Magic/DeathhailStaff.cs index f0fca04e3a..3c9297e9d5 100644 --- a/Items/Weapons/Magic/DeathhailStaff.cs +++ b/Items/Weapons/Magic/DeathhailStaff.cs @@ -52,57 +52,7 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int i = Main.myPlayer; - float num72 = item.shootSpeed; - int num73 = damage; - float num74 = knockBack; - num74 = player.GetWeaponKnockback(item, num74); - player.itemTime = item.useTime; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); - Vector2 vector3 = Main.MouseWorld - vector2; - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - - int num107 = 2; - for (int num108 = 0; num108 < num107; num108++) - { - vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - vector2.Y -= (float)(100 * num108); - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) - { - num79 *= -1f; - } - if (num79 < 20f) - { - num79 = 20f; - } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float speedX4 = num78 + (float)Main.rand.Next(-50, 51) * 0.02f; - float speedY5 = num79 + (float)Main.rand.Next(-50, 51) * 0.02f; - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, num73, num74, i, 0f, 0f); - } + CalamityUtils.ProjectileToMouse(player, 2, item.shootSpeed, 0f, 50f, type, damage, knockBack, player.whoAmI, true); return false; } } diff --git a/Items/Weapons/Magic/ParasiticSceptor.cs b/Items/Weapons/Magic/ParasiticSceptor.cs index a562d2398f..63043fd3a1 100644 --- a/Items/Weapons/Magic/ParasiticSceptor.cs +++ b/Items/Weapons/Magic/ParasiticSceptor.cs @@ -38,28 +38,6 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - float speed = item.shootSpeed; - Vector2 playerPos = player.RotatedRelativePoint(player.MountedCenter, true); - float xDist = Main.mouseX + Main.screenPosition.X - playerPos.X; - float yDist = Main.mouseY + Main.screenPosition.Y - playerPos.Y; - if (player.gravDir == -1f) - { - yDist = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - playerPos.Y; - } - Vector2 vector = new Vector2(xDist, yDist); - float speedMult = vector.Length(); - if ((float.IsNaN(xDist) && float.IsNaN(yDist)) || (xDist == 0f && yDist == 0f)) - { - xDist = player.direction; - yDist = 0f; - speedMult = speed; - } - else - { - speedMult = speed / speedMult; - } - xDist *= speedMult; - yDist *= speedMult; int leechAmt = 2; if (Main.rand.NextBool(3)) { @@ -71,23 +49,9 @@ namespace CalamityMod.Items.Weapons.Magic } if (Main.rand.NextBool(5)) { - leechAmt ++; - } - for (int i = 0; i < leechAmt; i++) - { - float xVec = xDist; - float yVec = yDist; - float spreadMult = 0.05f * i; - xVec += Main.rand.NextFloat(-25f, 25f) * spreadMult; - yVec += Main.rand.NextFloat(-25f, 25f) * spreadMult; - Vector2 directionToShoot = new Vector2(xVec, yVec); - speedMult = directionToShoot.Length(); - speedMult = speed / speedMult; - xVec *= speedMult; - yVec *= speedMult; - directionToShoot = new Vector2(xVec, yVec); - Projectile.NewProjectile(playerPos, directionToShoot, type, damage, knockBack, player.whoAmI, 0f, 0f); + leechAmt++; } + CalamityUtils.ProjectileToMouse(player, leechAmt, item.shootSpeed, 0.05f, 25f, type, damage, knockBack, player.whoAmI, false); return false; } } diff --git a/Items/Weapons/Magic/PhoenixFlameBarrage.cs b/Items/Weapons/Magic/PhoenixFlameBarrage.cs index 74ffcbb075..099362a846 100644 --- a/Items/Weapons/Magic/PhoenixFlameBarrage.cs +++ b/Items/Weapons/Magic/PhoenixFlameBarrage.cs @@ -45,59 +45,16 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - float num72 = item.shootSpeed; - player.itemTime = item.useTime; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - - int num107 = 30; + int flameAmt = 30; if (Main.rand.NextBool(3)) { - num107++; + flameAmt++; } if (Main.rand.NextBool(3)) { - num107++; - } - for (int num108 = 0; num108 < num107; num108++) - { - vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - vector2.Y -= (float)(100 * num108); - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) - { - num79 *= -1f; - } - if (num79 < 20f) - { - num79 = 20f; - } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float speedX4 = num78 + (float)Main.rand.Next(-30, 31) * 0.02f; - float speedY5 = num79 + (float)Main.rand.Next(-30, 31) * 0.02f; - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(15)); + flameAmt++; } + CalamityUtils.ProjectileToMouse(player, flameAmt, item.shootSpeed, 0f, 30f, type, damage, knockBack, player.whoAmI, true); return false; } } diff --git a/Items/Weapons/Magic/PlagueStaff.cs b/Items/Weapons/Magic/PlagueStaff.cs index 5059626301..23683c17c5 100644 --- a/Items/Weapons/Magic/PlagueStaff.cs +++ b/Items/Weapons/Magic/PlagueStaff.cs @@ -43,39 +43,20 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num72 = item.shootSpeed; - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - int num130 = 6; + int fangAmt = 6; if (Main.rand.NextBool(3)) { - num130++; + fangAmt++; } if (Main.rand.NextBool(4)) { - num130++; + fangAmt++; } if (Main.rand.NextBool(5)) { - num130++; - } - for (int num131 = 0; num131 < num130; num131++) - { - float num132 = num78; - float num133 = num79; - float num134 = 0.05f * (float)num131; - num132 += (float)Main.rand.Next(-120, 121) * num134; - num133 += (float)Main.rand.Next(-120, 121) * num134; - num80 = (float)Math.Sqrt((double)(num132 * num132 + num133 * num133)); - num80 = num72 / num80; - num132 *= num80; - num133 *= num80; - float x2 = vector2.X; - float y2 = vector2.Y; - Projectile.NewProjectile(x2, y2, num132, num133, ModContent.ProjectileType(), damage, knockBack, Main.myPlayer, 0f, 0f); + fangAmt++; } + CalamityUtils.ProjectileToMouse(player, fangAmt, item.shootSpeed, 0.05f, 120f, type, damage, knockBack, player.whoAmI, false); return false; } } diff --git a/Items/Weapons/Magic/ShadowdropStaff.cs b/Items/Weapons/Magic/ShadowdropStaff.cs index 296c86aa69..fab2dd126b 100644 --- a/Items/Weapons/Magic/ShadowdropStaff.cs +++ b/Items/Weapons/Magic/ShadowdropStaff.cs @@ -55,50 +55,7 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - - int num107 = 10; - for (int num108 = 0; num108 < num107; num108++) - { - vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - vector2.Y -= (float)(100 * num108); - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) - { - num79 *= -1f; - } - if (num79 < 20f) - { - num79 = 20f; - } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float speedX4 = num78 + (float)Main.rand.Next(-120, 121) * 0.02f; - float speedY5 = num79 + (float)Main.rand.Next(-120, 121) * 0.02f; - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(10)); - } + CalamityUtils.ProjectileToMouse(player, 10, item.shootSpeed, 0f, 120f, type, damage, knockBack, player.whoAmI, true); return false; } } diff --git a/Items/Weapons/Magic/SkyGlaze.cs b/Items/Weapons/Magic/SkyGlaze.cs index 941e02af33..2174b6576f 100644 --- a/Items/Weapons/Magic/SkyGlaze.cs +++ b/Items/Weapons/Magic/SkyGlaze.cs @@ -43,50 +43,7 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - - int num107 = 3; - for (int num108 = 0; num108 < num107; num108++) - { - vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - vector2.Y -= (float)(100 * num108); - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) - { - num79 *= -1f; - } - if (num79 < 20f) - { - num79 = 20f; - } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float speedX4 = num78 + (float)Main.rand.Next(-30, 31) * 0.02f; - float speedY5 = num79 + (float)Main.rand.Next(-30, 31) * 0.02f; - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(15)); - } + CalamityUtils.ProjectileToMouse(player, 3, item.shootSpeed, 0f, 30f, type, damage, knockBack, player.whoAmI, true); return false; } } diff --git a/Items/Weapons/Melee/Devastation.cs b/Items/Weapons/Melee/Devastation.cs index c41aa48ea2..5fa0d00651 100644 --- a/Items/Weapons/Melee/Devastation.cs +++ b/Items/Weapons/Melee/Devastation.cs @@ -52,53 +52,13 @@ namespace CalamityMod.Items.Weapons.Melee default: break; } - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } + Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - int num107 = 4; - for (int num108 = 0; num108 < num107; num108++) - { - vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - vector2.Y -= (float)(100 * num108); - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) - { - num79 *= -1f; - } - if (num79 < 20f) - { - num79 = 20f; - } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float speedX4 = num78 + (float)Main.rand.Next(-40, 41) * 0.02f; - float speedY5 = num79 + (float)Main.rand.Next(-40, 41) * 0.02f; - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), damage / 2, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(5)); - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), damage / 2, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(3)); - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), damage / 2, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(1)); - } + Projectile blast = CalamityUtils.ProjectileToMouse(player, 4, item.shootSpeed, 0f, 40f, ModContent.ProjectileType(), damage / 2, knockBack, player.whoAmI, true); + blast.ai[1] = Main.rand.Next(5); + Projectile blast2 = CalamityUtils.ProjectileToMouse(player, 4, item.shootSpeed, 0f, 40f, ModContent.ProjectileType(), damage / 2, knockBack, player.whoAmI, true); + blast2.ai[1] = Main.rand.Next(3); + CalamityUtils.ProjectileToMouse(player, 4, item.shootSpeed, 0f, 40f, ModContent.ProjectileType(), damage / 2, knockBack, player.whoAmI, true); return false; } diff --git a/Items/Weapons/Melee/EmpyreanKnives.cs b/Items/Weapons/Melee/EmpyreanKnives.cs index 5e65ceb85b..c7859ef9fc 100644 --- a/Items/Weapons/Melee/EmpyreanKnives.cs +++ b/Items/Weapons/Melee/EmpyreanKnives.cs @@ -41,61 +41,24 @@ namespace CalamityMod.Items.Weapons.Melee public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); - Vector2 vector3 = Main.MouseWorld - vector2; - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - num78 *= num80; - num79 *= num80; - int num146 = 4; + int knifeAmt = 4; if (Main.rand.NextBool(2)) { - num146++; + knifeAmt++; } if (Main.rand.NextBool(4)) { - num146++; + knifeAmt++; } if (Main.rand.NextBool(8)) { - num146++; + knifeAmt++; } if (Main.rand.NextBool(16)) { - num146++; - } - for (int num147 = 0; num147 < num146; num147++) - { - float num148 = num78; - float num149 = num79; - float num150 = 0.05f * (float)num147; - num148 += (float)Main.rand.Next(-25, 26) * num150; - num149 += (float)Main.rand.Next(-25, 26) * num150; - num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); - num80 = num72 / num80; - num148 *= num80; - num149 *= num80; - float x4 = vector2.X; - float y4 = vector2.Y; - Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 0f); + knifeAmt++; } + CalamityUtils.ProjectileToMouse(player, knifeAmt, item.shootSpeed, 0.05f, 25f, type, damage, knockBack, player.whoAmI, false); return false; } diff --git a/Items/Weapons/Melee/Greentide.cs b/Items/Weapons/Melee/Greentide.cs index 05d1284942..f63f359bba 100644 --- a/Items/Weapons/Melee/Greentide.cs +++ b/Items/Weapons/Melee/Greentide.cs @@ -35,106 +35,23 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - int i = Main.myPlayer; - float num72 = item.shootSpeed; - float num74 = knockback; - num74 = player.GetWeaponKnockback(item, num74); - player.itemTime = item.useTime; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX - Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY - Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) + if (target.type == NPCID.TargetDummy) { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - - int num107 = 4; - for (int num108 = 0; num108 < num107; num108++) - { - vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - vector2.Y -= (float)(100 * num108); - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) - { - num79 *= -1f; - } - if (num79 < 20f) - { - num79 = 20f; - } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float speedX4 = num78; - float speedY5 = num79 + (float)Main.rand.Next(-180, 181) * 0.02f; - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f)), num74, i, 0f, (float)Main.rand.Next(10)); + return; } + if (player.whoAmI == Main.myPlayer) + SpawnTeeth(player, knockback); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - int i = Main.myPlayer; - float num72 = item.shootSpeed; - float num74 = item.knockBack; - num74 = player.GetWeaponKnockback(item, num74); - player.itemTime = item.useTime; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX - Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY - Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } + if (player.whoAmI == Main.myPlayer) + SpawnTeeth(player, item.knockBack); + } - int num107 = 4; - for (int num108 = 0; num108 < num107; num108++) - { - vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - vector2.Y -= (float)(100 * num108); - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) - { - num79 *= -1f; - } - if (num79 < 20f) - { - num79 = 20f; - } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float speedX4 = num78; - float speedY5 = num79 + (float)Main.rand.Next(-180, 181) * 0.02f; - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f)), num74, i, 0f, (float)Main.rand.Next(10)); - } + private void SpawnTeeth(Player player, float knockBack) + { + CalamityUtils.ProjectileToMouse(player, 4, item.shootSpeed, 0f, 180f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), knockBack, player.whoAmI, true); } public override void MeleeEffects(Player player, Rectangle hitbox) diff --git a/Items/Weapons/Melee/MonstrousKnives.cs b/Items/Weapons/Melee/MonstrousKnives.cs index 35800a9933..4610385098 100644 --- a/Items/Weapons/Melee/MonstrousKnives.cs +++ b/Items/Weapons/Melee/MonstrousKnives.cs @@ -38,28 +38,6 @@ namespace CalamityMod.Items.Weapons.Melee public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - float speed = item.shootSpeed; - Vector2 playerPos = player.RotatedRelativePoint(player.MountedCenter, true); - float xDist = Main.mouseX + Main.screenPosition.X - playerPos.X; - float yDist = Main.mouseY + Main.screenPosition.Y - playerPos.Y; - if (player.gravDir == -1f) - { - yDist = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - playerPos.Y; - } - Vector2 vector = new Vector2(xDist, yDist); - float speedMult = vector.Length(); - if ((float.IsNaN(xDist) && float.IsNaN(yDist)) || (xDist == 0f && yDist == 0f)) - { - xDist = player.direction; - yDist = 0f; - speedMult = speed; - } - else - { - speedMult = speed / speedMult; - } - xDist *= speedMult; - yDist *= speedMult; int knifeAmt = 3; if (Main.rand.NextBool(2)) { @@ -77,21 +55,7 @@ namespace CalamityMod.Items.Weapons.Melee { knifeAmt++; } - for (int i = 0; i < knifeAmt; i++) - { - float xVec = xDist; - float yVec = yDist; - float spreadMult = 0.05f * i; - xVec += Main.rand.NextFloat(-25f, 25f) * spreadMult; - yVec += Main.rand.NextFloat(-25f, 25f) * spreadMult; - Vector2 directionToShoot = new Vector2(xVec, yVec); - speedMult = directionToShoot.Length(); - speedMult = speed / speedMult; - xVec *= speedMult; - yVec *= speedMult; - directionToShoot = new Vector2(xVec, yVec); - Projectile.NewProjectile(playerPos, directionToShoot, type, damage, knockBack, player.whoAmI, 0f, 0f); - } + CalamityUtils.ProjectileToMouse(player, knifeAmt, item.shootSpeed, 0.05f, 25f, type, damage, knockBack, player.whoAmI, false); return false; } diff --git a/Items/Weapons/Melee/RoyalKnivesMelee.cs b/Items/Weapons/Melee/RoyalKnivesMelee.cs index fc6cabc9ce..ab9729b9cb 100644 --- a/Items/Weapons/Melee/RoyalKnivesMelee.cs +++ b/Items/Weapons/Melee/RoyalKnivesMelee.cs @@ -40,62 +40,25 @@ namespace CalamityMod.Items.Weapons.Melee public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); - Vector2 vector3 = Main.MouseWorld - vector2; - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - num78 *= num80; - num79 *= num80; - int num146 = 4; + int knifeAmt = 4; if (Main.rand.NextBool(2)) { - num146++; + knifeAmt++; } if (Main.rand.NextBool(4)) { - num146++; + knifeAmt++; } if (Main.rand.NextBool(6)) { - num146++; + knifeAmt++; } if (Main.rand.NextBool(8)) { - num146++; - } - for (int num147 = 0; num147 < num146; num147++) - { - float num148 = num78; - float num149 = num79; - float num150 = 0.05f * (float)num147; - num148 += (float)Main.rand.Next(-35, 36) * num150; - num149 += (float)Main.rand.Next(-35, 36) * num150; - num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); - num80 = num72 / num80; - num148 *= num80; - num149 *= num80; - float x4 = vector2.X; - float y4 = vector2.Y; - int knife = Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 0f); - Main.projectile[knife].Calamity().forceMelee = true; + knifeAmt++; } + Projectile knife = CalamityUtils.ProjectileToMouse(player, knifeAmt, item.shootSpeed, 0.05f, 35f, type, damage, knockBack, player.whoAmI, false); + knife.Calamity().forceMelee = true; return false; } diff --git a/Items/Weapons/Melee/StellarStriker.cs b/Items/Weapons/Melee/StellarStriker.cs index 64b5f6c5f2..586e845833 100644 --- a/Items/Weapons/Melee/StellarStriker.cs +++ b/Items/Weapons/Melee/StellarStriker.cs @@ -51,53 +51,9 @@ namespace CalamityMod.Items.Weapons.Melee private void SpawnFlares(Player player, float knockBack) { - Main.PlaySound(SoundID.Item88, player.position); - int i = Main.myPlayer; - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - - int num112 = 2; - for (int num113 = 0; num113 < num112; num113++) - { - vector2 = new Vector2(player.Center.X + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - vector2.Y -= (float)(100 * num113); - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X + (float)Main.rand.Next(-40, 41) * 0.03f; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) - { - num79 *= -1f; - } - if (num79 < 20f) - { - num79 = 20f; - } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float num114 = num78; - float num115 = num79 + (float)Main.rand.Next(-80, 81) * 0.02f; - int proj = Projectile.NewProjectile(vector2.X, vector2.Y, num114, num115, ProjectileID.LunarFlare, (int)(item.damage * player.MeleeDamage() * 0.5), knockBack, i, 0f, (float)Main.rand.Next(3)); - Main.projectile[proj].Calamity().forceMelee = true; - } + Main.PlaySound(SoundID.Item88, player.Center); + Projectile flare = CalamityUtils.ProjectileToMouse(player, 2, item.shootSpeed, 0.03f, 80f, ProjectileID.LunarFlare, (int)(item.damage * player.MeleeDamage() * 0.5), knockBack, player.whoAmI, true, 40f); + flare.Calamity().forceMelee = true; } public override void MeleeEffects(Player player, Rectangle hitbox) diff --git a/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs b/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs index 518361349f..f7c907ea06 100644 --- a/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs +++ b/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs @@ -40,62 +40,26 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); - Vector2 vector3 = Main.MouseWorld - vector2; - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - num78 *= num80; - num79 *= num80; - int num146 = 4; + int knifeAmt = 4; if (Main.rand.NextBool(2)) { - num146++; + knifeAmt++; } if (Main.rand.NextBool(4)) { - num146++; + knifeAmt++; } if (Main.rand.NextBool(8)) { - num146++; + knifeAmt++; } if (Main.rand.NextBool(16)) { - num146++; - } - for (int num147 = 0; num147 < num146; num147++) - { - float num148 = num78; - float num149 = num79; - float num150 = 0.05f * (float)num147; - num148 += (float)Main.rand.Next(-25, 26) * num150; - num149 += (float)Main.rand.Next(-25, 26) * num150; - num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); - num80 = num72 / num80; - num148 *= num80; - num149 *= num80; - float x4 = vector2.X; - float y4 = vector2.Y; - int knife = Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 1f); - Main.projectile[knife].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + knifeAmt++; } + Projectile knife = CalamityUtils.ProjectileToMouse(player, knifeAmt, item.shootSpeed, 0.05f, 25f, type, damage, knockBack, player.whoAmI, false); + knife.Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + knife.Calamity().forceRogue = true; return false; } diff --git a/Items/Weapons/Rogue/LunarKunai.cs b/Items/Weapons/Rogue/LunarKunai.cs index 8ede908a84..d2aba10263 100644 --- a/Items/Weapons/Rogue/LunarKunai.cs +++ b/Items/Weapons/Rogue/LunarKunai.cs @@ -42,64 +42,9 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - num78 *= num80; - num79 *= num80; - if (player.Calamity().StealthStrikeAvailable()) - { - for (int i = 0; i < 5; i++) - { - float num148 = num78; - float num149 = num79; - float num150 = 0.05f * (float)i; - num148 += (float)Main.rand.Next(-35, 36) * num150; - num149 += (float)Main.rand.Next(-35, 36) * num150; - num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); - num80 = num72 / num80; - num148 *= num80; - num149 *= num80; - float x4 = vector2.X; - float y4 = vector2.Y; - int stealth = Projectile.NewProjectile(x4, y4, num148, num149, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); - Main.projectile[stealth].Calamity().stealthStrike = true; - } - } - else - { - for (int i = 0; i < 3; i++) - { - float num148 = num78; - float num149 = num79; - float num150 = 0.05f * (float)i; - num148 += (float)Main.rand.Next(-35, 36) * num150; - num149 += (float)Main.rand.Next(-35, 36) * num150; - num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); - num80 = num72 / num80; - num148 *= num80; - num149 *= num80; - float x4 = vector2.X; - float y4 = vector2.Y; - Projectile.NewProjectile(x4, y4, num148, num149, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); - } - } + int knifeAmt = player.Calamity().StealthStrikeAvailable() ? 5 : 3; + Projectile knife = CalamityUtils.ProjectileToMouse(player, knifeAmt, item.shootSpeed, 0.05f, 35f, type, damage, knockBack, player.whoAmI, false); + knife.Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Items/Weapons/Rogue/RoyalKnives.cs b/Items/Weapons/Rogue/RoyalKnives.cs index 03098ed750..55b8c52519 100644 --- a/Items/Weapons/Rogue/RoyalKnives.cs +++ b/Items/Weapons/Rogue/RoyalKnives.cs @@ -40,62 +40,25 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); - Vector2 vector3 = Main.MouseWorld - vector2; - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - num78 *= num80; - num79 *= num80; - int num146 = 4; + int knifeAmt = 4; if (Main.rand.NextBool(2)) { - num146++; + knifeAmt++; } if (Main.rand.NextBool(4)) { - num146++; + knifeAmt++; } if (Main.rand.NextBool(6)) { - num146++; + knifeAmt++; } if (Main.rand.NextBool(8)) { - num146++; - } - for (int num147 = 0; num147 < num146; num147++) - { - float num148 = num78; - float num149 = num79; - float num150 = 0.05f * (float)num147; - num148 += (float)Main.rand.Next(-35, 36) * num150; - num149 += (float)Main.rand.Next(-35, 36) * num150; - num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); - num80 = num72 / num80; - num148 *= num80; - num149 *= num80; - float x4 = vector2.X; - float y4 = vector2.Y; - int knife = Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 0f); - Main.projectile[knife].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + knifeAmt++; } + Projectile knife = CalamityUtils.ProjectileToMouse(player, knifeAmt, item.shootSpeed, 0.05f, 35f, type, damage, knockBack, player.whoAmI, false); + knife.Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index ba65d066b7..0f910ae78e 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -910,6 +910,23 @@ namespace CalamityMod } } + /// + /// Shortcut for raining projectiles at a certain position + /// + /// Target to barrage with projectiles + /// Horizontal randomization limits for spawning + /// Horizontal randomization amount of the target + /// Vertical lower limit for spawning + /// Vertical upper limit for spawning + /// How fast the projectiles should be + /// Type of proj to spawn + /// Damage of the projectile + /// Knockback of the projectile + /// Who owns the projectile + // Made the below three parameters before deciding to just return a projectile + /// Set it to a number to set the type of the projectile via the force methods + /// Set to 1 for local immunity, set to 2 for ID static immunity + /// Cooldown of the above, defaults to 10 public static Projectile ProjectileRain(Vector2 targetPos, float xLimit, float xVariance, float yLimitLower, float yLimitUpper, float projSpeed, int projType, int damage, float knockback, int owner, int forceType = 0, int immunitySetting = 0, int cooldown = 10) { float x = targetPos.X + Main.rand.NextFloat(-xLimit, xLimit); @@ -969,6 +986,91 @@ namespace CalamityMod return proj; } + /// + /// Shortcut for spawning projectiles aimed at the mouse either from above or in a spread + /// + /// Player who spawns the projectiles + /// Number of projectiles to spawn + /// How fast the projectiles should be + /// Slight variance in the cone + /// Cone of spread + /// Type of proj to spawn + /// Damage of the projectile + /// Knockback of the projectile + /// Who owns the projectile + /// Set to true for the projectiles to spawn above (like Stellar Striker). Set to false for the projectiles to be thrown in a spread (like Illustrious Knives) + public static Projectile ProjectileToMouse(Player player, int projAmount, float projSpeed, float spreadMult, float targetVariance, int projType, int damage, float knockback, int owner, bool above, float targetVariance2 = 0f, float spreadMult2 = 0.02f) + { + float speed = projSpeed; + Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); + float xDist = Main.mouseX + Main.screenPosition.X - source.X; + float yDist = Main.mouseY + Main.screenPosition.Y - source.Y; + if (player.gravDir == -1f) + { + yDist = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - source.Y; + } + Vector2 mouseDir = new Vector2(xDist, yDist); + float speedMult = mouseDir.Length(); + if ((float.IsNaN(mouseDir.X) && float.IsNaN(mouseDir.Y)) || (mouseDir.X == 0f && mouseDir.Y == 0f)) + { + mouseDir.X = player.direction; + mouseDir.Y = 0f; + speedMult = speed; + } + else + { + speedMult = speed / speedMult; + } + + if (!above) + { + mouseDir.X *= speedMult; + mouseDir.Y *= speedMult; + } + + Projectile proj; + int projAmt = projAmount; + for (int i = 0; i < projAmt; i++) + { + if (above) + { + source = new Vector2(player.Center.X + (Main.rand.NextFloat(200f) * -player.direction) + (Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + source.X = (source.X + player.Center.X) / 2f + Main.rand.NextFloat(-200, 201); + source.Y -= (float)(100 * i); + mouseDir.X = (float)Main.mouseX + Main.screenPosition.X - source.X + Main.rand.NextFloat(-targetVariance2, targetVariance2) * spreadMult; + mouseDir.Y = (float)Main.mouseY + Main.screenPosition.Y - source.Y; + if (mouseDir.Y < 0f) + { + mouseDir.Y *= -1f; + } + if (mouseDir.Y < 20f) + { + mouseDir.Y = 20f; + } + speedMult = mouseDir.Length(); + speedMult = speed / speedMult; + mouseDir.X *= speedMult; + mouseDir.Y *= speedMult; + mouseDir.Y += Main.rand.NextFloat(-targetVariance, targetVariance) * spreadMult2; + proj = Projectile.NewProjectileDirect(source, mouseDir, projType, damage, knockback, owner); + } + else + { + float xVec = mouseDir.X; + float yVec = mouseDir.Y; + float spreadMultiplier = spreadMult * i; + mouseDir.X += Main.rand.NextFloat(-targetVariance, targetVariance) * spreadMultiplier; + mouseDir.Y += Main.rand.NextFloat(-targetVariance, targetVariance) * spreadMultiplier; + speedMult = mouseDir.Length(); + speedMult = speed / speedMult; + mouseDir.X *= speedMult; + mouseDir.Y *= speedMult; + Projectile.NewProjectile(source, mouseDir, type, damage, knockBack, player.whoAmI, 0f, 0f); + } + } + return proj; + } + public static int DamageSoftCap(double dmgInput, int cap) { int newDamage = (int)(dmgInput); From f425b201d31d2914f12eb0489a6c5b7fdb5adafc Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 16 Jul 2020 22:57:37 -0400 Subject: [PATCH 111/160] utility cleanup --- CalPlayer/CalamityPlayerMiscEffects.cs | 44 +--------------- Items/Weapons/Magic/AquamarineStaff.cs | 3 +- Items/Weapons/Magic/CosmicRainbow.cs | 73 +++++--------------------- Utilities/CalamityUtils.cs | 2 +- 4 files changed, 18 insertions(+), 104 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index f07cac14bf..4968b21ba4 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3615,49 +3615,9 @@ namespace CalamityMod.CalPlayer { float shootSpeed = 18f; int dmg = (int)(50 * player.MagicDamage()); - Vector2 startPos = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 velocity = Main.MouseWorld - startPos; - if (player.gravDir == -1f) - { - velocity.Y = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - startPos.Y; - } - float travelDist = velocity.Length(); - if ((float.IsNaN(velocity.X) && float.IsNaN(velocity.Y)) || (velocity.X == 0f && velocity.Y == 0f)) - { - velocity.X = player.direction; - velocity.Y = 0f; - travelDist = shootSpeed; - } - else - { - travelDist = shootSpeed / travelDist; - } - int laserAmt = Main.rand.Next(2); - for (int index = 0; index < laserAmt; index++) - { - startPos = new Vector2(player.Center.X + (Main.rand.Next(201) * -(float)player.direction) + (Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - startPos.X = (startPos.X + player.Center.X) / 2f + Main.rand.Next(-200, 201); - startPos.Y -= 100 * index; - velocity.X = Main.mouseX + Main.screenPosition.X - startPos.X; - velocity.Y = Main.mouseY + Main.screenPosition.Y - startPos.Y; - if (velocity.Y < 0f) - { - velocity.Y *= -1f; - } - if (velocity.Y < 20f) - { - velocity.Y = 20f; - } - travelDist = velocity.Length(); - travelDist = shootSpeed / travelDist; - velocity.X *= travelDist; - velocity.Y *= travelDist; - velocity.X += Main.rand.Next(-50, 51) * 0.02f; - velocity.Y += Main.rand.Next(-50, 51) * 0.02f; - int laser = Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), dmg, 4f, player.whoAmI, 0f, 0f); - Main.projectile[laser].localNPCHitCooldown = 5; - } + Projectile laser = CalamityUtils.ProjectileToMouse(player, laserAmt, 18f, 0f, 50f, ModContent.ProjectileType(), dmg, 4f, player.whoAmI, true); + laser.localNPCHitCooldown = 5; Main.PlaySound(SoundID.Item12, player.Center); } if (modPlayer.prismaticLasers == 1800) diff --git a/Items/Weapons/Magic/AquamarineStaff.cs b/Items/Weapons/Magic/AquamarineStaff.cs index 9d97e02474..f65ffc3b59 100644 --- a/Items/Weapons/Magic/AquamarineStaff.cs +++ b/Items/Weapons/Magic/AquamarineStaff.cs @@ -43,8 +43,7 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int num6 = Main.rand.Next(2, 3); - for (int index = 0; index < num6; ++index) + for (int index = 0; index < 2; ++index) { float SpeedX = speedX + (float)Main.rand.Next(-30, 31) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-30, 31) * 0.05f; diff --git a/Items/Weapons/Magic/CosmicRainbow.cs b/Items/Weapons/Magic/CosmicRainbow.cs index 5889350917..f0a0c8aa15 100644 --- a/Items/Weapons/Magic/CosmicRainbow.cs +++ b/Items/Weapons/Magic/CosmicRainbow.cs @@ -50,70 +50,25 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - Vector2 vector = player.RotatedRelativePoint(player.MountedCenter, true); - float num117 = 0.314159274f; - int num118 = 3; - Vector2 vector7 = new Vector2(speedX, speedY); - vector7.Normalize(); - vector7 *= 60f; - bool flag11 = Collision.CanHit(vector, 0, 0, vector + vector7, 0, 0); - for (int num119 = 0; num119 < num118; num119++) + Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); + float piOverTen = MathHelper.Pi * 0.1f; + int projAmt = 3; + Vector2 velocity = new Vector2(speedX, speedY); + velocity.Normalize(); + velocity *= 60f; + bool canHit = Collision.CanHit(source, 0, 0, source + velocity, 0, 0); + for (int i = 0; i < projAmt; i++) { - float num120 = (float)num119 - ((float)num118 - 1f) / 2f; - Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default); - if (!flag11) + float offsetAmt = (float)i - ((float)projAmt - 1f) / 2f; + Vector2 offset = velocity.RotatedBy((double)(piOverTen * offsetAmt), default); + if (!canHit) { - value9 -= vector7; + offset -= velocity; } - int rainbow = Projectile.NewProjectile(vector.X + value9.X, vector.Y + value9.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); - Main.projectile[rainbow].usesLocalNPCImmunity = true; - Main.projectile[rainbow].localNPCHitCooldown = 10; - } - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; + Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); } - for (int num108 = 0; num108 < 2; num108++) - { - vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - vector2.Y -= (float)(100 * num108); - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) - { - num79 *= -1f; - } - if (num79 < 20f) - { - num79 = 20f; - } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float speedX4 = num78 + (float)Main.rand.Next(-15, 16) * 0.01f; - float speedY5 = num79 + (float)Main.rand.Next(-15, 16) * 0.01f; - int rainbow2 = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockBack, player.whoAmI, 0f, 0f); - Main.projectile[rainbow2].usesLocalNPCImmunity = true; - Main.projectile[rainbow2].localNPCHitCooldown = 10; - } + CalamityUtils.ProjectileToMouse(player, 2, item.shootSpeed, 0f, 15f, type, damage, knockBack, player.whoAmI, true); return false; } } diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 0f910ae78e..d82ea88b5b 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -1065,7 +1065,7 @@ namespace CalamityMod speedMult = speed / speedMult; mouseDir.X *= speedMult; mouseDir.Y *= speedMult; - Projectile.NewProjectile(source, mouseDir, type, damage, knockBack, player.whoAmI, 0f, 0f); + proj = Projectile.NewProjectile(source, mouseDir, projType, damage, knockback, owner); } } return proj; From 5c640c2cfccf2c07faa79786e2b38cadb371a53f Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 16 Jul 2020 23:00:31 -0400 Subject: [PATCH 112/160] a --- Utilities/CalamityUtils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index d82ea88b5b..07e189338f 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -1065,7 +1065,7 @@ namespace CalamityMod speedMult = speed / speedMult; mouseDir.X *= speedMult; mouseDir.Y *= speedMult; - proj = Projectile.NewProjectile(source, mouseDir, projType, damage, knockback, owner); + proj = Projectile.NewProjectileDirect(source, mouseDir, projType, damage, knockback, owner); } } return proj; From 335fdaa360d477393b22a8ff5eee040b9a0c787b Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 16 Jul 2020 23:07:33 -0400 Subject: [PATCH 113/160] Revert "a" This reverts commit 5c640c2cfccf2c07faa79786e2b38cadb371a53f. --- Utilities/CalamityUtils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 07e189338f..d82ea88b5b 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -1065,7 +1065,7 @@ namespace CalamityMod speedMult = speed / speedMult; mouseDir.X *= speedMult; mouseDir.Y *= speedMult; - proj = Projectile.NewProjectileDirect(source, mouseDir, projType, damage, knockback, owner); + proj = Projectile.NewProjectile(source, mouseDir, projType, damage, knockback, owner); } } return proj; From 4d8eda7fd1a7b1ccc6505a7f9c78e453423b24cc Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 16 Jul 2020 23:07:38 -0400 Subject: [PATCH 114/160] Revert "utility cleanup" This reverts commit f425b201d31d2914f12eb0489a6c5b7fdb5adafc. --- CalPlayer/CalamityPlayerMiscEffects.cs | 44 +++++++++++++++- Items/Weapons/Magic/AquamarineStaff.cs | 3 +- Items/Weapons/Magic/CosmicRainbow.cs | 73 +++++++++++++++++++++----- Utilities/CalamityUtils.cs | 2 +- 4 files changed, 104 insertions(+), 18 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 4968b21ba4..f07cac14bf 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3615,9 +3615,49 @@ namespace CalamityMod.CalPlayer { float shootSpeed = 18f; int dmg = (int)(50 * player.MagicDamage()); + Vector2 startPos = player.RotatedRelativePoint(player.MountedCenter, true); + Vector2 velocity = Main.MouseWorld - startPos; + if (player.gravDir == -1f) + { + velocity.Y = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - startPos.Y; + } + float travelDist = velocity.Length(); + if ((float.IsNaN(velocity.X) && float.IsNaN(velocity.Y)) || (velocity.X == 0f && velocity.Y == 0f)) + { + velocity.X = player.direction; + velocity.Y = 0f; + travelDist = shootSpeed; + } + else + { + travelDist = shootSpeed / travelDist; + } + int laserAmt = Main.rand.Next(2); - Projectile laser = CalamityUtils.ProjectileToMouse(player, laserAmt, 18f, 0f, 50f, ModContent.ProjectileType(), dmg, 4f, player.whoAmI, true); - laser.localNPCHitCooldown = 5; + for (int index = 0; index < laserAmt; index++) + { + startPos = new Vector2(player.Center.X + (Main.rand.Next(201) * -(float)player.direction) + (Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + startPos.X = (startPos.X + player.Center.X) / 2f + Main.rand.Next(-200, 201); + startPos.Y -= 100 * index; + velocity.X = Main.mouseX + Main.screenPosition.X - startPos.X; + velocity.Y = Main.mouseY + Main.screenPosition.Y - startPos.Y; + if (velocity.Y < 0f) + { + velocity.Y *= -1f; + } + if (velocity.Y < 20f) + { + velocity.Y = 20f; + } + travelDist = velocity.Length(); + travelDist = shootSpeed / travelDist; + velocity.X *= travelDist; + velocity.Y *= travelDist; + velocity.X += Main.rand.Next(-50, 51) * 0.02f; + velocity.Y += Main.rand.Next(-50, 51) * 0.02f; + int laser = Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), dmg, 4f, player.whoAmI, 0f, 0f); + Main.projectile[laser].localNPCHitCooldown = 5; + } Main.PlaySound(SoundID.Item12, player.Center); } if (modPlayer.prismaticLasers == 1800) diff --git a/Items/Weapons/Magic/AquamarineStaff.cs b/Items/Weapons/Magic/AquamarineStaff.cs index f65ffc3b59..9d97e02474 100644 --- a/Items/Weapons/Magic/AquamarineStaff.cs +++ b/Items/Weapons/Magic/AquamarineStaff.cs @@ -43,7 +43,8 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - for (int index = 0; index < 2; ++index) + int num6 = Main.rand.Next(2, 3); + for (int index = 0; index < num6; ++index) { float SpeedX = speedX + (float)Main.rand.Next(-30, 31) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-30, 31) * 0.05f; diff --git a/Items/Weapons/Magic/CosmicRainbow.cs b/Items/Weapons/Magic/CosmicRainbow.cs index f0a0c8aa15..5889350917 100644 --- a/Items/Weapons/Magic/CosmicRainbow.cs +++ b/Items/Weapons/Magic/CosmicRainbow.cs @@ -50,25 +50,70 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); - float piOverTen = MathHelper.Pi * 0.1f; - int projAmt = 3; - Vector2 velocity = new Vector2(speedX, speedY); - velocity.Normalize(); - velocity *= 60f; - bool canHit = Collision.CanHit(source, 0, 0, source + velocity, 0, 0); - for (int i = 0; i < projAmt; i++) + Vector2 vector = player.RotatedRelativePoint(player.MountedCenter, true); + float num117 = 0.314159274f; + int num118 = 3; + Vector2 vector7 = new Vector2(speedX, speedY); + vector7.Normalize(); + vector7 *= 60f; + bool flag11 = Collision.CanHit(vector, 0, 0, vector + vector7, 0, 0); + for (int num119 = 0; num119 < num118; num119++) { - float offsetAmt = (float)i - ((float)projAmt - 1f) / 2f; - Vector2 offset = velocity.RotatedBy((double)(piOverTen * offsetAmt), default); - if (!canHit) + float num120 = (float)num119 - ((float)num118 - 1f) / 2f; + Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default); + if (!flag11) { - offset -= velocity; + value9 -= vector7; } - Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); + int rainbow = Projectile.NewProjectile(vector.X + value9.X, vector.Y + value9.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[rainbow].usesLocalNPCImmunity = true; + Main.projectile[rainbow].localNPCHitCooldown = 10; + } + float num72 = item.shootSpeed; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; } - CalamityUtils.ProjectileToMouse(player, 2, item.shootSpeed, 0f, 15f, type, damage, knockBack, player.whoAmI, true); + for (int num108 = 0; num108 < 2; num108++) + { + vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); + vector2.Y -= (float)(100 * num108); + num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (num79 < 0f) + { + num79 *= -1f; + } + if (num79 < 20f) + { + num79 = 20f; + } + num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + num80 = num72 / num80; + num78 *= num80; + num79 *= num80; + float speedX4 = num78 + (float)Main.rand.Next(-15, 16) * 0.01f; + float speedY5 = num79 + (float)Main.rand.Next(-15, 16) * 0.01f; + int rainbow2 = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[rainbow2].usesLocalNPCImmunity = true; + Main.projectile[rainbow2].localNPCHitCooldown = 10; + } return false; } } diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index d82ea88b5b..0f910ae78e 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -1065,7 +1065,7 @@ namespace CalamityMod speedMult = speed / speedMult; mouseDir.X *= speedMult; mouseDir.Y *= speedMult; - proj = Projectile.NewProjectile(source, mouseDir, projType, damage, knockback, owner); + Projectile.NewProjectile(source, mouseDir, type, damage, knockBack, player.whoAmI, 0f, 0f); } } return proj; From 7e4782422fa56391e4f14bdd80e7410fd1da820c Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 16 Jul 2020 23:07:48 -0400 Subject: [PATCH 115/160] Revert "made another util for blood bath and illustrious knife type weapons" This reverts commit b314792923509ace0397a32338d708bc6f7b021a. --- CalPlayer/CalamityPlayer.cs | 45 ++++++++- Items/Weapons/Magic/AsteroidStaff.cs | 46 ++++++++- Items/Weapons/Magic/AstralachneaStaff.cs | 24 ++++- Items/Weapons/Magic/BittercoldStaff.cs | 32 +++++- Items/Weapons/Magic/BloodBath.cs | 50 +++++++++- Items/Weapons/Magic/DeathhailStaff.cs | 52 +++++++++- Items/Weapons/Magic/ParasiticSceptor.cs | 40 +++++++- Items/Weapons/Magic/PhoenixFlameBarrage.cs | 51 +++++++++- Items/Weapons/Magic/PlagueStaff.cs | 29 +++++- Items/Weapons/Magic/ShadowdropStaff.cs | 45 ++++++++- Items/Weapons/Magic/SkyGlaze.cs | 45 ++++++++- Items/Weapons/Melee/Devastation.cs | 52 ++++++++-- Items/Weapons/Melee/EmpyreanKnives.cs | 49 ++++++++-- Items/Weapons/Melee/Greentide.cs | 103 ++++++++++++++++++-- Items/Weapons/Melee/MonstrousKnives.cs | 38 +++++++- Items/Weapons/Melee/RoyalKnivesMelee.cs | 51 ++++++++-- Items/Weapons/Melee/StellarStriker.cs | 50 +++++++++- Items/Weapons/Rogue/EmpyreanKnivesThrown.cs | 52 ++++++++-- Items/Weapons/Rogue/LunarKunai.cs | 61 +++++++++++- Items/Weapons/Rogue/RoyalKnives.cs | 51 ++++++++-- Utilities/CalamityUtils.cs | 102 ------------------- 21 files changed, 886 insertions(+), 182 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 741477388d..8ef86d3f32 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -7075,11 +7075,50 @@ namespace CalamityMod.CalPlayer { if (item.Calamity().rogue) { - Projectile proj = CalamityUtils.ProjectileToMouse(player, 1, item.shootSpeed, 0f, 15f, type, (int)(damage * 0.15f), knockBack * 0.5f, player.whoAmI, true); - proj.Calamity().forceRogue = true; //in case melee/rogue variants bug out + float num72 = item.shootSpeed; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + + vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); + vector2.Y -= 100f; + num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (num79 < 0f) + { + num79 *= -1f; + } + if (num79 < 20f) + { + num79 = 20f; + } + num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + num80 = num72 / num80; + num78 *= num80; + num79 *= num80; + float speedX4 = num78 + (float)Main.rand.Next(-30, 31) * 0.02f; + float speedY5 = num79 + (float)Main.rand.Next(-30, 31) * 0.02f; + int p = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, (int)(damage * 0.15f), knockBack * 0.5f, player.whoAmI); + Main.projectile[p].Calamity().forceRogue = true; //in case melee/rogue variants bug out if (item.type == ModContent.ItemType()) { - proj.ai[1] = 1f; + Main.projectile[p].ai[1] = 1f; } if (StealthStrikeAvailable()) { diff --git a/Items/Weapons/Magic/AsteroidStaff.cs b/Items/Weapons/Magic/AsteroidStaff.cs index ea83002e89..4a2883c6f1 100644 --- a/Items/Weapons/Magic/AsteroidStaff.cs +++ b/Items/Weapons/Magic/AsteroidStaff.cs @@ -54,8 +54,50 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - Projectile asteroid = CalamityUtils.ProjectileToMouse(player, 3, item.shootSpeed, 0.03f, 40f, type, damage, knockBack, player.whoAmI, true, 40f); - asteroid.ai[1] = 0.5f + (float)Main.rand.NextDouble() * 0.3f; + float num72 = item.shootSpeed; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + + int num112 = 3; + for (int num113 = 0; num113 < num112; num113++) + { + vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); + vector2.Y -= (float)(100 * num113); + num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X + (float)Main.rand.Next(-40, 41) * 0.03f; + num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (num79 < 0f) + { + num79 *= -1f; + } + if (num79 < 20f) + { + num79 = 20f; + } + num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + num80 = num72 / num80; + num78 *= num80; + num79 *= num80; + float num114 = num78; + float num115 = num79 + (float)Main.rand.Next(-40, 41) * 0.02f; + Projectile.NewProjectile(vector2.X, vector2.Y, num114 * 0.75f, num115 * 0.75f, type, damage, knockBack, player.whoAmI, 0f, 0.5f + (float)Main.rand.NextDouble() * 0.3f); + } return false; } } diff --git a/Items/Weapons/Magic/AstralachneaStaff.cs b/Items/Weapons/Magic/AstralachneaStaff.cs index 529e7c3cb8..06e1de8eb6 100644 --- a/Items/Weapons/Magic/AstralachneaStaff.cs +++ b/Items/Weapons/Magic/AstralachneaStaff.cs @@ -43,6 +43,14 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + int i = Main.myPlayer; + float num72 = item.shootSpeed; + int num73 = damage; + float num74 = knockBack; + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); int spikeAmount = 4; if (Main.rand.NextBool(3)) { @@ -56,7 +64,21 @@ namespace CalamityMod.Items.Weapons.Magic { spikeAmount += 2; } - CalamityUtils.ProjectileToMouse(player, spikeAmount, item.shootSpeed, 0.05f, 400f, type, damage, knockBack, player.whoAmI, false); + for (int num131 = 0; num131 < spikeAmount; num131++) + { + float num132 = num78; + float num133 = num79; + float num134 = 0.05f * (float)num131; + num132 += (float)Main.rand.Next(-400, 400) * num134; + num133 += (float)Main.rand.Next(-400, 400) * num134; + num80 = (float)Math.Sqrt((double)(num132 * num132 + num133 * num133)); + num80 = num72 / num80; + num132 *= num80; + num133 *= num80; + float x2 = vector2.X; + float y2 = vector2.Y; + Projectile.NewProjectile(x2, y2, num132, num133, ModContent.ProjectileType(), num73, num74, i, 0f, 0f); + } return false; } } diff --git a/Items/Weapons/Magic/BittercoldStaff.cs b/Items/Weapons/Magic/BittercoldStaff.cs index 0bcc06a93b..6e4f1250e8 100644 --- a/Items/Weapons/Magic/BittercoldStaff.cs +++ b/Items/Weapons/Magic/BittercoldStaff.cs @@ -43,20 +43,42 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int spikeAmt = 2; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + int i = Main.myPlayer; + float num72 = item.shootSpeed; + int num73 = damage; + float num74 = knockBack; + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + int num130 = 2; if (Main.rand.NextBool(3)) { - spikeAmt++; + num130++; } if (Main.rand.NextBool(4)) { - spikeAmt++; + num130++; } if (Main.rand.NextBool(5)) { - spikeAmt++; + num130++; + } + for (int num131 = 0; num131 < num130; num131++) + { + float num132 = num78; + float num133 = num79; + float num134 = 0.05f * (float)num131; + num132 += (float)Main.rand.Next(-100, 100) * num134; + num133 += (float)Main.rand.Next(-100, 100) * num134; + num80 = (float)Math.Sqrt((double)(num132 * num132 + num133 * num133)); + num80 = num72 / num80; + num132 *= num80; + num133 *= num80; + float x2 = vector2.X; + float y2 = vector2.Y; + Projectile.NewProjectile(x2, y2, num132, num133, ModContent.ProjectileType(), num73, num74, i, 0f, 0f); } - CalamityUtils.ProjectileToMouse(player, spikeAmt, item.shootSpeed, 0.05f, 100f, type, damage, knockBack, player.whoAmI, false); return false; } } diff --git a/Items/Weapons/Magic/BloodBath.cs b/Items/Weapons/Magic/BloodBath.cs index e5adf442cb..b332e3186a 100644 --- a/Items/Weapons/Magic/BloodBath.cs +++ b/Items/Weapons/Magic/BloodBath.cs @@ -55,16 +55,58 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int bloodDropAmt = 2; + float num72 = item.shootSpeed; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + + int num107 = 2; if (Main.rand.NextBool(3)) { - bloodDropAmt++; + num107++; } if (Main.rand.NextBool(3)) { - bloodDropAmt++; + num107++; + } + for (int num108 = 0; num108 < num107; num108++) + { + vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); + vector2.Y -= (float)(100 * num108); + num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (num79 < 0f) + { + num79 *= -1f; + } + if (num79 < 20f) + { + num79 = 20f; + } + num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + num80 = num72 / num80; + num78 *= num80; + num79 *= num80; + float speedX4 = num78 + (float)Main.rand.Next(-30, 31) * 0.02f; + float speedY5 = num79 + (float)Main.rand.Next(-30, 31) * 0.02f; + Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(15)); } - CalamityUtils.ProjectileToMouse(player, bloodDropAmt, item.shootSpeed, 0f, 30f, type, damage, knockBack, player.whoAmI, true); return false; } } diff --git a/Items/Weapons/Magic/DeathhailStaff.cs b/Items/Weapons/Magic/DeathhailStaff.cs index 3c9297e9d5..f0fca04e3a 100644 --- a/Items/Weapons/Magic/DeathhailStaff.cs +++ b/Items/Weapons/Magic/DeathhailStaff.cs @@ -52,7 +52,57 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - CalamityUtils.ProjectileToMouse(player, 2, item.shootSpeed, 0f, 50f, type, damage, knockBack, player.whoAmI, true); + int i = Main.myPlayer; + float num72 = item.shootSpeed; + int num73 = damage; + float num74 = knockBack; + num74 = player.GetWeaponKnockback(item, num74); + player.itemTime = item.useTime; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); + Vector2 vector3 = Main.MouseWorld - vector2; + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + + int num107 = 2; + for (int num108 = 0; num108 < num107; num108++) + { + vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); + vector2.Y -= (float)(100 * num108); + num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (num79 < 0f) + { + num79 *= -1f; + } + if (num79 < 20f) + { + num79 = 20f; + } + num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + num80 = num72 / num80; + num78 *= num80; + num79 *= num80; + float speedX4 = num78 + (float)Main.rand.Next(-50, 51) * 0.02f; + float speedY5 = num79 + (float)Main.rand.Next(-50, 51) * 0.02f; + Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, num73, num74, i, 0f, 0f); + } return false; } } diff --git a/Items/Weapons/Magic/ParasiticSceptor.cs b/Items/Weapons/Magic/ParasiticSceptor.cs index 63043fd3a1..a562d2398f 100644 --- a/Items/Weapons/Magic/ParasiticSceptor.cs +++ b/Items/Weapons/Magic/ParasiticSceptor.cs @@ -38,6 +38,28 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { + float speed = item.shootSpeed; + Vector2 playerPos = player.RotatedRelativePoint(player.MountedCenter, true); + float xDist = Main.mouseX + Main.screenPosition.X - playerPos.X; + float yDist = Main.mouseY + Main.screenPosition.Y - playerPos.Y; + if (player.gravDir == -1f) + { + yDist = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - playerPos.Y; + } + Vector2 vector = new Vector2(xDist, yDist); + float speedMult = vector.Length(); + if ((float.IsNaN(xDist) && float.IsNaN(yDist)) || (xDist == 0f && yDist == 0f)) + { + xDist = player.direction; + yDist = 0f; + speedMult = speed; + } + else + { + speedMult = speed / speedMult; + } + xDist *= speedMult; + yDist *= speedMult; int leechAmt = 2; if (Main.rand.NextBool(3)) { @@ -49,9 +71,23 @@ namespace CalamityMod.Items.Weapons.Magic } if (Main.rand.NextBool(5)) { - leechAmt++; + leechAmt ++; + } + for (int i = 0; i < leechAmt; i++) + { + float xVec = xDist; + float yVec = yDist; + float spreadMult = 0.05f * i; + xVec += Main.rand.NextFloat(-25f, 25f) * spreadMult; + yVec += Main.rand.NextFloat(-25f, 25f) * spreadMult; + Vector2 directionToShoot = new Vector2(xVec, yVec); + speedMult = directionToShoot.Length(); + speedMult = speed / speedMult; + xVec *= speedMult; + yVec *= speedMult; + directionToShoot = new Vector2(xVec, yVec); + Projectile.NewProjectile(playerPos, directionToShoot, type, damage, knockBack, player.whoAmI, 0f, 0f); } - CalamityUtils.ProjectileToMouse(player, leechAmt, item.shootSpeed, 0.05f, 25f, type, damage, knockBack, player.whoAmI, false); return false; } } diff --git a/Items/Weapons/Magic/PhoenixFlameBarrage.cs b/Items/Weapons/Magic/PhoenixFlameBarrage.cs index 099362a846..74ffcbb075 100644 --- a/Items/Weapons/Magic/PhoenixFlameBarrage.cs +++ b/Items/Weapons/Magic/PhoenixFlameBarrage.cs @@ -45,16 +45,59 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int flameAmt = 30; + float num72 = item.shootSpeed; + player.itemTime = item.useTime; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + + int num107 = 30; if (Main.rand.NextBool(3)) { - flameAmt++; + num107++; } if (Main.rand.NextBool(3)) { - flameAmt++; + num107++; + } + for (int num108 = 0; num108 < num107; num108++) + { + vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); + vector2.Y -= (float)(100 * num108); + num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (num79 < 0f) + { + num79 *= -1f; + } + if (num79 < 20f) + { + num79 = 20f; + } + num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + num80 = num72 / num80; + num78 *= num80; + num79 *= num80; + float speedX4 = num78 + (float)Main.rand.Next(-30, 31) * 0.02f; + float speedY5 = num79 + (float)Main.rand.Next(-30, 31) * 0.02f; + Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(15)); } - CalamityUtils.ProjectileToMouse(player, flameAmt, item.shootSpeed, 0f, 30f, type, damage, knockBack, player.whoAmI, true); return false; } } diff --git a/Items/Weapons/Magic/PlagueStaff.cs b/Items/Weapons/Magic/PlagueStaff.cs index 23683c17c5..5059626301 100644 --- a/Items/Weapons/Magic/PlagueStaff.cs +++ b/Items/Weapons/Magic/PlagueStaff.cs @@ -43,20 +43,39 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int fangAmt = 6; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + float num72 = item.shootSpeed; + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + int num130 = 6; if (Main.rand.NextBool(3)) { - fangAmt++; + num130++; } if (Main.rand.NextBool(4)) { - fangAmt++; + num130++; } if (Main.rand.NextBool(5)) { - fangAmt++; + num130++; + } + for (int num131 = 0; num131 < num130; num131++) + { + float num132 = num78; + float num133 = num79; + float num134 = 0.05f * (float)num131; + num132 += (float)Main.rand.Next(-120, 121) * num134; + num133 += (float)Main.rand.Next(-120, 121) * num134; + num80 = (float)Math.Sqrt((double)(num132 * num132 + num133 * num133)); + num80 = num72 / num80; + num132 *= num80; + num133 *= num80; + float x2 = vector2.X; + float y2 = vector2.Y; + Projectile.NewProjectile(x2, y2, num132, num133, ModContent.ProjectileType(), damage, knockBack, Main.myPlayer, 0f, 0f); } - CalamityUtils.ProjectileToMouse(player, fangAmt, item.shootSpeed, 0.05f, 120f, type, damage, knockBack, player.whoAmI, false); return false; } } diff --git a/Items/Weapons/Magic/ShadowdropStaff.cs b/Items/Weapons/Magic/ShadowdropStaff.cs index fab2dd126b..296c86aa69 100644 --- a/Items/Weapons/Magic/ShadowdropStaff.cs +++ b/Items/Weapons/Magic/ShadowdropStaff.cs @@ -55,7 +55,50 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - CalamityUtils.ProjectileToMouse(player, 10, item.shootSpeed, 0f, 120f, type, damage, knockBack, player.whoAmI, true); + float num72 = item.shootSpeed; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + + int num107 = 10; + for (int num108 = 0; num108 < num107; num108++) + { + vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); + vector2.Y -= (float)(100 * num108); + num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (num79 < 0f) + { + num79 *= -1f; + } + if (num79 < 20f) + { + num79 = 20f; + } + num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + num80 = num72 / num80; + num78 *= num80; + num79 *= num80; + float speedX4 = num78 + (float)Main.rand.Next(-120, 121) * 0.02f; + float speedY5 = num79 + (float)Main.rand.Next(-120, 121) * 0.02f; + Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(10)); + } return false; } } diff --git a/Items/Weapons/Magic/SkyGlaze.cs b/Items/Weapons/Magic/SkyGlaze.cs index 2174b6576f..941e02af33 100644 --- a/Items/Weapons/Magic/SkyGlaze.cs +++ b/Items/Weapons/Magic/SkyGlaze.cs @@ -43,7 +43,50 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - CalamityUtils.ProjectileToMouse(player, 3, item.shootSpeed, 0f, 30f, type, damage, knockBack, player.whoAmI, true); + float num72 = item.shootSpeed; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + + int num107 = 3; + for (int num108 = 0; num108 < num107; num108++) + { + vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); + vector2.Y -= (float)(100 * num108); + num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (num79 < 0f) + { + num79 *= -1f; + } + if (num79 < 20f) + { + num79 = 20f; + } + num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + num80 = num72 / num80; + num78 *= num80; + num79 *= num80; + float speedX4 = num78 + (float)Main.rand.Next(-30, 31) * 0.02f; + float speedY5 = num79 + (float)Main.rand.Next(-30, 31) * 0.02f; + Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(15)); + } return false; } } diff --git a/Items/Weapons/Melee/Devastation.cs b/Items/Weapons/Melee/Devastation.cs index 5fa0d00651..c41aa48ea2 100644 --- a/Items/Weapons/Melee/Devastation.cs +++ b/Items/Weapons/Melee/Devastation.cs @@ -52,13 +52,53 @@ namespace CalamityMod.Items.Weapons.Melee default: break; } - Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + float num72 = item.shootSpeed; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } - Projectile blast = CalamityUtils.ProjectileToMouse(player, 4, item.shootSpeed, 0f, 40f, ModContent.ProjectileType(), damage / 2, knockBack, player.whoAmI, true); - blast.ai[1] = Main.rand.Next(5); - Projectile blast2 = CalamityUtils.ProjectileToMouse(player, 4, item.shootSpeed, 0f, 40f, ModContent.ProjectileType(), damage / 2, knockBack, player.whoAmI, true); - blast2.ai[1] = Main.rand.Next(3); - CalamityUtils.ProjectileToMouse(player, 4, item.shootSpeed, 0f, 40f, ModContent.ProjectileType(), damage / 2, knockBack, player.whoAmI, true); + int num107 = 4; + for (int num108 = 0; num108 < num107; num108++) + { + vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); + vector2.Y -= (float)(100 * num108); + num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (num79 < 0f) + { + num79 *= -1f; + } + if (num79 < 20f) + { + num79 = 20f; + } + num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + num80 = num72 / num80; + num78 *= num80; + num79 *= num80; + float speedX4 = num78 + (float)Main.rand.Next(-40, 41) * 0.02f; + float speedY5 = num79 + (float)Main.rand.Next(-40, 41) * 0.02f; + Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), damage / 2, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(5)); + Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), damage / 2, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(3)); + Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), damage / 2, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(1)); + } return false; } diff --git a/Items/Weapons/Melee/EmpyreanKnives.cs b/Items/Weapons/Melee/EmpyreanKnives.cs index c7859ef9fc..5e65ceb85b 100644 --- a/Items/Weapons/Melee/EmpyreanKnives.cs +++ b/Items/Weapons/Melee/EmpyreanKnives.cs @@ -41,24 +41,61 @@ namespace CalamityMod.Items.Weapons.Melee public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int knifeAmt = 4; + float num72 = item.shootSpeed; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); + Vector2 vector3 = Main.MouseWorld - vector2; + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + num78 *= num80; + num79 *= num80; + int num146 = 4; if (Main.rand.NextBool(2)) { - knifeAmt++; + num146++; } if (Main.rand.NextBool(4)) { - knifeAmt++; + num146++; } if (Main.rand.NextBool(8)) { - knifeAmt++; + num146++; } if (Main.rand.NextBool(16)) { - knifeAmt++; + num146++; + } + for (int num147 = 0; num147 < num146; num147++) + { + float num148 = num78; + float num149 = num79; + float num150 = 0.05f * (float)num147; + num148 += (float)Main.rand.Next(-25, 26) * num150; + num149 += (float)Main.rand.Next(-25, 26) * num150; + num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); + num80 = num72 / num80; + num148 *= num80; + num149 *= num80; + float x4 = vector2.X; + float y4 = vector2.Y; + Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 0f); } - CalamityUtils.ProjectileToMouse(player, knifeAmt, item.shootSpeed, 0.05f, 25f, type, damage, knockBack, player.whoAmI, false); return false; } diff --git a/Items/Weapons/Melee/Greentide.cs b/Items/Weapons/Melee/Greentide.cs index f63f359bba..05d1284942 100644 --- a/Items/Weapons/Melee/Greentide.cs +++ b/Items/Weapons/Melee/Greentide.cs @@ -35,23 +35,106 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy) + int i = Main.myPlayer; + float num72 = item.shootSpeed; + float num74 = knockback; + num74 = player.GetWeaponKnockback(item, num74); + player.itemTime = item.useTime; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + float num78 = (float)Main.mouseX - Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY - Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) { - return; + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + + int num107 = 4; + for (int num108 = 0; num108 < num107; num108++) + { + vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); + vector2.Y -= (float)(100 * num108); + num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (num79 < 0f) + { + num79 *= -1f; + } + if (num79 < 20f) + { + num79 = 20f; + } + num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + num80 = num72 / num80; + num78 *= num80; + num79 *= num80; + float speedX4 = num78; + float speedY5 = num79 + (float)Main.rand.Next(-180, 181) * 0.02f; + Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f)), num74, i, 0f, (float)Main.rand.Next(10)); } - if (player.whoAmI == Main.myPlayer) - SpawnTeeth(player, knockback); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - if (player.whoAmI == Main.myPlayer) - SpawnTeeth(player, item.knockBack); - } + int i = Main.myPlayer; + float num72 = item.shootSpeed; + float num74 = item.knockBack; + num74 = player.GetWeaponKnockback(item, num74); + player.itemTime = item.useTime; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + float num78 = (float)Main.mouseX - Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY - Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } - private void SpawnTeeth(Player player, float knockBack) - { - CalamityUtils.ProjectileToMouse(player, 4, item.shootSpeed, 0f, 180f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), knockBack, player.whoAmI, true); + int num107 = 4; + for (int num108 = 0; num108 < num107; num108++) + { + vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); + vector2.Y -= (float)(100 * num108); + num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (num79 < 0f) + { + num79 *= -1f; + } + if (num79 < 20f) + { + num79 = 20f; + } + num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + num80 = num72 / num80; + num78 *= num80; + num79 *= num80; + float speedX4 = num78; + float speedY5 = num79 + (float)Main.rand.Next(-180, 181) * 0.02f; + Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f)), num74, i, 0f, (float)Main.rand.Next(10)); + } } public override void MeleeEffects(Player player, Rectangle hitbox) diff --git a/Items/Weapons/Melee/MonstrousKnives.cs b/Items/Weapons/Melee/MonstrousKnives.cs index 4610385098..35800a9933 100644 --- a/Items/Weapons/Melee/MonstrousKnives.cs +++ b/Items/Weapons/Melee/MonstrousKnives.cs @@ -38,6 +38,28 @@ namespace CalamityMod.Items.Weapons.Melee public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { + float speed = item.shootSpeed; + Vector2 playerPos = player.RotatedRelativePoint(player.MountedCenter, true); + float xDist = Main.mouseX + Main.screenPosition.X - playerPos.X; + float yDist = Main.mouseY + Main.screenPosition.Y - playerPos.Y; + if (player.gravDir == -1f) + { + yDist = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - playerPos.Y; + } + Vector2 vector = new Vector2(xDist, yDist); + float speedMult = vector.Length(); + if ((float.IsNaN(xDist) && float.IsNaN(yDist)) || (xDist == 0f && yDist == 0f)) + { + xDist = player.direction; + yDist = 0f; + speedMult = speed; + } + else + { + speedMult = speed / speedMult; + } + xDist *= speedMult; + yDist *= speedMult; int knifeAmt = 3; if (Main.rand.NextBool(2)) { @@ -55,7 +77,21 @@ namespace CalamityMod.Items.Weapons.Melee { knifeAmt++; } - CalamityUtils.ProjectileToMouse(player, knifeAmt, item.shootSpeed, 0.05f, 25f, type, damage, knockBack, player.whoAmI, false); + for (int i = 0; i < knifeAmt; i++) + { + float xVec = xDist; + float yVec = yDist; + float spreadMult = 0.05f * i; + xVec += Main.rand.NextFloat(-25f, 25f) * spreadMult; + yVec += Main.rand.NextFloat(-25f, 25f) * spreadMult; + Vector2 directionToShoot = new Vector2(xVec, yVec); + speedMult = directionToShoot.Length(); + speedMult = speed / speedMult; + xVec *= speedMult; + yVec *= speedMult; + directionToShoot = new Vector2(xVec, yVec); + Projectile.NewProjectile(playerPos, directionToShoot, type, damage, knockBack, player.whoAmI, 0f, 0f); + } return false; } diff --git a/Items/Weapons/Melee/RoyalKnivesMelee.cs b/Items/Weapons/Melee/RoyalKnivesMelee.cs index ab9729b9cb..fc6cabc9ce 100644 --- a/Items/Weapons/Melee/RoyalKnivesMelee.cs +++ b/Items/Weapons/Melee/RoyalKnivesMelee.cs @@ -40,25 +40,62 @@ namespace CalamityMod.Items.Weapons.Melee public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int knifeAmt = 4; + float num72 = item.shootSpeed; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); + Vector2 vector3 = Main.MouseWorld - vector2; + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + num78 *= num80; + num79 *= num80; + int num146 = 4; if (Main.rand.NextBool(2)) { - knifeAmt++; + num146++; } if (Main.rand.NextBool(4)) { - knifeAmt++; + num146++; } if (Main.rand.NextBool(6)) { - knifeAmt++; + num146++; } if (Main.rand.NextBool(8)) { - knifeAmt++; + num146++; + } + for (int num147 = 0; num147 < num146; num147++) + { + float num148 = num78; + float num149 = num79; + float num150 = 0.05f * (float)num147; + num148 += (float)Main.rand.Next(-35, 36) * num150; + num149 += (float)Main.rand.Next(-35, 36) * num150; + num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); + num80 = num72 / num80; + num148 *= num80; + num149 *= num80; + float x4 = vector2.X; + float y4 = vector2.Y; + int knife = Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[knife].Calamity().forceMelee = true; } - Projectile knife = CalamityUtils.ProjectileToMouse(player, knifeAmt, item.shootSpeed, 0.05f, 35f, type, damage, knockBack, player.whoAmI, false); - knife.Calamity().forceMelee = true; return false; } diff --git a/Items/Weapons/Melee/StellarStriker.cs b/Items/Weapons/Melee/StellarStriker.cs index 586e845833..64b5f6c5f2 100644 --- a/Items/Weapons/Melee/StellarStriker.cs +++ b/Items/Weapons/Melee/StellarStriker.cs @@ -51,9 +51,53 @@ namespace CalamityMod.Items.Weapons.Melee private void SpawnFlares(Player player, float knockBack) { - Main.PlaySound(SoundID.Item88, player.Center); - Projectile flare = CalamityUtils.ProjectileToMouse(player, 2, item.shootSpeed, 0.03f, 80f, ProjectileID.LunarFlare, (int)(item.damage * player.MeleeDamage() * 0.5), knockBack, player.whoAmI, true, 40f); - flare.Calamity().forceMelee = true; + Main.PlaySound(SoundID.Item88, player.position); + int i = Main.myPlayer; + float num72 = item.shootSpeed; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + + int num112 = 2; + for (int num113 = 0; num113 < num112; num113++) + { + vector2 = new Vector2(player.Center.X + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); + vector2.Y -= (float)(100 * num113); + num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X + (float)Main.rand.Next(-40, 41) * 0.03f; + num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (num79 < 0f) + { + num79 *= -1f; + } + if (num79 < 20f) + { + num79 = 20f; + } + num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + num80 = num72 / num80; + num78 *= num80; + num79 *= num80; + float num114 = num78; + float num115 = num79 + (float)Main.rand.Next(-80, 81) * 0.02f; + int proj = Projectile.NewProjectile(vector2.X, vector2.Y, num114, num115, ProjectileID.LunarFlare, (int)(item.damage * player.MeleeDamage() * 0.5), knockBack, i, 0f, (float)Main.rand.Next(3)); + Main.projectile[proj].Calamity().forceMelee = true; + } } public override void MeleeEffects(Player player, Rectangle hitbox) diff --git a/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs b/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs index f7c907ea06..518361349f 100644 --- a/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs +++ b/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs @@ -40,26 +40,62 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int knifeAmt = 4; + float num72 = item.shootSpeed; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); + Vector2 vector3 = Main.MouseWorld - vector2; + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + num78 *= num80; + num79 *= num80; + int num146 = 4; if (Main.rand.NextBool(2)) { - knifeAmt++; + num146++; } if (Main.rand.NextBool(4)) { - knifeAmt++; + num146++; } if (Main.rand.NextBool(8)) { - knifeAmt++; + num146++; } if (Main.rand.NextBool(16)) { - knifeAmt++; + num146++; + } + for (int num147 = 0; num147 < num146; num147++) + { + float num148 = num78; + float num149 = num79; + float num150 = 0.05f * (float)num147; + num148 += (float)Main.rand.Next(-25, 26) * num150; + num149 += (float)Main.rand.Next(-25, 26) * num150; + num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); + num80 = num72 / num80; + num148 *= num80; + num149 *= num80; + float x4 = vector2.X; + float y4 = vector2.Y; + int knife = Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 1f); + Main.projectile[knife].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); } - Projectile knife = CalamityUtils.ProjectileToMouse(player, knifeAmt, item.shootSpeed, 0.05f, 25f, type, damage, knockBack, player.whoAmI, false); - knife.Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); - knife.Calamity().forceRogue = true; return false; } diff --git a/Items/Weapons/Rogue/LunarKunai.cs b/Items/Weapons/Rogue/LunarKunai.cs index d2aba10263..8ede908a84 100644 --- a/Items/Weapons/Rogue/LunarKunai.cs +++ b/Items/Weapons/Rogue/LunarKunai.cs @@ -42,9 +42,64 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int knifeAmt = player.Calamity().StealthStrikeAvailable() ? 5 : 3; - Projectile knife = CalamityUtils.ProjectileToMouse(player, knifeAmt, item.shootSpeed, 0.05f, 35f, type, damage, knockBack, player.whoAmI, false); - knife.Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + float num72 = item.shootSpeed; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + num78 *= num80; + num79 *= num80; + if (player.Calamity().StealthStrikeAvailable()) + { + for (int i = 0; i < 5; i++) + { + float num148 = num78; + float num149 = num79; + float num150 = 0.05f * (float)i; + num148 += (float)Main.rand.Next(-35, 36) * num150; + num149 += (float)Main.rand.Next(-35, 36) * num150; + num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); + num80 = num72 / num80; + num148 *= num80; + num149 *= num80; + float x4 = vector2.X; + float y4 = vector2.Y; + int stealth = Projectile.NewProjectile(x4, y4, num148, num149, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth].Calamity().stealthStrike = true; + } + } + else + { + for (int i = 0; i < 3; i++) + { + float num148 = num78; + float num149 = num79; + float num150 = 0.05f * (float)i; + num148 += (float)Main.rand.Next(-35, 36) * num150; + num149 += (float)Main.rand.Next(-35, 36) * num150; + num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); + num80 = num72 / num80; + num148 *= num80; + num149 *= num80; + float x4 = vector2.X; + float y4 = vector2.Y; + Projectile.NewProjectile(x4, y4, num148, num149, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + } + } return false; } diff --git a/Items/Weapons/Rogue/RoyalKnives.cs b/Items/Weapons/Rogue/RoyalKnives.cs index 55b8c52519..03098ed750 100644 --- a/Items/Weapons/Rogue/RoyalKnives.cs +++ b/Items/Weapons/Rogue/RoyalKnives.cs @@ -40,25 +40,62 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int knifeAmt = 4; + float num72 = item.shootSpeed; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); + Vector2 vector3 = Main.MouseWorld - vector2; + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + num78 *= num80; + num79 *= num80; + int num146 = 4; if (Main.rand.NextBool(2)) { - knifeAmt++; + num146++; } if (Main.rand.NextBool(4)) { - knifeAmt++; + num146++; } if (Main.rand.NextBool(6)) { - knifeAmt++; + num146++; } if (Main.rand.NextBool(8)) { - knifeAmt++; + num146++; + } + for (int num147 = 0; num147 < num146; num147++) + { + float num148 = num78; + float num149 = num79; + float num150 = 0.05f * (float)num147; + num148 += (float)Main.rand.Next(-35, 36) * num150; + num149 += (float)Main.rand.Next(-35, 36) * num150; + num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); + num80 = num72 / num80; + num148 *= num80; + num149 *= num80; + float x4 = vector2.X; + float y4 = vector2.Y; + int knife = Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[knife].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); } - Projectile knife = CalamityUtils.ProjectileToMouse(player, knifeAmt, item.shootSpeed, 0.05f, 35f, type, damage, knockBack, player.whoAmI, false); - knife.Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 0f910ae78e..ba65d066b7 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -910,23 +910,6 @@ namespace CalamityMod } } - /// - /// Shortcut for raining projectiles at a certain position - /// - /// Target to barrage with projectiles - /// Horizontal randomization limits for spawning - /// Horizontal randomization amount of the target - /// Vertical lower limit for spawning - /// Vertical upper limit for spawning - /// How fast the projectiles should be - /// Type of proj to spawn - /// Damage of the projectile - /// Knockback of the projectile - /// Who owns the projectile - // Made the below three parameters before deciding to just return a projectile - /// Set it to a number to set the type of the projectile via the force methods - /// Set to 1 for local immunity, set to 2 for ID static immunity - /// Cooldown of the above, defaults to 10 public static Projectile ProjectileRain(Vector2 targetPos, float xLimit, float xVariance, float yLimitLower, float yLimitUpper, float projSpeed, int projType, int damage, float knockback, int owner, int forceType = 0, int immunitySetting = 0, int cooldown = 10) { float x = targetPos.X + Main.rand.NextFloat(-xLimit, xLimit); @@ -986,91 +969,6 @@ namespace CalamityMod return proj; } - /// - /// Shortcut for spawning projectiles aimed at the mouse either from above or in a spread - /// - /// Player who spawns the projectiles - /// Number of projectiles to spawn - /// How fast the projectiles should be - /// Slight variance in the cone - /// Cone of spread - /// Type of proj to spawn - /// Damage of the projectile - /// Knockback of the projectile - /// Who owns the projectile - /// Set to true for the projectiles to spawn above (like Stellar Striker). Set to false for the projectiles to be thrown in a spread (like Illustrious Knives) - public static Projectile ProjectileToMouse(Player player, int projAmount, float projSpeed, float spreadMult, float targetVariance, int projType, int damage, float knockback, int owner, bool above, float targetVariance2 = 0f, float spreadMult2 = 0.02f) - { - float speed = projSpeed; - Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); - float xDist = Main.mouseX + Main.screenPosition.X - source.X; - float yDist = Main.mouseY + Main.screenPosition.Y - source.Y; - if (player.gravDir == -1f) - { - yDist = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - source.Y; - } - Vector2 mouseDir = new Vector2(xDist, yDist); - float speedMult = mouseDir.Length(); - if ((float.IsNaN(mouseDir.X) && float.IsNaN(mouseDir.Y)) || (mouseDir.X == 0f && mouseDir.Y == 0f)) - { - mouseDir.X = player.direction; - mouseDir.Y = 0f; - speedMult = speed; - } - else - { - speedMult = speed / speedMult; - } - - if (!above) - { - mouseDir.X *= speedMult; - mouseDir.Y *= speedMult; - } - - Projectile proj; - int projAmt = projAmount; - for (int i = 0; i < projAmt; i++) - { - if (above) - { - source = new Vector2(player.Center.X + (Main.rand.NextFloat(200f) * -player.direction) + (Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - source.X = (source.X + player.Center.X) / 2f + Main.rand.NextFloat(-200, 201); - source.Y -= (float)(100 * i); - mouseDir.X = (float)Main.mouseX + Main.screenPosition.X - source.X + Main.rand.NextFloat(-targetVariance2, targetVariance2) * spreadMult; - mouseDir.Y = (float)Main.mouseY + Main.screenPosition.Y - source.Y; - if (mouseDir.Y < 0f) - { - mouseDir.Y *= -1f; - } - if (mouseDir.Y < 20f) - { - mouseDir.Y = 20f; - } - speedMult = mouseDir.Length(); - speedMult = speed / speedMult; - mouseDir.X *= speedMult; - mouseDir.Y *= speedMult; - mouseDir.Y += Main.rand.NextFloat(-targetVariance, targetVariance) * spreadMult2; - proj = Projectile.NewProjectileDirect(source, mouseDir, projType, damage, knockback, owner); - } - else - { - float xVec = mouseDir.X; - float yVec = mouseDir.Y; - float spreadMultiplier = spreadMult * i; - mouseDir.X += Main.rand.NextFloat(-targetVariance, targetVariance) * spreadMultiplier; - mouseDir.Y += Main.rand.NextFloat(-targetVariance, targetVariance) * spreadMultiplier; - speedMult = mouseDir.Length(); - speedMult = speed / speedMult; - mouseDir.X *= speedMult; - mouseDir.Y *= speedMult; - Projectile.NewProjectile(source, mouseDir, type, damage, knockBack, player.whoAmI, 0f, 0f); - } - } - return proj; - } - public static int DamageSoftCap(double dmgInput, int cap) { int newDamage = (int)(dmgInput); From 0c6cdd992dee2eff925e16f4381d2067abaa18ac Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 17 Jul 2020 08:19:37 -0400 Subject: [PATCH 116/160] valediction cleanup --- Projectiles/Rogue/ValedictionBoomerang.cs | 70 +++++++++-------------- 1 file changed, 27 insertions(+), 43 deletions(-) diff --git a/Projectiles/Rogue/ValedictionBoomerang.cs b/Projectiles/Rogue/ValedictionBoomerang.cs index 1e2e86dba7..6e693b9d7f 100644 --- a/Projectiles/Rogue/ValedictionBoomerang.cs +++ b/Projectiles/Rogue/ValedictionBoomerang.cs @@ -122,77 +122,61 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 600); - int typhoonAmt = 3; - if (projectile.owner == Main.myPlayer && projectile.Calamity().stealthStrike) - { - Main.PlaySound(SoundID.Item84, projectile.position); - for (int typhoonCount = 0; typhoonCount < typhoonAmt; typhoonCount++) - { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int typhoon = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), projectile.damage / 2, 0f, projectile.owner, 0f, 0f); - Main.projectile[typhoon].Calamity().forceRogue = true; - Main.projectile[typhoon].usesLocalNPCImmunity = true; - Main.projectile[typhoon].localNPCHitCooldown = 10; - } - } + OnHitEffects(); } public override void OnHitPvp(Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType(), 600); + OnHitEffects(); + } + + private void OnHitEffects() + { int typhoonAmt = 3; if (projectile.owner == Main.myPlayer && projectile.Calamity().stealthStrike) { Main.PlaySound(SoundID.Item84, projectile.position); for (int typhoonCount = 0; typhoonCount < typhoonAmt; typhoonCount++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) + Vector2 velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (velocity.X == 0f && velocity.Y == 0f) { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int typhoon = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), projectile.damage / 3, 0f, projectile.owner, 0f, 1f); + velocity.Normalize(); + velocity *= (float)Main.rand.Next(70, 101) * 0.1f; + int typhoon = Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage / 2, 0f, projectile.owner, 0f, 0f); Main.projectile[typhoon].Calamity().forceRogue = true; Main.projectile[typhoon].usesLocalNPCImmunity = true; Main.projectile[typhoon].localNPCHitCooldown = 10; } } - } + } public override void Kill(int timeLeft) { Main.PlaySound(SoundID.Item21, projectile.position); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = 100; - projectile.height = 100; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num621 = 0; num621 < 5; num621++) + projectile.position = projectile.Center; + projectile.width = projectile.height = 100; + projectile.Center = projectile.position; + for (int d = 0; d < 5; d++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 3f; + int water = Dust.NewDust(projectile.position, projectile.width, projectile.height, 33, 0f, 0f, 100, default, 2f); + Main.dust[water].velocity *= 3f; if (Main.rand.NextBool(2)) { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[water].scale = 0.5f; + Main.dust[water].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - for (int num623 = 0; num623 < 8; num623++) + for (int d = 0; d < 8; d++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 2f); - Main.dust[num624].velocity *= 2f; + int water = Dust.NewDust(projectile.position, projectile.width, projectile.height, 33, 0f, 0f, 100, default, 3f); + Main.dust[water].noGravity = true; + Main.dust[water].velocity *= 5f; + water = Dust.NewDust(projectile.position, projectile.width, projectile.height, 33, 0f, 0f, 100, default, 2f); + Main.dust[water].velocity *= 2f; } } } From 648a22645045909c9ad6ace6ef857bcbc7a5a28d Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 17 Jul 2020 08:29:00 -0400 Subject: [PATCH 117/160] more valediction cleanup --- Projectiles/Rogue/GlaiveProj.cs | 8 +- Projectiles/Rogue/ValedictionBoomerang.cs | 283 +++++++++++----------- 2 files changed, 144 insertions(+), 147 deletions(-) diff --git a/Projectiles/Rogue/GlaiveProj.cs b/Projectiles/Rogue/GlaiveProj.cs index e2a3d4a386..f8af833e7e 100644 --- a/Projectiles/Rogue/GlaiveProj.cs +++ b/Projectiles/Rogue/GlaiveProj.cs @@ -82,25 +82,25 @@ namespace CalamityMod.Projectiles.Rogue // Home back in on the player. if (projectile.velocity.X < xDist) { - projectile.velocity.X = projectile.velocity.X + acceleration; + projectile.velocity.X += acceleration; if (projectile.velocity.X < 0f && xDist > 0f) projectile.velocity.X += acceleration; } else if (projectile.velocity.X > xDist) { - projectile.velocity.X = projectile.velocity.X - acceleration; + projectile.velocity.X -= acceleration; if (projectile.velocity.X > 0f && xDist < 0f) projectile.velocity.X -= acceleration; } if (projectile.velocity.Y < yDist) { - projectile.velocity.Y = projectile.velocity.Y + acceleration; + projectile.velocity.Y += acceleration; if (projectile.velocity.Y < 0f && yDist > 0f) projectile.velocity.Y += acceleration; } else if (projectile.velocity.Y > yDist) { - projectile.velocity.Y = projectile.velocity.Y - acceleration; + projectile.velocity.Y -= acceleration; if (projectile.velocity.Y > 0f && yDist < 0f) projectile.velocity.Y -= acceleration; } diff --git a/Projectiles/Rogue/ValedictionBoomerang.cs b/Projectiles/Rogue/ValedictionBoomerang.cs index 6e693b9d7f..3196886e20 100644 --- a/Projectiles/Rogue/ValedictionBoomerang.cs +++ b/Projectiles/Rogue/ValedictionBoomerang.cs @@ -9,135 +9,132 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class ValedictionBoomerang : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Scythe"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } + public class ValedictionBoomerang : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Scythe"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } - public override void SetDefaults() - { - projectile.width = 70; - projectile.height = 70; - projectile.friendly = true; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.extraUpdates = 3; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 15; - projectile.Calamity().rogue = true; - } + public override void SetDefaults() + { + projectile.width = projectile.height = 70; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.extraUpdates = 3; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 15; + projectile.Calamity().rogue = true; + } - public override void AI() - { + public override void AI() + { Player player = Main.player[projectile.owner]; - if (projectile.soundDelay == 0) - { - projectile.soundDelay = 8; - Main.PlaySound(SoundID.Item7, projectile.position); - } - if (projectile.ai[0] == 0f) - { - projectile.ai[1] += 1f; - if (projectile.ai[1] >= 60f) - { - projectile.ai[0] = 1f; - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - else - { + if (projectile.soundDelay == 0) + { + projectile.soundDelay = 8; + Main.PlaySound(SoundID.Item7, projectile.position); + } + if (projectile.ai[0] == 0f) + { + projectile.ai[1] += 1f; + if (projectile.ai[1] >= 60f) + { + projectile.ai[0] = 1f; + projectile.ai[1] = 0f; + projectile.netUpdate = true; + } + else + { CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 400f, 20f, 20f); - } - } - else - { - float returnSpeed = 30f; - float num43 = 5f; - Vector2 projPos = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float xDist = player.position.X + (float)(player.width / 2) - projPos.X; - float yDist = player.position.Y + (float)(player.height / 2) - projPos.Y; - float playerDist = (float)Math.Sqrt((double)(xDist * xDist + yDist * yDist)); - if (playerDist > 3000f) - { - projectile.Kill(); - } - playerDist = returnSpeed / playerDist; - xDist *= playerDist; - yDist *= playerDist; - if (projectile.velocity.X < xDist) - { - projectile.velocity.X = projectile.velocity.X + num43; - if (projectile.velocity.X < 0f && xDist > 0f) - { - projectile.velocity.X = projectile.velocity.X + num43; - } - } - else if (projectile.velocity.X > xDist) - { - projectile.velocity.X = projectile.velocity.X - num43; - if (projectile.velocity.X > 0f && xDist < 0f) - { - projectile.velocity.X = projectile.velocity.X - num43; - } - } - if (projectile.velocity.Y < yDist) - { - projectile.velocity.Y = projectile.velocity.Y + num43; - if (projectile.velocity.Y < 0f && yDist > 0f) - { - projectile.velocity.Y = projectile.velocity.Y + num43; - } - } - else if (projectile.velocity.Y > yDist) - { - projectile.velocity.Y = projectile.velocity.Y - num43; - if (projectile.velocity.Y > 0f && yDist < 0f) - { - projectile.velocity.Y = projectile.velocity.Y - num43; - } - } - if (Main.myPlayer == projectile.owner) - { - Rectangle projHitbox = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); - Rectangle playerHitbox = new Rectangle((int)player.position.X, (int)player.position.Y, player.width, player.height); - if (projHitbox.Intersects(playerHitbox)) - { - projectile.Kill(); - } - } - } - projectile.rotation += 0.5f; - } + } + } + else + { + float returnSpeed = 30f; + float acceleration = 5f; + Vector2 projVector = player.Center - projectile.Center; + float playerDist = projVector.Length(); + if (playerDist > 3000f) + { + projectile.Kill(); + } + playerDist = returnSpeed / playerDist; + projVector.X *= playerDist; + projVector.Y *= playerDist; + if (projectile.velocity.X < projVector.X) + { + projectile.velocity.X += acceleration; + if (projectile.velocity.X < 0f && projVector.X > 0f) + { + projectile.velocity.X += acceleration; + } + } + else if (projectile.velocity.X > projVector.X) + { + projectile.velocity.X -= acceleration; + if (projectile.velocity.X > 0f && projVector.X < 0f) + { + projectile.velocity.X -= acceleration; + } + } + if (projectile.velocity.Y < projVector.Y) + { + projectile.velocity.Y += acceleration; + if (projectile.velocity.Y < 0f && projVector.Y > 0f) + { + projectile.velocity.Y += acceleration; + } + } + else if (projectile.velocity.Y > projVector.Y) + { + projectile.velocity.Y -= acceleration; + if (projectile.velocity.Y > 0f && projVector.Y < 0f) + { + projectile.velocity.Y -= acceleration; + } + } + if (Main.myPlayer == projectile.owner) + { + Rectangle projHitbox = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); + Rectangle playerHitbox = new Rectangle((int)player.position.X, (int)player.position.Y, player.width, player.height); + if (projHitbox.Intersects(playerHitbox)) + { + projectile.Kill(); + } + } + } + projectile.rotation += 0.5f; + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 600); + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 600); OnHitEffects(); - } + } - public override void OnHitPvp(Player target, int damage, bool crit) - { - target.AddBuff(ModContent.BuffType(), 600); + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 600); OnHitEffects(); - } + } private void OnHitEffects() { int typhoonAmt = 3; if (projectile.owner == Main.myPlayer && projectile.Calamity().stealthStrike) { - Main.PlaySound(SoundID.Item84, projectile.position); - for (int typhoonCount = 0; typhoonCount < typhoonAmt; typhoonCount++) + Main.PlaySound(SoundID.Item84, projectile.position); + for (int typhoonCount = 0; typhoonCount < typhoonAmt; typhoonCount++) { Vector2 velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); while (velocity.X == 0f && velocity.Y == 0f) @@ -146,38 +143,38 @@ namespace CalamityMod.Projectiles.Rogue } velocity.Normalize(); velocity *= (float)Main.rand.Next(70, 101) * 0.1f; - int typhoon = Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage / 2, 0f, projectile.owner, 0f, 0f); - Main.projectile[typhoon].Calamity().forceRogue = true; - Main.projectile[typhoon].usesLocalNPCImmunity = true; - Main.projectile[typhoon].localNPCHitCooldown = 10; + Projectile typhoon = Projectile.NewProjectileDirect(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage / 2, 0f, projectile.owner); + typhoon.Calamity().forceRogue = true; + typhoon.usesLocalNPCImmunity = true; + typhoon.localNPCHitCooldown = 10; } } } - public override void Kill(int timeLeft) - { - Main.PlaySound(SoundID.Item21, projectile.position); + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item21, projectile.position); projectile.position = projectile.Center; - projectile.width = projectile.height = 100; - projectile.Center = projectile.position; - for (int d = 0; d < 5; d++) - { - int water = Dust.NewDust(projectile.position, projectile.width, projectile.height, 33, 0f, 0f, 100, default, 2f); - Main.dust[water].velocity *= 3f; - if (Main.rand.NextBool(2)) - { - Main.dust[water].scale = 0.5f; - Main.dust[water].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int d = 0; d < 8; d++) - { - int water = Dust.NewDust(projectile.position, projectile.width, projectile.height, 33, 0f, 0f, 100, default, 3f); - Main.dust[water].noGravity = true; - Main.dust[water].velocity *= 5f; - water = Dust.NewDust(projectile.position, projectile.width, projectile.height, 33, 0f, 0f, 100, default, 2f); - Main.dust[water].velocity *= 2f; - } - } - } + projectile.width = projectile.height = 100; + projectile.Center = projectile.position; + for (int d = 0; d < 5; d++) + { + int water = Dust.NewDust(projectile.position, projectile.width, projectile.height, 33, 0f, 0f, 100, default, 2f); + Main.dust[water].velocity *= 3f; + if (Main.rand.NextBool(2)) + { + Main.dust[water].scale = 0.5f; + Main.dust[water].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int d = 0; d < 8; d++) + { + int water = Dust.NewDust(projectile.position, projectile.width, projectile.height, 33, 0f, 0f, 100, default, 3f); + Main.dust[water].noGravity = true; + Main.dust[water].velocity *= 5f; + water = Dust.NewDust(projectile.position, projectile.width, projectile.height, 33, 0f, 0f, 100, default, 2f); + Main.dust[water].velocity *= 2f; + } + } + } } From 8a0d1f2456744f688c20c598bf7068d8e6ceaf2f Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 17 Jul 2020 11:11:19 -0400 Subject: [PATCH 118/160] crimulan blight slimes now drop red colored blighted gel --- NPCs/NormalNPCs/CrimulanBlightSlime.cs | 7 ++++++- NPCs/SulphurousSea/Mauler.cs | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/NPCs/NormalNPCs/CrimulanBlightSlime.cs b/NPCs/NormalNPCs/CrimulanBlightSlime.cs index 8b66fe1c81..da8584888f 100644 --- a/NPCs/NormalNPCs/CrimulanBlightSlime.cs +++ b/NPCs/NormalNPCs/CrimulanBlightSlime.cs @@ -1,6 +1,8 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Melee; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -70,7 +72,10 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - DropHelper.DropItem(npc, ModContent.ItemType(), 15, 16); + int item = Item.NewItem(npc.Center, npc.Size, ModContent.ItemType(), Main.rand.Next(15, 21), false, 0, false, false); + Main.item[item].color = new Color(250, 50, 50, 255); + NetMessage.SendData(88, -1, -1, null, item, 1f, 0f, 0f, 0, 0, 0); + DropHelper.DropItem(npc, ItemID.Gel, 10, 14); DropHelper.DropItemCondition(npc, ModContent.ItemType(), NPC.downedBoss3, 0.01f, 1, 1); } diff --git a/NPCs/SulphurousSea/Mauler.cs b/NPCs/SulphurousSea/Mauler.cs index bb7a967fe0..b1ca5493c2 100644 --- a/NPCs/SulphurousSea/Mauler.cs +++ b/NPCs/SulphurousSea/Mauler.cs @@ -351,7 +351,7 @@ namespace CalamityMod.NPCs.SulphurousSea public override void NPCLoot() { DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedPolterghast, 3, 1, 1); - int item = Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SharkFin, Main.rand.Next(2, 5), false, 0, false, false); + int item = Item.NewItem(npc.Center, npc.Size, ItemID.SharkFin, Main.rand.Next(2, 5), false, 0, false, false); Main.item[item].color = new Color(151, 115, 57, 255); NetMessage.SendData(88, -1, -1, null, item, 1f, 0f, 0f, 0, 0, 0); } From 8408748dbde4cb59353b7bb287c823cc4587784a Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 17 Jul 2020 15:53:49 -0400 Subject: [PATCH 119/160] made a utility for summoning off screen projectiles --- NPCs/SulphurousSea/Mauler.cs | 42 +++--- Projectiles/Magic/InfernalBlade.cs | 53 ++++--- Projectiles/Magic/LiquidBlade.cs | 31 ++-- Projectiles/Melee/DragonPowFlail.cs | 60 ++++---- Projectiles/Melee/ElementBallShiv.cs | 53 +++---- Projectiles/Melee/ExoGladProj.cs | 139 ++++++------------ Projectiles/Melee/HellionSpike.cs | 34 +++-- Projectiles/Melee/SHIV.cs | 20 +-- .../Spears/ExsanguinationLanceProjectile.cs | 34 +++-- .../Spears/HellionFlowerSpearProjectile.cs | 38 ++--- .../Melee/Spears/TenebreusTidesProjectile.cs | 15 +- .../Melee/TenebreusTidesWaterProjectile.cs | 15 +- Projectiles/Melee/TyphonsGreedStaff.cs | 17 +-- Projectiles/Ranged/AMRShot.cs | 39 ++--- Projectiles/Ranged/HyperiusBulletProj.cs | 29 ++-- Projectiles/Ranged/HyperiusSplit.cs | 2 + Projectiles/Ranged/PiercingBullet.cs | 37 ++--- Projectiles/Ranged/SeasSearingBubble.cs | 47 +++--- Utilities/CalamityUtils.cs | 20 +++ 19 files changed, 329 insertions(+), 396 deletions(-) diff --git a/NPCs/SulphurousSea/Mauler.cs b/NPCs/SulphurousSea/Mauler.cs index b1ca5493c2..aefec17e21 100644 --- a/NPCs/SulphurousSea/Mauler.cs +++ b/NPCs/SulphurousSea/Mauler.cs @@ -147,25 +147,25 @@ namespace CalamityMod.NPCs.SulphurousSea } else { - npc.velocity.X = npc.velocity.X + (float)npc.direction * 0.2f; + npc.velocity.X += (float)npc.direction * 0.2f; if (npc.velocity.X < -4f || npc.velocity.X > 4f) { - npc.velocity.X = npc.velocity.X * 0.95f; + npc.velocity.X *= 0.95f; } if (npc.ai[0] == -1f) { - npc.velocity.Y = npc.velocity.Y - 0.01f; - if ((double)npc.velocity.Y < -0.3) - { - npc.ai[0] = 1f; - } - } - else - { - npc.velocity.Y = npc.velocity.Y + 0.01f; - if ((double)npc.velocity.Y > 0.3) - { - npc.ai[0] = -1f; + npc.velocity.Y -= 0.01f; + if (npc.velocity.Y < -0.3f) + { + npc.ai[0] = 1f; + } + } + else + { + npc.velocity.Y += 0.01f; + if (npc.velocity.Y > 0.3f) + { + npc.ai[0] = -1f; } } } @@ -194,9 +194,9 @@ namespace CalamityMod.NPCs.SulphurousSea npc.ai[0] = -1f; } } - if ((double)npc.velocity.Y > 0.4 || (double)npc.velocity.Y < -0.4) + if (npc.velocity.Y > 0.4f || npc.velocity.Y < -0.4f) { - npc.velocity.Y = npc.velocity.Y * 0.95f; + npc.velocity.Y *= 0.95f; } } else @@ -261,11 +261,11 @@ namespace CalamityMod.NPCs.SulphurousSea } } npc.rotation = npc.velocity.Y * (float)npc.direction * 0.1f; - if ((double)npc.rotation < -0.2) + if (npc.rotation < -0.2f) { npc.rotation = -0.2f; } - if ((double)npc.rotation > 0.2) + if (npc.rotation > 0.2f) { npc.rotation = 0.2f; return; @@ -303,7 +303,7 @@ namespace CalamityMod.NPCs.SulphurousSea } for (int num621 = 0; num621 < 25; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 31, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(npc.position, npc.width, npc.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -314,10 +314,10 @@ namespace CalamityMod.NPCs.SulphurousSea } for (int num623 = 0; num623 < 50; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; Main.dust[num624].noGravity = true; } diff --git a/Projectiles/Magic/InfernalBlade.cs b/Projectiles/Magic/InfernalBlade.cs index ae4b69cf78..da9fd69275 100644 --- a/Projectiles/Magic/InfernalBlade.cs +++ b/Projectiles/Magic/InfernalBlade.cs @@ -59,24 +59,21 @@ namespace CalamityMod.Projectiles.Magic { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); Main.PlaySound(SoundID.Item10, projectile.position); - int num487 = Main.rand.Next(4, 10); - for (int num488 = 0; num488 < num487; num488++) + int dustAmt = Main.rand.Next(4, 10); + for (int d = 0; d < dustAmt; d++) { - int num489 = Dust.NewDust(projectile.Center, 0, 0, 182, 0f, 0f, 100, default, 1f); - Main.dust[num489].velocity *= 1.6f; - Dust expr_FEDF_cp_0 = Main.dust[num489]; - expr_FEDF_cp_0.velocity.Y -= 1f; - Main.dust[num489].velocity += -projectile.velocity * (Main.rand.NextFloat() * 2f - 1f) * 0.5f; - Main.dust[num489].scale = 2f; - Main.dust[num489].fadeIn = 0.5f; - Main.dust[num489].noGravity = true; + int fire = Dust.NewDust(projectile.Center, 0, 0, 182, 0f, 0f, 100, default, 1f); + Dust dust = Main.dust[fire]; + dust.velocity *= 1.6f; + dust.velocity.Y -= 1f; + dust.velocity += -projectile.velocity * (Main.rand.NextFloat() * 2f - 1f) * 0.5f; + dust.scale = 2f; + dust.fadeIn = 0.5f; + dust.noGravity = true; } } - public override Color? GetAlpha(Color lightColor) - { - return new Color(255, 50, 50, 0); - } + public override Color? GetAlpha(Color lightColor) => new Color(255, 50, 50, 0); public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { @@ -119,20 +116,22 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - float xPos = projectile.Center.X + 800 * Main.rand.NextBool(2).ToDirectionInt(); - float yPos = projectile.Center.Y + Main.rand.Next(-800, 801); - Vector2 spawnPosition = new Vector2(xPos, yPos); - Vector2 velocity = target.Center - spawnPosition; - float dir = 10 / spawnPosition.X; - velocity.X *= dir * 150; - velocity.Y *= dir * 150; - velocity.X = MathHelper.Clamp(velocity.X, -15f, 15f); - velocity.Y = MathHelper.Clamp(velocity.Y, -15f, 15f); - if (projectile.owner == Main.myPlayer) - { - Projectile.NewProjectile(spawnPosition, velocity, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.75), 1f, projectile.owner); - } + OnHitEffects(target.Center); target.AddBuff(ModContent.BuffType(), 240); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + OnHitEffects(target.Center); + target.AddBuff(ModContent.BuffType(), 240); + } + + private void OnHitEffects(Vector2 targetPos) + { + if (projectile.owner == Main.myPlayer) + { + CalamityUtils.ProjectileBarrage(projectile.Center, targetPos, Main.rand.NextBool(), 800f, 800f, 0f, 800f, 10f, ModContent.ProjectileType(), (int)(projectile.damage * 0.75), 1f, projectile.owner, true); + } + } } } diff --git a/Projectiles/Magic/LiquidBlade.cs b/Projectiles/Magic/LiquidBlade.cs index 7ff3f82483..bcc8f79caa 100644 --- a/Projectiles/Magic/LiquidBlade.cs +++ b/Projectiles/Magic/LiquidBlade.cs @@ -120,23 +120,28 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - float xPos = projectile.Center.X + 800 * Main.rand.NextBool(2).ToDirectionInt(); - float yPos = projectile.Center.Y + Main.rand.Next(-800, 801); - Vector2 spawnPosition = new Vector2(xPos, yPos); - Vector2 velocity = target.Center - spawnPosition; - float dir = 10 / spawnPosition.X; - velocity.X *= dir * 150; - velocity.Y *= dir * 150; - velocity.X = MathHelper.Clamp(velocity.X, -15f, 15f); - velocity.Y = MathHelper.Clamp(velocity.Y, -15f, 15f); - if (projectile.owner == Main.myPlayer) - { - Projectile.NewProjectile(spawnPosition, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.75), 1f, projectile.owner); - } + OnHitEffects(target.Center); target.AddBuff(BuffID.Ichor, 240); target.AddBuff(BuffID.Frostburn, 240); target.AddBuff(BuffID.OnFire, 240); target.AddBuff(BuffID.CursedInferno, 120); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + OnHitEffects(target.Center); + target.AddBuff(BuffID.Ichor, 240); + target.AddBuff(BuffID.Frostburn, 240); + target.AddBuff(BuffID.OnFire, 240); + target.AddBuff(BuffID.CursedInferno, 120); + } + + private void OnHitEffects(Vector2 targetPos) + { + if (projectile.owner == Main.myPlayer) + { + CalamityUtils.ProjectileBarrage(projectile.Center, targetPos, Main.rand.NextBool(), 800f, 800f, 0f, 800f, 10f, ModContent.ProjectileType(), (int)(projectile.damage * 0.75), 1f, projectile.owner, true); + } + } } } diff --git a/Projectiles/Melee/DragonPowFlail.cs b/Projectiles/Melee/DragonPowFlail.cs index 706d707863..a335681163 100644 --- a/Projectiles/Melee/DragonPowFlail.cs +++ b/Projectiles/Melee/DragonPowFlail.cs @@ -150,61 +150,57 @@ namespace CalamityMod.Projectiles.Melee if (target.type == NPCID.TargetDummy) return; - PetalStorm(target, damage, knockback, crit); - Waterfalls(target, damage, knockback, crit); + PetalStorm(target.Center); + Waterfalls(target.Center); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + // Inflicts Abyssal Flames and Holy Flames for 8 seconds on-hit + target.AddBuff(ModContent.BuffType(), 480); + target.AddBuff(ModContent.BuffType(), 480); + + projectile.ai[0] = 1f; + projectile.netUpdate = true; + + PetalStorm(target.Center); + Waterfalls(target.Center); } // Spawns a storm of flower petals on-hit. - private void PetalStorm(NPC target, int damage, float knockback, bool crit) + private void PetalStorm(Vector2 targetPos) { - Main.PlaySound(SoundID.Item105, target.Center); + Main.PlaySound(SoundID.Item105, targetPos); int type = ProjectileID.FlowerPetal; int numPetals = 12; int petalDamage = projectile.damage / 8; float petalKB = 0f; - Player owner = Main.player[projectile.owner]; for (int i = 0; i < numPetals; ++i) { - float startOffsetX = Main.rand.NextFloat(1000f, 1400f) * (Main.rand.NextBool() ? -1f : 1f); - float startOffsetY = Main.rand.NextFloat(80f, 900f) * (Main.rand.NextBool() ? -1f : 1f); - Vector2 startPos = new Vector2(target.Center.X + startOffsetX, target.Center.Y + startOffsetY); - float dx = target.Center.X - startPos.X; - float dy = target.Center.Y - startPos.Y; - - // Add some randomness / inaccuracy to the petal target location - dx += Main.rand.NextFloat(-5f, 5f); - dy += Main.rand.NextFloat(-5f, 5f); - float speed = Main.rand.NextFloat(DragonPow.MinPetalSpeed, DragonPow.MaxPetalSpeed); - float dist = (float)Math.Sqrt((double)(dx * dx + dy * dy)); - dist = speed / dist; - dx *= dist; - dy *= dist; - Vector2 petalVel = new Vector2(dx, dy); - float angle = Main.rand.NextFloat(MathHelper.TwoPi); - if (projectile.owner == Main.myPlayer) - { - int idx = Projectile.NewProjectile(startPos, petalVel, type, petalDamage, petalKB, projectile.owner, 0f, 0f); - Main.projectile[idx].rotation = angle; - Main.projectile[idx].melee = true; - Main.projectile[idx].usesLocalNPCImmunity = true; - Main.projectile[idx].localNPCHitCooldown = -1; - } + if (projectile.owner == Main.myPlayer) + { + float angle = Main.rand.NextFloat(MathHelper.TwoPi); + Projectile petal = CalamityUtils.ProjectileBarrage(projectile.Center, targetPos, Main.rand.NextBool(), 1000f, 1400f, 80f, 900f, Main.rand.NextFloat(DragonPow.MinPetalSpeed, DragonPow.MaxPetalSpeed), type, petalDamage, petalKB, projectile.owner); + petal.rotation = angle; + petal.Calamity().forceMelee = true; + petal.usesLocalNPCImmunity = true; + petal.localNPCHitCooldown = -1; + } } } - private void Waterfalls(NPC target, int damage, float knockback, bool crit) + private void Waterfalls(Vector2 targetPos) { int type = ModContent.ProjectileType(); int numWaterfalls = 12; int waterfallDamage = projectile.damage / 6; float waterfallKB = 0f; - Player owner = Main.player[projectile.owner]; for (int i = 0; i < numWaterfalls; ++i) { float startOffsetX = Main.rand.NextFloat(-120f, 120f); float startOffsetY = Main.rand.NextFloat(-740f, -700f); - Vector2 startPos = new Vector2(target.Center.X + startOffsetX, target.Center.Y + startOffsetY); + Vector2 startPos = new Vector2(targetPos.X + startOffsetX, targetPos.Y + startOffsetY); float fallSpeed = Main.rand.NextFloat(DragonPow.MinWaterfallSpeed, DragonPow.MaxWaterfallSpeed); Vector2 fallVec = new Vector2(0f, fallSpeed); fallVec = fallVec.RotatedBy(Main.rand.NextFloat(-0.08f, 0.08f)); diff --git a/Projectiles/Melee/ElementBallShiv.cs b/Projectiles/Melee/ElementBallShiv.cs index 687772a7b8..f808dd0b00 100644 --- a/Projectiles/Melee/ElementBallShiv.cs +++ b/Projectiles/Melee/ElementBallShiv.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { - projectile.width = 10; - projectile.height = 10; + projectile.width = 20; + projectile.height = 20; projectile.friendly = true; projectile.melee = true; projectile.penetrate = 1; @@ -29,9 +29,9 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - int num250 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, (float)(projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.3f); - Main.dust[num250].noGravity = true; - Main.dust[num250].velocity *= 0f; + int rainbow = Dust.NewDust(projectile.position, projectile.width, projectile.height, 66, (float)(projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.3f); + Main.dust[rainbow].noGravity = true; + Main.dust[rainbow].velocity = Vector2.Zero; CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 600f, 36f, 20f); } @@ -48,35 +48,38 @@ namespace CalamityMod.Projectiles.Melee { for (int k = 0; k < 4; k++) { - int num = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 66, (float)(projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f); - Main.dust[num].noGravity = true; + int rainbow = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 66, (float)(projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f); + Main.dust[rainbow].noGravity = true; } } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (projectile.owner == Main.myPlayer) - { - for (int i = 0; i < 4; i++) - { - float xPos = i < 2 ? projectile.Center.X + 800 : projectile.Center.X - 800; - Vector2 source = new Vector2(xPos, projectile.Center.Y + Main.rand.Next(-800, 801)); - - float xStart = xPos; - Vector2 speed = target.Center - source; - float dir = speed.Length(); - dir = 10 / xStart; - float random = (float)Main.rand.Next(1, 150); - - speed.X *= dir * random; - speed.Y *= dir * random; - Projectile.NewProjectile(source, speed, ModContent.ProjectileType(), projectile.damage, 1f, projectile.owner); - } - } + OnHitEffects(target.Center); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + OnHitEffects(target.Center); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + } + + private void OnHitEffects(Vector2 targetPos) + { + for (int x = 0; x < 4; x++) + { + if (projectile.owner == Main.myPlayer) + { + CalamityUtils.ProjectileBarrage(projectile.Center, targetPos, x > 2, 800f, 800f, 0f, 800f, 1f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, false, 50f); + } + } + } } } diff --git a/Projectiles/Melee/ExoGladProj.cs b/Projectiles/Melee/ExoGladProj.cs index ae2b717f7e..c30a1e6fb3 100644 --- a/Projectiles/Melee/ExoGladProj.cs +++ b/Projectiles/Melee/ExoGladProj.cs @@ -38,58 +38,26 @@ namespace CalamityMod.Projectiles.Melee } else { - for (int num41 = 0; num41 < 2; num41++) + for (int i = 0; i < 2; i++) { - int dustType = num41 == 0 ? 107 : 234; + int dustType = i == 0 ? 107 : 234; if (Main.rand.NextBool(4)) { dustType = 269; } - Vector2 value8 = Vector2.UnitX * -12f; - value8 = -Vector2.UnitY.RotatedBy((double)(counter * 0.1308997f + (float)num41 * 3.14159274f), default) * value7; - int num42 = Dust.NewDust(projectile.Center, 0, 0, dustType, 0f, 0f, 160, default, 1.5f); - Main.dust[num42].noGravity = true; - Main.dust[num42].position = projectile.Center + value8; - Main.dust[num42].velocity = projectile.velocity; - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 0.8f); - Main.dust[num458].noGravity = true; - Main.dust[num458].velocity *= 0f; + Vector2 offset = Vector2.UnitX * -12f; + offset = -Vector2.UnitY.RotatedBy((double)(counter * 0.1308997f + (float)i * MathHelper.Pi), default) * value7; + int exo = Dust.NewDust(projectile.Center, 0, 0, dustType, 0f, 0f, 160, default, 1.5f); + Main.dust[exo].noGravity = true; + Main.dust[exo].position = projectile.Center + offset; + Main.dust[exo].velocity = projectile.velocity; + int dusters = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 0.8f); + Main.dust[dusters].noGravity = true; + Main.dust[dusters].velocity *= 0f; } } - float num472 = projectile.Center.X; - float num473 = projectile.Center.Y; - float num474 = 1000f; - bool flag17 = false; - for (int num475 = 0; num475 < Main.npc.Length; num475++) - { - if (Main.npc[num475].CanBeChasedBy(projectile, false)) - { - float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); - float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); - if (num478 < num474) - { - num474 = num478; - num472 = num476; - num473 = num477; - flag17 = true; - } - } - } - if (flag17) - { - float num483 = 36f; - Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num484 = num472 - vector35.X; - float num485 = num473 - vector35.Y; - float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); - num486 = num483 / num486; - num484 *= num486; - num485 *= num486; - projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; - projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; - } + CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 1000f, 36f, 20f); } public override void Kill(int timeLeft) @@ -102,57 +70,14 @@ namespace CalamityMod.Projectiles.Melee }); for (int k = 0; k < 4; k++) { - int num = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, dustType, (float)(projectile.direction * 2), 0f, 150, default, 1f); - Main.dust[num].noGravity = true; + int exo = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, dustType, (float)(projectile.direction * 2), 0f, 150, default, 1f); + Main.dust[exo].noGravity = true; } } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - int type = ModContent.ProjectileType(); - int numSwords = Main.rand.Next(1,4); - float swordKB = projectile.knockBack; - for (int i = 0; i < numSwords; ++i) - { - float startOffsetX = Main.rand.NextFloat(1000f, 1400f) * (Main.rand.NextBool() ? -1f : 1f); - float startOffsetY = Main.rand.NextFloat(80f, 900f) * (Main.rand.NextBool() ? -1f : 1f); - Vector2 startPos = new Vector2(target.Center.X + startOffsetX, target.Center.Y + startOffsetY); - float dx = target.Center.X - startPos.X; - float dy = target.Center.Y - startPos.Y; - - dx += Main.rand.NextFloat(-5f, 5f); - dy += Main.rand.NextFloat(-5f, 5f); - float speed = Main.rand.NextFloat(24f, 30f); - float dist = (float)Math.Sqrt((double)(dx * dx + dy * dy)); - dist = speed / dist; - dx *= dist; - dy *= dist; - Vector2 swordVel = new Vector2(dx, dy); - float angle = Main.rand.NextFloat(MathHelper.TwoPi); - if (projectile.owner == Main.myPlayer) - { - int idx = Projectile.NewProjectile(startPos, swordVel, type, (int)((double)projectile.damage * 0.25), swordKB, projectile.owner, 0f, 0f); - Main.projectile[idx].rotation = angle; - } - } - - int spearAmt = Main.rand.Next(1,4); - for (int n = 0; n < spearAmt; n++) - { - float x = projectile.position.X + (float)Main.rand.Next(-400, 400); - float y = projectile.position.Y + (float)Main.rand.Next(800, 1000); - Vector2 vector = new Vector2(x, y); - float num13 = projectile.position.X + (float)(projectile.width / 2) - vector.X; - float num14 = projectile.position.Y + (float)(projectile.height / 2) - vector.Y; - num13 += (float)Main.rand.Next(-100, 101); - int num15 = 29; - float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); - num16 = (float)num15 / num16; - num13 *= num16; - num14 *= num16; - int num17 = Projectile.NewProjectile(x, y, num13, num14, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), swordKB, projectile.owner, 0f, 0f); - } - + OnHitEffects(target.Center); target.AddBuff(ModContent.BuffType(), 30); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); @@ -163,5 +88,39 @@ namespace CalamityMod.Projectiles.Melee target.AddBuff(BuffID.OnFire, 120); target.AddBuff(BuffID.Ichor, 120); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + OnHitEffects(target.Center); + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + + private void OnHitEffects(Vector2 targetPos) + { + float swordKB = projectile.knockBack; + int swordDmg = (int)(projectile.damage * 0.25); + int numSwords = Main.rand.Next(1,4); + int spearAmt = Main.rand.Next(1,4); + if (projectile.owner == Main.myPlayer) + { + for (int i = 0; i < numSwords; ++i) + { + CalamityUtils.ProjectileBarrage(projectile.Center, targetPos, Main.rand.NextBool(), 1000f, 1400f, 80f, 900f, Main.rand.NextFloat(24f, 30f), ModContent.ProjectileType(), swordDmg, swordKB, projectile.owner); + } + + for (int n = 0; n < spearAmt; n++) + { + CalamityUtils.ProjectileRain(targetPos, 400f, 100f, -1000f, -800f, 29f, ModContent.ProjectileType(), swordDmg, swordKB, projectile.owner); + } + } + } } } diff --git a/Projectiles/Melee/HellionSpike.cs b/Projectiles/Melee/HellionSpike.cs index 2e7c6bc864..64c2de990b 100644 --- a/Projectiles/Melee/HellionSpike.cs +++ b/Projectiles/Melee/HellionSpike.cs @@ -56,25 +56,27 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.immune[projectile.owner] = 8; + OnHitEffects(target.Center, crit); target.AddBuff(BuffID.Venom, 300); - if (crit) - { - float xPos = projectile.Center.X + 800 * Main.rand.NextBool(2).ToDirectionInt(); - float yPos = projectile.Center.Y + Main.rand.Next(-800, 801); - Vector2 spawnPosition = new Vector2(xPos, yPos); - Vector2 velocity = target.Center - spawnPosition; - float dir = 10 / spawnPosition.X; - velocity.X *= dir * 150; - velocity.Y *= dir * 150; - velocity.X = MathHelper.Clamp(velocity.X, -15f, 15f); - velocity.Y = MathHelper.Clamp(velocity.Y, -15f, 15f); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + OnHitEffects(target.Center, crit); + target.AddBuff(BuffID.Venom, 300); + } + + private void OnHitEffects(Vector2 targetPos, bool crit) + { + if (crit) + { if (projectile.owner == Main.myPlayer) { - int petal = Projectile.NewProjectile(spawnPosition, velocity, ProjectileID.FlowerPetal, (int)(projectile.damage * 0.5), projectile.knockBack * 0.5f, projectile.owner); - Main.projectile[petal].Calamity().forceMelee = true; - Main.projectile[petal].localNPCHitCooldown = -1; + Projectile petal = CalamityUtils.ProjectileBarrage(projectile.Center, targetPos, Main.rand.NextBool(), 800f, 800f, 0f, 800f, 10f, ProjectileID.FlowerPetal, (int)(projectile.damage * 0.5), projectile.knockBack * 0.5f, projectile.owner, true); + petal.Calamity().forceMelee = true; + petal.localNPCHitCooldown = -1; } - } - } + } + } } } diff --git a/Projectiles/Melee/SHIV.cs b/Projectiles/Melee/SHIV.cs index 1072dba0d2..40091aee13 100644 --- a/Projectiles/Melee/SHIV.cs +++ b/Projectiles/Melee/SHIV.cs @@ -18,29 +18,31 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { - projectile.width = 10; - projectile.height = 10; + projectile.width = 20; + projectile.height = 20; projectile.friendly = true; projectile.melee = true; projectile.penetrate = 1; projectile.tileCollide = false; projectile.timeLeft = 600; projectile.aiStyle = 27; + projectile.extraUpdates = 1; } public override void AI() { - projectile.velocity.X *= 1.075f; - projectile.velocity.Y *= 1.075f; - int num250 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, (float)(projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.3f); - Main.dust[num250].noGravity = true; - Main.dust[num250].velocity *= 0f; + if (projectile.velocity.Length() < 25f && projectile.timeLeft % 2 == 0) + projectile.velocity *= 1.04f; + + int rainbow = Dust.NewDust(projectile.position, projectile.width, projectile.height, 66, (float)(projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.3f); + Main.dust[rainbow].noGravity = true; + Main.dust[rainbow].velocity = Vector2.Zero; } public override void Kill(int timeLeft) { - int num = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 66, (float)(projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f); - Main.dust[num].noGravity = true; + int rainbow = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 66, (float)(projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f); + Main.dust[rainbow].noGravity = true; } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs b/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs index e98f738239..47f5399f4e 100644 --- a/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs +++ b/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs @@ -38,17 +38,29 @@ namespace CalamityMod.Projectiles.Melee.Spears if (Main.rand.NextBool(5)) Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, Main.rand.NextBool(3) ? 16 : 127, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - Vector2 goreVec = new Vector2(projectile.position.X + (float)(projectile.width / 2) + projectile.velocity.X, projectile.position.Y + (float)(projectile.height / 2) + projectile.velocity.Y); + Vector2 goreVec = projectile.Center + projectile.velocity; if (Main.rand.NextBool(8)) { int smoke = Gore.NewGore(goreVec, default, Main.rand.Next(375, 378), 1f); Main.gore[smoke].behindTiles = true; } } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.immune[projectile.owner] = 6; + OnHitEffects(target.Center, crit); target.AddBuff(BuffID.OnFire, 300); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + OnHitEffects(target.Center, crit); + target.AddBuff(BuffID.OnFire, 300); + } + + private void OnHitEffects(Vector2 targetPos, bool crit) + { if (projectile.owner == Main.myPlayer) { int boom = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); @@ -58,20 +70,12 @@ namespace CalamityMod.Projectiles.Melee.Spears { for (int i = 0; i < 2; i++) { - float xPos = projectile.position.X + 800f * Main.rand.NextBool(2).ToDirectionInt(); - Vector2 spawnPosition = new Vector2(xPos, projectile.position.Y - Main.rand.Next(-800, 801)); - float speedX = target.position.X - spawnPosition.X; - float speedY = target.position.Y - spawnPosition.Y; - float magnitude = (float)Math.Sqrt(speedX * speedX + speedY * speedY); - magnitude = 10f / xPos; - speedX *= magnitude * 150; - speedY *= magnitude * 150; - speedX = MathHelper.Clamp(speedX, -15f, 15f); - speedY = MathHelper.Clamp(speedY, -15f, 15f); - if (projectile.owner == Main.myPlayer) - Projectile.NewProjectile(spawnPosition.X, spawnPosition.Y, speedX, speedY, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), 2f, projectile.owner); - } - } + if (projectile.owner == Main.myPlayer) + { + CalamityUtils.ProjectileBarrage(projectile.Center, targetPos, Main.rand.NextBool(), 800f, 800f, 0f, 800f, 10f, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), 2f, projectile.owner, true); + } + } + } } } } diff --git a/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs b/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs index 4fc87924f3..f4970d16a2 100644 --- a/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs +++ b/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs @@ -37,27 +37,29 @@ namespace CalamityMod.Projectiles.Melee.Spears { Projectile.NewProjectile(projectile.Center.X + projectile.velocity.X, projectile.Center.Y + projectile.velocity.Y, projectile.velocity.X * 2.4f, projectile.velocity.Y * 2.4f, ModContent.ProjectileType(), (int)(projectile.damage * 0.65), projectile.knockBack * 0.85f, projectile.owner, 0f, 0f); }; - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.immune[projectile.owner] = 8; - target.AddBuff(BuffID.Venom, 300); + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.immune[projectile.owner] = 8; + OnHitEffects(target.Center, crit); + target.AddBuff(BuffID.Venom, 300); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + OnHitEffects(target.Center, crit); + target.AddBuff(BuffID.Venom, 300); + } + + private void OnHitEffects(Vector2 targetPos, bool crit) + { if (crit) { - float xPos = projectile.position.X + 800f * Main.rand.NextBool(2).ToDirectionInt(); - Vector2 spawnPosition = new Vector2(xPos, projectile.position.Y - Main.rand.Next(-800, 801)); - float speedX = target.position.X - spawnPosition.X; - float speedY = target.position.Y - spawnPosition.Y; - float magnitude = (float)Math.Sqrt(speedX * speedX + speedY * speedY); - magnitude = 10f / xPos; - speedX *= magnitude * 150; - speedY *= magnitude * 150; - speedX = MathHelper.Clamp(speedX, -15f, 15f); - speedY = MathHelper.Clamp(speedY, -15f, 15f); - if (projectile.owner == Main.myPlayer) + if (projectile.owner == Main.myPlayer) { - int petal = Projectile.NewProjectile(spawnPosition.X, spawnPosition.Y, speedX, speedY, ProjectileID.FlowerPetal, (int)(projectile.damage * 0.5), 2f, projectile.owner); - Main.projectile[petal].Calamity().forceMelee = true; - Main.projectile[petal].localNPCHitCooldown = -1; + Projectile petal = CalamityUtils.ProjectileBarrage(projectile.Center, targetPos, Main.rand.NextBool(), 800f, 800f, 0f, 800f, 10f, ProjectileID.FlowerPetal, (int)(projectile.damage * 0.5), projectile.knockBack * 0.5f, projectile.owner, true); + petal.Calamity().forceMelee = true; + petal.localNPCHitCooldown = -1; } } } diff --git a/Projectiles/Melee/Spears/TenebreusTidesProjectile.cs b/Projectiles/Melee/Spears/TenebreusTidesProjectile.cs index d228b7851f..755b3b173d 100644 --- a/Projectiles/Melee/Spears/TenebreusTidesProjectile.cs +++ b/Projectiles/Melee/Spears/TenebreusTidesProjectile.cs @@ -64,22 +64,9 @@ namespace CalamityMod.Projectiles.Melee.Spears for (int i = 0; i < projAmt; ++i) { int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); - float startOffsetX = Main.rand.NextFloat(1000f, 1400f) * (Main.rand.NextBool() ? -1f : 1f); - float startOffsetY = Main.rand.NextFloat(80f, 900f) * (Main.rand.NextBool() ? -1f : 1f); - Vector2 startPos = new Vector2(targetPos.X + startOffsetX, targetPos.Y + startOffsetY); - Vector2 projVel = targetPos - startPos; - - // Add some randomness / inaccuracy to the projectile target location - projVel.X += Main.rand.NextFloat(-5f, 5f); - projVel.Y += Main.rand.NextFloat(-5f, 5f); - float speed = Main.rand.NextFloat(25f, 35f); - float dist = projVel.Length(); - dist = speed / dist; - projVel.X *= dist; - projVel.Y *= dist; if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(startPos, projVel, type, projectile.damage / 2, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f); + CalamityUtils.ProjectileBarrage(projectile.Center, targetPos, Main.rand.NextBool(), 1000f, 1400f, 80f, 900f, Main.rand.NextFloat(25f, 35f), type, projectile.damage / 2, projectile.knockBack * 0.5f, projectile.owner); } } } diff --git a/Projectiles/Melee/TenebreusTidesWaterProjectile.cs b/Projectiles/Melee/TenebreusTidesWaterProjectile.cs index 9860c3de00..7970a0aa6a 100644 --- a/Projectiles/Melee/TenebreusTidesWaterProjectile.cs +++ b/Projectiles/Melee/TenebreusTidesWaterProjectile.cs @@ -98,22 +98,9 @@ namespace CalamityMod.Projectiles.Melee for (int i = 0; i < projAmt; ++i) { int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); - float startOffsetX = Main.rand.NextFloat(1000f, 1400f) * (Main.rand.NextBool() ? -1f : 1f); - float startOffsetY = Main.rand.NextFloat(80f, 900f) * (Main.rand.NextBool() ? -1f : 1f); - Vector2 startPos = new Vector2(targetPos.X + startOffsetX, targetPos.Y + startOffsetY); - Vector2 projVel = targetPos - startPos; - - // Add some randomness / inaccuracy to the projectile target location - projVel.X += Main.rand.NextFloat(-5f, 5f); - projVel.Y += Main.rand.NextFloat(-5f, 5f); - float speed = Main.rand.NextFloat(25f, 35f); - float dist = projVel.Length(); - dist = speed / dist; - projVel.X *= dist; - projVel.Y *= dist; if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(startPos, projVel, type, projectile.damage / 2, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f); + CalamityUtils.ProjectileBarrage(projectile.Center, targetPos, Main.rand.NextBool(), 1000f, 1400f, 80f, 900f, Main.rand.NextFloat(25f, 35f), type, projectile.damage / 2, projectile.knockBack * 0.5f, projectile.owner); } } } diff --git a/Projectiles/Melee/TyphonsGreedStaff.cs b/Projectiles/Melee/TyphonsGreedStaff.cs index 1ff3b8b1a3..2b213b2620 100644 --- a/Projectiles/Melee/TyphonsGreedStaff.cs +++ b/Projectiles/Melee/TyphonsGreedStaff.cs @@ -142,19 +142,10 @@ namespace CalamityMod.Projectiles.Melee projectile.localAI[0] += 1f; if (projectile.localAI[0] % 12f == 0f) { - float xPos = projectile.Center.X + 800 * Main.rand.NextBool(2).ToDirectionInt(); - float yPos = projectile.Center.Y + Main.rand.Next(-800, 801); - Vector2 spawnPosition = new Vector2(xPos, yPos); - Vector2 velocity = player.Center - spawnPosition; - float dir = 10 / spawnPosition.X; - velocity.X *= dir * 150; - velocity.Y *= dir * 150; - velocity.X = MathHelper.Clamp(velocity.X, -15f, 15f); - velocity.Y = MathHelper.Clamp(velocity.Y, -15f, 15f); if (projectile.owner == Main.myPlayer) { - float ai1 = Main.rand.NextFloat() + 0.5f; - Projectile.NewProjectile(spawnPosition, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), projectile.knockBack * 0.5f, projectile.owner, 0f, ai1); + Projectile bubble = CalamityUtils.ProjectileBarrage(projectile.Center, player.Center, Main.rand.NextBool(), 800f, 800f, 0f, 800f, 10f, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), projectile.knockBack * 0.5f, projectile.owner, true); + bubble.ai[1] = Main.rand.NextFloat() + 0.5f; } } } @@ -164,10 +155,10 @@ namespace CalamityMod.Projectiles.Melee Rectangle myRect = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); if (projectile.owner == Main.myPlayer) { - for (int i = 0; i < 200; i++) + for (int i = 0; i < Main.maxNPCs; i++) { if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && - ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == NPCID.Guide && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == NPCID.Clothier && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || + ((projectile.friendly && (!Main.npc[i].friendly || (Main.npc[i].type == NPCID.Guide && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == NPCID.Clothier && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || (projectile.hostile && Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles)) && (projectile.owner < 0 || Main.npc[i].immune[projectile.owner] == 0 || projectile.maxPenetrate == 1)) { if (Main.npc[i].noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(Main.npc[i])) diff --git a/Projectiles/Ranged/AMRShot.cs b/Projectiles/Ranged/AMRShot.cs index c7d8403d73..b6a2b523e2 100644 --- a/Projectiles/Ranged/AMRShot.cs +++ b/Projectiles/Ranged/AMRShot.cs @@ -40,29 +40,32 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (crit) - { - for (int x = 0; x < 8; x++) - { - float xPos = x > 4 ? projectile.Center.X + 500 : projectile.Center.X - 500; - float yPos = projectile.Center.Y + Main.rand.Next(-500, 501); - Vector2 spawnPosition = new Vector2(xPos, yPos); - Vector2 velocity = target.Center - spawnPosition; - float dir = velocity.Length(); - dir = 10 / spawnPosition.X; - velocity.X *= dir * 150; - velocity.Y *= dir * 150; - if (projectile.owner == Main.myPlayer) - { - Projectile.NewProjectile(spawnPosition, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.1), 1f, projectile.owner); - } - } - } + OnHitEffects(target.Center, crit); target.AddBuff(ModContent.BuffType(), 600); if (target.defense > 50) { target.defense -= 50; } + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + OnHitEffects(target.Center, crit); + target.AddBuff(ModContent.BuffType(), 600); + } + + private void OnHitEffects(Vector2 targetPos, bool crit) + { + if (crit) + { + for (int x = 0; x < 8; x++) + { + if (projectile.owner == Main.myPlayer) + { + CalamityUtils.ProjectileBarrage(projectile.Center, targetPos, x > 4, 500f, 500f, 0f, 500f, 10f, ModContent.ProjectileType(), (int)(projectile.damage * 0.1), 1f, projectile.owner); + } + } + } } } } diff --git a/Projectiles/Ranged/HyperiusBulletProj.cs b/Projectiles/Ranged/HyperiusBulletProj.cs index f580d96470..2f0713c0b3 100644 --- a/Projectiles/Ranged/HyperiusBulletProj.cs +++ b/Projectiles/Ranged/HyperiusBulletProj.cs @@ -75,21 +75,20 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - float xPos = projectile.Center.X + 800 * Main.rand.NextBool(2).ToDirectionInt(); - float yPos = projectile.Center.Y + Main.rand.Next(-800, 801); - Vector2 spawnPosition = new Vector2(xPos, yPos); - Vector2 velocity = target.Center - spawnPosition; - float dir = 10 / spawnPosition.X; - velocity.X *= dir * 150; - velocity.Y *= dir * 150; - velocity.X = MathHelper.Clamp(velocity.X, -15f, 15f); - velocity.Y = MathHelper.Clamp(velocity.Y, -15f, 15f); - if (projectile.owner == Main.myPlayer) - { - int splitDamage = (int)(projectile.damage * 0.6f); - float splitKB = 1f; - Projectile.NewProjectile(spawnPosition, velocity, ModContent.ProjectileType(), splitDamage, splitKB, projectile.owner); - } + OnHitEffects(target.Center); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + OnHitEffects(target.Center); + } + + private void OnHitEffects(Vector2 targetPos) + { + if (projectile.owner == Main.myPlayer) + { + CalamityUtils.ProjectileBarrage(projectile.Center, targetPos, Main.rand.NextBool(), 800f, 800f, 0f, 800f, 10f, ModContent.ProjectileType(), (int)(projectile.damage * 0.6), 1f, projectile.owner, true); + } } public override void Kill(int timeLeft) diff --git a/Projectiles/Ranged/HyperiusSplit.cs b/Projectiles/Ranged/HyperiusSplit.cs index 83c1c3f3c9..60719f0a07 100644 --- a/Projectiles/Ranged/HyperiusSplit.cs +++ b/Projectiles/Ranged/HyperiusSplit.cs @@ -50,6 +50,8 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { + if (projectile.timeLeft == 360) + return false; CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); return false; } diff --git a/Projectiles/Ranged/PiercingBullet.cs b/Projectiles/Ranged/PiercingBullet.cs index 29d5803af7..05416b3556 100644 --- a/Projectiles/Ranged/PiercingBullet.cs +++ b/Projectiles/Ranged/PiercingBullet.cs @@ -54,48 +54,29 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (crit) - { - int bulletCount = 10; - for (int x = 0; x < bulletCount; x++) - { - float speed = 12f; - float xPos = projectile.Center.X + (x < bulletCount / 2 ? 500f : -500f); - float yPos = projectile.Center.Y + Main.rand.Next(-500, 501); - Vector2 origin = new Vector2(xPos, yPos); - Vector2 velocity = new Vector2(target.Center.X - origin.X, target.Center.Y - origin.Y); - velocity.Normalize(); - velocity *= speed; - if (projectile.owner == Main.myPlayer) - { - Projectile.NewProjectile(origin, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.2), projectile.knockBack, projectile.owner); - } - } - } + OnHitEffects(target.Center, crit); target.AddBuff(ModContent.BuffType(), 900); } public override void OnHitPvp(Player target, int damage, bool crit) { + OnHitEffects(target.Center, crit); + target.AddBuff(ModContent.BuffType(), 900); + } + + private void OnHitEffects(Vector2 targetPos, bool crit) + { if (crit) { int bulletCount = 10; for (int x = 0; x < bulletCount; x++) { - float speed = 12f; - float xPos = projectile.Center.X + (x < bulletCount / 2 ? 500f : -500f); - float yPos = projectile.Center.Y + Main.rand.Next(-500, 501); - Vector2 origin = new Vector2(xPos, yPos); - Vector2 velocity = new Vector2(target.Center.X - origin.X, target.Center.Y - origin.Y); - velocity.Normalize(); - velocity *= speed; if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(origin, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.2), projectile.knockBack, projectile.owner); - } + CalamityUtils.ProjectileBarrage(projectile.Center, targetPos, x < bulletCount / 2, 500f, 500f, 0f, 500f, 12f, ModContent.ProjectileType(), (int)(projectile.damage * 0.2), projectile.knockBack, projectile.owner); + } } } - target.AddBuff(ModContent.BuffType(), 900); } } } diff --git a/Projectiles/Ranged/SeasSearingBubble.cs b/Projectiles/Ranged/SeasSearingBubble.cs index 40baf7cdb3..56554d93b7 100644 --- a/Projectiles/Ranged/SeasSearingBubble.cs +++ b/Projectiles/Ranged/SeasSearingBubble.cs @@ -88,42 +88,33 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - Main.PlaySound(SoundID.Item96, projectile.position); + OnHitEffects(target.Center); target.AddBuff(BuffID.Wet, 240); target.AddBuff(ModContent.BuffType(), 240); + } - int type = ModContent.ProjectileType(); + public override void OnHitPvp(Player target, int damage, bool crit) + { + OnHitEffects(target.Center); + target.AddBuff(BuffID.Wet, 240); + target.AddBuff(ModContent.BuffType(), 240); + } + + private void OnHitEffects(Vector2 targetPos) + { + Main.PlaySound(SoundID.Item96, projectile.Center); if (projectile.ai[0] == 1f) { - int numWaterBlasts = 2; - int waterDamage = SeasSearing.BaseDamage / 2; - float waterKB = 1f; - Player owner = Main.player[projectile.owner]; - for (int i = 0; i < numWaterBlasts; ++i) + for (int x = 0; x < 2; x++) { - float startOffsetX = Main.rand.NextFloat(1000f, 1400f) * (Main.rand.NextBool() ? -1f : 1f); - float startOffsetY = Main.rand.NextFloat(80f, 900f) * (Main.rand.NextBool() ? -1f : 1f); - Vector2 startPos = new Vector2(target.Center.X + startOffsetX, target.Center.Y + startOffsetY); - float dx = target.Center.X - startPos.X; - float dy = target.Center.Y - startPos.Y; - - // Add some randomness / inaccuracy - dx += Main.rand.NextFloat(-5f, 5f); - dy += Main.rand.NextFloat(-5f, 5f); - float speed = Main.rand.NextFloat(20f, 25f); - float dist = (float)Math.Sqrt((double)(dx * dx + dy * dy)); - dist = speed / dist; - dx *= dist; - dy *= dist; - Vector2 waterVel = new Vector2(dx, dy); - float angle = Main.rand.NextFloat(MathHelper.TwoPi); if (projectile.owner == Main.myPlayer) { - int idx = Projectile.NewProjectile(startPos, waterVel, type, waterDamage, waterKB, projectile.owner, 0f, 0f); - Main.projectile[idx].rotation = angle; - Main.projectile[idx].tileCollide = false; - Main.projectile[idx].usesLocalNPCImmunity = true; - Main.projectile[idx].localNPCHitCooldown = -1; + float angle = Main.rand.NextFloat(MathHelper.TwoPi); + Projectile bubble = CalamityUtils.ProjectileBarrage(projectile.Center, targetPos, Main.rand.NextBool(), 1000f, 1400f, 80f, 900f, Main.rand.NextFloat(20f, 25f), ModContent.ProjectileType(), projectile.damage / 2, 1f, projectile.owner); + bubble.rotation = angle; + bubble.tileCollide = false; + bubble.usesLocalNPCImmunity = true; + bubble.localNPCHitCooldown = -1; } } } diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index ba65d066b7..45de219e3e 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -969,6 +969,26 @@ namespace CalamityMod return proj; } + public static Projectile ProjectileBarrage(Vector2 originVec, Vector2 targetPos, bool fromRight, float xOffsetMin, float xOffsetMax, float yOffsetMin, float yOffsetMax, float projSpeed, int projType, int damage, float knockback, int owner, bool clamped = false, float inaccuracyOffset = 5f) + { + float xPos = originVec.X + Main.rand.NextFloat(xOffsetMin, xOffsetMax) * fromRight.ToDirectionInt(); + float yPos = originVec.Y + Main.rand.NextFloat(yOffsetMin, yOffsetMax) * Main.rand.NextBool().ToDirectionInt(); + Vector2 spawnPosition = new Vector2(xPos, yPos); + Vector2 velocity = targetPos - spawnPosition; + velocity.X += Main.rand.NextFloat(-inaccuracyOffset, inaccuracyOffset); + velocity.Y += Main.rand.NextFloat(-inaccuracyOffset, inaccuracyOffset); + velocity.Normalize(); + velocity *= projSpeed * (clamped ? 150f : 1f); + //This clamp means the spawned projectiles only go at diagnals and are not accurate + if (clamped) + { + velocity.X = MathHelper.Clamp(velocity.X, -15f, 15f); + velocity.Y = MathHelper.Clamp(velocity.Y, -15f, 15f); + } + Projectile proj = Projectile.NewProjectileDirect(spawnPosition, velocity, projType, damage, knockback, owner); + return proj; + } + public static int DamageSoftCap(double dmgInput, int cap) { int newDamage = (int)(dmgInput); From 4bf362618069c2e7bdbf85c6225c5236cb1cbc82 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 17 Jul 2020 16:21:30 -0400 Subject: [PATCH 120/160] fixed flat damage bug on bone breaker --- Projectiles/Melee/BonebreakerProjectile.cs | 43 +++++++++++++--------- Projectiles/Melee/GreenBall.cs | 8 +--- Projectiles/Melee/RedBall.cs | 8 +--- 3 files changed, 29 insertions(+), 30 deletions(-) diff --git a/Projectiles/Melee/BonebreakerProjectile.cs b/Projectiles/Melee/BonebreakerProjectile.cs index cdafa10941..704f138600 100644 --- a/Projectiles/Melee/BonebreakerProjectile.cs +++ b/Projectiles/Melee/BonebreakerProjectile.cs @@ -31,10 +31,9 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - int num982 = 25; if (projectile.alpha > 0) { - projectile.alpha -= num982; + projectile.alpha -= 25; } if (projectile.alpha < 0) { @@ -42,16 +41,13 @@ namespace CalamityMod.Projectiles.Melee } if (projectile.ai[0] == 0f) { - projectile.ai[1] += 1f; - if (projectile.ai[1] >= 45f) + projectile.localAI[1] += 1f; + if (projectile.localAI[1] >= 45f) { - float num986 = 0.98f; - float num987 = 0.35f; - projectile.ai[1] = 45f; - projectile.velocity.X = projectile.velocity.X * num986; - projectile.velocity.Y = projectile.velocity.Y + num987; + projectile.velocity.X *= 0.98f; + projectile.velocity.Y += 0.35f; } - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + MathHelper.PiOver2; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; } //Sticky Behaviour projectile.StickyProjAI(15); @@ -59,7 +55,7 @@ namespace CalamityMod.Projectiles.Melee public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - projectile.ModifyHitNPCSticky(6, false); + projectile.ModifyHitNPCSticky(6, true); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) @@ -86,16 +82,16 @@ namespace CalamityMod.Projectiles.Melee } if (projectile.owner == Main.myPlayer) { - for (int num252 = 0; num252 < Main.rand.Next(2,5); num252++) + for (int s = 0; s < Main.rand.Next(2,5); s++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) + Vector2 velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (velocity.X == 0f && velocity.Y == 0f) { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int shard = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)((float)Bonebreaker.BaseDamage * 0.5f), projectile.knockBack * 0.5f, projectile.owner, Main.rand.Next(0,4), 0f); + velocity.Normalize(); + velocity *= (float)Main.rand.Next(70, 101) * 0.1f; + int shard = Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.5f), projectile.knockBack * 0.5f, projectile.owner, Main.rand.Next(0,4), 0f); } } } @@ -113,5 +109,16 @@ namespace CalamityMod.Projectiles.Melee target.AddBuff(BuffID.Venom, 240); target.AddBuff(ModContent.BuffType(), 240); } + + public override bool? CanHitNPC(NPC target) + { + if (projectile.ai[0] == 1f) + { + return false; + } + return null; + } + + public override bool CanHitPvp(Player target) => projectile.ai[0] != 1f; } } diff --git a/Projectiles/Melee/GreenBall.cs b/Projectiles/Melee/GreenBall.cs index 5ca2cbf060..f7c99668db 100644 --- a/Projectiles/Melee/GreenBall.cs +++ b/Projectiles/Melee/GreenBall.cs @@ -7,8 +7,6 @@ namespace CalamityMod.Projectiles.Melee { public class GreenBall : ModProjectile { - private int projTime = 15; - public override void SetStaticDefaults() { DisplayName.SetDefault("Green Bag"); @@ -36,14 +34,12 @@ namespace CalamityMod.Projectiles.Melee projectile.alpha = 0; } projectile.rotation = projectile.velocity.X * 0.04f; - projTime--; - if (projTime == 0) + if (projectile.timeLeft % 15 == 0) { if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0.35f, projectile.velocity.Y * 0.35f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.75), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0.35f, projectile.velocity.Y * 0.35f, ModContent.ProjectileType(), (int)(projectile.damage * 0.75), projectile.knockBack, projectile.owner, 0f, 0f); } - projTime = 15; } } diff --git a/Projectiles/Melee/RedBall.cs b/Projectiles/Melee/RedBall.cs index a489dc1a20..b3da2a6d7f 100644 --- a/Projectiles/Melee/RedBall.cs +++ b/Projectiles/Melee/RedBall.cs @@ -7,8 +7,6 @@ namespace CalamityMod.Projectiles.Melee { public class RedBall : ModProjectile { - private int projTime = 15; - public override void SetStaticDefaults() { DisplayName.SetDefault("Red Bag"); @@ -36,14 +34,12 @@ namespace CalamityMod.Projectiles.Melee projectile.alpha = 0; } projectile.rotation = projectile.velocity.X * 0.04f; - projTime--; - if (projTime == 0) + if (projectile.timeLeft % 15 == 0) { if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0.35f, projectile.velocity.Y * 0.35f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.75), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0.35f, projectile.velocity.Y * 0.35f, ModContent.ProjectileType(), (int)(projectile.damage * 0.75), projectile.knockBack, projectile.owner, 0f, 0f); } - projTime = 15; } } From 2a152b5e9551cb1c494a3e065833a2007ce09ddf Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 17 Jul 2020 16:30:59 -0400 Subject: [PATCH 121/160] a little profaned partisan cleanup --- Projectiles/Rogue/ProfanedPartisanproj.cs | 28 ++++++++++------------ Projectiles/Rogue/ProfanedPartisanspear.cs | 24 +++++++------------ 2 files changed, 21 insertions(+), 31 deletions(-) diff --git a/Projectiles/Rogue/ProfanedPartisanproj.cs b/Projectiles/Rogue/ProfanedPartisanproj.cs index 992f348aa5..f5f60cf019 100644 --- a/Projectiles/Rogue/ProfanedPartisanproj.cs +++ b/Projectiles/Rogue/ProfanedPartisanproj.cs @@ -1,16 +1,15 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Rogue { public class ProfanedPartisanproj : ModProjectile { - public int stealthStrikeTimer = 0; - public override void SetStaticDefaults() { DisplayName.SetDefault("Profaned Partisan"); @@ -64,9 +63,9 @@ namespace CalamityMod.Projectiles.Rogue drawOriginOffsetY = 2; } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { - int d = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1.1f); + int d = Dust.NewDust(projectile.position, projectile.width, projectile.height, (int)CalamityDusts.ProfanedFire, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1.1f); Main.dust[d].position = projectile.Center; Main.dust[d].velocity *= 0.3f; Main.dust[d].velocity += projectile.velocity * 0.85f; @@ -75,13 +74,11 @@ namespace CalamityMod.Projectiles.Rogue if (projectile.Calamity().stealthStrike) //Stealth strike { - Vector2 spearposition = new Vector2(projectile.Center.X + Main.rand.NextFloat(-15f, 15f), projectile.Center.Y + Main.rand.NextFloat(-15f, 15f)); - Vector2 spearspeed = new Vector2(projectile.velocity.X, projectile.velocity.Y); - stealthStrikeTimer++; - if (stealthStrikeTimer >= 18) + Vector2 spearPosition = new Vector2(projectile.Center.X + Main.rand.NextFloat(-15f, 15f), projectile.Center.Y + Main.rand.NextFloat(-15f, 15f)); + Vector2 spearSpeed = projectile.velocity; + if (projectile.timeLeft % 18 == 0) { - Projectile.NewProjectile(spearposition, spearspeed, ModContent.ProjectileType(), projectile.damage/10, projectile.knockBack, projectile.owner, 0f, 0f); - stealthStrikeTimer = 0; + Projectile.NewProjectile(spearPosition, spearSpeed, ModContent.ProjectileType(), projectile.damage / 10, projectile.knockBack * 0.1f, projectile.owner); } } } @@ -90,11 +87,10 @@ namespace CalamityMod.Projectiles.Rogue { for (int i = 0; i < 20; i++) { - Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 50, default(Color), 2.6f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 50, default(Color), 2.6f); } Main.PlaySound(SoundID.Item45, projectile.position); - Vector2 explode = new Vector2(0f, 0f); - Projectile.NewProjectile(projectile.Center, explode, ModContent.ProjectileType(), projectile.damage/2, projectile.knockBack * 1.3f, projectile.owner); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage / 2, projectile.knockBack * 0.5f, projectile.owner); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Rogue/ProfanedPartisanspear.cs b/Projectiles/Rogue/ProfanedPartisanspear.cs index d69ca6b7e3..79c8b1d30d 100644 --- a/Projectiles/Rogue/ProfanedPartisanspear.cs +++ b/Projectiles/Rogue/ProfanedPartisanspear.cs @@ -53,32 +53,28 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - if (projectile.ai[1] != 1f) - { - projectile.velocity.X = -projectile.velocity.X; - projectile.velocity.Y = -projectile.velocity.Y; - projectile.ai[1] = 1f; - projectile.ai[0] = 1f; - projectile.extraUpdates = 2; - if (projectile.timeLeft > 280) - projectile.timeLeft = 280; - } + OnHitEffects(); } public override void OnHitPvp(Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType(), 120); + OnHitEffects(); + } + + private void OnHitEffects() + { if (projectile.ai[1] != 1f) { - projectile.velocity.X = -projectile.velocity.X; - projectile.velocity.Y = -projectile.velocity.Y; + projectile.velocity.X *= -1f; + projectile.velocity.Y *= -1f; projectile.ai[1] = 1f; projectile.ai[0] = 1f; projectile.extraUpdates = 2; if (projectile.timeLeft > 280) projectile.timeLeft = 280; } - } + } public override void AI() { @@ -88,8 +84,6 @@ namespace CalamityMod.Projectiles.Rogue timer++; if (timer >= 5) projectile.penetrate = 1; - float pcx = projectile.Center.X; - float pcy = projectile.Center.Y; if (timer >= 10) { CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 800f, 7f, 20f); From 720a258764e5965dab40fbd4f7b48defc985797f Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 17 Jul 2020 19:39:20 -0400 Subject: [PATCH 122/160] moved this commit to this branch --- Projectiles/Boss/BrimstoneMonster.cs | 226 ++++++++++++++------------- Utilities/CalamityUtils.cs | 2 +- 2 files changed, 115 insertions(+), 113 deletions(-) diff --git a/Projectiles/Boss/BrimstoneMonster.cs b/Projectiles/Boss/BrimstoneMonster.cs index 0bd500e3be..82cf189fc3 100644 --- a/Projectiles/Boss/BrimstoneMonster.cs +++ b/Projectiles/Boss/BrimstoneMonster.cs @@ -9,57 +9,57 @@ using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { - public class BrimstoneMonster : ModProjectile - { - private float speedAdd = 0f; - private float speedLimit = 0f; + public class BrimstoneMonster : ModProjectile + { + private float speedAdd = 0f; + private float speedLimit = 0f; - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brimstone Monster"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brimstone Monster"); + } - public override void SetDefaults() - { - projectile.width = 320; - projectile.height = 320; - projectile.hostile = true; - projectile.ignoreWater = true; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.timeLeft = 36000; - projectile.Opacity = 0f; - cooldownSlot = 1; - } + public override void SetDefaults() + { + projectile.width = 320; + projectile.height = 320; + projectile.hostile = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.timeLeft = 36000; + projectile.Opacity = 0f; + cooldownSlot = 1; + } - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(speedAdd); - writer.Write(projectile.localAI[0]); - writer.Write(speedLimit); - } + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(speedAdd); + writer.Write(projectile.localAI[0]); + writer.Write(speedLimit); + } - public override void ReceiveExtraAI(BinaryReader reader) - { - speedAdd = reader.ReadSingle(); - projectile.localAI[0] = reader.ReadSingle(); - speedLimit = reader.ReadSingle(); - } + public override void ReceiveExtraAI(BinaryReader reader) + { + speedAdd = reader.ReadSingle(); + projectile.localAI[0] = reader.ReadSingle(); + speedLimit = reader.ReadSingle(); + } - public override void AI() - { - if (!CalamityPlayer.areThereAnyDamnBosses) - { - projectile.active = false; - projectile.netUpdate = true; - return; - } + public override void AI() + { + if (!CalamityPlayer.areThereAnyDamnBosses) + { + projectile.active = false; + projectile.netUpdate = true; + return; + } int choice = (int)projectile.ai[1]; if (projectile.localAI[0] == 0f) { projectile.soundDelay = 1125 - (choice * 225); - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/BrimstoneMonsterSpawn"), (int)projectile.Center.X, (int)projectile.Center.Y); + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/BrimstoneMonsterSpawn"), projectile.Center); projectile.localAI[0] += 1f; switch (choice) { @@ -86,21 +86,21 @@ namespace CalamityMod.Projectiles.Boss if (projectile.soundDelay <= 0 && (choice == 0 || choice == 2)) { projectile.soundDelay = 420; - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/BrimstoneMonsterDrone"), (int)projectile.Center.X, (int)projectile.Center.Y); + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/BrimstoneMonsterDrone"), projectile.Center); } - bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive; + bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive; - Lighting.AddLight(projectile.Center, 3f, 0f, 0f); + Lighting.AddLight(projectile.Center, 3f, 0f, 0f); - float num953 = (revenge ? 5f : 4.5f) + speedAdd; //100 - float scaleFactor12 = (revenge ? 1.5f : 1.35f) + (speedAdd * 0.25f); //5 - float num954 = 160f; + float inertia = (revenge ? 5f : 4.5f) + speedAdd; //100 + float speed = (revenge ? 1.5f : 1.35f) + (speedAdd * 0.25f); //5 + float minDist = 160f; if (NPC.AnyNPCs(ModContent.NPCType())) { - num953 *= 0.5f; - scaleFactor12 *= 0.5f; + inertia *= 0.5f; + speed *= 0.5f; } if (projectile.timeLeft < 90) @@ -108,92 +108,94 @@ namespace CalamityMod.Projectiles.Boss else projectile.Opacity = MathHelper.Clamp(1f - ((projectile.timeLeft - 35910) / 90f), 0f, 1f); - int num959 = (int)projectile.ai[0]; - if (num959 >= 0 && Main.player[num959].active && !Main.player[num959].dead) - { - if (projectile.Distance(Main.player[num959].Center) > num954) - { - Vector2 vector102 = projectile.DirectionTo(Main.player[num959].Center); - if (vector102.HasNaNs()) - vector102 = Vector2.UnitY; + int target = (int)projectile.ai[0]; + if (target >= 0 && Main.player[target].active && !Main.player[target].dead) + { + if (projectile.Distance(Main.player[target].Center) > minDist) + { + Vector2 targetVec = projectile.DirectionTo(Main.player[target].Center); + if (targetVec.HasNaNs()) + targetVec = Vector2.UnitY; - projectile.velocity = (projectile.velocity * (num953 - 1f) + vector102 * scaleFactor12) / num953; - } - } - else - { - if (projectile.ai[0] != -1f) - { - projectile.ai[0] = -1f; - projectile.netUpdate = true; - } - } + projectile.velocity = (projectile.velocity * (inertia - 1f) + targetVec * speed) / inertia; + } + } + else + { + if (projectile.ai[0] != -1f) + { + projectile.ai[0] = -1f; + projectile.netUpdate = true; + } + } // Fly away from other brimstone monsters - float velocity = 0.05f; - for (int i = 0; i < Main.maxProjectiles; i++) + float pushForce = 0.05f; + for (int k = 0; k < Main.maxProjectiles; k++) { - if (Main.projectile[i].active) - { - if (i != projectile.whoAmI && Main.projectile[i].type == projectile.type) - { - if (Vector2.Distance(projectile.Center, Main.projectile[i].Center) < 320f) - { - if (projectile.position.X < Main.projectile[i].position.X) - projectile.velocity.X -= velocity; - else - projectile.velocity.X += velocity; + Projectile otherProj = Main.projectile[k]; + // Short circuits to make the loop as fast as possible + if (!otherProj.active || k == projectile.whoAmI) + continue; - if (projectile.position.Y < Main.projectile[i].position.Y) - projectile.velocity.Y -= velocity; - else - projectile.velocity.Y += velocity; - } - } + // If the other projectile is indeed the same owned by the same player and they're too close, nudge them away. + bool sameProjType = otherProj.type == projectile.type; + float taxicabDist = Vector2.Distance(projectile.Center, otherProj.Center); + if (sameProjType && taxicabDist < 320f) + { + if (projectile.position.X < otherProj.position.X) + projectile.velocity.X -= pushForce; + else + projectile.velocity.X += pushForce; + + if (projectile.position.Y < otherProj.position.Y) + projectile.velocity.Y -= pushForce; + else + projectile.velocity.Y += pushForce; } } } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) - { - float dist1 = Vector2.Distance(projectile.Center, targetHitbox.TopLeft()); - float dist2 = Vector2.Distance(projectile.Center, targetHitbox.TopRight()); - float dist3 = Vector2.Distance(projectile.Center, targetHitbox.BottomLeft()); - float dist4 = Vector2.Distance(projectile.Center, targetHitbox.BottomRight()); + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + float dist1 = Vector2.Distance(projectile.Center, targetHitbox.TopLeft()); + float dist2 = Vector2.Distance(projectile.Center, targetHitbox.TopRight()); + float dist3 = Vector2.Distance(projectile.Center, targetHitbox.BottomLeft()); + float dist4 = Vector2.Distance(projectile.Center, targetHitbox.BottomRight()); - float minDist = dist1; - if (dist2 < minDist) - minDist = dist2; - if (dist3 < minDist) - minDist = dist3; - if (dist4 < minDist) - minDist = dist4; + float minDist = dist1; + if (dist2 < minDist) + minDist = dist2; + if (dist3 < minDist) + minDist = dist3; + if (dist4 < minDist) + minDist = dist4; - return minDist <= 170f; - } + return minDist <= 170f; + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D tex = Main.projectileTexture[projectile.type]; + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; lightColor.R = (byte)(255 * projectile.Opacity); spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); - return false; - } + return false; + } public override bool CanHitPlayer(Player target) => projectile.Opacity == 1f; public override void OnHitPlayer(Player target, int damage, bool crit) - { + { if (projectile.Opacity != 1f) return; target.AddBuff(ModContent.BuffType(), 900); - target.AddBuff(ModContent.BuffType(), 300, true); - } + target.AddBuff(ModContent.BuffType(), 300, true); + } - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { target.Calamity().lastProjectileHit = projectile; } - } + } } diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 45de219e3e..83159a845c 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -1012,7 +1012,7 @@ namespace CalamityMod // If the other projectile is indeed the same owned by the same player and they're too close, nudge them away. bool sameProjType = otherProj.type == projectile.type; - float taxicabDist = Math.Abs(projectile.position.X - otherProj.position.X) + Math.Abs(projectile.position.Y - otherProj.position.Y); + float taxicabDist = Vector2.Distance(projectile.Center, otherProj.Center); if (sameProjType && taxicabDist < projectile.width) { if (projectile.position.X < otherProj.position.X) From 9d2e89438eaef1473784dfaed94f7f26fcc85595 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 17 Jul 2020 20:43:07 -0400 Subject: [PATCH 123/160] made a randomvelocity utility --- CalPlayer/CalamityPlayer.cs | 40 +-- Projectiles/CalamityGlobalProjectile.cs | 257 +++++++++----------- Projectiles/Rogue/FantasyTalismanProj.cs | 51 ++-- Projectiles/Rogue/FantasyTalismanStealth.cs | 53 ++-- Projectiles/Summon/LuxorsGiftSummon.cs | 2 +- Utilities/CalamityUtils.cs | 13 + 6 files changed, 170 insertions(+), 246 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index ba0becc54f..4b5b825f67 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -5257,13 +5257,7 @@ namespace CalamityMod.CalPlayer { for (int s = 0; s < 3; s++) { - Vector2 velocity = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); - while (velocity.X == 0f && velocity.Y == 0f) - { - velocity = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); - } - velocity.Normalize(); - velocity *= (float)Main.rand.Next(30, 61) * 0.1f; + Vector2 velocity = CalamityUtils.RandomVelocity(50f, 30f, 60f); Projectile.NewProjectile(target.Center, velocity, ModContent.ProjectileType(), (int)(damage * 0.15), 0f, player.whoAmI); } } @@ -5666,13 +5660,7 @@ namespace CalamityMod.CalPlayer { for (int s = 0; s < 3; s++) { - Vector2 velocity = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); - while (velocity.X == 0f && velocity.Y == 0f) - { - velocity = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); - } - velocity.Normalize(); - velocity *= (float)Main.rand.Next(30, 61) * 0.1f; + Vector2 velocity = CalamityUtils.RandomVelocity(50f, 30f, 60f); Projectile.NewProjectile(target.Center, velocity, ModContent.ProjectileType(), (int)(damage * 0.15), 0f, player.whoAmI); } } @@ -5680,13 +5668,7 @@ namespace CalamityMod.CalPlayer { for (int s = 0; s < 3; s++) { - Vector2 velocity = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); - while (velocity.X == 0f && velocity.Y == 0f) - { - velocity = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); - } - velocity.Normalize(); - velocity *= (float)Main.rand.Next(30, 61) * 0.1f; + Vector2 velocity = CalamityUtils.RandomVelocity(50f, 30f, 60f); int spark = Projectile.NewProjectile(target.Center, velocity, ModContent.ProjectileType(), (int)(damage * 0.1), 0f, player.whoAmI); Main.projectile[spark].Calamity().forceRogue = true; Main.projectile[spark].localNPCHitCooldown = -1; @@ -5711,13 +5693,7 @@ namespace CalamityMod.CalPlayer int leafAmt = Main.rand.Next(2, 4); for (int l = 0; l < leafAmt; l++) { - Vector2 velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (velocity.X == 0f && velocity.Y == 0f) - { - velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - velocity.Normalize(); - velocity *= (float)Main.rand.Next(70, 101) * 0.1f; + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); int FUCKYOU = Projectile.NewProjectile(target.Center, velocity, ProjectileID.Leaf, (int)(damage * 0.25), 0f, player.whoAmI); Main.projectile[FUCKYOU].Calamity().forceTypeless = true; Main.projectile[FUCKYOU].netUpdate = true; @@ -5751,13 +5727,7 @@ namespace CalamityMod.CalPlayer bloodflareMageCooldown = 120; for (int i = 0; i < 3; i++) { - Vector2 velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (velocity.X == 0f && velocity.Y == 0f) - { - velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - velocity.Normalize(); - velocity *= (float)Main.rand.Next(70, 101) * 0.1f; + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); int fire = Projectile.NewProjectile(target.Center, velocity, ProjectileID.BallofFire, (int)(damage * 0.5), 0f, player.whoAmI); Main.projectile[fire].Calamity().forceTypeless = true; Main.projectile[fire].netUpdate = true; diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 23a97c74f1..8c5d9b2fda 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -843,15 +843,9 @@ namespace CalamityMod.Projectiles { if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[90] < 30) { - for (int num252 = 0; num252 < 2; num252++) + for (int i = 0; i < 2; i++) { - Vector2 value15 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= Main.rand.Next(70, 101) * 0.1f; + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); int shard = Projectile.NewProjectile(projectile.oldPosition + projectile.Size * 0.5f, value15, ProjectileID.CrystalShard, (int)(projectile.damage * 0.25), 0f, projectile.owner, 0f, 0f); Main.projectile[shard].ranged = false; } @@ -1143,7 +1137,7 @@ namespace CalamityMod.Projectiles //flask of party affects all types of weapons, !projectile.melee is to prevent double flask effects if (!projectile.melee && player.meleeEnchant == 7) - Projectile.NewProjectile(target.Center.X, target.Center.Y, target.velocity.X, target.velocity.Y, ProjectileID.ConfettiMelee, 0, 0f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(target.Center, target.velocity, ProjectileID.ConfettiMelee, 0, 0f, projectile.owner, 0f, 0f); if (rogue && stealthStrike && modPlayer.dragonScales && CalamityUtils.CountProjectiles(ProjectileType()) < 2) { @@ -1186,7 +1180,7 @@ namespace CalamityMod.Projectiles { if (player.ghostHurt) { - projectile.ghostHurt(damage, new Vector2(target.Center.X, target.Center.Y)); + projectile.ghostHurt(damage, target.Center); } if (player.setNebula && player.nebulaCD == 0 && Main.rand.Next(3) == 0) @@ -1198,7 +1192,7 @@ namespace CalamityMod.Projectiles ItemID.NebulaPickup2, ItemID.NebulaPickup3 }); - int nebulaBooster = Item.NewItem((int)target.position.X, (int)target.position.Y, target.width, target.height, boosterType, 1, false, 0, false, false); + int nebulaBooster = Item.NewItem(target.Center, target.Size, boosterType, 1, false, 0, false, false); Main.item[nebulaBooster].velocity.Y = Main.rand.Next(-20, 1) * 0.2f; Main.item[nebulaBooster].velocity.X = Main.rand.Next(10, 31) * 0.2f * projectile.direction; if (Main.netMode == NetmodeID.MultiplayerClient) @@ -1213,23 +1207,23 @@ namespace CalamityMod.Projectiles // Increases the degree to which Spectre Healing set contributes to the lifesteal cap if (player.ghostHeal) { - float num = 0.1f; - num -= projectile.numHits * 0.025f; - if (num < 0f) - num = 0f; + float cooldownMult = 0.1f; + cooldownMult -= projectile.numHits * 0.025f; + if (cooldownMult < 0f) + cooldownMult = 0f; - float num2 = damage * num; - Main.player[Main.myPlayer].lifeSteal -= num2; + float cooldown = damage * cooldownMult; + Main.player[Main.myPlayer].lifeSteal -= cooldown; } // Increases the degree to which Vampire Knives contribute to the lifesteal cap if (projectile.type == ProjectileID.VampireKnife) { - float num = damage * 0.075f; - if (num < 0f) - num = 0f; + float cooldown = damage * 0.075f; + if (cooldown < 0f) + cooldown = 0f; - Main.player[Main.myPlayer].lifeSteal -= num; + Main.player[Main.myPlayer].lifeSteal -= cooldown; } if (modPlayer.vampiricTalisman && rogue && crit) @@ -1391,13 +1385,13 @@ namespace CalamityMod.Projectiles (projectile.magic || rogue || projectile.melee || projectile.IsSummon() || projectile.ranged) && player.ownedProjectileCounts[ProjectileType()] < 6) { - int plague = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.25, 30), 0f, projectile.owner, 0f, 0f); + int plague = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.25, 30), 0f, projectile.owner, 0f, 0f); Main.projectile[plague].Calamity().forceTypeless = true; } if (modPlayer.reaverBlast && projectile.melee) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.2, 30), 0f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.2, 30), 0f, projectile.owner, 0f, 0f); } if (projectile.magic) @@ -1408,18 +1402,18 @@ namespace CalamityMod.Projectiles projectile.position = projectile.Center; projectile.width = projectile.height = 96; projectile.Center = projectile.position; - for (int num193 = 0; num193 < 3; num193++) + for (int d = 0; d < 3; d++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.5f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.5f); } - for (int num194 = 0; num194 < 30; num194++) + for (int d = 0; d < 30; d++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 157, 0f, 0f, 0, new Color(Main.DiscoR, 203, 103), 2.5f); - Main.dust[num195].noGravity = true; - Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.5f); - Main.dust[num195].velocity *= 2f; - Main.dust[num195].noGravity = true; + int explode = Dust.NewDust(projectile.position, projectile.width, projectile.height, 157, 0f, 0f, 0, new Color(Main.DiscoR, 203, 103), 2.5f); + Main.dust[explode].noGravity = true; + Main.dust[explode].velocity *= 3f; + explode = Dust.NewDust(projectile.position, projectile.width, projectile.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.5f); + Main.dust[explode].velocity *= 2f; + Main.dust[explode].noGravity = true; } projectile.damage *= modPlayer.auricSet ? 7 : 4; projectile.localNPCHitCooldown = 10; @@ -1429,17 +1423,11 @@ namespace CalamityMod.Projectiles if (modPlayer.reaverBurst) { - int num251 = Main.rand.Next(2, 5); - for (int num252 = 0; num252 < num251; num252++) + int projAmt = Main.rand.Next(2, 5); + for (int i = 0; i < projAmt; i++) { - Vector2 value15 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= Main.rand.Next(70, 101) * 0.1f; - int proj = Projectile.NewProjectile(projectile.oldPosition.X + (projectile.width / 2), projectile.oldPosition.Y + (projectile.height / 2), value15.X, value15.Y, 569 + Main.rand.Next(3), CalamityUtils.DamageSoftCap(projectile.damage * 0.15, 15), 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + int proj = Projectile.NewProjectile(projectile.Center, velocity, ProjectileID.SporeGas + Main.rand.Next(3), CalamityUtils.DamageSoftCap(projectile.damage * 0.15, 15), 0f, projectile.owner, 0f, 0f); Main.projectile[proj].usesLocalNPCImmunity = true; Main.projectile[proj].localNPCHitCooldown = 30; } @@ -1447,14 +1435,14 @@ namespace CalamityMod.Projectiles else if (modPlayer.ataxiaMage && modPlayer.ataxiaDmg <= 0) { SpawnOrb(projectile, 1.25f, ProjectileType(), 800f, 20f); - int num = (int)(projectile.damage * 0.5f); - modPlayer.ataxiaDmg += num; + int cooldown = (int)(projectile.damage * 0.5f); + modPlayer.ataxiaDmg += cooldown; } else if (modPlayer.godSlayerMage && modPlayer.godSlayerDmg <= 0) { SpawnOrb(projectile, modPlayer.auricSet ? 2f : 1.5f, ProjectileType(), 800f, 20f); - int num = (int)(projectile.damage * 0.5f); - modPlayer.godSlayerDmg += num; + int cooldown = (int)(projectile.damage * 0.5f); + modPlayer.godSlayerDmg += cooldown; } } if (projectile.melee) @@ -1473,16 +1461,16 @@ namespace CalamityMod.Projectiles case 0: SpawnOrb(projectile, 1.6f, ProjectileType(), 800f, Main.rand.Next(15, 30)); - int num = (int)(projectile.damage * 0.5f); - modPlayer.xerocDmg += num; + int cooldown = (int)(projectile.damage * 0.5f); + modPlayer.xerocDmg += cooldown; break; case 1: SpawnOrb(projectile, 1.25f, ProjectileType(), 800f, 30f); - int num2 = (int)(projectile.damage * 0.5f); - modPlayer.xerocDmg += num2; + int cooldown = (int)(projectile.damage * 0.5f); + modPlayer.xerocDmg += cooldown; if (target.canGhostHeal && Main.player[Main.myPlayer].lifeSteal > 0f) { @@ -1513,8 +1501,8 @@ namespace CalamityMod.Projectiles case 4: SpawnOrb(projectile, 1.2f, ProjectileType(), 800f, 15f); - int num3 = (int)(projectile.damage * 0.5f); - modPlayer.xerocDmg += num3; + int cooldown = (int)(projectile.damage * 0.5f); + modPlayer.xerocDmg += cooldown; break; @@ -1529,11 +1517,12 @@ namespace CalamityMod.Projectiles { for (int i = 0; i < 6; i++) { - Vector2 pos = new Vector2(target.Center.X + target.width * 0.5f + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); - float speedX = (target.Center.X - pos.X) / 30f; - float speedY = (target.Center.Y - pos.Y) * 8; + Vector2 source = new Vector2(target.Center.X + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); + float speedX = (target.Center.X - source.X) / 30f; + float speedY = (target.Center.Y - source.Y) * 8; + Vector2 velocity = new Vector2(speedX, speedY); int dmg = (int)(15 + (projectile.damage * 0.05f)); - int feather = Projectile.NewProjectile(pos.X, pos.Y, speedX, speedY, ProjectileType(), dmg, 3, projectile.owner, 0f, Main.rand.Next(15)); + int feather = Projectile.NewProjectile(source, velocity, ProjectileType(), dmg, 3f, projectile.owner); Main.projectile[feather].Calamity().forceRogue = true; modPlayer.featherCrownCooldown = 15; } @@ -1543,11 +1532,10 @@ namespace CalamityMod.Projectiles { for (int i = 0; i < 6; i++) { - Vector2 pos = new Vector2(target.Center.X + target.width * 0.5f + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); - Vector2 velocity = (target.Center - pos) / 10f; - float AI1 = Main.rand.Next(3); + Vector2 source = new Vector2(target.Center.X + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); + Vector2 velocity = (target.Center - source) / 10f; int dmg = (int)(150 + (projectile.damage * 0.05f)); - int flare = Projectile.NewProjectile(pos, velocity, ProjectileID.LunarFlare, dmg, 3, projectile.owner, 0f, AI1); + int flare = Projectile.NewProjectile(source, velocity, ProjectileID.LunarFlare, dmg, 3, projectile.owner); Main.projectile[flare].Calamity().forceRogue = true; modPlayer.moonCrownCooldown = 15; } @@ -1557,10 +1545,10 @@ namespace CalamityMod.Projectiles { for (int i = 0; i < 6; i++) { - Vector2 pos = new Vector2(target.Center.X + target.width * 0.5f + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); - Vector2 velocity = (target.Center - pos) / 40f; + Vector2 source = new Vector2(target.Center.X + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); + Vector2 velocity = (target.Center - source) / 40f; int dmg = (int)(1000 + (projectile.damage * 0.05f)); - int flare = Projectile.NewProjectile(pos, velocity, ProjectileType(),dmg, 3f, projectile.owner, 0f, 0f); + int flare = Projectile.NewProjectile(source, velocity, ProjectileType(),dmg, 3f, projectile.owner); Main.projectile[flare].Calamity().rogue = true; modPlayer.nanoFlareCooldown = 15; } @@ -1656,40 +1644,35 @@ namespace CalamityMod.Projectiles if (CalamityMod.boomerangProjList.Contains(projectile.type)) { int spiritDamage = CalamityUtils.DamageSoftCap(projectile.damage * 0.2, 60); - int[] numArray1 = new int[Main.maxNPCs]; - int maxValue1 = 0; - int maxValue2 = 0; + int[] array = new int[Main.maxNPCs]; + int targetArrayA = 0; + int targetArrayB = 0; for (int index = 0; index < Main.maxNPCs; ++index) { - if (Main.npc[index].CanBeChasedBy((object)projectile, false)) + NPC npc = Main.npc[index]; + if (npc.CanBeChasedBy(projectile, false)) { - float num2 = Math.Abs(Main.npc[index].Center.X - projectile.Center.X) + Math.Abs(Main.npc[index].Center.Y - projectile.Center.Y); - if (num2 < 800f) + float npcDist = Vector2.Distance(projectile.Center, npc.Center); + if (npcDist < 800f) { - if (Collision.CanHit(projectile.position, 1, 1, Main.npc[index].position, Main.npc[index].width, Main.npc[index].height) && num2 > 50f) + if (Collision.CanHit(projectile.position, 1, 1, npc.position, npc.width, npc.height) && npcDist > 50f) { - numArray1[maxValue2] = index; - ++maxValue2; + array[targetArrayB] = index; + ++targetArrayB; } - else if (maxValue2 == 0) + else if (targetArrayB == 0) { - numArray1[maxValue1] = index; - ++maxValue1; + array[targetArrayA] = index; + ++targetArrayA; } } } } - if (maxValue1 == 0 && maxValue2 == 0) + if (targetArrayA == 0 && targetArrayB == 0) return; - int num3 = maxValue2 <= 0 ? numArray1[Main.rand.Next(maxValue1)] : numArray1[Main.rand.Next(maxValue2)]; - double num4 = 4.0; - float num5 = (float)Main.rand.Next(-100, 101); - float num6 = (float)Main.rand.Next(-100, 101); - double num7 = Math.Sqrt((double)num5 * (double)num5 + (double)num6 * (double)num6); - float num8 = (float)(num4 / num7); - float SpeedX = num5 * num8; - float SpeedY = num6 * num8; - int ghost = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, SpeedX, SpeedY, ProjectileID.SpectreWrath, spiritDamage, 0f, projectile.owner, (float)num3, 0f); + int target = targetArrayB <= 0 ? array[Main.rand.Next(targetArrayA)] : array[Main.rand.Next(targetArrayB)]; + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 4f, 4f, 1f); + int ghost = Projectile.NewProjectile(projectile.Center, velocity, ProjectileID.SpectreWrath, spiritDamage, 0f, projectile.owner, target, 0f); Main.projectile[ghost].Calamity().forceRogue = true; Main.projectile[ghost].penetrate = 1; modPlayer.shadowPotCooldown = 30; @@ -1746,8 +1729,8 @@ namespace CalamityMod.Projectiles if (modPlayer.godSlayerSummon && modPlayer.godSlayerDmg <= 0) { SpawnOrb(projectile, 2f, ProjectileType(), 800f, 15f, true); - int num = (int)(projectile.damage * 0.5f); - modPlayer.godSlayerDmg += num; + int cooldown = (int)(projectile.damage * 0.5f); + modPlayer.godSlayerDmg += cooldown; } //Priorities: Nucleogenesis => Starbuster Core => Nuclear Rod => Jelly-Charged Battery @@ -1794,8 +1777,8 @@ namespace CalamityMod.Projectiles else if (modPlayer.jellyChargedBattery) { SpawnOrb(projectile, 1.05f, ProjectileType(), 800f, 15f); - int num = (int)(projectile.damage * 0.5f); - modPlayer.jellyDmg += num; + int cooldown = (int)(projectile.damage * 0.5f); + modPlayer.jellyDmg += cooldown; } } @@ -1817,17 +1800,11 @@ namespace CalamityMod.Projectiles { if (modPlayer.tarraRanged && Main.rand.Next(0, 100) >= 88 && player.ownedProjectileCounts[ProjectileType()] <= 20 && (projectile.timeLeft <= 2 || projectile.penetrate <= 1)) { - int num251 = Main.rand.Next(2, 4); - for (int num252 = 0; num252 < num251; num252++) + int projAmt = Main.rand.Next(2, 4); + for (int projCount = 0; projCount < projAmt; projCount++) { - Vector2 value15 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.33, 65), 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(projectile.Center, velocity, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.33, 65), 0f, projectile.owner, 0f, 0f); } } } @@ -1988,11 +1965,11 @@ namespace CalamityMod.Projectiles { if (modPlayer.providenceLore && projectile.friendly && projectile.damage > 0 && (projectile.melee || projectile.ranged || projectile.magic || rogue)) { - Main.PlaySound(SoundID.Item20, (int)projectile.position.X, (int)projectile.position.Y); + Main.PlaySound(SoundID.Item20, projectile.Center); for (int dustIndex = 0; dustIndex < 3; dustIndex++) { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, (int)CalamityDusts.ProfanedFire, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default, 1f); - Main.dust[dust].noGravity = true; + int fire = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, (int)CalamityDusts.ProfanedFire, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default, 1f); + Main.dust[fire].noGravity = true; } } @@ -2000,16 +1977,10 @@ namespace CalamityMod.Projectiles { if (modPlayer.etherealExtorter && Main.rand.Next(0, 100) >= 95) { - for (int num252 = 0; num252 < 3; num252++) + for (int i = 0; i < 3; i++) { - Vector2 value15 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= Main.rand.Next(70, 101) * 0.1f; - int soul = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.33), 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + int soul = Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.33), 0f, projectile.owner, 0f, 0f); Main.projectile[soul].tileCollide = false; } } @@ -2065,76 +2036,72 @@ namespace CalamityMod.Projectiles if (Main.player[Main.myPlayer].moonLeech) return; Main.player[Main.myPlayer].lifeSteal -= healAmount * cooldownMultiplier; - float num13 = 0f; - int num14 = projectile.owner; + float lowestHealthCheck = 0f; + int healTarget = projectile.owner; for (int i = 0; i < Main.maxPlayers; i++) { - if (Main.player[i].active && !Main.player[i].dead && ((!player.hostile && !Main.player[i].hostile) || player.team == Main.player[i].team)) + Player otherPlayer = Main.player[i]; + if (otherPlayer.active && !otherPlayer.dead && ((!player.hostile && !otherPlayer.hostile) || player.team == otherPlayer.team)) { - float num15 = Math.Abs(Main.player[i].position.X + (Main.player[i].width / 2) - projectile.position.X + (projectile.width / 2)) + Math.Abs(Main.player[i].position.Y + (Main.player[i].height / 2) - projectile.position.Y + (projectile.height / 2)); - if (num15 < distanceRequired && (Main.player[i].statLifeMax2 - Main.player[i].statLife) > num13) + float playerDist = Vector2.Distance(projectile.Center, otherPlayer.Center); + if (playerDist < distanceRequired && (otherPlayer.statLifeMax2 - otherPlayer.statLife) > lowestHealthCheck) { - num13 = Main.player[i].statLifeMax2 - Main.player[i].statLife; - num14 = i; + lowestHealthCheck = otherPlayer.statLifeMax2 - otherPlayer.statLife; + healTarget = i; } } } - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, healProjectileType, 0, 0f, projectile.owner, num14, healAmount); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, healProjectileType, 0, 0f, projectile.owner, healTarget, healAmount); } #endregion #region AI Shortcuts - public void SpawnOrb(Projectile projectile, float dmgMult, int projType, float distanceRequired, float N, bool gsPhantom = false) + public void SpawnOrb(Projectile projectile, float dmgMult, int projType, float distanceRequired, float speedMult, bool gsPhantom = false) { Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - int num = (int)(projectile.damage * 0.5f); + int damage = (int)(projectile.damage * 0.5f); float ai1 = Main.rand.NextFloat() + 0.5f; int[] array = new int[Main.maxNPCs]; - int num3 = 0; - int num4 = 0; + int targetArrayIndexA = 0; + int targetArrayIndexB = 0; for (int i = 0; i < Main.maxNPCs; i++) { - if (Main.npc[i].CanBeChasedBy(projectile, false)) + NPC npc = Main.npc[i]; + if (npc.CanBeChasedBy(projectile, false)) { - float num5 = Math.Abs(Main.npc[i].position.X + (Main.npc[i].width / 2) - projectile.position.X + (projectile.width / 2)) + Math.Abs(Main.npc[i].position.Y + (Main.npc[i].height / 2) - projectile.position.Y + (projectile.height / 2)); - if (num5 < distanceRequired) + float enemyDist = Vector2.Distance(projectile.Center, npc.Center); + if (enemyDist < distanceRequired) { - if (Collision.CanHit(projectile.position, 1, 1, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height) && num5 > 50f) + if (Collision.CanHit(projectile.position, 1, 1, npc.position, npc.width, npc.height) && enemyDist > 50f) { - array[num4] = i; - num4++; + array[targetArrayIndexB] = i; + targetArrayIndexB++; } - else if (num4 == 0) + else if (targetArrayIndexB == 0) { - array[num3] = i; - num3++; + array[targetArrayIndexA] = i; + targetArrayIndexA++; } } } } - if (num3 == 0 && num4 == 0) + if (targetArrayIndexA == 0 && targetArrayIndexB == 0) { return; } - int num6; - if (num4 > 0) + int ai0; + if (targetArrayIndexB > 0) { - num6 = array[Main.rand.Next(num4)]; + ai0 = array[Main.rand.Next(targetArrayIndexB)]; } else { - num6 = array[Main.rand.Next(num3)]; + ai0 = array[Main.rand.Next(targetArrayIndexA)]; } - float num7 = N; - float num8 = Main.rand.Next(-100, 101); - float num9 = Main.rand.Next(-100, 101); - float num10 = (float)Math.Sqrt(num8 * num8 + num9 * num9); - num10 = num7 / num10; - num8 *= num10; - num9 *= num10; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num8, num9, projType, (int)(num * dmgMult), 0f, projectile.owner, gsPhantom ? 0f : num6, gsPhantom ? ai1 : 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, speedMult, speedMult, 1f); + Projectile.NewProjectile(projectile.Center, velocity, projType, (int)(damage * dmgMult), 0f, projectile.owner, gsPhantom ? 0f : ai0, gsPhantom ? ai1 : 0f); } public static void HomeInOnNPC(Projectile projectile, bool ignoreTiles, float distanceRequired, float homingVelocity, float N) diff --git a/Projectiles/Rogue/FantasyTalismanProj.cs b/Projectiles/Rogue/FantasyTalismanProj.cs index 568106cfd1..bd95a40f0f 100644 --- a/Projectiles/Rogue/FantasyTalismanProj.cs +++ b/Projectiles/Rogue/FantasyTalismanProj.cs @@ -35,11 +35,11 @@ namespace CalamityMod.Projectiles.Rogue { projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 175, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } - projectile.StickyProjAI(15); + projectile.StickyProjAI(4); if (projectile.ai[0] == 1f) { if (projectile.timeLeft % 10 == 0) @@ -47,40 +47,35 @@ namespace CalamityMod.Projectiles.Rogue if (Main.rand.NextBool(2)) { int spiritDamage = projectile.damage / 2; - int[] numArray1 = new int[Main.maxNPCs]; - int maxValue1 = 0; - int maxValue2 = 0; + int[] array = new int[Main.maxNPCs]; + int targetArrayA = 0; + int targetArrayB = 0; for (int index = 0; index < Main.maxNPCs; ++index) { - if (Main.npc[index].CanBeChasedBy((object) projectile, false)) + NPC npc = Main.npc[index]; + if (npc.CanBeChasedBy(projectile, false)) { - float num2 = Math.Abs(Main.npc[index].Center.X - projectile.Center.X) + Math.Abs(Main.npc[index].Center.Y - projectile.Center.Y); - if (num2 < 800f) + float npcDist = Vector2.Distance(projectile.Center, npc.Center); + if (npcDist < 800f) { - if (Collision.CanHit(projectile.position, 1, 1, Main.npc[index].position, Main.npc[index].width, Main.npc[index].height) && num2 > 50f) + if (Collision.CanHit(projectile.position, 1, 1, npc.position, npc.width, npc.height) && npcDist > 50f) { - numArray1[maxValue2] = index; - ++maxValue2; + array[targetArrayB] = index; + ++targetArrayB; } - else if (maxValue2 == 0) + else if (targetArrayB == 0) { - numArray1[maxValue1] = index; - ++maxValue1; + array[targetArrayA] = index; + ++targetArrayA; } } } } - if (maxValue1 == 0 && maxValue2 == 0) + if (targetArrayA == 0 && targetArrayB == 0) return; - int num3 = maxValue2 <= 0 ? numArray1[Main.rand.Next(maxValue1)] : numArray1[Main.rand.Next(maxValue2)]; - double num4 = 4.0; - float num5 = (float) Main.rand.Next(-100, 101); - float num6 = (float) Main.rand.Next(-100, 101); - double num7 = Math.Sqrt((double) num5 * (double) num5 + (double) num6 * (double) num6); - float num8 = (float) (num4 / num7); - float SpeedX = num5 * num8; - float SpeedY = num6 * num8; - int ghost = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, SpeedX, SpeedY, ProjectileID.SpectreWrath, spiritDamage, 0.0f, projectile.owner, (float)num3, 0f); + int target = targetArrayB <= 0 ? array[Main.rand.Next(targetArrayA)] : array[Main.rand.Next(targetArrayB)]; + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 4f, 4f, 1f); + int ghost = Projectile.NewProjectile(projectile.Center, velocity, ProjectileID.SpectreWrath, spiritDamage, 0f, projectile.owner, target, 0f); Main.projectile[ghost].Calamity().forceRogue = true; Main.projectile[ghost].penetrate = 1; } @@ -107,13 +102,5 @@ namespace CalamityMod.Projectiles.Rogue } return null; } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if (projectile.timeLeft > 240) - { - projectile.timeLeft = 240; - } - } } } diff --git a/Projectiles/Rogue/FantasyTalismanStealth.cs b/Projectiles/Rogue/FantasyTalismanStealth.cs index fb1ddd368f..bdf4928009 100644 --- a/Projectiles/Rogue/FantasyTalismanStealth.cs +++ b/Projectiles/Rogue/FantasyTalismanStealth.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Rogue { projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 175, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -45,11 +45,11 @@ namespace CalamityMod.Projectiles.Rogue { if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } } } - projectile.StickyProjAI(15); + projectile.StickyProjAI(4); if (projectile.ai[0] == 1f) { if (projectile.timeLeft % 4 == 0) @@ -57,40 +57,35 @@ namespace CalamityMod.Projectiles.Rogue if (Main.rand.NextBool(2)) { int spiritDamage = projectile.damage / 2; - int[] numArray1 = new int[Main.maxNPCs]; - int maxValue1 = 0; - int maxValue2 = 0; + int[] array = new int[Main.maxNPCs]; + int targetArrayA = 0; + int targetArrayB = 0; for (int index = 0; index < Main.maxNPCs; ++index) { - if (Main.npc[index].CanBeChasedBy((object) projectile, false)) + NPC npc = Main.npc[index]; + if (npc.CanBeChasedBy(projectile, false)) { - float num2 = Math.Abs(Main.npc[index].Center.X - projectile.Center.X) + Math.Abs(Main.npc[index].Center.Y - projectile.Center.Y); - if (num2 < 800f) + float npcDist = Vector2.Distance(projectile.Center, npc.Center); + if (npcDist < 800f) { - if (Collision.CanHit(projectile.position, 1, 1, Main.npc[index].position, Main.npc[index].width, Main.npc[index].height) && num2 > 50f) + if (Collision.CanHit(projectile.position, 1, 1, npc.position, npc.width, npc.height) && npcDist > 50f) { - numArray1[maxValue2] = index; - ++maxValue2; + array[targetArrayB] = index; + ++targetArrayB; } - else if (maxValue2 == 0) + else if (targetArrayB == 0) { - numArray1[maxValue1] = index; - ++maxValue1; + array[targetArrayA] = index; + ++targetArrayA; } } } } - if (maxValue1 == 0 && maxValue2 == 0) + if (targetArrayA == 0 && targetArrayB == 0) return; - int num3 = maxValue2 <= 0 ? numArray1[Main.rand.Next(maxValue1)] : numArray1[Main.rand.Next(maxValue2)]; - double num4 = 4.0; - float num5 = (float) Main.rand.Next(-100, 101); - float num6 = (float) Main.rand.Next(-100, 101); - double num7 = Math.Sqrt((double) num5 * (double) num5 + (double) num6 * (double) num6); - float num8 = (float) (num4 / num7); - float SpeedX = num5 * num8; - float SpeedY = num6 * num8; - int ghost = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, SpeedX, SpeedY, ProjectileID.SpectreWrath, spiritDamage, 0.0f, projectile.owner, (float)num3, 0f); + int target = targetArrayB <= 0 ? array[Main.rand.Next(targetArrayA)] : array[Main.rand.Next(targetArrayB)]; + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 4f, 4f, 1f); + int ghost = Projectile.NewProjectile(projectile.Center, velocity, ProjectileID.SpectreWrath, spiritDamage, 0f, projectile.owner, target, 0f); Main.projectile[ghost].Calamity().forceRogue = true; Main.projectile[ghost].penetrate = 1; } @@ -117,13 +112,5 @@ namespace CalamityMod.Projectiles.Rogue } return null; } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if (projectile.timeLeft > 240) - { - projectile.timeLeft = 240; - } - } } } diff --git a/Projectiles/Summon/LuxorsGiftSummon.cs b/Projectiles/Summon/LuxorsGiftSummon.cs index 29066770e9..4345c84869 100644 --- a/Projectiles/Summon/LuxorsGiftSummon.cs +++ b/Projectiles/Summon/LuxorsGiftSummon.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Summon projectile.ChargingMinionAI(700f, 1000f, 2200f, 150f, 0, 40f, 9f, -4f, 40f, 9f, true, true); - projectile.rotation = projectile.velocity.ToRotation() + 1.57f; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; } public override Color? GetAlpha(Color lightColor) diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 83159a845c..904aa22370 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -1001,6 +1001,19 @@ namespace CalamityMod return newDamage; } + public static Vector2 RandomVelocity(float directionMult, float speedLowerLimit, float speedCap, float speedMult = 0.1f) + { + Vector2 velocity = new Vector2(Main.rand.NextFloat(-directionMult, directionMult), Main.rand.NextFloat(-directionMult, directionMult)); + //Rerolling to avoid dividing by zero + while (velocity.X == 0f && velocity.Y == 0f) + { + velocity = new Vector2(Main.rand.NextFloat(-directionMult, directionMult), Main.rand.NextFloat(-directionMult, directionMult)); + } + velocity.Normalize(); + velocity *= Main.rand.NextFloat(speedLowerLimit, speedCap) * speedMult; + return velocity; + } + public static void MinionAntiClump(this Projectile projectile, float pushForce = 0.05f) { for (int k = 0; k < Main.maxProjectiles; k++) From 66ede475d028777b9842dfad2d8b63075aada0ab Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 17 Jul 2020 21:57:52 -0400 Subject: [PATCH 124/160] 1. converted many things to use the RandomVelocity util. 2. did funny disorganized refactors along the way. 3. Realized spectre ghost hurt is the spawnorb utility and made it now return a projectile. 4. Fixed nasty cholla scaling off of melee instead of rogue boosts. --- Items/Accessories/Wings/XerocWings.cs | 14 +-- Projectiles/Boss/MoltenBlast.cs | 24 ++--- Projectiles/CalamityGlobalProjectile.cs | 94 ++++++------------- Projectiles/Magic/LightBead.cs | 18 ++-- Projectiles/Magic/SparklingBeam.cs | 16 +--- Projectiles/Melee/AegisBeam.cs | 39 ++++---- Projectiles/Melee/ClamCrusherFlail.cs | 10 +- Projectiles/Melee/RedtideWhirlpool.cs | 2 +- Projectiles/Ranged/Aquashard.cs | 16 +--- Projectiles/Ranged/ClamorRifleProj.cs | 14 +-- Projectiles/Ranged/CosmicFire.cs | 53 +++++------ Projectiles/Ranged/EnhancedNanoRoundProj.cs | 12 +-- Projectiles/Ranged/FungiOrb.cs | 14 +-- Projectiles/Ranged/SporeBomb.cs | 28 +++--- Projectiles/Ranged/SpykerProj.cs | 20 ++-- Projectiles/Ranged/TerraArrowMain.cs | 30 +++--- Projectiles/Ranged/TerraBulletMain.cs | 12 +-- Projectiles/Rogue/BallisticPoisonBombProj.cs | 55 +++++------ Projectiles/Rogue/DestructionStar.cs | 14 +-- Projectiles/Rogue/FantasyTalismanProj.cs | 34 +------ Projectiles/Rogue/FantasyTalismanStealth.cs | 34 +------ Projectiles/Rogue/HypothermiaChunk.cs | 12 +-- Projectiles/Rogue/NastyChollaBol.cs | 21 ++--- Projectiles/Rogue/Prismalline3.cs | 16 +--- Projectiles/Rogue/PrismallineProj.cs | 44 ++------- Projectiles/Rogue/SandDollarStealth.cs | 40 +++----- Projectiles/Rogue/SupernovaBomb.cs | 57 +++++------ Projectiles/Rogue/TheSyringeProj.cs | 22 ++--- Projectiles/Rogue/TotalityFlask.cs | 28 +++--- Projectiles/Rogue/TotalityTar.cs | 43 ++++----- Projectiles/Rogue/TurbulanceProjectile.cs | 83 +++++----------- Projectiles/Rogue/ValariBoomerang.cs | 49 +++------- Projectiles/Summon/CosmicEnergySpiral.cs | 23 ++--- Projectiles/Summon/ReaverOrb.cs | 34 +++---- Projectiles/Summon/Urchin.cs | 48 ++++------ .../Typeless/GodSlayerShrapnelRound.cs | 24 ++--- 36 files changed, 369 insertions(+), 728 deletions(-) diff --git a/Items/Accessories/Wings/XerocWings.cs b/Items/Accessories/Wings/XerocWings.cs index ad99258922..00ee2b732b 100644 --- a/Items/Accessories/Wings/XerocWings.cs +++ b/Items/Accessories/Wings/XerocWings.cs @@ -41,19 +41,19 @@ namespace CalamityMod.Items.Accessories.Wings if (player.controlJump && player.wingTime > 0f && !player.jumpAgainCloud && player.jump == 0 && player.velocity.Y != 0f && !hideVisual) { - int num59 = 4; + float xOffset = 4f; if (player.direction == 1) { - num59 = -40; + xOffset = -40f; } - int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 242, 0f, 0f, 100, default, 2.4f); - Main.dust[num60].noGravity = true; - Main.dust[num60].velocity *= 0.3f; + int index = Dust.NewDust(new Vector2(player.Center.X + xOffset, player.Center.Y - 15f), 30, 30, 62, 0f, 0f, 100, default, 2.4f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 0.3f; if (Main.rand.NextBool(10)) { - Main.dust[num60].fadeIn = 2f; + Main.dust[index].fadeIn = 2f; } - Main.dust[num60].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player); + Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player); } player.wingTimeMax = 180; player.noFallDmg = true; diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index c22cb912a6..b79d1986e2 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -57,9 +57,9 @@ namespace CalamityMod.Projectiles.Boss int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; if (projectile.ai[1] == 0f) { - for (int num621 = 0; num621 < 10; num621++) + for (int d = 0; d < 10; d++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -106,19 +106,13 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - int num251 = Main.rand.Next(5, 10); + int blobAmt = Main.rand.Next(5, 10); if (projectile.owner == Main.myPlayer) { - for (int num252 = 0; num252 < num251; num252++) + for (int b = 0; b < blobAmt; b++) { - Vector2 value15 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= Main.rand.Next(70, 121) * 0.1f; //70 101 - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner, 0f, 0f); } } Main.PlaySound(SoundID.Item20, projectile.Center); @@ -126,14 +120,14 @@ namespace CalamityMod.Projectiles.Boss int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; for (int num193 = 0; num193 < 3; num193++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 50, default, 1.5f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 50, default, 1.5f); } for (int num194 = 0; num194 < 30; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 2.5f); + int num195 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 2.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 50, default, 1.5f); + num195 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 50, default, 1.5f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 8c5d9b2fda..497a6dfb02 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -846,7 +846,7 @@ namespace CalamityMod.Projectiles for (int i = 0; i < 2; i++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - int shard = Projectile.NewProjectile(projectile.oldPosition + projectile.Size * 0.5f, value15, ProjectileID.CrystalShard, (int)(projectile.damage * 0.25), 0f, projectile.owner, 0f, 0f); + int shard = Projectile.NewProjectile(projectile.Center, velocity, ProjectileID.CrystalShard, (int)(projectile.damage * 0.25), 0f, projectile.owner, 0f, 0f); Main.projectile[shard].ranged = false; } } @@ -1434,13 +1434,13 @@ namespace CalamityMod.Projectiles } else if (modPlayer.ataxiaMage && modPlayer.ataxiaDmg <= 0) { - SpawnOrb(projectile, 1.25f, ProjectileType(), 800f, 20f); + SpawnOrb(projectile, (int)(projectile.damage * 0.625), ProjectileType(), 800f, 20f); int cooldown = (int)(projectile.damage * 0.5f); modPlayer.ataxiaDmg += cooldown; } else if (modPlayer.godSlayerMage && modPlayer.godSlayerDmg <= 0) { - SpawnOrb(projectile, modPlayer.auricSet ? 2f : 1.5f, ProjectileType(), 800f, 20f); + SpawnOrb(projectile, (int)(projectile.damage * (modPlayer.auricSet ? 1 : 0.75)), ProjectileType(), 800f, 20f); int cooldown = (int)(projectile.damage * 0.5f); modPlayer.godSlayerDmg += cooldown; } @@ -1449,27 +1449,26 @@ namespace CalamityMod.Projectiles { if (modPlayer.ataxiaGeyser && player.ownedProjectileCounts[ProjectileType()] < 3) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.15, 35), 0f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.15, 35), 0f, projectile.owner, 0f, 0f); } } if (rogue) { if (modPlayer.xerocSet && modPlayer.xerocDmg <= 0 && player.ownedProjectileCounts[ProjectileType()] < 3 && player.ownedProjectileCounts[ProjectileType()] < 3) { + int cooldown = (int)(projectile.damage * 0.5f); switch (Main.rand.Next(5)) { case 0: - SpawnOrb(projectile, 1.6f, ProjectileType(), 800f, Main.rand.Next(15, 30)); - int cooldown = (int)(projectile.damage * 0.5f); + SpawnOrb(projectile, (int)(projectile.damage * 0.8), ProjectileType(), 800f, Main.rand.Next(15, 30)); modPlayer.xerocDmg += cooldown; break; case 1: - SpawnOrb(projectile, 1.25f, ProjectileType(), 800f, 30f); - int cooldown = (int)(projectile.damage * 0.5f); + SpawnOrb(projectile, (int)(projectile.damage * 0.625), ProjectileType(), 800f, 30f); modPlayer.xerocDmg += cooldown; if (target.canGhostHeal && Main.player[Main.myPlayer].lifeSteal > 0f) @@ -1488,20 +1487,19 @@ namespace CalamityMod.Projectiles case 2: - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.15, 40), 0f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.15, 40), 0f, projectile.owner, 0f, 0f); break; case 3: - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.2, 40), 0f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.2, 40), 0f, projectile.owner, 0f, 0f); break; case 4: - SpawnOrb(projectile, 1.2f, ProjectileType(), 800f, 15f); - int cooldown = (int)(projectile.damage * 0.5f); + SpawnOrb(projectile, (int)(projectile.damage * 0.6), ProjectileType(), 800f, 15f); modPlayer.xerocDmg += cooldown; break; @@ -1644,37 +1642,9 @@ namespace CalamityMod.Projectiles if (CalamityMod.boomerangProjList.Contains(projectile.type)) { int spiritDamage = CalamityUtils.DamageSoftCap(projectile.damage * 0.2, 60); - int[] array = new int[Main.maxNPCs]; - int targetArrayA = 0; - int targetArrayB = 0; - for (int index = 0; index < Main.maxNPCs; ++index) - { - NPC npc = Main.npc[index]; - if (npc.CanBeChasedBy(projectile, false)) - { - float npcDist = Vector2.Distance(projectile.Center, npc.Center); - if (npcDist < 800f) - { - if (Collision.CanHit(projectile.position, 1, 1, npc.position, npc.width, npc.height) && npcDist > 50f) - { - array[targetArrayB] = index; - ++targetArrayB; - } - else if (targetArrayB == 0) - { - array[targetArrayA] = index; - ++targetArrayA; - } - } - } - } - if (targetArrayA == 0 && targetArrayB == 0) - return; - int target = targetArrayB <= 0 ? array[Main.rand.Next(targetArrayA)] : array[Main.rand.Next(targetArrayB)]; - Vector2 velocity = CalamityUtils.RandomVelocity(100f, 4f, 4f, 1f); - int ghost = Projectile.NewProjectile(projectile.Center, velocity, ProjectileID.SpectreWrath, spiritDamage, 0f, projectile.owner, target, 0f); - Main.projectile[ghost].Calamity().forceRogue = true; - Main.projectile[ghost].penetrate = 1; + Projectile ghost = SpawnOrb(projectile, spiritDamage, ProjectileID.SpectreWrath, 800f, 4f); + ghost.Calamity().forceRogue = true; + ghost.penetrate = 1; modPlayer.shadowPotCooldown = 30; } if (CalamityMod.flaskBombProjList.Contains(projectile.type)) @@ -1728,7 +1698,7 @@ namespace CalamityMod.Projectiles if (modPlayer.godSlayerSummon && modPlayer.godSlayerDmg <= 0) { - SpawnOrb(projectile, 2f, ProjectileType(), 800f, 15f, true); + SpawnOrb(projectile, projectile.damage, ProjectileType(), 800f, 15f, true); int cooldown = (int)(projectile.damage * 0.5f); modPlayer.godSlayerDmg += cooldown; } @@ -1776,7 +1746,7 @@ namespace CalamityMod.Projectiles } else if (modPlayer.jellyChargedBattery) { - SpawnOrb(projectile, 1.05f, ProjectileType(), 800f, 15f); + SpawnOrb(projectile, (int)(projectile.damage * 0.525), ProjectileType(), 800f, 15f); int cooldown = (int)(projectile.damage * 0.5f); modPlayer.jellyDmg += cooldown; } @@ -2056,16 +2026,15 @@ namespace CalamityMod.Projectiles #endregion #region AI Shortcuts - public void SpawnOrb(Projectile projectile, float dmgMult, int projType, float distanceRequired, float speedMult, bool gsPhantom = false) + public static Projectile SpawnOrb(Projectile projectile, int damage, int projType, float distanceRequired, float speedMult, bool gsPhantom = false) { Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - int damage = (int)(projectile.damage * 0.5f); float ai1 = Main.rand.NextFloat() + 0.5f; int[] array = new int[Main.maxNPCs]; - int targetArrayIndexA = 0; - int targetArrayIndexB = 0; + int targetArrayA = 0; + int targetArrayB = 0; for (int i = 0; i < Main.maxNPCs; i++) { NPC npc = Main.npc[i]; @@ -2076,32 +2045,25 @@ namespace CalamityMod.Projectiles { if (Collision.CanHit(projectile.position, 1, 1, npc.position, npc.width, npc.height) && enemyDist > 50f) { - array[targetArrayIndexB] = i; - targetArrayIndexB++; + array[targetArrayB] = i; + targetArrayB++; } - else if (targetArrayIndexB == 0) + else if (targetArrayB == 0) { - array[targetArrayIndexA] = i; - targetArrayIndexA++; + array[targetArrayA] = i; + targetArrayA++; } } } } - if (targetArrayIndexA == 0 && targetArrayIndexB == 0) + if (targetArrayA == 0 && targetArrayB == 0) { - return; - } - int ai0; - if (targetArrayIndexB > 0) - { - ai0 = array[Main.rand.Next(targetArrayIndexB)]; - } - else - { - ai0 = array[Main.rand.Next(targetArrayIndexA)]; + return Projectile.NewProjectileDirect(projectile.Center, Vector2.Zero, ProjectileType(), 0, 0f, projectile.owner); } + int target = targetArrayB <= 0 ? array[Main.rand.Next(targetArrayA)] : array[Main.rand.Next(targetArrayB)]; Vector2 velocity = CalamityUtils.RandomVelocity(100f, speedMult, speedMult, 1f); - Projectile.NewProjectile(projectile.Center, velocity, projType, (int)(damage * dmgMult), 0f, projectile.owner, gsPhantom ? 0f : ai0, gsPhantom ? ai1 : 0f); + Projectile orb = Projectile.NewProjectileDirect(projectile.Center, velocity, projType, damage, 0f, projectile.owner, gsPhantom ? 0f : target, gsPhantom ? ai1 : 0f); + return orb; } public static void HomeInOnNPC(Projectile projectile, bool ignoreTiles, float distanceRequired, float homingVelocity, float N) diff --git a/Projectiles/Magic/LightBead.cs b/Projectiles/Magic/LightBead.cs index 237effaa0b..19dc99e163 100644 --- a/Projectiles/Magic/LightBead.cs +++ b/Projectiles/Magic/LightBead.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Magic projectile.ai[1] += 1f; if (Main.rand.NextBool(3)) { - int num300 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 0, default, 1f); + int num300 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 0, default, 1f); Main.dust[num300].noGravity = true; Main.dust[num300].velocity *= 0.5f; Main.dust[num300].scale *= 0.9f; @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Magic if (projectile.ai[1] > 300f) { projectile.scale -= 0.05f; - if ((double)projectile.scale <= 0.2) + if (projectile.scale <= 0.2f) { projectile.scale = 0.2f; projectile.Kill(); @@ -58,19 +58,13 @@ namespace CalamityMod.Projectiles.Magic { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 244, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); } - int num251 = Main.rand.Next(2, 3); + int beadAmt = Main.rand.Next(2, 3); if (projectile.owner == Main.myPlayer) { - for (int num252 = 0; num252 < num251; num252++) + for (int b = 0; b < beadAmt; b++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value15.X, value15.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/Magic/SparklingBeam.cs b/Projectiles/Magic/SparklingBeam.cs index 5d0d1a0383..cd46efefb5 100644 --- a/Projectiles/Magic/SparklingBeam.cs +++ b/Projectiles/Magic/SparklingBeam.cs @@ -111,20 +111,14 @@ namespace CalamityMod.Projectiles.Magic if (target.life <= 0) { Player player = Main.player[projectile.owner]; - int shardDamage = (int)((SparklingEmpress.BaseDamage / 5) * (player.allDamage + player.magicDamage - 1f)); - int num251 = Main.rand.Next(2, 4); + int shardDamage = (int)((SparklingEmpress.BaseDamage / 5) * player.MagicDamage()); + int shardAmt = Main.rand.Next(2, 4); if (projectile.owner == Main.myPlayer) { - for (int num252 = 0; num252 < num251; num252++) + for (int s = 0; s < shardAmt; s++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int shard = Projectile.NewProjectile(target.Center.X, target.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), shardDamage, 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + int shard = Projectile.NewProjectile(target.Center, velocity, ModContent.ProjectileType(), shardDamage, 0f, projectile.owner, 0f, 0f); Main.projectile[shard].Calamity().forceMagic = true; } } diff --git a/Projectiles/Melee/AegisBeam.cs b/Projectiles/Melee/AegisBeam.cs index 079d99c4c8..0be8a8f07b 100644 --- a/Projectiles/Melee/AegisBeam.cs +++ b/Projectiles/Melee/AegisBeam.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Melee Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 73); projectile.localAI[0] += 1f; } - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, new Color(255, Main.DiscoG, 53), 0.8f); + int num458 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 246, 0f, 0f, 100, new Color(255, Main.DiscoG, 53), 0.8f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; @@ -56,39 +56,32 @@ namespace CalamityMod.Projectiles.Melee projectile.localNPCHitCooldown = 10; projectile.Damage(); Main.PlaySound(SoundID.Item20, projectile.Center); - for (int dust = 0; dust <= 30; dust++) + for (int d = 0; d <= 30; d++) { float num463 = (float)Main.rand.Next(-10, 11); float num464 = (float)Main.rand.Next(-10, 11); - float num465 = (float)Main.rand.Next(3, 9); + float speed = (float)Main.rand.Next(3, 9); float num466 = (float)Math.Sqrt((double)(num463 * num463 + num464 * num464)); - num466 = num465 / num466; + num466 = speed / num466; num463 *= num466; num464 *= num466; int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, new Color(255, Main.DiscoG, 53), 1.2f); - Main.dust[num467].noGravity = true; - Main.dust[num467].position.X = projectile.Center.X; - Main.dust[num467].position.Y = projectile.Center.Y; - Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X += (float)Main.rand.Next(-10, 11); - Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y += (float)Main.rand.Next(-10, 11); - Main.dust[num467].velocity.X = num463; - Main.dust[num467].velocity.Y = num464; + Dust dust = Main.dust[num467]; + dust.noGravity = true; + dust.position.X = projectile.Center.X; + dust.position.Y = projectile.Center.Y; + dust.position.X += (float)Main.rand.Next(-10, 11); + dust.position.Y += (float)Main.rand.Next(-10, 11); + dust.velocity.X = num463; + dust.velocity.Y = num464; } - int num251 = Main.rand.Next(2, 4); + int flameAmt = Main.rand.Next(2, 4); if (projectile.owner == Main.myPlayer) { - for (int num252 = 0; num252 < num251; num252++) + for (int i = 0; i < flameAmt; i++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.75), 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.75), 0f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/Melee/ClamCrusherFlail.cs b/Projectiles/Melee/ClamCrusherFlail.cs index 654d461866..9d9fe2dc87 100644 --- a/Projectiles/Melee/ClamCrusherFlail.cs +++ b/Projectiles/Melee/ClamCrusherFlail.cs @@ -127,14 +127,8 @@ namespace CalamityMod.Projectiles.Melee Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/ClamImpact"), (int)projectile.position.X, (int)projectile.position.Y); for (int num105 = 0; num105 < 50; num105++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int waterDust = Dust.NewDust(new Vector2(projectile.Center.X, projectile.Center.Y), projectile.width / 2, projectile.height / 2, 33, value15.X, value15.Y, 0, new Color(0, 142, 255), 1.5f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + int waterDust = Dust.NewDust(new Vector2(projectile.Center.X, projectile.Center.Y), projectile.width / 2, projectile.height / 2, 33, velocity.X, velocity.Y, 0, new Color(0, 142, 255), 1.5f); Main.dust[waterDust].velocity *= 2f; } } diff --git a/Projectiles/Melee/RedtideWhirlpool.cs b/Projectiles/Melee/RedtideWhirlpool.cs index 6dfcb4d07f..3e80bfc60c 100644 --- a/Projectiles/Melee/RedtideWhirlpool.cs +++ b/Projectiles/Melee/RedtideWhirlpool.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Melee { projectile.frame = 0; } - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Ranged/Aquashard.cs b/Projectiles/Ranged/Aquashard.cs index 5faf5234ff..0b9f8b7705 100644 --- a/Projectiles/Ranged/Aquashard.cs +++ b/Projectiles/Ranged/Aquashard.cs @@ -26,24 +26,18 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { projectile.velocity.X *= 0.9995f; - projectile.velocity.Y = projectile.velocity.Y + 0.01f; + projectile.velocity.Y += 0.01f; } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - int num251 = Main.rand.Next(2, 4); + int projAmt = Main.rand.Next(2, 4); if (projectile.owner == Main.myPlayer) { - for (int num252 = 0; num252 < num251; num252++) + for (int i = 0; i < projAmt; i++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/Ranged/ClamorRifleProj.cs b/Projectiles/Ranged/ClamorRifleProj.cs index b356c3be83..9b5430bd60 100644 --- a/Projectiles/Ranged/ClamorRifleProj.cs +++ b/Projectiles/Ranged/ClamorRifleProj.cs @@ -49,19 +49,13 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - int num251 = Main.rand.Next(2, 3); + int bulletAmt = 2; if (projectile.owner == Main.myPlayer) { - for (int num252 = 0; num252 < num251; num252++) + for (int b = 0; b < bulletAmt; b++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.45), 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.45), 0f, projectile.owner, 0f, 0f); } } Main.PlaySound(SoundID.Item118, projectile.Center); diff --git a/Projectiles/Ranged/CosmicFire.cs b/Projectiles/Ranged/CosmicFire.cs index fc45b2f130..5b3dccc63a 100644 --- a/Projectiles/Ranged/CosmicFire.cs +++ b/Projectiles/Ranged/CosmicFire.cs @@ -37,47 +37,44 @@ namespace CalamityMod.Projectiles.Ranged } if (projectile.ai[0] > 7f) { - float num296 = 1f; + float scalar = 1f; if (projectile.ai[0] == 8f) { - num296 = 0.25f; + scalar = 0.25f; } else if (projectile.ai[0] == 9f) { - num296 = 0.5f; + scalar = 0.5f; } else if (projectile.ai[0] == 10f) { - num296 = 0.75f; + scalar = 0.75f; } projectile.ai[0] += 1f; int dustType = 62; if (Main.rand.NextBool(2)) { - for (int num298 = 0; num298 < 1; num298++) - { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); - Dust dust = Main.dust[num299]; - if (Main.rand.NextBool(3)) - { - dust.noGravity = true; - dust.scale *= 3f; - dust.velocity.X *= 2f; - dust.velocity.Y *= 2f; - } - else - { - dust.scale *= 1.5f; - } - dust.velocity.X *= 1.2f; - dust.velocity.Y *= 1.2f; - dust.scale *= num296; - dust.velocity += projectile.velocity; - if (!dust.noGravity) - { - dust.velocity *= 0.5f; - } - } + int fire = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + Dust dust = Main.dust[fire]; + if (Main.rand.NextBool(3)) + { + dust.noGravity = true; + dust.scale *= 3f; + dust.velocity.X *= 2f; + dust.velocity.Y *= 2f; + } + else + { + dust.scale *= 1.5f; + } + dust.velocity.X *= 1.2f; + dust.velocity.Y *= 1.2f; + dust.scale *= scalar; + dust.velocity += projectile.velocity; + if (!dust.noGravity) + { + dust.velocity *= 0.5f; + } } } else diff --git a/Projectiles/Ranged/EnhancedNanoRoundProj.cs b/Projectiles/Ranged/EnhancedNanoRoundProj.cs index c360fdb514..2e3f3e5e69 100644 --- a/Projectiles/Ranged/EnhancedNanoRoundProj.cs +++ b/Projectiles/Ranged/EnhancedNanoRoundProj.cs @@ -61,16 +61,10 @@ namespace CalamityMod.Projectiles.Ranged { if (projectile.owner == Main.myPlayer) { - for (int num252 = 0; num252 < 2; num252++) + for (int i = 0; i < 2; i++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value15.X, value15.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.3), 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.3), 0f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/Ranged/FungiOrb.cs b/Projectiles/Ranged/FungiOrb.cs index eb951a4840..5515739c10 100644 --- a/Projectiles/Ranged/FungiOrb.cs +++ b/Projectiles/Ranged/FungiOrb.cs @@ -44,19 +44,13 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - int num251 = Main.rand.Next(2, 5); + int fungiAmt = Main.rand.Next(2, 5); if (projectile.owner == Main.myPlayer) { - for (int num252 = 0; num252 < num251; num252++) + for (int f = 0; f < fungiAmt; f++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.25), 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.25), 0f, projectile.owner, 0f, 0f); } } Main.PlaySound(SoundID.NPCDeath1, projectile.position); diff --git a/Projectiles/Ranged/SporeBomb.cs b/Projectiles/Ranged/SporeBomb.cs index 035b88d0cb..c05d251d6a 100644 --- a/Projectiles/Ranged/SporeBomb.cs +++ b/Projectiles/Ranged/SporeBomb.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged if (projectile.localAI[0] == 0f) { projectile.scale += 0.05f; - if ((double)projectile.scale > 1.2) + if (projectile.scale > 1.2f) { projectile.localAI[0] = 1f; } @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Ranged else { projectile.scale -= 0.05f; - if ((double)projectile.scale < 0.8) + if (projectile.scale < 0.8f) { projectile.localAI[0] = 0f; } @@ -72,26 +72,20 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { Main.PlaySound(SoundID.Item14, projectile.position); - for (int num407 = 0; num407 < 25; num407++) + for (int d = 0; d < 25; d++) { - int num408 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 157, 0f, 0f, 0, new Color(Main.DiscoR, 203, 103), 1f); - Main.dust[num408].noGravity = true; - Main.dust[num408].velocity *= 1.5f; - Main.dust[num408].scale = 1.5f; + int index = Dust.NewDust(projectile.position, projectile.width, projectile.height, 157, 0f, 0f, 0, new Color(Main.DiscoR, 203, 103), 1f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 1.5f; + Main.dust[index].scale = 1.5f; } - int num251 = Main.rand.Next(3, 7); + int sporeAmt = Main.rand.Next(3, 7); if (projectile.owner == Main.myPlayer) { - for (int num252 = 0; num252 < num251; num252++) + for (int s = 0; s < sporeAmt; s++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ProjectileID.SporeGas + Main.rand.Next(3), (int)((double)projectile.damage * 0.25), 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + int proj = Projectile.NewProjectile(projectile.Center, velocity, ProjectileID.SporeGas + Main.rand.Next(3), (int)(projectile.damage * 0.25), 0f, projectile.owner, 0f, 0f); Main.projectile[proj].Calamity().forceRanged = true; Main.projectile[proj].usesLocalNPCImmunity = true; Main.projectile[proj].localNPCHitCooldown = 30; diff --git a/Projectiles/Ranged/SpykerProj.cs b/Projectiles/Ranged/SpykerProj.cs index 259b2d3042..9abaee61b8 100644 --- a/Projectiles/Ranged/SpykerProj.cs +++ b/Projectiles/Ranged/SpykerProj.cs @@ -66,24 +66,18 @@ namespace CalamityMod.Projectiles.Ranged projectile.width = projectile.height = 32; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - int num251 = Main.rand.Next(3, 6); + int projAmt = Main.rand.Next(3, 6); if (projectile.owner == Main.myPlayer) { - for (int num252 = 0; num252 < num251; num252++) + for (int p = 0; p < projAmt; p++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.65), 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.65), 0f, projectile.owner, 0f, 0f); } } for (int num621 = 0; num621 < 3; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 46, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); + int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 46, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -93,10 +87,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 5; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 39, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.7f); + int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 39, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 44, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1f); + num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 44, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Ranged/TerraArrowMain.cs b/Projectiles/Ranged/TerraArrowMain.cs index 1e93a8e051..7af1f17a05 100644 --- a/Projectiles/Ranged/TerraArrowMain.cs +++ b/Projectiles/Ranged/TerraArrowMain.cs @@ -27,42 +27,36 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { projectile.velocity *= 1.005f; - if (projectile.velocity.X >= 20f || projectile.velocity.Y >= 20f || projectile.velocity.X <= -20f || projectile.velocity.Y <= -20f) + if (projectile.velocity.Length() >= 20f) { projectile.Kill(); } - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; } public override void Kill(int timeLeft) { projectile.position = projectile.Center; projectile.width = projectile.height = 32; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X -= (float)(projectile.width / 2); + projectile.position.Y -= (float)(projectile.height / 2); Main.PlaySound(SoundID.Item60, projectile.position); - for (int num621 = 0; num621 < 3; num621++) + for (int d = 0; d < 3; d++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 1.2f; + int terra = Dust.NewDust(projectile.position, projectile.width, projectile.height, 107, 0f, 0f, 100, default, 2f); + Main.dust[terra].velocity *= 1.2f; if (Main.rand.NextBool(2)) { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[terra].scale = 0.5f; + Main.dust[terra].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } if (projectile.owner == Main.myPlayer) { - for (int num252 = 0; num252 < 2; num252++) + for (int a = 0; a < 2; a++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.25), 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.25), 0f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/Ranged/TerraBulletMain.cs b/Projectiles/Ranged/TerraBulletMain.cs index 28bb65c8e0..db3ce4ef4a 100644 --- a/Projectiles/Ranged/TerraBulletMain.cs +++ b/Projectiles/Ranged/TerraBulletMain.cs @@ -71,16 +71,10 @@ namespace CalamityMod.Projectiles.Ranged { if (projectile.owner == Main.myPlayer) { - for (int num252 = 0; num252 < 2; num252++) + for (int b = 0; b < 2; b++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.3), 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.3), 0f, projectile.owner, 0f, 0f); } } Main.PlaySound(SoundID.Item118, projectile.position); diff --git a/Projectiles/Rogue/BallisticPoisonBombProj.cs b/Projectiles/Rogue/BallisticPoisonBombProj.cs index 767b344b2b..9af091389a 100644 --- a/Projectiles/Rogue/BallisticPoisonBombProj.cs +++ b/Projectiles/Rogue/BallisticPoisonBombProj.cs @@ -1,5 +1,6 @@ using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -90,8 +91,8 @@ namespace CalamityMod.Projectiles.Rogue projectile.ai[0] = 10f; if (projectile.velocity.Y == 0f && projectile.velocity.X != 0f) { - projectile.velocity.X = projectile.velocity.X * 0.97f; - if (projectile.velocity.X > -0.01f && projectile.velocity.X < 0.01f) + projectile.velocity.X *= 0.97f; + if (Math.Abs(projectile.velocity.X) < 0.01f) { projectile.velocity.X = 0f; projectile.netUpdate = true; @@ -108,49 +109,39 @@ namespace CalamityMod.Projectiles.Rogue projectile.width = projectile.height = 128; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 14); - int num251 = Main.rand.Next(3, 5); + Main.PlaySound(SoundID.Item14, projectile.Center); + int projAmt = Main.rand.Next(3, 5); if (projectile.owner == Main.myPlayer) { - for (int num252 = 0; num252 < num251; num252++) + for (int s = 0; s < projAmt; s++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); } - int num320 = Main.rand.Next(8, 13); - int num3; - for (int num321 = 0; num321 < num320; num321 = num3 + 1) + int cloudAmt = Main.rand.Next(8, 13); + for (int c = 0; c < cloudAmt; c++) { - Vector2 vector15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - vector15.Normalize(); - vector15 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector15.X, vector15.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.25), 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); - num3 = num321; + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 10f, 200f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.25), 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); } } - for (int num621 = 0; num621 < 5; num621++) + for (int d = 0; d < 5; d++) { - int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 14, 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 3f; + int boom = Dust.NewDust(projectile.position, projectile.width, projectile.height, 14, 0f, 0f, 100, default, 2f); + Main.dust[boom].velocity *= 3f; if (Main.rand.NextBool(2)) { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[boom].scale = 0.5f; + Main.dust[boom].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - for (int num623 = 0; num623 < 9; num623++) + for (int d = 0; d < 9; d++) { - int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); - Main.dust[num624].velocity *= 2f; + int fire = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Fire, 0f, 0f, 100, default, 3f); + Main.dust[fire].noGravity = true; + Main.dust[fire].velocity *= 5f; + fire = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Fire, 0f, 0f, 100, default, 2f); + Main.dust[fire].velocity *= 2f; } CalamityUtils.ExplosionGores(projectile.Center, 3); } diff --git a/Projectiles/Rogue/DestructionStar.cs b/Projectiles/Rogue/DestructionStar.cs index 8faa224bca..2018a0a830 100644 --- a/Projectiles/Rogue/DestructionStar.cs +++ b/Projectiles/Rogue/DestructionStar.cs @@ -33,12 +33,12 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 191, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } projectile.rotation += Math.Sign(projectile.velocity.X) * MathHelper.ToRadians(8f); - if (projectile.Calamity().stealthStrike == true || hitCount > 16) + if (projectile.Calamity().stealthStrike || hitCount > 16) hitCount = 16; } @@ -91,14 +91,8 @@ namespace CalamityMod.Projectiles.Rogue { for (int i = 0; i < hitCount; i++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), 0f, Main.myPlayer, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/Projectiles/Rogue/FantasyTalismanProj.cs b/Projectiles/Rogue/FantasyTalismanProj.cs index bd95a40f0f..744533b7e7 100644 --- a/Projectiles/Rogue/FantasyTalismanProj.cs +++ b/Projectiles/Rogue/FantasyTalismanProj.cs @@ -47,37 +47,9 @@ namespace CalamityMod.Projectiles.Rogue if (Main.rand.NextBool(2)) { int spiritDamage = projectile.damage / 2; - int[] array = new int[Main.maxNPCs]; - int targetArrayA = 0; - int targetArrayB = 0; - for (int index = 0; index < Main.maxNPCs; ++index) - { - NPC npc = Main.npc[index]; - if (npc.CanBeChasedBy(projectile, false)) - { - float npcDist = Vector2.Distance(projectile.Center, npc.Center); - if (npcDist < 800f) - { - if (Collision.CanHit(projectile.position, 1, 1, npc.position, npc.width, npc.height) && npcDist > 50f) - { - array[targetArrayB] = index; - ++targetArrayB; - } - else if (targetArrayB == 0) - { - array[targetArrayA] = index; - ++targetArrayA; - } - } - } - } - if (targetArrayA == 0 && targetArrayB == 0) - return; - int target = targetArrayB <= 0 ? array[Main.rand.Next(targetArrayA)] : array[Main.rand.Next(targetArrayB)]; - Vector2 velocity = CalamityUtils.RandomVelocity(100f, 4f, 4f, 1f); - int ghost = Projectile.NewProjectile(projectile.Center, velocity, ProjectileID.SpectreWrath, spiritDamage, 0f, projectile.owner, target, 0f); - Main.projectile[ghost].Calamity().forceRogue = true; - Main.projectile[ghost].penetrate = 1; + Projectile ghost = CalamityGlobalProjectile.SpawnOrb(projectile, spiritDamage, ProjectileID.SpectreWrath, 800f, 4f); + ghost.Calamity().forceRogue = true; + ghost.penetrate = 1; } } } diff --git a/Projectiles/Rogue/FantasyTalismanStealth.cs b/Projectiles/Rogue/FantasyTalismanStealth.cs index bdf4928009..fb27738123 100644 --- a/Projectiles/Rogue/FantasyTalismanStealth.cs +++ b/Projectiles/Rogue/FantasyTalismanStealth.cs @@ -57,37 +57,9 @@ namespace CalamityMod.Projectiles.Rogue if (Main.rand.NextBool(2)) { int spiritDamage = projectile.damage / 2; - int[] array = new int[Main.maxNPCs]; - int targetArrayA = 0; - int targetArrayB = 0; - for (int index = 0; index < Main.maxNPCs; ++index) - { - NPC npc = Main.npc[index]; - if (npc.CanBeChasedBy(projectile, false)) - { - float npcDist = Vector2.Distance(projectile.Center, npc.Center); - if (npcDist < 800f) - { - if (Collision.CanHit(projectile.position, 1, 1, npc.position, npc.width, npc.height) && npcDist > 50f) - { - array[targetArrayB] = index; - ++targetArrayB; - } - else if (targetArrayB == 0) - { - array[targetArrayA] = index; - ++targetArrayA; - } - } - } - } - if (targetArrayA == 0 && targetArrayB == 0) - return; - int target = targetArrayB <= 0 ? array[Main.rand.Next(targetArrayA)] : array[Main.rand.Next(targetArrayB)]; - Vector2 velocity = CalamityUtils.RandomVelocity(100f, 4f, 4f, 1f); - int ghost = Projectile.NewProjectile(projectile.Center, velocity, ProjectileID.SpectreWrath, spiritDamage, 0f, projectile.owner, target, 0f); - Main.projectile[ghost].Calamity().forceRogue = true; - Main.projectile[ghost].penetrate = 1; + Projectile ghost = CalamityGlobalProjectile.SpawnOrb(projectile, spiritDamage, ProjectileID.SpectreWrath, 800f, 4f); + ghost.Calamity().forceRogue = true; + ghost.penetrate = 1; } } } diff --git a/Projectiles/Rogue/HypothermiaChunk.cs b/Projectiles/Rogue/HypothermiaChunk.cs index 24913c1d81..05d18001a9 100644 --- a/Projectiles/Rogue/HypothermiaChunk.cs +++ b/Projectiles/Rogue/HypothermiaChunk.cs @@ -58,16 +58,10 @@ namespace CalamityMod.Projectiles.Rogue } if (projectile.owner == Main.myPlayer) { - for (int num252 = 0; num252 < Main.rand.Next(1,4); num252++) + for (int i = 0; i < Main.rand.Next(1,4); i++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int shard = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.33f), projectile.knockBack * 0.75f, Main.myPlayer, Main.rand.Next(4), 1f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + int shard = Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.33f), projectile.knockBack * 0.75f, Main.myPlayer, Main.rand.Next(4), 1f); } } } diff --git a/Projectiles/Rogue/NastyChollaBol.cs b/Projectiles/Rogue/NastyChollaBol.cs index 8b201fe22f..fa7d5b20fa 100644 --- a/Projectiles/Rogue/NastyChollaBol.cs +++ b/Projectiles/Rogue/NastyChollaBol.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; +using System; using Terraria; using Terraria.ModLoader; @@ -81,14 +82,14 @@ namespace CalamityMod.Projectiles.Rogue projectile.localAI[1] = 10f; if (projectile.velocity.Y == 0f && projectile.velocity.X != 0f) { - projectile.velocity.X = projectile.velocity.X * 0.97f; - if ((double)projectile.velocity.X > -0.01 && (double)projectile.velocity.X < 0.01) + projectile.velocity.X *= 0.97f; + if (Math.Abs(projectile.velocity.X) < 0.01) { projectile.velocity.X = 0f; projectile.netUpdate = true; } } - projectile.velocity.Y = projectile.velocity.Y + 0.2f; + projectile.velocity.Y += 0.2f; } projectile.rotation += projectile.velocity.X * 0.1f; } @@ -121,19 +122,13 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { Player player = Main.player[projectile.owner]; - int num251 = Main.rand.Next(2, 4); + int needleAmt = Main.rand.Next(2, 4); if (projectile.owner == Main.myPlayer) { - for (int num252 = 0; num252 < num251; num252++) + for (int n = 0; n < needleAmt; n++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int shard = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)((NastyCholla.BaseDamage/4) * (player.allDamage + player.meleeDamage - 1f)), 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + int shard = Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)((NastyCholla.BaseDamage/4) * player.RogueDamage()), 0f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/Rogue/Prismalline3.cs b/Projectiles/Rogue/Prismalline3.cs index 1c4eeb32e2..5fc4d6946c 100644 --- a/Projectiles/Rogue/Prismalline3.cs +++ b/Projectiles/Rogue/Prismalline3.cs @@ -25,10 +25,10 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.ToRadians(135f); if (projectile.spriteDirection == -1) { - projectile.rotation -= 1.57f; + projectile.rotation -= MathHelper.PiOver2; } CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 300f, 25f, 20f); } @@ -49,16 +49,10 @@ namespace CalamityMod.Projectiles.Rogue if (projectile.ai[0] == 1f) { int shardCount = Main.rand.Next(1,4); - for (int num252 = 0; num252 < shardCount; num252++) + for (int s = 0; s < shardCount; s++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int shard = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), projectile.damage / 3, 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + int shard = Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage / 3, 0f, projectile.owner, 0f, 0f); Main.projectile[shard].Calamity().forceRogue = true; Main.projectile[shard].penetrate = 1; } diff --git a/Projectiles/Rogue/PrismallineProj.cs b/Projectiles/Rogue/PrismallineProj.cs index adc3098264..a1fab9f455 100644 --- a/Projectiles/Rogue/PrismallineProj.cs +++ b/Projectiles/Rogue/PrismallineProj.cs @@ -48,21 +48,15 @@ namespace CalamityMod.Projectiles.Rogue { for (int i = 0; i < numProj + 1; i++) { - Vector2 speed = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); - while (speed.X == 0f && speed.Y == 0f) - { - speed = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); - } - speed.Normalize(); - speed *= (float)Main.rand.Next(30, 61) * 0.1f * 2f; + Vector2 velocity = CalamityUtils.RandomVelocity(50f, 30f, 60f, 0.2f); if (numSpecProj < 2 && !hitEnemy) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speed.X, speed.Y, ModContent.ProjectileType(), (int)(projectile.damage * 1.1), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 1.1), projectile.knockBack, projectile.owner, 0f, 0f); ++numSpecProj; } else { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speed.X, speed.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.75), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.75), projectile.knockBack, projectile.owner, 0f, 0f); } } } @@ -71,28 +65,16 @@ namespace CalamityMod.Projectiles.Rogue int shardCount = Main.rand.Next(2,5); for (int num252 = 0; num252 < shardCount; num252++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int shard = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), projectile.damage / 2, 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + int shard = Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage / 2, 0f, projectile.owner, 0f, 0f); Main.projectile[shard].Calamity().forceRogue = true; Main.projectile[shard].usesLocalNPCImmunity = true; Main.projectile[shard].localNPCHitCooldown = 10; } for (int i = 0; i < numProj + 1; i++) { - Vector2 speed = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); - while (speed.X == 0f && speed.Y == 0f) - { - speed = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); - } - speed.Normalize(); - speed *= (float)Main.rand.Next(30, 61) * 0.1f * 2f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speed.X, speed.Y, ModContent.ProjectileType(), (int)(projectile.damage * 1.15), projectile.knockBack, projectile.owner, 1f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(50f, 30f, 60f, 0.2f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 1.15), projectile.knockBack, projectile.owner, 1f, 0f); } } } @@ -116,16 +98,10 @@ namespace CalamityMod.Projectiles.Rogue if (projectile.Calamity().stealthStrike) { int shardCount = Main.rand.Next(1,4); - for (int num252 = 0; num252 < shardCount; num252++) + for (int s = 0; s < shardCount; s++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int shard = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), projectile.damage / 2, 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + int shard = Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage / 2, 0f, projectile.owner, 0f, 0f); Main.projectile[shard].Calamity().forceRogue = true; Main.projectile[shard].penetrate = 1; } diff --git a/Projectiles/Rogue/SandDollarStealth.cs b/Projectiles/Rogue/SandDollarStealth.cs index d92e588b1d..4986c1cac4 100644 --- a/Projectiles/Rogue/SandDollarStealth.cs +++ b/Projectiles/Rogue/SandDollarStealth.cs @@ -28,44 +28,28 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { + OnHitEffects(); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + OnHitEffects(); + } + + private void OnHitEffects() + { int coralAmt = Main.rand.Next(1, 4); if (projectile.owner == Main.myPlayer && projectile.Calamity().stealthStrike) { for (int coralCount = 0; coralCount < coralAmt; coralCount++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int coral = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), projectile.damage / 3, 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + int coral = Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage / 3, 0f, projectile.owner, 0f, 0f); Main.projectile[coral].Calamity().forceRogue = true; } } } - public override void OnHitPvp(Player target, int damage, bool crit) - { - int coralAmt = Main.rand.Next(1, 4); - if (projectile.owner == Main.myPlayer && projectile.Calamity().stealthStrike) - { - for (int coralCount = 0; coralCount < coralAmt; coralCount++) - { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int coral = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), projectile.damage / 3, 0f, projectile.owner, 0f, 0f); - Main.projectile[coral].Calamity().forceRogue = true; - } - } - } - public override bool OnTileCollide(Vector2 oldVelocity) { projectile.ai[0] += 0.1f; diff --git a/Projectiles/Rogue/SupernovaBomb.cs b/Projectiles/Rogue/SupernovaBomb.cs index fa4ad25eee..a7f229b6da 100644 --- a/Projectiles/Rogue/SupernovaBomb.cs +++ b/Projectiles/Rogue/SupernovaBomb.cs @@ -50,14 +50,14 @@ namespace CalamityMod.Projectiles.Rogue projectile.ai[0] = 10f; if (projectile.velocity.Y == 0f && projectile.velocity.X != 0f) { - projectile.velocity.X = projectile.velocity.X * 0.97f; - if ((double)projectile.velocity.X > -0.01 && (double)projectile.velocity.X < 0.01) + projectile.velocity.X *= 0.97f; + if (Math.Abs(projectile.velocity.X) < 0.01f) { projectile.velocity.X = 0f; projectile.netUpdate = true; } } - projectile.velocity.Y = projectile.velocity.Y + 0.2f; + projectile.velocity.Y += 0.2f; } //rotation @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Rogue { if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0f, 2f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.8), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0f, 2f, ModContent.ProjectileType(), (int)(projectile.damage * 0.8), projectile.knockBack, projectile.owner, 0f, 0f); } } } @@ -85,57 +85,50 @@ namespace CalamityMod.Projectiles.Rogue Main.PlaySound(SoundID.Item14, projectile.position); //spawn projectiles - int num251 = Main.rand.Next(3, 5); + int projAmt = Main.rand.Next(3, 5); if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - for (int num252 = 0; num252 < num251; num252++) + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + for (int i = 0; i < projAmt; i++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.6), 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.6), 0f, projectile.owner, 0f, 0f); } float spread = 60f * 0.0174f; double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; double deltaAngle = spread / 6f; double offsetAngle; - int i; - for (i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 2f), (float)(Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 2f), (float)(-Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 2f), (float)(Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType(), (int)(projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 2f), (float)(-Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType(), (int)(projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); } } //dust effects - int num298 = Main.rand.NextBool(2) ? 107 : 234; + int dustType = Main.rand.NextBool(2) ? 107 : 234; if (Main.rand.NextBool(4)) { - num298 = 269; + dustType = 269; } - for (int num621 = 0; num621 < 5; num621++) + for (int d = 0; d < 5; d++) { - int num622 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num298, 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 3f; + int exo = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f); + Main.dust[exo].velocity *= 3f; if (Main.rand.NextBool(2)) { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[exo].scale = 0.5f; + Main.dust[exo].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - for (int num623 = 0; num623 < 9; num623++) + for (int d = 0; d < 9; d++) { - int num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); - Main.dust[num624].velocity *= 2f; + int fire = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Fire, 0f, 0f, 100, default, 3f); + Main.dust[fire].noGravity = true; + Main.dust[fire].velocity *= 5f; + fire = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Fire, 0f, 0f, 100, default, 2f); + Main.dust[fire].velocity *= 2f; } //gore cloud effects diff --git a/Projectiles/Rogue/TheSyringeProj.cs b/Projectiles/Rogue/TheSyringeProj.cs index 0db04433ed..1694cd1276 100644 --- a/Projectiles/Rogue/TheSyringeProj.cs +++ b/Projectiles/Rogue/TheSyringeProj.cs @@ -70,21 +70,15 @@ namespace CalamityMod.Projectiles.Rogue { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 89, projectile.oldVelocity.X, projectile.oldVelocity.Y); } - int num251 = Main.rand.Next(1, 3); + int fireAmt = Main.rand.Next(1, 3); if (projectile.owner == Main.myPlayer) { - for (int num252 = 0; num252 < num251; num252++) + for (int f = 0; f < fireAmt; f++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), 0f, Main.myPlayer, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), 0f, Main.myPlayer, 0f, 0f); } - for (int index = 0; index < 2; ++index) + for (int s = 0; s < 2; ++s) { float SpeedX = -projectile.velocity.X * Main.rand.Next(40, 70) * 0.01f + Main.rand.Next(-20, 21) * 0.4f; float SpeedY = -projectile.velocity.Y * Main.rand.Next(40, 70) * 0.01f + Main.rand.Next(-20, 21) * 0.4f; @@ -93,12 +87,12 @@ namespace CalamityMod.Projectiles.Rogue } if (projectile.owner == Main.myPlayer && projectile.ai[1] == 1) { - for (int num639 = 0; num639 < 5; num639++) + for (int b = 0; b < 5; b++) { float speedX = (float)Main.rand.Next(-35, 36) * 0.02f; float speedY = (float)Main.rand.Next(-35, 36) * 0.02f; - int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speedX, speedY, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), 0f, Main.myPlayer, 0f, 0f); - Main.projectile[proj].penetrate = 1; + int bee = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speedX, speedY, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), 0f, Main.myPlayer, 0f, 0f); + Main.projectile[bee].penetrate = 1; } } } diff --git a/Projectiles/Rogue/TotalityFlask.cs b/Projectiles/Rogue/TotalityFlask.cs index 6336f8aac1..c78562fb18 100644 --- a/Projectiles/Rogue/TotalityFlask.cs +++ b/Projectiles/Rogue/TotalityFlask.cs @@ -25,13 +25,13 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (projectile.Calamity().stealthStrike == true) + if (projectile.Calamity().stealthStrike) { if (projectile.timeLeft % 10 == 0) { if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0f, projectile.velocity.Y * 0f, ModContent.ProjectileType(), (int)(projectile.damage * 0.6), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.6), projectile.knockBack, projectile.owner, 0f, 0f); } } } @@ -62,35 +62,29 @@ namespace CalamityMod.Projectiles.Rogue Main.projectile[meltdown].Center = projectile.Center; //makes it centered because it's not without this Vector2 vector2 = new Vector2(20f, 20f); - for (int index = 0; index < 5; ++index) + for (int d = 0; d < 5; ++d) Dust.NewDust(projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 191, 0.0f, 0.0f, 0, Color.Red, 1f); - for (int index1 = 0; index1 < 10; ++index1) + for (int d = 0; d < 10; ++d) { int index2 = Dust.NewDust(projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 31, 0.0f, 0.0f, 100, new Color(), 1.5f); Dust dust = Main.dust[index2]; dust.velocity *= 1.4f; } - for (int index1 = 0; index1 < 20; ++index1) + for (int d = 0; d < 20; ++d) { - int index2 = Dust.NewDust(projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 6, 0.0f, 0.0f, 100, new Color(), 2.5f); + int index2 = Dust.NewDust(projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, DustID.Fire, 0.0f, 0.0f, 100, new Color(), 2.5f); Dust dust1 = Main.dust[index2]; dust1.noGravity = true; dust1.velocity *= 5f; - int index3 = Dust.NewDust(projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 6, 0.0f, 0.0f, 100, new Color(), 1.5f); + int index3 = Dust.NewDust(projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, DustID.Fire, 0.0f, 0.0f, 100, new Color(), 1.5f); Dust dust2 = Main.dust[index3]; dust2.velocity *= 3f; } - int num251 = Main.rand.Next(2, 4); - for (int num252 = 0; num252 < num251; num252++) + int tarAmt = Main.rand.Next(2, 4); + for (int t = 0; t < tarAmt; t++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.3), 0f, Main.myPlayer, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.3), 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/Projectiles/Rogue/TotalityTar.cs b/Projectiles/Rogue/TotalityTar.cs index 6ea14ec9df..6e6d7fa30d 100644 --- a/Projectiles/Rogue/TotalityTar.cs +++ b/Projectiles/Rogue/TotalityTar.cs @@ -1,4 +1,5 @@ using Microsoft.Xna.Framework; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -28,15 +29,15 @@ namespace CalamityMod.Projectiles.Rogue { if (projectile.velocity.X != projectile.velocity.X) { - projectile.velocity.X = projectile.velocity.X * -0.1f; + projectile.velocity.X *= -0.1f; } if (projectile.velocity.X != projectile.velocity.X) { - projectile.velocity.X = projectile.velocity.X * -0.5f; + projectile.velocity.X *= -0.5f; } if (projectile.velocity.Y != projectile.velocity.Y && projectile.velocity.Y > 1f) { - projectile.velocity.Y = projectile.velocity.Y * -0.5f; + projectile.velocity.Y *= -0.5f; } projectile.ai[0] += 1f; if (projectile.ai[0] > 5f) @@ -44,19 +45,19 @@ namespace CalamityMod.Projectiles.Rogue projectile.ai[0] = 5f; if (projectile.velocity.Y == 0f && projectile.velocity.X != 0f) { - projectile.velocity.X = projectile.velocity.X * 0.97f; - if ((double)projectile.velocity.X > -0.01 && (double)projectile.velocity.X < 0.01) + projectile.velocity.X *= 0.97f; + if (Math.Abs(projectile.velocity.X) < 0.01f) { projectile.velocity.X = 0f; projectile.netUpdate = true; } } - projectile.velocity.Y = projectile.velocity.Y + 0.2f; + projectile.velocity.Y += 0.2f; } projectile.rotation += projectile.velocity.X * 0.1f; - if ((double)projectile.velocity.Y < 0.25 && (double)projectile.velocity.Y > 0.15) + if (projectile.velocity.Y < 0.25f && projectile.velocity.Y > 0.15f) { - projectile.velocity.X = projectile.velocity.X * 0.8f; + projectile.velocity.X *= 0.8f; } projectile.rotation = -projectile.velocity.X * 0.05f; if (projectile.velocity.Y > 16f) @@ -90,31 +91,25 @@ namespace CalamityMod.Projectiles.Rogue { int index2 = Dust.NewDust(projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 31, 0.0f, 0.0f, 100, new Color(), 1.5f); Dust dust = Main.dust[index2]; - dust.velocity = dust.velocity * 1.4f; + dust.velocity *= 1.4f; } for (int index1 = 0; index1 < 10; ++index1) { - int index2 = Dust.NewDust(projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 6, 0.0f, 0.0f, 100, new Color(), 2.5f); - Main.dust[index2].noGravity = true; + int index2 = Dust.NewDust(projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, DustID.Fire, 0.0f, 0.0f, 100, new Color(), 2.5f); Dust dust1 = Main.dust[index2]; - dust1.velocity = dust1.velocity * 5f; - int index3 = Dust.NewDust(projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 6, 0.0f, 0.0f, 100, new Color(), 1.5f); + dust1.noGravity = true; + dust1.velocity *= 5f; + int index3 = Dust.NewDust(projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, DustID.Fire, 0.0f, 0.0f, 100, new Color(), 1.5f); Dust dust2 = Main.dust[index3]; - dust2.velocity = dust2.velocity * 3f; + dust2.velocity *= 3f; } - int num251 = Main.rand.Next(2, 4); + int fireAmt = Main.rand.Next(2, 4); if (projectile.owner == Main.myPlayer) { - for (int num252 = 0; num252 < num251; num252++) + for (int f = 0; f < fireAmt; f++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int fire = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), projectile.damage, 1f, Main.myPlayer, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage, 1f, Main.myPlayer, 0f, 0f); } } } diff --git a/Projectiles/Rogue/TurbulanceProjectile.cs b/Projectiles/Rogue/TurbulanceProjectile.cs index 91a3065856..a4bf1741d7 100644 --- a/Projectiles/Rogue/TurbulanceProjectile.cs +++ b/Projectiles/Rogue/TurbulanceProjectile.cs @@ -9,8 +9,6 @@ namespace CalamityMod.Projectiles.Rogue { public class TurbulanceProjectile : ModProjectile { - public int stealthStrikeTimer = 0; - public override void SetStaticDefaults() { DisplayName.SetDefault("Turbulance"); @@ -20,10 +18,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetDefaults() { - projectile.width = 20; - projectile.height = 20; + projectile.width = projectile.height = 20; projectile.friendly = true; - projectile.penetrate = 1; projectile.timeLeft = 600; projectile.extraUpdates = 2; projectile.ignoreWater = true; @@ -33,37 +29,29 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (projectile.ai[0] < 0.2f) - { - projectile.ai[0] += 0.1f; - } - else - { - projectile.tileCollide = true; - } + projectile.ai[0]++; + projectile.tileCollide = projectile.ai[0] < 2f; - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.ToRadians(135f); if (projectile.spriteDirection == -1) { - projectile.rotation -= 1.57f; + projectile.rotation -= MathHelper.PiOver2; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 187, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 100, new Color(53, Main.DiscoG, 255)); } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 16, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } if (projectile.Calamity().stealthStrike) //Stealth strike { - stealthStrikeTimer++; - if (stealthStrikeTimer >= 14) + if (projectile.timeLeft % 14 == 0) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack / 2, projectile.owner, 1f, 1f); - stealthStrikeTimer = 0; + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, projectile.knockBack / 2, projectile.owner, 1f, 1f); } } } @@ -78,57 +66,30 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (projectile.owner == Main.myPlayer) - { - for (int num252 = 0; num252 < 4; num252++) - { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), projectile.damage / 3, projectile.knockBack / 3, Main.myPlayer, 0f, (crit ? 1f /*homing*/: 0f/*not homing*/)); - } - } + OnHitEffects(crit); } public override void OnHitPvp(Player target, int damage, bool crit) { - if (projectile.owner == Main.myPlayer) - { - for (int num252 = 0; num252 < 4; num252++) - { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), projectile.damage / 3, projectile.knockBack / 3, Main.myPlayer, 0f, (crit ? 1f /*homing*/: 0f/*not homing*/)); - } - } + OnHitEffects(crit); } public override bool OnTileCollide(Vector2 oldVelocity) { + OnHitEffects(false); + return true; + } + + private void OnHitEffects(bool homeIn) + { if (projectile.owner == Main.myPlayer) { - for (int num252 = 0; num252 < 4; num252++) - { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), projectile.damage / 3, projectile.knockBack / 3, Main.myPlayer, 0f, 0f); - } + for (int w = 0; w < 4; w++) + { + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage / 3, projectile.knockBack / 3, Main.myPlayer, 0f, (homeIn ? 1f : 0f)); + } } - return true; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Rogue/ValariBoomerang.cs b/Projectiles/Rogue/ValariBoomerang.cs index c112d88487..4e0e029242 100644 --- a/Projectiles/Rogue/ValariBoomerang.cs +++ b/Projectiles/Rogue/ValariBoomerang.cs @@ -94,25 +94,25 @@ namespace CalamityMod.Projectiles.Rogue // Home back in on the player. if (projectile.velocity.X < xDist) { - projectile.velocity.X = projectile.velocity.X + acceleration; + projectile.velocity.X += acceleration; if (projectile.velocity.X < 0f && xDist > 0f) projectile.velocity.X += acceleration; } else if (projectile.velocity.X > xDist) { - projectile.velocity.X = projectile.velocity.X - acceleration; + projectile.velocity.X -= acceleration; if (projectile.velocity.X > 0f && xDist < 0f) projectile.velocity.X -= acceleration; } if (projectile.velocity.Y < yDist) { - projectile.velocity.Y = projectile.velocity.Y + acceleration; + projectile.velocity.Y += acceleration; if (projectile.velocity.Y < 0f && yDist > 0f) projectile.velocity.Y += acceleration; } else if (projectile.velocity.Y > yDist) { - projectile.velocity.Y = projectile.velocity.Y - acceleration; + projectile.velocity.Y -= acceleration; if (projectile.velocity.Y > 0f && yDist < 0f) projectile.velocity.Y -= acceleration; } @@ -125,27 +125,26 @@ namespace CalamityMod.Projectiles.Rogue } } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + private void OnHitEffects() { //Start homing at player if you hit an enemy projectile.ai[0] = 1; - int num251 = Main.rand.Next(2, 4); + int icicleAmt = Main.rand.Next(2, 4); if (projectile.owner == Main.myPlayer) { - for (int num252 = 0; num252 < num251; num252++) + for (int i = 0; i < icicleAmt; i++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int shard = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, (Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType()), projectile.damage / 3, 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + int shard = Projectile.NewProjectile(projectile.Center, velocity, (Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType()), projectile.damage / 3, 0f, projectile.owner, 0f, 0f); } } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + OnHitEffects(); target.AddBuff(BuffID.Frostburn, 240); target.AddBuff(ModContent.BuffType(), 240); if (Main.rand.NextBool(5)) @@ -154,25 +153,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitPvp(Player target, int damage, bool crit) { - //Start homing at player if you hit someone - projectile.ai[0] = 1; - - int num251 = Main.rand.Next(2, 4); - if (projectile.owner == Main.myPlayer) - { - for (int num252 = 0; num252 < num251; num252++) - { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int shard = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, (Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType()), projectile.damage / 3, 0f, projectile.owner, 0f, 0f); - } - } - + OnHitEffects(); target.AddBuff(BuffID.Frostburn, 240); target.AddBuff(ModContent.BuffType(), 240); if (Main.rand.NextBool(5)) diff --git a/Projectiles/Summon/CosmicEnergySpiral.cs b/Projectiles/Summon/CosmicEnergySpiral.cs index 86851d8c8e..3ee918c8bb 100644 --- a/Projectiles/Summon/CosmicEnergySpiral.cs +++ b/Projectiles/Summon/CosmicEnergySpiral.cs @@ -214,24 +214,17 @@ namespace CalamityMod.Projectiles.Summon if (flag11) { Main.PlaySound(SoundID.Item105, (int)projectile.position.X, (int)projectile.position.Y); - int num251 = Main.rand.Next(5, 8); - for (int num252 = 0; num252 < num251; num252++) + int blastAmt = Main.rand.Next(5, 8); + for (int b = 0; b < blastAmt; b++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), 2f, projectile.owner, (float)target, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), 2f, projectile.owner, (float)target, 0f); } - float num403 = 15f; - Vector2 vector29 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num404 = num396 - vector29.X; - float num405 = num397 - vector29.Y; + float speed = 15f; + float num404 = num396 - projectile.Center.X; + float num405 = num397 - projectile.Center.Y; float num406 = (float)Math.Sqrt((double)(num404 * num404 + num405 * num405)); - num406 = num403 / num406; + num406 = speed / num406; num404 *= num406; num405 *= num406; Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num404, num405, ModContent.ProjectileType(), projectile.damage, 3f, projectile.owner, (float)target, 0f); diff --git a/Projectiles/Summon/ReaverOrb.cs b/Projectiles/Summon/ReaverOrb.cs index 467deb8d7a..9a8949e334 100644 --- a/Projectiles/Summon/ReaverOrb.cs +++ b/Projectiles/Summon/ReaverOrb.cs @@ -95,36 +95,28 @@ namespace CalamityMod.Projectiles.Summon projectile.ai[0] -= 1f; return; } - bool flag18 = false; - float num508 = 600f; - for (int num512 = 0; num512 < Main.maxNPCs; num512++) + bool foundTarget = false; + float maxDist = 600f; + for (int i = 0; i < Main.maxNPCs; i++) { - if (Main.npc[num512].CanBeChasedBy(projectile, false)) + NPC npc = Main.npc[i]; + if (npc.CanBeChasedBy(projectile, false)) { - float num513 = Main.npc[num512].position.X + (float)(Main.npc[num512].width / 2); - float num514 = Main.npc[num512].position.Y + (float)(Main.npc[num512].height / 2); - float num515 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num513) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num514); - if (num515 < num508 && Collision.CanHit(projectile.position, projectile.width, projectile.height, Main.npc[num512].position, Main.npc[num512].width, Main.npc[num512].height)) + if (Vector2.Distance(projectile.Center, npc.Center) < maxDist && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { - num508 = num515; - flag18 = true; + foundTarget = true; break; } } } - if (flag18) + if (foundTarget) { - int num251 = Main.rand.Next(4, 9); - for (int num252 = 0; num252 < num251; num252++) + int projAmt = Main.rand.Next(4, 9); + for (int u = 0; u < projAmt; u++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(90, 121) * 0.1f; - int spore = Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, value15.X, value15.Y, ProjectileID.SporeGas + Main.rand.Next(3), projectile.damage, 1.5f, projectile.owner, 0f, 0f); + Vector2 source = new Vector2(projectile.Center.X - 4f, projectile.Center.Y); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 90f, 120f); + int spore = Projectile.NewProjectile(source, velocity, ProjectileID.SporeGas + Main.rand.Next(3), projectile.damage, 1.5f, projectile.owner, 0f, 0f); Main.projectile[spore].minionSlots = 0f; Main.projectile[spore].Calamity().forceMinion = true; Main.projectile[spore].usesLocalNPCImmunity = true; diff --git a/Projectiles/Summon/Urchin.cs b/Projectiles/Summon/Urchin.cs index 98ed8bf83c..930f055101 100644 --- a/Projectiles/Summon/Urchin.cs +++ b/Projectiles/Summon/Urchin.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { - bool flag64 = projectile.type == ModContent.ProjectileType(); Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); if (!modPlayer.urchin) @@ -42,7 +41,8 @@ namespace CalamityMod.Projectiles.Summon projectile.active = false; return; } - if (flag64) + bool correctMinion = projectile.type == ModContent.ProjectileType(); + if (correctMinion) { if (player.dead) { @@ -58,12 +58,12 @@ namespace CalamityMod.Projectiles.Summon { projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; - int num501 = 50; - for (int num502 = 0; num502 < num501; num502++) + int dustAmt = 50; + for (int d = 0; d < dustAmt; d++) { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 179, 0f, 0f, 0, default, 1f); - Main.dust[num503].velocity *= 2f; - Main.dust[num503].scale *= 1.15f; + int index = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 179, 0f, 0f, 0, default, 1f); + Main.dust[index].velocity *= 2f; + Main.dust[index].scale *= 1.15f; } } if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) @@ -95,36 +95,28 @@ namespace CalamityMod.Projectiles.Summon projectile.ai[0] -= 1f; return; } - bool flag18 = false; - float num508 = 300f; - for (int num512 = 0; num512 < Main.maxNPCs; num512++) + bool foundTarget = false; + float maxDist = 300f; + for (int i = 0; i < Main.maxNPCs; i++) { - if (Main.npc[num512].CanBeChasedBy(projectile, false)) + NPC npc = Main.npc[i]; + if (npc.CanBeChasedBy(projectile, false)) { - float num513 = Main.npc[num512].position.X + (float)(Main.npc[num512].width / 2); - float num514 = Main.npc[num512].position.Y + (float)(Main.npc[num512].height / 2); - float num515 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num513) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num514); - if (num515 < num508 && Collision.CanHit(projectile.position, projectile.width, projectile.height, Main.npc[num512].position, Main.npc[num512].width, Main.npc[num512].height)) + if (Vector2.Distance(projectile.Center, npc.Center) < maxDist && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { - num508 = num515; - flag18 = true; + foundTarget = true; break; } } } - if (flag18) + if (foundTarget) { - int num251 = Main.rand.Next(3, 7); - for (int num252 = 0; num252 < num251; num252++) + int projAmt = Main.rand.Next(3, 7); + for (int u = 0; u < projAmt; u++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int spore = Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), projectile.damage, 1f, projectile.owner, 0f, 0f); + Vector2 source = new Vector2(projectile.Center.X - 4f, projectile.Center.Y); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + int spore = Projectile.NewProjectile(source, velocity, ModContent.ProjectileType(), projectile.damage, 1f, projectile.owner, 0f, 0f); Main.projectile[spore].minion = true; Main.projectile[spore].minionSlots = 0f; } diff --git a/Projectiles/Typeless/GodSlayerShrapnelRound.cs b/Projectiles/Typeless/GodSlayerShrapnelRound.cs index c5384e4247..622dcfeb94 100644 --- a/Projectiles/Typeless/GodSlayerShrapnelRound.cs +++ b/Projectiles/Typeless/GodSlayerShrapnelRound.cs @@ -28,12 +28,12 @@ namespace CalamityMod.Projectiles.Typeless Main.PlaySound(SoundID.Item73, projectile.position); projectile.localAI[0] += 1f; } - for (int num457 = 0; num457 < 3; num457++) + for (int d = 0; d < 3; d++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.2f); - Main.dust[num458].noGravity = true; - Main.dust[num458].velocity *= 0.5f; - Main.dust[num458].velocity += projectile.velocity * 0.1f; + int cosmilite = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.2f); + Main.dust[cosmilite].noGravity = true; + Main.dust[cosmilite].velocity *= 0.5f; + Main.dust[cosmilite].velocity += projectile.velocity * 0.1f; } } @@ -41,17 +41,11 @@ namespace CalamityMod.Projectiles.Typeless { if (projectile.owner == Main.myPlayer) { - int num251 = Main.rand.Next(4, 7); - for (int num252 = 0; num252 < num251; num252++) + int shrapnelAmt = Main.rand.Next(4, 7); + for (int s = 0; s < shrapnelAmt; s++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value15.X, value15.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.3), 0f, projectile.owner, 0f, 0f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.3), 0f, projectile.owner, 0f, 0f); } } } From cc012ead4c44b04f60afea9d61968308a3a53918 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 18 Jul 2020 13:44:22 -0400 Subject: [PATCH 125/160] fixed reaver rogue set bonus fucking i frames --- CalPlayer/CalamityPlayer.cs | 31 ++++++------ Projectiles/CalamityGlobalProjectile.cs | 2 +- Projectiles/Typeless/ReaverSpore.cs | 63 ++++++++++++++++++++++++ Projectiles/Typeless/ReaverSpore.png | Bin 0 -> 245 bytes Projectiles/Typeless/ReaverSpore2.png | Bin 0 -> 253 bytes 5 files changed, 78 insertions(+), 18 deletions(-) create mode 100644 Projectiles/Typeless/ReaverSpore.cs create mode 100644 Projectiles/Typeless/ReaverSpore.png create mode 100644 Projectiles/Typeless/ReaverSpore2.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 4b5b825f67..55de885b61 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -7742,17 +7742,16 @@ namespace CalamityMod.CalPlayer double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; double offsetAngle; - int i; int fDamage = (int)(56 * player.AverageDamage()); if (player.whoAmI == Main.myPlayer) { - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { float xPos = Main.rand.NextBool(2) ? player.Center.X + 100 : player.Center.X - 100; - Vector2 vector2 = new Vector2(xPos, player.Center.Y + Main.rand.Next(-100, 101)); + Vector2 spawnPos = new Vector2(xPos, player.Center.Y + Main.rand.Next(-100, 101)); offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - int spore1 = Projectile.NewProjectile(vector2.X, vector2.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ProjectileID.TruffleSpore, fDamage, 1.25f, player.whoAmI, 0f, 0f); - int spore2 = Projectile.NewProjectile(vector2.X, vector2.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ProjectileID.TruffleSpore, fDamage, 1.25f, player.whoAmI, 0f, 0f); + int spore1 = Projectile.NewProjectile(spawnPos.X, spawnPos.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ProjectileID.TruffleSpore, fDamage, 1.25f, player.whoAmI, 0f, 0f); + int spore2 = Projectile.NewProjectile(spawnPos.X, spawnPos.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ProjectileID.TruffleSpore, fDamage, 1.25f, player.whoAmI, 0f, 0f); Main.projectile[spore1].timeLeft = 120; Main.projectile[spore2].timeLeft = 120; } @@ -7768,13 +7767,12 @@ namespace CalamityMod.CalPlayer double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; double offsetAngle; - int i; int sDamage = hardMode ? 36 : 6; if (aSparkRare) sDamage += hardMode ? 12 : 2; if (player.whoAmI == Main.myPlayer) { - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; int spark1 = Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)(sDamage * player.AverageDamage()), 1.25f, player.whoAmI, 0f, 0f); @@ -7796,7 +7794,7 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < 5; i++) { Main.PlaySound(SoundID.Item, (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y, 61); - int inkBomb = Projectile.NewProjectile(player.Center.X, player.Center.Y, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-0f, -4f), ModContent.ProjectileType(), 0, 0, player.whoAmI); + Projectile.NewProjectile(player.Center.X, player.Center.Y, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-0f, -4f), ModContent.ProjectileType(), 0, 0, player.whoAmI); } } } @@ -7824,7 +7822,7 @@ namespace CalamityMod.CalPlayer int eDamage = (int)(100 * player.AverageDamage()); if (player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), eDamage, 1f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), eDamage, 1f, player.whoAmI, 0f, 0f); } } } @@ -7845,8 +7843,8 @@ namespace CalamityMod.CalPlayer float randomSpeed = (float)Main.rand.Next(1, 7); float randomSpeed2 = (float)Main.rand.Next(1, 7); offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - int shard = Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f) + randomSpeed, 90, sDamage, 1f, player.whoAmI, 0f, 0f); - int shard2 = Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f) + randomSpeed2, 90, sDamage, 1f, player.whoAmI, 0f, 0f); + int shard = Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f) + randomSpeed, ProjectileID.CrystalShard, sDamage, 1f, player.whoAmI, 0f, 0f); + int shard2 = Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f) + randomSpeed2, ProjectileID.CrystalShard, sDamage, 1f, player.whoAmI, 0f, 0f); Main.projectile[shard].Calamity().forceTypeless = true; Main.projectile[shard2].Calamity().forceTypeless = true; } @@ -7862,19 +7860,18 @@ namespace CalamityMod.CalPlayer double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; double offsetAngle; - int i; int rDamage = (int)(58 * player.RogueDamage()); //Reaver rogue helm if (player.whoAmI == Main.myPlayer) { - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { float xPos = Main.rand.NextBool(2) ? player.Center.X + 100 : player.Center.X - 100; - Vector2 vector2 = new Vector2(xPos, player.Center.Y + Main.rand.Next(-100, 101)); + Vector2 spawnPos = new Vector2(xPos, player.Center.Y + Main.rand.Next(-100, 101)); offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - int rspore1 = Projectile.NewProjectile(vector2.X, vector2.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), 567, rDamage, 2f, player.whoAmI, 0f, 0f); + int rspore1 = Projectile.NewProjectile(spawnPos.X, spawnPos.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), rDamage, 2f, player.whoAmI, 0f, 0f); Main.projectile[rspore1].usesLocalNPCImmunity = true; Main.projectile[rspore1].localNPCHitCooldown = 60; - int rspore2 = Projectile.NewProjectile(vector2.X, vector2.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), 568, rDamage, 2f, player.whoAmI, 0f, 0f); + int rspore2 = Projectile.NewProjectile(spawnPos.X, spawnPos.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), rDamage, 2f, player.whoAmI, 1f, 0f); Main.projectile[rspore2].usesLocalNPCImmunity = true; Main.projectile[rspore2].localNPCHitCooldown = 60; } @@ -7908,7 +7905,7 @@ namespace CalamityMod.CalPlayer Main.PlaySound(SoundID.Item, (int)player.position.X, (int)player.position.Y, 74); if (player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((auricSet ? 2400 : 1200) * player.MagicDamage()), 1f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), (int)((auricSet ? 2400 : 1200) * player.MagicDamage()), 1f, player.whoAmI, 0f, 0f); } } } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 497a6dfb02..977677e842 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -2065,7 +2065,7 @@ namespace CalamityMod.Projectiles Projectile orb = Projectile.NewProjectileDirect(projectile.Center, velocity, projType, damage, 0f, projectile.owner, gsPhantom ? 0f : target, gsPhantom ? ai1 : 0f); return orb; } - + public static void HomeInOnNPC(Projectile projectile, bool ignoreTiles, float distanceRequired, float homingVelocity, float N) { Vector2 center = projectile.Center; diff --git a/Projectiles/Typeless/ReaverSpore.cs b/Projectiles/Typeless/ReaverSpore.cs new file mode 100644 index 0000000000..199e598ce9 --- /dev/null +++ b/Projectiles/Typeless/ReaverSpore.cs @@ -0,0 +1,63 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class ReaverSpore : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spore"); + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 16; + projectile.aiStyle = 105; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.alpha = 255; + projectile.timeLeft = 3600; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 60; + } + + public override void Kill(int timeLeft) + { + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 1f, 1f, 0.3f); + int gas = Projectile.NewProjectile(projectile.Center, velocity, ProjectileID.SporeGas + Main.rand.Next(3), projectile.damage, 0f, projectile.owner); + Main.projectile[gas].usesLocalNPCImmunity = true; + Main.projectile[gas].localNPCHitCooldown = 30; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture; + switch (projectile.ai[0]) + { + case 1f: texture = ModContent.GetTexture("CalamityMod/Projectiles/Typeless/ReaverSpore2"); + break; + default: texture = Main.projectileTexture[projectile.type]; + break; + } + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, texture.Height / 2f), projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.Poisoned, 60 * Main.rand.Next(5, 11)); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Poisoned, 60 * Main.rand.Next(5, 11)); + } + } +} diff --git a/Projectiles/Typeless/ReaverSpore.png b/Projectiles/Typeless/ReaverSpore.png new file mode 100644 index 0000000000000000000000000000000000000000..02c53c1a788060d3a1d0f4b846d28ecb5f0f0ea1 GIT binary patch literal 245 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`dpunnLn`JZCmdjWvaIsY^x4lo z%1^i9*&q<)u!Yg!wp{Algp`DY1cS=DhDIPbxMbR6duC?l!@Hiz_uRM=c%IcjxOst@ z-}&xzpsIw3Z)wsYN3%P;7rZjyQMk=&V1Mur&*sRGBV8cPid@T#xUQN(Pgh^*!VqMEm$+XX(AIoICy1=vG2J40!4o8fysPe2Z pyKJX=h+$VR50CYRRf})1GUSMaa(8;w?*#gT!PC{xWt~$(69B5kV157q literal 0 HcmV?d00001 diff --git a/Projectiles/Typeless/ReaverSpore2.png b/Projectiles/Typeless/ReaverSpore2.png new file mode 100644 index 0000000000000000000000000000000000000000..235e4f51cc1c902d423f462efe05c398a7d44dde GIT binary patch literal 253 zcmVA^2^a; zYc%*OKcig=fb`c_l+B4JfyK1Q4ghq<8IW(cnWD^W_frkvxF-PSgBbvua}2=!Y6Fmj z*`GW*ZWs9c(?yv|a_ Date: Sat, 18 Jul 2020 14:06:56 -0400 Subject: [PATCH 126/160] refactored nebula star & deadly microbe a bit fixed microbe having i frame interferance --- Projectiles/Typeless/NebulaStar.cs | 214 +++------------ Projectiles/Typeless/ReaverSpore.cs | 19 +- .../Typeless/TheDeadlyMicrobeProjectile.cs | 245 ++++-------------- Utilities/CalamityUtils.cs | 150 +++++++++++ 4 files changed, 246 insertions(+), 382 deletions(-) diff --git a/Projectiles/Typeless/NebulaStar.cs b/Projectiles/Typeless/NebulaStar.cs index a2d726d91e..a21ec81a21 100644 --- a/Projectiles/Typeless/NebulaStar.cs +++ b/Projectiles/Typeless/NebulaStar.cs @@ -5,188 +5,42 @@ using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { - public class NebulaStar : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Star"); - } + public class NebulaStar : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Star"); + } - public override void SetDefaults() - { - projectile.width = 34; - projectile.height = 34; - projectile.friendly = true; - projectile.alpha = 255; - projectile.penetrate = 1; - projectile.tileCollide = false; - projectile.ignoreWater = true; - projectile.timeLeft = 3600; - } + public override void SetDefaults() + { + projectile.width = projectile.height = 34; + projectile.friendly = true; + projectile.alpha = 255; + projectile.penetrate = 1; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.timeLeft = 3600; + } - public override void AI() - { - float num944 = 1f - (float)projectile.alpha / 255f; - num944 *= projectile.scale; - Lighting.AddLight(projectile.Center, 0.25f * num944, 0.025f * num944, 0.275f * num944); - projectile.localAI[0] += 1f; - if (projectile.localAI[0] >= 90f) - { - projectile.localAI[0] *= -1f; - } - if (projectile.localAI[0] >= 0f) - { - projectile.scale += 0.003f; - } - else - { - projectile.scale -= 0.003f; - } - projectile.rotation += 0.0025f * projectile.scale; - float num945 = 1f; - float num946 = 1f; - if (projectile.identity % 6 == 0) - { - num946 *= -1f; - } - if (projectile.identity % 6 == 1) - { - num945 *= -1f; - } - if (projectile.identity % 6 == 2) - { - num946 *= -1f; - num945 *= -1f; - } - if (projectile.identity % 6 == 3) - { - num946 = 0f; - } - if (projectile.identity % 6 == 4) - { - num945 = 0f; - } - projectile.localAI[1] += 1f; - if (projectile.localAI[1] > 60f) - { - projectile.localAI[1] = -180f; - } - if (projectile.localAI[1] >= -60f) - { - projectile.velocity.X = projectile.velocity.X + 0.002f * num946; - projectile.velocity.Y = projectile.velocity.Y + 0.002f * num945; - } - else - { - projectile.velocity.X = projectile.velocity.X - 0.002f * num946; - projectile.velocity.Y = projectile.velocity.Y - 0.002f * num945; - } - projectile.ai[0] += 1f; - if (projectile.ai[0] > 5400f) - { - projectile.damage = 0; - projectile.ai[1] = 1f; - if (projectile.alpha < 255) - { - projectile.alpha += 5; - if (projectile.alpha > 255) - { - projectile.alpha = 255; - } - } - else if (projectile.owner == Main.myPlayer) - { - projectile.Kill(); - } - } - else - { - float num947 = (projectile.Center - Main.player[projectile.owner].Center).Length() / 100f; - if (num947 > 4f) - { - num947 *= 1.1f; - } - if (num947 > 5f) - { - num947 *= 1.2f; - } - if (num947 > 6f) - { - num947 *= 1.3f; - } - if (num947 > 7f) - { - num947 *= 1.4f; - } - if (num947 > 8f) - { - num947 *= 1.5f; - } - if (num947 > 9f) - { - num947 *= 1.6f; - } - if (num947 > 10f) - { - num947 *= 1.7f; - } - projectile.ai[0] += num947; - if (projectile.alpha > 50) - { - projectile.alpha -= 10; - if (projectile.alpha < 50) - { - projectile.alpha = 50; - } - } - } - bool flag49 = false; - Vector2 center12 = new Vector2(0f, 0f); - float num948 = 600f; - for (int num949 = 0; num949 < Main.maxNPCs; num949++) - { - if (Main.npc[num949].CanBeChasedBy(projectile, false)) - { - float num950 = Main.npc[num949].position.X + (float)(Main.npc[num949].width / 2); - float num951 = Main.npc[num949].position.Y + (float)(Main.npc[num949].height / 2); - float num952 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num950) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num951); - if (num952 < num948) - { - num948 = num952; - center12 = Main.npc[num949].Center; - flag49 = true; - } - } - } - if (flag49) - { - Vector2 vector101 = center12 - projectile.Center; - vector101.Normalize(); - vector101 *= 0.75f; - projectile.velocity = (projectile.velocity * 10f + vector101) / 11f; - return; - } - if ((double)projectile.velocity.Length() > 0.2) - { - projectile.velocity *= 0.98f; - } - } + public override void AI() + { + projectile.SporeSacAI(); + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if (projectile.owner == Main.myPlayer && projectile.ai[1] == 0f) - { - Vector2 value10 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - value10.Normalize(); - value10 *= 0.3f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value10.X, value10.Y, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner, 0f, 0f); - } - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (projectile.owner == Main.myPlayer && projectile.ai[1] == 0f) + { + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 1f, 1f, 0.3f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner, 0f, 0f); + } + } - public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) - { - Rectangle frame = new Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Typeless/NebulaStarGlow"), projectile.Center - Main.screenPosition, frame, Color.White, projectile.rotation, projectile.Size / 2, 1f, SpriteEffects.None, 0f); - } - } + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + Rectangle frame = new Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height); + spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Typeless/NebulaStarGlow"), projectile.Center - Main.screenPosition, frame, Color.White, projectile.rotation, projectile.Size / 2, 1f, SpriteEffects.None, 0f); + } + } } diff --git a/Projectiles/Typeless/ReaverSpore.cs b/Projectiles/Typeless/ReaverSpore.cs index 199e598ce9..fb2d03a80c 100644 --- a/Projectiles/Typeless/ReaverSpore.cs +++ b/Projectiles/Typeless/ReaverSpore.cs @@ -17,23 +17,28 @@ namespace CalamityMod.Projectiles.Typeless public override void SetDefaults() { projectile.width = projectile.height = 16; - projectile.aiStyle = 105; projectile.friendly = true; projectile.penetrate = 1; projectile.alpha = 255; projectile.timeLeft = 3600; projectile.tileCollide = false; projectile.ignoreWater = true; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 60; + } + + public override void AI() + { + projectile.SporeSacAI(); } public override void Kill(int timeLeft) { - Vector2 velocity = CalamityUtils.RandomVelocity(100f, 1f, 1f, 0.3f); - int gas = Projectile.NewProjectile(projectile.Center, velocity, ProjectileID.SporeGas + Main.rand.Next(3), projectile.damage, 0f, projectile.owner); - Main.projectile[gas].usesLocalNPCImmunity = true; - Main.projectile[gas].localNPCHitCooldown = 30; + if (projectile.owner == Main.myPlayer) + { + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 1f, 1f, 0.3f); + int gas = Projectile.NewProjectile(projectile.Center, velocity, ProjectileID.SporeGas + Main.rand.Next(3), projectile.damage, 0f, projectile.owner); + Main.projectile[gas].usesLocalNPCImmunity = true; + Main.projectile[gas].localNPCHitCooldown = 30; + } } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Typeless/TheDeadlyMicrobeProjectile.cs b/Projectiles/Typeless/TheDeadlyMicrobeProjectile.cs index 2882484679..f4815e83ce 100644 --- a/Projectiles/Typeless/TheDeadlyMicrobeProjectile.cs +++ b/Projectiles/Typeless/TheDeadlyMicrobeProjectile.cs @@ -6,201 +6,56 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { - public class TheDeadlyMicrobeProjectile : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Star"); - } - - public override void SetDefaults() - { - projectile.width = 14; - projectile.height = 14; - projectile.friendly = true; - projectile.alpha = 255; - projectile.penetrate = 1; - projectile.tileCollide = false; - projectile.ignoreWater = true; - projectile.timeLeft = 3600; - } - - public override void AI() - { - float num944 = 1f - (float)projectile.alpha / 255f; - num944 *= projectile.scale; - Lighting.AddLight(projectile.Center, 0.25f * num944, 0.025f * num944, 0.275f * num944); - projectile.localAI[0] += 1f; - if (projectile.localAI[0] >= 90f) - { - projectile.localAI[0] *= -1f; - } - if (projectile.localAI[0] >= 0f) - { - projectile.scale += 0.003f; - } - else - { - projectile.scale -= 0.003f; - } - projectile.rotation += 0.0025f * projectile.scale; - float num945 = 1f; - float num946 = 1f; - if (projectile.identity % 6 == 0) - { - num946 *= -1f; - } - if (projectile.identity % 6 == 1) - { - num945 *= -1f; - } - if (projectile.identity % 6 == 2) - { - num946 *= -1f; - num945 *= -1f; - } - if (projectile.identity % 6 == 3) - { - num946 = 0f; - } - if (projectile.identity % 6 == 4) - { - num945 = 0f; - } - projectile.localAI[1] += 1f; - if (projectile.localAI[1] > 60f) - { - projectile.localAI[1] = -180f; - } - if (projectile.localAI[1] >= -60f) - { - projectile.velocity.X = projectile.velocity.X + 0.002f * num946; - projectile.velocity.Y = projectile.velocity.Y + 0.002f * num945; - } - else - { - projectile.velocity.X = projectile.velocity.X - 0.002f * num946; - projectile.velocity.Y = projectile.velocity.Y - 0.002f * num945; - } - projectile.ai[0] += 1f; - if (projectile.ai[0] > 5400f) - { - projectile.damage = 0; - projectile.ai[1] = 1f; - if (projectile.alpha < 255) - { - projectile.alpha += 5; - if (projectile.alpha > 255) - { - projectile.alpha = 255; - } - } - else if (projectile.owner == Main.myPlayer) - { - projectile.Kill(); - } - } - else - { - float num947 = (projectile.Center - Main.player[projectile.owner].Center).Length() / 100f; - if (num947 > 4f) - { - num947 *= 1.1f; - } - if (num947 > 5f) - { - num947 *= 1.2f; - } - if (num947 > 6f) - { - num947 *= 1.3f; - } - if (num947 > 7f) - { - num947 *= 1.4f; - } - if (num947 > 8f) - { - num947 *= 1.5f; - } - if (num947 > 9f) - { - num947 *= 1.6f; - } - if (num947 > 10f) - { - num947 *= 1.7f; - } - projectile.ai[0] += num947; - if (projectile.alpha > 50) - { - projectile.alpha -= 10; - if (projectile.alpha < 50) - { - projectile.alpha = 50; - } - } - } - bool flag49 = false; - Vector2 center12 = new Vector2(0f, 0f); - float num948 = 600f; - for (int num949 = 0; num949 < 200; num949++) - { - if (Main.npc[num949].CanBeChasedBy(projectile, false)) - { - float num950 = Main.npc[num949].position.X + (float)(Main.npc[num949].width / 2); - float num951 = Main.npc[num949].position.Y + (float)(Main.npc[num949].height / 2); - float num952 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num950) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num951); - if (num952 < num948) - { - num948 = num952; - center12 = Main.npc[num949].Center; - flag49 = true; - } - } - } - if (flag49) - { - Vector2 vector101 = center12 - projectile.Center; - vector101.Normalize(); - vector101 *= 0.75f; - projectile.velocity = (projectile.velocity * 10f + vector101) / 11f; - return; - } - if ((double)projectile.velocity.Length() > 0.2) - { - projectile.velocity *= 0.98f; - } - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.CursedInferno, 90); - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - target.AddBuff(BuffID.CursedInferno, 90); + public class TheDeadlyMicrobeProjectile : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Microbe"); } - public override void Kill(int timeLeft) - { - projectile.position = projectile.Center; - projectile.width = projectile.height = 56; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - int num226 = 36; - for (int num227 = 0; num227 < num226; num227++) - { - Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; - Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 44, vector7.X, vector7.Y, 100, default, 0.5f); - Main.dust[num228].noGravity = true; - Main.dust[num228].noLight = true; - Main.dust[num228].velocity = vector7; - } - projectile.Damage(); - } - } + public override void SetDefaults() + { + projectile.width = projectile.height = 14; + projectile.friendly = true; + projectile.alpha = 255; + projectile.penetrate = 1; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.timeLeft = 3600; + } + + public override void AI() + { + projectile.SporeSacAI(); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.CursedInferno, 90); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.CursedInferno, 90); + } + + public override void Kill(int timeLeft) + { + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 56); + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + int dustAmt = 36; + for (int d = 0; d < dustAmt; d++) + { + Vector2 source = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; + source = source.RotatedBy((double)((float)(d - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + projectile.Center; + Vector2 dustVel = source - projectile.Center; + int index = Dust.NewDust(source + dustVel, 0, 0, 44, dustVel.X, dustVel.Y, 100, default, 0.5f); + Main.dust[index].noGravity = true; + Main.dust[index].noLight = true; + Main.dust[index].velocity = dustVel; + } + projectile.Damage(); + } + } } diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 904aa22370..b369cd4f2d 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -1014,6 +1014,156 @@ namespace CalamityMod return velocity; } + public static void SporeSacAI(this Projectile projectile) + { + Player player = Main.player[projectile.owner]; + + float scaleAmt = 1f - (float)projectile.alpha / 255f; + scaleAmt *= projectile.scale; + Lighting.AddLight(projectile.Center, 0.25f * scaleAmt, 0.025f * scaleAmt, 0.275f * scaleAmt); + + projectile.localAI[0] += 1f; + if (projectile.localAI[0] >= 90f) + { + projectile.localAI[0] *= -1f; + } + if (projectile.localAI[0] >= 0f) + { + projectile.scale += 0.003f; + } + else + { + projectile.scale -= 0.003f; + } + projectile.rotation += 0.0025f * projectile.scale; + float yVel = 1f; + float xVel = 1f; + if (projectile.identity % 6 == 0) + { + xVel *= -1f; + } + if (projectile.identity % 6 == 1) + { + yVel *= -1f; + } + if (projectile.identity % 6 == 2) + { + xVel *= -1f; + yVel *= -1f; + } + if (projectile.identity % 6 == 3) + { + xVel = 0f; + } + if (projectile.identity % 6 == 4) + { + yVel = 0f; + } + projectile.localAI[1] += 1f; + if (projectile.localAI[1] > 60f) + { + projectile.localAI[1] = -180f; + } + if (projectile.localAI[1] >= -60f) + { + projectile.velocity.X += 0.002f * xVel; + projectile.velocity.Y += 0.002f * yVel; + } + else + { + projectile.velocity.X -= 0.002f * xVel; + projectile.velocity.Y -= 0.002f * yVel; + } + projectile.ai[0] += 1f; + if (projectile.ai[0] > 5400f) + { + projectile.damage = 0; + projectile.ai[1] = 1f; + if (projectile.alpha < 255) + { + projectile.alpha += 5; + if (projectile.alpha > 255) + { + projectile.alpha = 255; + } + } + else if (projectile.owner == Main.myPlayer) + { + projectile.Kill(); + } + } + else + { + float playerDist = (projectile.Center - player.Center).Length() / 100f; + if (playerDist > 4f) + { + playerDist *= 1.1f; + } + if (playerDist > 5f) + { + playerDist *= 1.2f; + } + if (playerDist > 6f) + { + playerDist *= 1.3f; + } + if (playerDist > 7f) + { + playerDist *= 1.4f; + } + if (playerDist > 8f) + { + playerDist *= 1.5f; + } + if (playerDist > 9f) + { + playerDist *= 1.6f; + } + if (playerDist > 10f) + { + playerDist *= 1.7f; + } + projectile.ai[0] += playerDist; + if (projectile.alpha > 50) + { + projectile.alpha -= 10; + if (projectile.alpha < 50) + { + projectile.alpha = 50; + } + } + } + bool foundTarget = false; + Vector2 targetPos = new Vector2(0f, 0f); + float maxDist = 600f; + for (int i = 0; i < Main.maxNPCs; i++) + { + NPC npc = Main.npc[i]; + if (npc.CanBeChasedBy(projectile, false)) + { + float targetDist = Vector2.Distance(projectile.Center, npc.Center); + if (targetDist < maxDist) + { + targetPos = npc.Center; + foundTarget = true; + break; + } + } + } + if (foundTarget) + { + Vector2 targetVec = targetPos - projectile.Center; + targetVec.Normalize(); + targetVec *= 0.75f; + projectile.velocity = (projectile.velocity * 10f + targetVec) / 11f; + return; + } + if (projectile.velocity.Length() > 0.2f) + { + projectile.velocity *= 0.98f; + } + } + public static void MinionAntiClump(this Projectile projectile, float pushForce = 0.05f) { for (int k = 0; k < Main.maxProjectiles; k++) From 783f9c4dc7b5334575be55ba807f0c7a39ad5362 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 18 Jul 2020 14:27:26 -0400 Subject: [PATCH 127/160] made a stick to tiles util and said things no longer stick to planter boxes --- Projectiles/CalamityGlobalProjectile.cs | 30 +++++------ Projectiles/Rogue/AuroradicalStar.cs | 21 ++++---- Projectiles/Rogue/BallisticPoisonBombProj.cs | 55 ++----------------- Projectiles/Rogue/NastyChollaBol.cs | 47 ++-------------- Projectiles/Rogue/StickyBol.cs | 56 +++----------------- Utilities/CalamityUtils.cs | 47 ++++++++++++++++ 6 files changed, 82 insertions(+), 174 deletions(-) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 977677e842..860127a9d0 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1399,22 +1399,20 @@ namespace CalamityMod.Projectiles if (modPlayer.silvaMage && projectile.penetrate == 1 && Main.rand.Next(0, 100) >= 97) { Main.PlaySound(SoundID.Zombie, (int)projectile.position.X, (int)projectile.position.Y, 103); - projectile.position = projectile.Center; - projectile.width = projectile.height = 96; - projectile.Center = projectile.position; - for (int d = 0; d < 3; d++) - { - Dust.NewDust(projectile.position, projectile.width, projectile.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.5f); - } - for (int d = 0; d < 30; d++) - { - int explode = Dust.NewDust(projectile.position, projectile.width, projectile.height, 157, 0f, 0f, 0, new Color(Main.DiscoR, 203, 103), 2.5f); - Main.dust[explode].noGravity = true; - Main.dust[explode].velocity *= 3f; - explode = Dust.NewDust(projectile.position, projectile.width, projectile.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.5f); - Main.dust[explode].velocity *= 2f; - Main.dust[explode].noGravity = true; - } + ExpandHitboxBy(projectile, 96); + for (int d = 0; d < 3; d++) + { + Dust.NewDust(projectile.position, projectile.width, projectile.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.5f); + } + for (int d = 0; d < 30; d++) + { + int explode = Dust.NewDust(projectile.position, projectile.width, projectile.height, 157, 0f, 0f, 0, new Color(Main.DiscoR, 203, 103), 2.5f); + Main.dust[explode].noGravity = true; + Main.dust[explode].velocity *= 3f; + explode = Dust.NewDust(projectile.position, projectile.width, projectile.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.5f); + Main.dust[explode].velocity *= 2f; + Main.dust[explode].noGravity = true; + } projectile.damage *= modPlayer.auricSet ? 7 : 4; projectile.localNPCHitCooldown = 10; projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Rogue/AuroradicalStar.cs b/Projectiles/Rogue/AuroradicalStar.cs index f7468a41c1..5af928b27e 100644 --- a/Projectiles/Rogue/AuroradicalStar.cs +++ b/Projectiles/Rogue/AuroradicalStar.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 9); } } @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.ai[0] += 1f; if (projectile.ai[0] > 15f) { - int astral = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.Next(dustTypes), 0f, 0f, 100, default, 0.8f); + int astral = Dust.NewDust(projectile.position, projectile.width, projectile.height, Main.rand.Next(dustTypes), 0f, 0f, 100, default, 0.8f); Main.dust[astral].noGravity = true; Main.dust[astral].velocity *= 0f; } @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Rogue int dmg = projectile.damage / 2; int comet = Projectile.NewProjectile(pos, velocity, ModContent.ProjectileType(), dmg, projectile.knockBack, projectile.owner, 0f, 0f); Main.projectile[comet].Calamity().forceRogue = true; - Main.projectile[comet].Calamity().lineColor = Main.rand.Next(3);; + Main.projectile[comet].Calamity().lineColor = Main.rand.Next(3); } } @@ -147,30 +147,27 @@ namespace CalamityMod.Projectiles.Rogue int dmg = projectile.damage / 2; int comet = Projectile.NewProjectile(pos, velocity, ModContent.ProjectileType(), dmg, projectile.knockBack, projectile.owner, 0f, 0f); Main.projectile[comet].Calamity().forceRogue = true; - Main.projectile[comet].Calamity().lineColor = Main.rand.Next(3);; + Main.projectile[comet].Calamity().lineColor = Main.rand.Next(3); } } public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9, 1f, 0f); - projectile.position = projectile.Center; - projectile.width = projectile.height = 96; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 9, 1f, 0f); + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 96); projectile.localNPCHitCooldown = 10; projectile.usesLocalNPCImmunity = true; projectile.Damage(); for (int d = 0; d < 2; d++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.Next(dustTypes), 0f, 0f, 50, default, 1f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, Main.rand.Next(dustTypes), 0f, 0f, 50, default, 1f); } for (int d = 0; d < 20; d++) { - int astral = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.Next(dustTypes), 0f, 0f, 0, default, 1.5f); + int astral = Dust.NewDust(projectile.position, projectile.width, projectile.height, Main.rand.Next(dustTypes), 0f, 0f, 0, default, 1.5f); Main.dust[astral].noGravity = true; Main.dust[astral].velocity *= 3f; - astral = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 50, default, 1f); + astral = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 50, default, 1f); Main.dust[astral].velocity *= 2f; Main.dust[astral].noGravity = true; } diff --git a/Projectiles/Rogue/BallisticPoisonBombProj.cs b/Projectiles/Rogue/BallisticPoisonBombProj.cs index 9af091389a..9e5f0b8ab0 100644 --- a/Projectiles/Rogue/BallisticPoisonBombProj.cs +++ b/Projectiles/Rogue/BallisticPoisonBombProj.cs @@ -31,59 +31,13 @@ namespace CalamityMod.Projectiles.Rogue { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 14, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } - try - { - int num223 = (int)(projectile.position.X / 16f) - 1; - int num224 = (int)((projectile.position.X + (float)projectile.width) / 16f) + 2; - int num225 = (int)(projectile.position.Y / 16f) - 1; - int num226 = (int)((projectile.position.Y + (float)projectile.height) / 16f) + 2; - if (num223 < 0) - { - num223 = 0; - } - if (num224 > Main.maxTilesX) - { - num224 = Main.maxTilesX; - } - if (num225 < 0) - { - num225 = 0; - } - if (num226 > Main.maxTilesY) - { - num226 = Main.maxTilesY; - } - for (int num227 = num223; num227 < num224; num227++) - { - for (int num228 = num225; num228 < num226; num228++) - { - if (Main.tile[num227, num228] != null && !TileID.Sets.Platforms[Main.tile[num227, num228].type] && Main.tile[num227, num228].nactive() && (Main.tileSolid[(int)Main.tile[num227, num228].type] || (Main.tileSolidTop[(int)Main.tile[num227, num228].type] && Main.tile[num227, num228].frameY == 0))) - { - Vector2 vector19; - vector19.X = (float)(num227 * 16); - vector19.Y = (float)(num228 * 16); - if (projectile.position.X + (float)projectile.width - 4f > vector19.X && projectile.position.X + 4f < vector19.X + 16f && projectile.position.Y + (float)projectile.height - 4f > vector19.Y && projectile.position.Y + 4f < vector19.Y + 16f) - { - projectile.velocity.X = 0f; - projectile.velocity.Y = -0.2f; - } - } - } - } - } catch - { - } + projectile.StickToTiles(); if (projectile.owner == Main.myPlayer && projectile.timeLeft <= 3) { projectile.tileCollide = false; projectile.ai[1] = 0f; projectile.alpha = 255; - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = 128; - projectile.height = 128; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 128); } projectile.ai[0] += 1f; if (projectile.ai[0] > 10f) @@ -105,10 +59,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - projectile.position = projectile.Center; - projectile.width = projectile.height = 128; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 128); Main.PlaySound(SoundID.Item14, projectile.Center); int projAmt = Main.rand.Next(3, 5); if (projectile.owner == Main.myPlayer) diff --git a/Projectiles/Rogue/NastyChollaBol.cs b/Projectiles/Rogue/NastyChollaBol.cs index fa7d5b20fa..4602066ee9 100644 --- a/Projectiles/Rogue/NastyChollaBol.cs +++ b/Projectiles/Rogue/NastyChollaBol.cs @@ -34,48 +34,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.StickyProjAI(15); if (projectile.ai[0] != 1f) { - try - { - int num223 = (int)(projectile.position.X / 16f) - 1; - int num224 = (int)((projectile.position.X + (float)projectile.width) / 16f) + 2; - int num225 = (int)(projectile.position.Y / 16f) - 1; - int num226 = (int)((projectile.position.Y + (float)projectile.height) / 16f) + 2; - if (num223 < 0) - { - num223 = 0; - } - if (num224 > Main.maxTilesX) - { - num224 = Main.maxTilesX; - } - if (num225 < 0) - { - num225 = 0; - } - if (num226 > Main.maxTilesY) - { - num226 = Main.maxTilesY; - } - for (int num227 = num223; num227 < num224; num227++) - { - for (int num228 = num225; num228 < num226; num228++) - { - if (Main.tile[num227, num228] != null && Main.tile[num227, num228].nactive() && (Main.tileSolid[(int)Main.tile[num227, num228].type] || (Main.tileSolidTop[(int)Main.tile[num227, num228].type] && Main.tile[num227, num228].frameY == 0))) - { - Vector2 vector19; - vector19.X = (float)(num227 * 16); - vector19.Y = (float)(num228 * 16); - if (projectile.position.X + (float)projectile.width - 4f > vector19.X && projectile.position.X + 4f < vector19.X + 16f && projectile.position.Y + (float)projectile.height - 4f > vector19.Y && projectile.position.Y + 4f < vector19.Y + 16f) - { - projectile.velocity.X = 0f; - projectile.velocity.Y = -0.2f; - } - } - } - } - } catch - { - } + projectile.StickToTiles(); projectile.localAI[1] += 1f; if (projectile.localAI[1] > 10f) { @@ -83,7 +42,7 @@ namespace CalamityMod.Projectiles.Rogue if (projectile.velocity.Y == 0f && projectile.velocity.X != 0f) { projectile.velocity.X *= 0.97f; - if (Math.Abs(projectile.velocity.X) < 0.01) + if (Math.Abs(projectile.velocity.X) < 0.01f) { projectile.velocity.X = 0f; projectile.netUpdate = true; @@ -92,7 +51,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.velocity.Y += 0.2f; } projectile.rotation += projectile.velocity.X * 0.1f; - } + } } public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) diff --git a/Projectiles/Rogue/StickyBol.cs b/Projectiles/Rogue/StickyBol.cs index b2a4316afa..6989d391fa 100644 --- a/Projectiles/Rogue/StickyBol.cs +++ b/Projectiles/Rogue/StickyBol.cs @@ -27,74 +27,30 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - int Alpha = 175; - Color newColor = new Color(0, 80, (int) byte.MaxValue, 100); + Color color = new Color(0, 80, 255, 100); if (Main.rand.NextBool(12)) { - Vector2 vector2 = projectile.velocity * (float) Main.rand.Next(6) / 6f; - int num = 6; - Dust.NewDust(projectile.position + Vector2.One * 6f, projectile.width - num * 2, projectile.height - num * 2, 4, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, Alpha, newColor, 1.2f); + Dust.NewDust(projectile.position + Vector2.One * 6f, projectile.width - 12, projectile.height - 12, 4, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 175, color, 1.2f); } //Sticky Behaviour projectile.StickyProjAI(10); if (projectile.ai[0] != 1f) { - try - { - int num223 = (int)(projectile.position.X / 16f) - 1; - int num224 = (int)((projectile.position.X + (float)projectile.width) / 16f) + 2; - int num225 = (int)(projectile.position.Y / 16f) - 1; - int num226 = (int)((projectile.position.Y + (float)projectile.height) / 16f) + 2; - if (num223 < 0) - { - num223 = 0; - } - if (num224 > Main.maxTilesX) - { - num224 = Main.maxTilesX; - } - if (num225 < 0) - { - num225 = 0; - } - if (num226 > Main.maxTilesY) - { - num226 = Main.maxTilesY; - } - for (int num227 = num223; num227 < num224; num227++) - { - for (int num228 = num225; num228 < num226; num228++) - { - if (Main.tile[num227, num228] != null && Main.tile[num227, num228].nactive() && (Main.tileSolid[(int)Main.tile[num227, num228].type] || (Main.tileSolidTop[(int)Main.tile[num227, num228].type] && Main.tile[num227, num228].frameY == 0))) - { - Vector2 vector19; - vector19.X = (float)(num227 * 16); - vector19.Y = (float)(num228 * 16); - if (projectile.position.X + (float)projectile.width - 4f > vector19.X && projectile.position.X + 4f < vector19.X + 16f && projectile.position.Y + (float)projectile.height - 4f > vector19.Y && projectile.position.Y + 4f < vector19.Y + 16f) - { - projectile.velocity.X = 0f; - projectile.velocity.Y = -0.2f; - } - } - } - } - } catch - { - } + projectile.StickToTiles(); projectile.localAI[1] += 1f; if (projectile.localAI[1] > 10f) { projectile.localAI[1] = 10f; if (projectile.velocity.Y == 0f && projectile.velocity.X != 0f) { - projectile.velocity.X = projectile.velocity.X * 0.97f; - if ((double)projectile.velocity.X > -0.01 && (double)projectile.velocity.X < 0.01) + projectile.velocity.X *= 0.97f; + if (Math.Abs(projectile.velocity.X) < 0.01f) { projectile.velocity.X = 0f; projectile.netUpdate = true; } } - projectile.velocity.Y = projectile.velocity.Y + 0.2f; + projectile.velocity.Y += 0.2f; } projectile.rotation += projectile.velocity.X * 0.1f; } diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index b369cd4f2d..e8f3f6c6bd 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -910,6 +910,53 @@ namespace CalamityMod } } + public static void StickToTiles(this Projectile projectile) + { + try + { + int xLeft = (int)(projectile.position.X / 16f) - 1; + int xRight = (int)((projectile.position.X + (float)projectile.width) / 16f) + 2; + int yBottom = (int)(projectile.position.Y / 16f) - 1; + int yTop = (int)((projectile.position.Y + (float)projectile.height) / 16f) + 2; + if (xLeft < 0) + { + xLeft = 0; + } + if (xRight > Main.maxTilesX) + { + xRight = Main.maxTilesX; + } + if (yBottom < 0) + { + yBottom = 0; + } + if (yTop > Main.maxTilesY) + { + yTop = Main.maxTilesY; + } + for (int x = xLeft; x < xRight; x++) + { + for (int y = yBottom; y < yTop; y++) + { + Tile tile = Main.tile[x, y]; + if (tile != null && !TileID.Sets.Platforms[tile.type] && tile.type != TileID.PlanterBox && tile.nactive() && (Main.tileSolid[tile.type] || (Main.tileSolidTop[tile.type] && tile.frameY == 0))) + { + Vector2 tileSize; + tileSize.X = (float)(x * 16); + tileSize.Y = (float)(y * 16); + if (projectile.position.X + (float)projectile.width - 4f > tileSize.X && projectile.position.X + 4f < tileSize.X + 16f && projectile.position.Y + (float)projectile.height - 4f > tileSize.Y && projectile.position.Y + 4f < tileSize.Y + 16f) + { + projectile.velocity.X = 0f; + projectile.velocity.Y = -0.2f; + } + } + } + } + } catch + { + } + } + public static Projectile ProjectileRain(Vector2 targetPos, float xLimit, float xVariance, float yLimitLower, float yLimitUpper, float projSpeed, int projType, int damage, float knockback, int owner, int forceType = 0, int immunitySetting = 0, int cooldown = 10) { float x = targetPos.X + Main.rand.NextFloat(-xLimit, xLimit); From 40a3f42c9d52506c2ad34250dcf88c62bf0088c9 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 18 Jul 2020 14:31:20 -0400 Subject: [PATCH 128/160] stupid ass using directive --- Projectiles/Rogue/StickyBol.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Projectiles/Rogue/StickyBol.cs b/Projectiles/Rogue/StickyBol.cs index 6989d391fa..e3a95f9cba 100644 --- a/Projectiles/Rogue/StickyBol.cs +++ b/Projectiles/Rogue/StickyBol.cs @@ -1,4 +1,5 @@ using Microsoft.Xna.Framework; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; From 743882344ab4ae77cc2507498f1daaf10bd42edb Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 18 Jul 2020 21:59:57 -0400 Subject: [PATCH 129/160] roxcalibur now always follows the player guaranteed --- Items/Weapons/Melee/Roxcalibur.cs | 2 +- Projectiles/Melee/RoxSlam.cs | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Items/Weapons/Melee/Roxcalibur.cs b/Items/Weapons/Melee/Roxcalibur.cs index c238771905..a500f545bc 100644 --- a/Items/Weapons/Melee/Roxcalibur.cs +++ b/Items/Weapons/Melee/Roxcalibur.cs @@ -213,7 +213,7 @@ namespace CalamityMod.Items.Weapons.Melee //Spawns a projectile on the tip of the sword in the alt fire float positionx; float positiony = position.Y + (item.height / 2) + 23; - ; + int cooldown = 0; //Check if the entire cooldown has passed if (Roxcooldown >= 600) diff --git a/Projectiles/Melee/RoxSlam.cs b/Projectiles/Melee/RoxSlam.cs index feecfb4671..c41919ffb6 100644 --- a/Projectiles/Melee/RoxSlam.cs +++ b/Projectiles/Melee/RoxSlam.cs @@ -19,15 +19,25 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - Player player = Main.player[Main.myPlayer]; + Player player = Main.player[projectile.owner]; //Kills the projectile if the alt attack ended if (player.itemAnimation == 0) { projectile.Kill(); } - //Makes the projectiles follow the player - projectile.velocity.X = player.velocity.X; - projectile.velocity.Y = player.velocity.Y; + //Makes the projectiles track the player + float posX; + float posY = player.Center.Y + 63; + // Makes the projectile follow the proper position on the X axis + if (player.direction == 1) + { + posX = player.Center.X + 6; + } + else + { + posX = player.Center.X - 8; + } + projectile.Center = new Vector2(posX, posY - (player.height / 10f)); } public override bool OnTileCollide(Vector2 oldVelocity) From bb3e5881496a7a10cca00d42c539471c877083ce Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 19 Jul 2020 11:12:41 -0400 Subject: [PATCH 130/160] pylons now double the spawn rates of other wulfrum enemies & wulfrum slimes no longer spawn (for now) --- NPCs/NormalNPCs/WulfrumDrone.cs | 3 +- NPCs/NormalNPCs/WulfrumGyrator.cs | 3 +- NPCs/NormalNPCs/WulfrumHovercraft.cs | 3 +- NPCs/NormalNPCs/WulfrumRover.cs | 3 +- NPCs/NormalNPCs/WulfrumSlime.cs | 113 ++++++++++++++------------- 5 files changed, 65 insertions(+), 60 deletions(-) diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index 36462945bd..bfd8027b36 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -136,10 +136,11 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { + float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 2f : 1f; if (spawnInfo.playerSafe || spawnInfo.player.Calamity().ZoneSulphur) return 0f; - return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.05f : 0.2f); + return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.05f : 0.2f) * pylonMult; } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/NormalNPCs/WulfrumGyrator.cs b/NPCs/NormalNPCs/WulfrumGyrator.cs index 69a75e1c7e..180eef6cb1 100644 --- a/NPCs/NormalNPCs/WulfrumGyrator.cs +++ b/NPCs/NormalNPCs/WulfrumGyrator.cs @@ -144,9 +144,10 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { + float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 2f : 1f; if (spawnInfo.playerSafe || spawnInfo.player.Calamity().ZoneSulphur) return 0f; - return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.0333f : 0.15f); + return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.0333f : 0.15f) * pylonMult; } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/NormalNPCs/WulfrumHovercraft.cs b/NPCs/NormalNPCs/WulfrumHovercraft.cs index aec09cd0f0..a9ec65599a 100644 --- a/NPCs/NormalNPCs/WulfrumHovercraft.cs +++ b/NPCs/NormalNPCs/WulfrumHovercraft.cs @@ -216,9 +216,10 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { + float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 2f : 1f; if (spawnInfo.playerSafe || spawnInfo.player.Calamity().ZoneSulphur) return 0f; - return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.025f : 0.125f); + return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.025f : 0.125f) * pylonMult; } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/NormalNPCs/WulfrumRover.cs b/NPCs/NormalNPCs/WulfrumRover.cs index 04660e5eb3..bcd1d87d5f 100644 --- a/NPCs/NormalNPCs/WulfrumRover.cs +++ b/NPCs/NormalNPCs/WulfrumRover.cs @@ -92,9 +92,10 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { + float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 2f : 1f; if (spawnInfo.playerSafe || spawnInfo.player.Calamity().ZoneSulphur) return 0f; - return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.05f : 0.2f); + return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.05f : 0.2f) * pylonMult; } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/NormalNPCs/WulfrumSlime.cs b/NPCs/NormalNPCs/WulfrumSlime.cs index 9202d0bb22..8ac0ef9fb2 100644 --- a/NPCs/NormalNPCs/WulfrumSlime.cs +++ b/NPCs/NormalNPCs/WulfrumSlime.cs @@ -5,64 +5,65 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class WulfrumSlime : ModNPC - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Wulfrum Slime"); - Main.npcFrameCount[npc.type] = 2; - } + public class WulfrumSlime : ModNPC + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wulfrum Slime"); + Main.npcFrameCount[npc.type] = 2; + } - public override void SetDefaults() - { - npc.aiStyle = 1; - npc.damage = 8; - npc.width = 30; - npc.height = 22; - npc.defense = 2; - npc.lifeMax = 12; - npc.knockBackResist = 0f; - animationType = NPCID.CorruptSlime; - npc.value = Item.buyPrice(0, 0, 0, 30); - npc.alpha = 60; - npc.lavaImmune = false; - npc.noGravity = false; - npc.noTileCollide = false; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - banner = npc.type; - bannerItem = ModContent.ItemType(); - npc.buffImmune[BuffID.Confused] = false; - } + public override void SetDefaults() + { + npc.aiStyle = 1; + npc.damage = 8; + npc.width = 30; + npc.height = 22; + npc.defense = 2; + npc.lifeMax = 12; + npc.knockBackResist = 0f; + animationType = NPCID.CorruptSlime; + npc.value = Item.buyPrice(0, 0, 0, 30); + npc.alpha = 60; + npc.lavaImmune = false; + npc.noGravity = false; + npc.noTileCollide = false; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + banner = npc.type; + bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - if (spawnInfo.playerSafe || spawnInfo.player.Calamity().ZoneSulphur) - { - return 0f; - } - return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.08f : 0.33f); - } + /*public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 2f : 1f; + if (spawnInfo.playerSafe || spawnInfo.player.Calamity().ZoneSulphur) + { + return 0f; + } + return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.08f : 0.33f) * pylonMult; + }*/ - public override void HitEffect(int hitDirection, double damage) - { - for (int k = 0; k < 3; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 3, hitDirection, -1f, 0, default, 1f); - } - if (npc.life <= 0) - { - for (int k = 0; k < 15; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 3, hitDirection, -1f, 0, default, 1f); - } - } - } + public override void HitEffect(int hitDirection, double damage) + { + for (int k = 0; k < 3; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 3, hitDirection, -1f, 0, default, 1f); + } + if (npc.life <= 0) + { + for (int k = 0; k < 15; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 3, hitDirection, -1f, 0, default, 1f); + } + } + } - public override void NPCLoot() - { - DropHelper.DropItem(npc, ModContent.ItemType(), 1, 1); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, 0.5f, 1, 1); - } - } + public override void NPCLoot() + { + DropHelper.DropItem(npc, ModContent.ItemType(), 1, 1); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, 0.5f, 1, 1); + } + } } From f6aca60e8fe9cb5e052ef7fbdd53cf595f7e5a46 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 19 Jul 2020 11:21:24 -0400 Subject: [PATCH 131/160] added energy core & wulfrum drone banner now gives protection against the martian proj it fires --- CalPlayer/CalamityPlayer.cs | 2 +- Items/Armor/WulfrumArmor.cs | 1 + Items/Armor/WulfrumHeadgear.cs | 1 + Items/Armor/WulfrumHelm.cs | 1 + Items/Armor/WulfrumHelmet.cs | 1 + Items/Armor/WulfrumHood.cs | 1 + Items/Armor/WulfrumLeggings.cs | 1 + Items/Armor/WulfrumMask.cs | 1 + Items/Materials/EnergyCore.cs | 22 ++++++++++++++++++++++ Items/Materials/EnergyCore.png | Bin 0 -> 595 bytes NPCs/NormalNPCs/WulfrumDrone.cs | 3 ++- NPCs/NormalNPCs/WulfrumGyrator.cs | 1 + NPCs/NormalNPCs/WulfrumHovercraft.cs | 1 + NPCs/NormalNPCs/WulfrumPylon.cs | 1 + NPCs/NormalNPCs/WulfrumRover.cs | 3 ++- 15 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 Items/Materials/EnergyCore.cs create mode 100644 Items/Materials/EnergyCore.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 3a0aee860d..350e59d0d3 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -6907,7 +6907,7 @@ namespace CalamityMod.CalPlayer break; case ProjectileID.MartianTurretBolt: - if ((bannerNPCType == NPCID.MartianTurret && Main.invasionType == InvasionID.MartianMadness) || (bannerNPCType == ModContent.NPCType() && Main.invasionType != InvasionID.MartianMadness)) + if ((bannerNPCType == NPCID.MartianTurret && Main.invasionType == InvasionID.MartianMadness) || ((bannerNPCType == ModContent.NPCType() || bannerNPCType == ModContent.NPCType()) && Main.invasionType != InvasionID.MartianMadness)) { reduceDamage = true; } diff --git a/Items/Armor/WulfrumArmor.cs b/Items/Armor/WulfrumArmor.cs index 184f6f3e39..a310356c7a 100644 --- a/Items/Armor/WulfrumArmor.cs +++ b/Items/Armor/WulfrumArmor.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Items.Armor { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 12); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Armor/WulfrumHeadgear.cs b/Items/Armor/WulfrumHeadgear.cs index 6cdfc216f8..9d4dabb104 100644 --- a/Items/Armor/WulfrumHeadgear.cs +++ b/Items/Armor/WulfrumHeadgear.cs @@ -48,6 +48,7 @@ namespace CalamityMod.Items.Armor { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Armor/WulfrumHelm.cs b/Items/Armor/WulfrumHelm.cs index 6282432f34..8aa0a192c9 100644 --- a/Items/Armor/WulfrumHelm.cs +++ b/Items/Armor/WulfrumHelm.cs @@ -48,6 +48,7 @@ namespace CalamityMod.Items.Armor { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Armor/WulfrumHelmet.cs b/Items/Armor/WulfrumHelmet.cs index b5491ec39c..39e6910971 100644 --- a/Items/Armor/WulfrumHelmet.cs +++ b/Items/Armor/WulfrumHelmet.cs @@ -49,6 +49,7 @@ namespace CalamityMod.Items.Armor { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Armor/WulfrumHood.cs b/Items/Armor/WulfrumHood.cs index ae10a22c7e..830e20dfeb 100644 --- a/Items/Armor/WulfrumHood.cs +++ b/Items/Armor/WulfrumHood.cs @@ -48,6 +48,7 @@ namespace CalamityMod.Items.Armor { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Armor/WulfrumLeggings.cs b/Items/Armor/WulfrumLeggings.cs index b769ea91a3..bf591c7ff6 100644 --- a/Items/Armor/WulfrumLeggings.cs +++ b/Items/Armor/WulfrumLeggings.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Items.Armor { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Armor/WulfrumMask.cs b/Items/Armor/WulfrumMask.cs index 75e87db6d0..518a9ec763 100644 --- a/Items/Armor/WulfrumMask.cs +++ b/Items/Armor/WulfrumMask.cs @@ -56,6 +56,7 @@ namespace CalamityMod.Items.Armor { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Materials/EnergyCore.cs b/Items/Materials/EnergyCore.cs new file mode 100644 index 0000000000..8a2a3343fa --- /dev/null +++ b/Items/Materials/EnergyCore.cs @@ -0,0 +1,22 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Materials +{ + public class EnergyCore : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Energy Core"); + Tooltip.SetDefault("It pulses with energy"); + } + + public override void SetDefaults() + { + item.width = item.height = 22; + item.maxStack = 999; + item.value = Item.sellPrice(copper: 80); + item.rare = 1; + } + } +} diff --git a/Items/Materials/EnergyCore.png b/Items/Materials/EnergyCore.png new file mode 100644 index 0000000000000000000000000000000000000000..5b2ee40e5d5f794e29b7b2ce673955fb2678b6d5 GIT binary patch literal 595 zcmV-Z0<8UsP)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00E&%L_t(I%eB=%NL67N$MMh6Nb_p` zX}H$VgeV3*)L%XxU--|v0D&&$hmB8@n5=_%+dEr8F9`(jN*Uuhv~=)tq8W1yuO z^Z!J2>cSbYy!R|vUn<2gd~q^4d1x}zxcTB5n7yBT+xizH=y^MxFY&fQxi!fu(=k-f zjc-XB;`jPW74$rqh@nt!jq)X~SAND&zS058#=z;q2e4)))7b7L*zDeu6dL}@-S2U} z#37koNl1sg$5Ny>AHK^p-X0B|Tu%9mZpfFo_P(~IAaoF3L3qF1%hZSc^1tH{kDs(O z2scvoKcq>_)HhQ49S76<Q*M(), 1, 3); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, 1, 1); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode); DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), Supercharged); } } } diff --git a/NPCs/NormalNPCs/WulfrumGyrator.cs b/NPCs/NormalNPCs/WulfrumGyrator.cs index 180eef6cb1..8b9844cb2b 100644 --- a/NPCs/NormalNPCs/WulfrumGyrator.cs +++ b/NPCs/NormalNPCs/WulfrumGyrator.cs @@ -171,6 +171,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { DropHelper.DropItem(npc, ModContent.ItemType(), 1, 2); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), Supercharged); } } } diff --git a/NPCs/NormalNPCs/WulfrumHovercraft.cs b/NPCs/NormalNPCs/WulfrumHovercraft.cs index a9ec65599a..c03dd17b80 100644 --- a/NPCs/NormalNPCs/WulfrumHovercraft.cs +++ b/NPCs/NormalNPCs/WulfrumHovercraft.cs @@ -249,6 +249,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { DropHelper.DropItem(npc, ModContent.ItemType(), 2, 3); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), Supercharged); } } } diff --git a/NPCs/NormalNPCs/WulfrumPylon.cs b/NPCs/NormalNPCs/WulfrumPylon.cs index 1f41122e36..336135f481 100644 --- a/NPCs/NormalNPCs/WulfrumPylon.cs +++ b/NPCs/NormalNPCs/WulfrumPylon.cs @@ -154,6 +154,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { DropHelper.DropItem(npc, ModContent.ItemType(), 2, 3); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), Supercharged); } } } diff --git a/NPCs/NormalNPCs/WulfrumRover.cs b/NPCs/NormalNPCs/WulfrumRover.cs index bcd1d87d5f..baeb2de11f 100644 --- a/NPCs/NormalNPCs/WulfrumRover.cs +++ b/NPCs/NormalNPCs/WulfrumRover.cs @@ -136,7 +136,8 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - DropHelper.DropItem(npc, ModContent.ItemType(), 1, 1); + DropHelper.DropItem(npc, ModContent.ItemType()); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), Supercharged); } } } From 9a82e4253079b0f0845c8c308fa35c20d89d7bdd Mon Sep 17 00:00:00 2001 From: DominicKarma42 <51094361+DominicKarma@users.noreply.github.com> Date: Sun, 19 Jul 2020 12:20:48 -0500 Subject: [PATCH 132/160] Made draedon attack tiles easier to mine --- Tiles/DraedonFactoryFieldGenerator.cs | 2 +- Tiles/DraedonTurretTile.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tiles/DraedonFactoryFieldGenerator.cs b/Tiles/DraedonFactoryFieldGenerator.cs index 7057fd8fb7..876344699d 100644 --- a/Tiles/DraedonFactoryFieldGenerator.cs +++ b/Tiles/DraedonFactoryFieldGenerator.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Tiles ModTranslation name = CreateMapEntryName(); name.SetDefault("Field Generator"); AddMapEntry(new Color(53, 49, 52), name); - minPick = 190; + minPick = 65; } public TEDraedonFieldGenerator RetrieveTileEntity(int i, int j) { diff --git a/Tiles/DraedonTurretTile.cs b/Tiles/DraedonTurretTile.cs index 177098f5b7..ba864e4530 100644 --- a/Tiles/DraedonTurretTile.cs +++ b/Tiles/DraedonTurretTile.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Tiles AddMapEntry(new Color(67, 72, 81), name); soundType = SoundID.Item; soundStyle = 14; - minPick = 100; + minPick = 65; } public TEDraedonTurret RetrieveTileEntity(int i, int j) From 52656224e22d05392a3b4d1ebff4da5baf495aaf Mon Sep 17 00:00:00 2001 From: DominicKarma42 <51094361+DominicKarma@users.noreply.github.com> Date: Sun, 19 Jul 2020 12:44:29 -0500 Subject: [PATCH 133/160] You can't blow up anti-aircraft laser shooters anymore --- Tiles/DraedonFactoryFieldGenerator.cs | 6 ++++++ Tiles/DraedonTurretTile.cs | 2 ++ 2 files changed, 8 insertions(+) diff --git a/Tiles/DraedonFactoryFieldGenerator.cs b/Tiles/DraedonFactoryFieldGenerator.cs index 876344699d..1ef04a2e0c 100644 --- a/Tiles/DraedonFactoryFieldGenerator.cs +++ b/Tiles/DraedonFactoryFieldGenerator.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Tiles AddMapEntry(new Color(53, 49, 52), name); minPick = 65; } + public TEDraedonFieldGenerator RetrieveTileEntity(int i, int j) { int determinedID = ModContent.GetInstance().Find(i, j); @@ -41,15 +42,20 @@ namespace CalamityMod.Tiles } return (TEDraedonFieldGenerator)TileEntity.ByID[determinedID]; } + + public override bool CanExplode(int i, int j) => false; + public override bool CreateDust(int i, int j, ref int type) { Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 226); return false; } + public override void NumDust(int i, int j, bool fail, ref int num) { num = fail ? 1 : 3; } + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { TEDraedonFieldGenerator charger = RetrieveTileEntity(i, j); diff --git a/Tiles/DraedonTurretTile.cs b/Tiles/DraedonTurretTile.cs index ba864e4530..f0e44dd1c4 100644 --- a/Tiles/DraedonTurretTile.cs +++ b/Tiles/DraedonTurretTile.cs @@ -32,6 +32,8 @@ namespace CalamityMod.Tiles minPick = 65; } + public override bool CanExplode(int i, int j) => false; + public TEDraedonTurret RetrieveTileEntity(int i, int j) { int left = i - Main.tile[i, j].frameX % (Width * 18) / 18; From 88b260ee6b3aef9a0eb310bf4f7575d1e1eb4985 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 19 Jul 2020 14:55:53 -0400 Subject: [PATCH 134/160] added rover drive acc and adjusted confusion on a few enemies --- CalPlayer/CalamityPlayer.cs | 38 +++++++++++++++++++++++++ CalPlayer/CalamityPlayerMiscEffects.cs | 16 +++++++++++ ExtraTextures/RoverAccShield.png | Bin 0 -> 4672 bytes Items/Accessories/RoverDrive.cs | 32 +++++++++++++++++++++ Items/Accessories/RoverDrive.png | Bin 0 -> 730 bytes Items/Accessories/TheAbsorber.cs | 2 ++ NPCs/NormalNPCs/WulfrumDrone.cs | 1 - NPCs/NormalNPCs/WulfrumGyrator.cs | 3 +- NPCs/NormalNPCs/WulfrumPylon.cs | 1 - NPCs/NormalNPCs/WulfrumRover.cs | 5 +++- 10 files changed, 94 insertions(+), 4 deletions(-) create mode 100644 ExtraTextures/RoverAccShield.png create mode 100644 Items/Accessories/RoverDrive.cs create mode 100644 Items/Accessories/RoverDrive.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 350e59d0d3..659260c3a0 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -582,6 +582,10 @@ namespace CalamityMod.CalPlayer public bool rustyMedal = false; public bool noStupidNaturalARSpawns = false; public bool burdenBreakerYeet = false; + public bool roverDrive = false; + public int roverDriveTimer = 0; + public int roverFrameCounter = 0; + public int roverFrame = 0; #endregion #region Armor Set @@ -1610,6 +1614,7 @@ namespace CalamityMod.CalPlayer rustyMedal = false; noStupidNaturalARSpawns = false; burdenBreakerYeet = false; + roverDrive = false; daedalusReflect = false; daedalusSplit = false; @@ -2022,6 +2027,7 @@ namespace CalamityMod.CalPlayer sulphurBubbleCooldown = 0; ladHearts = 0; prismaticLasers = 0; + roverDriveTimer = 0; alcoholPoisoning = false; shadowflame = false; @@ -9890,6 +9896,15 @@ namespace CalamityMod.CalPlayer } tailFrameUp = 0; } + + int frameAmt = 11; + if (roverFrameCounter >= 7) + { + roverFrameCounter = -1; + roverFrame = roverFrame == frameAmt - 1 ? 0 : roverFrame + 1; + } + roverFrameCounter++; + for (int i = 0; i < player.dye.Length; i++) { if (player.dye[i].type == ModContent.ItemType()) @@ -10002,6 +10017,28 @@ namespace CalamityMod.CalPlayer } }); + public static readonly PlayerLayer RoverDriveShield = new PlayerLayer("CalamityMod", "RoverDrive", PlayerLayer.Skin, (drawInfo) => + { + Player drawPlayer = drawInfo.drawPlayer; + CalamityPlayer modPlayer = drawPlayer.Calamity(); + if (modPlayer.roverDriveTimer < 616 && modPlayer.roverDrive) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/ExtraTextures/RoverAccShield"); + int frameAmt = 11; + int height = texture.Height / frameAmt; + int frameHeight = height * modPlayer.roverFrame; + Vector2 drawPos = drawPlayer.Center - Main.screenPosition + new Vector2(0f, drawPlayer.gfxOffY); + Rectangle frame = new Rectangle(0, frameHeight, texture.Width, height); + Color color = Color.White * 0.625f; + Vector2 origin = new Vector2(texture.Width / 2f, height / 2f); + float scale = 1f + (float)Math.Cos(Main.GlobalTime) * 0.1f; + SpriteEffects spriteEffects = drawPlayer.direction != -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + + DrawData data = new DrawData(texture, drawPos, frame, color, 0f, origin, scale, spriteEffects, 0); + Main.playerDrawData.Add(data); + } + }); + public static readonly PlayerLayer StratusSphereDrawing = new PlayerLayer("CalamityMod", "StratusSphereDrawing", PlayerLayer.HeldProjFront, (drawInfo) => { Player drawPlayer = drawInfo.drawPlayer; @@ -10202,6 +10239,7 @@ namespace CalamityMod.CalPlayer list.Insert(drawTheStupidSign, ForbiddenCircletSign); } list.Add(ColdDivinityOverlay); + list.Add(RoverDriveShield); list.Add(StratusSphereDrawing); list.Add(ProfanedMoonlightDyeEffects); list.Add(IbanDevRobot); diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 0d1c9ef6bf..75b6422c87 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -988,6 +988,15 @@ namespace CalamityMod.CalPlayer modPlayer.dogTextCooldown--; if (modPlayer.titanCooldown > 0) modPlayer.titanCooldown--; + if (modPlayer.roverDrive) + { + if (modPlayer.roverDriveTimer < CalamityUtils.SecondsToFrames(30f)) + modPlayer.roverDriveTimer++; + if (modPlayer.roverDriveTimer >= CalamityUtils.SecondsToFrames(30f)) + modPlayer.roverDriveTimer = 0; + } + else + modPlayer.roverDriveTimer = CalamityUtils.SecondsToFrames(10f) + 1; //Doesn't reset to zero to prevent exploits // Silva invincibility effects if (modPlayer.silvaCountdown > 0 && modPlayer.hasSilvaEffect && modPlayer.silvaSet) @@ -1152,6 +1161,13 @@ namespace CalamityMod.CalPlayer player.statDefense += 20; } + if (modPlayer.roverDriveTimer < 616) + { + player.statDefense += 10; + if (modPlayer.roverDriveTimer > 606) + player.statDefense -= modPlayer.roverDriveTimer - 606; //so it scales down when the shield dies + } + // Absorber bonus if (modPlayer.absorber) { diff --git a/ExtraTextures/RoverAccShield.png b/ExtraTextures/RoverAccShield.png new file mode 100644 index 0000000000000000000000000000000000000000..9250879d99ce0a261f9293c07175ef6797556a2c GIT binary patch literal 4672 zcmcIocT`hZx4(dh10$#q7!b)Qj$#}@Wu!xBf=HDXN&o>PAiahn1V;gl0)vQ%kN_e@ z6NvOs0*HnvARtAG)X)?NF-iytBzYO%`__7I*7wi%$6I%=bUYt>1^^OH06@xZ0N@C2rF;f}m@@#ddIbP<9|M3~cwx(BeSu=Hua$)v!2kOy zCROABz`;yQGh?T?Ng8H4Oc5sET@<1PwuOHRG@Lpen@$wjm8tNoGw%S;Xb{;{1xp?ybhuPeI0HWY#_d%>eQGhbjUn0DmsOA!Ux4CgkJ z`P2tA%nUTR=bm$$!MgO|9u@c&DYG~4dEBjVXX2qG(cIja8Z`Y)r`%ll==z&Z%$2#J z|CWG)kgH?7;Ed0Wu@7Y7@{yqQ54f6!h&2=NK+Ll;pu#KPyq>B+;H?8^2K-)q(*ZJ@ z-2&mLDJOhIpT((Q6LP^N&xU)hWO?Erzx)vQ#ucg`K|o!ro)85)t-x{zwY_AptH z-32q-RingPPWq38%S;nvMJ{{csWE*R^47fAIXgSDv~Ta#uiPZnJI-y5k37t_93*E( zr8UB5^DUCR-9Gve_CUO}Y=S24I^X!k%`PKg;xgm1PXh0iB%sJymI1EtavP>rIuyXj z$t+iL`b1G0?Y(OOG{ zC|&wf)=dm3Ujgp{^mn`D+GI4{Jlq9O=yhm&yUqp)){d=Jk_yRI1v+^XHOH0J7wUEz zfhz(BWC6H)n@goW2&{>OY36K%u@Ns2x1%QB{TKJ^-val&v6FEuI%w-P1{sF7l-L;!)2Hp%Kl1Z>vJ zc*{K>rS8HozG}ATJ$90_Bq^TvL8vlL_fY@i#lceC6Ra2PfRp}t&_=oI1H81dOT=Ea z{XZn*#3se`r>X%&)2M}U#HXLF?CDwPu{(rg#<(~TUby?<<6~+06Rws4-A~sbCw)OD zZyzubko17b+d26s5`ny23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U%s@BjU%gc(u&A7afMDGI)%fo!p_7(6q+4kv+%PQ3b5O3cp2y!tSH=4|33_ zT3gp>ksx|J^!oSN_Qf7ukW~3q)wFVDSB5>GxRqpg!TXP9j`M7cbp2ExcV$xG?rf|y zg+qyX^pGU#-}wG?qQB-+?`qJe9V*9N|R4kt)$w=&>a*w6OxKVR*KD_Bm&&1EE5y^2$TO z{m=W$qhF1?Fm&7W0%AgcAj0xgH;Be)+ORJku(*<9yiMu-h|pML+o#%W#&yo@j6|sU zm%cUEtal|N+fn-WvIp!d_qC-eU?gme@zj62rO0O;txL<+q z34+Gjq0o?F>ghMjPa!-^$;zu=vhBys1SJBJS)9=FMZDmxv%XJ~fx}zpwiWJ0W`*BD zoVMVYYb}6n6d?*nSOx)aAnmjhjXNDVoc8qnAbKq+^aXpmc*fl^R}L44q6a7DW*x`H zoCiT>5N5D%j0`v_t}<16C=0TQMNDz5WR$mFKW)d zUQUi>5tg*!m!YN8E2qv|&O)^;0#={Y;S_&*fQx(8xa)pUFWM{(E%z{{Y!{R5+*Z4F z07smLDiu{!51!^Io}IGbOk89P7!SW(a!GAPwejz2jBZy?EVjEN<-JJ8HRyD08T8J) zV@QK1;U&_yXhk}1 M*qT+FT>10A09GTG(f|Me literal 0 HcmV?d00001 diff --git a/Items/Accessories/RoverDrive.cs b/Items/Accessories/RoverDrive.cs new file mode 100644 index 0000000000..eb6db78b0b --- /dev/null +++ b/Items/Accessories/RoverDrive.cs @@ -0,0 +1,32 @@ +using CalamityMod.CalPlayer; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories +{ + public class RoverDrive : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rover Drive"); + Tooltip.SetDefault("Activates a protective shield that grants 10 defense for 10 seconds\n" + + //Actually 10.1 seconds at full power with a dissipation across 0.1666 seconds but whatever + "The shield then dissipates and recharges for 20 seconds before being reactivated"); + } + + public override void SetDefaults() + { + item.width = 38; + item.height = 26; + item.value = CalamityGlobalItem.Rarity1BuyPrice; + item.rare = 1; + item.accessory = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.roverDrive = true; + } + } +} diff --git a/Items/Accessories/RoverDrive.png b/Items/Accessories/RoverDrive.png new file mode 100644 index 0000000000000000000000000000000000000000..dc5b42b8ba8bff40df890a9cb4e08fe62bb6ed20 GIT binary patch literal 730 zcmV<00ww*4P)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00JmUL_t(Y$KBVzYZGA{$MN^oG+a{B zSktPsQm7$m5e!&Rp*j=?!GEAQI0!C+LpSFxE>4cR=_ctP;N&1`9R!C8MO$j2&|;-E zw3ntwqCJP_`6fP(mozCNS3k?$^Xu+-<$F&OhYmA2dEIFDx?KS5`1`@{{cG!A0XQ?z z>i}%~`v7=e8Gxn5`Ih(T>h!_>Rh+*iG?7h)uAf`30G$gS9kIg-ZRPs`NZfm5^l!eK z24ML4R!4%-6+5iZNBtf+R>kN zGoiskpE_C>ntQnczy)1vjRdqx{XW^V0L;Gr5=2_e$>j?Hz_mMnq_^y z1i;4B!_e_l#rptwYn~~jW7n7@`eH+arvXR}r2t6ZK5k6x`QWsa6giQR93<3t<*_kd zdV4q8Vlg=xy)kSGJXHec-Jd{XKiVD7Xh96YjH?&6Swpr|a%Dz|>2_qr>NPfYF=q_e zH6}Z@y`S0n{9-j!NFuc?vF9aRH{v_L-LX8HSiuOl4#S zXw;A`6pzOpfNHf0z@G0DX)$N~@&o{0scd|ybx)lOU65U=srh=p5;19iyLtkElW)Ga zB_ugAzhGltsa)3sa0b*qR4XnRg7#Z05@T9SQY$W~@g_oY{D1x>V=-F@#v`?*IS* M07*qoM6N<$f;u-m^#A|> literal 0 HcmV?d00001 diff --git a/Items/Accessories/TheAbsorber.cs b/Items/Accessories/TheAbsorber.cs index e4132ff431..75215db544 100644 --- a/Items/Accessories/TheAbsorber.cs +++ b/Items/Accessories/TheAbsorber.cs @@ -55,6 +55,7 @@ namespace CalamityMod.Items.Accessories recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ModContent.ItemType(), 5); @@ -68,6 +69,7 @@ namespace CalamityMod.Items.Accessories recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ModContent.ItemType(), 5); diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index 85755fb94e..a818545724 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -60,7 +60,6 @@ namespace CalamityMod.NPCs.NormalNPCs npc.noTileCollide = true; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; - npc.buffImmune[BuffID.Confused] = false; banner = npc.type; bannerItem = ModContent.ItemType(); } diff --git a/NPCs/NormalNPCs/WulfrumGyrator.cs b/NPCs/NormalNPCs/WulfrumGyrator.cs index 8b9844cb2b..3323ce5634 100644 --- a/NPCs/NormalNPCs/WulfrumGyrator.cs +++ b/NPCs/NormalNPCs/WulfrumGyrator.cs @@ -48,6 +48,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath14; banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override void FindFrame(int frameHeight) @@ -88,7 +89,7 @@ namespace CalamityMod.NPCs.NormalNPCs Math.Abs(player.Center.X - npc.Center.X) < PlayerSearchDistance && Math.Abs(player.Center.X - npc.Center.X) > PlayerTargetingThreshold) { - int direction = Math.Sign(player.Center.X - npc.Center.X); + int direction = Math.Sign(player.Center.X - npc.Center.X) * (npc.confused ? -1 : 1); if (npc.direction != direction) { npc.direction = direction; diff --git a/NPCs/NormalNPCs/WulfrumPylon.cs b/NPCs/NormalNPCs/WulfrumPylon.cs index 336135f481..1f41122e36 100644 --- a/NPCs/NormalNPCs/WulfrumPylon.cs +++ b/NPCs/NormalNPCs/WulfrumPylon.cs @@ -154,7 +154,6 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { DropHelper.DropItem(npc, ModContent.ItemType(), 2, 3); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), Supercharged); } } } diff --git a/NPCs/NormalNPCs/WulfrumRover.cs b/NPCs/NormalNPCs/WulfrumRover.cs index baeb2de11f..1344b783bf 100644 --- a/NPCs/NormalNPCs/WulfrumRover.cs +++ b/NPCs/NormalNPCs/WulfrumRover.cs @@ -1,3 +1,4 @@ +using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; @@ -42,6 +43,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath14; banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override void FindFrame(int frameHeight) @@ -73,7 +75,7 @@ namespace CalamityMod.NPCs.NormalNPCs Math.Abs(player.Center.X - npc.Center.X) < PlayerSearchDistance && Math.Abs(player.Center.X - npc.Center.X) > PlayerTargetingThreshold) { - int direction = Math.Sign(player.Center.X - npc.Center.X); + int direction = Math.Sign(player.Center.X - npc.Center.X) * (npc.confused ? -1 : 1); if (npc.direction != direction) { npc.direction = direction; @@ -138,6 +140,7 @@ namespace CalamityMod.NPCs.NormalNPCs { DropHelper.DropItem(npc, ModContent.ItemType()); DropHelper.DropItemCondition(npc, ModContent.ItemType(), Supercharged); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); } } } From d28bb6839cd283ca33cadc48fe44de9840ed9bac Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 19 Jul 2020 14:58:37 -0400 Subject: [PATCH 135/160] wulfrum pylon now drops an energy core --- NPCs/NormalNPCs/WulfrumPylon.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/NPCs/NormalNPCs/WulfrumPylon.cs b/NPCs/NormalNPCs/WulfrumPylon.cs index 1f41122e36..88443a1876 100644 --- a/NPCs/NormalNPCs/WulfrumPylon.cs +++ b/NPCs/NormalNPCs/WulfrumPylon.cs @@ -154,6 +154,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { DropHelper.DropItem(npc, ModContent.ItemType(), 2, 3); + DropHelper.DropItem(npc, ModContent.ItemType()); } } } From fa8acf7d0715cf9de053aa1c9ec00113088aa17e Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 19 Jul 2020 15:11:12 -0400 Subject: [PATCH 136/160] added a buff for blood pact --- Buffs/StatBuffs/BloodyBoost.cs | 25 +++++++++++++++++++++++++ Buffs/StatBuffs/BloodyBoost.png | Bin 0 -> 607 bytes CalPlayer/CalamityPlayer.cs | 9 +++++---- CalPlayer/CalamityPlayerLifeRegen.cs | 2 +- CalPlayer/CalamityPlayerMiscEffects.cs | 4 +--- 5 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 Buffs/StatBuffs/BloodyBoost.cs create mode 100644 Buffs/StatBuffs/BloodyBoost.png diff --git a/Buffs/StatBuffs/BloodyBoost.cs b/Buffs/StatBuffs/BloodyBoost.cs new file mode 100644 index 0000000000..b9dbc83448 --- /dev/null +++ b/Buffs/StatBuffs/BloodyBoost.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.StatBuffs +{ + public class BloodyBoost : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Bloody Boost"); + Description.SetDefault("Increased offensive and defensive stats\n" + + "Healing potions grant more health"); + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = false; + longerExpertDebuff = false; + canBeCleared = false; + } + + public override void Update(Player player, ref int buffIndex) + { + player.Calamity().bloodPactBoost = true; + } + } +} diff --git a/Buffs/StatBuffs/BloodyBoost.png b/Buffs/StatBuffs/BloodyBoost.png new file mode 100644 index 0000000000000000000000000000000000000000..020e7e63c109931d055a3cd24af1280ae6a78222 GIT binary patch literal 607 zcmV-l0-*hgP)1vrG8kXoP{u- zZSNDelh=}9Y+_I_-rV^^xZ{+LuVp+q++EQx|9B()h3u)|P<>EvI&3K8sGkY zV-90N{FpQDDmbBf-u9FtjN7AtyZ1UZ_ReLX`(ca{AdDEtW*%(T!L~;MGJ3jxmu9HD zP7nqtVKOG}H|ETXKWL8vk=}kuDiMtcwv7#tq~P7bnV=ujxX0UZrX~}f9^x~)_dItm zEqfGT&$o8>RgM}TUY^BX-CWkWE7;zFi?U6{7G{)xxUtC-*EQOq?3@C76!4_^%~%?V zi3KB+F!z`c{D?~zuNbO`_9`$R>G5O?BN(CtPW0nPKlAu0VUGgbbWbhnCM07RtQ-{} zC1{=k2Ju4)=4ohY6&Kc7(*gD<00VBq{G)moq;u*i<~&a)$8i-*t?vph&Lsu8M_|sm zhq))%hMLf=h+tyA6XHo#6Y^Gs0XJWmn^OAzklN>F_qiCf=Nnez5A#fO`sHYG#bhDIxPjRGs@& tR^0=pO&tCp>tI)10r^7J+5FG1<4@{9y$I64e2)MC002ovPDHLkV1j@yAn*VH literal 0 HcmV?d00001 diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index c0c8d8de80..f8f2b5637f 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -491,7 +491,7 @@ namespace CalamityMod.CalPlayer public bool fleshTotem = false; public bool fleshTotemCooldown = false; public bool bloodPact = false; - public int bloodPactBuffTimer = 0; + public bool bloodPactBoost = false; public bool bloodflareCore = false; public bool coreOfTheBloodGod = false; public bool elementalHeart = false; @@ -1822,6 +1822,7 @@ namespace CalamityMod.CalPlayer polarisBoostTwo = false; polarisBoostThree = false; bloodfinBoost = false; + bloodPactBoost = false; killSpikyBalls = false; @@ -2025,7 +2026,6 @@ namespace CalamityMod.CalPlayer sulphurBubbleCooldown = 0; ladHearts = 0; prismaticLasers = 0; - bloodPactBuffTimer = 0; alcoholPoisoning = false; shadowflame = false; @@ -2204,6 +2204,7 @@ namespace CalamityMod.CalPlayer revivify = false; healCounter = 300; danceOfLightCharge = 0; + bloodPactBoost = false; #endregion #region Armorbonuses @@ -4192,7 +4193,7 @@ namespace CalamityMod.CalPlayer #region Get Heal Life public override void GetHealLife(Item item, bool quickHeal, ref int healValue) { - if (bloodPactBuffTimer > 0) + if (bloodPactBoost) healValue = (int)(healValue * 1.5); if (CalamityWorld.ironHeart) healValue = 0; @@ -7365,7 +7366,7 @@ namespace CalamityMod.CalPlayer if (bloodPact && Main.rand.NextBool(4)) { - bloodPactBuffTimer = 600; + player.AddBuff(ModContent.BuffType(), 600); damageMult += 1.25; } diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 3df4ecdc25..51b45ca9eb 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -694,7 +694,7 @@ namespace CalamityMod.CalPlayer { player.lifeRegen += 2; } - if (modPlayer.bloodPactBuffTimer > 0) + if (modPlayer.bloodPactBoost) { player.lifeRegen += 2; } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 18c997ece1..365b7cba41 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -988,8 +988,6 @@ namespace CalamityMod.CalPlayer modPlayer.dogTextCooldown--; if (modPlayer.titanCooldown > 0) modPlayer.titanCooldown--; - if (modPlayer.bloodPactBuffTimer > 0) - modPlayer.bloodPactBuffTimer--; // Silva invincibility effects if (modPlayer.silvaCountdown > 0 && modPlayer.hasSilvaEffect && modPlayer.silvaSet) @@ -2512,7 +2510,7 @@ namespace CalamityMod.CalPlayer player.magicQuiver = true; } - if (modPlayer.bloodPactBuffTimer > 0) + if (modPlayer.bloodPactBoost) { player.allDamage += 0.05f; player.statDefense += 20; From b28a46664ad7ba7842b3f79434ed9ce39a1cdc79 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 19 Jul 2020 17:36:22 -0400 Subject: [PATCH 137/160] weapon nerfs and compile fixes --- .../Fishing/BrimstoneCragCatches/Bloodfin.cs | 4 ++-- Items/Potions/Alcohol/GrapeBeer.cs | 4 ++-- Items/Potions/Alcohol/Margarita.cs | 4 ++-- Items/Potions/SunkenStew.cs | 4 ++-- Items/Weapons/Summon/BensUmbrella.cs | 8 ++++---- Items/Weapons/Summon/PlantationStaff.cs | 2 +- Items/Weapons/Summon/SarosPossession.cs | 18 ++++++++--------- Items/Weapons/Summon/Sirius.cs | 20 +++++++++---------- Items/Weapons/Summon/SunGodStaff.cs | 12 +++++------ Items/Weapons/Summon/SunSpiritStaff.cs | 14 ++++++------- Projectiles/Summon/RadiantResolutionAura.cs | 12 +++++------ Projectiles/Summon/RadiantResolutionFire.cs | 20 +++++++------------ 12 files changed, 54 insertions(+), 68 deletions(-) diff --git a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs index cda0ac35d7..871ca5599d 100644 --- a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs +++ b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs @@ -40,7 +40,7 @@ The life regen boost is stronger if below 75% health"); public override void OnConsumeItem(Player player) { int healAmt = CalamityWorld.ironHeart ? 0 : 240; - if (player.Calamity().bloodPactBuffTimer > 0) + if (player.Calamity().bloodPactBoost) healAmt = (int)(healAmt * 1.5); player.statLife += healAmt; if (player.statLife > player.statLifeMax2) @@ -69,7 +69,7 @@ The life regen boost is stronger if below 75% health"); public override void ModifyTooltips(List tooltips) { float healMult = 1f; - if (Main.player[Main.myPlayer].Calamity().bloodPactBuffTimer > 0) + if (Main.player[Main.myPlayer].Calamity().bloodPactBoost) healMult = 1.5f; tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : (int)(item.healLife * healMult)) + " life"; } diff --git a/Items/Potions/Alcohol/GrapeBeer.cs b/Items/Potions/Alcohol/GrapeBeer.cs index cb0a8dfeec..52875fb9ef 100644 --- a/Items/Potions/Alcohol/GrapeBeer.cs +++ b/Items/Potions/Alcohol/GrapeBeer.cs @@ -42,7 +42,7 @@ Reduces defense by 2 and movement speed by 5%"); public override void OnConsumeItem(Player player) { int healAmt = CalamityWorld.ironHeart ? 0 : 100; - if (player.Calamity().bloodPactBuffTimer > 0) + if (player.Calamity().bloodPactBoost) healAmt = (int)(healAmt * 1.5); player.statLife += healAmt; player.statMana += 100; @@ -74,7 +74,7 @@ Reduces defense by 2 and movement speed by 5%"); public override void ModifyTooltips(List tooltips) { float healMult = 1f; - if (Main.player[Main.myPlayer].Calamity().bloodPactBuffTimer > 0) + if (Main.player[Main.myPlayer].Calamity().bloodPactBoost) healMult = 1.5f; tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : (int)(item.healLife * healMult)) + " life"; } diff --git a/Items/Potions/Alcohol/Margarita.cs b/Items/Potions/Alcohol/Margarita.cs index ba6f67a029..a6c75e20a0 100644 --- a/Items/Potions/Alcohol/Margarita.cs +++ b/Items/Potions/Alcohol/Margarita.cs @@ -45,7 +45,7 @@ Reduces defense by 6 and life regen by 1"); public override void OnConsumeItem(Player player) { int healAmt = CalamityWorld.ironHeart ? 0 : 200; - if (player.Calamity().bloodPactBuffTimer > 0) + if (player.Calamity().bloodPactBoost) healAmt = (int)(healAmt * 1.5); player.statLife += healAmt; player.statMana += 200; @@ -77,7 +77,7 @@ Reduces defense by 6 and life regen by 1"); public override void ModifyTooltips(List tooltips) { float healMult = 1f; - if (Main.player[Main.myPlayer].Calamity().bloodPactBuffTimer > 0) + if (Main.player[Main.myPlayer].Calamity().bloodPactBoost) healMult = 1.5f; tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : (int)(item.healLife * healMult)) + " life"; } diff --git a/Items/Potions/SunkenStew.cs b/Items/Potions/SunkenStew.cs index 1acf2364fd..598a592537 100644 --- a/Items/Potions/SunkenStew.cs +++ b/Items/Potions/SunkenStew.cs @@ -45,7 +45,7 @@ Grants Well Fed"); public override bool UseItem(Player player) { int healAmt = CalamityWorld.ironHeart ? 0 : 120; - if (player.Calamity().bloodPactBuffTimer > 0) + if (player.Calamity().bloodPactBoost) healAmt = (int)(healAmt * 1.5); player.statLife += healAmt; player.statMana += 150; @@ -82,7 +82,7 @@ Grants Well Fed"); public override void ModifyTooltips(List tooltips) { float healMult = 1f; - if (Main.player[Main.myPlayer].Calamity().bloodPactBuffTimer > 0) + if (Main.player[Main.myPlayer].Calamity().bloodPactBoost) healMult = 1.5f; tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : (int)(item.healLife * healMult)) + " life"; } diff --git a/Items/Weapons/Summon/BensUmbrella.cs b/Items/Weapons/Summon/BensUmbrella.cs index dee041c074..dd6ca111be 100644 --- a/Items/Weapons/Summon/BensUmbrella.cs +++ b/Items/Weapons/Summon/BensUmbrella.cs @@ -46,14 +46,14 @@ namespace CalamityMod.Items.Weapons.Summon { for (int x = 0; x < Main.maxProjectiles; x++) { - Projectile projectile = Main.projectile[x]; - if (projectile.active && projectile.owner == player.whoAmI && projectile.type == type) + Projectile proj = Main.projectile[x]; + if (proj.active && proj.owner == player.whoAmI && proj.type == type) { - projectile.Kill(); + proj.Kill(); break; } } - Projectile.NewProjectile(player.Center, Vector2.Zero, type, damage, knockBack, player.whoAmI); + Projectile.NewProjectile(position, Vector2.Zero, type, damage, knockBack, player.whoAmI); return false; } diff --git a/Items/Weapons/Summon/PlantationStaff.cs b/Items/Weapons/Summon/PlantationStaff.cs index ffcf474c10..a844859e51 100644 --- a/Items/Weapons/Summon/PlantationStaff.cs +++ b/Items/Weapons/Summon/PlantationStaff.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 60; + item.damage = 55; item.mana = 10; item.width = 66; item.height = 70; diff --git a/Items/Weapons/Summon/SarosPossession.cs b/Items/Weapons/Summon/SarosPossession.cs index 932650edd9..afa9e2884b 100644 --- a/Items/Weapons/Summon/SarosPossession.cs +++ b/Items/Weapons/Summon/SarosPossession.cs @@ -47,10 +47,10 @@ namespace CalamityMod.Items.Weapons.Summon double minionCount = 0; for (int j = 0; j < Main.projectile.Length; j++) { - Projectile projectile = Main.projectile[j]; - if (projectile.active && projectile.owner == player.whoAmI && projectile.minion && projectile.type != ModContent.ProjectileType() && projectile.type != ModContent.ProjectileType()) + Projectile proj = Main.projectile[j]; + if (proj.active && proj.owner == player.whoAmI && proj.minion && proj.type != item.shoot) { - minionCount += projectile.minionSlots; + minionCount += proj.minionSlots; } } radianceSlots = (int)(player.maxMinions - minionCount); @@ -65,16 +65,14 @@ namespace CalamityMod.Items.Weapons.Summon { for (int x = 0; x < Main.projectile.Length; x++) { - Projectile projectile = Main.projectile[x]; - if (projectile.active && projectile.owner == player.whoAmI && projectile.type == ModContent.ProjectileType() && projectile.type != ModContent.ProjectileType()) + Projectile proj = Main.projectile[x]; + if (proj.active && proj.owner == player.whoAmI && proj.type == type) { - projectile.Kill(); + proj.Kill(); + break; } } - position = Main.MouseWorld; - speedX = 0; - speedY = 0; - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, radianceSlots); + Projectile.NewProjectile(position, Vector2.Zero, type, damage, knockBack, player.whoAmI, radianceSlots); return false; } diff --git a/Items/Weapons/Summon/Sirius.cs b/Items/Weapons/Summon/Sirius.cs index 37e60e7d4b..23f78749e8 100644 --- a/Items/Weapons/Summon/Sirius.cs +++ b/Items/Weapons/Summon/Sirius.cs @@ -46,13 +46,13 @@ namespace CalamityMod.Items.Weapons.Summon double minionCount = 0; for (int j = 0; j < Main.projectile.Length; j++) { - Projectile projectile = Main.projectile[j]; - if (projectile.active && projectile.owner == player.whoAmI && projectile.minion && projectile.type != ModContent.ProjectileType() && projectile.type != ModContent.ProjectileType()) + Projectile proj = Main.projectile[j]; + if (proj.active && proj.owner == player.whoAmI && proj.minion && proj.type != item.shoot) { - minionCount += projectile.minionSlots; + minionCount += proj.minionSlots; } } - siriusSlots = (int)((double)player.maxMinions - minionCount); + siriusSlots = (int)(player.maxMinions - minionCount); } public override bool CanUseItem(Player player) @@ -64,16 +64,14 @@ namespace CalamityMod.Items.Weapons.Summon { for (int x = 0; x < Main.projectile.Length; x++) { - Projectile projectile2 = Main.projectile[x]; - if (projectile2.active && projectile2.owner == player.whoAmI && projectile2.type == ModContent.ProjectileType() && projectile2.type != ModContent.ProjectileType()) + Projectile proj = Main.projectile[x]; + if (proj.active && proj.owner == player.whoAmI && proj.type == type) { - projectile2.Kill(); + proj.Kill(); + break; } } - position = Main.MouseWorld; - speedX = 0; - speedY = 0; - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, siriusSlots, 30f); + Projectile.NewProjectile(position, Vector2.Zero, type, damage, knockBack, player.whoAmI, siriusSlots, 30f); return false; } diff --git a/Items/Weapons/Summon/SunGodStaff.cs b/Items/Weapons/Summon/SunGodStaff.cs index c856eada29..ebe9ce9e11 100644 --- a/Items/Weapons/Summon/SunGodStaff.cs +++ b/Items/Weapons/Summon/SunGodStaff.cs @@ -47,18 +47,16 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - position = Main.MouseWorld; - speedX = 0; - speedY = 0; for (int x = 0; x < Main.maxProjectiles; x++) { - Projectile projectile = Main.projectile[x]; - if (projectile.active && projectile.owner == player.whoAmI && projectile.type == item.shoot) + Projectile proj = Main.projectile[x]; + if (proj.active && proj.owner == player.whoAmI && proj.type == type) { - projectile.Kill(); + proj.Kill(); + break; } } - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI); + Projectile.NewProjectile(position, Vector2.Zero, type, damage, knockBack, player.whoAmI); return false; } } diff --git a/Items/Weapons/Summon/SunSpiritStaff.cs b/Items/Weapons/Summon/SunSpiritStaff.cs index 00f9a88a12..e874d3e8cd 100644 --- a/Items/Weapons/Summon/SunSpiritStaff.cs +++ b/Items/Weapons/Summon/SunSpiritStaff.cs @@ -44,18 +44,16 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - position = Main.MouseWorld; - speedX = 0; - speedY = 0; - for (int x = 0; x < 1000; x++) + for (int x = 0; x < Main.maxProjectiles; x++) { - Projectile projectile = Main.projectile[x]; - if (projectile.active && projectile.owner == player.whoAmI && projectile.type == ModContent.ProjectileType()) + Projectile proj = Main.projectile[x]; + if (proj.active && proj.owner == player.whoAmI && proj.type == type) { - projectile.Kill(); + proj.Kill(); + break; } } - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI); + Projectile.NewProjectile(position, Vector2.Zero, type, damage, knockBack, player.whoAmI); return false; } } diff --git a/Projectiles/Summon/RadiantResolutionAura.cs b/Projectiles/Summon/RadiantResolutionAura.cs index 5051154e9d..8a69544737 100644 --- a/Projectiles/Summon/RadiantResolutionAura.cs +++ b/Projectiles/Summon/RadiantResolutionAura.cs @@ -36,10 +36,10 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { Lighting.AddLight(projectile.Center, 2f, 2f, 2f); - bool isCorrectProjectile = projectile.type == ModContent.ProjectileType(); Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); + bool isCorrectProjectile = projectile.type == ModContent.ProjectileType(); if (isCorrectProjectile) { if (player.dead) @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Summon projectile.rotation += MathHelper.ToRadians(3f) + MathHelper.ToRadians(allocatedSlots * 0.85f); int radiantOrbDamage = (int)(projectile.damage * (Math.Log(allocatedSlots, 2.5) + 1f)); - int radiantOrbAppearRate = (int)(124 * Math.Pow(0.9, allocatedSlots)); + int radiantOrbAppearRate = (int)(130 * Math.Pow(0.8, allocatedSlots)); if (radiantOrbAppearRate < 7) radiantOrbAppearRate = 7; @@ -87,9 +87,9 @@ namespace CalamityMod.Projectiles.Summon { if (projectile.ai[1] % 35 == 34) { - for (int i = 0; i < 3; i++) + for (int i = 0; i < 2; i++) { - float angle = MathHelper.Lerp(-MathHelper.ToRadians(30f), MathHelper.ToRadians(30f), i / 3f); + float angle = MathHelper.Lerp(-MathHelper.ToRadians(20f), MathHelper.ToRadians(20f), i / 2f); Projectile.NewProjectile(projectile.Center, projectile.DirectionTo(potentialTarget.Center).RotatedBy(angle) * 15f, ModContent.ProjectileType(), radiantOrbDamage / 2, projectile.knockBack, projectile.owner); } @@ -98,9 +98,9 @@ namespace CalamityMod.Projectiles.Summon { Projectile.NewProjectile(projectile.Center + Utils.NextVector2Unit(Main.rand) * Main.rand.NextFloat(100f, 360f), projectile.DirectionTo(potentialTarget.Center) * 2f, ModContent.ProjectileType(), radiantOrbDamage, projectile.knockBack * 4f, projectile.owner); - for (int i = 0; i < 4; i++) + for (int i = 0; i < 3; i++) { - float angle = MathHelper.Lerp(-MathHelper.ToRadians(40f), MathHelper.ToRadians(40f), i / 4f); + float angle = MathHelper.Lerp(-MathHelper.ToRadians(30f), MathHelper.ToRadians(30f), i / 3f); Projectile.NewProjectile(projectile.Center, projectile.DirectionTo(potentialTarget.Center).RotatedBy(angle) * 19f, ModContent.ProjectileType(), radiantOrbDamage / 2, projectile.knockBack, projectile.owner); } diff --git a/Projectiles/Summon/RadiantResolutionFire.cs b/Projectiles/Summon/RadiantResolutionFire.cs index 4b9fdc04b9..97f276bef3 100644 --- a/Projectiles/Summon/RadiantResolutionFire.cs +++ b/Projectiles/Summon/RadiantResolutionFire.cs @@ -15,15 +15,12 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { - projectile.width = 10; - projectile.height = 10; + projectile.width = projectile.height = 10; projectile.friendly = true; - projectile.penetrate = 1; projectile.light = 1f; projectile.timeLeft = 300; projectile.minion = true; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 4; + projectile.tileCollide = false; } public override void AI() @@ -41,16 +38,13 @@ namespace CalamityMod.Projectiles.Summon public override void Kill(int timeLeft) { - projectile.position = projectile.Center; - projectile.width = projectile.height = 60; - projectile.position -= projectile.Size / 2f; - projectile.maxPenetrate = -1; - projectile.penetrate = -1; + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 60); + projectile.maxPenetrate = projectile.penetrate = -1; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 5; - projectile.damage /= 2; + projectile.localNPCHitCooldown = 10; + projectile.damage /= 3; projectile.Damage(); - Main.PlaySound(SoundID.Item14, projectile.position); + Main.PlaySound(SoundID.Item14, projectile.Center); for (int i = 0; i < 20; i++) { Dust dust = Dust.NewDustPerfect(projectile.Center, (int)CalamityDusts.ProfanedFire); From d5fc403713bb3c36a95a1bbb1c369439272605f1 Mon Sep 17 00:00:00 2001 From: DominicKarma42 <51094361+DominicKarma@users.noreply.github.com> Date: Sun, 19 Jul 2020 16:38:33 -0500 Subject: [PATCH 138/160] Various fixes/adjustments (also fixed errors from last commit) --- CalamityMod.cs | 12 ++--- .../Fishing/BrimstoneCragCatches/Bloodfin.cs | 8 ++-- Items/Potions/Alcohol/GrapeBeer.cs | 8 ++-- Items/Potions/Alcohol/Margarita.cs | 8 ++-- Items/Potions/SunkenStew.cs | 6 +-- Localization/CalamityLocalization.cs | 1 - Schematics/TilePlacementHelpers.cs | 19 ++++++-- Tiles/Astral/AstralBeacon.cs | 10 ----- UI/DraedonsLogUI.cs | 44 ++++++++++++++----- World/WorldGenerationMethods.cs | 23 +++++++--- 10 files changed, 87 insertions(+), 52 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index 0702c76f83..5f39276b47 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -3391,6 +3391,13 @@ namespace CalamityMod StealthUI.Draw(Main.spriteBatch, Main.LocalPlayer); return true; }, InterfaceScaleType.None)); + + // Popup GUIs. + layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Popup GUIs", () => + { + PopupGUIManager.UpdateAndDraw(Main.spriteBatch); + return true; + }, InterfaceScaleType.None)); } // Invasion UI (used for Acid Rain) @@ -3406,11 +3413,6 @@ namespace CalamityMod return true; }, InterfaceScaleType.None)); } - layers.Add(new LegacyGameInterfaceLayer("Popup GUIs", () => - { - PopupGUIManager.UpdateAndDraw(Main.spriteBatch); - return true; - }, InterfaceScaleType.None)); } public static Color GetNPCColor(NPC npc, Vector2? position = null, bool effects = true, float shadowOverride = 0f) diff --git a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs index cda0ac35d7..f770884576 100644 --- a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs +++ b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs @@ -40,8 +40,8 @@ The life regen boost is stronger if below 75% health"); public override void OnConsumeItem(Player player) { int healAmt = CalamityWorld.ironHeart ? 0 : 240; - if (player.Calamity().bloodPactBuffTimer > 0) - healAmt = (int)(healAmt * 1.5); + if (player.Calamity().bloodPactBoost) + healAmt = (int)(healAmt * 1.5); player.statLife += healAmt; if (player.statLife > player.statLifeMax2) { @@ -69,8 +69,8 @@ The life regen boost is stronger if below 75% health"); public override void ModifyTooltips(List tooltips) { float healMult = 1f; - if (Main.player[Main.myPlayer].Calamity().bloodPactBuffTimer > 0) - healMult = 1.5f; + if (Main.LocalPlayer.Calamity().bloodPactBoost) + healMult = 1.5f; tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : (int)(item.healLife * healMult)) + " life"; } } diff --git a/Items/Potions/Alcohol/GrapeBeer.cs b/Items/Potions/Alcohol/GrapeBeer.cs index cb0a8dfeec..000531441f 100644 --- a/Items/Potions/Alcohol/GrapeBeer.cs +++ b/Items/Potions/Alcohol/GrapeBeer.cs @@ -42,8 +42,8 @@ Reduces defense by 2 and movement speed by 5%"); public override void OnConsumeItem(Player player) { int healAmt = CalamityWorld.ironHeart ? 0 : 100; - if (player.Calamity().bloodPactBuffTimer > 0) - healAmt = (int)(healAmt * 1.5); + if (player.Calamity().bloodPactBoost) + healAmt = (int)(healAmt * 1.5); player.statLife += healAmt; player.statMana += 100; if (player.statLife > player.statLifeMax2) @@ -74,8 +74,8 @@ Reduces defense by 2 and movement speed by 5%"); public override void ModifyTooltips(List tooltips) { float healMult = 1f; - if (Main.player[Main.myPlayer].Calamity().bloodPactBuffTimer > 0) - healMult = 1.5f; + if (Main.LocalPlayer.Calamity().bloodPactBoost) + healMult = 1.5f; tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : (int)(item.healLife * healMult)) + " life"; } } diff --git a/Items/Potions/Alcohol/Margarita.cs b/Items/Potions/Alcohol/Margarita.cs index ba6f67a029..6fdf83315b 100644 --- a/Items/Potions/Alcohol/Margarita.cs +++ b/Items/Potions/Alcohol/Margarita.cs @@ -45,8 +45,8 @@ Reduces defense by 6 and life regen by 1"); public override void OnConsumeItem(Player player) { int healAmt = CalamityWorld.ironHeart ? 0 : 200; - if (player.Calamity().bloodPactBuffTimer > 0) - healAmt = (int)(healAmt * 1.5); + if (player.Calamity().bloodPactBoost) + healAmt = (int)(healAmt * 1.5); player.statLife += healAmt; player.statMana += 200; if (player.statLife > player.statLifeMax2) @@ -77,8 +77,8 @@ Reduces defense by 6 and life regen by 1"); public override void ModifyTooltips(List tooltips) { float healMult = 1f; - if (Main.player[Main.myPlayer].Calamity().bloodPactBuffTimer > 0) - healMult = 1.5f; + if (Main.LocalPlayer.Calamity().bloodPactBoost) + healMult = 1.5f; tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : (int)(item.healLife * healMult)) + " life"; } } diff --git a/Items/Potions/SunkenStew.cs b/Items/Potions/SunkenStew.cs index 1acf2364fd..ecd3d87a59 100644 --- a/Items/Potions/SunkenStew.cs +++ b/Items/Potions/SunkenStew.cs @@ -45,7 +45,7 @@ Grants Well Fed"); public override bool UseItem(Player player) { int healAmt = CalamityWorld.ironHeart ? 0 : 120; - if (player.Calamity().bloodPactBuffTimer > 0) + if (player.Calamity().bloodPactBoost) healAmt = (int)(healAmt * 1.5); player.statLife += healAmt; player.statMana += 150; @@ -82,8 +82,8 @@ Grants Well Fed"); public override void ModifyTooltips(List tooltips) { float healMult = 1f; - if (Main.player[Main.myPlayer].Calamity().bloodPactBuffTimer > 0) - healMult = 1.5f; + if (Main.LocalPlayer.Calamity().bloodPactBoost) + healMult = 1.5f; tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : (int)(item.healLife * healMult)) + " life"; } diff --git a/Localization/CalamityLocalization.cs b/Localization/CalamityLocalization.cs index d883788023..2c9dae7289 100644 --- a/Localization/CalamityLocalization.cs +++ b/Localization/CalamityLocalization.cs @@ -95,7 +95,6 @@ namespace CalamityMod.Localization new [] { "AureusBossText2", "A faint ethereal click can be heard from the dungeon." }, new [] { "AstralBossText", "The seal of the stars has been broken! You can now mine Astral Ore." }, new [] { "DeusText", "A star-spawned horror tunnels through the astral infection." }, - new [] { "DeusAltarRejectText", "The god of the stars rejects your offering. You must unleash the power of the lunar Cultist to perform the ritual." }, new [] { "DeusAltarRejectNightText", "The god of the stars rejects your offering. The ritual can only be performed at night." }, new [] { "CalamitasBossText", "You underestimate my power..." }, diff --git a/Schematics/TilePlacementHelpers.cs b/Schematics/TilePlacementHelpers.cs index 4cdfc17fee..490eb7c518 100644 --- a/Schematics/TilePlacementHelpers.cs +++ b/Schematics/TilePlacementHelpers.cs @@ -49,6 +49,20 @@ namespace CalamityMod.Schematics yOffset += tiles.GetLength(1); break; } + ushort[,] oldWalls = new ushort[tiles.GetLength(0), tiles.GetLength(1)]; + for (int x = 0; x < tiles.GetLength(0); x++) + { + for (int y = 0; y < tiles.GetLength(1); y++) + { + Tile tile = Main.tile[x + xOffset, y + yOffset]; + oldWalls[x, y] = tile.wall; + + // Attempting to break chests causes the game to attempt to infinitely recurse in an attempt to break the tile, resulting in a stack overflow. + if (tile.type == TileID.Containers) + continue; + WorldGen.KillTile(x + xOffset, y + yOffset); + } + } for (int x = 0; x < tiles.GetLength(0); x++) { for (int y = 0; y < tiles.GetLength(1); y++) @@ -68,13 +82,12 @@ namespace CalamityMod.Schematics } } - ushort oldWall = Main.tile[x + xOffset, y + yOffset].wall; Main.tile[x + xOffset, y + yOffset] = (Tile)tiles[x, y].Clone(); // If specified, preserve walls if they're not not being overrided and there's no active tile in its place. - if (preserveWalls && Main.tile[x + xOffset, y + yOffset].wall == 0 && !Main.tile[x + xOffset, y + yOffset].active()) + if (preserveWalls && oldWalls[x, y] != 0) { - Main.tile[x + xOffset, y + yOffset].wall = oldWall; + Main.tile[x + xOffset, y + yOffset].wall = oldWalls[x, y]; } Rectangle placeInArea = new Rectangle(x, y, tiles.GetLength(0), tiles.GetLength(1)); diff --git a/Tiles/Astral/AstralBeacon.cs b/Tiles/Astral/AstralBeacon.cs index 34739c94f5..44369421e9 100644 --- a/Tiles/Astral/AstralBeacon.cs +++ b/Tiles/Astral/AstralBeacon.cs @@ -64,16 +64,6 @@ namespace CalamityMod.Tiles.Astral bool usingStarcore = Main.LocalPlayer.HasItem(ModContent.ItemType()); - if (!NPC.downedAncientCultist) - { - string localizationKey = "Mods.CalamityMod.DeusAltarRejectText"; - if (Main.netMode == NetmodeID.SinglePlayer) - Main.NewText(Language.GetTextValue(localizationKey), FailColor); - else if (Main.netMode == NetmodeID.Server) - NetMessage.BroadcastChatMessage(NetworkText.FromKey(localizationKey), FailColor); - return true; - } - if (Main.dayTime) { string localizationKey = "Mods.CalamityMod.DeusAltarRejectNightText"; diff --git a/UI/DraedonsLogUI.cs b/UI/DraedonsLogUI.cs index d85bc3492a..effde96590 100644 --- a/UI/DraedonsLogUI.cs +++ b/UI/DraedonsLogUI.cs @@ -13,7 +13,7 @@ namespace CalamityMod.UI public int Page = 0; public int ArrowClickCooldown; public bool HoveringOverBook = false; - public const int TotalLinesPerPage = 16; + public int TotalLinesPerPage => (int)Math.Ceiling(16 * Main.screenHeight / 1440f - 1); public const int TextStartOffsetX = 40; public override void Update() { @@ -44,6 +44,8 @@ namespace CalamityMod.UI Vector2 scale = new Vector2(xScale, 1f) * new Vector2(Main.screenWidth, Main.screenHeight) / pageTexture.Size(); scale *= 0.5f; + float xResolutionScale = Main.screenWidth / 2560f; + float yResolutionScale = Main.screenHeight / 1440f; float bookScale = 0.75f; scale *= bookScale; @@ -69,24 +71,38 @@ namespace CalamityMod.UI } } - string placeholderText = "This is placeholder text. Yell at the lore writers to make something for this that pertains to Draedon and Co."; + string placeholderText = "A GOD DOES NOT FEAR DEATH "; + for (int i = 0; i < 7; i++) + { + placeholderText += placeholderText; + } // Create text and arrows. if (FadeTime >= FadeTimeMax - 4 && Active) { int textWidth = (int)(xScale * 2 * pageTexture.Width) - TextStartOffsetX; - textWidth = (int)(textWidth * Main.screenWidth / 2560f); + textWidth = (int)(textWidth * xResolutionScale); List dialogLines = Utils.WordwrapString(placeholderText, Main.fontMouseText, textWidth, 250, out _).ToList(); dialogLines.RemoveAll(text => string.IsNullOrEmpty(text)); int totalPages = dialogLines.Count / (TotalLinesPerPage * 2 + 2); + // Ensure the page number doesn't become nonsensical as a result of a resolution change (such as by resizing the game). + if (Page < 0) + Page = 0; + if (Page > totalPages) + Page = totalPages; + // Draw arrows. if (Page > 0) { Texture2D pageArrowTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DraedonsLogArrow"); - Vector2 bottomLeft = new Vector2(Main.screenWidth / 2 - pageTexture.Width * 2 - 36, yPageTop + pageTexture.Height + 32); + Vector2 offset = new Vector2(-(int)(pageTexture.Width * xResolutionScale) * 2 - (int)(36 * xResolutionScale), (int)(pageTexture.Height * yResolutionScale) + (int)(52 * yResolutionScale)); + Vector2 bottomLeft = new Vector2(Main.screenWidth / 2, yPageTop); + bottomLeft += offset; Rectangle arrowRectangle = new Rectangle((int)bottomLeft.X, (int)bottomLeft.Y, pageArrowTexture.Width, pageArrowTexture.Height); + arrowRectangle.Width = (int)(arrowRectangle.Width * xResolutionScale); + arrowRectangle.Height = (int)(arrowRectangle.Height * yResolutionScale); if (mouseRectangle.Intersects(arrowRectangle)) { pageArrowTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DraedonsLogArrowHover"); @@ -104,15 +120,19 @@ namespace CalamityMod.UI Color.White, 0f, Vector2.Zero, - 1f, + new Vector2(xResolutionScale, yResolutionScale), SpriteEffects.FlipHorizontally, 0f); } if (Page < totalPages) { Texture2D pageArrowTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DraedonsLogArrow"); - Vector2 bottomRight = new Vector2(Main.screenWidth / 2 + pageTexture.Width * 2 + 10, yPageTop + pageTexture.Height + 32); - Rectangle arrowRectangle = new Rectangle((int)bottomRight.X, (int)bottomRight.Y, pageArrowTexture.Width, pageArrowTexture.Height); + Vector2 offset = new Vector2((int)(pageTexture.Width * xResolutionScale) * 2 + (int)(10 * xResolutionScale), (int)(pageTexture.Height * yResolutionScale) + (int)(52 * yResolutionScale)); + Vector2 bottomRight = new Vector2(Main.screenWidth / 2, yPageTop); + bottomRight += offset; + Rectangle arrowRectangle = new Rectangle((int)bottomRight.X, (int)bottomRight.Y, pageArrowTexture.Width, pageArrowTexture.Height); ; + arrowRectangle.Width = (int)(arrowRectangle.Width * xResolutionScale); + arrowRectangle.Height = (int)(arrowRectangle.Height * yResolutionScale); if (mouseRectangle.Intersects(arrowRectangle)) { pageArrowTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DraedonsLogArrowHover"); @@ -130,7 +150,7 @@ namespace CalamityMod.UI Color.White, 0f, Vector2.Zero, - 1f, + new Vector2(xResolutionScale, yResolutionScale), SpriteEffects.None, 0f); } @@ -144,12 +164,12 @@ namespace CalamityMod.UI bool onNextPage = i - startingLine > TotalLinesPerPage; if (dialogLines[i] != null) { - int textDrawPositionX = Main.screenWidth / 2 - (int)((pageTexture.Width * 2) * Main.screenWidth / 2560f); - int textDrawPositionY = (int)(50 + (i - startingLine) * 24 * Main.screenHeight / 1440f) + (int)yPageTop; + int textDrawPositionX = (int)(Main.screenWidth / 2 - 50 * xResolutionScale) - (int)(pageTexture.Width * 2 * xResolutionScale); + int textDrawPositionY = (int)(50 * yResolutionScale) + (i - startingLine) * 24 + (int)yPageTop; if (onNextPage) { - textDrawPositionX = Main.screenWidth / 2 + (int)(TextStartOffsetX * 1.5 * Main.screenWidth / 2560f); - textDrawPositionY = (int)(50 + (i - startingLine - (TotalLinesPerPage + 1)) * 24 * Main.screenHeight / 1440f) + (int)yPageTop; + textDrawPositionX = (int)(Main.screenWidth / 2 + 16 * xResolutionScale) + (int)(TextStartOffsetX * 1.5 * xResolutionScale); + textDrawPositionY = (int)(50 * yResolutionScale) + (i - startingLine - (TotalLinesPerPage + 1)) * 24 + (int)yPageTop; } Color drawColor = Color.Lerp(Color.Cyan, Color.DarkCyan, (float)Math.Cos(i * 0.4) * 0.5f + 0.5f); diff --git a/World/WorldGenerationMethods.cs b/World/WorldGenerationMethods.cs index b5bb64e742..1206237398 100644 --- a/World/WorldGenerationMethods.cs +++ b/World/WorldGenerationMethods.cs @@ -1606,18 +1606,29 @@ namespace CalamityMod.World if (CanAstralBiomeSpawn()) { DoAstralConversion(new Point(i, j)); - int checkWidth = 70; - float height = 9000; + int checkWidth = 180; + float averageHeight = 0f; + float lowestHeight = 0f; for (int x = i - checkWidth / 2; x < i + checkWidth / 2; x++) { - int y = j - 100; - while (!CalamityUtils.ParanoidTileRetrieval(x, y).active()) + int y = j - 200; + while (!CalamityUtils.ParanoidTileRetrieval(x, y).active() || CalamityUtils.ParanoidTileRetrieval(x, y).type == TileID.Trees) { y++; + if (y > j - 10) + break; } - height = (int)MathHelper.Min(height, y); + lowestHeight = (int)MathHelper.Max(lowestHeight, y); + averageHeight += y; } - SchematicPlacementHelpers.PlaceStructure("Astral Beacon", new Point(i, (int)height - 30), SchematicPlacementHelpers.PlacementAnchorType.Center); + lowestHeight -= 36f; + averageHeight /= checkWidth; + float height = lowestHeight; + + // If there's a sudden change between the average and lowest height (which is indicative of holes/chasms), go with the average. + if (Math.Abs(lowestHeight - averageHeight) > 50f) + height = averageHeight; + SchematicPlacementHelpers.PlaceStructure("Astral Beacon", new Point(i, (int)height - 20), SchematicPlacementHelpers.PlacementAnchorType.Center); } } return true; From d8b8968f0632ad467d2873e9f462ad9d17887b5e Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 19 Jul 2020 19:07:25 -0400 Subject: [PATCH 139/160] Fixed Terra Shiv proj phasing through tiles???!??!? (Terraria why) --- Projectiles/Melee/ShortBeam.cs | 1 - Projectiles/Melee/ShortNightBeam.cs | 1 - Projectiles/Melee/ShortTerraBeam.cs | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Projectiles/Melee/ShortBeam.cs b/Projectiles/Melee/ShortBeam.cs index a97d2516d8..df133f307b 100644 --- a/Projectiles/Melee/ShortBeam.cs +++ b/Projectiles/Melee/ShortBeam.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.2f / 255f, 0f, (255 - projectile.alpha) * 0.2f / 255f); - projectile.velocity.Y += projectile.ai[0]; if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 73, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); diff --git a/Projectiles/Melee/ShortNightBeam.cs b/Projectiles/Melee/ShortNightBeam.cs index 8d71bb8209..b289cca935 100644 --- a/Projectiles/Melee/ShortNightBeam.cs +++ b/Projectiles/Melee/ShortNightBeam.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { Lighting.AddLight(projectile.Center, 0f, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0.1f / 255f); - projectile.velocity.Y += projectile.ai[0]; if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 21, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); diff --git a/Projectiles/Melee/ShortTerraBeam.cs b/Projectiles/Melee/ShortTerraBeam.cs index 846387995b..d959cc1355 100644 --- a/Projectiles/Melee/ShortTerraBeam.cs +++ b/Projectiles/Melee/ShortTerraBeam.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { projectile.width = 20; - projectile.height = 6; + projectile.height = 20; projectile.aiStyle = 27; projectile.friendly = true; projectile.melee = true; From 736c7aaa4cd5db3bee797077346cce1a619d412a Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 20 Jul 2020 11:29:20 -0400 Subject: [PATCH 140/160] added titan heart tooltip, added a find first proj util, arethereanydamnbosses now checks for the deus ritual proj --- Items/Materials/TitanHeart.cs | 1 + Items/Tools/ClimateChange/Cosmolight.cs | 4 ++-- Items/Tools/ClimateChange/Daylight.cs | 4 ++-- Items/Tools/ClimateChange/Moonlight.cs | 4 ++-- NPCs/CalamityGlobalNPC.cs | 3 ++- Utilities/CalamityUtils.cs | 15 +++++++++++++++ 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/Items/Materials/TitanHeart.cs b/Items/Materials/TitanHeart.cs index c51478954c..80eafd1844 100644 --- a/Items/Materials/TitanHeart.cs +++ b/Items/Materials/TitanHeart.cs @@ -8,6 +8,7 @@ namespace CalamityMod.Items.Materials public override void SetStaticDefaults() { DisplayName.SetDefault("Titan Heart"); + Tooltip.SetDefault("Also used at the Astral Beacon"); } public override void SetDefaults() diff --git a/Items/Tools/ClimateChange/Cosmolight.cs b/Items/Tools/ClimateChange/Cosmolight.cs index c372575163..681306c541 100644 --- a/Items/Tools/ClimateChange/Cosmolight.cs +++ b/Items/Tools/ClimateChange/Cosmolight.cs @@ -1,4 +1,4 @@ -using CalamityMod.NPCs; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Tools.ClimateChange public override bool CanUseItem(Player player) { - return !CalamityGlobalNPC.AnyBossNPCS(); + return !CalamityPlayer.areThereAnyDamnBosses; } public override bool UseItem(Player player) diff --git a/Items/Tools/ClimateChange/Daylight.cs b/Items/Tools/ClimateChange/Daylight.cs index 1d4e405fde..d9e280c78e 100644 --- a/Items/Tools/ClimateChange/Daylight.cs +++ b/Items/Tools/ClimateChange/Daylight.cs @@ -1,4 +1,4 @@ -using CalamityMod.NPCs; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Tools.ClimateChange public override bool CanUseItem(Player player) { - return !Main.dayTime && !CalamityGlobalNPC.AnyBossNPCS(); + return !Main.dayTime && !CalamityPlayer.areThereAnyDamnBosses; } public override bool UseItem(Player player) diff --git a/Items/Tools/ClimateChange/Moonlight.cs b/Items/Tools/ClimateChange/Moonlight.cs index 7ed05c712c..d5afd2cab2 100644 --- a/Items/Tools/ClimateChange/Moonlight.cs +++ b/Items/Tools/ClimateChange/Moonlight.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.NPCs; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Tools.ClimateChange public override bool CanUseItem(Player player) { - return Main.dayTime && !CalamityGlobalNPC.AnyBossNPCS(); + return Main.dayTime && !CalamityPlayer.areThereAnyDamnBosses; } public override bool UseItem(Player player) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 5da258093e..b547721ed9 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -49,6 +49,7 @@ using CalamityMod.NPCs.SulphurousSea; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.TownNPCs; using CalamityMod.NPCs.Yharon; +using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Ranged; @@ -5933,7 +5934,7 @@ namespace CalamityMod.NPCs return true; } } - return false; + return CalamityUtils.FindFirstProjectile(ProjectileType()) != -1; } #endregion diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 340248019a..c3bbf100be 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -773,6 +773,21 @@ namespace CalamityMod } } + public static int FindFirstProjectile(int Type) + { + int index = -1; + for (int x = 0; x < Main.maxProjectiles; x++) + { + Projectile proj = Main.projectile[x]; + if (proj.active && proj.type == Type) + { + index = x; + break; + } + } + return index; + } + /// /// Call this function in the Kill function of your projectile to spawn cloud-like gores. Used primarily for explosions /// From 03cab913279617d5be0d6ea3a30abfc51547203f Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 20 Jul 2020 13:02:34 -0400 Subject: [PATCH 141/160] reworked toxicant twister (again) --- Items/Weapons/Rogue/StellarKnife.cs | 2 +- Items/Weapons/Rogue/ToxicantTwister.cs | 37 +++++++--------- Projectiles/Rogue/StellarKnifeProj.cs | 2 +- .../Rogue/ToxicantTwisterTwoPointZero.cs | 43 ++++++++++++++----- 4 files changed, 49 insertions(+), 35 deletions(-) diff --git a/Items/Weapons/Rogue/StellarKnife.cs b/Items/Weapons/Rogue/StellarKnife.cs index 1dce4dda87..ca67e08474 100644 --- a/Items/Weapons/Rogue/StellarKnife.cs +++ b/Items/Weapons/Rogue/StellarKnife.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Rogue { speedX *= 0.9f; Vector2 perturbedspeed = new Vector2(speedX, speedY + Main.rand.Next(-3, 4)).RotatedBy(MathHelper.ToRadians(spread)); - Projectile.NewProjectile(position, perturbedspeed, type, damage, knockBack, player.whoAmI, 1f, i %5 == 0 ? 1f : 0f); + Projectile.NewProjectile(position, perturbedspeed, type, damage, knockBack, player.whoAmI, 1f, i % 5 == 0 ? 1f : 0f); spread -= Main.rand.Next(1, 3); } return false; diff --git a/Items/Weapons/Rogue/ToxicantTwister.cs b/Items/Weapons/Rogue/ToxicantTwister.cs index 2f3309268c..2c79249716 100644 --- a/Items/Weapons/Rogue/ToxicantTwister.cs +++ b/Items/Weapons/Rogue/ToxicantTwister.cs @@ -8,18 +8,19 @@ namespace CalamityMod.Items.Weapons.Rogue { public class ToxicantTwister : RogueWeapon { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Toxicant Twister"); - Tooltip.SetDefault("Throws a speedy, homing boomerang\n" + - "Stealth strikes fire two boomerangs that go much faster and release sand rapidly"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Toxicant Twister"); + Tooltip.SetDefault("Throws a slow moving boomerang\n" + + "After a few moments, the boomerang chooses a target and rapidly homes in\n" + + "Stealth strikes fire three boomerangs that home in faster and rapidly release sand"); + } public override void SafeSetDefaults() { item.width = 42; item.height = 46; - item.damage = 650; + item.damage = 750; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = item.useTime = 20; @@ -39,21 +40,13 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - float SpeedX = speedX + (float)Main.rand.Next(-20, 21) * 0.05f; - float SpeedY = speedY + (float)Main.rand.Next(-20, 21) * 0.05f; - int stealth = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); - Main.projectile[stealth].Calamity().stealthStrike = true; - Main.projectile[stealth].velocity *= 1.5f; - Main.projectile[stealth].timeLeft = 420; - Main.projectile[stealth].penetrate = -1; - Main.projectile[stealth].localNPCHitCooldown = 6; - - float SpeedX2 = speedX + (float)Main.rand.Next(-20, 21) * 0.05f; - float SpeedY2 = speedY + (float)Main.rand.Next(-20, 21) * 0.05f; - int stealth2 = Projectile.NewProjectile(position.X, position.Y, SpeedX2, SpeedY2, type, (int)(damage * 0.6f), knockBack, player.whoAmI, 0f, 0f); - Main.projectile[stealth2].Calamity().stealthStrike = true; - Main.projectile[stealth2].penetrate += 2; - Main.projectile[stealth2].localNPCHitCooldown = 8; + for (int i = 0; i < 3; i++) + { + float SpeedX = speedX + (float)Main.rand.Next(-20, 21) * 0.05f; + float SpeedY = speedY + (float)Main.rand.Next(-20, 21) * 0.05f; + int stealth = Projectile.NewProjectile(position, new Vector2(SpeedX, SpeedY), type, damage, knockBack, player.whoAmI); + Main.projectile[stealth].Calamity().stealthStrike = true; + } } else { diff --git a/Projectiles/Rogue/StellarKnifeProj.cs b/Projectiles/Rogue/StellarKnifeProj.cs index 23ee2f5efa..6bc326dd0d 100644 --- a/Projectiles/Rogue/StellarKnifeProj.cs +++ b/Projectiles/Rogue/StellarKnifeProj.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Rogue if (projectile.ai[0] == 1f) { projectile.ai[0] = 0f; - projectile.damage = (int)((double) projectile.damage * (projectile.ai[1] == 1f ? 0.9f : 0.75f)); + projectile.damage = (int)(projectile.damage * (projectile.ai[1] == 1f ? 0.9f : 0.75f)); projectile.ai[1] = 0f; } projectile.ai[1] += 0.75f; diff --git a/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs b/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs index e49e7434ed..d6d3b5b8e5 100644 --- a/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs +++ b/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Projectiles.Rogue public class ToxicantTwisterTwoPointZero : ModProjectile { private int lifeTime = 300; + private int targetIndex = -1; public override void SetStaticDefaults() { @@ -23,10 +24,9 @@ namespace CalamityMod.Projectiles.Rogue projectile.height = 46; projectile.friendly = true; projectile.tileCollide = false; - projectile.penetrate = 5; + projectile.penetrate = -1; projectile.timeLeft = lifeTime; projectile.Calamity().rogue = true; - projectile.extraUpdates = 1; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 12; } @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Rogue { if (projectile.Calamity().stealthStrike) { - if (projectile.timeLeft % 50f == 0f) + if (projectile.timeLeft % 20 == 0) { for (int i = 0; i < 2; i++) { @@ -57,10 +57,7 @@ namespace CalamityMod.Projectiles.Rogue Main.PlaySound(SoundID.Item7, projectile.position); } - // Returns after 2.5 seconds in the air - if (projectile.timeLeft < lifeTime - 150) - projectile.ai[0] = 1f; - + projectile.ai[1]++; if (projectile.ai[0] != 0f) { float returnSpeed = 30f; @@ -109,16 +106,41 @@ namespace CalamityMod.Projectiles.Rogue if (projectile.Hitbox.Intersects(owner.Hitbox)) projectile.Kill(); } + else if (projectile.ai[1] > 40f) + { + NPC closestTarget = projectile.Center.ClosestNPCAt(1769f, true, true); + if (closestTarget != null) + { + projectile.extraUpdates = 1; + targetIndex = closestTarget.whoAmI; + float inertia = 20f; + float homingVelocity = projectile.Calamity().stealthStrike ? 30f : 20f; + Vector2 homeInVector = projectile.DirectionTo(closestTarget.Center); + if (homeInVector.HasNaNs()) + homeInVector = Vector2.UnitY; + + projectile.velocity = (projectile.velocity * inertia + homeInVector * homingVelocity) / (inertia + 1f); + } + } else { - CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 600f, 20f, 20f); + projectile.velocity *= 0.985f; } } + public override void ModifyHitNPC(Projectile projectile, NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + if (projectile.ai[1] <= 40f && projectile.ai[0] != 1f) + { + damage /= 3; + } + } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (projectile.penetrate < 3) + if (targetIndex == target.whoAmI) projectile.ai[0] = 1f; + target.AddBuff(ModContent.BuffType(), 180); Main.PlaySound(SoundID.Item20, projectile.position); for (int k = 0; k < 10; k++) @@ -131,8 +153,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitPvp(Player target, int damage, bool crit) { - if (projectile.penetrate < 3) - projectile.ai[0] = 1f; + projectile.ai[0] = 1f; target.AddBuff(ModContent.BuffType(), 180); Main.PlaySound(SoundID.Item20, projectile.position); for (int k = 0; k < 10; k++) From 50010de6cde074b4c97e668248df5421bf079beb Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Mon, 20 Jul 2020 12:48:37 -0500 Subject: [PATCH 142/160] 1 - Laser Rifle damage nerfed by 50%, now fires two beams instead of 1 to make it flashier. 2 - SCal spawns 1 moon in normal, 2 in expert and 4 in rev+. 3 - Gatling Laser spread reduced slightly. --- Items/Weapons/DraedonsArsenal/LaserRifle.cs | 12 +++++++----- Items/Weapons/DraedonsArsenal/PlasmaCaster.cs | 8 ++++---- NPCs/SupremeCalamitas/SupremeCalamitas.cs | 4 +++- .../DraedonsArsenal/GatlingLaserProj.cs | 4 ++-- Projectiles/DraedonsArsenal/LaserRifleShot.cs | 18 +++++------------- 5 files changed, 21 insertions(+), 25 deletions(-) diff --git a/Items/Weapons/DraedonsArsenal/LaserRifle.cs b/Items/Weapons/DraedonsArsenal/LaserRifle.cs index d2c508ab4c..9add3a711d 100644 --- a/Items/Weapons/DraedonsArsenal/LaserRifle.cs +++ b/Items/Weapons/DraedonsArsenal/LaserRifle.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { public class LaserRifle : ModItem { - private int BaseDamage = 200; + private int BaseDamage = 100; public override void SetStaticDefaults() { @@ -52,10 +52,12 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal velocity *= 5f; } - float SpeedX = velocity.X + (float)Main.rand.Next(-1, 2) * 0.05f; - float SpeedY = velocity.Y + (float)Main.rand.Next(-1, 2) * 0.05f; - - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + for (int i = 0; i < 2; i++) + { + float SpeedX = velocity.X + Main.rand.Next(-1, 2) * 0.05f; + float SpeedY = velocity.Y + Main.rand.Next(-1, 2) * 0.05f; + Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, i, 0f); + } // Consume 4 ammo per shot CalamityGlobalItem.ConsumeAdditionalAmmo(player, item, 4); diff --git a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs index 93e909c1cd..d59ff2cbca 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs @@ -77,13 +77,13 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal } int ammoConsumed = 20; - float SpeedX = velocity.X + (float)Main.rand.Next(-3, 4) * 0.05f; - float SpeedY = velocity.Y + (float)Main.rand.Next(-3, 4) * 0.05f; + float SpeedX = velocity.X + Main.rand.Next(-3, 4) * 0.05f; + float SpeedY = velocity.Y + Main.rand.Next(-3, 4) * 0.05f; if (player.altFunctionUse == 2) { ammoConsumed = 5; - SpeedX = velocity.X + (float)Main.rand.Next(-15, 16) * 0.05f; - SpeedY = velocity.Y + (float)Main.rand.Next(-15, 16) * 0.05f; + SpeedX = velocity.X + Main.rand.Next(-15, 16) * 0.05f; + SpeedY = velocity.Y + Main.rand.Next(-15, 16) * 0.05f; } Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 09b830060a..5f3d107100 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -227,6 +227,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas CalamityMod.StopRain(); bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; + bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive; bool death = CalamityWorld.death || CalamityWorld.bossRushActive; bool enraged = npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive); Vector2 vectorCenter = npc.Center; @@ -677,7 +678,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas { Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } - if (bulletHellCounter2 % 225 == 0 && expertMode) //giant homing fireballs + int divisor = revenge ? 225 : expertMode ? 450 : 675; + if (bulletHellCounter2 % divisor == 0 && expertMode) //giant homing fireballs { Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 1f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, passedVar); passedVar += 1f; diff --git a/Projectiles/DraedonsArsenal/GatlingLaserProj.cs b/Projectiles/DraedonsArsenal/GatlingLaserProj.cs index ff64a9d489..f466fd633b 100644 --- a/Projectiles/DraedonsArsenal/GatlingLaserProj.cs +++ b/Projectiles/DraedonsArsenal/GatlingLaserProj.cs @@ -109,8 +109,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal velocity2.Normalize(); velocity2 *= 5f; } - float SpeedX = velocity2.X + Main.rand.Next(-1, 2) * 0.01f; - float SpeedY = velocity2.Y + Main.rand.Next(-1, 2) * 0.01f; + float SpeedX = velocity2.X + Main.rand.Next(-1, 2) * 0.005f; + float SpeedY = velocity2.Y + Main.rand.Next(-1, 2) * 0.005f; float ai0 = projectile.ai[0] - 2f; // 0, 1, or 2 Projectile.NewProjectile(value2.X, value2.Y, SpeedX, SpeedY, type, weaponDamage2, projectile.knockBack, projectile.owner, ai0, 0f); } diff --git a/Projectiles/DraedonsArsenal/LaserRifleShot.cs b/Projectiles/DraedonsArsenal/LaserRifleShot.cs index b52dffebbf..a4e23a5fdf 100644 --- a/Projectiles/DraedonsArsenal/LaserRifleShot.cs +++ b/Projectiles/DraedonsArsenal/LaserRifleShot.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal for (int i = 0; i < 2; i++) { - int num41 = Dust.NewDust(projectile.Center, 0, 0, dust, 0f, 0f, 160, default, 2f); + int num41 = Dust.NewDust(projectile.Center, 0, 0, dust, 0f, 0f, 160, projectile.ai[0] == 0f ? default : new Color(255, 255, 0), 2f); Main.dust[num41].noGravity = true; Main.dust[num41].position = projectile.Center; Main.dust[num41].velocity = projectile.velocity; @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void Kill(int timeLeft) { - int height = 40; + int height = 60; projectile.position = projectile.Center; projectile.width = projectile.height = height; projectile.Center = projectile.position; @@ -74,8 +74,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal LaserBurst(2.4f, 4.2f); // 60 dusts - int num3; - for (int num640 = 0; num640 < 100; num640 = num3 + 1) + for (int num640 = 0; num640 < 100; num640++) { float num641 = 4f; @@ -96,8 +95,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal dust2.velocity.X = dust2.velocity.X + num644; dust2.velocity.Y = dust2.velocity.Y + num645; dust2.noGravity = true; - - num3 = num640; } } @@ -105,8 +102,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { float angleRandom = 0.05f; - int num3; - for (int num53 = 0; num53 < 20; num53 = num3 + 1) + for (int num53 = 0; num53 < 20; num53++) { float dustSpeed = Main.rand.NextFloat(speed1, speed2); Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(projectile.velocity.ToRotation()); @@ -132,10 +128,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Main.dust[num54].color = Color.Orange * 0.5f; dust2 = Main.dust[num54]; - - num3 = num53; } - for (int num55 = 0; num55 < 10; num55 = num3 + 1) + for (int num55 = 0; num55 < 10; num55++) { float dustSpeed = Main.rand.NextFloat(speed1, speed2); Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(projectile.velocity.ToRotation()); @@ -149,8 +143,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Dust dust2 = Main.dust[num56]; dust2.velocity *= 0.5f; dust2 = Main.dust[num56]; - - num3 = num55; } } } From d448e90d8c0328db360d296e4f9ec7f6faf6df5a Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 20 Jul 2020 14:37:42 -0400 Subject: [PATCH 143/160] fixed math death --- Projectiles/Summon/RadiantResolutionAura.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Summon/RadiantResolutionAura.cs b/Projectiles/Summon/RadiantResolutionAura.cs index 8a69544737..689d7c6820 100644 --- a/Projectiles/Summon/RadiantResolutionAura.cs +++ b/Projectiles/Summon/RadiantResolutionAura.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Summon projectile.rotation += MathHelper.ToRadians(3f) + MathHelper.ToRadians(allocatedSlots * 0.85f); int radiantOrbDamage = (int)(projectile.damage * (Math.Log(allocatedSlots, 2.5) + 1f)); - int radiantOrbAppearRate = (int)(130 * Math.Pow(0.8, allocatedSlots)); + int radiantOrbAppearRate = (int)(130 * Math.Pow(0.9, allocatedSlots)); if (radiantOrbAppearRate < 7) radiantOrbAppearRate = 7; From c549b9ecc324949f7da2ead2e4fec1c0a6f78d46 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Mon, 20 Jul 2020 14:02:01 -0500 Subject: [PATCH 144/160] 1 - Death Whistle spawns Ravager a bit higher above the player to avoid potential cheap hits. --- Items/SummonItems/AncientMedallion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/SummonItems/AncientMedallion.cs b/Items/SummonItems/AncientMedallion.cs index b92a0af850..9c8c86545e 100644 --- a/Items/SummonItems/AncientMedallion.cs +++ b/Items/SummonItems/AncientMedallion.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.SummonItems Main.PlaySound(SoundID.Roar, player.position, 2); if (Main.netMode != NetmodeID.MultiplayerClient) { - int npc = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-100, 101)), (int)(player.position.Y - 250f), ModContent.NPCType(), 1); + int npc = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-100, 101)), (int)(player.position.Y - 350f), ModContent.NPCType(), 1); Main.npc[npc].timeLeft *= 20; } else From 79f2045b6899fd18c4a889e7b987ea2c9a8acd7c Mon Sep 17 00:00:00 2001 From: Cameron Ewell Date: Mon, 20 Jul 2020 15:07:24 -0400 Subject: [PATCH 145/160] 1/3 is 1/3 --- Items/Weapons/Ranged/FirestormCannon.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/FirestormCannon.cs b/Items/Weapons/Ranged/FirestormCannon.cs index 81dc8eafab..858549f145 100644 --- a/Items/Weapons/Ranged/FirestormCannon.cs +++ b/Items/Weapons/Ranged/FirestormCannon.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override float UseTimeMultiplier (Player player) { if (player.altFunctionUse == 2) - return (9f/27f); + return 0.3333f; return 1f; } From f2fc44be192c157f3160869f0acf9a82b7cd0671 Mon Sep 17 00:00:00 2001 From: Cameron Ewell Date: Mon, 20 Jul 2020 15:07:44 -0400 Subject: [PATCH 146/160] Fraction reduction --- Items/Weapons/Ranged/Pumpler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/Pumpler.cs b/Items/Weapons/Ranged/Pumpler.cs index 5bad53be0c..021cd8b2a9 100644 --- a/Items/Weapons/Ranged/Pumpler.cs +++ b/Items/Weapons/Ranged/Pumpler.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override float UseTimeMultiplier (Player player) { if (player.altFunctionUse == 2) - return (10f/36f); + return (5f/18f); return 1f; } From 226932c27d9f4d81d4b6632d554b5460dfdb71aa Mon Sep 17 00:00:00 2001 From: Cameron Ewell Date: Mon, 20 Jul 2020 15:08:14 -0400 Subject: [PATCH 147/160] Fix giant clam if hardmode is deactivated for some reason --- NPCs/SunkenSea/GiantClam.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index c8e45cb028..ae08fbb541 100644 --- a/NPCs/SunkenSea/GiantClam.cs +++ b/NPCs/SunkenSea/GiantClam.cs @@ -427,7 +427,7 @@ namespace CalamityMod.NPCs.SunkenSea // Mark Giant Clam as dead CalamityWorld.downedCLAM = true; - CalamityWorld.downedCLAMHardMode = Main.hardMode; + CalamityWorld.downedCLAMHardMode = Main.hardMode || CalamityWorld.downedCLAMHardMode; CalamityMod.UpdateServerBoolean(); } } From 48ef42f3599c82ada800b4b7d317febdc6885a09 Mon Sep 17 00:00:00 2001 From: Cameron Ewell Date: Mon, 20 Jul 2020 15:08:49 -0400 Subject: [PATCH 148/160] radians good. degrees bad. --- Projectiles/Rogue/SupernovaBomb.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Rogue/SupernovaBomb.cs b/Projectiles/Rogue/SupernovaBomb.cs index 6ce3e64ba2..6d0552505d 100644 --- a/Projectiles/Rogue/SupernovaBomb.cs +++ b/Projectiles/Rogue/SupernovaBomb.cs @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Rogue Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.6), 0f, projectile.owner, 0f, 0f); } - float spread = 60f * 0.0174f; + float spread = MathHelper.Pi / 3f; double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; double deltaAngle = spread / 6f; double offsetAngle; From 1b6767667461c722c937c19663180fb022f32545 Mon Sep 17 00:00:00 2001 From: Cameron Ewell Date: Mon, 20 Jul 2020 15:09:24 -0400 Subject: [PATCH 149/160] Valediction projectile is now named Valediction --- Projectiles/Rogue/ValedictionBoomerang.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Rogue/ValedictionBoomerang.cs b/Projectiles/Rogue/ValedictionBoomerang.cs index 3196886e20..c4d6044ff8 100644 --- a/Projectiles/Rogue/ValedictionBoomerang.cs +++ b/Projectiles/Rogue/ValedictionBoomerang.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Rogue { public override void SetStaticDefaults() { - DisplayName.SetDefault("Scythe"); + DisplayName.SetDefault("Valediction"); ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; ProjectileID.Sets.TrailingMode[projectile.type] = 0; } From 606631fb93c74c9f5188c9881603f49419f17afb Mon Sep 17 00:00:00 2001 From: Cameron Ewell Date: Mon, 20 Jul 2020 15:10:17 -0400 Subject: [PATCH 150/160] Upgraded exo debuff utility comment --- Utilities/CalamityUtils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 100d30fbba..39e0c4e34b 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -541,7 +541,7 @@ namespace CalamityMod } } - /// Inflict typical exo weapon debuffs. This helps bypass the 5 debuff limit by checking if the NPC already has it. + /// Inflict typical exo weapon debuffs. Duration multiplier optional. /// /// The NPC attacked. /// Debuff time multiplier if needed. From 860f2f293b2ac9373d7ebd68b6bed8868f1f42b1 Mon Sep 17 00:00:00 2001 From: Cameron Ewell Date: Mon, 20 Jul 2020 15:10:39 -0400 Subject: [PATCH 151/160] Upgraded explosion cloud utility coment --- Utilities/CalamityUtils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 39e0c4e34b..e4d4a065e8 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -3652,7 +3652,7 @@ namespace CalamityMod public static int SecondsToFrames(float seconds) => (int)(seconds * 60); /// - /// Call this function in the Kill function of your npc to spawn cloud-like gores. + /// Call this function to spawn explosion clouds at the specified location. Good for when NPCs or projectiles die and need to explode. /// /// The spot to spawn the explosion clouds /// Number of times it loops to spawn gores From 1c5592cbfa3935d999ee222eda4b806ef746d90c Mon Sep 17 00:00:00 2001 From: Cameron Ewell Date: Mon, 20 Jul 2020 15:11:10 -0400 Subject: [PATCH 152/160] Revert minion anticlump to taxicab distance The performance reasons outweigh the mild inaccuracy. --- Utilities/CalamityUtils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index e4d4a065e8..a8e1b99208 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -1261,7 +1261,7 @@ namespace CalamityMod // If the other projectile is indeed the same owned by the same player and they're too close, nudge them away. bool sameProjType = otherProj.type == projectile.type; - float taxicabDist = Vector2.Distance(projectile.Center, otherProj.Center); + float taxicabDist = Math.Abs(projectile.position.X - otherProj.position.X) + Math.Abs(projectile.position.Y - otherProj.position.Y); if (sameProjType && taxicabDist < projectile.width) { if (projectile.position.X < otherProj.position.X) From 0e3b3eddf93c5b937b0e1870d4b3d71a4bd8961a Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 20 Jul 2020 15:25:54 -0400 Subject: [PATCH 153/160] fixed amalgam tooltip --- Items/Accessories/TheAmalgam.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Accessories/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index d6caba2720..945040cc4b 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Accessories if (line2.mod == "Terraria" && line2.Name == "Tooltip8") { line2.text = "You have a damaging aura that envenoms nearby enemies and increased movement in liquids\n" + - "Provides cold protection in Death Mode"; + "Provides heat protection in Death Mode"; } } } From 3835678424efd63e58defc182805b190ade4b97e Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 20 Jul 2020 15:27:57 -0400 Subject: [PATCH 154/160] renamed antumbra transpiercer to shard of antumbra --- Items/Weapons/Rogue/XerocPitchfork.cs | 2 +- ...forkProjectile.cs => AntumbraShardProjectile.cs} | 4 ++-- ...rkProjectile.png => AntumbraShardProjectile.png} | Bin 3 files changed, 3 insertions(+), 3 deletions(-) rename Projectiles/Rogue/{XerocPitchforkProjectile.cs => AntumbraShardProjectile.cs} (96%) rename Projectiles/Rogue/{XerocPitchforkProjectile.png => AntumbraShardProjectile.png} (100%) diff --git a/Items/Weapons/Rogue/XerocPitchfork.cs b/Items/Weapons/Rogue/XerocPitchfork.cs index 5f4ccf1ec6..fce13ec65d 100644 --- a/Items/Weapons/Rogue/XerocPitchfork.cs +++ b/Items/Weapons/Rogue/XerocPitchfork.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Rogue { public override void SetStaticDefaults() { - DisplayName.SetDefault("Antumbra Transpiercer"); + DisplayName.SetDefault("Shard of Antumbra"); Tooltip.SetDefault("Stealth strikes leave homing stars in their wake"); } diff --git a/Projectiles/Rogue/XerocPitchforkProjectile.cs b/Projectiles/Rogue/AntumbraShardProjectile.cs similarity index 96% rename from Projectiles/Rogue/XerocPitchforkProjectile.cs rename to Projectiles/Rogue/AntumbraShardProjectile.cs index 186fdcd827..fb9821e918 100644 --- a/Projectiles/Rogue/XerocPitchforkProjectile.cs +++ b/Projectiles/Rogue/AntumbraShardProjectile.cs @@ -8,11 +8,11 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class XerocPitchforkProjectile : ModProjectile + public class AntumbraShardProjectile : ModProjectile { public override void SetStaticDefaults() { - DisplayName.SetDefault("Antumbra Transpiercer"); + DisplayName.SetDefault("Antumbra Shard"); ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; ProjectileID.Sets.TrailingMode[projectile.type] = 0; } diff --git a/Projectiles/Rogue/XerocPitchforkProjectile.png b/Projectiles/Rogue/AntumbraShardProjectile.png similarity index 100% rename from Projectiles/Rogue/XerocPitchforkProjectile.png rename to Projectiles/Rogue/AntumbraShardProjectile.png From c2b4c27e73f4495c3238585ff9bedeb15c1137df Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 20 Jul 2020 15:33:52 -0400 Subject: [PATCH 155/160] rewrote alluring bait fishing code a bit --- CalPlayer/CalamityPlayerFishing.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CalPlayer/CalamityPlayerFishing.cs b/CalPlayer/CalamityPlayerFishing.cs index 50523224b6..f12735d387 100644 --- a/CalPlayer/CalamityPlayerFishing.cs +++ b/CalPlayer/CalamityPlayerFishing.cs @@ -480,11 +480,11 @@ namespace CalamityMod.CalPlayer } if (Main.rand.NextBool(25)) { - caughtType = ModContent.ItemType(); - } - if (Main.rand.NextBool(25)) - { - caughtType = ModContent.ItemType(); + caughtType = Utils.SelectRandom(Main.rand, new int[] + { + ModContent.ItemType(), + ModContent.ItemType() + }); } if (player.cratePotion && Main.rand.NextBool(5)) // 20% { From 3ee443b0b456cb3553b4109b1841123fb2b83f6d Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Mon, 20 Jul 2020 15:59:01 -0500 Subject: [PATCH 156/160] 1 - Anahita can no longer use her charging phase twice in a row. --- NPCs/Leviathan/Siren.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/NPCs/Leviathan/Siren.cs b/NPCs/Leviathan/Siren.cs index d12d062578..dccf2c7347 100644 --- a/NPCs/Leviathan/Siren.cs +++ b/NPCs/Leviathan/Siren.cs @@ -591,8 +591,9 @@ namespace CalamityMod.NPCs.Leviathan if (npc.ai[1] >= (revenge ? 45f : 60f)) { forceChargeFrames = true; - npc.ai[0] = npc.ai[2] >= ((leviAlive && !phase4) ? 2f : 3f) ? -1f : 4f; - npc.ai[1] = npc.ai[2] >= ((leviAlive && !phase4) ? 2f : 3f) ? 3f : 0f; + float aiInterval = (leviAlive && !phase4) ? 2f : 3f; + npc.ai[0] = (npc.ai[2] >= aiInterval) ? -1f : 4f; + npc.ai[1] = (npc.ai[2] >= aiInterval) ? 3f : 0f; npc.localAI[0] = 0f; // Velocity and rotation From 815a386315162cd8a59f90ea3519acdbd77fa80f Mon Sep 17 00:00:00 2001 From: DominicKarma42 <51094361+DominicKarma@users.noreply.github.com> Date: Mon, 20 Jul 2020 16:24:18 -0500 Subject: [PATCH 157/160] Andromeda is no longer a rogue projectile --- Projectiles/Summon/GiantIbanRobotOfDoom.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Projectiles/Summon/GiantIbanRobotOfDoom.cs b/Projectiles/Summon/GiantIbanRobotOfDoom.cs index 97bf416ef4..796598232d 100644 --- a/Projectiles/Summon/GiantIbanRobotOfDoom.cs +++ b/Projectiles/Summon/GiantIbanRobotOfDoom.cs @@ -68,7 +68,6 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft *= 5; projectile.tileCollide = false; projectile.alpha = 255; - projectile.Calamity().rogue = true; projectile.usesIDStaticNPCImmunity = true; projectile.idStaticNPCHitCooldown = 11; } From e5ae64bd09194e460cc642df26ed5ff1dfa843df Mon Sep 17 00:00:00 2001 From: Cameron Ewell Date: Mon, 20 Jul 2020 17:34:34 -0400 Subject: [PATCH 158/160] Fixed fishing drop rates of abyss accessories --- CalPlayer/CalamityPlayerFishing.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CalPlayer/CalamityPlayerFishing.cs b/CalPlayer/CalamityPlayerFishing.cs index f12735d387..d803b09b2d 100644 --- a/CalPlayer/CalamityPlayerFishing.cs +++ b/CalPlayer/CalamityPlayerFishing.cs @@ -478,7 +478,7 @@ namespace CalamityMod.CalPlayer { caughtType = ModContent.ItemType(); } - if (Main.rand.NextBool(25)) + if (Main.rand.NextFloat() < 0.08f) { caughtType = Utils.SelectRandom(Main.rand, new int[] { From f1d02f6bb463a34b3602be55d34b11b076860b7b Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Mon, 20 Jul 2020 17:37:36 -0400 Subject: [PATCH 159/160] Fixed Shard of Antumbra projectile class reference --- Items/Weapons/Rogue/XerocPitchfork.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/XerocPitchfork.cs b/Items/Weapons/Rogue/XerocPitchfork.cs index fce13ec65d..86bd16da89 100644 --- a/Items/Weapons/Rogue/XerocPitchfork.cs +++ b/Items/Weapons/Rogue/XerocPitchfork.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.maxStack = 999; item.value = 10000; item.rare = 9; - item.shoot = ModContent.ProjectileType(); + item.shoot = ModContent.ProjectileType(); item.shootSpeed = 16f; item.Calamity().rogue = true; } From b5751a2bdb0be1423b31ea8b38bfcab77899d250 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Mon, 20 Jul 2020 17:43:10 -0400 Subject: [PATCH 160/160] another Antumbra fix and an override compile error --- CalamityMod.cs | 2 +- Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index 5f39276b47..9ecaf7bd76 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -2128,7 +2128,7 @@ namespace CalamityMod ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), - ModContent.ProjectileType(), + ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType() }; diff --git a/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs b/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs index d6d3b5b8e5..b7535085c7 100644 --- a/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs +++ b/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs @@ -128,7 +128,7 @@ namespace CalamityMod.Projectiles.Rogue } } - public override void ModifyHitNPC(Projectile projectile, NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { if (projectile.ai[1] <= 40f && projectile.ai[0] != 1f) {