diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index 47037c8dbb..4ba927c1db 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -264,9 +264,12 @@ namespace CalamityMod.Balancing // 20% resist to Eclipse's Fall. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType(), ProjectileType())))); - // 20% resist to Yharim's Crystal + // 20% resist to Yharim's Crystal. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); + // 20% resist to Zenith. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.FinalFractal)))); + // 15% resist to Enforcer projectiles. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType())))); #endregion @@ -302,9 +305,6 @@ namespace CalamityMod.Balancing // 50% resist to Chicken Cannon. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); - // 50% resist to Prismatic Breaker. (why is this more than BOTH Rancor and Yharim's Crystal? jesus fuck this weapon seriously) - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); - // 50% resist to Tarragon Throwing Darts Thorns. (LOL) NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType(), ProjectileType())))); @@ -320,6 +320,9 @@ namespace CalamityMod.Balancing // 40% resist to Rancor. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType())))); + // 35% resist to Zenith. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.FinalFractal)))); + // 30% resist to the Spin Throw part of the Ark of the Cosmos' combo. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.7f, AotCThrowCombo)))); @@ -335,6 +338,9 @@ namespace CalamityMod.Balancing // 30% resist to Dragon Scales and The Wand's tornadoes NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType(), ProjectileType())))); + // 30% resist to Prismatic Breaker's laser beam. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + // 25% resist to Dragon Rage projectiles. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, DragonRageFilter)))); @@ -377,8 +383,8 @@ namespace CalamityMod.Balancing // 85% resist to Chicken Cannon. NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.15f, ProjectileType()))); - // 35% resist to Subsuming Vortex. - NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.65f, ProjectileType(), ProjectileType(), ProjectileType()))); + // 40% resist to Subsuming Vortex. + NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.6f, ProjectileType(), ProjectileType(), ProjectileType()))); // 30% resist to Murasama. NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.7f, ProjectileType()))); diff --git a/Buffs/Alcohol/BloodyMaryBuff.png b/Buffs/Alcohol/BloodyMaryBuff.png index bee4c0d4f1..04b959506c 100644 Binary files a/Buffs/Alcohol/BloodyMaryBuff.png and b/Buffs/Alcohol/BloodyMaryBuff.png differ diff --git a/Buffs/Alcohol/CaribbeanRumBuff.png b/Buffs/Alcohol/CaribbeanRumBuff.png index b6bd9fb903..c3e5464b05 100644 Binary files a/Buffs/Alcohol/CaribbeanRumBuff.png and b/Buffs/Alcohol/CaribbeanRumBuff.png differ diff --git a/Buffs/Alcohol/CinnamonRollBuff.png b/Buffs/Alcohol/CinnamonRollBuff.png index 2d2e710cd4..075531eacc 100644 Binary files a/Buffs/Alcohol/CinnamonRollBuff.png and b/Buffs/Alcohol/CinnamonRollBuff.png differ diff --git a/Buffs/Alcohol/EverclearBuff.png b/Buffs/Alcohol/EverclearBuff.png index a6f5af5315..fde2031fa3 100644 Binary files a/Buffs/Alcohol/EverclearBuff.png and b/Buffs/Alcohol/EverclearBuff.png differ diff --git a/Buffs/Alcohol/EvergreenGinBuff.png b/Buffs/Alcohol/EvergreenGinBuff.png index c7d719d065..5e41d87eb6 100644 Binary files a/Buffs/Alcohol/EvergreenGinBuff.png and b/Buffs/Alcohol/EvergreenGinBuff.png differ diff --git a/Buffs/Alcohol/FireballBuff.png b/Buffs/Alcohol/FireballBuff.png index 31c326dcfc..7ee9784312 100644 Binary files a/Buffs/Alcohol/FireballBuff.png and b/Buffs/Alcohol/FireballBuff.png differ diff --git a/Buffs/Alcohol/GrapeBeerBuff.png b/Buffs/Alcohol/GrapeBeerBuff.png index 37b192bf52..d951249d12 100644 Binary files a/Buffs/Alcohol/GrapeBeerBuff.png and b/Buffs/Alcohol/GrapeBeerBuff.png differ diff --git a/Buffs/Alcohol/MargaritaBuff.png b/Buffs/Alcohol/MargaritaBuff.png index 28c9daaea9..068aebf1e0 100644 Binary files a/Buffs/Alcohol/MargaritaBuff.png and b/Buffs/Alcohol/MargaritaBuff.png differ diff --git a/Buffs/Alcohol/MoonshineBuff.png b/Buffs/Alcohol/MoonshineBuff.png index 1655cd8ea4..b079231309 100644 Binary files a/Buffs/Alcohol/MoonshineBuff.png and b/Buffs/Alcohol/MoonshineBuff.png differ diff --git a/Buffs/Alcohol/MoscowMuleBuff.png b/Buffs/Alcohol/MoscowMuleBuff.png index 3339894ff2..969367e33f 100644 Binary files a/Buffs/Alcohol/MoscowMuleBuff.png and b/Buffs/Alcohol/MoscowMuleBuff.png differ diff --git a/Buffs/Alcohol/RedWineBuff.png b/Buffs/Alcohol/RedWineBuff.png index ed3caab2bf..a3e116c717 100644 Binary files a/Buffs/Alcohol/RedWineBuff.png and b/Buffs/Alcohol/RedWineBuff.png differ diff --git a/Buffs/Alcohol/RumBuff.png b/Buffs/Alcohol/RumBuff.png index ed16ae3277..29f7cd9fda 100644 Binary files a/Buffs/Alcohol/RumBuff.png and b/Buffs/Alcohol/RumBuff.png differ diff --git a/Buffs/Alcohol/ScrewdriverBuff.png b/Buffs/Alcohol/ScrewdriverBuff.png index f8eff84972..868d695c58 100644 Binary files a/Buffs/Alcohol/ScrewdriverBuff.png and b/Buffs/Alcohol/ScrewdriverBuff.png differ diff --git a/Buffs/Alcohol/StarBeamRyeBuff.png b/Buffs/Alcohol/StarBeamRyeBuff.png index 469bf8b6c8..e678986953 100644 Binary files a/Buffs/Alcohol/StarBeamRyeBuff.png and b/Buffs/Alcohol/StarBeamRyeBuff.png differ diff --git a/Buffs/Alcohol/TequilaBuff.png b/Buffs/Alcohol/TequilaBuff.png index e93e1d68f1..ca3a7b204e 100644 Binary files a/Buffs/Alcohol/TequilaBuff.png and b/Buffs/Alcohol/TequilaBuff.png differ diff --git a/Buffs/Alcohol/TequilaSunriseBuff.png b/Buffs/Alcohol/TequilaSunriseBuff.png index 10777fd43d..04c3901caf 100644 Binary files a/Buffs/Alcohol/TequilaSunriseBuff.png and b/Buffs/Alcohol/TequilaSunriseBuff.png differ diff --git a/Buffs/Alcohol/VodkaBuff.png b/Buffs/Alcohol/VodkaBuff.png index 47e680eede..b2c2eb1496 100644 Binary files a/Buffs/Alcohol/VodkaBuff.png and b/Buffs/Alcohol/VodkaBuff.png differ diff --git a/Buffs/Alcohol/WhiskeyBuff.png b/Buffs/Alcohol/WhiskeyBuff.png index 1c05b68602..56f2662420 100644 Binary files a/Buffs/Alcohol/WhiskeyBuff.png and b/Buffs/Alcohol/WhiskeyBuff.png differ diff --git a/Buffs/Alcohol/WhiteWineBuff.png b/Buffs/Alcohol/WhiteWineBuff.png index d294938dde..548844ed08 100644 Binary files a/Buffs/Alcohol/WhiteWineBuff.png and b/Buffs/Alcohol/WhiteWineBuff.png differ diff --git a/Buffs/Potions/WeaponImbueCrumbling.png b/Buffs/Potions/WeaponImbueCrumbling.png index 91c59e2816..3518e6bf34 100644 Binary files a/Buffs/Potions/WeaponImbueCrumbling.png and b/Buffs/Potions/WeaponImbueCrumbling.png differ diff --git a/Buffs/StatDebuffs/Crumbling.png b/Buffs/StatDebuffs/Crumbling.png index eacef7559f..b7ae6c8d3b 100644 Binary files a/Buffs/StatDebuffs/Crumbling.png and b/Buffs/StatDebuffs/Crumbling.png differ diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index c4a4bca9b0..99a0003650 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -373,7 +373,7 @@ namespace CalamityMod.CalPlayer public bool HasAnyEnergyShield => roverDrive || lunicCorpsSet || sponge; public bool freeDodgeFromShieldAbsorption = false; public bool drawnAnyShieldThisFrame = false; - + // TODO -- Some way to show the player their total shield points. public int TotalEnergyShielding => RoverDriveShieldDurability + LunicCorpsShieldDurability + SpongeShieldDurability; public int TotalMaxShieldDurability => (roverDrive ? RoverDrive.ShieldDurabilityMax : 0) + (lunicCorpsSet ? LunicCorpsHelmet.ShieldDurabilityMax : 0) + (sponge ? TheSponge.ShieldDurabilityMax : 0); @@ -470,8 +470,14 @@ namespace CalamityMod.CalPlayer public bool gShell = false; public bool tortShell = false; public bool absorber = false; + public bool alwaysHoneyRegen = false; + public bool honeyTurboRegen = false; + public bool honeyDewHalveDebuffs = false; + public bool livingDewHalveDebuffs = false; + public int jewelBonusDefense = 0; public bool aAmpoule = false; public bool rOoze = false; + public bool JustWasDebuffed = false; public bool fBarrier = false; public bool aBrain = false; public bool amalgam = false; @@ -517,8 +523,9 @@ namespace CalamityMod.CalPlayer public bool coreOfTheBloodGod = false; public bool elementalHeart = false; public bool crownJewel = false; - public bool celestialJewel = false; - public bool astralArcanum = false; + public bool infectedJewel = false; + public bool purity = false; + public int PurityHealSlowdownFrames = 0; public bool harpyRing = false; public bool angelTreads = false; public bool harpyWingBoost = false; //harpy wings + harpy ring @@ -812,6 +819,7 @@ namespace CalamityMod.CalPlayer public bool fishAlert = false; public bool clamity = false; public bool NOU = false; + public bool absorberAffliction = false; public bool sulphurPoison = false; public bool nightwither = false; public bool eutrophication = false; @@ -1079,7 +1087,6 @@ namespace CalamityMod.CalPlayer public bool witheringWeaponEnchant = false; public bool witheredDebuff = false; - public bool absorberAffliction = false; public int witheredWeaponHoldTime = 0; public int witheringDamageDone = 0; @@ -1572,6 +1579,10 @@ namespace CalamityMod.CalPlayer gShell = false; tortShell = false; absorber = false; + alwaysHoneyRegen = false; + honeyTurboRegen = false; + honeyDewHalveDebuffs = false; + livingDewHalveDebuffs = false; aAmpoule = false; rOoze = false; fBarrier = false; @@ -1609,8 +1620,8 @@ namespace CalamityMod.CalPlayer coreOfTheBloodGod = false; elementalHeart = false; crownJewel = false; - celestialJewel = false; - astralArcanum = false; + infectedJewel = false; + purity = false; harpyRing = false; angelTreads = false; harpyWingBoost = false; //harpy wings + harpy ring @@ -2243,6 +2254,7 @@ namespace CalamityMod.CalPlayer vaporfied = false; banishingFire = false; wither = false; + PurityHealSlowdownFrames = 0; #endregion #region Rogue @@ -2575,7 +2587,7 @@ namespace CalamityMod.CalPlayer { gSabatonHotkeyHoldTime = 0; } - + if (CalamityKeybinds.NormalityRelocatorHotKey.JustPressed && normalityRelocator && Main.myPlayer == Player.whoAmI) { if (!Player.CCed && !Player.chaosState) @@ -2882,25 +2894,7 @@ namespace CalamityMod.CalPlayer if (prismaticSet && !Player.HasCooldown(PrismaticLaser.ID) && prismaticLasers <= 0) prismaticLasers = CalamityUtils.SecondsToFrames(35f); } - if (CalamityKeybinds.AstralArcanumUIHotkey.JustPressed && astralArcanum && !areThereAnyDamnBosses) - { - AstralArcanumUI.Toggle(); - } - if (CalamityKeybinds.AstralTeleportHotKey.JustPressed) - { - if (celestialJewel && !areThereAnyDamnBosses) - { - if (Main.netMode == NetmodeID.SinglePlayer) - { - Player.TeleportationPotion(); - SoundEngine.PlaySound(SoundID.Item6, Player.Center); - } - else if (Main.netMode == NetmodeID.MultiplayerClient && Player.whoAmI == Main.myPlayer) - { - NetMessage.SendData(MessageID.RequestTeleportationByServer, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } - } + if (CalamityKeybinds.BlazingCoreHotKey.JustPressed) { if (blazingCore && blazingCoreParry == 0 && blazingCoreSuccessfulParry == 0) @@ -2964,7 +2958,7 @@ namespace CalamityMod.CalPlayer { float angle = MathHelper.TwoPi * i / skullCount; Vector2 initialVelocity = angle.ToRotationVector2().RotatedByRandom(MathHelper.ToRadians(12f)) * skullSpeed * new Vector2(0.82f, 1.5f) * - Main.rand.NextFloat(0.8f, 1.2f) * (i < skullCount / 2 ? 0.25f : 1f); + Main.rand.NextFloat(0.8f, 1.2f) * (i < skullCount / 2 ? 0.25f : 1f); int projectileIndex = Projectile.NewProjectile(source, Player.Center + initialVelocity * 3f, initialVelocity, ModContent.ProjectileType(), damage, 2f, Player.whoAmI); Main.projectile[projectileIndex].tileCollide = false; Main.projectile[projectileIndex].localAI[1] = (Main.projectile[projectileIndex].velocity.Y < 0f).ToInt(); @@ -3285,7 +3279,7 @@ namespace CalamityMod.CalPlayer //Life Jelly regen aura spawn when using a healing potion if (timePotionSick == 1 && Player.whoAmI == Main.myPlayer && lifejelly && !GrandGelatin) - Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0, Player.whoAmI); + Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0, Player.whoAmI); //Cleansing Jelly cleansing aura spawn when using a healing potion if (timePotionSick == 1 && Player.whoAmI == Main.myPlayer && cleansingjelly && !GrandGelatin) @@ -3351,7 +3345,7 @@ namespace CalamityMod.CalPlayer //While holding hotkey, but before slam, bring Y velocity closer to 0 if (gSabatonHotkeyHoldTime < 60 && gSabatonHotkeyHoldTime != 0 && !gSabatonFalling) { - Player.velocity.Y *= (60 - (gSabatonHotkeyHoldTime/4f))/60f; + Player.velocity.Y *= (60 - (gSabatonHotkeyHoldTime / 4f)) / 60f; } //Play sound a bit early so it goes in time with the fall if (gSabatonHotkeyHoldTime == 45 && !gSabatonFalling) @@ -3372,11 +3366,11 @@ namespace CalamityMod.CalPlayer if (gSabatonFalling) { SpawnGravistarParticle(); - + //Cap time converted to damage at 2 seconds if (gSabatonFall < 120) gSabatonFall++; - + Player.maxFallSpeed = 40f; Player.gravity = 1.3f; //If the player can fly during the fall, the physics gets a bit funky @@ -3394,7 +3388,7 @@ namespace CalamityMod.CalPlayer gSabatonTempJumpSpeed = 40; } } - + } } #endregion @@ -3405,7 +3399,7 @@ namespace CalamityMod.CalPlayer //Infinite flight granted by some boss attacks if (infiniteFlight) Player.wingTime = Player.wingTimeMax; - + // Reset the Calamity shader. CalamityFireDyeShader = null; @@ -3774,7 +3768,7 @@ namespace CalamityMod.CalPlayer if (Main.rand.NextBool(20)) { int confettiDust = Main.rand.Next(139, 143); - int confetti = Dust.NewDust(new Vector2(hitbox.X,hitbox.Y), hitbox.Width, hitbox.Height, confettiDust, Player.velocity.X, Player.velocity.Y, 0, new Color(), 1.2f); + int confetti = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, confettiDust, Player.velocity.X, Player.velocity.Y, 0, new Color(), 1.2f); Main.dust[confetti].velocity.X *= (float)(1.0 + Main.rand.Next(-50, 51) * 0.01); Main.dust[confetti].velocity.Y *= (float)(1.0 + Main.rand.Next(-50, 51) * 0.01); Main.dust[confetti].velocity.X += Main.rand.Next(-50, 51) * 0.05f; @@ -3915,7 +3909,7 @@ namespace CalamityMod.CalPlayer } } #endregion - + #region Shoot public override bool Shoot(Item item, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockBack) { @@ -3926,60 +3920,66 @@ namespace CalamityMod.CalPlayer { if (item.CountsAsClass()) { - 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 + if (!CalamityLists.VeneratedLocketBanlist.Contains(item.type)) { + 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(source, vector2.X, vector2.Y, speedX4, speedY5, type, (int)(damage * 0.07), knockBack * 0.5f, Player.whoAmI); - 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(source, vector2.X, vector2.Y, speedX4, speedY5, type, (int)(damage * 0.075), knockBack * 0.5f, Player.whoAmI); + if (p.WithinBounds(Main.maxProjectiles)) + { + Main.projectile[p].DamageType = DamageClass.Generic; //Makes it not proc shit like nanotech, extorter and other stuff + Main.projectile[p].Calamity().LocketClone = true; //To not have clones trigger effects like Sacrifice's Lifesteal and Final Dawn's stealth generation + } - if (p.WithinBounds(Main.maxProjectiles)) - Main.projectile[p].DamageType = DamageClass.Generic; //in case melee/rogue variants bug out - - // Handle AI edge-cases. - if (item.type == ModContent.ItemType()) - Main.projectile[p].ai[1] = 1f; - if (item.type == ModContent.ItemType()) - Main.projectile[p].ai[0] = -1f; + // Handle AI edge-cases. These are like overlapping projectiles and the projectile not spawning at all + if (item.type == ModContent.ItemType()) + Main.projectile[p].ai[1] = 1f; //MUST BE 1 OTHERWISE CLONES GENERATE STEALTH AAAAAAAAAAA + if (item.type == ModContent.ItemType()) + Main.projectile[p].ai[0] = -1f; + } if (StealthStrikeAvailable()) { - int knifeCount = 16; - int knifeDamage = (int)Player.GetTotalDamage().ApplyTo(60); + int knifeCount = 12; + int knifeDamage = (int)Player.GetTotalDamage().ApplyTo(70); float angleStep = MathHelper.TwoPi / knifeCount; float speed = 15f; @@ -4063,7 +4063,7 @@ namespace CalamityMod.CalPlayer } else if (AresExoskeleton.ArmExists(Player)) Player.body = EquipLoader.GetEquipSlot(Mod, "AresExoskeleton", EquipType.Body); - + else if ((abyssalDivingSuitPower || abyssalDivingSuitForce) && !abyssalDivingSuitHide) { Player.legs = EquipLoader.GetEquipSlot(Mod, "AbyssalDivingSuit", EquipType.Legs); @@ -4663,7 +4663,7 @@ namespace CalamityMod.CalPlayer break; if (Main.projectile[i].owner == Player.whoAmI && Main.projectile[i].friendly) { - bool attack = Main.projectile[i].owner == Player.whoAmI && Main.projectile[i].type == ModContent.ProjectileType(); + bool attack = Main.projectile[i].owner == Player.whoAmI && Main.projectile[i].type == ModContent.ProjectileType(); bool defense = Main.projectile[i].owner == Player.whoAmI && Main.projectile[i].type == ModContent.ProjectileType(); if (attack || defense) { diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 106de27fb0..3fc7d17598 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -746,7 +746,7 @@ namespace CalamityMod.CalPlayer } // Can't have any cooldowns here because dodges grrrrr.... - if (fleshTotem && !Player.HasCooldown(Cooldowns.FleshTotem.ID)) + if (fleshTotem && !Player.HasCooldown(Cooldowns.FleshTotem.ID) && TotalEnergyShielding <= 0) contactDamageReduction += 0.5; if (tarragonCloak && tarraMelee && !Player.HasCooldown(Cooldowns.TarragonCloak.ID)) @@ -1157,20 +1157,20 @@ namespace CalamityMod.CalPlayer // As such, to avoid cooldowns proccing from dodge hits, do it here if (fleshTotem && !Player.HasCooldown(Cooldowns.FleshTotem.ID) && hurtInfo.Damage > 0) Player.AddCooldown(Cooldowns.FleshTotem.ID, CalamityUtils.SecondsToFrames(20), true, coreOfTheBloodGod ? "bloodgod" : "default"); + if (NPC.AnyNPCs(ModContent.NPCType())) - { Player.AddBuff(ModContent.BuffType(), 15, true); - } + if (crawCarapace) { - npc.AddBuff(ModContent.BuffType(), 720); + npc.AddBuff(ModContent.BuffType(), 900); SoundEngine.PlaySound(SoundID.NPCHit33 with { Volume = 0.5f }, Player.Center); } if (baroclaw) { - npc.AddBuff(ModContent.BuffType(), 1800); - npc.AddBuff(ModContent.BuffType(), 1800); + npc.AddBuff(ModContent.BuffType(), 900); + npc.AddBuff(ModContent.BuffType(), 900); SoundEngine.PlaySound(BaroclawHit, Player.Center); Vector2 bloodSpawnPosition = Player.Center + Main.rand.NextVector2Circular(Player.width, Player.height) * 0.04f; Vector2 splatterDirection = (Player.Center - bloodSpawnPosition).SafeNormalize(Vector2.UnitY); @@ -1189,7 +1189,7 @@ namespace CalamityMod.CalPlayer if (absorber) { - npc.AddBuff(ModContent.BuffType(), 1800); + npc.AddBuff(ModContent.BuffType(), 900); SoundEngine.PlaySound(AbsorberHit, Player.Center); Vector2 bloodSpawnPosition = Player.Center + Main.rand.NextVector2Circular(Player.width, Player.height) * 0.04f; Vector2 splatterDirection = (Player.Center - bloodSpawnPosition).SafeNormalize(Vector2.UnitY); @@ -1629,9 +1629,10 @@ namespace CalamityMod.CalPlayer private void ModifyHurtInfo_Calamity(ref Player.HurtInfo info) { // Boss Rush's damage floor is implemented as a dirty modifier + // TODO -- implementing this correctly would require fully reimplementing all of DR and ADR if (BossRushEvent.BossRushActive) { - int bossRushDamageFloor = (Main.expertMode ? 400 : 240) + (BossRushEvent.BossRushStage * 2); + int bossRushDamageFloor = (Main.expertMode ? 160 : 100) + (BossRushEvent.BossRushStage * 2); if (info.Damage < bossRushDamageFloor) info.Damage += (bossRushDamageFloor - info.Damage); } diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index d358a1c42f..b904ffeb75 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -1,18 +1,19 @@ -using CalamityMod.Items.Accessories; +using System; +using System.Linq; using CalamityMod.Buffs.Alcohol; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Cooldowns; -using CalamityMod.Events; +using CalamityMod.Items.Accessories; using CalamityMod.NPCs; using CalamityMod.Projectiles.Ranged; +using CalamityMod.Systems; using CalamityMod.World; using Microsoft.Xna.Framework; -using System; using Terraria; -using Terraria.ModLoader; using Terraria.DataStructures; -using CalamityMod.Systems; -using System.Linq; +using Terraria.GameContent.ItemDropRules; +using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.CalPlayer { @@ -24,141 +25,94 @@ namespace CalamityMod.CalPlayer if (Player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) noLifeRegen = true; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - double lifeRegenMult = death ? 1.5 : 1D; - if (reaverDefense) - lifeRegenMult *= 0.8; - int lifeRegenLost = 0; + // Universal +50% increase to DoT debuff damage in Death Mode + float deathNegativeRegenBonus = 0.5f; + float calamityDebuffMultiplier = 1f + (CalamityWorld.death ? deathNegativeRegenBonus : 0f); - // Initial Debuffs + // Cumulative amount of DoT debuff negative life regen from Calamity debuffs (or changes to vanilla debuffs) + float totalNegativeLifeRegen = 0; - // Get fucked, Nebula Armor - Player.nebulaLevelLife = 0; + #region Damage over Time Debuffs (Negative Life Regen) - // Vanilla - if (death) + // Vanilla debuffs (+50% damage over time in Death Mode is applied here) + if (CalamityWorld.death) { - if (Player.poisoned) - lifeRegenLost += 4; + int totalVanillaDoT = 0; - if (Player.onFire) - lifeRegenLost += 8; + if (Player.poisoned && !purity) + totalVanillaDoT += 4; + + if (Player.onFire && !purity) + totalVanillaDoT += 8; if (Player.tongued) - lifeRegenLost += 100; + totalVanillaDoT += 100; - if (Player.venom) - lifeRegenLost += 12; + if (Player.venom && !purity) + totalVanillaDoT += 12; - if (Player.onFrostBurn) - lifeRegenLost += 12; + if (Player.onFrostBurn && !purity) + totalVanillaDoT += 12; - if (Player.onFire2) - lifeRegenLost += 12; + if (Player.onFire2 && !purity) + totalVanillaDoT += 12; if (Player.burned) - lifeRegenLost += 60; + totalVanillaDoT += 60; if (Player.suffocating) - lifeRegenLost += 40; + totalVanillaDoT += 40; - if (Player.electrified) + if (Player.electrified && !purity) { - lifeRegenLost += 8; + totalVanillaDoT += 8; if (Player.controlLeft || Player.controlRight) - lifeRegenLost += 32; + totalVanillaDoT += 32; } + + // Tally up total current vanilla DoT so it can be added as extra DoT from Death Mode + totalNegativeLifeRegen += totalVanillaDoT * deathNegativeRegenBonus; } - // Calamity - if (shadowflame) + // + // Calamity debuffs (Vanilla Shadowflame is added here) + // + void ApplyDoTDebuff(bool hasDebuff, int negativeLifeRegenToApply, bool immuneCondition = false) { + if (!hasDebuff || immuneCondition) + return; + if (Player.lifeRegen > 0) Player.lifeRegen = 0; Player.lifeRegenTime = 0; - lifeRegenLost += 30; + totalNegativeLifeRegen += negativeLifeRegenToApply * calamityDebuffMultiplier; } - if (wDeath) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; + // Whispering Death sets positive regen to zero but doesn't actually deal any damage + ApplyDoTDebuff(wDeath, 0); - Player.lifeRegenTime = 0; - } - - if (weakBrimstoneFlames) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 7; - } - - if (bFlames) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 16; - } - - if (nightwither) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 16; - } - - if (vaporfied) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 8; - } - - if (cragsLava) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 30; - } - - if (gsInferno) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += profanedCrystalBuffs ? 35 : 30; - } - - if (astralInfection) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 20; - } - - if (irradiated) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 4; - } + ApplyDoTDebuff(irradiated, 4, purity); + int sulphurDoT = 6 - (sulfurSet ? 2 : 0) - (sulphurskin ? 2 : 0); + ApplyDoTDebuff(sulphurPoison, sulphurDoT, purity); + ApplyDoTDebuff(rTide, 6, purity); + ApplyDoTDebuff(weakBrimstoneFlames, 7); + ApplyDoTDebuff(bBlood, 8, purity); + ApplyDoTDebuff(vaporfied, 8, purity); + ApplyDoTDebuff(bFlames, 16, purity); + ApplyDoTDebuff(nightwither, 16, purity); + ApplyDoTDebuff(hFlames, 16, purity); + ApplyDoTDebuff(vHex, 16); + ApplyDoTDebuff(cDepth, 18, purity); + ApplyDoTDebuff(astralInfection, 20, infectedJewel || purity); + ApplyDoTDebuff(pFlames, 20, purity); + ApplyDoTDebuff(cragsLava, 30); + ApplyDoTDebuff(shadowflame, 30, purity); + // Profaned Soul Crystal turns you into Providence, a God, and you take more damage from God Slayer Inferno + ApplyDoTDebuff(gsInferno, profanedCrystalBuffs ? 35 : 30); + ApplyDoTDebuff(dragonFire, 36); + ApplyDoTDebuff(miracleBlight, 40); + ApplyDoTDebuff(banishingFire, 60); // Slowly increase the sulphuric water poisoning effect. Once it's high enough, the player starts taking damage over time. bool nearSafeZone = false; @@ -199,116 +153,20 @@ namespace CalamityMod.CalPlayer } else SulphWaterPoisoningLevel = MathHelper.Clamp(SulphWaterPoisoningLevel - 1f / SulphSeaWaterRecoveryTime, 0f, 1f); + #endregion - if (sulphurPoison) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 6; - if (sulfurSet) - { - lifeRegenLost -= 2; - } - if (sulphurskin) - { - lifeRegenLost -= 2; - } - } - - if (hFlames) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 16; - } - - if (banishingFire) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 60; - } - - if (pFlames) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 20; - } - - if (bBlood) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 8; - } - - if (vHex) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 16; - } - - if (dragonFire) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 36; - } - - if (miracleBlight) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 40; - } - - if (cDepth) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 18; - } - - if (rTide) - { - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += 6; - } - + #region Alcohol if (vodka) { alcoholPoisonLevel++; - lifeRegenLost += 1; + totalNegativeLifeRegen += 1; } if (redWine) { alcoholPoisonLevel++; - lifeRegenLost += 1; + totalNegativeLifeRegen += 1; if (baguette) - lifeRegenLost += 3; + totalNegativeLifeRegen += 3; } if (grapeBeer) { @@ -317,7 +175,7 @@ namespace CalamityMod.CalPlayer if (moonshine) { alcoholPoisonLevel++; - lifeRegenLost += 1; + totalNegativeLifeRegen += 1; } if (rum) { @@ -330,7 +188,7 @@ namespace CalamityMod.CalPlayer if (fireball) { alcoholPoisonLevel++; - lifeRegenLost += 1; + totalNegativeLifeRegen += 1; } if (whiskey) { @@ -339,27 +197,27 @@ namespace CalamityMod.CalPlayer if (everclear) { alcoholPoisonLevel += 2; - lifeRegenLost += 10; + totalNegativeLifeRegen += 10; } if (bloodyMary) { alcoholPoisonLevel++; - lifeRegenLost += 4; + totalNegativeLifeRegen += 4; } if (tequila) { alcoholPoisonLevel++; - lifeRegenLost += 1; + totalNegativeLifeRegen += 1; } if (tequilaSunrise) { alcoholPoisonLevel++; - lifeRegenLost += 2; + totalNegativeLifeRegen += 2; } if (screwdriver) { alcoholPoisonLevel++; - lifeRegenLost += 1; + totalNegativeLifeRegen += 1; } if (caribbeanRum) { @@ -372,27 +230,27 @@ namespace CalamityMod.CalPlayer if (margarita) { alcoholPoisonLevel++; - lifeRegenLost += 1; + totalNegativeLifeRegen += 1; } if (starBeamRye) { alcoholPoisonLevel++; - lifeRegenLost += 2; + totalNegativeLifeRegen += 2; } if (moscowMule) { alcoholPoisonLevel++; - lifeRegenLost += 4; + totalNegativeLifeRegen += 4; } if (whiteWine) { alcoholPoisonLevel++; - lifeRegenLost += 1; + totalNegativeLifeRegen += 1; } if (evergreenGin) { alcoholPoisonLevel++; - lifeRegenLost += 1; + totalNegativeLifeRegen += 1; } if (Player.tipsy) { @@ -410,14 +268,16 @@ namespace CalamityMod.CalPlayer Player.lifeRegen = 0; Player.lifeRegenTime = 0; - lifeRegenLost += 3 * alcoholPoisonLevel; + totalNegativeLifeRegen += 3 * alcoholPoisonLevel; } + #endregion if (manaOverloader) { if (Player.statMana > (int)(Player.statManaMax2 * 0.5)) - lifeRegenLost += 3; + totalNegativeLifeRegen += 3; } + if (brimflameFrenzy) { Player.manaRegen = 0; @@ -425,7 +285,7 @@ namespace CalamityMod.CalPlayer Player.manaRegenDelay = (int) Player.maxRegenDelay; if (Player.lifeRegen > 0) Player.lifeRegen = 0; - lifeRegenLost += 42; //the meaning of death + totalNegativeLifeRegen += 42; //the meaning of death } if (witheredDebuff) @@ -437,7 +297,7 @@ namespace CalamityMod.CalPlayer } else { - lifeRegenLost += (int)(5D * Math.Pow(1.5D, witheredWeaponHoldTime / 87D)); + totalNegativeLifeRegen += (int)(5D * Math.Pow(1.5D, witheredWeaponHoldTime / 87D)); if (Player.lifeRegen > 0) Player.lifeRegen = 0; } @@ -450,14 +310,62 @@ namespace CalamityMod.CalPlayer int debuffIndex = Player.FindBuffIndex(ModContent.BuffType()); float debuffIntensity = debuffIndex == -1 ? 0f : Player.buffTime[debuffIndex] / (float)Player.manaSickTimeMax; - lifeRegenLost += (int)(Math.Sqrt(debuffIntensity) * Math.Pow(6D, debuffIntensity + 1f)); + totalNegativeLifeRegen += (int)(Math.Sqrt(debuffIntensity) * Math.Pow(6D, debuffIntensity + 1f)); if (Player.lifeRegen > 0) Player.lifeRegen = 0; } - Player.lifeRegen -= (int)(lifeRegenLost * lifeRegenMult); + // + // ACTUALLY APPLY NEGATIVE LIFE REGEN + // - // Buffs + // At the last second, Reaver defense helm reduces DoT debuffs by 20% + if (reaverDefense) + totalNegativeLifeRegen = (int)(0.8f * totalNegativeLifeRegen); + + Player.lifeRegen -= (int)totalNegativeLifeRegen; + + #region Life Regen That Works Even During DoT Debuffs + + // Honey Dew (and upgrades) + if (alwaysHoneyRegen) + { + // Exact copy of vanilla Honey behavior, but does not stack with actually standing in Honey + if (!Player.honey) + { + Player.lifeRegen += 2; + Player.lifeRegenTime += 1; + + // Grants +2 life regen if negative life regen would otherwise occur. + // However, this can't bring regen into the positives. + if (Player.lifeRegen < 0) + { + Player.lifeRegen += 2; + if (Player.lifeRegen > 0) + Player.lifeRegen = 0; + } + } + } + + if (honeyDewHalveDebuffs) + { + // Tick down all sickness debuffs; this makes them expire 2x faster + // Upgrades increase the sets of debuffs which expire faster + for (int l = 0; l < Player.MaxBuffs; ++l) + { + int buffID = Player.buffType[l]; + if (Player.buffTime[l] <= 2) + continue; + bool shouldHalveDuration = CalamityLists.sicknessDebuffList.Contains(buffID); + if (livingDewHalveDebuffs) + shouldHalveDuration |= CalamityLists.fireDebuffList.Contains(buffID); + if (purity) + shouldHalveDuration |= CalamityLists.debuffList.Contains(buffID); + + if (shouldHalveDuration) + --Player.buffTime[l]; + } + } if (divineBless) { @@ -496,76 +404,136 @@ namespace CalamityMod.CalPlayer } // Permafrost's Concoction increases life regen while afflicted with a fire debuff - if (permafrostsConcoction) + if (permafrostsConcoction && Player.buffType.Any(CalamityLists.fireDebuffList.Contains)) { - if (Player.onFire || Player.onFire2 || Player.onFire3 || Player.burned || shadowflame || weakBrimstoneFlames || bFlames || cragsLava || gsInferno || hFlames || banishingFire || dragonFire) + if (Player.lifeRegenTime < 1800) + Player.lifeRegenTime = 1800; + + Player.lifeRegen += 6; + } + + // Grant life regen based on missing health for Radiant Ooze, Ambrosial Ampule, and purity + if (rOoze || aAmpoule || purity) + { + float missingLifeRatio = (Player.statLifeMax2 - Player.statLife) / Player.statLifeMax2; + //Ambrosial Ampule and ooze give between 2 and 6 hp/s, Purity gives between 3 and 7 hp/s + float lifeRegenToGive = MathHelper.Lerp( purity ? 6f : 4f, purity ? 14f : 12f, missingLifeRatio); + Player.lifeRegen += (int)lifeRegenToGive; + } + + if (purity) + { + int intendedPurityDefense = 0; + int currentDebuffs = Player.buffType.Count(CalamityLists.debuffList.Contains); + if (currentDebuffs > 0) { + // Healing rate is normally 5 HP/s (+1 every 12 frames) + // However, that 12 frames can and will slowly increase if you try to abuse this accessory + int healFrameCadence = 12; + + // Healing slows down after 5 seconds (300 frames) debuffed. For every 15 frames thereafter the cadence slows + // There is no upper limit to how slow it can get and it can take a very long time to reset to normal + int punishmentFrames = PurityHealSlowdownFrames - 300; + //lowest punishment is three full seconds between the one health heal + if (healFrameCadence < 180) + healFrameCadence += (punishmentFrames < 0) ? 0 : punishmentFrames / 15; + + if (Player.miscCounter % healFrameCadence == healFrameCadence - 1) + Player.Heal(1); + if (Player.lifeRegenTime < 1800) Player.lifeRegenTime = 1800; - Player.lifeRegen += 6; + intendedPurityDefense = 20 + (currentDebuffs - 1) * 8; + if (jewelBonusDefense < intendedPurityDefense) + jewelBonusDefense = intendedPurityDefense; + + // Count up total frames spent healing for slowdown. + ++PurityHealSlowdownFrames; } + + // If the defense should be ticking down to some lower value, do that. + // Purity loses 1 point of defense every second. + if (Player.miscCounter % 60 == 0 && jewelBonusDefense > intendedPurityDefense) + --jewelBonusDefense; + + // If the player is clear of all debuffs then gradually reduce the slowdown frames + if (currentDebuffs <= 0) + { + --PurityHealSlowdownFrames; + if (PurityHealSlowdownFrames < 0) + PurityHealSlowdownFrames = 0; + } + + // Actually apply defense bonus + Player.statDefense += jewelBonusDefense; } - if (celestialJewel || astralArcanum) + // Infected Jewel does not stack with Purity + else if (infectedJewel) { - bool lesserEffect = false; - for (int l = 0; l < Player.MaxBuffs; l++) + Player.lifeRegen += 2; + + // If the player has any debuffs, give the extra life regen and defense + // More defense is given for each additional debuff + int intendedJewelDefense = 0; + int currentDebuffs = Player.buffType.Count(CalamityLists.debuffList.Contains); + if (currentDebuffs > 0) { - int hasBuff = Player.buffType[l]; - lesserEffect = CalamityLists.alcoholList.Contains(hasBuff); + Player.lifeRegen += 4; + if (Player.lifeRegenTime < 1800) + Player.lifeRegenTime = 1800; + + intendedJewelDefense = 16 + (currentDebuffs - 1) * 5; + if (jewelBonusDefense < intendedJewelDefense) + jewelBonusDefense = intendedJewelDefense; } - int defenseBoost = astralArcanum ? 15 : 11; - if (lesserEffect) - { - Player.lifeRegen += astralArcanum ? 2 : 1; - Player.statDefense += defenseBoost; - } - else - { - if (Player.lifeRegen < 0) - { - if (Player.lifeRegenTime < 1800) - Player.lifeRegenTime = 1800; + // If the defense should be ticking down to some lower value, do that. + // Infected Jewel loses 1 point of defense every 20 frames. + if (Player.miscCounter % 60 == 0 && jewelBonusDefense > intendedJewelDefense) + --jewelBonusDefense; - Player.lifeRegen += astralArcanum ? 6 : 4; - Player.statDefense += defenseBoost; - } - else - Player.lifeRegen += astralArcanum ? 3 : 2; - } + // Actually apply defense bonus + Player.statDefense += jewelBonusDefense; } + + // Crown Jewel does not stack with Purity or Infected Jewel else if (crownJewel) { - bool lesserEffect = false; - for (int l = 0; l < Player.MaxBuffs; l++) - { - int hasBuff = Player.buffType[l]; - lesserEffect = CalamityLists.alcoholList.Contains(hasBuff); - } + Player.lifeRegen += 2; - if (lesserEffect) - Player.statDefense += 8; - else + // If any debuff is detected, provide even more life regen and massively accelerate it + if (Player.buffType.Any(CalamityLists.debuffList.Contains)) { - if (Player.lifeRegen < 0) - { - if (Player.lifeRegenTime < 1800) - Player.lifeRegenTime = 1800; - - Player.lifeRegen += 4; - Player.statDefense += 8; - } - else - Player.lifeRegen += 2; + Player.lifeRegen += 3; + if (Player.lifeRegenTime < 1800) + Player.lifeRegenTime = 1800; } } + #endregion - // Last Debuffs + // During Silva revive or God Slayer dash, all negative life regen is canceled + if ((silvaCountdown > 0 && hasSilvaEffect && silvaSet) || (DashID == GodSlayerDash.ID && Player.dashDelay < 0)) + { + if (Player.lifeRegen < 0) + Player.lifeRegen = 0; + } + + #region Things That Disable Even That Life Regen + // + // Yes, really, there's a list of conditions under which life regen doesn't work + // even if it's life regen that normally works during a damage over time debuff. + // + // 1. No life regen bool (Blood Boiler usage or wearing Omega Blue armor) + // 2. Being too far from Providence cocoon ("Holy Inferno") + // 3. Air drowning in the Abyss + // if (noLifeRegen) { + Player.nebulaLevelLife = 0; + if (Player.lifeRegen > 0) Player.lifeRegen = 0; @@ -585,7 +553,7 @@ namespace CalamityMod.CalPlayer Player.lifeRegen = 0; Player.lifeRegenTime = 0; - Player.lifeRegen -= (int)(hInfernoBoost * lifeRegenMult); + Player.lifeRegen -= (int)(hInfernoBoost * calamityDebuffMultiplier); if (Player.lifeRegen < -200) Player.lifeRegen = -200; @@ -605,22 +573,18 @@ namespace CalamityMod.CalPlayer Player.lifeRegen = 0; Player.lifeRegenTime = 0; - Player.lifeRegen -= (int)(160D * lifeRegenMult); + Player.lifeRegen -= (int)(160D * calamityDebuffMultiplier); } } } + // TODO -- Why is this here? if (weakPetrification) { if (Player.mount.Active) Player.mount.Dismount(Player); } - - if ((silvaCountdown > 0 && hasSilvaEffect && silvaSet) || (DashID == GodSlayerDash.ID && Player.dashDelay < 0)) - { - if (Player.lifeRegen < 0) - Player.lifeRegen = 0; - } + #endregion } #endregion @@ -673,9 +637,6 @@ namespace CalamityMod.CalPlayer if (trinketOfChi || chiRegen) Player.lifeRegen += 2; - if (rOoze) - Player.lifeRegen += 4; - if (ursaSergeant) { @@ -810,101 +771,55 @@ namespace CalamityMod.CalPlayer Player.lifeRegenTime += (int)MathHelper.Lerp(1f, 3f, regenBenefitFactor); } - // Standing still healing bonuses (all exclusive with vanilla Shiny Stone) - if (!Player.shinyStone) - { - int lifeRegenTimeMaxBoost = areThereAnyDamnBosses ? 450 : 1800; - int lifeRegenMaxBoost = areThereAnyDamnBosses ? 1 : 4; - float lifeRegenLifeRegenTimeMaxBoost = areThereAnyDamnBosses ? 8f : 30f; + #region Standing Still Life Regen + // Standing still healing bonuses (all are exclusive with vanilla Shiny Stone, but all function similarly) + if (!Player.shinyStone && Player.StandingStill() && Player.velocity.Y == 0 && Player.itemAnimation == 0) + { + bool honeyDewWorking = honeyTurboRegen && Player.honeyWet; + bool anyStandingStillLifeRegen = shadeRegen || cFreeze || honeyDewWorking || photosynthesis || aAmpoule || purity; + bool onlyPhotosynthesisAtNight = !shadeRegen && !cFreeze && !honeyDewWorking && photosynthesis && !Main.dayTime; - if (Player.StandingStill() && Player.itemAnimation == 0) + // Divides all negative life regen by two before applying any other effects. + if (anyStandingStillLifeRegen && Player.lifeRegen < 0) + Player.lifeRegen /= 2; + + // Spawn dust of some flavor while actually regenerating, aAmpule and purity have a slightly different looking style + if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife) { - bool boostedRegen = false; - bool noSunlight = false; - if (shadeRegen) + int dustType = shadeRegen ? 173 : cFreeze ? 67 : honeyDewWorking ? DustID.Honey2 : photosynthesis ? 244 : aAmpoule ? 228 : purity ? 187 : -1; + bool dustSpawnRolled = Main.rand.Next(30000) < Player.lifeRegenTime || purity ? Main.rand.NextBool(2) : aAmpoule ? Main.rand.NextBool(4) : Main.rand.NextBool(30); + if (dustType != -1 && dustSpawnRolled) { - boostedRegen = true; - if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife) - { - if (Main.rand.Next(30000) < Player.lifeRegenTime || Main.rand.NextBool(30)) - { - int regen = Dust.NewDust(Player.position, Player.width, Player.height, 173, 0f, 0f, 200, default, 1f); - Main.dust[regen].noGravity = true; - Main.dust[regen].fadeIn = 1.3f; - Vector2 velocity = CalamityUtils.RandomVelocity(100f, 50f, 100f, 0.04f); - Main.dust[regen].velocity = velocity; - velocity.Normalize(); - velocity *= 34f; - Main.dust[regen].position = Player.Center - velocity; - } - } - } - else if (cFreeze) - { - boostedRegen = true; - if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife) - { - if (Main.rand.Next(30000) < Player.lifeRegenTime || Main.rand.NextBool(30)) - { - int regen = Dust.NewDust(Player.position, Player.width, Player.height, 67, 0f, 0f, 200, new Color(150, Main.DiscoG, 255), 0.75f); - Main.dust[regen].noGravity = true; - Main.dust[regen].fadeIn = 1.3f; - Vector2 velocity = CalamityUtils.RandomVelocity(100f, 50f, 100f, 0.04f); - Main.dust[regen].velocity = velocity; - velocity.Normalize(); - velocity *= 34f; - Main.dust[regen].position = Player.Center - velocity; - } - } - } - else if (photosynthesis) - { - boostedRegen = true; - if (!Main.dayTime) - noSunlight = true; - if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife) - { - if (Main.rand.Next(30000) < Player.lifeRegenTime || Main.rand.NextBool(2)) - { - int regen = Dust.NewDust(Player.position, Player.width, Player.height, 244, 0f, 0f, 200, default, 1f); - Main.dust[regen].noGravity = true; - Main.dust[regen].fadeIn = 1.3f; - Vector2 velocity = CalamityUtils.RandomVelocity(100f, 50f, 100f, 0.04f); - Main.dust[regen].velocity = velocity; - velocity.Normalize(); - velocity *= 34f; - Main.dust[regen].position = Player.Center - velocity; - } - } - } - if (boostedRegen) - { - int lifeRegenTimeMaxBoost2 = !noSunlight ? lifeRegenTimeMaxBoost : (lifeRegenTimeMaxBoost / 5); - int lifeRegenMaxBoost2 = !noSunlight ? lifeRegenMaxBoost : (lifeRegenMaxBoost / 5); - float lifeRegenLifeRegenTimeMaxBoost2 = !noSunlight ? lifeRegenLifeRegenTimeMaxBoost : (lifeRegenLifeRegenTimeMaxBoost / 5); - - if (Player.lifeRegenTime > 90 && Player.lifeRegenTime < lifeRegenTimeMaxBoost2) - Player.lifeRegenTime = lifeRegenTimeMaxBoost2; - - Player.lifeRegenTime += lifeRegenMaxBoost2; - Player.lifeRegen += lifeRegenMaxBoost2; - - float num3 = Player.lifeRegenTime * 2.5f; // lifeRegenTime max is 3600 - num3 /= 300f; - if (num3 > 0f) - { - if (num3 > lifeRegenLifeRegenTimeMaxBoost2) - num3 = lifeRegenLifeRegenTimeMaxBoost2; - - Player.lifeRegen += (int)num3; - } - if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife) - { - Player.lifeRegenCount++; - } + int regen = Dust.NewDust(Player.position, Player.width, Player.height, dustType, 0f, 0f, purity || aAmpoule ? 80 : 200, default, purity || aAmpoule ? 0.5f : 1f); + Main.dust[regen].noGravity = true; + Main.dust[regen].fadeIn = 1.3f; + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 50f, 100f, 0.04f); + Main.dust[regen].velocity = velocity; + velocity.Normalize(); + velocity *= purity || aAmpoule ? 55f : 34f; + Main.dust[regen].position = Player.Center - velocity; } } + + // Actually apply "standing still" regeneration (the stats are granted even at full health) + float regenTimeNeededForTurboRegen = shadeRegen ? 40f : cFreeze ? 60f : honeyDewWorking ? 90f : photosynthesis ? 90f : aAmpoule ? 90f : purity ? 60f : -1f; + + // 4 = vanilla Shiny Stone + int turboRegenPower = shadeRegen || cFreeze || purity ? 4 : honeyDewWorking || aAmpoule ? 3 : photosynthesis ? 1 : -1; + + if (turboRegenPower > 0) + { + // After a brief delay determined by your form of standing still regen, min-cap life regen time at 1800 / 3600. + // Photosynthesis Potion does not do this at night. + if (Player.lifeRegenTime > regenTimeNeededForTurboRegen && Player.lifeRegenTime < 1800f && !onlyPhotosynthesisAtNight) + Player.lifeRegenTime = 1800f; + + Player.lifeRegen += turboRegenPower; + Player.lifeRegenTime += turboRegenPower; + } + } + #endregion // The Camper counteracts the regen loss while moving horizontally if (camper && (Player.velocity.X != 0 && Player.grappling[0] <= 0)) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 4e101ef4f9..b297593fea 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using CalamityMod.Balancing; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.Potions; @@ -1153,7 +1152,7 @@ namespace CalamityMod.CalPlayer if (instance.timeLeft < 0) { handler.OnCompleted(); - if (handler.EndSound != null) + if (handler.EndSound != null && handler.ShouldPlayEndSound) SoundEngine.PlaySound(handler.EndSound.GetValueOrDefault()); expiredCooldowns.Add(id); } @@ -1577,23 +1576,7 @@ namespace CalamityMod.CalPlayer Player.GetDamage() += 0.1f; } - // Ambrosial Ampoule bonus and other light-granting bonuses float[] light = new float[3]; - if ((rOoze && !Main.dayTime) || aAmpoule) - { - light[0] += 1f; - light[1] += 1f; - light[2] += 0.6f; - } - if (aAmpoule) - { - Player.endurance += 0.05f; - Player.buffImmune[BuffID.Frozen] = true; - Player.buffImmune[BuffID.Chilled] = true; - Player.buffImmune[BuffID.Frostburn] = true; - Player.buffImmune[BuffID.CursedInferno] = true; - Player.buffImmune[ModContent.BuffType()] = true; - } if (cFreeze) { light[0] += 0.3f; @@ -2383,8 +2366,8 @@ namespace CalamityMod.CalPlayer if (AbsorberRegen) { - Player.GetDamage() += 0.1f; - Player.endurance += 0.07f; + Player.GetDamage() += 0.08f; + Player.endurance += 0.05f; } if (crawCarapace) @@ -2698,25 +2681,25 @@ namespace CalamityMod.CalPlayer Player.lifeMagnet = true; } - if (wDeath) + if (wDeath && !purity) Player.GetDamage() -= 0.25f; - if (astralInfection) + if (astralInfection && !(infectedJewel || purity)) Player.GetDamage() -= 0.15f; - if (pFlames) + if (pFlames && !purity) { Player.blind = true; Player.GetDamage() -= 0.15f; } - if (aCrunch && !laudanum) + if (aCrunch && !laudanum && !purity) { Player.statDefense -= ArmorCrunch.DefenseReduction; Player.endurance *= ArmorCrunch.MultiplicativeDamageReductionPlayer; } - if (wither) + if (wither && !purity) { Player.statDefense -= WitherDebuff.DefenseReduction; } @@ -2729,10 +2712,10 @@ namespace CalamityMod.CalPlayer Player.velocity.Y = 15f; } - if (eutrophication) + if (eutrophication && !purity) Player.velocity = Vector2.Zero; - if (vaporfied || galvanicCorrosion) + if ((vaporfied && !purity) || galvanicCorrosion) Player.velocity *= 0.98f; if (molluskSet) @@ -3629,7 +3612,6 @@ namespace CalamityMod.CalPlayer { CooldownInstance durabilityCooldown = Player.AddCooldown(WulfrumRoverDriveDurability.ID, RoverDrive.ShieldDurabilityMax); durabilityCooldown.timeLeft = RoverDriveShieldDurability; - SoundEngine.PlaySound(RoverDrive.ActivationSound, Player.Center); } // Add light if this shield is currently active diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 0784b84d49..6a85e5abc7 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -707,7 +707,7 @@ namespace CalamityMod.CalPlayer } } - // Fearmonger set's colossal life regeneration + // Fearmonger set gains +10 frames (max 90) of regen when any minion lands any hit if (fearmongerSet) { fearmongerRegenFrames += 10; @@ -840,7 +840,7 @@ namespace CalamityMod.CalPlayer { Vector2 source = new Vector2(position.X + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); Vector2 velocity = (position - source) / 40f; - int damage = (int)Player.GetTotalDamage().ApplyTo(120); + int damage = (int)Player.GetTotalDamage().ApplyTo(125); Projectile.NewProjectile(spawnSource, source, velocity, ProjectileType(), damage, 3f, proj.owner); } } diff --git a/CalamityKeybinds.cs b/CalamityKeybinds.cs index fc27dabb6c..c76f1a98c2 100644 --- a/CalamityKeybinds.cs +++ b/CalamityKeybinds.cs @@ -9,8 +9,6 @@ namespace CalamityMod public static ModKeybind SetBonusHotKey { get; private set; } public static ModKeybind RageHotKey { get; private set; } public static ModKeybind AdrenalineHotKey { get; private set; } - public static ModKeybind AstralTeleportHotKey { get; private set; } - public static ModKeybind AstralArcanumUIHotkey { get; private set; } public static ModKeybind SandCloakHotkey { get; private set; } public static ModKeybind SpectralVeilHotKey { get; private set; } public static ModKeybind PlaguePackHotKey { get; private set; } @@ -28,8 +26,6 @@ namespace CalamityMod AdrenalineHotKey = KeybindLoader.RegisterKeybind(Mod, "AdrenalineMode", "B"); BlazingCoreHotKey = KeybindLoader.RegisterKeybind(Mod, "BlazingCoreParry", "N"); SetBonusHotKey = KeybindLoader.RegisterKeybind(Mod, "ArmorSetBonus", "Y"); - AstralTeleportHotKey = KeybindLoader.RegisterKeybind(Mod, "AstralTeleport", "P"); - AstralArcanumUIHotkey = KeybindLoader.RegisterKeybind(Mod, "AstralArcanumUIToggle", "O"); SandCloakHotkey = KeybindLoader.RegisterKeybind(Mod, "SandCloakEffect", "C"); SpectralVeilHotKey = KeybindLoader.RegisterKeybind(Mod, "SpectralVeilTeleport", "Z"); PlaguePackHotKey = KeybindLoader.RegisterKeybind(Mod, "BoosterDash", "Q"); @@ -47,8 +43,6 @@ namespace CalamityMod AdrenalineHotKey = null; BlazingCoreHotKey = null; SetBonusHotKey = null; - AstralTeleportHotKey = null; - AstralArcanumUIHotkey = null; SandCloakHotkey = null; SpectralVeilHotKey = null; PlaguePackHotKey = null; diff --git a/CalamityLists.cs b/CalamityLists.cs index 878f01aa30..f9d71c9bb7 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -1,11 +1,13 @@ -using CalamityMod.Buffs.Alcohol; +using System.Collections.Generic; +using CalamityMod.Buffs; +using CalamityMod.Buffs.Alcohol; +using CalamityMod.Buffs.Cooldowns; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.Potions; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.DraedonMisc; -using CalamityMod.Items.Fishing.BrimstoneCragCatches; using CalamityMod.Items.Fishing.FishingRods; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; @@ -64,7 +66,6 @@ using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; using CalamityMod.Tiles.LivingFire; -using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -87,6 +88,8 @@ namespace CalamityMod public static List friendlyBeeList; public static List hardModeNerfList; public static List debuffList; + public static List fireDebuffList; + public static List sicknessDebuffList; public static List alcoholList; public static List spearAutoreuseList; public static List pumpkinMoonBuffList; @@ -160,6 +163,8 @@ namespace CalamityMod public static List DisabledSummonerNerfItems; public static List DisabledSummonerNerfMinions; + public static List VeneratedLocketBanlist; //To ban projectiles from locket, mainly spikeballs altho Toasty asked me to add mod calls for adding stuff like Dreamtastic + public static void LoadLists() { donatorList = new List() @@ -1155,7 +1160,47 @@ namespace CalamityMod BuffType(), BuffType(), BuffType(), - BuffType() + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + // BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType() + }; + + fireDebuffList = new List() + { + BuffID.OnFire, + BuffID.OnFire3, // Hellfire + BuffID.Burning, // Touching meteorite ore or hellstone without obsidian skull + BuffID.CursedInferno, + BuffID.ShadowFlame, // Vanilla Shadowflame, can normally never be applied to players + BuffType(), // Calamity Shadowflame copy for players + BuffType(), // Crags lava + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), // Aflame enchant self damage + BuffType(), + }; + + sicknessDebuffList = new List() + { + BuffID.Poisoned, + BuffID.Venom, + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType() }; alcoholList = new List() @@ -1944,6 +1989,8 @@ namespace CalamityMod ProjectileID.MonkStaffT3, ProjectileID.LastPrismLaser, ProjectileID.ChargedBlasterLaser, + ProjectileID.PiercingStarlight, + ProjectileID.FinalFractal, ProjectileType(), ProjectileType(), ProjectileType(), @@ -1990,6 +2037,10 @@ namespace CalamityMod ProjectileType(), ProjectileType(), ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), }; // Lists of enemies that resist piercing to some extent (mostly worms). @@ -2670,6 +2721,18 @@ namespace CalamityMod DisabledSummonerNerfItems = new(); DisabledSummonerNerfMinions = new(); + + VeneratedLocketBanlist = new List() + { + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType() + }; } public static void UnloadLists() @@ -2686,6 +2749,8 @@ namespace CalamityMod beeProjectileList = null; hardModeNerfList = null; debuffList = null; + fireDebuffList = null; + sicknessDebuffList = null; alcoholList = null; spearAutoreuseList = null; pumpkinMoonBuffList = null; @@ -2758,6 +2823,8 @@ namespace CalamityMod DisabledSummonerNerfItems = null; DisabledSummonerNerfMinions = null; + + VeneratedLocketBanlist = null; } } } diff --git a/CalamityMod.cs b/CalamityMod.cs index 8f665dadcf..15188a5ff9 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -361,7 +361,6 @@ namespace CalamityMod RipperUI.Load(); StealthUI.Load(); ChargeMeterUI.Load(); - AstralArcanumUI.Load(this); FlightBar.Load(); // TODO -- Is this not possible to place in ModNPC.Load or ModNPC.SetStaticDefaults ? @@ -465,7 +464,6 @@ namespace CalamityMod RipperUI.Unload(); StealthUI.Unload(); ChargeMeterUI.Unload(); - AstralArcanumUI.Unload(); FlightBar.Unload(); if (!Main.dedServ) diff --git a/Cooldowns/CooldownHandler.cs b/Cooldowns/CooldownHandler.cs index 4fe1a63e97..f9d83b7837 100644 --- a/Cooldowns/CooldownHandler.cs +++ b/Cooldowns/CooldownHandler.cs @@ -49,6 +49,11 @@ namespace CalamityMod.Cooldowns /// When the cooldown instance ends, this sound is played. Leave at null for no sound. /// public virtual SoundStyle? EndSound => null; + + /// + /// Set this to true to have the cooldown instance end sound play upon expiration. Defaults to true + /// + public virtual bool ShouldPlayEndSound => true; #endregion #region Display & Rendering diff --git a/Cooldowns/LunicCorpsShieldCooldowns.cs b/Cooldowns/LunicCorpsShieldCooldowns.cs index 8834314338..dbee30e4a1 100644 --- a/Cooldowns/LunicCorpsShieldCooldowns.cs +++ b/Cooldowns/LunicCorpsShieldCooldowns.cs @@ -90,6 +90,7 @@ namespace CalamityMod.Cooldowns public override Color CooldownStartColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion); public override Color CooldownEndColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion); public override SoundStyle? EndSound => LunicCorpsHelmet.ActivationSound; + public override bool ShouldPlayEndSound => instance.player.Calamity().lunicCorpsSet; public override void Tick() => instance.player.Calamity().playedLunicCorpsShieldSound = false; // When the recharge period completes, grant 1 point of shielding immediately so the rest my refill normally. diff --git a/Cooldowns/SpongeCooldowns.cs b/Cooldowns/SpongeCooldowns.cs index 6484749021..b9429b1bac 100644 --- a/Cooldowns/SpongeCooldowns.cs +++ b/Cooldowns/SpongeCooldowns.cs @@ -90,6 +90,7 @@ namespace CalamityMod.Cooldowns public override Color CooldownStartColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion); public override Color CooldownEndColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion); public override SoundStyle? EndSound => TheSponge.ActivationSound; + public override bool ShouldPlayEndSound => instance.player.Calamity().sponge; public override void Tick() => instance.player.Calamity().playedSpongeShieldSound = false; // When the recharge period completes, grant 1 point of shielding immediately so the rest my refill normally. diff --git a/Cooldowns/WulfrumRoverDriveCooldowns.cs b/Cooldowns/WulfrumRoverDriveCooldowns.cs index 894e7dd7f9..e4c6485992 100644 --- a/Cooldowns/WulfrumRoverDriveCooldowns.cs +++ b/Cooldowns/WulfrumRoverDriveCooldowns.cs @@ -98,6 +98,7 @@ namespace CalamityMod.Cooldowns if (modPlayer.roverDrive) modPlayer.RoverDriveShieldDurability = RoverDrive.ShieldDurabilityMax; } - public override SoundStyle? EndSound => null; + public override SoundStyle? EndSound => RoverDrive.ActivationSound; + public override bool ShouldPlayEndSound => instance.player.Calamity().roverDrive; } } diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index a6c0313621..0815435ac2 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -456,8 +456,14 @@ namespace CalamityMod.ILEditing private static string IncorporateEnchantmentInAffix(Terraria.On_Item.orig_AffixName orig, Item self) { string result = orig(self); - if (!self.IsAir && self.Calamity().AppliedEnchantment.HasValue) - result = $"{self.Calamity().AppliedEnchantment.Value.Name} {result}"; + + // This hook could occur before CalamityGlobalItem is loaded and throw an error. + try + { + if (!self.IsAir && self.Calamity().AppliedEnchantment.HasValue) + result = $"{self.Calamity().AppliedEnchantment.Value.Name} {result}"; + } + catch { } return result; } #endregion diff --git a/Items/Accessories/AmbrosialAmpoule.cs b/Items/Accessories/AmbrosialAmpoule.cs index e5c3c33fd1..0836aa2a59 100644 --- a/Items/Accessories/AmbrosialAmpoule.cs +++ b/Items/Accessories/AmbrosialAmpoule.cs @@ -1,6 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -12,37 +12,38 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { - Item.defense = 6; Item.width = 20; Item.height = 20; - Item.value = CalamityGlobalItem.Rarity5BuyPrice; - Item.rare = ItemRarityID.Pink; + Item.value = CalamityGlobalItem.Rarity9BuyPrice; + Item.rare = ItemRarityID.Cyan; Item.accessory = true; } public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); + player.statLifeMax2 += 70; + + // bool left in for abyss light purposes and life regen effects modPlayer.aAmpoule = true; - modPlayer.rOoze = true; + + // Inherits all effects of Honey Dew and Living Dew (except standing regen is not honey exclusive anymore) + modPlayer.alwaysHoneyRegen = true; + modPlayer.honeyDewHalveDebuffs = true; + modPlayer.livingDewHalveDebuffs = true; + + // Add light if the other accessories aren't equipped and visibility is turned on + if (!(modPlayer.rOoze || modPlayer.purity) && !hideVisual) + Lighting.AddLight(player.Center, new Vector3(1.2f, 1.2f, 0.72f)); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(). + AddIngredient(). AddIngredient(). - AddIngredient(5). - AddIngredient(10). - AddTile(TileID.MythrilAnvil). - Register(); - - CreateRecipe(). - AddIngredient(). - AddIngredient(). - AddIngredient(5). - AddIngredient(10). - AddTile(TileID.MythrilAnvil). + AddIngredient(3). + AddTile(TileID.LunarCraftingStation). Register(); } } diff --git a/Items/Accessories/AngelicAlliance.cs b/Items/Accessories/AngelicAlliance.cs index a4817de3e4..aa7c22ee77 100644 --- a/Items/Accessories/AngelicAlliance.cs +++ b/Items/Accessories/AngelicAlliance.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Accessories player.GetDamage() += 0.08f; player.GetDamage() += 0.07f; //7% + 8% = 15% player.maxMinions += 2; - if (player.controlJump) + if (player.wingTime < player.wingTimeMax) player.lifeRegen += 4; } diff --git a/Items/Accessories/AstralArcanum.cs b/Items/Accessories/AstralArcanum.cs deleted file mode 100644 index c5b266e111..0000000000 --- a/Items/Accessories/AstralArcanum.cs +++ /dev/null @@ -1,44 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.CalPlayer; -using CalamityMod.Items.Materials; -using CalamityMod.Rarities; -using System.Collections.Generic; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Accessories -{ - public class AstralArcanum : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Accessories"; - public override void SetDefaults() - { - Item.defense = 12; - Item.width = 26; - Item.height = 26; - Item.accessory = true; - Item.value = CalamityGlobalItem.Rarity12BuyPrice; - Item.rare = ModContent.RarityType(); - } - - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.AstralArcanumUIHotkey); - - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.astralArcanum = true; - player.buffImmune[ModContent.BuffType()] = true; - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(). - AddIngredient(3). - AddIngredient(ItemID.LunarBar, 5). - AddTile(TileID.LunarCraftingStation). - Register(); - } - } -} diff --git a/Items/Accessories/AstralArcanum.png b/Items/Accessories/AstralArcanum.png deleted file mode 100644 index 30af2e08c5..0000000000 Binary files a/Items/Accessories/AstralArcanum.png and /dev/null differ diff --git a/Items/Accessories/CrownJewel.cs b/Items/Accessories/CrownJewel.cs index 617a17cd63..75b74c27da 100644 --- a/Items/Accessories/CrownJewel.cs +++ b/Items/Accessories/CrownJewel.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { - Item.defense = 5; + Item.defense = 4; Item.width = 26; Item.height = 26; Item.value = CalamityGlobalItem.Rarity1BuyPrice; diff --git a/Items/Accessories/HoneyDew.cs b/Items/Accessories/HoneyDew.cs index 055720f5f6..247b8ed539 100644 --- a/Items/Accessories/HoneyDew.cs +++ b/Items/Accessories/HoneyDew.cs @@ -13,46 +13,27 @@ namespace CalamityMod.Items.Accessories { Item.width = 20; Item.height = 20; - Item.value = CalamityGlobalItem.Rarity5BuyPrice; - Item.rare = ItemRarityID.Pink; + Item.value = CalamityGlobalItem.Rarity2BuyPrice; + Item.rare = ItemRarityID.Green; Item.accessory = true; } public override void UpdateAccessory(Player player, bool hideVisual) { + player.statLifeMax2 += 30; CalamityPlayer modPlayer = player.Calamity(); - modPlayer.beeResist = true; - - if (player.ZoneJungle) - { - player.lifeRegen += 1; - player.statDefense += 9; - player.endurance += 0.05f; - } - - player.buffImmune[BuffID.Venom] = true; - player.buffImmune[BuffID.Poisoned] = true; - - if (!player.honey && player.lifeRegen < 0) - { - player.lifeRegen += 2; - if (player.lifeRegen > 0) - player.lifeRegen = 0; - } - - player.lifeRegenTime += 1; - player.lifeRegen += 2; + modPlayer.alwaysHoneyRegen = true; + modPlayer.honeyTurboRegen = true; + modPlayer.honeyDewHalveDebuffs = true; } public override void AddRecipes() { CreateRecipe(). - AddIngredient(). AddIngredient(ItemID.BottledHoney, 10). - AddIngredient(2). - AddIngredient(ItemID.ButterflyDust). - AddIngredient(3). - AddTile(TileID.MythrilAnvil). + AddIngredient(ItemID.BeeWax, 3). + AddIngredient(3). + AddTile(TileID.Anvils). Register(); } } diff --git a/Items/Accessories/CelestialJewel.cs b/Items/Accessories/InfectedJewel.cs similarity index 61% rename from Items/Accessories/CelestialJewel.cs rename to Items/Accessories/InfectedJewel.cs index 565496846d..cd5e261296 100644 --- a/Items/Accessories/CelestialJewel.cs +++ b/Items/Accessories/InfectedJewel.cs @@ -1,19 +1,19 @@ -using CalamityMod.Items.Placeables; -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; using CalamityMod.Items.Potions; -using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class CelestialJewel : ModItem, ILocalizedModType + [LegacyName("CelestialJewel")] + public class InfectedJewel : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { - Item.defense = 8; + Item.defense = 6; Item.width = 26; Item.height = 26; Item.value = CalamityGlobalItem.Rarity7BuyPrice; @@ -21,21 +21,18 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.AstralTeleportHotKey); - public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.celestialJewel = true; + modPlayer.infectedJewel = true; } public override void AddRecipes() { CreateRecipe(). AddIngredient(). - AddIngredient(ItemID.TeleportationPotion, 3). - AddIngredient(15). - AddIngredient(15). + AddIngredient(10). + AddIngredient(25). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/CelestialJewel.png b/Items/Accessories/InfectedJewel.png similarity index 100% rename from Items/Accessories/CelestialJewel.png rename to Items/Accessories/InfectedJewel.png diff --git a/Items/Accessories/LivingDew.cs b/Items/Accessories/LivingDew.cs index 786de519e7..1ef0b8db2c 100644 --- a/Items/Accessories/LivingDew.cs +++ b/Items/Accessories/LivingDew.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -12,29 +13,32 @@ namespace CalamityMod.Items.Accessories { Item.width = 34; Item.height = 22; - Item.value = CalamityGlobalItem.Rarity3BuyPrice; - Item.rare = ItemRarityID.Orange; + Item.value = CalamityGlobalItem.Rarity7BuyPrice; + Item.rare = ItemRarityID.Lime; Item.accessory = true; } public override void UpdateAccessory(Player player, bool hideVisual) { - if (player.ZoneJungle) - { - player.lifeRegen += 1; - player.statDefense += 5; - player.endurance += 0.05f; - } - player.buffImmune[BuffID.Poisoned] = true; + player.statLifeMax2 += 50; + + // Inherits all effects of Honey Dew + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.alwaysHoneyRegen = true; + modPlayer.honeyTurboRegen = true; + modPlayer.honeyDewHalveDebuffs = true; + modPlayer.livingDewHalveDebuffs = true; } public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.Bezoar). - AddIngredient(ItemID.Vine, 2). - AddIngredient(5). - AddTile(TileID.Anvils). + AddIngredient(). + AddIngredient(3). + AddIngredient(6). + // TODO -- Replace with Water Essence + AddIngredient(5). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Accessories/Purity.cs b/Items/Accessories/Purity.cs new file mode 100644 index 0000000000..620e58a2c6 --- /dev/null +++ b/Items/Accessories/Purity.cs @@ -0,0 +1,54 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories +{ + [LegacyName("AstralArcanum")] + public class Purity : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Accessories"; + public override void SetDefaults() + { + Item.defense = 8; + Item.width = 18; + Item.height = 44; + Item.accessory = true; + Item.value = CalamityGlobalItem.Rarity15BuyPrice; + Item.rare = ModContent.RarityType(); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.Calamity(); + player.statLifeMax2 += 100; + + // Abyss light, debuff near-immunity, life regen effects, and massively enhances debuff halving + modPlayer.purity = true; + + // Inherits effects from Honey Dew and Living Dew + modPlayer.alwaysHoneyRegen = true; + modPlayer.honeyDewHalveDebuffs = true; + modPlayer.livingDewHalveDebuffs = true; + + // Add light if the other accessories aren't equipped and visibility is turned on + if (!(modPlayer.rOoze || modPlayer.aAmpoule) && !hideVisual) + Lighting.AddLight(player.Center, new Vector3(1.32f, 1.32f, 1.82f)); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(). + AddIngredient(). + AddIngredient(5). + AddIngredient(4). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Accessories/Purity.png b/Items/Accessories/Purity.png new file mode 100644 index 0000000000..c710af531d Binary files /dev/null and b/Items/Accessories/Purity.png differ diff --git a/Items/Accessories/RadiantOoze.cs b/Items/Accessories/RadiantOoze.cs index 52825d6ca9..58f33eec38 100644 --- a/Items/Accessories/RadiantOoze.cs +++ b/Items/Accessories/RadiantOoze.cs @@ -1,4 +1,6 @@ -using CalamityMod.Items.Materials; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -19,7 +21,14 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.Calamity().rOoze = true; + CalamityPlayer modPlayer = player.Calamity(); + + // bool left in for abyss light purposes and life regen effects + modPlayer.rOoze = true; + + // Add light if the other accessories aren't equipped and visibility is turned on + if (!(modPlayer.aAmpoule || modPlayer.purity) && !hideVisual) + Lighting.AddLight(player.Center, new Vector3(1f, 1f, 0.6f)); } public override void AddRecipes() diff --git a/Items/Accessories/RampartofDeities.cs b/Items/Accessories/RampartofDeities.cs index c994cc1856..b3dfb4b051 100644 --- a/Items/Accessories/RampartofDeities.cs +++ b/Items/Accessories/RampartofDeities.cs @@ -17,10 +17,10 @@ namespace CalamityMod.Items.Accessories { Item.width = 64; Item.height = 62; - Item.value = CalamityGlobalItem.Rarity14BuyPrice; + Item.value = CalamityGlobalItem.Rarity15BuyPrice; Item.defense = 18; Item.accessory = true; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override void UpdateAccessory(Player player, bool hideVisual) @@ -57,8 +57,7 @@ namespace CalamityMod.Items.Accessories CreateRecipe(). AddIngredient(ItemID.FrozenShield). AddIngredient(). - AddIngredient(10). - AddIngredient(10). + AddIngredient(5). AddIngredient(4). AddTile(). Register(); diff --git a/Items/Accessories/TheAbsorber.cs b/Items/Accessories/TheAbsorber.cs index dc8af18d29..87c9f5fe19 100644 --- a/Items/Accessories/TheAbsorber.cs +++ b/Items/Accessories/TheAbsorber.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { - Item.defense = 16; + Item.defense = 15; Item.width = 20; Item.height = 24; Item.value = CalamityGlobalItem.Rarity9BuyPrice; diff --git a/Items/Accessories/TheCommunity.cs b/Items/Accessories/TheCommunity.cs index ccd0f1b00a..416d820142 100644 --- a/Items/Accessories/TheCommunity.cs +++ b/Items/Accessories/TheCommunity.cs @@ -93,7 +93,7 @@ namespace CalamityMod.Items.Accessories // Damage stat boosts public const float DamageMultiplier = 0.5f; // 2.5% to 10% (x100) - public const float CritMultiplier = 25f; // 1.25% to 5% + public const float CritMultiplier = 25f; // 1.25% to 5% (end result rounded down) // Defensive stat boosts public const float HealthMultiplier = 50f; // 2% to 10% (rounded down) @@ -112,11 +112,11 @@ namespace CalamityMod.Items.Accessories float power = CalculatePower(); string statList = this.GetLocalization("StatsList").Format( (DamageMultiplier * power * 100).ToString("N1"), - (CritMultiplier * power).ToString("N0"), + (int)(CritMultiplier * power), (int)(HealthMultiplier * power), (DRMultiplier * power * 100).ToString("N2"), (int)(DefenseMultiplier * power), - 1 + (int)(RegenMultiplier * power), + (0.5f * (1f + (int)(RegenMultiplier * power))).ToString("n1"), (SpeedMultiplier * power * 100).ToString("N1"), (FlightMultiplier * power * 100).ToString("N1"), (CalculatePower(true) * 100).ToString("N0")); diff --git a/Items/Accessories/TheEvolution.cs b/Items/Accessories/TheEvolution.cs index fc43a7c998..f7cae5cd24 100644 --- a/Items/Accessories/TheEvolution.cs +++ b/Items/Accessories/TheEvolution.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetStaticDefaults() { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 10)); + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 10)); ItemID.Sets.AnimatesAsSoul[Type] = true; } diff --git a/Items/Accessories/TheSponge.cs b/Items/Accessories/TheSponge.cs index b9f75fbe5d..99a96e5c64 100644 --- a/Items/Accessories/TheSponge.cs +++ b/Items/Accessories/TheSponge.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Accessories public static readonly SoundStyle BreakSound = new("CalamityMod/Sounds/Custom/RoverDriveBreak") { Volume = 0.75f }; public static int ShieldDurabilityMax = 180; - public static int ShieldRechargeDelay = CalamityUtils.SecondsToFrames(6); + public static int ShieldRechargeDelay = CalamityUtils.SecondsToFrames(9); // was 6 public static int TotalShieldRechargeTime = CalamityUtils.SecondsToFrames(6); // While active, The Sponge gives 30 defense and 30% DR diff --git a/Items/Ammo/AccelerationRound.cs b/Items/Ammo/AccelerationRound.cs index c7b8def04d..7d95498944 100644 --- a/Items/Ammo/AccelerationRound.cs +++ b/Items/Ammo/AccelerationRound.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Items.Ammo { Item.damage = 10; Item.DamageType = DamageClass.Ranged; - Item.width = 8; - Item.height = 8; + Item.width = 10; + Item.height = 16; Item.maxStack = 9999; Item.consumable = true; Item.knockBack = 1.25f; diff --git a/Items/Ammo/AccelerationRound.png b/Items/Ammo/AccelerationRound.png index aaae66b94b..c2c6a926ad 100644 Binary files a/Items/Ammo/AccelerationRound.png and b/Items/Ammo/AccelerationRound.png differ diff --git a/Items/Armor/GemTech/GemTechHeadgear.cs b/Items/Armor/GemTech/GemTechHeadgear.cs index 1b212d446b..8a0b35a901 100644 --- a/Items/Armor/GemTech/GemTechHeadgear.cs +++ b/Items/Armor/GemTech/GemTechHeadgear.cs @@ -138,12 +138,15 @@ namespace CalamityMod.Items.Armor.GemTech tooltips.Insert(setBonusIndex, purpleGemTooltip); setBonusIndex++; - TooltipLine pinkGemTooltip = new TooltipLine(item.Mod, "CalamityMod:SetBonus7", CalamityUtils.GetTextFromModItem("PinkGemInfo").Format(BaseGemDefenseBoost, BaseGemLifeRegenBoost)); + string pinkLifeRegenString = (0.5f * BaseGemLifeRegenBoost).ToString("n1"); + TooltipLine pinkGemTooltip = new TooltipLine(item.Mod, "CalamityMod:SetBonus7", CalamityUtils.GetTextFromModItem("PinkGemInfo").Format(BaseGemDefenseBoost, pinkLifeRegenString)); pinkGemTooltip.OverrideColor = new Color(255, 115, 206); tooltips.Insert(setBonusIndex, pinkGemTooltip); setBonusIndex++; - TooltipLine liferegenTooltip = new TooltipLine(item.Mod, "CalamityMod:SetBonus8", CalamityUtils.GetTextFromModItem("GemBonusInfo").Format(AllGemsWeaponUseLifeRegenBoost, AllGemsLifeRegenBoostTime / 60, AllGemsMultiWeaponUseLifeRegenBoost, AllGemsMultiWeaponLifeRegenBoostTime / 60f)); + string baseLifeRegenString = (0.5f * AllGemsWeaponUseLifeRegenBoost).ToString("n1"); + string multiclassLifeRegenString = (0.5f * AllGemsMultiWeaponUseLifeRegenBoost).ToString("n1"); + TooltipLine liferegenTooltip = new TooltipLine(item.Mod, "CalamityMod:SetBonus8", CalamityUtils.GetTextFromModItem("GemBonusInfo").Format(baseLifeRegenString, AllGemsLifeRegenBoostTime / 60, multiclassLifeRegenString, AllGemsMultiWeaponLifeRegenBoostTime / 60f)); liferegenTooltip.OverrideColor = new Color(230, 230, 230); tooltips.Insert(setBonusIndex, liferegenTooltip); } diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 650f93c390..814d5c1ed6 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -442,7 +442,7 @@ namespace CalamityMod.Items // Palladium if (item.type == ItemID.PalladiumSword || item.type == ItemID.PalladiumPike) - EditTooltipByName("Knockback", (line) => line.Text += "\nIncreases life regen on hit"); + EditTooltipByName("Knockback", (line) => line.Text += "\nIncreases natural life regen on hit"); // Mythril if (item.type == ItemID.MythrilSword || item.type == ItemID.MythrilHalberd) @@ -588,7 +588,7 @@ namespace CalamityMod.Items // Fairy Boots buff. if (item.type == ItemID.FairyBoots) EditTooltipByNum(2, (line) => line.Text += "\nFairies can spawn at any time on the surface and spawn far more frequently\n" + - "Nearby fairies grant increased life regen, defense and movement speed\n" + + "Nearby fairies grant +2 HP/s life regen, 10 defense and 10% movement speed\n" + "Fairies are immune to damage and will no longer flee"); // Armor Crunch immunity pre-Golem. @@ -729,7 +729,7 @@ namespace CalamityMod.Items if (item.type == ItemID.TinHelmet) AddTooltip("3% increased critical strike chance"); if (item.type == ItemID.TinChainmail) - AddTooltip("+1 life regen"); + AddTooltip("+0.5 HP/s life regen"); if (item.type == ItemID.TinGreaves) AddTooltip("5% increased movement speed"); @@ -745,7 +745,7 @@ namespace CalamityMod.Items if (item.type == ItemID.SilverHelmet) AddTooltip("5% increased critical strike chance"); if (item.type == ItemID.SilverChainmail) - AddTooltip("+2 life regen"); + AddTooltip("+1 HP/s life regen"); if (item.type == ItemID.SilverGreaves) AddTooltip("8% increased movement speed"); @@ -753,7 +753,7 @@ namespace CalamityMod.Items if (item.type == ItemID.TungstenHelmet) AddTooltip("7% increased damage"); if (item.type == ItemID.TungstenChainmail) - AddTooltip("+1 life regen"); + AddTooltip("+0.5 HP/s life regen"); if (item.type == ItemID.TungstenGreaves) AddTooltip("8% increased movement speed"); @@ -782,7 +782,7 @@ namespace CalamityMod.Items { EditTooltipByNum(0, (line) => { string newTooltip = line.Text.Replace("2%", "5%"); - newTooltip += "\n+1 life regen"; + newTooltip += "\n+0.5 HP/s life regen"; line.Text = newTooltip; }); } @@ -945,7 +945,7 @@ namespace CalamityMod.Items AddWingStats(3f, 1f, 0, 25); if (item.type == ItemID.AngelWings) - AddWingStats(6.25f, 1f, 1, 100, "+20 max life, +10 defense and +2 life regen"); + AddWingStats(6.25f, 1f, 1, 100, "+20 max life, +10 defense and +1 HP/s life regen"); if (item.type == ItemID.DemonWings) AddWingStats(6.25f, 1f, 1, 100, "5% increased damage and critical strike chance"); diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index f9eedd1e22..99081780c9 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Items // { ItemID.FireworksLauncher, Do(DamageRatio(2f)) }, // Celebration { ItemID.Flamarang, Do(DamageExact(43)) }, { ItemID.Flamelash, Do(DamageRatio(1.25f)) }, - { ItemID.Flamethrower, Do(DamageExact(42), ShootSpeedDelta(+3f)) }, + { ItemID.Flamethrower, Do(ShootSpeedDelta(+3f)) }, { ItemID.FlowerofFire, Do(AutoReuse, ManaExact(7), UseRatio(0.88f)) }, // Uses ratios due to remix seed { ItemID.FlowerofFrost, Do(AutoReuse, ManaExact(7), UseExact(30), DamageExact(70), ShootSpeedExact(14)) }, { ItemID.FlyingKnife, Do(DamageExact(70)) }, @@ -212,7 +212,6 @@ namespace CalamityMod.Items { ItemID.StakeLauncher, Do(PointBlank, DamageRatio(2f), UseRatio(1.5f)) }, { ItemID.StarCannon, Do(DamageExact(25)) }, { ItemID.StardustDragonStaff, Do(AutoReuse, DamageExact(20), UseExact(19)) }, - { ItemID.StarWrath, Do(DamageRatio(0.9f)) }, { ItemID.StormTigerStaff, Do(AutoReuse, DamageExact(49), UseExact(20)) }, // Desert Tiger Staff { ItemID.StylistKilLaKillScissorsIWish, Do(AutoReuse, UseTurn, DamageExact(18)) }, // Stylish Scissors { ItemID.Swordfish, Do(AutoReuse, TrueMelee, DamageExact(24)) }, diff --git a/Items/PermanentBoosters/MiracleFruit.cs b/Items/PermanentBoosters/MiracleFruit.cs index 4b6d640f7a..7ff881db9a 100644 --- a/Items/PermanentBoosters/MiracleFruit.cs +++ b/Items/PermanentBoosters/MiracleFruit.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Items.PermanentBoosters AddIngredient(ItemID.LifeFruit, 5). AddIngredient(5). AddIngredient(5). - AddIngredient(10). + AddIngredient(12). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs index ab2b6a4fb7..6b86d860fd 100644 --- a/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs +++ b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs @@ -66,6 +66,7 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "Atalya", "Ben-TK", "Cei", + "CongratsIsTrash", "Cooper", "CrabBar", "Done", @@ -91,7 +92,6 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "Shayy", "Spider Prov", "StipulateVenus", - "Sylvium", "Tomat", "Triangle", "Uberransy", @@ -182,6 +182,7 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "spooktacular", "Spoopyro", "Svante", + "Sylvium", "Teragat", "Terry N. Muse", "ThousandFields", diff --git a/Items/VanillaArmorChanges/IronArmorSetChange.cs b/Items/VanillaArmorChanges/IronArmorSetChange.cs index 3bf3a7a576..a5af707c1c 100644 --- a/Items/VanillaArmorChanges/IronArmorSetChange.cs +++ b/Items/VanillaArmorChanges/IronArmorSetChange.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.VanillaArmorChanges public override void UpdateSetBonusText(ref string setBonusText) { StringBuilder sb = new StringBuilder(256); - sb.Append("\nIncreases damage reduction by 6%\n+2 life regen"); + sb.Append("\nIncreases damage reduction by 6%\n+1 HP/s life regen"); setBonusText += sb.ToString(); } diff --git a/Items/VanillaArmorChanges/LeadArmorSetChange.cs b/Items/VanillaArmorChanges/LeadArmorSetChange.cs index 5683e3af9d..0f35ce35f1 100644 --- a/Items/VanillaArmorChanges/LeadArmorSetChange.cs +++ b/Items/VanillaArmorChanges/LeadArmorSetChange.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.VanillaArmorChanges public override void UpdateSetBonusText(ref string setBonusText) { StringBuilder sb = new StringBuilder(256); - sb.Append("\nIncreases damage reduction by 3%\n+1 life regen\nGrants immunity to knockback"); + sb.Append("\nIncreases damage reduction by 3%\n+0.5 HP/s life regen\nGrants immunity to knockback"); setBonusText += sb.ToString(); } diff --git a/Items/VanillaArmorChanges/PlatinumArmorSetChange.cs b/Items/VanillaArmorChanges/PlatinumArmorSetChange.cs index 19b239eb06..9f7cd286e1 100644 --- a/Items/VanillaArmorChanges/PlatinumArmorSetChange.cs +++ b/Items/VanillaArmorChanges/PlatinumArmorSetChange.cs @@ -18,9 +18,10 @@ namespace CalamityMod.Items.VanillaArmorChanges public const float HeadDamage = 0.06f; public const float ChestCrit = 5f; public const float LegsMoveSpeed = 0.1f; - public const float SetBonusLifeRegenPerDefense = 0.0666667f; // 15 defense = +1 life regen - public const float SetBonusCritPerDefense = 0.0666667f; // 15 defense = +1% crit chance - public const int SetBonusDefenseCap = 45; + public const float SetBonusLifeRegenPerDefense = 0.1f; // 10 defense = +1 life regen + public const float SetBonusDamagePerDefense = 0.1f; // 10 defense = +1% damage + public const float SetBonusCritPerDefense = 0.1f; // 10 defense = +1% crit chance + public const int SetBonusDefenseCap = 40; public override void ApplyHeadPieceEffect(Player player) => player.GetDamage() += HeadDamage; @@ -31,7 +32,7 @@ namespace CalamityMod.Items.VanillaArmorChanges public override void UpdateSetBonusText(ref string setBonusText) { StringBuilder sb = new StringBuilder(256); - sb.Append("\nEvery 15 defense gives you +1 life regen and 1% increased critical strike chance\nThese effects both cap at 45 defense"); + sb.Append("\nEvery 10 defense gives you +0.5 HP/s life regen, 1% increased damage and 1% increased critical strike chance\nThese effects cap at 40 defense"); setBonusText += sb.ToString(); } @@ -41,6 +42,7 @@ namespace CalamityMod.Items.VanillaArmorChanges if (defense > SetBonusDefenseCap) defense = SetBonusDefenseCap; player.lifeRegen += (int)(defense * SetBonusLifeRegenPerDefense); + player.GetDamage() += defense * SetBonusDamagePerDefense; player.GetCritChance() += defense * SetBonusCritPerDefense; } } diff --git a/Items/VanillaArmorChanges/SilverArmorSetChange.cs b/Items/VanillaArmorChanges/SilverArmorSetChange.cs index e7fa03d65f..c9e6246e0f 100644 --- a/Items/VanillaArmorChanges/SilverArmorSetChange.cs +++ b/Items/VanillaArmorChanges/SilverArmorSetChange.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.VanillaArmorChanges public override void UpdateSetBonusText(ref string setBonusText) { StringBuilder sb = new StringBuilder(256); - sb.Append("\n+1 life regen\nTwo seconds after getting hit for 20 or more damage, you heal for 10\nGetting hit again resets the timer, delaying the heal"); + sb.Append("\n+0.5 HP/s life regen\nTwo seconds after getting hit for 20 or more damage, you heal for 10\nGetting hit again resets the timer, delaying the heal"); setBonusText += sb.ToString(); } diff --git a/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs b/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs index f25fbec3e2..f575b6ff3e 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.width = 22; Item.height = 28; - Item.damage = 1378; + Item.damage = 1000; Item.noMelee = true; Item.noUseGraphic = true; Item.consumable = false; @@ -40,19 +40,20 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.rare = ModContent.RarityType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 14f; + Item.shootSpeed = 11f; Item.DamageType = RogueDamageClass.Instance; modItem.UsesCharge = true; modItem.MaxCharge = 250f; - modItem.ChargePerUse = 0.2f; + modItem.ChargePerUse = 0.25f; } + public override float StealthDamageMultiplier => 1.2f; + public override float StealthVelocityMultiplier => 1.2f; + public override float StealthKnockbackMultiplier => 1.5f; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.Calamity().StealthStrikeAvailable()) - damage = (int)(damage * 1.05); - int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); if (proj.WithinBounds(Main.maxProjectiles)) Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); diff --git a/Items/Weapons/DraedonsArsenal/PulseRifle.cs b/Items/Weapons/DraedonsArsenal/PulseRifle.cs index e4afc89dbc..d2684920b4 100644 --- a/Items/Weapons/DraedonsArsenal/PulseRifle.cs +++ b/Items/Weapons/DraedonsArsenal/PulseRifle.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/PulseRifleFire"); - private int BaseDamage = 1280; + private int BaseDamage = 1200; public override void SetDefaults() { diff --git a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs index 4085c57b49..7d171cf708 100644 --- a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs +++ b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs @@ -1,10 +1,10 @@ -using CalamityMod.CustomRecipes; +using System; +using System.Collections.Generic; +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Rarities; using Microsoft.Xna.Framework; -using System; -using System.Collections.Generic; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -15,12 +15,16 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public class SnakeEyes : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; + + public static float EnemyDistanceDetection = 2000f; + public static float TimeToShoot = 30f; + public static float ProjectileSpeed = 40f; + public static float TimeToRedirect = 15f; + public static float TimeToRestart = 45f; + public override void SetDefaults() { - CalamityGlobalItem modItem = Item.Calamity(); - - Item.shootSpeed = 10f; - Item.damage = 65; + Item.damage = 200; Item.mana = 12; Item.width = 38; Item.height = 24; @@ -35,9 +39,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.UseSound = SoundID.Item15; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; + CalamityGlobalItem modItem = Item.Calamity(); modItem.UsesCharge = true; modItem.MaxCharge = 190f; modItem.ChargePerUse = 1f; @@ -46,10 +50,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int watcher = Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(watcher)) - Main.projectile[watcher].originalDamage = Item.damage; - + Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI); return false; } diff --git a/Items/Weapons/Magic/GruesomeEminence.cs b/Items/Weapons/Magic/GruesomeEminence.cs index b71835a0fd..928015d4d8 100644 --- a/Items/Weapons/Magic/GruesomeEminence.cs +++ b/Items/Weapons/Magic/GruesomeEminence.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() { - Item.damage = 888; + Item.damage = 666; Item.DamageType = DamageClass.Magic; Item.noUseGraphic = true; Item.channel = true; diff --git a/Items/Weapons/Magic/NightsRay.cs b/Items/Weapons/Magic/NightsRay.cs index 6bc2641140..0fb6594049 100644 --- a/Items/Weapons/Magic/NightsRay.cs +++ b/Items/Weapons/Magic/NightsRay.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Item.type] = true; } public override void SetDefaults() @@ -20,8 +20,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 24; Item.DamageType = DamageClass.Magic; Item.mana = 10; - Item.width = 50; - Item.height = 50; + Item.width = 58; + Item.height = 54; Item.useTime = 20; Item.useAnimation = 20; Item.useStyle = ItemUseStyleID.Shoot; @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Magic Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 6f; } - public override void AddRecipes() { diff --git a/Items/Weapons/Magic/NightsRay.png b/Items/Weapons/Magic/NightsRay.png index 39da37b60d..ce0d6dcdad 100644 Binary files a/Items/Weapons/Magic/NightsRay.png and b/Items/Weapons/Magic/NightsRay.png differ diff --git a/Items/Weapons/Magic/Poseidon.cs b/Items/Weapons/Magic/Poseidon.cs index 434ca31c28..d8f8451f9a 100644 --- a/Items/Weapons/Magic/Poseidon.cs +++ b/Items/Weapons/Magic/Poseidon.cs @@ -12,13 +12,13 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() { - Item.damage = 62; + Item.damage = 52; Item.DamageType = DamageClass.Magic; Item.mana = 12; Item.width = 28; Item.height = 32; - Item.useTime = 45; - Item.useAnimation = 45; + Item.useTime = 49; + Item.useAnimation = 49; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 6f; @@ -27,13 +27,12 @@ namespace CalamityMod.Items.Weapons.Magic Item.rare = ItemRarityID.Pink; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 20f; + Item.shootSpeed = 18f; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { int typhoon = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 0f); - Main.projectile[typhoon].penetrate = Main.rand.Next(4,11); return false; } } diff --git a/Items/Weapons/Magic/SubsumingVortex.cs b/Items/Weapons/Magic/SubsumingVortex.cs index 84eaddb6ba..e8f91b17a0 100644 --- a/Items/Weapons/Magic/SubsumingVortex.cs +++ b/Items/Weapons/Magic/SubsumingVortex.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Magic public const float ReleaseSpeed = 33f; - public const float ReleaseDamageFactor = 4.48f; + public const float ReleaseDamageFactor = 4.65f; public static readonly SoundStyle ExplosionSound = new("CalamityMod/Sounds/Custom/SubsumingVortexExplosion"); @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - Item.damage = 507; + Item.damage = 483; Item.DamageType = DamageClass.Magic; Item.useTime = Item.useAnimation = 20; Item.shootSpeed = 7f; diff --git a/Items/Weapons/Magic/TerraRay.cs b/Items/Weapons/Magic/TerraRay.cs index 1487295159..3101d05973 100644 --- a/Items/Weapons/Magic/TerraRay.cs +++ b/Items/Weapons/Magic/TerraRay.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - Item.damage = 50; + Item.damage = 60; Item.DamageType = DamageClass.Magic; Item.mana = 10; Item.width = 54; diff --git a/Items/Weapons/Magic/VoidVortex.cs b/Items/Weapons/Magic/VoidVortex.cs index fdc6183b87..db4a6bd179 100644 --- a/Items/Weapons/Magic/VoidVortex.cs +++ b/Items/Weapons/Magic/VoidVortex.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic public class VoidVortex : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; - public const int OrbFireRate = 16; + public const int OrbFireRate = 20; public override void SetStaticDefaults() { @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - Item.damage = 112; + Item.damage = 106; Item.DamageType = DamageClass.Magic; Item.mana = 60; Item.width = 130; diff --git a/Items/Weapons/Melee/ElementalShiv.cs b/Items/Weapons/Melee/ElementalShiv.cs index ca8df0a385..6ed09153d6 100644 --- a/Items/Weapons/Melee/ElementalShiv.cs +++ b/Items/Weapons/Melee/ElementalShiv.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Items.Weapons.Melee { Item.useStyle = ItemUseStyleID.Rapier; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 10; - Item.useTime = 10; + Item.useAnimation = 13; + Item.useTime = 13; Item.width = 44; Item.height = 44; Item.damage = 190; diff --git a/Items/Weapons/Melee/EmpyreanKnives.cs b/Items/Weapons/Melee/EmpyreanKnives.cs index e6a600fb90..61af6ce656 100644 --- a/Items/Weapons/Melee/EmpyreanKnives.cs +++ b/Items/Weapons/Melee/EmpyreanKnives.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.width = 18; - Item.damage = 198; + Item.damage = 207; Item.DamageType = DamageClass.MeleeNoSpeed; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/Nadir.cs b/Items/Weapons/Melee/Nadir.cs index 09736a0e7d..cdd08c10b9 100644 --- a/Items/Weapons/Melee/Nadir.cs +++ b/Items/Weapons/Melee/Nadir.cs @@ -36,8 +36,8 @@ namespace CalamityMod.Items.Weapons.Melee Item.useStyle = ItemUseStyleID.Shoot; Item.UseSound = SoundID.Item1; - Item.value = CalamityGlobalItem.Rarity14BuyPrice; - Item.rare = ModContent.RarityType(); + Item.value = CalamityGlobalItem.Rarity15BuyPrice; + Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Melee/Nebulash.cs b/Items/Weapons/Melee/Nebulash.cs index f677385279..af58c393d6 100644 --- a/Items/Weapons/Melee/Nebulash.cs +++ b/Items/Weapons/Melee/Nebulash.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 16; Item.height = 16; - Item.damage = 60; + Item.damage = 78; Item.rare = ItemRarityID.Lime; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/PrismaticBreaker.cs b/Items/Weapons/Melee/PrismaticBreaker.cs index 76a3836524..43a1e1404d 100644 --- a/Items/Weapons/Melee/PrismaticBreaker.cs +++ b/Items/Weapons/Melee/PrismaticBreaker.cs @@ -84,7 +84,7 @@ namespace CalamityMod.Items.Weapons.Melee } else { - Projectile.NewProjectile(source, position.X, position.Y, velocity.X * 0.5f, velocity.Y * 0.5f, type, (int)(damage * 1.3f), knockback, player.whoAmI); + Projectile.NewProjectile(source, position.X, position.Y, velocity.X * 0.5f, velocity.Y * 0.5f, type, (int)(damage * 1.1f), knockback, player.whoAmI); } return false; } diff --git a/Items/Weapons/Melee/SeekingScorcher.cs b/Items/Weapons/Melee/SeekingScorcher.cs index da30a835ad..9de2ff5f31 100644 --- a/Items/Weapons/Melee/SeekingScorcher.cs +++ b/Items/Weapons/Melee/SeekingScorcher.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.width = 60; - Item.damage = 177; + Item.damage = 232; Item.noMelee = true; Item.noUseGraphic = true; Item.autoReuse = true; diff --git a/Items/Weapons/Ranged/ArterialAssault.cs b/Items/Weapons/Ranged/ArterialAssault.cs index c7284e7030..9bd1950f75 100644 --- a/Items/Weapons/Ranged/ArterialAssault.cs +++ b/Items/Weapons/Ranged/ArterialAssault.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -97,4 +97,4 @@ namespace CalamityMod.Items.Weapons.Ranged Register(); } } -} +} \ No newline at end of file diff --git a/Items/Weapons/Ranged/BlossomFlux.cs b/Items/Weapons/Ranged/BlossomFlux.cs index 5ce6e69dcb..08bf441c83 100644 --- a/Items/Weapons/Ranged/BlossomFlux.cs +++ b/Items/Weapons/Ranged/BlossomFlux.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 20; + Item.damage = 14; Item.DamageType = DamageClass.Ranged; Item.width = 38; Item.height = 68; diff --git a/Items/Weapons/Ranged/DodusHandcannon.cs b/Items/Weapons/Ranged/DodusHandcannon.cs index 98aae42a20..103e91d86f 100644 --- a/Items/Weapons/Ranged/DodusHandcannon.cs +++ b/Items/Weapons/Ranged/DodusHandcannon.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 62; Item.height = 34; - Item.damage = 857; + Item.damage = 1020; Item.DamageType = DamageClass.Ranged; Item.useTime = 30; Item.useAnimation = 30; diff --git a/Items/Weapons/Ranged/DragonsBreath.cs b/Items/Weapons/Ranged/DragonsBreath.cs index d412ddaefb..7998f6fe0d 100644 --- a/Items/Weapons/Ranged/DragonsBreath.cs +++ b/Items/Weapons/Ranged/DragonsBreath.cs @@ -26,11 +26,10 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 130; + Item.damage = 162; Item.DamageType = DamageClass.Ranged; Item.width = 124; Item.height = 78; - Item.useTime = 9; Item.useAnimation = 18; Item.reuseDelay = BetweenShotsPause; diff --git a/Items/Weapons/Ranged/ElementalBlaster.cs b/Items/Weapons/Ranged/ElementalBlaster.cs index 8265d0d556..fab5898e68 100644 --- a/Items/Weapons/Ranged/ElementalBlaster.cs +++ b/Items/Weapons/Ranged/ElementalBlaster.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 55; + Item.damage = 67; Item.DamageType = DamageClass.Ranged; Item.width = 104; Item.height = 42; diff --git a/Items/Weapons/Ranged/FlarewingBow.cs b/Items/Weapons/Ranged/FlarewingBow.cs index 9e88e86d1b..5cde932d3d 100644 --- a/Items/Weapons/Ranged/FlarewingBow.cs +++ b/Items/Weapons/Ranged/FlarewingBow.cs @@ -13,12 +13,12 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 17; + Item.damage = 31; Item.DamageType = DamageClass.Ranged; Item.width = 40; Item.height = 72; - Item.useTime = 30; - Item.useAnimation = 30; + Item.useTime = 41; + Item.useAnimation = 41; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 1.5f; @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.UseSound = SoundID.Item5; Item.autoReuse = true; Item.shoot = ProjectileID.WoodenArrowFriendly; - Item.shootSpeed = 16f; + Item.shootSpeed = 18f; Item.useAmmo = AmmoID.Arrow; Item.Calamity().canFirePointBlankShots = true; } @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); float num117 = 0.314159274f; - int num118 = 4; + int num118 = 3; Vector2 vector7 = velocity; vector7.Normalize(); vector7 *= 50f; @@ -70,7 +70,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(5). AddIngredient(ItemID.LivingFireBlock, 50). AddIngredient(ItemID.Obsidian, 10). - AddTile(TileID.MythrilAnvil). + AddTile(TileID.Anvils). Register(); } } diff --git a/Items/Weapons/Ranged/HeavenlyGale.cs b/Items/Weapons/Ranged/HeavenlyGale.cs index c1675b64ba..0cafcf0831 100644 --- a/Items/Weapons/Ranged/HeavenlyGale.cs +++ b/Items/Weapons/Ranged/HeavenlyGale.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 300; + Item.damage = 221; Item.DamageType = DamageClass.Ranged; Item.width = 138; Item.height = 176; @@ -76,4 +76,4 @@ namespace CalamityMod.Items.Weapons.Ranged Register(); } } -} \ No newline at end of file +} diff --git a/Items/Weapons/Ranged/HoarfrostBow.cs b/Items/Weapons/Ranged/HoarfrostBow.cs index 80a9e04a96..9f290e1709 100644 --- a/Items/Weapons/Ranged/HoarfrostBow.cs +++ b/Items/Weapons/Ranged/HoarfrostBow.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 56; + Item.damage = 37; Item.DamageType = DamageClass.Ranged; Item.width = 26; Item.height = 70; diff --git a/Items/Weapons/Ranged/Monsoon.cs b/Items/Weapons/Ranged/Monsoon.cs index 1c4d7c7388..66559fea56 100644 --- a/Items/Weapons/Ranged/Monsoon.cs +++ b/Items/Weapons/Ranged/Monsoon.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 121; + Item.damage = 152; Item.DamageType = DamageClass.Ranged; Item.width = 46; Item.height = 78; diff --git a/Items/Weapons/Ranged/OnyxChainBlaster.cs b/Items/Weapons/Ranged/OnyxChainBlaster.cs index 21f3abf073..e155ee4dd2 100644 --- a/Items/Weapons/Ranged/OnyxChainBlaster.cs +++ b/Items/Weapons/Ranged/OnyxChainBlaster.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 40; + Item.damage = 51; Item.DamageType = DamageClass.Ranged; Item.width = 64; Item.height = 32; diff --git a/Items/Weapons/Ranged/Starmageddon.cs b/Items/Weapons/Ranged/Starmageddon.cs index 07cf6bbe9a..d27be3cc48 100644 --- a/Items/Weapons/Ranged/Starmageddon.cs +++ b/Items/Weapons/Ranged/Starmageddon.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 90; + Item.damage = 100; Item.knockBack = 4f; Item.shootSpeed = 16f; Item.useStyle = ItemUseStyleID.Shoot; @@ -55,11 +55,8 @@ namespace CalamityMod.Items.Weapons.Ranged { CreateRecipe(). AddIngredient(). - AddIngredient(). AddIngredient(). - AddIngredient(). AddIngredient(5). - AddIngredient(10). AddIngredient(10). AddIngredient(15). AddTile(ModContent.TileType()). diff --git a/Items/Weapons/Ranged/TerraFlameburster.cs b/Items/Weapons/Ranged/TerraFlameburster.cs index 977c3893db..301887cddb 100644 --- a/Items/Weapons/Ranged/TerraFlameburster.cs +++ b/Items/Weapons/Ranged/TerraFlameburster.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Ranged CreateRecipe(). AddIngredient(ItemID.Flamethrower). AddIngredient(). - AddIngredient(7). + AddIngredient(12). AddIngredient(5). AddTile(TileID.MythrilAnvil). Register(); diff --git a/Items/Weapons/Ranged/TheHive.cs b/Items/Weapons/Ranged/TheHive.cs index ff0d2344a8..1816264b40 100644 --- a/Items/Weapons/Ranged/TheHive.cs +++ b/Items/Weapons/Ranged/TheHive.cs @@ -12,12 +12,12 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 80; + Item.damage = 60; Item.DamageType = DamageClass.Ranged; Item.width = 62; Item.height = 30; - Item.useTime = 21; - Item.useAnimation = 21; + Item.useTime = 34; + Item.useAnimation = 34; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 3.5f; diff --git a/Items/Weapons/Rogue/EclipsesFall.cs b/Items/Weapons/Rogue/EclipsesFall.cs index 1275a42f81..b914c5c93a 100644 --- a/Items/Weapons/Rogue/EclipsesFall.cs +++ b/Items/Weapons/Rogue/EclipsesFall.cs @@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Rogue; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Rogue { public override void SetDefaults() { - Item.damage = 564; + Item.damage = 540; Item.knockBack = 3.5f; Item.useAnimation = Item.useTime = 21; Item.autoReuse = true; @@ -43,6 +44,8 @@ namespace CalamityMod.Items.Weapons.Rogue return false; } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) => Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request(Texture + "Glow").Value); + public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Rogue/EclipsesFallGlow.png b/Items/Weapons/Rogue/EclipsesFallGlow.png new file mode 100644 index 0000000000..f0cd455dd5 Binary files /dev/null and b/Items/Weapons/Rogue/EclipsesFallGlow.png differ diff --git a/Items/Weapons/Rogue/Eradicator.cs b/Items/Weapons/Rogue/Eradicator.cs index 3a90a57e57..2283706320 100644 --- a/Items/Weapons/Rogue/Eradicator.cs +++ b/Items/Weapons/Rogue/Eradicator.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 62; Item.height = 58; - Item.damage = 563; + Item.damage = 620; Item.noMelee = true; Item.noUseGraphic = true; Item.autoReuse = true; @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override float StealthDamageMultiplier => 0.5f; + public override float StealthDamageMultiplier => 0.75f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Rogue/ExecutionersBlade.cs b/Items/Weapons/Rogue/ExecutionersBlade.cs index 3ace052a76..3041d19896 100644 --- a/Items/Weapons/Rogue/ExecutionersBlade.cs +++ b/Items/Weapons/Rogue/ExecutionersBlade.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetDefaults() { Item.width = 64; - Item.damage = 188; + Item.damage = 225; Item.noMelee = true; Item.noUseGraphic = true; Item.useTime = 3; @@ -41,19 +41,15 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/Rogue/ExecutionersBladeGlow").Value); } - public override bool AdditionalStealthCheck() => counter == 0; + public override float StealthDamageMultiplier => 0.6f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - bool usingStealth = player.Calamity().StealthStrikeAvailable() && counter == 0; + bool usingStealth = player.Calamity().StealthStrikeAvailable(); int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); if (usingStealth && stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; - - counter++; - if (counter >= Item.useAnimation / Item.useTime) - counter = 0; return false; } diff --git a/Items/Weapons/Rogue/RadiantStar.cs b/Items/Weapons/Rogue/RadiantStar.cs index 980671fdb9..5f914b488f 100644 --- a/Items/Weapons/Rogue/RadiantStar.cs +++ b/Items/Weapons/Rogue/RadiantStar.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Items.Weapons.Rogue { public override void SetDefaults() { - Item.width = 52; - Item.height = 48; + Item.width = 54; + Item.height = 54; Item.damage = 55; //33 Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Rogue/RadiantStar.png b/Items/Weapons/Rogue/RadiantStar.png index e29e6807b2..d1e248a2f9 100644 Binary files a/Items/Weapons/Rogue/RadiantStar.png and b/Items/Weapons/Rogue/RadiantStar.png differ diff --git a/Items/Weapons/Rogue/UtensilPoker.cs b/Items/Weapons/Rogue/UtensilPoker.cs index 1ace51a26d..dba6b5b87e 100644 --- a/Items/Weapons/Rogue/UtensilPoker.cs +++ b/Items/Weapons/Rogue/UtensilPoker.cs @@ -5,6 +5,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Particles; namespace CalamityMod.Items.Weapons.Rogue { @@ -45,23 +46,23 @@ namespace CalamityMod.Items.Weapons.Rogue } else { - int utensil = ModContent.ProjectileType(); + type = ModContent.ProjectileType(); double dmgMult = 1D; float kbMult = 1f; - switch (Main.rand.Next(3)) + switch (counter) { case 0: - utensil = ModContent.ProjectileType(); + type = ModContent.ProjectileType(); dmgMult = 1.1; kbMult = 2f; break; case 1: - utensil = ModContent.ProjectileType(); + type = ModContent.ProjectileType(); dmgMult = 1.2; kbMult = 1f; break; case 2: - utensil = ModContent.ProjectileType(); + type = ModContent.ProjectileType(); dmgMult = 1D; kbMult = 1f; break; @@ -70,7 +71,8 @@ namespace CalamityMod.Items.Weapons.Rogue } damage = (int)(damage * dmgMult); knockback = knockback * kbMult; - } + + } } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) @@ -80,9 +82,8 @@ namespace CalamityMod.Items.Weapons.Rogue int idx = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); if (idx.WithinBounds(Main.maxProjectiles)) Main.projectile[idx].Calamity().stealthStrike = mp.StealthStrikeAvailable(); - counter++; - if (counter == 3) + if (counter >= 3) counter = 0; return false; } diff --git a/Items/Weapons/Summon/BloodClotStaff.cs b/Items/Weapons/Summon/BloodClotStaff.cs index 4d53e483aa..0636ef149b 100644 --- a/Items/Weapons/Summon/BloodClotStaff.cs +++ b/Items/Weapons/Summon/BloodClotStaff.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public override void SetDefaults() { - Item.damage = 7; + Item.damage = 9; Item.mana = 10; Item.width = 58; Item.height = 64; diff --git a/Items/Weapons/Summon/DankStaff.cs b/Items/Weapons/Summon/DankStaff.cs index c1062c2e63..e56b5e9522 100644 --- a/Items/Weapons/Summon/DankStaff.cs +++ b/Items/Weapons/Summon/DankStaff.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public override void SetDefaults() { - Item.damage = 7; + Item.damage = 9; Item.mana = 10; Item.width = 58; Item.height = 58; diff --git a/Items/Weapons/Summon/HerringStaff.cs b/Items/Weapons/Summon/HerringStaff.cs index 4f18837d2d..28fdad0288 100644 --- a/Items/Weapons/Summon/HerringStaff.cs +++ b/Items/Weapons/Summon/HerringStaff.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public override void SetDefaults() { - Item.damage = 17; + Item.damage = 15; Item.knockBack = 1.25f; Item.mana = 10; diff --git a/Items/Weapons/Summon/SandSharknadoStaff.cs b/Items/Weapons/Summon/SandSharknadoStaff.cs index 568f0131ee..95807064b4 100644 --- a/Items/Weapons/Summon/SandSharknadoStaff.cs +++ b/Items/Weapons/Summon/SandSharknadoStaff.cs @@ -11,11 +11,11 @@ namespace CalamityMod.Items.Weapons.Summon public class SandSharknadoStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; - #region Other stats for easy modifcation + #region Other stats for easy modification - public const float ProjVel = 30f; + public const float ProjSpeed = 30f; - public const float FireSpeed = 120f; // In frames. 60 frames = 2 seconds. + public const float FireSpeed = 50f; // In frames. 60 frames = 1 second. #endregion diff --git a/Items/Weapons/Summon/StormjawStaff.cs b/Items/Weapons/Summon/StormjawStaff.cs index 28e74b34be..f32049a30c 100644 --- a/Items/Weapons/Summon/StormjawStaff.cs +++ b/Items/Weapons/Summon/StormjawStaff.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public override void SetDefaults() { - Item.damage = 8; + Item.damage = 11; Item.mana = 10; Item.width = 32; Item.height = 32; diff --git a/Items/Weapons/Summon/VileFeeder.cs b/Items/Weapons/Summon/VileFeeder.cs index 8bbeba057f..c42b8e20d1 100644 --- a/Items/Weapons/Summon/VileFeeder.cs +++ b/Items/Weapons/Summon/VileFeeder.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Summon public class VileFeeder : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; - public static int BaseDamage = 9; + public static int BaseDamage = 14; public override void SetDefaults() { diff --git a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson index ba3e243db0..77baa3201a 100644 --- a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson +++ b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson @@ -105,7 +105,7 @@ PestilentSlime: The virus hunts for any openings within one’s body to reprogra PlaguebringerMiniboss: Nothing can escape the Plague; everything is either assimilated or culled. Such is the case of queen bees. While strong enough to stave off plagued creatures, they are often forced to abandon their hives due to their subjects becoming infected. This leaves their larvae to be overtaken by nanites, and soon after, a plaguebringer is born. PlagueCharger: Spawn of the plaguebringers, these were born already taken by Draedon’s nanomachines. Nanites ensure they reach adulthood in a matter of hours by supercharging their aging process, even if this means their lifespan can be counted in days. Yet, this is exactly what makes them the perfect dispensable soldiers. Plagueshell: A turtle’s shell and nervous system are intertwined, making giant tortoises ideal targets for the Plague. Whatever pain is caused by the process of drilling into their shells is rapidly anesthetized, putting the tortoises under control without a single protest. -Viruling: Unlike derplings, who use their proboscis to drain the blood of other creatures, virulings use theirs by using it to inject the plague directly into their victims. Aside from the plaguebringers themselves, no creature is nearly as efficient at contaminating the local wildlife. +Viruling: Unlike derplings, who use their proboscis to drain the blood of other creatures, virulings use theirs to inject the plague directly into their victims. Aside from the plaguebringers themselves, no creature is nearly as efficient at contaminating the local wildlife. //Sulphur Sea Enemies AnthozoanCrab: Though disguised as simple rocks, they are capable of hurling entire boulders at creatures with ease, and will retreat swiftly if approached. Elsewhere, a creature such as this would thrive due to its might; yet in such a hostile environment as this, this much is required merely to survive. AquaticUrchin: Closely related to sea urchins, aquatic urchins have been forced to adapt to the acidic water and radioactive waste. Normally their venomous spikes would normally deter predators, but in the environment it lives in, a painful meal is still a meal. Nothing in this sea can afford to be a picky eater. @@ -139,7 +139,7 @@ DarkEnergy: - DesertNuisance: Though these serpents are of the Desert Scourge’s species, they are notably younger and less developed. Choosing to hunt in a pack with the large scourge due to this weakness, many have seen them tear apart prey not unlike the piranhas that once populated the former sea. CosmicGuardian: Though of the same species as the nameless serpent, their minds and functions are far more basic. They possess very little will of their own and blindly follow the orders of their gluttonous master. HiveTumor: This tumor acts as the brain of the putrid wasteland, being all that is left of the minds of the slain gods that lay there. The creatures of the Corruption exist to protect it, and those who attempt to harm it rarely live to tell the tale. -AquaticAberration: ASpawn of the immense Leviathan, their lifespan can be measured in hours. All they know is how to hunt for their masters. Even non-aquatic life is well within their reach, due to their uncanny ability to fly through air just as easily as swimming through water. +AquaticAberration: A spawn of the immense Leviathan, their lifespan can be measured in hours. All they know is how to hunt for their masters. Even non-aquatic life is well within their reach, due to their uncanny ability to fly through air just as easily as swimming through water. LeviathanStart: A lure created by the Water Elemental, Anahita. It sings so sweetly, its voice full of promise and warmth, but beware: follow the siren’s call at your own peril. PerforatorCyst: This twitching and convulsing pile of gore acts as the heart of the Perforator Hive, harvesting what small amount of diluted Ichor flowing through the Crimson is left and feeding it to the Hive. Little else is known about it, for those who dare to disturb it have become indistinguishable from the landscape. CosmicLantern: These lanterns possess a magical, distorted flame that radiates no heat whatsoever. If one looks closely into their fire, they may see another world entirely. diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 772c052271..83f5f3c1ea 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -754,7 +754,7 @@ KamiBuff: { Mushy: { DisplayName: Mushy - Description: Increased defense by 6 and life regen by 2 + Description: Increased defense by 6 and life regen by 1HP/s } PhantomicEmpowerment: { @@ -1479,12 +1479,12 @@ WulfrumDroidBuff: { PinkJellyRegen: { DisplayName: Pink Jelly Regen - Description: The power of goo refreshes you, life regen increased by 4 + Description: The power of goo refreshes you, life regen increased by 2HP/s } GreenJellyRegen: { DisplayName: Green Jelly Regen - Description: The regenerative goo empowers you, life regen increased by 5 + Description: The regenerative goo empowers you, life regen increased by 2.5HP/s } AbsorberRegen: { @@ -1492,7 +1492,7 @@ AbsorberRegen: { Description: ''' You are blessed by the culmimation of nature's powers - Life regen increased by 6, damage increased by 10%, damage reduction increased by 7% + Life regen increased by 3HP/s, damage increased by 8%, damage reduction increased by 5% ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Configs.hjson b/Localization/en-US/Mods.CalamityMod.Configs.hjson index eba58802b8..e15c05bcc1 100644 --- a/Localization/en-US/Mods.CalamityMod.Configs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Configs.hjson @@ -71,7 +71,6 @@ CalamityConfig: { ''' Gives the player a very weak dash by default that requires no equipment or items to use. This dash will be replaced by any other available dash, including those from other mods. - Calamity is balanced around this setting being enabled. ''' } @@ -423,4 +422,4 @@ CalamityConfig: { Label: "[i:Book] Wiki Status Message" Tooltip: Enable or disable the status message promoting the Official Calamity Wiki that plays on world entry. } -} +} \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 5cd7eda970..2153fdf732 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -74,7 +74,7 @@ Affliction: { DisplayName: Affliction Tooltip: ''' - Gives you and all other players on your team +1 life regen, + Gives you and all other players on your team +0.5 HP/s life regen, +10% max life, 7% damage reduction, 13 defense and 10% increased damage ''' } @@ -115,9 +115,12 @@ AmbrosialAmpoule: { DisplayName: Ambrosial Ampoule Tooltip: ''' - You emit light - 5% increased damage reduction and increased life regen - Grants immunity to the Frozen, Chilled, Frostburn, Cursed Inferno and Burning Blood debuffs + +70 max life + Grants +2 to +6 HP/s life regen based on missing health + Provides life regeneration equivalent to standing in Honey + Standing still grants extremely powerful regen + Halves how long you are afflicted with fire and sickness debuffs + You emit yellow light if visibility is enabled ''' } @@ -152,7 +155,7 @@ AngelicAlliance: { Call upon the force of heaven to empower your attacks and minions Courage, Enlightenment, Bliss. United in Judgement +2 max minions, 15% increased summon damage, and 8% increased damage to all other classes - Life regeneration is boosted while jumping + +2 HP/s life regen while airborne using wings Press [KEY] to grace yourself in divinity for 15 seconds While under the effects of Divine Bless, for every minion you have, an archangel shall be summoned to aid you in combat Each spawned angel will instantly heal you for two health @@ -218,7 +221,7 @@ AsgardianAegis: { ''' Grants immunity to knockback Immune to most debuffs - +40 max life and increased life regeneration + +40 max life and +0.5 HP/s life regen Grants a cosmic inferno dash which can slam through enemies without taking damage Can be used to ram enemies +20 defense while submerged in liquid @@ -237,14 +240,22 @@ AsgardsValor: { ''' } -AstralArcanum: { - DisplayName: Astral Arcanum +Purity: { + DisplayName: Purity Tooltip: ''' - Provides immunity to the astral infection debuff - Boosts life regen even while under the effects of a damaging debuff - While under the effects of a damaging debuff you will gain 15 defense - Press [KEY] to toggle teleportation UI while no bosses are alive + +100 max life + Grants +3 to +7 HP/s life regen based on missing health + Provides life regeneration equivalent to standing in Honey + Standing still grants extremely powerful regen + Grants 20 defense and continuous healing while afflicted with any debuff + The healing eventually slows down if debuffed for an extended period of time + Massively boosts natural life regen while afflicted with any debuff + Each debuff beyond the first grants 8 additional defense + Granted defense fades away slowly when not afflicted with any debuffs + Makes weak damage over time debuffs harmless and halves the duration of all but the strongest debuffs + You emit shining blue light if visibility is enabled + 'A once putrid crystal, now glimmering with immaculate purity' ''' } @@ -316,8 +327,9 @@ BloomStone: { DisplayName: Bloom Stone Tooltip: ''' - You quickly regenerate life while on the ground - This effect works best during daytime + Grants between +1 HP/s and +3 HP/s life regen depending on time of day + Accelerates life regen based on time of day + Both of these effects are maximized from noon to sunset Flowers grow if you are standing on grass Random dye plants will grow while standing on grassless dirt One of the ancient relics @@ -347,13 +359,17 @@ Calamity: { ''' } -CelestialJewel: { - DisplayName: Celestial Jewel +InfectedJewel: { + DisplayName: Infected Jewel Tooltip: ''' - Boosts life regen even while under the effects of a damaging debuff - While under the effects of a damaging debuff you will gain 11 defense - Press [KEY] to teleport to a random location while no bosses are alive + +1 HP/s life regen + Grants 16 defense and +2 HP/s life regen while afflicted with any debuff + Massively boosts natural life regen while afflicted with any debuff + Granted defense fades away quickly when not afflicted with any debuffs + Each debuff beyond the first grants 5 additional defense + Makes the Astral Infection debuff harmless + 'A beautiful gemstone tarnished by spaceborne rot' ''' } @@ -431,7 +447,7 @@ Baroclaw: { Tooltip: ''' 10% increased damage - Enemies that hit you take high damage and are inflicted with Armor Crunch and Crush Depth for a long time + Enemies that hit you take high damage and are inflicted with Armor Crunch and Crush Depth ''' } @@ -448,8 +464,9 @@ CrownJewel: { DisplayName: Crown Jewel Tooltip: ''' - Boosts life regen even while under the effects of a damaging debuff - While under the effects of a damaging debuff you will gain 8 defense + +1 HP/s life regen + You gain an additional +1.5 HP/s life regen while afflicted with any debuff + Massively boosts natural life regen while afflicted with any debuff ''' } @@ -481,7 +498,7 @@ DaawnlightSpiritOrigin: { } DarkGodsSheath: { - DisplayName: Dark God's Sheath + DisplayName: Dark Matter Sheath Tooltip: ''' +10 maximum stealth @@ -496,11 +513,11 @@ DarkSunRing: { Tooltip: ''' 12% increase to damage - +1 life regen and +2 max minions + +0.5 HP/s life regen and +2 max minions Increased minion knockback - During the day the player has +4 life regen - During the night the player has +20 defense - During an eclipse the player has +2 life regen and +10 defense + During the day, grants +2 HP/s life regen + During the night, grants +20 defense + During an eclipse, grants +1 HP/s life regen and +10 defense 'Contains the power of the dark sun' ''' } @@ -528,7 +545,8 @@ DeificAmulet: { Tooltip: ''' Causes stars to fall and grants increased immune time when damaged - Provides life regeneration and reduces the cooldown of healing potions + +0.5 HP/s life regen + Reduces the cooldown of healing potions ''' } @@ -781,7 +799,7 @@ FungalSymbiote: { Tooltip: ''' You grow mushrooms on the grass beneath you - Consuming mushrooms provides the Mushy buff, increasing defense by 6 and life regen by 2 + Consuming mushrooms provides the Mushy buff, increasing defense by 6 and granting 1 HP/s life regen All mushroom-based weapons deal 10% more damage and emit non-damaging mushrooms ''' } @@ -861,7 +879,7 @@ GrandGelatin: { 10% increased movement speed and jump speed Using a healing potion will spawn a cleansing aura Walking into the aura removes all debuffs and defense damage one time - The aura provides increased life regen for all players inside for 8 seconds + The aura grants +2.5 HP/s life regen for all players inside for 8 seconds ''' } @@ -934,10 +952,10 @@ HoneyDew: { DisplayName: Honey Dew Tooltip: ''' - 5% increased damage reduction, +9 defense and increased life regen while in the Jungle - Poison and Venom immunity - Honey-like life regen with no speed penalty - Most bee/hornet enemies and projectiles do 75% damage to you + +30 max life + Provides life regeneration equivalent to standing in Honey + Standing still in Honey grants extremely powerful regen + Halves how long you are afflicted with sickness debuffs ''' } @@ -1001,7 +1019,7 @@ LifeJelly: { Tooltip: ''' Using a healing potion will spawn a lingering aura - The aura provides increased life regen for all players inside for 5 seconds + The aura grants +2 HP/s life regen for all players inside for 5 seconds ''' } @@ -1009,8 +1027,10 @@ LivingDew: { DisplayName: Living Dew Tooltip: ''' - 5% increased damage reduction, +5 defense, and increased life regen while in the Jungle - Immunity to Poison + +50 max life + Provides life regeneration equivalent to standing in Honey + Standing still in Honey grants extremely powerful regen + Halves how long you are afflicted with fire and sickness debuffs ''' } @@ -1048,7 +1068,7 @@ ManaPolarizer: { Tooltip: ''' Increases max mana by 50 and magic damage by 6% - Life regen lowered by 3 if mana is above 50% of its maximum + -1.5 HP/s life regen if mana is above 50% of its maximum Grants spectre healing, the amount healed scales with your mana The healing only works while holding a magic weapon The more mana you have, the more you heal @@ -1220,8 +1240,8 @@ PermafrostsConcoction: { Tooltip: ''' Increases maximum mana by 50 and reduces mana cost by 15% - Increases life regen as life decreases - Increases life regen when afflicted with any fire debuff + +0.5 HP/s life regen below half health, +1 HP/s when below 25% health and +2 HP/s when below 10% health + +3 HP/s life regen while afflicted with any fire debuff 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 ''' @@ -1311,7 +1331,11 @@ QuiverofNihility: { RadiantOoze: { DisplayName: Radiant Ooze - Tooltip: You emit light and regen life more quickly + Tooltip: + ''' + Grants +2 to +6 HP/s life regen based on missing health + You emit yellow light if visibility is enabled + ''' } RaidersTalisman: { @@ -1328,7 +1352,7 @@ RampartofDeities: { Tooltip: ''' Causes stars to fall and gives increased immune time when damaged - Provides life regeneration and reduces the cooldown of healing potions + +0.5 HP/s life regen and reduces the cooldown of healing potions Absorbs 15% of damage done to players on your team This effect is only active above 25% life Grants immunity to knockback @@ -1350,7 +1374,7 @@ Regenator: { DisplayName: Regenator Tooltip: ''' - Greatly improves life regeneration + +6 HP/s life regen and massively accelerated natural life regen However, your health cannot exceed 50% of its maximum ''' } @@ -1420,7 +1444,7 @@ SandCloak: { Tooltip: ''' 5% increased movement speed - Press [KEY] to consume 10% of your maximum stealth to create a protective dust veil which provides +6 defense and +2 life regen + Press [KEY] to consume 10% of your maximum stealth to create a protective dust veil which provides +6 defense and +1 HP/s life regen This effect has a 30 second cooldown before it can be used again ''' } @@ -1449,7 +1473,7 @@ ShatteredCommunity: { ''' 'Ruined by unknowable hatred, it still contains (most of) the power of The Community...' Increases damage by 10% and critical strike chance by 5% - Increases max health by 10%, damage reduction by 5%, defense by 10 and life regen by 2 + Increases max health by 10%, damage reduction by 5%, defense by 10, and life regen by 1 HP/s Increases movement speed by 10% and flight time by 20% [RAGEDESC] Taking damage gives rage, this effect is not hindered by your defensive stats @@ -1466,6 +1490,7 @@ ShatteredCommunity: { When Rage is maxed, press {0} for a temporary damage boost ''' RageModified: You generate rage over time and rage does not fade out of combat + LevelUpText: The Community cracks... } ShieldoftheHighRuler: { @@ -1487,7 +1512,7 @@ ShieldoftheOcean: { Tooltip: ''' Increased defense by 5 when submerged in liquid - Increases movement speed and life regen while wearing the Victide armor + 10% increased movement speed and +1 HP/s life regen while wearing Victide armor ''' } @@ -1702,10 +1727,10 @@ TheAbsorber: { Tooltip: ''' 10% increased movement and jump speed - Enemies take immense damage when they touch you and are afflicted with a debuff that reduces damage reduction significantly + Enemies take immense damage when they touch you and are afflicted with a damaging sickeness debuff that reduces damage reduction significantly Using a healing potion will spawn a cleansing aura Walking into the aura removes all debuffs and defense damage one time - The aura provides greatly increased life regen, damage, and damage reduction for all players inside for 15 seconds + The aura grants +3 HP/s life regen, +8% damage, and +5% damage reduction for all players inside for 10 seconds 5% of the damage from enemy attacks is absorbed and converted into healing ''' } @@ -1760,7 +1785,7 @@ TheCommunity: { ''' Increases damage by {0}% and critical strike chance by {1}% Increases max health by {2}%, damage reduction by {3}%, and defense by {4} - Increases life regen by {5} while under damage over time effects + +{5} HP/s life regen while suffering from damage over time debuffs Increases movement speed by {6}% and flight time by {7}% Become more powerful as you defeat bosses ({8}% Power) ''' @@ -1773,7 +1798,7 @@ TheEvolution: { You reflect projectiles when they hit you Reflected projectiles deal no damage to you This reflect has a 90 second cooldown which is shared with all other dodges and reflects - If this effect triggers you get a health regeneration boost for 5 seconds + After reflecting something, grants +1 HP/s life regen and accelerated life regen for 5 seconds If the same enemy projectile type hits you again you will resist its damage by 15% ''' } @@ -1793,7 +1818,7 @@ TheSponge: { ''' Projects a quantum foam barrier that absorbs up to 180 damage The barrier grants 30 defense and reduces damage taken by 30% while active - The barrier starts recharging 6 seconds after being hit + The barrier starts recharging 9 seconds after being hit Recharging from zero to full charge takes 6 seconds Being hit again while recharging restarts the charge timer The barrier's color will change to match your team selection as needed @@ -1826,7 +1851,7 @@ TrinketofChi: { Tooltip: ''' Provides 10% damage reduction after not being hit for 15 seconds, this is removed when you are hit - Provides 2 life regen for you and everyone on your team + +1 HP/s life regen for you and everyone on your team ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson index 5c1780a4f0..7066cfd499 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson @@ -172,7 +172,7 @@ FathomSwarmerBreastplate: { ''' 6% increased damage reduction 6% increased summon damage - Boosted defense and regen increased while submerged in liquid + Increases defense by 10 and grants +2.5 HP/s life regen while submerged in liquid Reduces defense loss within the Abyss ''' } @@ -488,11 +488,11 @@ ReaverHeadTank: { ''' 15% increased damage reduction but 30% decreased damage +50 max life - Passively regenerates one health point every second + Restores 1 HP every second, this applies separately from life regen ''' SetBonus: ''' - +10 defense and +3 life regen + +10 defense and +1.5 HP/s life regen Enemies are more likely to target you Reduces the life regen lost from damage over time debuffs by 20% All attacks have a small chance to steal life and speed up the rate of life regen diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson index 62df2dd5c0..1ef58d16aa 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson @@ -82,7 +82,7 @@ BloodflareBodyArmor: { ''' CommonSetBonus: ''' - Greatly increases life regen + Greatly increased life regen, equivalent to Crimson armor Enemies below 50% life drop a heart when struck This effect has a 5 second cooldown ''' @@ -152,7 +152,7 @@ BloodflareHeadSummon: { 50% increased summon damage and +3 max minions Summons polterghast mines to circle you At 90% life and above you gain 10% increased summon damage - At 50% life and below you gain 20 defense and 2 life regen + At 50% life and below you gain 20 defense and +1 HP/s life regen ''' } @@ -163,7 +163,7 @@ DemonshadeBreastplate: { 25% increased melee speed, 15% increased damage and critical strike chance Enemies take ungodly damage when they touch you Increased max life and mana by 200 - Standing still lets you absorb the shadows and boost your life regen + Standing still absorbs shadows to grant exponentially accelerating life regen ''' } @@ -233,7 +233,7 @@ FearmongerGreathelm: { 20% increased summon damage and +2 max minions Minions no longer deal less damage while wielding non-summoner weapons Immunity to all forms of frost and flame - All minion attacks grant colossal life regeneration + Minion attacks grant +3.5 HP/s life regen and massively accelerate life regen 15% increased damage reduction during the Pumpkin and Frost Moons This extra damage reduction ignores the soft cap ''' @@ -288,11 +288,11 @@ GemTechHeadgear: { GreenGemInfo: "[i:Emerald] The green gem provides increased ranged stats and causes flechettes to fly swiftly towards targets when they are damaged by a ranged projectile" BlueGemInfo: "[i:Sapphire] The blue gem grants {0} extra maximum minions, increased summon damage, and negates the summon damage penalty while wielding non-summoner weapons" PurpleGemInfo: "[i:Amethyst] The violet gem grants {0} extra maximum mana, increased magic stats, and makes mana rapidly regenerate when holding a non-magic weapon" - PinkGemInfo: "[i:Diamond] The pink base gem grants {0} extra defense, extra damage reduction, increased movement speed, jump speed, and +{1} life regen" + PinkGemInfo: "[i:Diamond] The pink base gem grants {0} extra defense, extra damage reduction, increased movement speed, jump speed, and +{1} HP/s life regen" GemBonusInfo: ''' - When all gems exist simultaneously, hitting a target with any weapon grants you +{0} life regen for {1} seconds - This is increased to +{2} life regen if a weapon of another class is used during that {1} second period for {3} seconds + When all gems exist simultaneously, hitting a target with any weapon grants you +{0} HP/s life regen for {1} seconds + This is increased to +{2} HP/s life regen if a weapon of another class is used during that {1} second period for {3} seconds ''' } @@ -491,7 +491,7 @@ TarragonBreastplate: { Tooltip: ''' 10% increased damage and 5% increased critical strike chance - +2 life regen and +40 max life + +1 HP/s life regen and +40 max life ''' CommonSetBonus: ''' @@ -554,8 +554,8 @@ TarragonHeadRogue: { SetBonus: ''' +115 maximum stealth - After every 25 rogue critical hits you will gain 3 seconds of damage immunity - This effect can only occur once every 30 seconds + After every 50 rogue critical hits you will gain 2.5 seconds of damage immunity + This effect has a cooldown of 25 seconds While under the effects of a debuff you gain 10% increased rogue damage ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson index c27cf40941..547aa65183 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson @@ -238,7 +238,7 @@ VictideGreaves: { VictideHeadMagic: { DisplayName: Victide Hermit Helmet Tooltip: 5% increased magic damage - SetBonus: +3 life regen and 10% increased magic damage while submerged in liquid + SetBonus: +1.5 HP/s life regen and 10% increased magic damage while submerged in liquid } VictideHeadMelee: { @@ -247,14 +247,14 @@ VictideHeadMelee: { SetBonus: ''' Enemies are more likely to target you - +3 life regen and 10% increased melee damage while submerged in liquid + +1.5 HP/s life regen and 10% increased melee damage while submerged in liquid ''' } VictideHeadRanged: { DisplayName: Victide Coral Turban Tooltip: 5% increased ranged damage - SetBonus: +3 life regen and 10% increased ranged damage while submerged in liquid + SetBonus: +1.5 HP/s life regen and 10% increased ranged damage while submerged in liquid } VictideHeadRogue: { @@ -263,7 +263,7 @@ VictideHeadRogue: { SetBonus: ''' +60 maximum stealth - +3 life regen and 10% increased rogue damage while submerged in liquid + +1.5 HP/s life regen and 10% increased rogue damage while submerged in liquid ''' } @@ -274,7 +274,7 @@ VictideHeadSummon: { ''' +1 max minion Summons a sea snail to protect you - +3 life regen and 10% increased summon damage while submerged in liquid + +1.5 HP/s life regen and 10% increased summon damage while submerged in liquid ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index d2815713ef..0f2df3541f 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -3930,70 +3930,98 @@ HardenedEutrophicSand: { FireTurret: { DisplayName: Fire Turret - Tooltip: "" + Tooltip: + ''' + Roasts nearby enemies with a flamethrower at full blast + Cannot attack while a boss is alive + ''' } HostileFireTurret: { DisplayName: Hostile Fire Turret - Tooltip: "" + Tooltip: Roasts nearby players with a flamethrower at full blast } HostileIceTurret: { DisplayName: Hostile Ice Turret - Tooltip: "" + Tooltip: Lobs fragile ice mist bombs at nearby players } HostileLabTurret: { DisplayName: Hostile Lab Turret - Tooltip: "" + Tooltip: Shoots laser beams at nearby players } HostileLaserTurret: { DisplayName: Hostile Laser Turret - Tooltip: "" + Tooltip: Blasts nearby players with lightning-fast laser beams } HostileOnyxTurret: { DisplayName: Hostile Onyx Turret - Tooltip: "" + Tooltip: Shoots a shotgun spread of bullets at nearby players } HostilePlagueTurret: { DisplayName: Hostile Plague Turret - Tooltip: "" + Tooltip: Ejects homing plague missiles towards nearby players } HostileWaterTurret: { DisplayName: Hostile Water Turret - Tooltip: "" + Tooltip: Shoots high-speed water blasts at nearby players } IceTurret: { DisplayName: Ice Turret - Tooltip: "" + Tooltip: + ''' + Lobs fragile ice mist bombs at nearby enemies + Cannot attack while a boss is alive + ''' } LabTurret: { DisplayName: Lab Turret - Tooltip: "" + Tooltip: + ''' + Shoots laser beams at nearby enemies + Cannot attack while a boss is alive + ''' } LaserTurret: { DisplayName: Laser Turret - Tooltip: "" + Tooltip: + ''' + Blasts nearby enemies with lightning-fast laser beams + Cannot attack while a boss is alive + ''' } OnyxTurret: { DisplayName: Onyx Turret - Tooltip: "" + Tooltip: + ''' + Shoots a shotgun spread of bullets at nearby enemies + Cannot attack while a boss is alive + ''' } PlagueTurret: { DisplayName: Plague Turret - Tooltip: "" + Tooltip: + ''' + Ejects homing plague missiles towards nearby enemies + Cannot attack while a boss is alive + ''' } WaterTurret: { DisplayName: Water Turret - Tooltip: "" + Tooltip: + ''' + Shoots high-speed water blasts at nearby enemies + Cannot attack while a boss is alive + ''' } \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index b694abfb31..b1e804aab3 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -180,7 +180,7 @@ BloodyMary: { Tooltip: ''' 10% increased damage and movement speed during a Blood Moon - Reduces life regen by 4 and defense by 4% + Reduces life regen by 2 HP/s and defense by 4% [c/B00BA5:'Extra spicy... and bloody!'] ''' } @@ -189,7 +189,7 @@ CaribbeanRum: { DisplayName: Caribbean Rum Tooltip: ''' - Increases life regen by 2, movement speed by 10% and wing flight time by 20% + Increases life regen by 1 HP/s, movement speed by 10% and wing flight time by 20% Makes you floaty and reduces defense by 10% [c/B00BA5:'Why is the rum gone?'] ''' @@ -210,7 +210,7 @@ Everclear: { Tooltip: ''' 25% increased damage - Reduces life regen by 10 and defense by 30% + Reduces life regen by 5 HP/s and defense by 30% [c/B00BA5:'This is the most potent booze I have, be careful with it.'] ''' } @@ -220,7 +220,7 @@ EvergreenGin: { Tooltip: ''' Multiplies all sickness and water-related debuff damage by 1.25x - Reduces life regen by 1 + Reduces life regen by 0.5 HP/s [c/B00BA5:'It tastes like a Christmas tree, if you can imagine that.'] ''' } @@ -240,7 +240,7 @@ Fireball: { Tooltip: ''' Multiplies all fire-based debuff damage by 1.25x - Reduces life regen by 1 + Reduces life regen by 0.5 HP/s [c/B00BA5:'A great-tasting cinnamon whiskey.'] ''' } @@ -259,7 +259,7 @@ Margarita: { Tooltip: ''' Halves the duration of most harmful debuffs - Reduces defense by 6% and life regen by 1 + Reduces defense by 6% and life regen by 0.5 HP/s 3 minute duration [c/B00BA5:'One of the best drinks ever created, enjoy it while it lasts.'] ''' @@ -270,7 +270,7 @@ Moonshine: { Tooltip: ''' Increases defense by 10 and damage reduction by 3% - Reduces life regen by 1 + Reduces life regen by 0.5 HP/s [c/B00BA5:'This stuff is pretty strong, but I'm sure you can handle it.'] ''' } @@ -280,7 +280,7 @@ MoscowMule: { Tooltip: ''' Increases damage by 9%, knockback by 50% and critical strike chance by 3% - Reduces life regen by 4 + Reduces life regen by 2 HP/s [c/B00BA5:'I once heard the copper mug can be toxic and I told 'em, 'listen dummy, I'm already poisoning myself!''] ''' } @@ -299,7 +299,7 @@ RedWine: { DisplayName: Red Wine Tooltip: ''' - Reduces life regen by 1 for 15 seconds + Reduces life regen by 0.5 HP/s for 15 seconds [c/B00BA5:'Too dry for my taste.'] ''' } @@ -308,7 +308,7 @@ Rum: { DisplayName: Rum Tooltip: ''' - Increases life regen by 2 and movement speed by 10% + Increases life regen by 1 HP/s and movement speed by 10% Reduces defense by 5% [c/B00BA5:'Sweet and potent, just how I like it.'] ''' @@ -319,7 +319,7 @@ Screwdriver: { Tooltip: ''' Multiplies piercing projectile damage by 1.05x - Reduces life regen by 1 + Reduces life regen by 0.5 HP/s [c/B00BA5:'Do you have a screw loose?'] ''' } @@ -330,7 +330,7 @@ StarBeamRye: { ''' Increases max mana by 50, magic damage by 8%, and reduces mana usage by 10% - Reduces defense by 6% and life regen by 2 + Reduces defense by 6% and life regen by 1 HP/s [c/B00BA5:'Made from some stuff I found near the Astral Meteor crash site. Don't worry, it's safe, trust me...'] ''' } @@ -340,7 +340,7 @@ Tequila: { Tooltip: ''' Increases knockback by 10%, crit chance by 4% and defense by 5 during daytime - Reduces life regen by 1 + Reduces life regen by 0.5 HP/s [c/B00BA5:'Great for mixing up daytime drinks.'] ''' } @@ -350,7 +350,7 @@ TequilaSunrise: { Tooltip: ''' Increases knockback by 20%, crit chance by 8% and defense by 10 during daytime - Reduces life regen by 2 + Reduces life regen by 1 HP/s [c/B00BA5:'The greatest daytime drink I've ever had.'] ''' } @@ -360,7 +360,7 @@ Vodka: { Tooltip: ''' Increases damage by 6% and critical strike chance by 2% - Reduces life regen by 1 and defense by 5% + Reduces life regen by 0.5 HP/s and defense by 5% [c/B00BA5:'The number one alcohol for creating great mixed drinks.'] ''' } @@ -380,7 +380,7 @@ WhiteWine: { Tooltip: ''' Increases magic damage by 8% - Reduces defense by 6% and life regen by 1 + Reduces defense by 6% and life regen by 0.5 HP/s [c/B00BA5:'I drank a full barrel of this stuff once in one night, I couldn't remember who I was the next day.'] ''' } \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson index ef43f00306..68e9863f99 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson @@ -235,7 +235,7 @@ RuneofKos: { Tooltip: ''' An ornate sigil of the Profaned Flame - Hatred yet burns upon its brow + Hatred yet burns upon its brow [SPAWN] Not consumable ''' @@ -307,4 +307,4 @@ YharonEgg: { Not consumable An effigy of a Phoenix Dragon egg, used in worship ''' -} +} \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson index 879b58bb79..2330fb0490 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson @@ -164,7 +164,9 @@ SnakeEyes: { DisplayName: Snake Eyes Tooltip: ''' - Summons a mechanical surveillance drone that flies around enemies and mercilessly zaps them with electricity + Summons a levitating drone which fires piercing, highly calibrated energy bolts + If a bolt hits, the drone will teleport into its path and reflect the bolt + Reflected bolts home in and explode on impact [c/1FFBFF:'Equipped with high-end sensors, little can evade them. Even less are able to escape their ever watchful eyes.] [c/1FFBFF:An excellent bridge between my experiments with the sight-based soul powered machines and my latest project.'] ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index bfe3cc19c2..9b7399e9de 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -734,7 +734,7 @@ SubsumingVortex: { Press to cast a gigantic vortex in front of you with a bias towards the mouse When enemies are near the vortex, it sends multiple fast-moving smaller vortices towards them Releasing fires the vortex towards the mouse if enough time has passed - Damage scales based on how long the vortex was held out + Damage scales based on how long the vortex was held out ''' } @@ -955,4 +955,4 @@ YharimsCrystal: { Tooltip: "[GFB]" TooltipNormal: Fires draconic beams of total annihilation TooltipGFB: ...throughs a pice of dnimite -} +} \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index b1ec787467..b40cc452aa 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -62,7 +62,7 @@ Arbalest: { DisplayName: Arbalest Tooltip: ''' - Fires a volley of 10 high-speed arrows + Fires a volley of 6 high-speed arrows Arrows start off small and grow in size with continuous fire Arrow damage, spread and knockback scale with arrow size ''' @@ -475,8 +475,8 @@ FlarewingBow: { DisplayName: Flarewing Bow Tooltip: ''' - Shoots a spread of 4 arrows - Wooden arrows are converted into bouncing obsidian bats + Shoots a spread of 3 arrows + Wooden arrows are converted into obsidian bats which home in after piercing once ''' } @@ -519,7 +519,7 @@ Galeforce: { } GodsBellows: { - DisplayName: God's Bellows + DisplayName: Dead Sun's Wind Tooltip: 70% chance to save ammo } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index a334f86b58..b75593716d 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -283,7 +283,7 @@ DefectiveSphere: { } DeificThunderbolt: { - DisplayName: Deific Thunderbolt + DisplayName: Twisting Thunder Tooltip: ''' Fires a lightning bolt to electrocute enemies @@ -843,7 +843,7 @@ OrichalcumSpikedGemstone: { PalladiumJavelin: { DisplayName: Palladium Javelin - Tooltip: Stealth strikes split into more javelins and boost life regeneration on hits + Tooltip: Stealth strikes split into more javelins and boost natural life regeneration on hits } Penumbra: { @@ -1337,7 +1337,7 @@ UtensilPoker: { DisplayName: Utensil Poker Tooltip: ''' - Fires random utensils in bursts of three + Fires utensils in bursts of three Stealth strikes replace any utensil with a powerful butcher knife 'Space chickens, that is all' ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson index 85e1ad5db0..c41f64d8b5 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -403,7 +403,7 @@ GlacialEmbrace: { } GodspawnHelixStaff: { - DisplayName: Godspawn Helix Staff + DisplayName: Starspawn Helix Staff Tooltip: Summons astral probes to protect you } @@ -633,7 +633,7 @@ StormjawStaff: { } SunGodStaff: { - DisplayName: Sun God Staff + DisplayName: Vengeful Sun Staff Tooltip: ''' Summons a solar god spirit to protect you diff --git a/Localization/en-US/Mods.CalamityMod.Keybinds.hjson b/Localization/en-US/Mods.CalamityMod.Keybinds.hjson index b37414be9f..2800de597f 100644 --- a/Localization/en-US/Mods.CalamityMod.Keybinds.hjson +++ b/Localization/en-US/Mods.CalamityMod.Keybinds.hjson @@ -5,7 +5,7 @@ AngelicAllianceBlessing.DisplayName: Angelic Alliance Blessing BoosterDash.DisplayName: Booster Dash SpectralVeilTeleport.DisplayName: Spectral Veil Teleport SandCloakEffect.DisplayName: Sand Cloak Effect -AstralArcanumUIToggle.DisplayName: Astral Arcanum UI Toggle +PurityUIToggle.DisplayName: Special Teleport UI Toggle AstralTeleport.DisplayName: Astral Teleport ArmorSetBonus.DisplayName: Armor Set Bonus AdrenalineMode.DisplayName: Adrenaline Mode diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson index 0ba4bae953..ca3c5b88d4 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson @@ -45,6 +45,7 @@ UnstableMatter.DisplayName: Unstable Matter VoltageStream.DisplayName: Voltage Stream WavePounderBoom.DisplayName: Explosion WavePounderProjectile.DisplayName: Wave Pounder +SnakeEyesProjectile.DisplayName: Inescapable Bolt // Environmental AcidDrop.DisplayName: Acid BrimstoneGeyser.DisplayName: Smoke diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson index 4a748ebfc7..bd1b0ec7a5 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson @@ -91,6 +91,7 @@ EclipseMirrorBurst.DisplayName: Eclipse Mirror Flash EclipsesFallMain.DisplayName: Eclipse's Fall EclipsesSmol.DisplayName: Eclipse's Small EclipsesStealth.DisplayName: Eclipse's Fall +EclipseStealthBoom.DisplayName: Eclipse Blast EGloveSpark.DisplayName: Spark ElementalDiskProj.DisplayName: Elemental Disk ElementalDiskSplit.DisplayName: Elemental Disk diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index 7db7b60177..19302dcd1e 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -7,6 +7,7 @@ using CalamityMod.Events; using CalamityMod.Items; using CalamityMod.Particles; using CalamityMod.Particles.Metaballs; +using CalamityMod.Systems; using CalamityMod.UI; using CalamityMod.UI.CalamitasEnchants; using CalamityMod.UI.DraedonSummoning; @@ -521,6 +522,13 @@ namespace CalamityMod return CalamityWorld.armageddon = enabled; } } + + public static void AddCustomDifficulty(DifficultyMode newMode) + { + //Add the new difficulty and recalculate + DifficultyModeSystem.Difficulties.Add(newMode); + DifficultyModeSystem.CalculateDifficultyData(); + } #endregion #region Rogue Class @@ -1702,8 +1710,20 @@ namespace CalamityMod public static bool IsOnPersistentBuffList(int type) => CalamityLists.persistentBuffList.Contains(type); #endregion + #region Venerated Locket Bans + public static bool AddToVeneratedLocketBanlist(int type) + { + if (!CalamityLists.VeneratedLocketBanlist.Contains(type)) + { + CalamityLists.VeneratedLocketBanlist.Add(type); + return true; + } + return false; + } + #endregion + #region Summoner Cross Class Nerf Disabling - public static bool SetSummonerNerfDisabledByMinion(int type, bool disableNerf) + public static bool SetSummonerNerfDisabledByMinion(int type, bool disableNerf) { if (disableNerf && !CalamityLists.DisabledSummonerNerfMinions.Contains(type)) { @@ -1853,6 +1873,16 @@ namespace CalamityMod return new ArgumentException("ERROR: The first argument to \"SetDifficulty\" must be a string."); return SetDifficultyActive(args[1].ToString(), enabled); + + case "AddDifficultyToUI": + if (args.Length < 2) + return new ArgumentException("ERROR: Not enough arguements provided"); + + if (args[1] is not DifficultyMode mode) + return new ArgumentException("ERROR: A class inheriting from 'DifficultyMode' must be provided."); + AddCustomDifficulty(mode); + return null; + case "GetLight": case "GetLightLevel": case "GetLightStrength": @@ -2684,6 +2714,13 @@ namespace CalamityMod DraedonDialogRegistry.DialogOptions.Add(new(inquiry, response, condition)); return null; + case "AddToVeneratedLocketBanlist": + if (args.Length < 2) + return new ArgumentException("ERROR: Not enough arguments!"); + if (args[1] is not int itemType) + return new ArgumentException("ERROR: Must specify a valid item type as an int index of the item."); + return AddToVeneratedLocketBanlist(itemType); + default: return new ArgumentException("ERROR: Invalid method name."); } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 9899b205ec..1c395f9ad6 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -1014,7 +1014,7 @@ namespace CalamityMod.NPCs //Absorber Affliction if (absorberAffliction > 0) { - int baseAbsorberDoTValue = (int)(260 * sicknessDamageMult); + int baseAbsorberDoTValue = (int)(400 * sicknessDamageMult); ApplyDPSDebuff(baseAbsorberDoTValue, baseAbsorberDoTValue / 65, ref npc.lifeRegen, ref damage); } @@ -2690,7 +2690,7 @@ namespace CalamityMod.NPCs if (marked > 0) calcDR *= 0.5f; if (absorberAffliction > 0) - calcDR *= 0.7f; + calcDR *= 0.8f; if (npc.betsysCurse) calcDR *= 0.66f; if (npc.Calamity().kamiFlu > 0) diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 926898b098..b0f2f01e1a 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -179,7 +179,7 @@ namespace CalamityMod.NPCs.Leviathan { SoundID.Zombie38, SoundID.Zombie39, - SoundID.Zombie49 + SoundID.Zombie40 }); if (soundDelay > 0) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 1da386d36d..c4e325877c 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -74,6 +74,9 @@ namespace CalamityMod.Projectiles // If true, this projectile creates impact sparks upon hitting enemies public bool deepcoreBullet = false; + // If true, causes all projectiles fired by this weapon to have homing. Currently used for Arterial Assault. + public bool allProjectilesHome = false; + // Amount of extra updates that are set in SetDefaults. public int defExtraUpdates = -1; @@ -105,6 +108,7 @@ namespace CalamityMod.Projectiles public bool stealthStrike = false; public int stealthStrikeHitCount = 0; public bool extorterBoost = false; + public bool LocketClone = false; // Note: Although this was intended for fishing line colors, I use this as an AI variable a lot because vanilla only has 4 that sometimes are already in use. ~Ben // TODO -- uses of this variable are undocumented and unstable. Remove it from the API surface. @@ -2487,6 +2491,11 @@ namespace CalamityMod.Projectiles confetti.velocity.Y += Main.rand.Next(-50, 51) * 0.05f; } } + + if (allProjectilesHome) + { + CalamityUtils.HomeInOnNPC(projectile, !projectile.tileCollide, 300f, 12f, 20f); + } } } #endregion diff --git a/Projectiles/CalamityGlobalProjectileTweaks.cs b/Projectiles/CalamityGlobalProjectileTweaks.cs index bc232b8b76..183f2cdb7c 100644 --- a/Projectiles/CalamityGlobalProjectileTweaks.cs +++ b/Projectiles/CalamityGlobalProjectileTweaks.cs @@ -129,7 +129,7 @@ namespace CalamityMod.Projectiles { ProjectileID.EnchantedBoomerang, Do(ExtraUpdatesExact(1)) }, { ProjectileID.ExplosiveBullet, standardBulletTweaks }, { ProjectileID.Flamarang, Do(ExtraUpdatesExact(2)) }, - { ProjectileID.Flames, Do(IDStaticIFrames(6), ExtraUpdatesDelta(+1)) }, // Flamethrower + Elf Melter + { ProjectileID.Flames, Do(IDStaticIFrames(10)) }, // Flamethrower + Elf Melter { ProjectileID.FlamingJack, Do(ExtraUpdatesExact(1)) }, { ProjectileID.FlowerPetal, Do(MaxUpdatesExact(4), LocalIFrames(10)) }, // Orichalcum armor { ProjectileID.FlowerPow, Do(ExtraUpdatesExact(1)) }, diff --git a/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs b/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs index cdff65ad8e..9f24c66d94 100644 --- a/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs +++ b/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs @@ -4,6 +4,7 @@ using Terraria; using Terraria.ModLoader; using Terraria.Audio; using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Particles; namespace CalamityMod.Projectiles.DraedonsArsenal { @@ -13,6 +14,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override string Texture => "CalamityMod/Items/Weapons/DraedonsArsenal/PlasmaGrenade"; private static readonly float Gravity = 0.09f; + private float rotate = Main.rand.Next(360); public float Time { @@ -26,27 +28,28 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile.height = 28; Projectile.friendly = true; Projectile.penetrate = 1; - Projectile.timeLeft = 300; + Projectile.timeLeft = 450; Projectile.MaxUpdates = 2; Projectile.DamageType = RogueDamageClass.Instance; } public override void AI() { - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.ToRadians(rotate); Vector2 projectileTop = Projectile.Center + new Vector2(0f, Projectile.height * -0.5f).RotatedBy(Projectile.rotation); if (Time > 10f) Projectile.velocity.Y += Gravity; - if (!Main.dedServ) + if (!Main.dedServ && Main.rand.NextBool()) // 50% chance to spawn smoke { - Dust dust = Dust.NewDustPerfect(projectileTop, 107); - dust.velocity = Projectile.rotation.ToRotationVector2().RotatedByRandom(0.35f) * Main.rand.NextFloat(2f, 4f); - dust.velocity += Projectile.velocity * 0.25f; - dust.scale = Main.rand.NextFloat(0.95f, 1.3f); + Color plasmaLime = Color.Lerp(Color.Lime, Color.LimeGreen, Main.rand.NextFloat(1f)); + Color fadeColor = Color.Lerp(Color.LightGreen, plasmaLime, Main.rand.NextFloat(0.5f,1f)); + Particle plasma = new SmallSmokeParticle(projectileTop, Projectile.oldVelocity*0.7f, Color.LightGreen, fadeColor, Main.rand.NextFloat(0.4f,0.9f), 100f); + GeneralParticleHandler.SpawnParticle(plasma); } Time++; + rotate += 10; } public override void Kill(int timeLeft) diff --git a/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs b/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs new file mode 100644 index 0000000000..2675611ef2 --- /dev/null +++ b/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs @@ -0,0 +1,198 @@ +using System; +using System.IO; +using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class SnakeEyesProjectile : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public Player Owner => Main.player[Projectile.owner]; + public NPC TargetShot => Main.npc[(int)TargetID]; + public NPC Target => Projectile.Center.MinionHoming(SnakeEyes.EnemyDistanceDetection, Owner); + + public ref float MinionID => ref Projectile.ai[0]; + public ref float TargetID => ref Projectile.ai[1]; + public ref float TimerToRedirect => ref Projectile.ai[2]; + + public bool HasHitEnemy = false; + public bool HasRedirected = false; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.MinionShot[Type] = true; + + // While this projectile doesn't have afterimages, it keeps track of old positions for its primitive drawcode. + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + } + + public override void SetDefaults() + { + Projectile.DamageType = DamageClass.Summon; + Projectile.localNPCHitCooldown = 10; + Projectile.width = Projectile.height = 16; + Projectile.timeLeft = 120; + Projectile.penetrate = -1; + + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.netImportant = true; + } + + #region Variable Syncing + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(HasHitEnemy); + writer.Write(HasRedirected); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + HasHitEnemy = reader.ReadBoolean(); + HasRedirected = reader.ReadBoolean(); + } + + #endregion + + public override void AI() + { + if (HasHitEnemy && TimerToRedirect < SnakeEyes.TimeToRedirect) + TimerToRedirect++; + + if (TimerToRedirect >= SnakeEyes.TimeToRedirect && !HasRedirected) + { + if (TargetShot is not null) + TargetEnemy(TargetShot); + else if (Target is not null) + TargetEnemy(Target); + } + + if (HasRedirected) + { + if (TargetShot is not null) + FollowEnemy(TargetShot); + else if (Target is not null) + FollowEnemy(Target); + else + Projectile.Kill(); + + Projectile.timeLeft = 2; + } + + for (int i = 0; i < 2; i++) + { + Dust trailDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, HasRedirected ? 261 : 226, Scale: HasRedirected ? 2f : .5f); + trailDust.velocity = Vector2.Zero; + trailDust.noGravity = true; + } + } + + #region AI Methods + + private void TargetEnemy(NPC target) + { + Projectile.velocity = Projectile.SafeDirectionTo(target.Center) * SnakeEyes.ProjectileSpeed; + HasRedirected = true; + + SoundEngine.PlaySound(SoundID.Item92 with { Volume = .8f, Pitch = .5f, PitchVariance = .1f }, Projectile.Center); + + Projectile.netUpdate = true; + } + + private void FollowEnemy(NPC target) + { + Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.SafeDirectionTo(target.Center) * SnakeEyes.ProjectileSpeed, .2f); + } + + #endregion + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + HasHitEnemy = true; + + if (HasRedirected && TargetShot == target) + Projectile.Kill(); + } + + public override void Kill(int timeLeft) + { + if (!HasRedirected) + return; + + Projectile.ExpandHitboxBy(300); + Projectile.Damage(); + + for (int i = 0; i < 20; i++) + { + Dust boomDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, 261, Scale: 2f); + boomDust.noGravity = true; + } + + Particle boom = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.White, Vector2.One, 0f, 0.05f, 1f + Main.rand.NextFloat(0.2f), 20); + GeneralParticleHandler.SpawnParticle(boom); + + SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); + } + + #region Shader Trail Methods + + private float PrimitiveWidthFunction(float completionRatio) + { + float arrowheadCutoff = 0.36f; + float width = 39f; + float minHeadWidth = 0.02f; + float maxHeadWidth = width; + if (completionRatio <= arrowheadCutoff) + width = MathHelper.Lerp(minHeadWidth, maxHeadWidth, Utils.GetLerpValue(0f, arrowheadCutoff, completionRatio, true)); + return width; + } + + private Color PrimitiveColorFunction(float completionRatio) + { + float endFadeRatio = 0.41f; + + float completionRatioFactor = 2.7f; + float globalTimeFactor = 5.3f; + float endFadeFactor = 3.2f; + float endFadeTerm = Utils.GetLerpValue(0f, endFadeRatio * 0.5f, completionRatio, true) * endFadeFactor; + float cosArgument = completionRatio * completionRatioFactor - Main.GlobalTimeWrappedHourly * globalTimeFactor + endFadeTerm; + float startingInterpolant = (float)Math.Cos(cosArgument) * 0.5f + 0.5f; + + float colorLerpFactor = 0.6f; + Color startingColor = Color.Lerp(HasRedirected ? Color.White with { A = 50 } : new Color(0, 0, 0, 0), HasRedirected ? Color.White with { A = 100 } : Color.Cyan with { A = 25 }, startingInterpolant * colorLerpFactor); + + return Color.Lerp(startingColor, HasRedirected ? Color.White : Color.DarkCyan with { A = 50 }, MathHelper.SmoothStep(0f, 1f, Utils.GetLerpValue(0f, endFadeRatio, completionRatio, true))); + } + + #endregion + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = ModContent.Request(Texture).Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Vector2 origin = frame.Size() * 0.5f; + Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + + PrimitiveTrail trail = new PrimitiveTrail(PrimitiveWidthFunction, PrimitiveColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); + GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/FabstaffStreak")); + trail.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 92); + + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs index d210a36699..a789a53b17 100644 --- a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs +++ b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs @@ -1,260 +1,256 @@ -using CalamityMod.Buffs.Summon; +using System; +using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.IO; using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.DraedonsArsenal { public class SnakeEyesSummon : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Misc"; - public bool SufferingFromSeparationAnxiety = false; - public Vector2 OldCenter; - public Vector2 Destination; - public float Time + public Player Owner => Main.player[Projectile.owner]; + public CalamityPlayer ModdedOwner => Owner.Calamity(); + public NPC Target => Owner.Center.MinionHoming(SnakeEyes.EnemyDistanceDetection, Owner); + + public enum AIState { - get => Projectile.ai[0]; - set => Projectile.ai[0] = value; + Idle, + Targetting, + Redirecting } + public AIState State + { + get => (AIState)Projectile.ai[0]; + set => Projectile.ai[0] = (int)value; + } + public ref float AITimer => ref Projectile.ai[1]; + public ref float EyeAngle => ref Projectile.localAI[0]; + public ref float EyeOutwardness => ref Projectile.localAI[1]; - public float EyeOutwardness = 1f; - public float EyeRotation = 0f; + public bool HasShot = false; + public bool HasTeleported = false; + public Vector2 RandomPosition; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() { + Projectile.DamageType = DamageClass.Summon; + Projectile.minionSlots = 1f; Projectile.width = Projectile.height = 22; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.minionSlots = 1; - Projectile.timeLeft = 18000; Projectile.penetrate = -1; - Projectile.timeLeft *= 5; + + Projectile.friendly = true; Projectile.minion = true; Projectile.tileCollide = false; - Projectile.DamageType = DamageClass.Summon; - } - - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(SufferingFromSeparationAnxiety); - writer.Write(EyeOutwardness); - writer.Write(EyeRotation); - writer.WriteVector2(OldCenter); - writer.WriteVector2(Destination); - } - public override void ReceiveExtraAI(BinaryReader reader) - { - SufferingFromSeparationAnxiety = reader.ReadBoolean(); - EyeOutwardness = reader.ReadSingle(); - EyeRotation = reader.ReadSingle(); - OldCenter = reader.ReadVector2(); - Destination = reader.ReadVector2(); + Projectile.netImportant = true; } public override void AI() { - Player player = Main.player[Projectile.owner]; - if (Projectile.localAI[0] == 0f) + // Checks if the minion can still exist given the player's circumstance. + CheckMinionExistence(); + + // The properties of the minion's pupil, it looks around the target if there's one and to the mouse if there isn't any. + EyeAngle = Projectile.SafeDirectionTo((Target is not null) ? Target.Center : Main.MouseWorld).ToRotation(); + EyeOutwardness = Utils.Remap(Projectile.Distance((Target is not null) ? Target.Center : Main.MouseWorld), 0f, 300f, 0f, 5f); + + // Random flavor pulse. + if (Main.rand.NextBool(100)) { - Initialize(player); - Projectile.localAI[0] = 1f; + Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.DarkCyan, Vector2.One, 0f, 0.05f, 0.4f + Main.rand.NextFloat(0.2f), 30); + GeneralParticleHandler.SpawnParticle(pulse); } - GrantBuffs(player); - NPC potentialTarget = Projectile.Center.MinionHoming(820f, player); - if (potentialTarget == null || SufferingFromSeparationAnxiety) + + switch (State) { - Projectile.ai[1] = 0f; - if (Projectile.localAI[1] == 1f) + case AIState.Idle: + IdleState(); + break; + case AIState.Targetting: + TargettingState(); + break; + case AIState.Redirecting: + RedirectingState(); + break; + } + } + + #region AI Methods + + private void IdleState() + { + AITimer += .01f; + + // The projectile oscillates in place. + Projectile.velocity.Y -= MathF.Cos(AITimer) / 350f; + + // If the player's far enough from the minion, he'll teleport somewhere around the player. + if (!Projectile.WithinRange(Owner.Center, 400f)) + { + Projectile.Center = Owner.Center + Main.rand.NextVector2Circular(300f, 300f); + DoVFXPulse(); + } + + if (Target is not null) + SwitchAIState(AIState.Targetting); + } + + private void TargettingState() + { + if (Target is not null) + { + // The minion decides a random position around the target. + if (!HasTeleported) { - Time = 0f; - Projectile.localAI[1] = 0f; + RandomPosition = Target.Center + Main.rand.NextVector2CircularEdge(400f, 400f); + Projectile.Center = RandomPosition; + + DoVFXPulse(); + + HasTeleported = true; + Projectile.netUpdate = true; + } + + else + { + // The projectile will stay on that position. + Projectile.Center = RandomPosition; + + // When the delay is over, shoot at the target. + if (!HasShot && AITimer >= SnakeEyes.TimeToShoot) + ShootProjectile(); + + // When the minion has shot, when the projectile redirects towards the target, + // the minion will teleport on that moment on top of the projectile, + // so it looks like the minion deflected his own projectile. + if (HasShot) + { + for (int i = 0; i < Main.maxProjectiles; i++) + { + Projectile proj = Main.projectile[i]; + if (proj is not null && proj.active && proj.type == ModContent.ProjectileType() && proj.owner == Owner.whoAmI && proj.ModProjectile().MinionID == Projectile.whoAmI && proj.ModProjectile().HasRedirected) + { + Projectile.Center = proj.Center; + SwitchAIState(AIState.Redirecting); + } + } + } + + // If the projectile failed to hit it's enemy and therefore couldn't deflect, + // repeat this process. + if (AITimer >= SnakeEyes.TimeToShoot + 120f) + SwitchAIState(AIState.Targetting); + + AITimer++; } - PlayerMovement(player); } else + SwitchAIState(AIState.Idle); + } + + private void ShootProjectile() + { + if (Main.myPlayer == Projectile.owner) { - if (Projectile.localAI[1] == 0f) - { - Time = 0f; - Projectile.localAI[1] = 1f; - } - NPCMovement(potentialTarget); - } - if (!SufferingFromSeparationAnxiety && Projectile.Distance(player.Center) > (potentialTarget is null ? 360f : 1800f)) - { - SufferingFromSeparationAnxiety = true; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, Target, SnakeEyes.ProjectileSpeed), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Owner.whoAmI, Projectile.whoAmI, Target.whoAmI); + + DoVFXPulse(); + + SoundEngine.PlaySound(SoundID.Item91 with { Volume = .8f, Pitch = .5f, PitchVariance = .1f }, Projectile.Center); + + HasShot = true; Projectile.netUpdate = true; } - else if (SufferingFromSeparationAnxiety && Projectile.Distance(player.Center) < (potentialTarget is null ? 10f : 120f)) - { - SufferingFromSeparationAnxiety = false; - Projectile.netUpdate = true; - } - if (!Main.dedServ) - { - GenerateAfterimageDust(); - } - Time++; } - public void Initialize(Player player) + private void RedirectingState() { - Destination = Projectile.Center - Vector2.UnitY * 180f; - for (int i = 0; i < 45; i++) + if (Target is not null) { - float angle = MathHelper.TwoPi / 45f * i; - Vector2 velocity = angle.ToRotationVector2() * 4f; - Dust dust = Dust.NewDustPerfect(Projectile.Center + velocity * 2.75f, 39, velocity); - dust.noGravity = true; + // The projectile will idle on the spot where he "deflected" the projectile to restart the process. + if (AITimer < SnakeEyes.TimeToRestart) + AITimer++; + else + SwitchAIState(AIState.Targetting); } + else + SwitchAIState(AIState.Idle); } - public void GrantBuffs(Player player) + private void SwitchAIState(AIState state) { - bool isCorrectProjectile = Projectile.type == ModContent.ProjectileType(); - player.AddBuff(ModContent.BuffType(), 3600); - if (isCorrectProjectile) - { - if (player.dead) - { - player.Calamity().snakeEyes = false; - } - if (player.Calamity().snakeEyes) - { - Projectile.timeLeft = 2; - } - } - } + State = state; + AITimer = 0f; + HasTeleported = false; + HasShot = false; + RandomPosition = Vector2.Zero; - public void PlayerMovement(Player player) - { Projectile.velocity = Vector2.Zero; - if (!SufferingFromSeparationAnxiety) - { - Projectile.Center = player.Center - Vector2.UnitY * (80f + (float)Math.Sin(Time / 120f * MathHelper.TwoPi) * 30f); - EyeOutwardness = MathHelper.Lerp(EyeOutwardness, 0f, 0.15f); + + DoVFXPulse(state == AIState.Redirecting); + + Projectile.netUpdate = true; + } + + private void CheckMinionExistence() + { + Owner.AddBuff(ModContent.BuffType(), 2); + if (Type != ModContent.ProjectileType()) return; - } - if (Time % 150f == 0f) - { - OldCenter = Projectile.Center; - } - else if (Time % 150f <= 35f) - { - EyeRotation = Projectile.AngleTo(player.Center); - EyeOutwardness = MathHelper.Lerp(EyeOutwardness, 1f, 0.15f); - Projectile.Center = Vector2.SmoothStep(OldCenter, player.Center - Vector2.UnitY * 80f, Utils.GetLerpValue(0f, 35f, Time % 150f)); - } - else - { - Projectile.Center = player.Center - Vector2.UnitY * (80f + (float)Math.Sin((Time % 150f - 35f) / 115f * MathHelper.TwoPi) * 30f); - } - EyeOutwardness = MathHelper.Lerp(EyeOutwardness, 0f, 0.15f); + + if (Owner.dead) + ModdedOwner.snakeEyes = false; + if (ModdedOwner.snakeEyes) + Projectile.timeLeft = 2; } - public void NPCMovement(NPC npc) + private void DoVFXPulse(bool empowered = false) { - Projectile.velocity = Vector2.Zero; - Vector2 offsetMultiplier = Vector2.UnitX; - switch ((int)Projectile.ai[1] % 4) + int dustAmount = 40; + for (int dustIndex = 0; dustIndex < dustAmount; dustIndex++) { - case 0: - offsetMultiplier = new Vector2(-1f, -1f); - break; - case 1: - offsetMultiplier = new Vector2(-1f, 1f); - break; - case 2: - offsetMultiplier = new Vector2(1f, 1f); - break; - case 3: - offsetMultiplier = new Vector2(1f, -1f); - break; - } - if (Time % 20f == 0f) - { - if (Projectile.ai[1] > 0 && Main.myPlayer == Projectile.owner) - { - Vector2 shootPosition = Projectile.Center + Utils.Vector2FromElipse(EyeRotation.ToRotationVector2(), Projectile.Size * 0.5f * EyeOutwardness); - Vector2 shootVelocity = Projectile.SafeDirectionTo(npc.Center, Main.rand.NextVector2Unit()) * 4f; - int laser = Projectile.NewProjectile(Projectile.GetSource_FromThis(), shootPosition, shootVelocity, ProjectileID.UFOLaser, Projectile.damage, Projectile.knockBack, Projectile.owner); - if (laser.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[laser].timeLeft *= 2; - Main.projectile[laser].originalDamage = Projectile.originalDamage; - Main.projectile[laser].tileCollide = false; - Main.projectile[laser].netUpdate = true; - Main.projectile[laser].DamageType = DamageClass.Summon; - } - } - Projectile.ai[1]++; - OldCenter = Projectile.Center; - } - else - { - EyeOutwardness = MathHelper.Lerp(EyeOutwardness, 1f, 0.15f); - EyeRotation = EyeRotation.AngleTowards(Projectile.AngleTo(npc.Center), MathHelper.TwoPi / 20f); - Projectile.Center = Vector2.SmoothStep(OldCenter, npc.Center + (new Vector2(300f) + Projectile.Size * 0.5f) * offsetMultiplier, Time % 20f / 20f); + float angle = MathHelper.TwoPi / dustAmount * dustIndex; + Vector2 velocity = angle.ToRotationVector2() * 9f; + Dust pulseDust = Dust.NewDustPerfect(Projectile.Center, empowered ? 261 : 226, velocity, Scale: empowered ? 2f : .5f); + pulseDust.noGravity = true; } + + Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, empowered ? Color.White : Color.DarkCyan * 1.2f, Vector2.One, 0f, 0.05f, 0.5f + Main.rand.NextFloat(0.2f), 20); + GeneralParticleHandler.SpawnParticle(pulse); } - public void GenerateAfterimageDust() - { - for (int i = 1; i < Projectile.oldPos.Length; i++) - { - if (i == 1) - { - for (int j = 0; j < 14; j++) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center, 261); - dust.position += (j / 14f * MathHelper.TwoPi).ToRotationVector2() * Projectile.Size * 0.5f * 1.3f; - dust.velocity = Vector2.Zero; - dust.scale = 0.6f; - dust.noGravity = true; - } - } - if (Vector2.Distance(Projectile.oldPos[i - 1], Projectile.oldPos[i]) > 3f) - { - for (int j = 0; j < 7; j++) - { - Dust dust = Dust.NewDustPerfect(Projectile.oldPos[i] + Projectile.Size * 0.5f, 261); - dust.position += (j / 7f * MathHelper.TwoPi).ToRotationVector2() * ((Projectile.oldPos.Length - i) * 1.2f + 3f); - dust.velocity = Vector2.Zero; - dust.scale = 0.6f; - dust.noGravity = true; - } - } - } - } + #endregion + + public override void OnSpawn(IEntitySource source) => DoVFXPulse(); public override bool? CanDamage() => false; public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, 0, Color.White, ProjectileID.Sets.TrailCacheLength[Projectile.type]); + Texture2D texture = ModContent.Request(Texture).Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Vector2 origin = frame.Size() * 0.5f; + Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + Texture2D eyeTexture = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/SnakeEye").Value; - Vector2 offsetVector = Utils.Vector2FromElipse(EyeRotation.ToRotationVector2(), Projectile.Size * 0.5f * EyeOutwardness); - Main.EntitySpriteDraw(eyeTexture, - Projectile.Center + offsetVector - Main.screenPosition, - null, - Color.White, - 0f, - eyeTexture.Size() * 0.5f, - 1f, - SpriteEffects.None, - 0); + Vector2 eyeDrawPosition = Projectile.Center - Main.screenPosition + EyeAngle.ToRotationVector2() * EyeOutwardness; + Main.EntitySpriteDraw(eyeTexture, eyeDrawPosition, null, Color.White, 0f, eyeTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); + return false; } } diff --git a/Projectiles/Healing/AbsorberAura.cs b/Projectiles/Healing/AbsorberAura.cs index 252941164e..03c29a479c 100644 --- a/Projectiles/Healing/AbsorberAura.cs +++ b/Projectiles/Healing/AbsorberAura.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Typless //Remove the players debuffs and defense damage, but only once per aura if (targetDist < 232f) { - player.AddBuff(ModContent.BuffType(), 900); + player.AddBuff(ModContent.BuffType(), 600); if (cleanseList[playerIndex] == false) { cleanseList[playerIndex] = true; diff --git a/Projectiles/Magic/CoralSpoutHoldout.cs b/Projectiles/Magic/CoralSpoutHoldout.cs index 2c22646cb4..7ad3a1471c 100644 --- a/Projectiles/Magic/CoralSpoutHoldout.cs +++ b/Projectiles/Magic/CoralSpoutHoldout.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Magic Main.EntitySpriteDraw(texture, Owner.MountedCenter - Main.screenPosition, null, Color.White, angle, new Vector2(texture.Width / 2f, texture.Height/2f), 700f, 0, 0); Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); return false; } diff --git a/Projectiles/Magic/EnormousConsumingVortex.cs b/Projectiles/Magic/EnormousConsumingVortex.cs index 418c72b519..942699f649 100644 --- a/Projectiles/Magic/EnormousConsumingVortex.cs +++ b/Projectiles/Magic/EnormousConsumingVortex.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Magic if (Main.myPlayer == Projectile.owner) { Projectile.velocity = Projectile.SafeDirectionTo(Main.MouseWorld) * SubsumingVortex.ReleaseSpeed; - Projectile.damage = (int)(Projectile.damage * (1f + Time * 0.0145f)); + Projectile.damage = (int)(Projectile.damage * (1f + Time * 0.0152f)); HasBeenReleased = true; Projectile.netUpdate = true; } @@ -112,9 +112,9 @@ namespace CalamityMod.Projectiles.Magic GeneralParticleHandler.SpawnParticle(exoEnergy); } - // Fire vortices at nearby target if not fully charged yet. + // Fire vortices at nearby target if not fully charged and has not been released yet. NPC potentialTarget = Projectile.Center.ClosestNPCAt(SubsumingVortex.SmallVortexTargetRange - 100f); - if (potentialTarget != null && Time % SubsumingVortex.VortexReleaseRate == SubsumingVortex.VortexReleaseRate - 1 && Time < SubsumingVortex.LargeVortexChargeupTime) + if (potentialTarget != null && Time % SubsumingVortex.VortexReleaseRate == SubsumingVortex.VortexReleaseRate - 1 && Time < SubsumingVortex.LargeVortexChargeupTime && !HasBeenReleased) { // CheckMana returns true if the mana cost can be paid.. bool allowContinuedUse = Owner.CheckMana(Owner.ActiveItem(), -1, true, false); @@ -130,8 +130,6 @@ namespace CalamityMod.Projectiles.Magic } Projectile.netUpdate = true; } - else if (!vortexStillInUse) - Projectile.Kill(); } } diff --git a/Projectiles/Magic/PoseidonTyphoon.cs b/Projectiles/Magic/PoseidonTyphoon.cs index ef3a55a3d3..e29fd95186 100644 --- a/Projectiles/Magic/PoseidonTyphoon.cs +++ b/Projectiles/Magic/PoseidonTyphoon.cs @@ -18,10 +18,12 @@ namespace CalamityMod.Projectiles.Magic Projectile.height = 30; Projectile.friendly = true; Projectile.DamageType = DamageClass.Magic; - Projectile.penetrate = 10; //randomized in the item file now, penetrates 4 to 10 times - Projectile.timeLeft = 300; + Projectile.penetrate = 6; + Projectile.timeLeft = 270; Projectile.ignoreWater = true; Projectile.scale = 1.6f; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 40; } public override void AI() @@ -31,7 +33,7 @@ namespace CalamityMod.Projectiles.Magic Lighting.AddLight(Projectile.Center, 0, (255 - Projectile.alpha) * 0.7f / 255f, (255 - Projectile.alpha) / 255f); - CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 6f, 30f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 10f, 30f); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); diff --git a/Projectiles/Magic/SpiritCongregation.cs b/Projectiles/Magic/SpiritCongregation.cs index 0831b4b830..ac81c8ca39 100644 --- a/Projectiles/Magic/SpiritCongregation.cs +++ b/Projectiles/Magic/SpiritCongregation.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 6; + Projectile.localNPCHitCooldown = 12; Projectile.timeLeft = 90000; } @@ -125,7 +125,7 @@ namespace CalamityMod.Projectiles.Magic BaseDamage = Projectile.damage; else { - float damageBoostFactor = MathHelper.SmoothStep(1f, 3.3f, CurrentPower); + float damageBoostFactor = MathHelper.SmoothStep(1f, 1.85f, CurrentPower); Projectile.damage = (int)(BaseDamage * damageBoostFactor); } diff --git a/Projectiles/Magic/TerraBeam.cs b/Projectiles/Magic/TerraBeam.cs index 61d3ad9bee..a8cdb69688 100644 --- a/Projectiles/Magic/TerraBeam.cs +++ b/Projectiles/Magic/TerraBeam.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.ignoreWater = true; Projectile.penetrate = 10; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 8; + Projectile.localNPCHitCooldown = 12; Projectile.tileCollide = false; Projectile.timeLeft = (int)Lifetime; } @@ -90,9 +90,9 @@ namespace CalamityMod.Projectiles.Magic // boxes, but that should be negligible. float lengthFromStart = Projectile.Distance(target.Center); - int totalShards = (int)MathHelper.Lerp(1, 4, MathHelper.Clamp(lengthFromStart / MaxLaserLength * 1.4f, 0f, 1f)); + int totalShards = (int)MathHelper.Lerp(1, 3, MathHelper.Clamp(lengthFromStart / MaxLaserLength * 1.5f, 0f, 1f)); int shardType = ModContent.ProjectileType(); - int shardDamage = (int)(Projectile.damage * 0.6); + int shardDamage = (int)(Projectile.damage * 0.5); for (int i = 0; i < totalShards; i++) { int tries = 0; diff --git a/Projectiles/Melee/DivineHatchetBoomerang.cs b/Projectiles/Melee/DivineHatchetBoomerang.cs index dc7bf20165..bb9734bcd1 100644 --- a/Projectiles/Melee/DivineHatchetBoomerang.cs +++ b/Projectiles/Melee/DivineHatchetBoomerang.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.height = 60; Projectile.friendly = true; Projectile.tileCollide = false; - Projectile.penetrate = 4; + Projectile.penetrate = 3; Projectile.timeLeft = Lifetime; Projectile.DamageType = DamageClass.MeleeNoSpeed; Projectile.extraUpdates = 1; diff --git a/Projectiles/Melee/ElementBallShiv.cs b/Projectiles/Melee/ElementBallShiv.cs index 0cb96a955c..44d993767d 100644 --- a/Projectiles/Melee/ElementBallShiv.cs +++ b/Projectiles/Melee/ElementBallShiv.cs @@ -14,10 +14,12 @@ namespace CalamityMod.Projectiles.Melee Projectile.height = 20; Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; - Projectile.penetrate = 1; + Projectile.penetrate = 2; Projectile.tileCollide = false; Projectile.timeLeft = 60; Projectile.aiStyle = ProjAIStyleID.Beam; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; } public override void AI() @@ -59,11 +61,11 @@ namespace CalamityMod.Projectiles.Melee private void OnHitEffects(Vector2 targetPos) { var source = Projectile.GetSource_FromThis(); - for (int x = 0; x < 4; x++) + for (int x = 0; x < 3; x++) { if (Projectile.owner == Main.myPlayer) { - CalamityUtils.ProjectileBarrage(source, Projectile.Center, targetPos, x > 2, 800f, 800f, 0f, 800f, 1f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, false, 50f); + CalamityUtils.ProjectileBarrage(source, Projectile.Center, targetPos, x > 2, 800f, 800f, 0f, 800f, 20f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, false, 50f); } } } diff --git a/Projectiles/Melee/EmpyreanKnife.cs b/Projectiles/Melee/EmpyreanKnife.cs index 2b4b202b8c..a327401b8f 100644 --- a/Projectiles/Melee/EmpyreanKnife.cs +++ b/Projectiles/Melee/EmpyreanKnife.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - float healAmt = hit.Damage * 0.005f; + float healAmt = hit.Damage * 0.0075f; if ((int)healAmt == 0) return; diff --git a/Projectiles/Melee/NebulashFlail.cs b/Projectiles/Melee/NebulashFlail.cs index 0ad290be47..f8a50b26ca 100644 --- a/Projectiles/Melee/NebulashFlail.cs +++ b/Projectiles/Melee/NebulashFlail.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.DamageType = DamageClass.MeleeNoSpeed; Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 3; + Projectile.localNPCHitCooldown = 2; } public override Color SpecialDrawColor => new(255, 200, 0); public override int ExudeDustType => ModContent.DustType(); diff --git a/Projectiles/Melee/PrismaticBeam.cs b/Projectiles/Melee/PrismaticBeam.cs index 9eb22b1903..712cd1c434 100644 --- a/Projectiles/Melee/PrismaticBeam.cs +++ b/Projectiles/Melee/PrismaticBeam.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Melee public Player Owner => Main.player[Projectile.owner]; public override Color LaserOverlayColor => CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly / ColorSet.Length % 1f, ColorSet); public override Color LightCastColor => LaserOverlayColor; - public override float Lifetime => 1500f; + public override float Lifetime => 900f; public override float MaxScale => 1.5f; public override float MaxLaserLength => 2200f; public override Texture2D LaserBeginTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/UltimaRayStart", AssetRequestMode.ImmediateLoad).Value; @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.hide = true; - Projectile.timeLeft = 1500; + Projectile.timeLeft = 900; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; } diff --git a/Projectiles/Melee/SHIV.cs b/Projectiles/Melee/SHIV.cs index 1e5432ee31..d940fd634a 100644 --- a/Projectiles/Melee/SHIV.cs +++ b/Projectiles/Melee/SHIV.cs @@ -27,10 +27,9 @@ namespace CalamityMod.Projectiles.Melee } public override void AI() - { - if (Projectile.velocity.Length() < 25f && Projectile.timeLeft % 2 == 0) - Projectile.velocity *= 2.08f; - + { + CalamityUtils.HomeInOnNPC(Projectile, true, 300f, 12f, 20f); + 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; diff --git a/Projectiles/Melee/Shortswords/ElementalShivProj.cs b/Projectiles/Melee/Shortswords/ElementalShivProj.cs index 653d59d278..6c9cb5ee50 100644 --- a/Projectiles/Melee/Shortswords/ElementalShivProj.cs +++ b/Projectiles/Melee/Shortswords/ElementalShivProj.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; diff --git a/Projectiles/Melee/StormRulerProj.cs b/Projectiles/Melee/StormRulerProj.cs index a8c261d8bf..ea730da216 100644 --- a/Projectiles/Melee/StormRulerProj.cs +++ b/Projectiles/Melee/StormRulerProj.cs @@ -17,8 +17,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { - Projectile.width = 10; - Projectile.height = 10; + Projectile.width = Projectile.height = 28; Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; Projectile.penetrate = 1; @@ -49,7 +48,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.localAI[0] = 0f; } } - Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X) + 1.57f; + Projectile.rotation = Projectile.velocity.ToRotation(); } public override void Kill(int timeLeft) diff --git a/Projectiles/Melee/StormRulerProj.png b/Projectiles/Melee/StormRulerProj.png index d62ee6f72c..cd5c500f08 100644 Binary files a/Projectiles/Melee/StormRulerProj.png and b/Projectiles/Melee/StormRulerProj.png differ diff --git a/Projectiles/Ranged/FlareBat.cs b/Projectiles/Ranged/FlareBat.cs index cb08fbbdb3..85ca86d3fa 100644 --- a/Projectiles/Ranged/FlareBat.cs +++ b/Projectiles/Ranged/FlareBat.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.height = 24; Projectile.friendly = true; Projectile.DamageType = DamageClass.Ranged; - Projectile.penetrate = 3; + Projectile.penetrate = 2; Projectile.timeLeft = 300; Projectile.light = 0.25f; Projectile.usesLocalNPCImmunity = true; @@ -64,34 +64,20 @@ namespace CalamityMod.Projectiles.Ranged } Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) * Projectile.direction; - } - public override bool OnTileCollide(Vector2 oldVelocity) - { - Projectile.penetrate--; - if (Projectile.penetrate <= 0) - { - Projectile.Kill(); - } - 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; + if (Projectile.localAI[0] > 0f) + Projectile.localAI[0]--; + + // Makes the bat home onto enemies after piercing once + if (Projectile.penetrate == 1 && Projectile.localAI[0] <= 0f) + CalamityUtils.HomeInOnNPC(Projectile, false, 500f, 12f, 20f); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.OnFire3, 480); - - Projectile.Kill(); + Projectile.localAI[0] = 10f; + Projectile.damage /= 2; } public override void OnHitPlayer(Player target, Player.HurtInfo info) diff --git a/Projectiles/Ranged/TitaniumRailgunScope.cs b/Projectiles/Ranged/TitaniumRailgunScope.cs index b2bea7ff0a..ca386ce464 100644 --- a/Projectiles/Ranged/TitaniumRailgunScope.cs +++ b/Projectiles/Ranged/TitaniumRailgunScope.cs @@ -215,7 +215,7 @@ namespace CalamityMod.Projectiles.Ranged Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); return false; } diff --git a/Projectiles/Rogue/EclipseStealthBoom.cs b/Projectiles/Rogue/EclipseStealthBoom.cs new file mode 100644 index 0000000000..dc1441f7be --- /dev/null +++ b/Projectiles/Rogue/EclipseStealthBoom.cs @@ -0,0 +1,48 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class EclipseStealthBoom : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Rogue"; + + public const int Lifetime = 35; // 7 animation frames, 12 FPS + + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 7; + } + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 102; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.penetrate = -1; + Projectile.timeLeft = Lifetime; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + + public override void AI() + { + Projectile.frameCounter++; + Projectile.frame = Projectile.frameCounter / 5; + + if (Projectile.frameCounter > Lifetime) + Projectile.Kill(); + } + + public override void PostDraw(Color lightColor) + { + Texture2D glow = ModContent.Request(Texture + "Glow").Value; + Rectangle frame = glow.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, frame.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + } + } +} diff --git a/Projectiles/Rogue/EclipseStealthBoom.png b/Projectiles/Rogue/EclipseStealthBoom.png new file mode 100644 index 0000000000..e8611cd39b Binary files /dev/null and b/Projectiles/Rogue/EclipseStealthBoom.png differ diff --git a/Projectiles/Rogue/EclipseStealthBoomGlow.png b/Projectiles/Rogue/EclipseStealthBoomGlow.png new file mode 100644 index 0000000000..afa3ecf883 Binary files /dev/null and b/Projectiles/Rogue/EclipseStealthBoomGlow.png differ diff --git a/Projectiles/Rogue/EclipsesFallMain.cs b/Projectiles/Rogue/EclipsesFallMain.cs index 890660b424..c533adb17c 100644 --- a/Projectiles/Rogue/EclipsesFallMain.cs +++ b/Projectiles/Rogue/EclipsesFallMain.cs @@ -1,4 +1,6 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,61 +12,69 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/EclipsesFall"; + // these also affect KB + public const float RainDamageMultMin = 0.4f; + public const float RainDamageMultMax = 0.5f; + public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() { Projectile.width = Projectile.height = 40; Projectile.friendly = true; - Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.extraUpdates = 1; Projectile.ignoreWater = true; Projectile.tileCollide = false; - Projectile.timeLeft = 300; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.MaxUpdates = 2; + Projectile.penetrate = 3; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 6 * Projectile.MaxUpdates; + Projectile.timeLeft = 150 * Projectile.MaxUpdates; } public override void AI() { - 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); - } + Lighting.AddLight(Projectile.Center, 1f, 0.8f, 0.3f); Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; + if (Main.rand.NextBool(5)) + { + Vector2 trailPos = Projectile.Center + Vector2.UnitY.RotatedBy(Projectile.rotation) * Main.rand.NextFloat(-16f, 16f); + float trailScale = Main.rand.NextFloat(0.8f, 1.2f); + Color trailColor = Main.rand.NextBool() ? Color.Indigo : Color.DarkOrange; + Particle eclipseTrail = new SparkParticle(trailPos, Projectile.velocity * 0.2f, false, 60, trailScale, trailColor); + GeneralParticleHandler.SpawnParticle(eclipseTrail); + } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - SpawnSpears(target.Center); - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => SpawnSpears(target.Center); - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - SpawnSpears(target.Center); - } + public override void OnHitPlayer(Player target, Player.HurtInfo info) => SpawnSpears(target.Center); private void SpawnSpears(Vector2 targetPos) { - int spearAmt = Main.rand.Next(3, 6); //3 to 5 spears + int spearAmt = Main.rand.Next(3, 5 + 1); // 3 to 5 spears var source = Projectile.GetSource_FromThis(); for (int n = 0; n < spearAmt; n++) { - float dmgMult = 0.08f * Main.rand.NextFloat(4f, 7f); - float kBMult = 0.1f * Main.rand.NextFloat(7f, 10f); - CalamityUtils.ProjectileRain(source, targetPos, 400f, 100f, 500f, 800f, 29f, ModContent.ProjectileType(), (int)(Projectile.damage * dmgMult), Projectile.knockBack * kBMult, Projectile.owner); + float dmgMult = Main.rand.NextFloat(RainDamageMultMin, RainDamageMultMax); + CalamityUtils.ProjectileRain(source, targetPos, 400f, 100f, 500f, 800f, 29f, ModContent.ProjectileType(), (int)(Projectile.damage * dmgMult), Projectile.knockBack * dmgMult, Projectile.owner); } } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } + + public override void PostDraw(Color lightColor) + { + Texture2D glow = ModContent.Request(Texture + "Glow").Value; + Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, glow.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + } } } diff --git a/Projectiles/Rogue/EclipsesSmol.cs b/Projectiles/Rogue/EclipsesSmol.cs index 7746962ca8..1000f9603e 100644 --- a/Projectiles/Rogue/EclipsesSmol.cs +++ b/Projectiles/Rogue/EclipsesSmol.cs @@ -1,9 +1,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; + namespace CalamityMod.Projectiles.Rogue { public class EclipsesSmol : ModProjectile, ILocalizedModType @@ -15,38 +14,16 @@ namespace CalamityMod.Projectiles.Rogue Projectile.friendly = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; - Projectile.timeLeft = 150; - Projectile.extraUpdates = 1; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.MaxUpdates = 2; + Projectile.timeLeft = 75 * Projectile.MaxUpdates; } public override void AI() { + Lighting.AddLight(Projectile.Center, 0.5f, 0.4f, 0.15f); Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; - CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); - } - - public override void Kill(int timeLeft) - { - SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - for (int i = 0; i < 2; i++) - { - 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 j = 0; j < 3; j++) - { - 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; - } + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 16f, 20f); } public override bool PreDraw(ref Color lightColor) @@ -55,5 +32,11 @@ namespace CalamityMod.Projectiles.Rogue Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } + + public override void PostDraw(Color lightColor) + { + Texture2D glow = ModContent.Request(Texture + "Glow").Value; + Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, glow.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + } } } diff --git a/Projectiles/Rogue/EclipsesSmolGlow.png b/Projectiles/Rogue/EclipsesSmolGlow.png new file mode 100644 index 0000000000..0539d70e64 Binary files /dev/null and b/Projectiles/Rogue/EclipsesSmolGlow.png differ diff --git a/Projectiles/Rogue/EclipsesStealth.cs b/Projectiles/Rogue/EclipsesStealth.cs index e87f3cd117..1b71e7d58d 100644 --- a/Projectiles/Rogue/EclipsesStealth.cs +++ b/Projectiles/Rogue/EclipsesStealth.cs @@ -1,5 +1,8 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -10,42 +13,51 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/EclipsesFall"; + // these also affect KB + public const float RainDamageMult = 0.25f; + public const float ExplosionDamageMult = 0.5f; + // For more consistent DPS, always alternates between spawning 1 and 2 spears instead of picking randomly private bool spawnTwoSpears = true; private bool changedTimeLeft = false; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() { - Projectile.width = 25; - Projectile.height = 25; + Projectile.width = Projectile.height = 40; Projectile.friendly = true; - Projectile.penetrate = -1; - Projectile.timeLeft = 300; Projectile.ignoreWater = true; - Projectile.tileCollide = false; + Projectile.tileCollide = false; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.MaxUpdates = 2; + Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.DamageType = RogueDamageClass.Instance; + Projectile.timeLeft = 150 * Projectile.MaxUpdates; } // Uses localAI[1] to decide how many frames until the next spear drops. public override void AI() { + Lighting.AddLight(Projectile.Center, 1f, 0.8f, 0.3f); // Behavior when not sticking to anything if (Projectile.ai[0] == 0f) { // Keep the spear oriented in the correct direction Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; - - // Spawn dust while flying - 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); + if (Main.rand.NextBool(5)) + { + Vector2 trailPos = Projectile.Center + Vector2.UnitY.RotatedBy(Projectile.rotation) * Main.rand.NextFloat(-16f, 16f); + float trailScale = Main.rand.NextFloat(0.8f, 1.2f); + Color trailColor = Main.rand.NextBool() ? Color.Indigo : Color.DarkOrange; + Particle eclipseTrail = new SparkParticle(trailPos, Projectile.velocity * 0.2f, false, 60, trailScale, trailColor); + GeneralParticleHandler.SpawnParticle(eclipseTrail); + } } // Behavior when having impaled a target @@ -54,6 +66,7 @@ namespace CalamityMod.Projectiles.Rogue // Eclipse's Fall is guaranteed to impale for 10 seconds, no more, no less if (!changedTimeLeft) { + Projectile.MaxUpdates = 1; Projectile.timeLeft = 600; changedTimeLeft = true; } @@ -67,16 +80,14 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.localAI[1] <= 0f) { // Set up the spear counter for next time. Used to be every 5 frames there was a 50% chance; now it's more reliable but slower. - Projectile.localAI[1] = Main.rand.Next(8, 14); // 8 to 13 frames between each spearfall + Projectile.localAI[1] = Main.rand.Next(8, 13); // 8 to 12 frames between each spearfall int type = ModContent.ProjectileType(); - int smolDamage = (int)(Projectile.damage * 0.22f); - float smolKB = 3f; // Used to be a 50% chance each spearfall for 1 or 2. Now is consistent. int numSpears = spawnTwoSpears ? 2 : 1; spawnTwoSpears = !spawnTwoSpears; for (int i = 0; i < numSpears; ++i) - CalamityUtils.ProjectileRain(source, Projectile.Center, 400f, 100f, 500f, 800f, 29f, type, smolDamage, smolKB, Projectile.owner); + CalamityUtils.ProjectileRain(source, Projectile.Center, 400f, 100f, 500f, 800f, 29f, type, (int)(Projectile.damage * RainDamageMult), Projectile.knockBack * RainDamageMult, Projectile.owner); } } } @@ -98,19 +109,25 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } - public override bool? CanHitNPC(NPC target) + public override void PostDraw(Color lightColor) { - if (Projectile.ai[0] == 1f) - { - return false; - } - return null; + Texture2D glow = ModContent.Request(Texture + "Glow").Value; + Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, glow.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); } + public override bool? CanHitNPC(NPC target) => Projectile.ai[0] == 1f ? false : base.CanHitNPC(target); + public override bool CanHitPvp(Player target) => Projectile.ai[0] != 1f; + + public override void Kill(int timeLeft) + { + SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); + if (Main.myPlayer == Projectile.owner) + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * ExplosionDamageMult), Projectile.knockBack * ExplosionDamageMult, Projectile.owner); + } } } diff --git a/Projectiles/Rogue/EradicatorProjectile.cs b/Projectiles/Rogue/EradicatorProjectile.cs index 92ef2ca750..7fb2693bb0 100644 --- a/Projectiles/Rogue/EradicatorProjectile.cs +++ b/Projectiles/Rogue/EradicatorProjectile.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Particles; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -14,10 +15,10 @@ namespace CalamityMod.Projectiles.Rogue { public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/Eradicator"; - private const float RotationIncrement = 0.09f; - private const int Lifetime = 350; - public const int StealthExtraLifetime = 240; // 1 extra update means this is double what you'd expect for 2 seconds - private const float ReboundTime = 40f; + private static float RotationIncrement = 0.15f; + private static int Lifetime = 350; + public static int StealthExtraLifetime = 240; // 1 extra update means this is double what you'd expect for 2 seconds + private static int ReboundTime = 60; private float randomLaserCharge = 0f; @@ -29,7 +30,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetDefaults() { - Projectile.width = Projectile.height = 58; + Projectile.width = Projectile.height = 62; Projectile.friendly = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; @@ -116,7 +117,7 @@ namespace CalamityMod.Projectiles.Rogue { // Fire lasers at up to 2 nearby targets every 8 frames for 40% damage. // Stealth strike lasers have an intentionally lower ratio of 12%. - double laserDamageRatio = Projectile.Calamity().stealthStrike ? 0.12D : 0.4D; + double laserDamageRatio = Projectile.Calamity().stealthStrike ? 0.15D : 0.4D; float laserFrames = Projectile.MaxUpdates * 8f; CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, laserFrames, 2, ModContent.ProjectileType(), laserDamageRatio, true); } @@ -167,7 +168,39 @@ namespace CalamityMod.Projectiles.Rogue } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 180); + + // Spawn sparks; taken from Despair stone then adapted to a projectile + Vector2 particleSpawnDisplacement; + Vector2 splatterDirection; + + particleSpawnDisplacement = new Vector2(2f * -Projectile.ai[2], 2f * -Projectile.ai[2]); + splatterDirection = new Vector2(Projectile.velocity.X, Projectile.velocity.Y); + + Vector2 SparkSpawnPosition = target.Center + particleSpawnDisplacement; + + if (Projectile.ai[1] % 4 == 0) + { + for (int i = 0; i < 2; i++) + { + int sparkLifetime = Main.rand.Next(14, 21); + float sparkScale = Main.rand.NextFloat(0.8f, 1f) + 1f * 0.05f; + Color sparkColor = Color.Lerp(Color.Fuchsia, Color.AliceBlue, Main.rand.NextFloat(0.5f)); + sparkColor = Color.Lerp(sparkColor, Color.Cyan, Main.rand.NextFloat()); + + if (Main.rand.NextBool(5)) + sparkScale *= 1.4f; + + Vector2 sparkVelocity = splatterDirection.RotatedByRandom(MathHelper.TwoPi); + sparkVelocity.Y -= 6f; + SparkParticle spark = new SparkParticle(SparkSpawnPosition, sparkVelocity, true, sparkLifetime, sparkScale, sparkColor); + GeneralParticleHandler.SpawnParticle(spark); + } + } + + } public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); @@ -175,7 +208,7 @@ namespace CalamityMod.Projectiles.Rogue private void OnHit() { - // Non-stealth strikes do nothing special on hit. + // Non-stealth strikes do not stick on hit. if (!Projectile.Calamity().stealthStrike) return; diff --git a/Projectiles/Rogue/FinalDawnFireSlash.cs b/Projectiles/Rogue/FinalDawnFireSlash.cs index c676c2ad00..8cee1e8eac 100644 --- a/Projectiles/Rogue/FinalDawnFireSlash.cs +++ b/Projectiles/Rogue/FinalDawnFireSlash.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Rogue { public new string LocalizationCategory => "Projectiles.Rogue"; public bool HasRegeneratedStealth = false; - public const float StealthReturnRatio = 0.25f; + public static float StealthReturnRatio = 0.40f; public override void SetStaticDefaults() { Main.projFrames[Projectile.type] = 11; @@ -93,14 +93,14 @@ namespace CalamityMod.Projectiles.Rogue { CalamityPlayer calamityPlayer = Main.player[Projectile.owner].Calamity(); // Restore stealth - if (!HasRegeneratedStealth) + if (!HasRegeneratedStealth && !Projectile.Calamity().LocketClone) //Locket clones dont create stealth { calamityPlayer.rogueStealth += calamityPlayer.rogueStealthMax * StealthReturnRatio; if (calamityPlayer.rogueStealth > calamityPlayer.rogueStealthMax) calamityPlayer.rogueStealth = calamityPlayer.rogueStealthMax; HasRegeneratedStealth = true; - target.AddBuff(ModContent.BuffType(), 300); } + target.AddBuff(ModContent.BuffType(), 300); } public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Rogue/FinalDawnProjectile.cs b/Projectiles/Rogue/FinalDawnProjectile.cs index cfbc669dd8..e520d9d24c 100644 --- a/Projectiles/Rogue/FinalDawnProjectile.cs +++ b/Projectiles/Rogue/FinalDawnProjectile.cs @@ -138,12 +138,14 @@ namespace CalamityMod.Projectiles.Rogue else { //This one doesn't consume stealth since it replenishes stealth on hits - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, + int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + if (p.WithinBounds(Main.maxProjectiles) && Projectile.Calamity().LocketClone) + Main.projectile[p].Calamity().LocketClone = true; // NO STEALTH GEN OK? } } } diff --git a/Projectiles/Rogue/RadiantStar2.cs b/Projectiles/Rogue/RadiantStar2.cs index 6cc2c03ae1..c7a125d31a 100644 --- a/Projectiles/Rogue/RadiantStar2.cs +++ b/Projectiles/Rogue/RadiantStar2.cs @@ -22,8 +22,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetDefaults() { - Projectile.width = 24; - Projectile.height = 24; + Projectile.width = Projectile.height = 32; Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.penetrate = 1; diff --git a/Projectiles/Rogue/RadiantStarKnife.cs b/Projectiles/Rogue/RadiantStarKnife.cs index c2727d3a69..2b5d9812d3 100644 --- a/Projectiles/Rogue/RadiantStarKnife.cs +++ b/Projectiles/Rogue/RadiantStarKnife.cs @@ -22,8 +22,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetDefaults() { - Projectile.width = 24; - Projectile.height = 24; + Projectile.width = Projectile.height = 32; Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.penetrate = 4; diff --git a/Projectiles/Rogue/SacrificeProjectile.cs b/Projectiles/Rogue/SacrificeProjectile.cs index c28094dd21..61dbf71973 100644 --- a/Projectiles/Rogue/SacrificeProjectile.cs +++ b/Projectiles/Rogue/SacrificeProjectile.cs @@ -40,6 +40,9 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { + if (Projectile.Calamity().LocketClone) + AbleToHealOwner = false; // No healing you too much of your hp + if (ReturningToOwner) { Projectile.timeLeft = 15; diff --git a/Projectiles/Rogue/UmbraphileBoom.cs b/Projectiles/Rogue/UmbraphileBoom.cs index c75540960e..fb9924cd18 100644 --- a/Projectiles/Rogue/UmbraphileBoom.cs +++ b/Projectiles/Rogue/UmbraphileBoom.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -9,36 +10,33 @@ namespace CalamityMod.Projectiles.Rogue public class UmbraphileBoom : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public const int Lifetime = 35; // 7 animation frames, 12 FPS + + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 7; + } public override void SetDefaults() { - Projectile.width = 60; - Projectile.height = 60; + Projectile.width = Projectile.height = 58; Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.tileCollide = false; Projectile.penetrate = -1; - Projectile.timeLeft = 5; + Projectile.timeLeft = Lifetime; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; } - public override void Kill(int timeLeft) + public override void AI() { - for (int s = 0; s < 20; s++) - { - int dustType = Main.rand.NextBool() ? 246 : 176; - float dustSpeed = Main.rand.NextFloat(3f, 9f); - Vector2 dustVel = CalamityUtils.RandomVelocity(10f, dustSpeed, dustSpeed, 1f); - int boom = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 1f); - Dust dust = Main.dust[boom]; - dust.noGravity = true; - dust.position = Projectile.Center; - dust.position.X += (float)Main.rand.Next(-10, 11); - dust.position.Y += (float)Main.rand.Next(-10, 11); - dust.velocity = dustVel; - } + Projectile.frameCounter++; + Projectile.frame = Projectile.frameCounter / 5; + + if (Projectile.frameCounter > Lifetime) + Projectile.Kill(); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) @@ -58,5 +56,12 @@ namespace CalamityMod.Projectiles.Rogue if (!Main.dayTime || Main.rand.NextBool(3)) //100% at night, 33.33% chance during day target.AddBuff(ModContent.BuffType(), 45); } + + public override void PostDraw(Color lightColor) + { + Texture2D glow = ModContent.Request(Texture + "Glow").Value; + Rectangle frame = glow.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, frame.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + } } } diff --git a/Projectiles/Rogue/UmbraphileBoom.png b/Projectiles/Rogue/UmbraphileBoom.png new file mode 100644 index 0000000000..8e6d4ccdf2 Binary files /dev/null and b/Projectiles/Rogue/UmbraphileBoom.png differ diff --git a/Projectiles/Rogue/UmbraphileBoomGlow.png b/Projectiles/Rogue/UmbraphileBoomGlow.png new file mode 100644 index 0000000000..b4c9459bdd Binary files /dev/null and b/Projectiles/Rogue/UmbraphileBoomGlow.png differ diff --git a/Projectiles/Summon/BloodClotMinion.cs b/Projectiles/Summon/BloodClotMinion.cs index fb58e7187c..5df7b760fa 100644 --- a/Projectiles/Summon/BloodClotMinion.cs +++ b/Projectiles/Summon/BloodClotMinion.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.tileCollide = false; Projectile.MaxUpdates = 3; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = Projectile.MaxUpdates * 24; + Projectile.localNPCHitCooldown = Projectile.MaxUpdates * 30; Projectile.DamageType = DamageClass.Summon; } diff --git a/Projectiles/Summon/DankCreeperMinion.cs b/Projectiles/Summon/DankCreeperMinion.cs index aabd4f4191..666edf8be2 100644 --- a/Projectiles/Summon/DankCreeperMinion.cs +++ b/Projectiles/Summon/DankCreeperMinion.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.tileCollide = false; Projectile.MaxUpdates = 3; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = Projectile.MaxUpdates * 24; + Projectile.localNPCHitCooldown = Projectile.MaxUpdates * 30; Projectile.DamageType = DamageClass.Summon; } diff --git a/Projectiles/Summon/MiniSandShark.cs b/Projectiles/Summon/MiniSandShark.cs index a71818b08e..939e5d60a1 100644 --- a/Projectiles/Summon/MiniSandShark.cs +++ b/Projectiles/Summon/MiniSandShark.cs @@ -22,6 +22,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.minion = true; Projectile.friendly = true; Projectile.ignoreWater = true; + Projectile.extraUpdates = 1; + Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Summon; } @@ -34,6 +36,16 @@ namespace CalamityMod.Projectiles.Summon public override void Kill(int timeLeft) // When the projectile hits an enemy, it'll make a dust impact effect. { + Projectile.position = Projectile.Center; + Projectile.width = Projectile.height = 64; + Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); + Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2); + Projectile.maxPenetrate = -1; + Projectile.penetrate = -1; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 10; + Projectile.damage = (int)(Projectile.damage * 0.6f); + Projectile.Damage(); SoundEngine.PlaySound(SoundID.Item14, Projectile.position); for (int dustIndex = 0; dustIndex < 36; dustIndex++) { diff --git a/Projectiles/Summon/SandnadoMinion.cs b/Projectiles/Summon/SandnadoMinion.cs index 364096e900..d2356c97a6 100644 --- a/Projectiles/Summon/SandnadoMinion.cs +++ b/Projectiles/Summon/SandnadoMinion.cs @@ -143,11 +143,16 @@ namespace CalamityMod.Projectiles.Summon public void ShootTarget(NPC target) { - if (TimerForShooting == SandSharknadoStaff.FireSpeed && Main.myPlayer == Projectile.owner) + int randomDelay = Main.rand.Next(-5, 6); + Vector2 targetPos = target.Center; + Vector2 ProjVel = targetPos - Projectile.Center; + ProjVel.Normalize(); + ProjVel *= SandSharknadoStaff.ProjSpeed; + if (TimerForShooting == SandSharknadoStaff.FireSpeed + randomDelay && Main.myPlayer == Projectile.owner) { int sandSharkProj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, - CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, target, SandSharknadoStaff.ProjVel), + ProjVel, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, diff --git a/Projectiles/Summon/StormjawBaby.cs b/Projectiles/Summon/StormjawBaby.cs index 2754293e9f..13700aca1f 100644 --- a/Projectiles/Summon/StormjawBaby.cs +++ b/Projectiles/Summon/StormjawBaby.cs @@ -393,7 +393,7 @@ namespace CalamityMod.Projectiles.Summon if (sparkCounter < 0) sparkCounter = 0; - float sepAnxietyDist = 500f; + float sepAnxietyDist = 1000f; Vector2 playerDist = player.Center - Projectile.Center; // Teleport to the player if too far if (playerDist.Length() > 2000f) @@ -413,14 +413,14 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.ai[0] == 0f) { Projectile.tileCollide = true; - float accelFast = 0.5f; - float maxSpeed = 4f; - float xVel = 4f; - float accelSlow = 0.1f; + float accelFast = 1f; + float maxSpeed = 8f; + float xVel = 8f; + float accelSlow = 0.2f; if (xVel < Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y)) { xVel = Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y); - accelFast = 0.7f; + accelFast = 1.4f; } int direction = 0; bool flag3 = false; diff --git a/Projectiles/Summon/VileFeederSummon.cs b/Projectiles/Summon/VileFeederSummon.cs index e9b2b88884..9e8a586f64 100644 --- a/Projectiles/Summon/VileFeederSummon.cs +++ b/Projectiles/Summon/VileFeederSummon.cs @@ -35,6 +35,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.timeLeft *= 5; Projectile.minion = true; Projectile.DamageType = DamageClass.Summon; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 60; } public override void SendExtraAI(BinaryWriter writer) @@ -267,13 +269,6 @@ namespace CalamityMod.Projectiles.Summon return false; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.immune[Projectile.owner] = 0; - } - - public override bool? CanDamage() => Projectile.ai[0] != 3f; - public override bool OnTileCollide(Vector2 oldVelocity) => false; } } diff --git a/Systems/DifficultyModeSystem.cs b/Systems/DifficultyModeSystem.cs index fa1cdd14f6..b91788d864 100644 --- a/Systems/DifficultyModeSystem.cs +++ b/Systems/DifficultyModeSystem.cs @@ -22,23 +22,51 @@ namespace CalamityMod.Systems { internal static bool _hasCheckedItOutYet = false; //Simple variable to add a cool effect to the mode selector - public static DifficultyMode[] Difficulties; //Difficulty modes ordered by ascending difficulty + public static List Difficulties = new List(); //Difficulty modes ordered by ascending difficulty public static List DifficultyTiers; //Difficulty modes grouped together by difficulty public static int MostAlternateDifficulties; //The most alternate difficulties at any tier that exists. Used to know the widest space to take in the ui public override void Load() { MostAlternateDifficulties = 1; - Difficulties = new DifficultyMode[] { new NoDifficulty(), new RevengeanceDifficulty(), new DeathDifficulty()}; + //Initialize base mod difficulties + Difficulties = new List() { new NoDifficulty(), new RevengeanceDifficulty(), new DeathDifficulty()}; - //All of this should happen after a hook happens which lets other mods add their own difficulties - Difficulties = Difficulties.OrderBy(d => d.DifficultyScale).ToArray(); + CalculateDifficultyData(); + } + public override void Unload() + { + Difficulties = null; + } + + public static DifficultyMode GetCurrentDifficulty + { + get + { + DifficultyMode mode = Difficulties[0]; + + for (int i = 1; i < Difficulties.Count; i++) + { + if (Difficulties[i].Enabled) + mode = Difficulties[i]; + } + + return mode; + } + } + + public static void CalculateDifficultyData() + { + MostAlternateDifficulties = 1; + Difficulties.OrderBy(d => d.DifficultyScale); + + //Difficulties are arranged in "tiers". This is done so that multiple mods can add their own alternate difficulties sharing a tier with the base ones DifficultyTiers = new List(); float currentTier = -1; int tierIndex = -1; - for (int i = 0; i < Difficulties.Length; i++) + for (int i = 0; i < Difficulties.Count; i++) { //if we are at a new tier, create a new list of difficulties at that tier. if (currentTier != Difficulties[i].DifficultyScale) @@ -53,7 +81,6 @@ namespace CalamityMod.Systems { //ugly DifficultyTiers[tierIndex] = DifficultyTiers[tierIndex].Append(Difficulties[i]).ToArray(); - MostAlternateDifficulties = Math.Max(DifficultyTiers[tierIndex].Length, MostAlternateDifficulties); } @@ -61,27 +88,6 @@ namespace CalamityMod.Systems } } - public override void Unload() - { - Difficulties = null; - } - - public static DifficultyMode GetCurrentDifficulty - { - get - { - DifficultyMode mode = Difficulties[0]; - - for (int i = 1; i < Difficulties.Length; i++) - { - if (Difficulties[i].Enabled) - mode = Difficulties[i]; - } - - return mode; - } - } - public override void SaveWorldData(TagCompound tag) { //Apparently this is ran after worldgen so it cant always be set to true diff --git a/Systems/MiscWorldStateSystem.cs b/Systems/MiscWorldStateSystem.cs index 1f69bbd246..52fca6e672 100644 --- a/Systems/MiscWorldStateSystem.cs +++ b/Systems/MiscWorldStateSystem.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.IO; using CalamityMod.CustomRecipes; using CalamityMod.Events; using CalamityMod.NPCs; @@ -8,14 +9,15 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.IO; +using static CalamityMod.DownedBossSystem; using static CalamityMod.World.CalamityWorld; namespace CalamityMod { public class MiscWorldStateSystem : ModSystem { - #region Resetting - public static void ResetWorldData() + #region Clear World Data (Reset) + public override void ClearWorld() { CalamityGlobalNPC.holyBoss = -1; CalamityGlobalNPC.doughnutBoss = -1; @@ -69,10 +71,6 @@ namespace CalamityMod AcidRainEvent.AcidRainEventIsOngoing = false; AcidRainEvent.CountdownUntilForcedAcidRain = 0; } - - public override void OnWorldLoad() => ResetWorldData(); - - public override void OnWorldUnload() => ResetWorldData(); #endregion #region Saving/Loading @@ -193,5 +191,300 @@ namespace CalamityMod CavernLabCenter = tag.Get("CavernLabCenter"); } #endregion Saving/Loading + + #region NetSend + public override void NetSend(BinaryWriter writer) + { + BitsByte flags = new BitsByte(); + flags[0] = downedDesertScourge; + flags[1] = downedHiveMind; + flags[2] = downedPerforator; + flags[3] = downedSlimeGod; + flags[4] = downedCryogen; + flags[5] = downedBrimstoneElemental; + flags[6] = downedCalamitasClone; + flags[7] = downedLeviathan; + + BitsByte flags2 = new BitsByte(); + flags2[0] = downedDoG; + flags2[1] = downedPlaguebringer; + flags2[2] = downedGuardians; + flags2[3] = downedProvidence; + flags2[4] = downedCeaselessVoid; + flags2[5] = downedStormWeaver; + flags2[6] = downedSignus; + flags2[7] = downedYharon; + + // Don't write meaningful values for the now-unused vanilla boss booleans + BitsByte flags3 = new BitsByte(); + flags3[0] = downedCalamitas; + flags3[1] = downedDragonfolly; + flags3[2] = downedCrabulon; + flags3[3] = downedBetsy; + flags3[4] = downedRavager; + flags3[5] = false; + flags3[6] = false; + flags3[7] = false; + + BitsByte flags4 = new BitsByte(); + flags4[0] = false; + flags4[1] = false; + flags4[2] = false; + flags4[3] = false; + flags4[4] = false; + flags4[5] = false; + flags4[6] = onionMode; + flags4[7] = revenge; + + BitsByte flags5 = new BitsByte(); + flags5[0] = downedAstrumDeus; + flags5[1] = spawnedBandit; + flags5[2] = spawnedCirrus; + flags5[3] = AcidRainEvent.HasStartedAcidicDownpour; + flags5[4] = false; + flags5[5] = downedPolterghast; + flags5[6] = death; + flags5[7] = downedGSS; + + BitsByte flags6 = new BitsByte(); + flags6[0] = Abyss.AtLeftSideOfWorld; + flags6[1] = downedAquaticScourge; + flags6[2] = downedAstrumAureus; + flags6[3] = false; + flags6[4] = armageddon; + flags6[5] = false; + flags6[6] = false; + flags6[7] = false; + + BitsByte flags7 = new BitsByte(); + flags7[0] = BossRushEvent.BossRushActive; + flags7[1] = downedBoomerDuke; + flags7[2] = downedCLAM; + flags7[3] = false; + flags7[4] = AcidRainEvent.AcidRainEventIsOngoing; + flags7[5] = downedEoCAcidRain; + flags7[6] = downedAquaticScourgeAcidRain; + flags7[7] = AcidRainEvent.HasTriedToSummonOldDuke; + + BitsByte flags8 = new BitsByte(); + flags8[0] = AcidRainEvent.HasBeenForceStartedByEoCDefeat; + flags8[1] = false; + flags8[2] = downedSecondSentinels; + flags8[3] = foundHomePermafrost; + flags8[4] = downedCLAMHardMode; + flags8[5] = catName; + flags8[6] = dogName; + flags8[7] = bunnyName; + + BitsByte flags9 = new BitsByte(); + flags9[0] = false; + flags9[1] = false; + flags9[2] = false; + flags9[3] = false; + flags9[4] = false; + flags9[5] = false; + flags9[6] = false; + flags9[7] = false; + + BitsByte flags10 = new BitsByte(); + flags10[0] = false; + flags10[1] = false; + flags10[2] = AcidRainEvent.OldDukeHasBeenEncountered; + flags10[3] = false; + flags10[4] = false; + flags10[5] = false; + flags10[6] = false; + flags10[7] = false; + + BitsByte flags11 = new BitsByte(); + flags11[0] = false; + flags11[1] = HasGeneratedLuminitePlanetoids; + flags11[2] = downedPrimordialWyrm; + flags11[3] = downedExoMechs; + flags11[4] = downedAres; + flags11[5] = downedThanatos; + flags11[6] = downedArtemisAndApollo; + flags11[7] = TalkedToDraedon; + + BitsByte flags12 = new BitsByte(); + flags12[0] = downedCragmawMire; + flags12[1] = downedMauler; + flags12[2] = downedNuclearTerror; + flags12[3] = downedBossRush; + flags12[4] = DraedonMechdusa; + + writer.Write(flags); + writer.Write(flags2); + writer.Write(flags3); + writer.Write(flags4); + writer.Write(flags5); + writer.Write(flags6); + writer.Write(flags7); + writer.Write(flags8); + writer.Write(flags9); + writer.Write(flags10); + writer.Write(flags11); + writer.Write(flags12); + + RecipeUnlockHandler.SendData(writer); + + writer.Write(Abyss.AbyssChasmBottom); + writer.Write(SulphurousSea.YStart); + writer.Write(AstralBiome.YStart); + writer.Write(AcidRainEvent.AccumulatedKillPoints); + writer.Write(Reforges); + writer.Write(MoneyStolenByBandit); + writer.Write(DraedonSummonCountdown); + writer.Write((int)DraedonMechToSummon); + writer.WriteVector2(DraedonSummonPosition); + writer.WriteVector2(SunkenSeaLabCenter); + writer.WriteVector2(PlanetoidLabCenter); + writer.WriteVector2(JungleLabCenter); + writer.WriteVector2(HellLabCenter); + writer.WriteVector2(IceLabCenter); + writer.WriteVector2(CavernLabCenter); + } + #endregion + + #region NetReceive + public override void NetReceive(BinaryReader reader) + { + BitsByte flags = reader.ReadByte(); + downedDesertScourge = flags[0]; + downedHiveMind = flags[1]; + downedPerforator = flags[2]; + downedSlimeGod = flags[3]; + downedCryogen = flags[4]; + downedBrimstoneElemental = flags[5]; + downedCalamitasClone = flags[6]; + downedLeviathan = flags[7]; + + BitsByte flags2 = reader.ReadByte(); + downedDoG = flags2[0]; + downedPlaguebringer = flags2[1]; + downedGuardians = flags2[2]; + downedProvidence = flags2[3]; + downedCeaselessVoid = flags2[4]; + downedStormWeaver = flags2[5]; + downedSignus = flags2[6]; + downedYharon = flags2[7]; + + // Explicitly discard the now-unused vanilla boss booleans + BitsByte flags3 = reader.ReadByte(); + downedCalamitas = flags3[0]; + downedDragonfolly = flags3[1]; + downedCrabulon = flags3[2]; + downedBetsy = flags3[3]; + downedRavager = flags3[4]; + _ = flags3[5]; + _ = flags3[6]; + _ = flags3[7]; + + BitsByte flags4 = reader.ReadByte(); + _ = flags4[0]; + _ = flags4[1]; + _ = flags4[2]; + _ = flags4[3]; + _ = flags4[4]; + _ = flags4[5]; + onionMode = flags4[6]; + revenge = flags4[7]; + + BitsByte flags5 = reader.ReadByte(); + downedAstrumDeus = flags5[0]; + spawnedBandit = flags5[1]; + spawnedCirrus = flags5[2]; + AcidRainEvent.HasStartedAcidicDownpour = flags5[3]; + _ = flags5[4]; + downedPolterghast = flags5[5]; + death = flags5[6]; + downedGSS = flags5[7]; + + BitsByte flags6 = reader.ReadByte(); + Abyss.AtLeftSideOfWorld = flags6[0]; + downedAquaticScourge = flags6[1]; + downedAstrumAureus = flags6[2]; + _ = flags6[3]; + armageddon = flags6[4]; + _ = flags6[5]; + _ = flags6[6]; + _ = flags6[7]; + + BitsByte flags7 = reader.ReadByte(); + BossRushEvent.BossRushActive = flags7[0]; + downedBoomerDuke = flags7[1]; + downedCLAM = flags7[2]; + _ = flags7[3]; + AcidRainEvent.AcidRainEventIsOngoing = flags7[4]; + downedEoCAcidRain = flags7[5]; + downedAquaticScourgeAcidRain = flags7[6]; + AcidRainEvent.HasTriedToSummonOldDuke = flags7[7]; + + BitsByte flags8 = reader.ReadByte(); + AcidRainEvent.HasBeenForceStartedByEoCDefeat = flags8[0]; + _ = flags8[1]; + downedSecondSentinels = flags8[2]; + foundHomePermafrost = flags8[3]; + downedCLAMHardMode = flags8[4]; + catName = flags8[5]; + dogName = flags8[6]; + bunnyName = flags8[7]; + + BitsByte flags9 = reader.ReadByte(); + _ = flags9[0]; + _ = flags9[1]; + _ = flags9[2]; + _ = flags9[3]; + _ = flags9[4]; + _ = flags9[5]; + _ = flags9[6]; + _ = flags9[7]; + + BitsByte flags10 = reader.ReadByte(); + _ = flags10[0]; + _ = flags10[1]; + AcidRainEvent.OldDukeHasBeenEncountered = flags10[2]; + _ = flags10[3]; + _ = flags10[4]; + _ = flags10[5]; + _ = flags10[6]; + _ = flags10[7]; + + BitsByte flags11 = reader.ReadByte(); + _ = flags11[0]; + HasGeneratedLuminitePlanetoids = flags11[1]; + downedPrimordialWyrm = flags11[2]; + downedExoMechs = flags11[3]; + downedAres = flags11[4]; + downedThanatos = flags11[5]; + downedArtemisAndApollo = flags11[6]; + TalkedToDraedon = flags11[7]; + + BitsByte flags12 = reader.ReadByte(); + downedCragmawMire = flags12[0]; + downedMauler = flags12[1]; + downedNuclearTerror = flags12[2]; + downedBossRush = flags12[3]; + DraedonMechdusa = flags12[4]; + + RecipeUnlockHandler.ReceiveData(reader); + + Abyss.AbyssChasmBottom = reader.ReadInt32(); + SulphurousSea.YStart = reader.ReadInt32(); + AstralBiome.YStart = reader.ReadInt32(); + AcidRainEvent.AccumulatedKillPoints = reader.ReadInt32(); + Reforges = reader.ReadInt32(); + MoneyStolenByBandit = reader.ReadInt32(); + DraedonSummonCountdown = reader.ReadInt32(); + DraedonMechToSummon = (ExoMech)reader.ReadInt32(); + DraedonSummonPosition = reader.ReadVector2(); + SunkenSeaLabCenter = reader.ReadVector2(); + PlanetoidLabCenter = reader.ReadVector2(); + JungleLabCenter = reader.ReadVector2(); + HellLabCenter = reader.ReadVector2(); + IceLabCenter = reader.ReadVector2(); + CavernLabCenter = reader.ReadVector2(); + } + #endregion } } diff --git a/Systems/UIManagementSystem.cs b/Systems/UIManagementSystem.cs index a678d6e40c..9da8ba9fc7 100644 --- a/Systems/UIManagementSystem.cs +++ b/Systems/UIManagementSystem.cs @@ -62,10 +62,10 @@ namespace CalamityMod.Systems return true; }, InterfaceScaleType.UI)); - // Astral Arcanum overlay (if open) - layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Astral Arcanum UI", delegate () + // Special Teleport overlay (if open) + layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Special Teleport UI", delegate () { - AstralArcanumUI.UpdateAndDraw(Main.spriteBatch); + SpecialTeleportUI.UpdateAndDraw(Main.spriteBatch); return true; }, InterfaceScaleType.None)); diff --git a/Systems/WorldSyncingSystem.cs b/Systems/WorldSyncingSystem.cs deleted file mode 100644 index 1cabbe8654..0000000000 --- a/Systems/WorldSyncingSystem.cs +++ /dev/null @@ -1,309 +0,0 @@ -using System.IO; -using CalamityMod.CustomRecipes; -using CalamityMod.Events; -using CalamityMod.World; -using Terraria; -using Terraria.ModLoader; -using static CalamityMod.DownedBossSystem; -using static CalamityMod.World.CalamityWorld; - -namespace CalamityMod.Systems -{ - public class WorldSyncingSystem : ModSystem - { - #region NetSend - public override void NetSend(BinaryWriter writer) - { - BitsByte flags = new BitsByte(); - flags[0] = downedDesertScourge; - flags[1] = downedHiveMind; - flags[2] = downedPerforator; - flags[3] = downedSlimeGod; - flags[4] = downedCryogen; - flags[5] = downedBrimstoneElemental; - flags[6] = downedCalamitasClone; - flags[7] = downedLeviathan; - - BitsByte flags2 = new BitsByte(); - flags2[0] = downedDoG; - flags2[1] = downedPlaguebringer; - flags2[2] = downedGuardians; - flags2[3] = downedProvidence; - flags2[4] = downedCeaselessVoid; - flags2[5] = downedStormWeaver; - flags2[6] = downedSignus; - flags2[7] = downedYharon; - - // Don't write meaningful values for the now-unused vanilla boss booleans - BitsByte flags3 = new BitsByte(); - flags3[0] = downedCalamitas; - flags3[1] = downedDragonfolly; - flags3[2] = downedCrabulon; - flags3[3] = downedBetsy; - flags3[4] = downedRavager; - flags3[5] = false; - flags3[6] = false; - flags3[7] = false; - - BitsByte flags4 = new BitsByte(); - flags4[0] = false; - flags4[1] = false; - flags4[2] = false; - flags4[3] = false; - flags4[4] = false; - flags4[5] = false; - flags4[6] = onionMode; - flags4[7] = revenge; - - BitsByte flags5 = new BitsByte(); - flags5[0] = downedAstrumDeus; - flags5[1] = spawnedBandit; - flags5[2] = spawnedCirrus; - flags5[3] = AcidRainEvent.HasStartedAcidicDownpour; - flags5[4] = false; - flags5[5] = downedPolterghast; - flags5[6] = death; - flags5[7] = downedGSS; - - BitsByte flags6 = new BitsByte(); - flags6[0] = Abyss.AtLeftSideOfWorld; - flags6[1] = downedAquaticScourge; - flags6[2] = downedAstrumAureus; - flags6[3] = false; - flags6[4] = armageddon; - flags6[5] = false; - flags6[6] = false; - flags6[7] = false; - - BitsByte flags7 = new BitsByte(); - flags7[0] = BossRushEvent.BossRushActive; - flags7[1] = downedBoomerDuke; - flags7[2] = downedCLAM; - flags7[3] = false; - flags7[4] = AcidRainEvent.AcidRainEventIsOngoing; - flags7[5] = downedEoCAcidRain; - flags7[6] = downedAquaticScourgeAcidRain; - flags7[7] = AcidRainEvent.HasTriedToSummonOldDuke; - - BitsByte flags8 = new BitsByte(); - flags8[0] = AcidRainEvent.HasBeenForceStartedByEoCDefeat; - flags8[1] = false; - flags8[2] = downedSecondSentinels; - flags8[3] = foundHomePermafrost; - flags8[4] = downedCLAMHardMode; - flags8[5] = catName; - flags8[6] = dogName; - flags8[7] = bunnyName; - - BitsByte flags9 = new BitsByte(); - flags9[0] = false; - flags9[1] = false; - flags9[2] = false; - flags9[3] = false; - flags9[4] = false; - flags9[5] = false; - flags9[6] = false; - flags9[7] = false; - - BitsByte flags10 = new BitsByte(); - flags10[0] = false; - flags10[1] = false; - flags10[2] = AcidRainEvent.OldDukeHasBeenEncountered; - flags10[3] = false; - flags10[4] = false; - flags10[5] = false; - flags10[6] = false; - flags10[7] = false; - - BitsByte flags11 = new BitsByte(); - flags11[0] = false; - flags11[1] = HasGeneratedLuminitePlanetoids; - flags11[2] = downedPrimordialWyrm; - flags11[3] = downedExoMechs; - flags11[4] = downedAres; - flags11[5] = downedThanatos; - flags11[6] = downedArtemisAndApollo; - flags11[7] = TalkedToDraedon; - - BitsByte flags12 = new BitsByte(); - flags12[0] = downedCragmawMire; - flags12[1] = downedMauler; - flags12[2] = downedNuclearTerror; - flags12[3] = downedBossRush; - flags12[4] = DraedonMechdusa; - - writer.Write(flags); - writer.Write(flags2); - writer.Write(flags3); - writer.Write(flags4); - writer.Write(flags5); - writer.Write(flags6); - writer.Write(flags7); - writer.Write(flags8); - writer.Write(flags9); - writer.Write(flags10); - writer.Write(flags11); - writer.Write(flags12); - - RecipeUnlockHandler.SendData(writer); - - writer.Write(Abyss.AbyssChasmBottom); - writer.Write(SulphurousSea.YStart); - writer.Write(AstralBiome.YStart); - writer.Write(AcidRainEvent.AccumulatedKillPoints); - writer.Write(Reforges); - writer.Write(MoneyStolenByBandit); - writer.Write(DraedonSummonCountdown); - writer.Write((int)DraedonMechToSummon); - writer.WriteVector2(DraedonSummonPosition); - writer.WriteVector2(SunkenSeaLabCenter); - writer.WriteVector2(PlanetoidLabCenter); - writer.WriteVector2(JungleLabCenter); - writer.WriteVector2(HellLabCenter); - writer.WriteVector2(IceLabCenter); - writer.WriteVector2(CavernLabCenter); - } - #endregion - - #region NetReceive - public override void NetReceive(BinaryReader reader) - { - BitsByte flags = reader.ReadByte(); - downedDesertScourge = flags[0]; - downedHiveMind = flags[1]; - downedPerforator = flags[2]; - downedSlimeGod = flags[3]; - downedCryogen = flags[4]; - downedBrimstoneElemental = flags[5]; - downedCalamitasClone = flags[6]; - downedLeviathan = flags[7]; - - BitsByte flags2 = reader.ReadByte(); - downedDoG = flags2[0]; - downedPlaguebringer = flags2[1]; - downedGuardians = flags2[2]; - downedProvidence = flags2[3]; - downedCeaselessVoid = flags2[4]; - downedStormWeaver = flags2[5]; - downedSignus = flags2[6]; - downedYharon = flags2[7]; - - // Explicitly discard the now-unused vanilla boss booleans - BitsByte flags3 = reader.ReadByte(); - downedCalamitas = flags3[0]; - downedDragonfolly = flags3[1]; - downedCrabulon = flags3[2]; - downedBetsy = flags3[3]; - downedRavager = flags3[4]; - _ = flags3[5]; - _ = flags3[6]; - _ = flags3[7]; - - BitsByte flags4 = reader.ReadByte(); - _ = flags4[0]; - _ = flags4[1]; - _ = flags4[2]; - _ = flags4[3]; - _ = flags4[4]; - _ = flags4[5]; - onionMode = flags4[6]; - revenge = flags4[7]; - - BitsByte flags5 = reader.ReadByte(); - downedAstrumDeus = flags5[0]; - spawnedBandit = flags5[1]; - spawnedCirrus = flags5[2]; - AcidRainEvent.HasStartedAcidicDownpour = flags5[3]; - _ = flags5[4]; - downedPolterghast = flags5[5]; - death = flags5[6]; - downedGSS = flags5[7]; - - BitsByte flags6 = reader.ReadByte(); - Abyss.AtLeftSideOfWorld = flags6[0]; - downedAquaticScourge = flags6[1]; - downedAstrumAureus = flags6[2]; - _ = flags6[3]; - armageddon = flags6[4]; - _ = flags6[5]; - _ = flags6[6]; - _ = flags6[7]; - - BitsByte flags7 = reader.ReadByte(); - BossRushEvent.BossRushActive = flags7[0]; - downedBoomerDuke = flags7[1]; - downedCLAM = flags7[2]; - _ = flags7[3]; - AcidRainEvent.AcidRainEventIsOngoing = flags7[4]; - downedEoCAcidRain = flags7[5]; - downedAquaticScourgeAcidRain = flags7[6]; - AcidRainEvent.HasTriedToSummonOldDuke = flags7[7]; - - BitsByte flags8 = reader.ReadByte(); - AcidRainEvent.HasBeenForceStartedByEoCDefeat = flags8[0]; - _ = flags8[1]; - downedSecondSentinels = flags8[2]; - foundHomePermafrost = flags8[3]; - downedCLAMHardMode = flags8[4]; - catName = flags8[5]; - dogName = flags8[6]; - bunnyName = flags8[7]; - - BitsByte flags9 = reader.ReadByte(); - _ = flags9[0]; - _ = flags9[1]; - _ = flags9[2]; - _ = flags9[3]; - _ = flags9[4]; - _ = flags9[5]; - _ = flags9[6]; - _ = flags9[7]; - - BitsByte flags10 = reader.ReadByte(); - _ = flags10[0]; - _ = flags10[1]; - AcidRainEvent.OldDukeHasBeenEncountered = flags10[2]; - _ = flags10[3]; - _ = flags10[4]; - _ = flags10[5]; - _ = flags10[6]; - _ = flags10[7]; - - BitsByte flags11 = reader.ReadByte(); - _ = flags11[0]; - HasGeneratedLuminitePlanetoids = flags11[1]; - downedPrimordialWyrm = flags11[2]; - downedExoMechs = flags11[3]; - downedAres = flags11[4]; - downedThanatos = flags11[5]; - downedArtemisAndApollo = flags11[6]; - TalkedToDraedon = flags11[7]; - - BitsByte flags12 = reader.ReadByte(); - downedCragmawMire = flags12[0]; - downedMauler = flags12[1]; - downedNuclearTerror = flags12[2]; - downedBossRush = flags12[3]; - DraedonMechdusa = flags12[4]; - - RecipeUnlockHandler.ReceiveData(reader); - - Abyss.AbyssChasmBottom = reader.ReadInt32(); - SulphurousSea.YStart = reader.ReadInt32(); - AstralBiome.YStart = reader.ReadInt32(); - AcidRainEvent.AccumulatedKillPoints = reader.ReadInt32(); - Reforges = reader.ReadInt32(); - MoneyStolenByBandit = reader.ReadInt32(); - DraedonSummonCountdown = reader.ReadInt32(); - DraedonMechToSummon = (ExoMech)reader.ReadInt32(); - DraedonSummonPosition = reader.ReadVector2(); - SunkenSeaLabCenter = reader.ReadVector2(); - PlanetoidLabCenter = reader.ReadVector2(); - JungleLabCenter = reader.ReadVector2(); - HellLabCenter = reader.ReadVector2(); - IceLabCenter = reader.ReadVector2(); - CavernLabCenter = reader.ReadVector2(); - } - #endregion - } -} diff --git a/UI/MiscTextures/AstralArcanumCircles.png b/UI/MiscTextures/SpecialTeleportCircles.png similarity index 100% rename from UI/MiscTextures/AstralArcanumCircles.png rename to UI/MiscTextures/SpecialTeleportCircles.png diff --git a/UI/ModeIndicator/ModeIndicatorUI.cs b/UI/ModeIndicator/ModeIndicatorUI.cs index 90c6b4b05d..723f75b573 100644 --- a/UI/ModeIndicator/ModeIndicatorUI.cs +++ b/UI/ModeIndicator/ModeIndicatorUI.cs @@ -210,7 +210,7 @@ namespace CalamityMod.UI.ModeIndicator string modeToDisplay = Difficulties[1].Name.ToString(); bool anyActiveMode = false; - for (int i = 1; i < Difficulties.Length; i++) + for (int i = 1; i < Difficulties.Count; i++) { if (GetCurrentDifficulty == Difficulties[i]) { @@ -406,7 +406,7 @@ namespace CalamityMod.UI.ModeIndicator // But would be super useful so other mods can let their own difficulties go there. // Disable difficulties. - for (int i = 0; i < Difficulties.Length; i++) + for (int i = 0; i < Difficulties.Count; i++) { // Disable all difficulties at the same tier / at a tier above itself. if (Difficulties[i]._difficultyTier >= mode._difficultyTier && Difficulties[i] != mode) diff --git a/UI/AstralArcanumUI.cs b/UI/PurityUI.cs similarity index 98% rename from UI/AstralArcanumUI.cs rename to UI/PurityUI.cs index ef5cc8cbfb..2767f40817 100644 --- a/UI/AstralArcanumUI.cs +++ b/UI/PurityUI.cs @@ -13,7 +13,7 @@ using Terraria.ModLoader; namespace CalamityMod.UI { // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. - public static class AstralArcanumUI + public static class SpecialTeleportUI { enum CircleStyle { @@ -34,7 +34,7 @@ namespace CalamityMod.UI public static void Load(Mod mod) { - CircleTextures = ModContent.Request("CalamityMod/UI/MiscTextures/AstralArcanumCircles", AssetRequestMode.ImmediateLoad).Value; + CircleTextures = ModContent.Request("CalamityMod/UI/MiscTextures/SpecialTeleportCircles", AssetRequestMode.ImmediateLoad).Value; } public static void Unload() diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index 8a03f12c5b..8590dabaed 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -813,6 +813,7 @@ namespace CalamityMod // Make various things cheaper (sorted by progression) { Vanilla(ItemID.Leather), ChangeIngredientStack(ItemID.RottenChunk, 2) }, { Vanilla(ItemID.JestersArrow), JesterArrowRecipeEdit }, + { Vanilla(ItemID.TeleportationPotion), TeleportationPotionRecipeEdit }, { Vanilla(ItemID.WormFood), WormFoodRecipeEdit }, { Vanilla(ItemID.BloodySpine), BloodySpineRecipeEdit }, { Vanilla(ItemID.GoblinBattleStandard), ChangeIngredientStack(ItemID.TatteredCloth, 5) }, @@ -826,6 +827,7 @@ namespace CalamityMod { Vanilla(ItemID.BundleofBalloons), AddIngredient(ModContent.ItemType(), 3) }, { r => r.HasResult(ItemID.HorseshoeBundle) && !r.HasIngredient(ItemID.BundleofBalloons), AddIngredient(ModContent.ItemType(), 3) }, { Vanilla(ItemID.NightsEdge), AddIngredient(ModContent.ItemType(), 5) }, + { Vanilla(ItemID.FairyBoots), AddIngredient(ItemID.SoulofLight, 5) }, { Vanilla(ItemID.SpiritFlame), AddGroup(AnyAdamantiteBar, 2) }, { Vanilla(ItemID.TerraBlade), AddIngredient(ModContent.ItemType(), 12) }, { Vanilla(ItemID.FireGauntlet), AddIngredient(ModContent.ItemType(), 5) }, @@ -957,6 +959,15 @@ namespace CalamityMod r.ChangeIngredientStack(ItemID.WoodenArrow, intendedStack); } + // Increases Teleportation Potion's recipe to give 5 per craft and use 5 bottled waters + private static void TeleportationPotionRecipeEdit(Recipe r) + { + int intendedStack = 5; + if (r.createItem.stack < intendedStack) + r.createItem.stack = intendedStack; + r.ChangeIngredientStack(ItemID.BottledWater, intendedStack); + } + // Change True Night's Edge recipe to require far less mech boss souls private static void TrueNightsEdgeRecipeEdit(Recipe r) { diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index 452c1edf1d..2c835c9d85 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -173,9 +173,9 @@ namespace CalamityMod light += 1; if (mp.aquaticHeart) light += 1; - if (mp.aAmpoule) - light += 1; - else if (mp.rOoze && !Main.dayTime) // radiant ooze and ampoule/higher don't stack + if (mp.purity) // does not stack with downgrades + light += 2; + else if (mp.rOoze || mp.aAmpoule) // the two "yellow lights" do not stack with each other light += 1; if (mp.aquaticEmblem && underwater) light += 1; @@ -245,6 +245,8 @@ namespace CalamityMod return true; } + // See also: Player.IsStandingStillForSpecialEffects (Vanilla shiny stone + standing still mana regen) + // That is more or less equivalent to this with the default value of 0.05 public static bool StandingStill(this Player player, float velocity = 0.05f) => player.velocity.Length() < velocity; ///