diff --git a/CalPlayer/CalamityPlayerFishing.cs b/CalPlayer/CalamityPlayerFishing.cs index 659ebe2937..a7f8dff27b 100644 --- a/CalPlayer/CalamityPlayerFishing.cs +++ b/CalPlayer/CalamityPlayerFishing.cs @@ -551,7 +551,11 @@ namespace CalamityMod.CalPlayer { if (ZoneCalamity) // Brimstone Crags, fishing in lava { - if (attempt.legendary) + if (attempt.crate) + { + itemDrop = ModContent.ItemType(); + } + else if (attempt.legendary) { List legendaryCatches = new List() { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 07eae50cc3..3abf67a65f 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -435,13 +435,14 @@ namespace CalamityMod.CalPlayer } else { - // If any boss is alive (or you are between DoG phases or Boss Rush is active), you gain adrenaline smoothly. + // If any boss is alive, you gain adrenaline smoothly. // EXCEPTION: Wall of Flesh is alive and you are not in hell. Then you don't get anything. - if ((areThereAnyDamnBosses || BossRushEvent.BossRushActive) && !wofAndNotHell) + if (areThereAnyDamnBosses && !wofAndNotHell) adrenalineDiff += adrenalineMax / AdrenalineChargeTime; // If you aren't actively in a boss fight, adrenaline rapidly fades away. - else + // If Boss Rush is active, adrenaline is paused between boss fights and during the Exo Mechs "Make your choice". + else if (!BossRushEvent.BossRushActive) adrenalineDiff = -adrenalineMax / AdrenalineFadeTime; } diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 13742af3ff..11e94b81b4 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -1493,7 +1493,7 @@ namespace CalamityMod.CalPlayer } if (corrosiveSpine) { - target.AddBuff(BuffID.Venom, 240); + target.AddBuff(BuffID.Poisoned, 240); } } if (summon) diff --git a/Events/BossRushEvent.cs b/Events/BossRushEvent.cs index cb6d77be7c..5a1c2dc8ed 100644 --- a/Events/BossRushEvent.cs +++ b/Events/BossRushEvent.cs @@ -162,7 +162,7 @@ namespace CalamityMod.Events int thePefectOne = NPC.NewNPC(Source, (int)(player.position.X + Main.rand.Next(-100, 101)), (int)(player.position.Y - 400f), type, 1); Main.npc[thePefectOne].timeLeft *= 20; CalamityUtils.BossAwakenMessage(thePefectOne); - }, specialSpawnCountdown: 300, permittedNPCs: ModContent.NPCType()), + }, permittedNPCs: ModContent.NPCType()), new Boss(NPCID.EaterofWorldsHead, permittedNPCs: new int[] { NPCID.EaterofWorldsBody, NPCID.EaterofWorldsTail, NPCID.VileSpit }), @@ -195,7 +195,7 @@ namespace CalamityMod.Events NPC.SpawnWOF(player.position); }, permittedNPCs: new int[] { NPCID.WallofFleshEye, NPCID.LeechHead, NPCID.LeechBody, NPCID.LeechTail, NPCID.TheHungry, NPCID.TheHungryII }), - new Boss(NPCID.QueenSlimeBoss, permittedNPCs: new int[] { NPCID.QueenSlimeMinionBlue, NPCID.QueenSlimeMinionPink, NPCID.QueenSlimeMinionPurple }), + new Boss(NPCID.QueenSlimeBoss, specialSpawnCountdown: 120, permittedNPCs: new int[] { NPCID.QueenSlimeMinionBlue, NPCID.QueenSlimeMinionPink, NPCID.QueenSlimeMinionPurple }), new Boss(ModContent.NPCType(), permittedNPCs: ModContent.NPCType()), @@ -207,18 +207,18 @@ namespace CalamityMod.Events new Boss(ModContent.NPCType(), permittedNPCs: new int[] { ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }), - new Boss(NPCID.TheDestroyer, TimeChangeContext.Night, specialSpawnCountdown: 300, permittedNPCs: new int[] { NPCID.TheDestroyerBody, NPCID.TheDestroyerTail, NPCID.Probe }), + new Boss(NPCID.TheDestroyer, TimeChangeContext.Night, permittedNPCs: new int[] { NPCID.TheDestroyerBody, NPCID.TheDestroyerTail, NPCID.Probe }), new Boss(ModContent.NPCType(), permittedNPCs: ModContent.NPCType()), new Boss(NPCID.SkeletronPrime, TimeChangeContext.Night, permittedNPCs: new int[] { NPCID.PrimeCannon, NPCID.PrimeSaw, NPCID.PrimeVice, NPCID.PrimeLaser, NPCID.Probe }), - new Boss(ModContent.NPCType(), TimeChangeContext.Night, specialSpawnCountdown: 300, dimnessFactor: 0.6f, permittedNPCs: new int[] { ModContent.NPCType(), ModContent.NPCType(), + new Boss(ModContent.NPCType(), TimeChangeContext.Night, dimnessFactor: 0.6f, permittedNPCs: new int[] { ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }), new Boss(NPCID.Plantera, permittedNPCs: new int[] { NPCID.PlanterasTentacle, NPCID.PlanterasHook, NPCID.Spore }), - new Boss(ModContent.NPCType(), TimeChangeContext.Day, permittedNPCs: new int[] { ModContent.NPCType(), ModContent.NPCType(), + new Boss(ModContent.NPCType(), TimeChangeContext.Day, specialSpawnCountdown: 120, permittedNPCs: new int[] { ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), NPCID.DetonatingBubble}), new Boss(ModContent.NPCType(), TimeChangeContext.Night, permittedNPCs: ModContent.NPCType()), @@ -253,7 +253,7 @@ namespace CalamityMod.Events Player player = Main.player[ClosestPlayerToWorldCenter]; SoundEngine.PlaySound(SoundID.ScaryScream, player.position); - int ravager = NPC.NewNPC(Source, (int)(player.position.X + Main.rand.Next(-100, 101)), (int)(player.position.Y - 400f), type, 1); + int ravager = NPC.NewNPC(Source, (int)(player.position.X + Main.rand.Next(-100, 101)), (int)(player.position.Y - 600f), type, 1); Main.npc[ravager].timeLeft *= 20; CalamityUtils.BossAwakenMessage(ravager); }, usesSpecialSound: true, permittedNPCs: new int[] { ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), @@ -574,8 +574,8 @@ namespace CalamityMod.Events // Cooldown before next boss spawns. BossRushSpawnCountdown = 60; - // Increase cooldown post-Fishron. - if (BossRushStage >= Bosses.FindIndex(boss => boss.EntityID == NPCID.DukeFishron)) + // Increase cooldown post-Moon Lord. + if (BossRushStage >= Bosses.FindIndex(boss => boss.EntityID == NPCID.MoonLordCore)) BossRushSpawnCountdown += 300; // Override the spawn countdown if specified. diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index 0bc996a458..917b73755b 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -551,5 +551,26 @@ namespace CalamityMod.ILEditing cursor.Emit(OpCodes.Ldc_R4, BalancingConstants.SharpeningStationArmorPenetration); } #endregion + + #region Remove Lunatic Cultist Homing Resist + private static void RemoveLunaticCultistHomingResist(ILContext il) + { + // Change Lunatic Cultist's resist from 25% to 0% (effectively removing it). + var cursor = new ILCursor(il); + if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdsfld(typeof(ProjectileID.Sets), "CultistIsResistantTo"))) + { + LogFailure("Lunatic Cultist Homing Resist Removal", "Could not locate the Cultist resist set."); + return; + } + if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(0.75f))) // The resist ratio. + { + LogFailure("Lunatic Cultist Homing Resist Removal", "Could not locate the resist percentage."); + return; + } + + // Replace the value with 1, meaning -0% damage or no resist. + cursor.Next.Operand = 1f; + } + #endregion } } diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 84149f4aa9..1543319339 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -31,49 +31,61 @@ namespace CalamityMod.ILEditing // Re-initialize the projectile cache list. OrderedProjectiles = new List(); - // Mechanics / features - On.Terraria.NPC.ApplyTileCollision += AllowTriggeredFallthrough; - On.Terraria.NPC.ShouldEmpressBeEnraged += AllowEmpressToEnrageInBossRush; + // Graphics + IL.Terraria.Main.DoDraw += AdditiveDrawing; + On.Terraria.Main.DrawGore += DrawForegroundStuff; + On.Terraria.Main.DrawCursor += UseCoolFireCursorEffect; + On.Terraria.Main.SetDisplayMode += ResetRenderTargetSizes; + On.Terraria.Main.SortDrawCacheWorms += DrawFusableParticles; + On.Terraria.Main.DrawInfernoRings += DrawForegroundParticles; + IL.Terraria.Main.DrawInterface_40_InteractItemIcon += MakeMouseHoverItemsSupportAnimations; + On.Terraria.GameContent.Drawing.TileDrawing.DrawPartialLiquid += DrawCustomLava; + IL.Terraria.WaterfallManager.DrawWaterfall += DrawCustomLavafalls; + IL.Terraria.GameContent.Liquid.LiquidRenderer.InternalDraw += ChangeWaterQuadColors; + IL.Terraria.Main.oldDrawWater += DrawCustomLava3; + On.Terraria.Graphics.Light.TileLightScanner.GetTileLight += MakeSulphSeaWaterBetter; + On.Terraria.GameContent.Drawing.TileDrawing.PreDrawTiles += ClearForegroundStuff; + On.Terraria.GameContent.Drawing.TileDrawing.Draw += ClearTilePings; + On.Terraria.GameContent.ItemDropRules.CommonCode.ModifyItemDropFromNPC += ColorBlightedGel; + + // NPC behavior IL.Terraria.Main.UpdateTime += PermitNighttimeTownNPCSpawning; On.Terraria.Main.UpdateTime_SpawnTownNPCs += AlterTownNPCSpawnRate; + On.Terraria.NPC.ShouldEmpressBeEnraged += AllowEmpressToEnrageInBossRush; + IL.Terraria.Player.CollectTaxes += MakeTaxCollectorUseful; + IL.Terraria.Projectile.Damage += RemoveLunaticCultistHomingResist; + + // Mechanics / features + On.Terraria.NPC.ApplyTileCollision += AllowTriggeredFallthrough; IL.Terraria.Player.Hurt += RemoveRNGFromDodges; IL.Terraria.Player.DashMovement += FixAllDashMechanics; IL.Terraria.Player.GiveImmuneTimeForCollisionAttack += MakeShieldSlamIFramesConsistent; IL.Terraria.Player.Update_NPCCollision += NerfShieldOfCthulhuBonkSafety; On.Terraria.WorldGen.OpenDoor += OpenDoor_LabDoorOverride; On.Terraria.WorldGen.CloseDoor += CloseDoor_LabDoorOverride; - IL.Terraria.Main.DrawInterface_40_InteractItemIcon += MakeMouseHoverItemsSupportAnimations; On.Terraria.Item.AffixName += IncorporateEnchantmentInAffix; On.Terraria.Projectile.NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float += IncorporateMinionExplodingCountdown; - On.Terraria.Main.DrawCursor += UseCoolFireCursorEffect; - IL.Terraria.Player.QuickHeal += ConditionallyReplaceManaSickness; - IL.Terraria.Player.QuickMana += ConditionallyReplaceManaSickness; - IL.Terraria.Player.ItemCheck_Inner += ConditionallyReplaceManaSickness; - IL.Terraria.Main.DoDraw += AdditiveDrawing; - On.Terraria.Main.SortDrawCacheWorms += DrawFusableParticles; - On.Terraria.Main.DrawInfernoRings += DrawForegroundParticles; - On.Terraria.Main.SetDisplayMode += ResetRenderTargetSizes; - On.Terraria.GameContent.Drawing.TileDrawing.DrawPartialLiquid += DrawCustomLava; - IL.Terraria.GameContent.Liquid.LiquidRenderer.InternalDraw += ChangeWaterQuadColors; - IL.Terraria.Main.oldDrawWater += DrawCustomLava3; - IL.Terraria.Player.CollectTaxes += MakeTaxCollectorUseful; - On.Terraria.Graphics.Light.TileLightScanner.GetTileLight += MakeSulphSeaWaterBetter; - On.Terraria.Main.DrawGore += DrawForegroundStuff; - On.Terraria.GameContent.Drawing.TileDrawing.PreDrawTiles += ClearForegroundStuff; - On.Terraria.GameContent.Drawing.TileDrawing.Draw += ClearTilePings; - On.Terraria.Player.GrappleMovement += CustomGrappleMovementCheck; - On.Terraria.Player.UpdatePettingAnimal += CustomGrapplePreDefaultMovement; - On.Terraria.Player.PlayerFrame += CustomGrapplePostFrame; - On.Terraria.Player.SlopeDownMovement += CustomGrapplePreStepUp; - IL.Terraria.WaterfallManager.DrawWaterfall += DrawCustomLavafalls; // TODO -- This should be unnecessary. There is now a TML hook for platform collision for ModNPCs. On.Terraria.NPC.Collision_DecideFallThroughPlatforms += EnableCalamityBossPlatformCollision; IL.Terraria.Wiring.HitWireSingle += AddTwinklersToStatue; + // Mana Burn + IL.Terraria.Player.QuickHeal += ConditionallyReplaceManaSickness; + IL.Terraria.Player.QuickMana += ConditionallyReplaceManaSickness; + IL.Terraria.Player.ItemCheck_Inner += ConditionallyReplaceManaSickness; + + // Custom grappling + On.Terraria.Player.GrappleMovement += CustomGrappleMovementCheck; + On.Terraria.Player.UpdatePettingAnimal += CustomGrapplePreDefaultMovement; + On.Terraria.Player.PlayerFrame += CustomGrapplePostFrame; + On.Terraria.Player.SlopeDownMovement += CustomGrapplePreStepUp; + // Damage and health balance IL.Terraria.Main.DamageVar += AdjustDamageVariance; + IL.Terraria.Projectile.Damage += MakeTagDamageMultiplicative; IL.Terraria.NPC.ScaleStats_ApplyExpertTweaks += RemoveExpertHardmodeScaling; IL.Terraria.Projectile.AI_001 += AdjustChlorophyteBullets; + IL.Terraria.Player.UpdateBuffs += NerfSharpeningStation; // Movement speed balance IL.Terraria.Player.UpdateJumpHeight += FixJumpHeightBoosts; @@ -84,9 +96,6 @@ namespace CalamityMod.ILEditing IL.Terraria.Player.Update += NerfSoaringInsigniaRunAcceleration; IL.Terraria.Player.WingMovement += RemoveSoaringInsigniaInfiniteWingTime; - // Damage balance - IL.Terraria.Player.UpdateBuffs += NerfSharpeningStation; - // Life regen balance IL.Terraria.Player.UpdateLifeRegen += PreventWellFedFromBeingRequiredInExpertModeForFullLifeRegen; @@ -118,18 +127,15 @@ namespace CalamityMod.ILEditing IL.Terraria.Main.UpdateWindyDayState += MakeWindyDayMusicPlayLessOften; IL.Terraria.Main.UpdateTime_StartNight += BloodMoonsRequire200MaxLife; IL.Terraria.WorldGen.AttemptFossilShattering += PreventFossilShattering; - IL.Terraria.Projectile.Damage += MakeTagDamageMultiplicative; On.Terraria.Player.GetPickaxeDamage += RemoveHellforgePickaxeRequirement; - On.Terraria.GameContent.ItemDropRules.CommonCode.ModifyItemDropFromNPC += ColorBlightedGel; // Fix vanilla bugs exposed by Calamity mechanics IL.Terraria.NPC.NPCLoot += FixSplittingWormBannerDrops; On.Terraria.Item.Prefix += LetRogueItemsBeReforgeable; + // Should not be necessary in 1.4 // IL.Terraria.Main.DoUpdate += FixProjectileUpdatePriorityProblems; - //Additional detours that are in their own item files given they are only relevant to these specific items: - //Rover drive detours on Player.DrawInfernoRings to draw its shield //Wulfrum armor hooks on Player.KeyDoubleTap and DrawPendingMouseText to activate its set bonus and spoof the mouse text to display the stats of the activated weapon if shift is held //HeldOnlyItem detours Player.dropItemCheck, ItemSlot.Draw (Sb, itemarray, int, int, vector2, color) and ItemSlot.LeftClick_ItemArray to make its stuff work @@ -143,39 +149,47 @@ namespace CalamityMod.ILEditing VanillaSpawnTownNPCs = null; labDoorOpen = labDoorClosed = aLabDoorOpen = aLabDoorClosed = exoDoorClosed = exoDoorOpen = -1; - // Mechanics / features - On.Terraria.NPC.ApplyTileCollision -= AllowTriggeredFallthrough; - On.Terraria.NPC.ShouldEmpressBeEnraged -= AllowEmpressToEnrageInBossRush; + // Graphics + IL.Terraria.Main.DoDraw -= AdditiveDrawing; + On.Terraria.Main.DrawGore -= DrawForegroundStuff; + On.Terraria.Main.DrawCursor -= UseCoolFireCursorEffect; + On.Terraria.Main.SetDisplayMode -= ResetRenderTargetSizes; + On.Terraria.Main.SortDrawCacheWorms -= DrawFusableParticles; + On.Terraria.Main.DrawInfernoRings -= DrawForegroundParticles; + IL.Terraria.Main.DrawInterface_40_InteractItemIcon -= MakeMouseHoverItemsSupportAnimations; + On.Terraria.GameContent.Drawing.TileDrawing.DrawPartialLiquid -= DrawCustomLava; + IL.Terraria.WaterfallManager.DrawWaterfall -= DrawCustomLavafalls; + IL.Terraria.GameContent.Liquid.LiquidRenderer.InternalDraw -= ChangeWaterQuadColors; + IL.Terraria.Main.oldDrawWater -= DrawCustomLava3; + On.Terraria.Graphics.Light.TileLightScanner.GetTileLight -= MakeSulphSeaWaterBetter; + On.Terraria.GameContent.Drawing.TileDrawing.PreDrawTiles -= ClearForegroundStuff; + On.Terraria.GameContent.Drawing.TileDrawing.Draw -= ClearTilePings; + On.Terraria.GameContent.ItemDropRules.CommonCode.ModifyItemDropFromNPC -= ColorBlightedGel; + + // NPC behavior IL.Terraria.Main.UpdateTime -= PermitNighttimeTownNPCSpawning; On.Terraria.Main.UpdateTime_SpawnTownNPCs -= AlterTownNPCSpawnRate; + On.Terraria.NPC.ShouldEmpressBeEnraged -= AllowEmpressToEnrageInBossRush; + IL.Terraria.Player.CollectTaxes -= MakeTaxCollectorUseful; + IL.Terraria.Projectile.Damage -= RemoveLunaticCultistHomingResist; + + // Mechanics / features + On.Terraria.NPC.ApplyTileCollision -= AllowTriggeredFallthrough; IL.Terraria.Player.Hurt -= RemoveRNGFromDodges; IL.Terraria.Player.DashMovement -= FixAllDashMechanics; IL.Terraria.Player.GiveImmuneTimeForCollisionAttack -= MakeShieldSlamIFramesConsistent; IL.Terraria.Player.Update_NPCCollision -= NerfShieldOfCthulhuBonkSafety; On.Terraria.WorldGen.OpenDoor -= OpenDoor_LabDoorOverride; On.Terraria.WorldGen.CloseDoor -= CloseDoor_LabDoorOverride; - IL.Terraria.Main.DrawInterface_40_InteractItemIcon -= MakeMouseHoverItemsSupportAnimations; On.Terraria.Item.AffixName -= IncorporateEnchantmentInAffix; On.Terraria.Projectile.NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float -= IncorporateMinionExplodingCountdown; - On.Terraria.Main.DrawCursor -= UseCoolFireCursorEffect; + + // Mana Burn IL.Terraria.Player.QuickHeal -= ConditionallyReplaceManaSickness; IL.Terraria.Player.QuickMana -= ConditionallyReplaceManaSickness; IL.Terraria.Player.ItemCheck_Inner -= ConditionallyReplaceManaSickness; - IL.Terraria.Main.DoDraw -= AdditiveDrawing; - On.Terraria.Main.SortDrawCacheWorms -= DrawFusableParticles; - On.Terraria.Main.DrawInfernoRings -= DrawForegroundParticles; - On.Terraria.Main.SetDisplayMode -= ResetRenderTargetSizes; - On.Terraria.GameContent.Drawing.TileDrawing.DrawPartialLiquid -= DrawCustomLava; - IL.Terraria.GameContent.Liquid.LiquidRenderer.InternalDraw -= ChangeWaterQuadColors; - IL.Terraria.Main.oldDrawWater -= DrawCustomLava3; - IL.Terraria.Player.CollectTaxes -= MakeTaxCollectorUseful; - On.Terraria.Graphics.Light.TileLightScanner.GetTileLight -= MakeSulphSeaWaterBetter; - // IL.Terraria.WaterfallManager.DrawWaterfall -= DrawCustomLavafalls; - On.Terraria.NPC.Collision_DecideFallThroughPlatforms -= EnableCalamityBossPlatformCollision; - IL.Terraria.Wiring.HitWireSingle -= AddTwinklersToStatue; - On.Terraria.Main.DrawGore -= DrawForegroundStuff; - On.Terraria.GameContent.Drawing.TileDrawing.PreDrawTiles -= ClearForegroundStuff; - On.Terraria.GameContent.Drawing.TileDrawing.Draw -= ClearTilePings; + + // Custom grappling On.Terraria.Player.GrappleMovement -= CustomGrappleMovementCheck; On.Terraria.Player.UpdatePettingAnimal -= CustomGrapplePreDefaultMovement; On.Terraria.Player.PlayerFrame -= CustomGrapplePostFrame; @@ -183,8 +197,10 @@ namespace CalamityMod.ILEditing // Damage and health balance IL.Terraria.Main.DamageVar -= AdjustDamageVariance; + IL.Terraria.Projectile.Damage -= MakeTagDamageMultiplicative; IL.Terraria.NPC.ScaleStats_ApplyExpertTweaks -= RemoveExpertHardmodeScaling; IL.Terraria.Projectile.AI_001 -= AdjustChlorophyteBullets; + IL.Terraria.Player.UpdateBuffs -= NerfSharpeningStation; // Movement speed balance IL.Terraria.Player.UpdateJumpHeight -= FixJumpHeightBoosts; @@ -195,9 +211,6 @@ namespace CalamityMod.ILEditing IL.Terraria.Player.Update -= NerfSoaringInsigniaRunAcceleration; IL.Terraria.Player.WingMovement -= RemoveSoaringInsigniaInfiniteWingTime; - // Damage balance - IL.Terraria.Player.UpdateBuffs -= NerfSharpeningStation; - // Life regen balance IL.Terraria.Player.UpdateLifeRegen -= PreventWellFedFromBeingRequiredInExpertModeForFullLifeRegen; @@ -222,15 +235,13 @@ namespace CalamityMod.ILEditing IL.Terraria.Item.Prefix -= RelaxPrefixRequirements; On.Terraria.NPC.SlimeRainSpawns -= PreventBossSlimeRainSpawns; IL.Terraria.NPC.SpawnNPC -= MakeVoodooDemonDollWork; - //IL.Terraria.NPC.VanillaHitEffect -= RemoveLavaDropsFromExpertLavaSlimes; + // IL.Terraria.NPC.VanillaHitEffect -= RemoveLavaDropsFromExpertLavaSlimes; IL.Terraria.Player.IsTileTypeInInteractionRange -= IncreasePylonInteractionRange; IL.Terraria.Projectile.CanExplodeTile -= MakeMeteoriteExplodable; IL.Terraria.Main.UpdateWindyDayState -= MakeWindyDayMusicPlayLessOften; IL.Terraria.Main.UpdateTime_StartNight -= BloodMoonsRequire200MaxLife; IL.Terraria.WorldGen.AttemptFossilShattering -= PreventFossilShattering; - IL.Terraria.Projectile.Damage -= MakeTagDamageMultiplicative; On.Terraria.Player.GetPickaxeDamage -= RemoveHellforgePickaxeRequirement; - On.Terraria.GameContent.ItemDropRules.CommonCode.ModifyItemDropFromNPC -= ColorBlightedGel; // Fix vanilla bugs exposed by Calamity mechanics IL.Terraria.NPC.NPCLoot -= FixSplittingWormBannerDrops; diff --git a/Items/Accessories/CorrosiveSpine.cs b/Items/Accessories/CorrosiveSpine.cs index 9c6aa04075..7a224840ea 100644 --- a/Items/Accessories/CorrosiveSpine.cs +++ b/Items/Accessories/CorrosiveSpine.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories SacrificeTotal = 1; DisplayName.SetDefault("Corrosive Spine"); Tooltip.SetDefault("5% increased movement speed\n" + - "All rogue weapons inflict venom and spawn clouds on enemy hits\n" + + "All rogue weapons inflict poisoned and spawn clouds on enemy hits\n" + "You release a ton of clouds everywhere on hit"); } diff --git a/Items/Weapons/Melee/CosmicShiv.cs b/Items/Weapons/Melee/CosmicShiv.cs index 8dde48b2c1..a5a129e030 100644 --- a/Items/Weapons/Melee/CosmicShiv.cs +++ b/Items/Weapons/Melee/CosmicShiv.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.useStyle = ItemUseStyleID.Rapier; - Item.DamageType = TrueMeleeDamageClass.Instance; + Item.DamageType = DamageClass.Melee; Item.useAnimation = 18; Item.useTime = 18; Item.width = 44; diff --git a/Items/Weapons/Melee/ElementalShiv.cs b/Items/Weapons/Melee/ElementalShiv.cs index 158a1981db..9f37e0cd70 100644 --- a/Items/Weapons/Melee/ElementalShiv.cs +++ b/Items/Weapons/Melee/ElementalShiv.cs @@ -1,9 +1,9 @@ -using Terraria.DataStructures; -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee.Shortswords; using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.useStyle = ItemUseStyleID.Rapier; - Item.DamageType = TrueMeleeDamageClass.Instance; + Item.DamageType = DamageClass.Melee; Item.useAnimation = 10; Item.useTime = 10; Item.width = 44; diff --git a/Localization/CalamityLocalization.cs b/Localization/CalamityLocalization.cs index e8be92b01b..63ee09fbc0 100644 --- a/Localization/CalamityLocalization.cs +++ b/Localization/CalamityLocalization.cs @@ -126,6 +126,7 @@ namespace CalamityMod.Localization new [] { "DraedonExoPhase6Text3", "I shall show you the full fury of my final machine." }, new [] { "DraedonAresEnrageText", "How foolish. You cannot escape." }, new [] { "DraedonResummonText", "Make your choice." }, + new [] { "DraedonBossRushText", "Make your choice. You have 20 seconds." }, new [] { "DraedonEndText1", "An unknown factor-a catalyst is what you are." }, new [] { "DraedonEndText2", "Nearly as alien as I, to this land and its history." }, new [] { "DraedonEndText3", "...Excuse my introspection. I must gather my thoughts after that display." }, diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 957ba6d914..8141348943 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -4560,7 +4560,7 @@ namespace CalamityMod.NPCs bool phaseSwitchPhase = (phase2 && calamityGlobalNPC.newAI[0] < newPhaseTimer && calamityGlobalNPC.newAI[2] != 1f) || (phase3 && calamityGlobalNPC.newAI[1] < newPhaseTimer && calamityGlobalNPC.newAI[3] != 1f); - calamityGlobalNPC.DR = (phaseSwitchPhase || npc.ai[0] == 5f || (enrageScale == 3f && !bossRush)) ? 0.55f : 0.1f; + calamityGlobalNPC.DR = (phaseSwitchPhase || npc.ai[0] == 5f || (enrageScale == 3f && !bossRush)) ? (bossRush ? 0.99f : 0.55f) : 0.1f; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phaseSwitchPhase || npc.ai[0] == 5f || (enrageScale == 3f && !bossRush); if (phaseSwitchPhase) @@ -5575,7 +5575,7 @@ namespace CalamityMod.NPCs // Increased DR while transitioning phases and not exhausted if (!exhausted) - calamityGlobalNPC.DR = (npc.ai[0] == -1f || npc.ai[0] == 4f || npc.ai[0] == 9f) ? 0.75f : 0.5f; + calamityGlobalNPC.DR = (npc.ai[0] == -1f || npc.ai[0] == 4f || npc.ai[0] == 9f) ? (bossRush ? 0.99f : 0.75f) : 0.5f; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = npc.ai[0] == -1f || npc.ai[0] == 4f || npc.ai[0] == 9f; diff --git a/NPCs/Crabulon/CrabShroom.cs b/NPCs/Crabulon/CrabShroom.cs index c7b7fd1111..d9ab79d2d0 100644 --- a/NPCs/Crabulon/CrabShroom.cs +++ b/NPCs/Crabulon/CrabShroom.cs @@ -28,7 +28,7 @@ namespace CalamityMod.NPCs.Crabulon NPC.lifeMax = 15; if (BossRushEvent.BossRushActive) - NPC.lifeMax = 15000; + NPC.lifeMax = 8000; if (Main.getGoodWorld) NPC.lifeMax *= 2; diff --git a/NPCs/Crabulon/Crabulon.cs b/NPCs/Crabulon/Crabulon.cs index 0aaadbba51..9382127cd6 100644 --- a/NPCs/Crabulon/Crabulon.cs +++ b/NPCs/Crabulon/Crabulon.cs @@ -58,7 +58,7 @@ namespace CalamityMod.NPCs.Crabulon NPC.width = 196; NPC.height = 196; NPC.defense = 8; - NPC.LifeMaxNERB(3350, 4000, 1100000); + NPC.LifeMaxNERB(3350, 4000, 680000); double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index fdc4269593..d4ec3a4e0a 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -1198,7 +1198,7 @@ namespace CalamityMod.NPCs.Cryogen // Spawn Permafrost if he isn't in the world int permafrostNPC = NPC.FindFirstNPC(ModContent.NPCType()); - if (permafrostNPC == -1) + if (permafrostNPC == -1 && !BossRushEvent.BossRushActive) NPC.NewNPC(NPC.GetSource_Death(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); // If Cryogen has not been killed, notify players about Cryonic Ore diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index 0881a6e169..7bc8733490 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -271,7 +271,9 @@ namespace CalamityMod.NPCs.ExoMechs // Inform the player who summoned draedon they may choose the first mech and cause a selection UI to appear over their head. if (Main.netMode != NetmodeID.MultiplayerClient && TalkTimer == TalkDelay + DelayPerDialogLine * 4f) { - if ((CalamityWorld.TalkedToDraedon || bossRush)) + if (bossRush) + CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.DraedonBossRushText", TextColorEdgy); + else if (CalamityWorld.TalkedToDraedon) CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.DraedonResummonText", TextColorEdgy); else CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.DraedonIntroductionText5", TextColorEdgy); @@ -295,7 +297,7 @@ namespace CalamityMod.NPCs.ExoMechs { // Summon a random exo mech if you wait too long BossRushCounter++; - if (BossRushCounter > 600 && CalamityWorld.DraedonMechToSummon == ExoMech.None) + if (BossRushCounter > 1200 && CalamityWorld.DraedonMechToSummon == ExoMech.None) { CalamityWorld.DraedonMechToSummon = (ExoMech)Main.rand.Next(1,4); diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 33106d54fb..e7f095edd5 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -760,8 +760,8 @@ namespace CalamityMod.NPCs.StormWeaver lightning -= lightningDecay; } - // Start a storm when in third phase - if (Main.netMode == NetmodeID.MultiplayerClient || (Main.netMode == NetmodeID.SinglePlayer && Main.gameMenu) || calamityGlobalNPC.newAI[1] > 0f) + // Start a storm when in third phase. Don't do this during Boss Rush + if (Main.netMode == NetmodeID.MultiplayerClient || (Main.netMode == NetmodeID.SinglePlayer && Main.gameMenu) || calamityGlobalNPC.newAI[1] > 0f || bossRush) return; CalamityUtils.StartRain(true, true); diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index d047b55813..d04147c736 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -2564,7 +2564,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas Main.player[NPC.target].Calamity().sCalKillCount++; // Spawn the SCal NPC directly where the boss was - NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y + 12, ModContent.NPCType()); + if (!BossRushEvent.BossRushActive) + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y + 12, ModContent.NPCType()); // Mark Supreme Calamitas as defeated DownedBossSystem.downedSCal = true; diff --git a/NPCs/VanillaNPCOverrides/Bosses/DukeFishronAI.cs b/NPCs/VanillaNPCOverrides/Bosses/DukeFishronAI.cs index bcaf119e34..39946748a6 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/DukeFishronAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/DukeFishronAI.cs @@ -161,7 +161,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.dontTakeDamage = false; // Increased DR during phase transitions - calamityGlobalNPC.DR = (npc.ai[0] == -1f || npc.ai[0] == 4f || npc.ai[0] == 9f) ? 0.625f : 0.15f; + calamityGlobalNPC.DR = (npc.ai[0] == -1f || npc.ai[0] == 4f || npc.ai[0] == 9f) ? (bossRush ? 0.99f : 0.625f) : 0.15f; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = npc.ai[0] == -1f || npc.ai[0] == 4f || npc.ai[0] == 9f; // Enrage diff --git a/NPCs/VanillaNPCOverrides/Bosses/EmpressofLightAI.cs b/NPCs/VanillaNPCOverrides/Bosses/EmpressofLightAI.cs index 892bf76d8c..3fa2bb0fb3 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/EmpressofLightAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/EmpressofLightAI.cs @@ -604,7 +604,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.damage = 0; // Increase durability. - calamityGlobalNPC.DR = shouldBeInPhase2ButIsStillInPhase1 ? 0.99f : 0.575f; + calamityGlobalNPC.DR = shouldBeInPhase2ButIsStillInPhase1 ? 0.99f : (bossRush ? 0.99f : 0.575f); int totalSunDances = phase2 ? 2 : 3; float sunDanceGateValue = dayTimeEnrage ? 35f : death ? 40f : 50f; diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index f6e258cb8a..f474daec79 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -384,17 +384,17 @@ namespace CalamityMod.NPCs.Yharon { if (phase3Change) { - calamityGlobalNPC.DR = phase4Check ? 0.7f : normalDR; + calamityGlobalNPC.DR = phase4Check ? (bossRush ? 0.99f : 0.7f) : normalDR; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase4Check; } else if (phase2Change) { - calamityGlobalNPC.DR = phase3Check ? 0.7f : normalDR; + calamityGlobalNPC.DR = phase3Check ? (bossRush ? 0.99f : 0.7f) : normalDR; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase3Check; } else if (phase1Change) { - calamityGlobalNPC.DR = phase2Check ? 0.7f : normalDR; + calamityGlobalNPC.DR = phase2Check ? (bossRush ? 0.99f : 0.7f) : normalDR; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase2Check; } } @@ -1620,22 +1620,22 @@ namespace CalamityMod.NPCs.Yharon switch (secondPhasePhase) { case 1: - calamityGlobalNPC.DR = phase2 ? 0.7f : normalDR; + calamityGlobalNPC.DR = phase2 ? (bossRush ? 0.99f : 0.7f) : normalDR; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase2; break; case 2: - calamityGlobalNPC.DR = phase3 ? 0.7f : normalDR; + calamityGlobalNPC.DR = phase3 ? (bossRush ? 0.99f : 0.7f) : normalDR; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase3; break; case 3: - calamityGlobalNPC.DR = phase4 ? 0.7f : normalDR; + calamityGlobalNPC.DR = phase4 ? (bossRush ? 0.99f : 0.7f) : normalDR; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase4; break; } if (NPC.ai[0] == 9f) { - calamityGlobalNPC.DR = 0.7f; + calamityGlobalNPC.DR = bossRush ? 0.99f : 0.7f; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = true; } } diff --git a/Particles/Metaballs/FusableParticleManager.cs b/Particles/Metaballs/FusableParticleManager.cs index 21a476713f..0a689c6a03 100644 --- a/Particles/Metaballs/FusableParticleManager.cs +++ b/Particles/Metaballs/FusableParticleManager.cs @@ -221,6 +221,10 @@ namespace CalamityMod.Particles.Metaballs if (Main.netMode == NetmodeID.Server) return null; + // Reload particle sets if they are completely unloaded for some reason. + if (ParticleSets.Count <= 0) + LoadParticleRenderSets(true); + return ParticleSets.First(s => s.ParticleSet.GetType() == typeof(T)).ParticleSet as T; } } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 205c6814e0..44b89053a2 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -149,8 +149,8 @@ namespace CalamityMod.Projectiles #region SetDefaults public override void SetDefaults(Projectile projectile) { - // Disable Lunatic Cultist's homing resistance globally - ProjectileID.Sets.CultistIsResistantTo[projectile.type] = false; + // OLD 1.3 CODE: Disable Lunatic Cultist's homing resistance globally + // ProjectileID.Sets.CultistIsResistantTo[projectile.type] = false; // Apply Calamity Global Projectile Tweaks. SetDefaults_ApplyTweaks(projectile); diff --git a/Projectiles/Summon/DormantBrimseekerBab.cs b/Projectiles/Summon/DormantBrimseekerBab.cs index 7d76ad10f1..cf541a66aa 100644 --- a/Projectiles/Summon/DormantBrimseekerBab.cs +++ b/Projectiles/Summon/DormantBrimseekerBab.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Summon public class DormantBrimseekerBab : ModProjectile { public const float DistanceToCheck = 1600f; - public const int TurnTime = 7; + public const int TurnTime = 12; public bool SeekingTarget = false; public float MaxChargeTime { @@ -113,9 +113,9 @@ namespace CalamityMod.Projectiles.Summon { SoundEngine.PlaySound(SoundID.DD2_DrakinShot, Projectile.Center); Projectile.ai[0]++; - float acceleration = (Projectile.localAI[1] == 1f) ? 1.85f : 1.1f; - float minSpeed = (Projectile.localAI[1] == 1f) ? 21.5f : 15f; - float maxSpeed = (Projectile.localAI[1] == 1f) ? 32f : 24f; + float acceleration = (Projectile.localAI[1] == 1f) ? 1.5f : 1.1f; + float minSpeed = (Projectile.localAI[1] == 1f) ? 17.5f : 15f; + float maxSpeed = (Projectile.localAI[1] == 1f) ? 28f : 24f; Projectile.velocity = Projectile.SafeDirectionTo(potentialTarget.Center) * MathHelper.Clamp(Projectile.velocity.Length() + acceleration, minSpeed, maxSpeed); Projectile.rotation = Projectile.AngleTo(potentialTarget.Center) + (Projectile.spriteDirection == 1).ToInt() * MathHelper.Pi; } diff --git a/Systems/WorldMiscUpdateSystem.cs b/Systems/WorldMiscUpdateSystem.cs index c8a983e6e4..780f28e764 100644 --- a/Systems/WorldMiscUpdateSystem.cs +++ b/Systems/WorldMiscUpdateSystem.cs @@ -150,7 +150,7 @@ namespace CalamityMod.Systems if (y2 < 10) y2 = 10; - if (Main.tile[x, y] != null) + if (WorldGen.InWorld(x, y, 1) && Main.tile[x, y] != null) { if (Main.tile[x, y].HasUnactuatedTile) { @@ -161,7 +161,7 @@ namespace CalamityMod.Systems if (Main.tile[x, y2].LiquidAmount == 0) { // Plantera Bulbs pre-mech - if (WorldGen.genRand.Next(1500) == 0) + if (WorldGen.genRand.NextBool(1500)) { if (Main.hardMode && (!NPC.downedMechBoss1 || !NPC.downedMechBoss2 || !NPC.downedMechBoss3)) { @@ -195,7 +195,7 @@ namespace CalamityMod.Systems // Life Fruit pre-mech int random = Main.expertMode ? 90 : 120; - if (WorldGen.genRand.Next(random) == 0) + if (WorldGen.genRand.NextBool(random)) { if (Main.hardMode && !NPC.downedMechBossAny) { @@ -315,7 +315,6 @@ namespace CalamityMod.Systems } l++; } - } public static bool CanPlaceBasedOnProximity(int x, int y, int tileType) diff --git a/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs b/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs index 4244b70d54..29c9d91e4d 100644 --- a/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs +++ b/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs @@ -13,7 +13,7 @@ namespace CalamityMod.UI.SulphurousWaterMeter { // These values were decided relative to the stealth meter positions, and are by default slightly below them. internal const float DefaultPosX = StealthUI.DefaultStealthPosX; - internal const float DefaultPosY = StealthUI.DefaultStealthPosY + 0.0377f; + internal const float DefaultPosY = StealthUI.DefaultStealthPosY + 2.286282f; private const float MouseDragEpsilon = 0.05f; // 0.05% private static Vector2? dragOffset = null;