diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index 9cc73f84a1..226bf39ba5 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -259,15 +259,15 @@ namespace CalamityMod.Balancing // 70% resist to Stardust Dragon Staff. NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.StardustDragon1, ProjectileID.StardustDragon2, ProjectileID.StardustDragon3, ProjectileID.StardustDragon4)))); - // 65% resist to Atlantis (Atlantis gaming!). - NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType())))); - // 55% resist to Flak Kraken. NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.45f, ProjectileType())))); // 50% resist to true melee. NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(ResistTrueMelee(0.5f)))); + // 50% resist to Atlantis (Atlantis gaming!). + NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + // 50% resist to Aurora Blazer. NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 3f9d258b45..6314224166 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -61,9 +61,11 @@ using CalamityMod.Systems; using CalamityMod.Systems.Collections; using CalamityMod.World; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; using Terraria.DataStructures; +using Terraria.GameContent; using Terraria.GameInput; using Terraria.Graphics.Shaders; using Terraria.ID; @@ -143,6 +145,7 @@ namespace CalamityMod.CalPlayer public bool disableHiveCystSpawns = false; public bool disableNaturalScourgeSpawns = false; public bool disableAnahitaSpawns = false; + public int whitewaterHeal = 0; /// Used for toggling Calamity's blazing cursor effect. public bool blazingCursorDamage = false; /// @@ -710,9 +713,11 @@ namespace CalamityMod.CalPlayer public bool shieldOfTheHighRulerDashVelocityBoosted = false; public bool luxorsGift = false; public bool luxorHit = false; + public bool luxorsGiftVanity = false; public bool fungalSymbiote = false; public bool trinketOfChi = false; public bool gladiatorSword = false; + public int gladiatorTimer = 0; public bool unstableGraniteCore = false; public bool regenator = false; public float regenatorDamage = 0; @@ -731,6 +736,10 @@ namespace CalamityMod.CalPlayer /// Used to prevent dodges from triggering The Bee's full health damage reduction cooldown. public bool shouldTriggerBeeCooldown = false; public int theBeeCooldown = 0; + public bool aFossil = false; + public bool aPowder = false; + public bool fallingBlockProtection = false; + public bool trapProtection = false; public bool alluringBait = false; public bool enchantedPearl = false; public bool fishingStation = false; @@ -872,8 +881,6 @@ namespace CalamityMod.CalPlayer public int PurityHealSlowdownFrames = 0; public bool harpyRing = false; public bool angelTreads = false; - /// Synergy effect while wearing Harpy Wings with Harpy Ring or Angel Treads, allowing attacks to be accompanied by feathers. - public bool harpyWingBoost = false; /// Counter variable used for automatically re-engaging Vortex armor's stealth with Vortex Booster. public int vortexBoosterStealthDelay = 0; /// Makes Flesh Knuckles and its upgrades increase the player's max health by 45. @@ -2128,6 +2135,7 @@ namespace CalamityMod.CalPlayer blazingCursorVisuals = false; luxorsGift = false; + luxorsGiftVanity = false; fungalSymbiote = false; trinketOfChi = false; gladiatorSword = false; @@ -2139,6 +2147,10 @@ namespace CalamityMod.CalPlayer arcFlashRingVisual = false; bGlassBand = false; bGlassBandVisual = false; + aFossil = false; + aPowder = false; + fallingBlockProtection = false; + trapProtection = false; alluringBait = false; enchantedPearl = false; fishingStation = false; @@ -2213,7 +2225,6 @@ namespace CalamityMod.CalPlayer purity = false; harpyRing = false; angelTreads = false; - harpyWingBoost = false; //harpy wings + harpy ring fleshKnuckles = false; darkSunRing = false; crawCarapace = false; @@ -2789,6 +2800,7 @@ namespace CalamityMod.CalPlayer #region Buffs, Debuffs, Counters, and Nonsense heldGaelsLastFrame = false; gaelSwipes = 0; + whitewaterHeal = 0; luxorHit = false; arsenalCooldown = 0; andromedaState = AndromedaPlayerState.Inactive; @@ -3404,6 +3416,80 @@ namespace CalamityMod.CalPlayer SoundEngine.PlaySound(SoundID.Item34, Player.Center); } + if (CalamityKeybinds.AmmoCycleHotkey.JustPressed && deadshotBrooch) + { + SoundEngine.PlaySound(SoundID.Item149, Player.Center); + + // I could've made this so simple on myself, but no, I felt the need to make things convenient for the users... + // First we need to determine the bounds for what we're swapping. + int ammoType = Player.HeldItem.useAmmo; + int lastSlot, firstSlot; + for (lastSlot = 57; lastSlot >= 54; lastSlot--) + { + if (!Player.inventory[lastSlot].IsAir && Player.inventory[lastSlot].ammo == ammoType) + break; + } + for (firstSlot = 54; firstSlot <= 57; firstSlot++) + { + if (!Player.inventory[firstSlot].IsAir && Player.inventory[firstSlot].ammo == ammoType) + break; + } + // If firstSlot = lastSlot, then there is only one ammo in ammo slots, so don't do anything. + if (firstSlot != lastSlot) + { + int tempType = Player.inventory[lastSlot].type; + int tempStack = Player.inventory[lastSlot].stack; + // This list tracks the favorited status of the ammo slots. Since swapping the slots around fucks with the favorite status it must be manually set. + List favorited = []; + for (int z = 54; z <= 57; z++) + favorited.Add(!Player.inventory[z].IsAir && Player.inventory[z].favorited); + + // It is impossible for lastSlot to equal 54 and firstSlot to not equal 54. + for (int i = lastSlot; i >= 55; i--) + { + if (Player.inventory[i].IsAir || Player.inventory[i].ammo != ammoType) + continue; + + // If the slot we're interested in is the lower bound of our ammos, set it to the temp values and don't run anything else. + if (i == firstSlot) + { + Player.inventory[i].SetDefaults(tempType); + Player.inventory[i].stack = tempStack; + Player.inventory[i].favorited = favorited[lastSlot - 54]; + continue; + } + + // Find the next slot that has ammo in it. + int nextSlot; + for (nextSlot = i - 1; nextSlot >= 54; nextSlot--) + { + if (!Player.inventory[nextSlot].IsAir && Player.inventory[nextSlot].ammo == ammoType) + break; + } + + // Set this slot to what is in that slot. + Player.inventory[i].SetDefaults(Player.inventory[nextSlot].type); + Player.inventory[i].stack = Player.inventory[nextSlot].stack; + Player.inventory[i].favorited = favorited[nextSlot - 54]; + } + + // Handles swapping the ammo that is in the first slot. + if (firstSlot == 54) + { + Player.inventory[54].SetDefaults(tempType); + Player.inventory[54].stack = tempStack; + Player.inventory[54].favorited = favorited[lastSlot - 54]; + } + + // Produce a visual effect showing the top ammo that you swapped to. + int visualType = Player.inventory[firstSlot].type; + Texture2D ammoTex = TextureAssets.Item[visualType].Value; + int frameAmt = Main.itemAnimations[visualType] == null ? 1 : ammoTex.Height / Main.itemAnimations[visualType].GetFrame(ammoTex).Height; + CustomSprite ammoVisual = new(Player.Center - Vector2.UnitY * 20f, -Vector2.UnitY * 7f, 30, ammoTex, 1f, Color.White, 0f, false, false, frameAmt); + GeneralParticleHandler.SpawnParticle(ammoVisual); + } + } + if (CalamityKeybinds.ArmorSetBonusHotKey.JustPressed) { PlayerLoader.ArmorSetBonusActivated(Player); @@ -4006,7 +4092,7 @@ namespace CalamityMod.CalPlayer } // Cancel fall and don't give 'on ground' effects if on rope, on mount, grappled, or tongued // Also cancel fall if the player has upwards Y velocity (Goodbye Inner Tube cheese) - if (Player.velocity.Y < 0f || Player.pulley || Player.mount.Active || Player.grappling[0] != -1 || Player.tongued) + if ((Player.gravDir == 1 && Player.velocity.Y < 0f) || (Player.gravDir == -1 && Player.velocity.Y > 1f) || Player.pulley || Player.mount.Active || Player.grappling[0] != -1 || Player.tongued) { gSabatonFall = 0; gSabatonFalling = false; diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index dcc2c5d56e..a8f69fe751 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -995,7 +995,7 @@ namespace CalamityMod.CalPlayer modifiers.SourceDamage *= 0.65f; // 80 in normal, 100 in expert, 150 in master - else if (proj.type == ProjectileID.SpikyBallTrap || proj.type == ProjectileID.FlamethrowerTrap || proj.type == ProjectileID.PoisonDartTrap) + else if (proj.type == ProjectileID.SpikyBallTrap || proj.type == ProjectileID.FlamethrowerTrap || proj.type == ProjectileID.FlamesTrap || proj.type == ProjectileID.PoisonDartTrap) modifiers.SourceDamage *= 0.625f; // 120 in normal, 144 in expert, 216 in master @@ -1003,6 +1003,24 @@ namespace CalamityMod.CalPlayer modifiers.SourceDamage *= 0.6f; } + bool isFallingBlock = (proj.type == ProjectileID.SandBallFalling) || (proj.type == ProjectileID.SiltBall) || (proj.type == ProjectileID.AshBallFalling) || + (proj.type == ProjectileID.CrimsandBallFalling) || (proj.type == ProjectileID.EbonsandBallFalling) || (proj.type == ProjectileID.PearlSandBallFalling) || + (proj.type == ProjectileID.ShellPileFalling) || (proj.type == ProjectileID.SlushBall) || (proj.type == ModContent.ProjectileType()); + if (Player.Calamity().fallingBlockProtection && isFallingBlock) + modifiers.Cancel(); + + bool isIgnoredTrap = (proj.type == ProjectileID.PoisonDartTrap) || (proj.type == ProjectileID.VenomDartTrap) || (proj.type == ProjectileID.PoisonDart); + if (Player.Calamity().trapProtection && isIgnoredTrap) + modifiers.Cancel(); + + bool isReducedTrap = (proj.type == ProjectileID.Boulder) || (proj.type == ProjectileID.BouncyBoulder) || (proj.type == ProjectileID.LifeCrystalBoulder) || + (proj.type == ProjectileID.MiniBoulder) || (proj.type == ProjectileID.MoonBoulder) || (proj.type == ProjectileID.SpearTrap) || + (proj.type == ProjectileID.SpikyBallTrap) || (proj.type == ProjectileID.GeyserTrap) || (proj.type == ProjectileID.FlamethrowerTrap) || + (proj.type == ProjectileID.RollingCactus) || (proj.type == ProjectileID.RollingCactusSpike) || (proj.type == ProjectileID.Explosives) || + (proj.type == ProjectileID.TNTBarrel) || (proj.type == ProjectileID.Landmine) || (proj.type == ModContent.ProjectileType()) || (proj.type == ProjectileID.FlamesTrap); // Fun fact: flamethrower traps fire proj 188, NOT ProjectileID.FlamethrowerTrap :) + if (Player.Calamity().trapProtection && isReducedTrap) + modifiers.SourceDamage *= 0.35f; + // Reduce damage dealt by rainbow trails depending on how faded they are. if (proj.type == ProjectileID.HallowBossLastingRainbow) { diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 5a65730151..d686181a32 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -409,10 +409,10 @@ namespace CalamityMod.CalPlayer 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 + // The upper limit to how slow it can get is after 15 seconds (900 frames) int punishmentFrames = PurityHealSlowdownFrames - 300; - //lowest punishment is three full seconds between the one health heal - if (healFrameCadence < 180) + //lowest punishment is a little under a second between the one health heal + if (healFrameCadence < 52) healFrameCadence += (punishmentFrames < 0) ? 0 : punishmentFrames / 15; if (Player.miscCounter % healFrameCadence == healFrameCadence - 1) @@ -426,7 +426,8 @@ namespace CalamityMod.CalPlayer jewelBonusDefense = intendedPurityDefense; // Count up total frames spent healing for slowdown. - ++PurityHealSlowdownFrames; + if (PurityHealSlowdownFrames < 900) + ++PurityHealSlowdownFrames; } // If the defense should be ticking down to some lower value, do that. diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index c1f1904037..151381aca0 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1788,6 +1788,25 @@ namespace CalamityMod.CalPlayer } } + if (whitewaterHeal > 0) + { + if (whitewaterHeal % 15 == 0) + Player.HealPlayer(1); + whitewaterHeal--; + + Vector2 vel = (MathHelper.TwoPi * whitewaterHeal * Player.direction / 25).ToRotationVector2() * 3f; + for (int i = -1; i <= 1; i += 2) + { + Dust c = Dust.NewDustPerfect(Player.Center + vel * 4 * i, ModContent.DustType()); + c.velocity = vel * i; + c.scale = Main.rand.NextFloat(0.9f, 1f); + c.noGravity = true; + c.alpha = 150; + c.color = Color.SkyBlue; + c.noLightEmittence = true; + } + } + // Tick all cooldowns. // Depending on the code for each individual cooldown, this isn't guaranteed to do anything. // It may not tick down the timer or not do anything at all. @@ -1870,6 +1889,8 @@ namespace CalamityMod.CalPlayer KameiBladeUseDelay--; if (galileoCooldown > 0) galileoCooldown--; + if (gladiatorTimer > 0) + gladiatorTimer--; if (dragonRageCooldown > 0) dragonRageCooldown--; if (soundCooldown > 0) @@ -2016,9 +2037,14 @@ namespace CalamityMod.CalPlayer else if (blazingCoreParry > 0) BlazingCore.HandleParryCountdown(Player); } - else if (flameLickedShell && flameLickedShellParry > 0) + else if (blazingCoreParry > 0) + blazingCoreParry--; + else if (flameLickedShellParry > 0) { - FlameLickedShell.HandleParryCountdown(Player); + if (flameLickedShell) + FlameLickedShell.HandleParryCountdown(Player); + else + flameLickedShellParry--; } if (shieldOfTheOceanParry > 0) { diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index e07dba7ad0..d2beb90e23 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -1282,8 +1282,13 @@ namespace CalamityMod.CalPlayer if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5) { + float healPower = 10 * Utils.GetLerpValue(300, 0, gladiatorTimer, true); target.Calamity().gladiatorOnKill = false; - Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center.X, target.Center.Y, target.velocity.X / 2, target.velocity.Y / 2, ProjectileType(), 0, 0f); + if (healPower >= 1) + { + Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType(), 0, 0, -1, (int)healPower); + gladiatorTimer = 300; + } } if (Main.LocalPlayer.lifeSteal > 0f && !Player.moonLeech && target.lifeMax > 5) @@ -1450,8 +1455,13 @@ namespace CalamityMod.CalPlayer if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5) { + float healPower = 10 * Utils.GetLerpValue(300, 0, gladiatorTimer, true); target.Calamity().gladiatorOnKill = false; - Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType(), 0, 0f); + if (healPower >= 1) + { + Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType(), 0, 0, -1, (int)healPower); + gladiatorTimer = 300; + } } if (reaverDefense) diff --git a/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs b/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs index 029b50fe1b..9d364b2ec0 100644 --- a/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs +++ b/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs @@ -84,6 +84,8 @@ namespace CalamityMod.CalPlayer.DrawLayers glowMask = ModContent.Request("CalamityMod/Items/Weapons/Melee/PrismaticBreakerGlow").Value; else if (itemType == ModContent.ItemType()) glowMask = ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/PulseRifleGlow").Value; + else if (itemType == ModContent.ItemType()) + glowMask = ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/GaussRifleGlow").Value; else if (itemType == ModContent.ItemType()) glowMask = ModContent.Request("CalamityMod/Items/Weapons/Magic/SoulPiercerGlow").Value; else if (itemType == ModContent.ItemType()) diff --git a/CalamityKeybinds.cs b/CalamityKeybinds.cs index cba78a4d7b..c09e181762 100644 --- a/CalamityKeybinds.cs +++ b/CalamityKeybinds.cs @@ -6,6 +6,7 @@ namespace CalamityMod { public static ModKeybind AccessoryParryHotKey { get; private set; } public static ModKeybind AdrenalineHotKey { get; private set; } + public static ModKeybind AmmoCycleHotkey { get; private set; } public static ModKeybind AngelicAllianceHotKey { get; private set; } public static ModKeybind ArmorSetBonusHotKey { get; private set; } public static ModKeybind AscendantInsigniaHotKey { get; private set; } @@ -24,6 +25,7 @@ namespace CalamityMod // Register keybinds AccessoryParryHotKey = KeybindLoader.RegisterKeybind(Mod, "ActivateAccessoryParry", "N"); AdrenalineHotKey = KeybindLoader.RegisterKeybind(Mod, "AdrenalineMode", "B"); + AmmoCycleHotkey = KeybindLoader.RegisterKeybind(Mod, "AmmoCycle", "Mouse3"); AngelicAllianceHotKey = KeybindLoader.RegisterKeybind(Mod, "AngelicAllianceBlessing", "G"); ArmorSetBonusHotKey = KeybindLoader.RegisterKeybind(Mod, "ArmorSetBonus", "Y"); AscendantInsigniaHotKey = KeybindLoader.RegisterKeybind(Mod, "AscendantInsigniaHotKey", "K"); @@ -42,6 +44,7 @@ namespace CalamityMod { AccessoryParryHotKey = null; AdrenalineHotKey = null; + AmmoCycleHotkey = null; AngelicAllianceHotKey = null; ArmorSetBonusHotKey = null; AscendantInsigniaHotKey = null; diff --git a/DataStructures/NPCStats.cs b/DataStructures/NPCStats.cs index 26ccaea36d..e1ebbd3f93 100644 --- a/DataStructures/NPCStats.cs +++ b/DataStructures/NPCStats.cs @@ -707,13 +707,13 @@ namespace CalamityMod { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 100, 172, 208, 244, 366 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 88, 156, 184, 212, 318 } }, - { new Tuple(NPCID.Golem, ProjectileID.Fireball), new int[] { 72, 132, 160, 188, 282 } }, + { new Tuple(NPCID.Golem, ProjectileID.Fireball), new int[] { 60, 120, 140, 180, 270 } }, { new Tuple(NPCID.Golem, ProjectileID.EyeBeam), new int[] { 80, 140, 172, 204, 306 } }, - { new Tuple(NPCID.GolemHead, ProjectileID.Fireball), new int[] { 60, 120, 160, 200, 300 } }, + { new Tuple(NPCID.GolemHead, ProjectileID.Fireball), new int[] { 60, 120, 140, 180, 270 } }, { new Tuple(NPCID.GolemHead, ProjectileID.EyeBeam), new int[] { 80, 140, 172, 204, 306 } }, { new Tuple(NPCID.GolemFistLeft, ProjectileID.InfernoHostileBolt), new int[] { 88, 156, 184, 212, 318 } }, { new Tuple(NPCID.GolemFistRight, ProjectileID.InfernoHostileBolt), new int[] { 88, 156, 184, 212, 318 } }, - { new Tuple(NPCID.GolemHeadFree, ProjectileID.Fireball), new int[] { 60, 120, 160, 200, 300 } }, + { new Tuple(NPCID.GolemHeadFree, ProjectileID.Fireball), new int[] { 60, 120, 140, 180, 270 } }, { new Tuple(NPCID.GolemHeadFree, ProjectileID.EyeBeam), new int[] { 80, 140, 172, 204, 306 } }, { new Tuple(NPCID.GolemHeadFree, ProjectileID.InfernoHostileBolt), new int[] { 88, 156, 184, 212, 318 } }, diff --git a/ExtraTextures/ExtraTextureRefs.cs b/ExtraTextures/ExtraTextureRefs.cs index dd5c2d46a8..bc86cb89a7 100644 --- a/ExtraTextures/ExtraTextureRefs.cs +++ b/ExtraTextures/ExtraTextureRefs.cs @@ -13,7 +13,7 @@ using Terraria.ModLoader; namespace CalamityMod.ExtraTextures { [Autoload(Side = ModSide.Client)] - internal sealed class ExtraTextureRefs : ModSystem + public class ExtraTextureRefs : ModSystem { // Destroyer glowmasks public static Asset DestroyerHeadGlowmask; diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 5e7483cac7..8a366bd53a 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -206,6 +206,7 @@ namespace CalamityMod.ILEditing On_Player.ItemCheck_CheckCanUse += RemoveUseLocks; On_Player.ItemCheck_UseEventItems += ApplyCelestialSigilChanges; IL_Main.DrawInfoAccs += RemoveDamageConditionFromRadar; + On_ShopHelper.ApplyNpcRelationshipEffect += AllowMultipleLikedNPCs; // Fix vanilla bugs exposed by Calamity mechanics IL_NPC.NPCLoot += FixSplittingWormBannerDrops; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 982f343ba2..8563814c11 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -1868,7 +1868,7 @@ namespace CalamityMod.ILEditing #region Revengeance Master Mode Twins Shenanigans public static void TripletsSpawnTextOverride(Terraria.On_NPC.orig_SpawnBoss orig, int x, int y, int type, int targetPlayerIndex) { - if (Main.masterMode && CalamityWorld.revenge && type == NPCID.Retinazer) + if (CalamityWorld.death && type == NPCID.Retinazer) { int retinazerIndex = NPC.NewNPC(NPC.GetBossSpawnSource(targetPlayerIndex), x, y, type, 1); if (retinazerIndex == 200) @@ -1896,7 +1896,7 @@ namespace CalamityMod.ILEditing public static void PreventFoveanatorDefeatMessageIfNotKilledLast(On_NPC.orig_DoDeathEvents_BeforeLoot orig, NPC self, Player closestPlayer) { - if (Main.masterMode && CalamityWorld.revenge && self.type == ModContent.NPCType() && (NPC.AnyNPCs(NPCID.Spazmatism) || NPC.AnyNPCs(NPCID.Retinazer))) + if (CalamityWorld.death && self.type == ModContent.NPCType() && (NPC.AnyNPCs(NPCID.Spazmatism) || NPC.AnyNPCs(NPCID.Retinazer))) { self.value = 0f; self.boss = false; @@ -1911,7 +1911,7 @@ namespace CalamityMod.ILEditing public static void TripletsDefeatTextOverride(On_NPC.orig_DoDeathEvents_CelebrateBossDeath orig, NPC self, string typeName) { bool correctNPCType = self.type == NPCID.Retinazer || self.type == NPCID.Spazmatism || self.type == ModContent.NPCType(); - if (Main.masterMode && CalamityWorld.revenge && correctNPCType) + if (CalamityWorld.death && correctNPCType) { if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue("Announcement.HasBeenDefeated_Plural", CalamityUtils.GetTextValue("Status.Boss.TripletsDefeatName")), 175, 75, 255); diff --git a/ILEditing/VanillaStupidityFixingILChanges.cs b/ILEditing/VanillaStupidityFixingILChanges.cs index 4971102da3..d75d3e67bd 100644 --- a/ILEditing/VanillaStupidityFixingILChanges.cs +++ b/ILEditing/VanillaStupidityFixingILChanges.cs @@ -7,6 +7,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.TreasureBags.MiscGrabBags; using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.NPCs.TownNPCs; using CalamityMod.Walls; using Microsoft.Xna.Framework; using Mono.Cecil.Cil; @@ -14,7 +15,9 @@ using MonoMod.Cil; using Terraria; using Terraria.Audio; using Terraria.DataStructures; +using Terraria.GameContent; using Terraria.GameContent.Drawing; +using Terraria.GameContent.Personalities; using Terraria.ID; using Terraria.ModLoader; @@ -1121,6 +1124,38 @@ namespace CalamityMod.ILEditing } #endregion + #region Multiple NPC Happiness support for Cirrus + private static void AllowMultipleLikedNPCs(On_ShopHelper.orig_ApplyNpcRelationshipEffect orig, ShopHelper self, int npcType, AffectionLevel affectionLevel) + { + FieldInfo npcTalkField = typeof(ShopHelper).GetField("_currentNPCBeingTalkedTo", BindingFlags.Instance | BindingFlags.NonPublic); + NPC talkedNPC = (NPC)npcTalkField.GetValue(self); + + // Allow Cirrus to have things to say about multiple NPCs with the same happiness level + if (talkedNPC.type == ModContent.NPCType()) + { + MethodInfo addReportField = typeof(ShopHelper).GetMethod("AddHappinessReportText", BindingFlags.Instance | BindingFlags.NonPublic); + + FieldInfo happinessField = typeof(ShopHelper).GetField("_currentPriceAdjustment", BindingFlags.Instance | BindingFlags.NonPublic); + float currentPriceAdjustment = (float)happinessField.GetValue(self); + + if (affectionLevel != 0 && Enum.IsDefined(affectionLevel)) + { + // Add a suffix to the localization key which specifies the NPC's name + addReportField.Invoke(self, [ $"{affectionLevel}NPC_" + NPCID.Search.GetName(npcType), new + { + NPCName = NPC.GetFullnameByID(npcType) + }, 0]); + currentPriceAdjustment *= NPCHappiness.AffectionLevelToPriceMultiplier[affectionLevel]; + happinessField.SetValue(self, currentPriceAdjustment); + } + } + else + { + orig(self, npcType, affectionLevel); + } + } + #endregion + // 02JUN2024: Ozzatron: The below code is being kept in its initial state for historic value. #region Store The Stupid Fucking Private Wind Map In Public Property [/*TotallyNot*/Obsolete("This function serves no purpose and is included in the Calamity source code for historic value.", error: true)] diff --git a/Items/Accessories/AncientFossil.cs b/Items/Accessories/AncientFossil.cs index 09447e3273..6293e34145 100644 --- a/Items/Accessories/AncientFossil.cs +++ b/Items/Accessories/AncientFossil.cs @@ -19,6 +19,8 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { player.pickSpeed -= 0.1f; + player.Calamity().aFossil = true; + player.Calamity().fallingBlockProtection = true; } public override void AddRecipes() diff --git a/Items/Accessories/ArchaicPowder.cs b/Items/Accessories/ArchaicPowder.cs index 05610d1dc1..0a6598e7c6 100644 --- a/Items/Accessories/ArchaicPowder.cs +++ b/Items/Accessories/ArchaicPowder.cs @@ -20,20 +20,25 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.pickSpeed -= 0.15f; - if (player.ZoneDirtLayerHeight || player.ZoneRockLayerHeight || player.ZoneUnderworldHeight) - { - player.statDefense += 10; - player.endurance += 0.05f; - } + player.pickSpeed -= 0.3f; + player.Calamity().aPowder = true; + player.Calamity().fallingBlockProtection = true; + player.Calamity().trapProtection = true; + + // Doesn't stack with downgrades + if (player.chiselSpeed) + player.pickSpeed += 0.15f; + if (player.Calamity().aFossil) + player.pickSpeed += 0.1f; } public override void AddRecipes() { CreateRecipe(). AddIngredient(). + AddIngredient(ItemID.AncientChisel). AddIngredient(3). - AddIngredient(15). + AddIngredient(10). AddIngredient(ItemID.Bone, 15). AddTile(TileID.Anvils). Register(); diff --git a/Items/Accessories/AscendantInsignia.cs b/Items/Accessories/AscendantInsignia.cs index e13bb27c68..307cc2620b 100644 --- a/Items/Accessories/AscendantInsignia.cs +++ b/Items/Accessories/AscendantInsignia.cs @@ -30,6 +30,8 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.ascendantInsignia = true; player.empressBrooch = true; + player.moveSpeed += 0.05f; + player.jumpSpeedBoost += 0.25f; } public override void AddRecipes() diff --git a/Items/Accessories/DeadshotBrooch.cs b/Items/Accessories/DeadshotBrooch.cs index 1e1ec3c3ad..d017624cdf 100644 --- a/Items/Accessories/DeadshotBrooch.cs +++ b/Items/Accessories/DeadshotBrooch.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using System.Collections.Generic; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -22,10 +23,12 @@ namespace CalamityMod.Items.Accessories { player.Calamity().deadshotBrooch = true; player.Calamity().rangedAmmoCost *= 0.8f; - player.GetDamage() += 0.1f; - player.GetCritChance() += 5; + player.GetDamage() += 0.12f; + player.GetCritChance() += 7; } + public override void ModifyTooltips(List tooltips) => tooltips.IntegrateHotkey(CalamityKeybinds.AmmoCycleHotkey); + public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Accessories/GladiatorsLocket.cs b/Items/Accessories/GladiatorsLocket.cs index 4e1d606e02..c7b583cea5 100644 --- a/Items/Accessories/GladiatorsLocket.cs +++ b/Items/Accessories/GladiatorsLocket.cs @@ -1,4 +1,5 @@ -using CalamityMod.Buffs.Summon; +using System; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; @@ -17,17 +18,15 @@ namespace CalamityMod.Items.Accessories Item.height = 36; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; - Item.defense = 5; Item.accessory = true; } public override void UpdateAccessory(Player player, bool hideVisual) { - float damageIncrease = 0.2f; - float moveSpeedIncrease = 0.2f; + float statPower = (float)Math.Round(0.2f * Utils.GetLerpValue(1, 0.5f, ((float)player.statLife / (float)player.statLifeMax2), true), 2); player.Calamity().gladiatorSword = true; - player.GetDamage() += damageIncrease - (damageIncrease * player.statLife / player.statLifeMax2); - player.moveSpeed += moveSpeedIncrease - (moveSpeedIncrease * player.statLife / player.statLifeMax2); + player.GetDamage() += statPower; + player.moveSpeed += statPower; } } } diff --git a/Items/Accessories/LuxorsGift.cs b/Items/Accessories/LuxorsGift.cs index d2d0a1d680..aeeda7a03d 100644 --- a/Items/Accessories/LuxorsGift.cs +++ b/Items/Accessories/LuxorsGift.cs @@ -50,7 +50,18 @@ namespace CalamityMod.Items.Accessories if (player.ownedProjectileCounts[ProjectileType()] < 1 && !player.dead) { - Projectile lux = Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.Center, Vector2.Zero, ProjectileType(), 0, 0f, player.whoAmI); + Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.Center, Vector2.Zero, ProjectileType(), 0, 0f, player.whoAmI); + } + } + + public override void UpdateVanity(Player player) + { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.luxorsGiftVanity = true; + + if (player.ownedProjectileCounts[ProjectileType()] < 1 && !player.dead) + { + Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.Center, Vector2.Zero, ProjectileType(), 0, 0f, player.whoAmI); } } } diff --git a/Items/Accessories/MarniteRepulsionShield.cs b/Items/Accessories/MarniteRepulsionShield.cs index 8f20c5926b..ca173561dc 100644 --- a/Items/Accessories/MarniteRepulsionShield.cs +++ b/Items/Accessories/MarniteRepulsionShield.cs @@ -92,6 +92,8 @@ namespace CalamityMod.Items.Accessories Projectile.tileCollide = false; Projectile.ArmorPenetration = 20; Projectile.netImportant = true; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Items/Accessories/PlanebreakersPouch.cs b/Items/Accessories/PlanebreakersPouch.cs index 61da35b09b..20902eceda 100644 --- a/Items/Accessories/PlanebreakersPouch.cs +++ b/Items/Accessories/PlanebreakersPouch.cs @@ -1,4 +1,5 @@ -using CalamityMod.CalPlayer; +using System.Collections.Generic; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -31,6 +32,8 @@ namespace CalamityMod.Items.Accessories modPlayer.rangedAmmoCost *= 0.8f; } + public override void ModifyTooltips(List tooltips) => tooltips.IntegrateHotkey(CalamityKeybinds.AmmoCycleHotkey); + public override void AddRecipes() { CreateRecipe(). diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 4df5b0fc6f..49c79cc472 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -10,6 +10,7 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Potions; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.VanillaArmorChanges; +using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.Other; @@ -478,25 +479,6 @@ namespace CalamityMod.Items } } } - if (modPlayer.harpyWingBoost && (modPlayer.harpyRing || modPlayer.angelTreads)) - { - if (Main.rand.NextBool(5) && modPlayer.wingProjectileCooldown == 0 && !item.channel) - { - modPlayer.wingProjectileCooldown = 20; - if (player.whoAmI == Main.myPlayer) - { - float spreadX = velocity.X + Main.rand.NextFloat(-0.75f, 0.75f); - float spreadY = velocity.Y + Main.rand.NextFloat(-0.75f, 0.75f); - int feather = Projectile.NewProjectile(playerSource, position, new Vector2(spreadX, spreadY) * 1.25f, ModContent.ProjectileType(), (int)(damage * 0.3), 2f, player.whoAmI); - if (feather.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[feather].usesLocalNPCImmunity = true; - Main.projectile[feather].localNPCHitCooldown = 10; - Main.projectile[feather].DamageType = DamageClass.Generic; - } - } - } - } return true; } #endregion @@ -564,7 +546,7 @@ namespace CalamityMod.Items #region Pickup Item Changes public override bool OnPickup(Item item, Player player) { - if (item.type == ItemID.Heart || item.type == ItemID.CandyApple || item.type == ItemID.CandyCane) + if (item.type == ItemID.Heart || item.type == ItemID.CandyApple || item.type == ItemID.CandyCane) // On heart pickup { bool boostedHeart = player.Calamity().photosynthesis; if (boostedHeart) @@ -572,6 +554,11 @@ namespace CalamityMod.Items player.HealPlayer(PhotosynthesisPotion.IncreasedHeartHeal); } } + if (item.type == ItemID.Star || item.type == ItemID.SoulCake || item.type == ItemID.SugarPlum) // On star pickup + { + if (player.ActiveItem().type == ModContent.ItemType() || player.ActiveItem().type == ModContent.ItemType()) + return false; + } return true; } #endregion @@ -1290,7 +1277,7 @@ namespace CalamityMod.Items if (item.type == ItemID.MoonStone) { - if (!Main.dayTime) + if (!Main.dayTime || Main.eclipse) player.GetAttackSpeed() -= 0.1f; } @@ -1331,7 +1318,6 @@ namespace CalamityMod.Items } else if (item.type == ItemID.HarpyWings) { - modPlayer.harpyWingBoost = true; player.moveSpeed += 0.1f; player.noFallDmg = true; } @@ -1573,7 +1559,7 @@ namespace CalamityMod.Items // Draw all particles. float currentPower = 0f; - int calamitasNPCIndex = NPC.FindFirstNPC(ModContent.NPCType()); + int calamitasNPCIndex = NPC.FindFirstNPC(ModContent.NPCType()); if (calamitasNPCIndex != -1) currentPower = Utils.GetLerpValue(11750f, 1000f, Main.LocalPlayer.Distance(Main.npc[calamitasNPCIndex].Center), true); @@ -1637,7 +1623,7 @@ namespace CalamityMod.Items { storedPrefix = -1; // Bandit steals 20% of the total price of the reforge if she's around. - if (NPC.AnyNPCs(ModContent.NPCType())) + if (NPC.AnyNPCs(ModContent.NPCType())) { // Calculate the item's reforge cost. int value = item.value; diff --git a/Items/DraedonMisc/EncryptedSchematicHell.cs b/Items/DraedonMisc/EncryptedSchematicHell.cs index 73fc317a35..69f3014040 100644 --- a/Items/DraedonMisc/EncryptedSchematicHell.cs +++ b/Items/DraedonMisc/EncryptedSchematicHell.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.DraedonMisc meleeDisplay.OverrideColor = new Color(201, 41, 255); list.Insert(insertIndex + 1, meleeDisplay); - int rangedItem = ModContent.ItemType(); + int rangedItem = ModContent.ItemType(); TooltipLine rangedDisplay = new TooltipLine(this.Mod, "CalamityMod:RangedDisplay", $"[i:{rangedItem}] {CalamityUtils.GetItemName(rangedItem)}"); rangedDisplay.OverrideColor = new Color(255, 64, 31); list.Insert(insertIndex + 2, rangedDisplay); diff --git a/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs b/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs index d0389e89e5..bc6eed8da8 100644 --- a/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs +++ b/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Items.DraedonMisc meleeDisplay.OverrideColor = new Color(31, 242, 245); list.Insert(insertIndex + 1, meleeDisplay); - int rangedItem = ModContent.ItemType(); + int rangedItem = ModContent.ItemType(); TooltipLine rangedDisplay = new TooltipLine(this.Mod, "CalamityMod:RangedDisplay", $"[i:{rangedItem}] {CalamityUtils.GetItemName(rangedItem)}"); rangedDisplay.OverrideColor = new Color(149, 243, 43); list.Insert(insertIndex + 2, rangedDisplay); diff --git a/Items/Fishing/SulphurCatches/HydrothermalCrate.cs b/Items/Fishing/SulphurCatches/HydrothermalCrate.cs index d14e2f292c..8aa67f0bd6 100644 --- a/Items/Fishing/SulphurCatches/HydrothermalCrate.cs +++ b/Items/Fishing/SulphurCatches/HydrothermalCrate.cs @@ -58,8 +58,8 @@ namespace CalamityMod.Items.Fishing.SulphurCatches ModContent.ItemType() )); - // Pre-HM Abyss Weapons - itemLoot.Add(new OneFromOptionsDropRule(10, 1, + // Ancient Treasure Chest Loot @ 100%; Individually 10% + itemLoot.Add(new OneFromOptionsNotScaledWithLuckDropRule(1, 1, ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), diff --git a/Items/Mounts/AlicornMount.cs b/Items/Mounts/AlicornMount.cs index 7b0199c8d5..195d4ab52a 100644 --- a/Items/Mounts/AlicornMount.cs +++ b/Items/Mounts/AlicornMount.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Items.Mounts { foreach (NPC npc in Main.ActiveNPCs) { - if (npc.type == ModContent.NPCType()) + if (npc.type == ModContent.NPCType()) { npc.active = false; npc.netUpdate = true; @@ -100,10 +100,10 @@ namespace CalamityMod.Items.Mounts // Spawn Cirrus if no other players are on the Alicorn mount. if (!anyPlayerOnFabMount) { - if (!NPC.AnyNPCs(ModContent.NPCType())) + if (!NPC.AnyNPCs(ModContent.NPCType())) { if (Main.netMode != NetmodeID.MultiplayerClient) - NPC.NewNPC(NPC.GetSource_TownSpawn(), (int)player.Center.X, (int)player.Center.Y, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_TownSpawn(), (int)player.Center.X, (int)player.Center.Y, ModContent.NPCType()); } } } diff --git a/Items/Weapons/DraedonsArsenal/GaussRifle.cs b/Items/Weapons/DraedonsArsenal/GaussRifle.cs index ea4fe97f92..5988a7d135 100644 --- a/Items/Weapons/DraedonsArsenal/GaussRifle.cs +++ b/Items/Weapons/DraedonsArsenal/GaussRifle.cs @@ -5,6 +5,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Sounds; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; using Terraria.DataStructures; @@ -22,34 +23,62 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { CalamityGlobalItem modItem = Item.Calamity(); - Item.width = 112; - Item.height = 36; + Item.width = 70; + Item.height = 30; Item.DamageType = DamageClass.Ranged; - Item.damage = 150; - Item.knockBack = 30f; - Item.useAnimation = Item.useTime = 32; + Item.damage = 100; + Item.knockBack = 0.2f; + Item.useTime = Item.useAnimation = 10; Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = CommonCalamitySounds.GaussWeaponFire; + Item.UseSound = new SoundStyle("CalamityMod/Sounds/Item/GaussFire") with { Volume = 0.7f, Pitch = Main.rand.NextFloat(0.5f, 0.65f) }; Item.noMelee = true; Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 27f; + Item.shootSpeed = 7f; modItem.UsesCharge = true; modItem.MaxCharge = 135f; - modItem.ChargePerUse = 0.1125f; + modItem.ChargePerUse = 0.0225f; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, position + velocity * 6, velocity.RotatedByRandom(0.03f), ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/GaussRifleGlow").Value); + } + public override void UseStyle(Player player, Rectangle heldItemFrame) + { + player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X)); + float itemRotation = player.compositeFrontArm.rotation + MathHelper.PiOver2 * player.gravDir; + + Vector2 itemPosition = player.MountedCenter + itemRotation.ToRotationVector2() * 7f; + Vector2 itemSize = new Vector2(70, 30); + Vector2 itemOrigin = new Vector2(-18, 6); + + CalamityUtils.CleanHoldStyle(player, itemRotation, itemPosition, itemSize, itemOrigin); + + base.UseStyle(player, heldItemFrame); + } + public override void UseItemFrame(Player player) + { + player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X)); + + float animProgress = 0.5f - player.itemTime / (float)player.itemTimeMax; + float rotation = (player.Center - player.Calamity().mouseWorld).ToRotation() * player.gravDir + MathHelper.PiOver2; + if (animProgress < 0.4f) + rotation += -0.025f * (float)Math.Pow((0.6f - animProgress) / 0.6f, 2) * player.direction; + + player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, rotation); + } public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 3); diff --git a/Items/Weapons/DraedonsArsenal/GaussRifle.png b/Items/Weapons/DraedonsArsenal/GaussRifle.png index f1e885da7d..ac001b522d 100644 Binary files a/Items/Weapons/DraedonsArsenal/GaussRifle.png and b/Items/Weapons/DraedonsArsenal/GaussRifle.png differ diff --git a/Items/Weapons/DraedonsArsenal/GaussRifleGlow.png b/Items/Weapons/DraedonsArsenal/GaussRifleGlow.png new file mode 100644 index 0000000000..89cc2dc642 Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/GaussRifleGlow.png differ diff --git a/Items/Weapons/DraedonsArsenal/HeavyLaserRifle.png b/Items/Weapons/DraedonsArsenal/HeavyLaserRifle.png deleted file mode 100644 index 9f3f3750da..0000000000 Binary files a/Items/Weapons/DraedonsArsenal/HeavyLaserRifle.png and /dev/null differ diff --git a/Items/Weapons/DraedonsArsenal/MatterModulator.cs b/Items/Weapons/DraedonsArsenal/HolofiberImmolator.cs similarity index 50% rename from Items/Weapons/DraedonsArsenal/MatterModulator.cs rename to Items/Weapons/DraedonsArsenal/HolofiberImmolator.cs index 004fcf0338..ab7226c2e3 100644 --- a/Items/Weapons/DraedonsArsenal/MatterModulator.cs +++ b/Items/Weapons/DraedonsArsenal/HolofiberImmolator.cs @@ -3,51 +3,62 @@ using System.Collections.Generic; using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; -using CalamityMod.Sounds; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.DraedonsArsenal { - public class MatterModulator : ModItem, ILocalizedModType + [LegacyName("MatterModulator")] + public class HolofiberImmolator : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; + public static readonly SoundStyle PlasmaSound = new("CalamityMod/Sounds/Item/PlasmaSmall"); public override void SetDefaults() { CalamityGlobalItem modItem = Item.Calamity(); - Item.width = 40; - Item.height = 22; + Item.width = 30; + Item.height = 62; Item.DamageType = DamageClass.Ranged; - Item.damage = 100; - Item.knockBack = 11f; - Item.useAnimation = Item.useTime = 33; + Item.damage = 57; + Item.knockBack = 0.8f; + Item.useTime = Item.useAnimation = 14; Item.autoReuse = true; + Item.noUseGraphic = true; + Item.channel = true; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = CommonCalamitySounds.PlasmaBoltSound; + Item.UseSound = null; Item.noMelee = true; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 12f; + //Item.useAmmo = AmmoID.Arrow; modItem.UsesCharge = true; modItem.MaxCharge = 85f; - modItem.ChargePerUse = 0.075f; + modItem.ChargePerUse = 0.001f; // Charge depletion is done in the holdout, but it needs a small fee to prevent usage at 0% } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + public override bool CanConsumeAmmo(Item ammo, Player player) => false; + public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true; + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/HolofiberImmolatorGlow").Value); + } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - for (int i = 0; i < Main.rand.Next(3, 5 + 1); i++) - { - Projectile.NewProjectile(source, position, velocity.RotatedByRandom(0.4f) * Main.rand.NextFloat(0.8f, 1.3f), type, damage, knockback, player.whoAmI); - } + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 1); + holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); return false; } diff --git a/Items/Weapons/DraedonsArsenal/HolofiberImmolator.png b/Items/Weapons/DraedonsArsenal/HolofiberImmolator.png new file mode 100644 index 0000000000..cda04308bb Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/HolofiberImmolator.png differ diff --git a/Items/Weapons/DraedonsArsenal/HolofiberImmolatorGlow.png b/Items/Weapons/DraedonsArsenal/HolofiberImmolatorGlow.png new file mode 100644 index 0000000000..b0ce820d9a Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/HolofiberImmolatorGlow.png differ diff --git a/Items/Weapons/DraedonsArsenal/MatterModulator.png b/Items/Weapons/DraedonsArsenal/MatterModulator.png deleted file mode 100644 index 7bdc4d548a..0000000000 Binary files a/Items/Weapons/DraedonsArsenal/MatterModulator.png and /dev/null differ diff --git a/Items/Weapons/DraedonsArsenal/PulsePistol.cs b/Items/Weapons/DraedonsArsenal/PulsePistol.cs index 53f707848b..c75c22416d 100644 --- a/Items/Weapons/DraedonsArsenal/PulsePistol.cs +++ b/Items/Weapons/DraedonsArsenal/PulsePistol.cs @@ -6,6 +6,7 @@ using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -18,31 +19,65 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { CalamityGlobalItem modItem = Item.Calamity(); - Item.width = 62; - Item.height = 22; - Item.damage = 22; + Item.width = 54; + Item.height = 38; Item.DamageType = DamageClass.Magic; - Item.mana = 6; - Item.useAnimation = Item.useTime = 23; - Item.knockBack = 0.25f; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 5.2f; // This may seem low but the shot has 10 extra updates. - - Item.UseSound = PulseRifle.FireSound; - Item.useStyle = ItemUseStyleID.Shoot; + Item.damage = 70; + Item.knockBack = 3f; + Item.useTime = Item.useAnimation = 44; Item.autoReuse = true; + Item.mana = 3; + + Item.useStyle = ItemUseStyleID.Shoot; + Item.UseSound = PulseRifle.FireSound with { Pitch = 0.3f, Volume = 0.7f }; Item.noMelee = true; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 8.2f; + modItem.UsesCharge = true; modItem.MaxCharge = 50f; - modItem.ChargePerUse = 0.05f; + modItem.ChargePerUse = 0.01f; } - public override Vector2? HoldoutOffset() => new Vector2(10f, 0f); + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + Projectile.NewProjectile(source, position + velocity * 4, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 3f); + return false; + } + public override void UseStyle(Player player, Rectangle heldItemFrame) + { + player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X)); + float itemRotation = player.compositeFrontArm.rotation + MathHelper.PiOver2 * player.gravDir; + float pullback = 7f; + + float animProgress = 0.5f - player.itemTime / (float)player.itemTimeMax; + float rotation = (player.Center - player.Calamity().mouseWorld).ToRotation() * player.gravDir + MathHelper.PiOver2; + if (animProgress < 0.4f) + pullback -= (2.75f) * (float)Math.Pow((0.6f - animProgress) / 0.6f, 2); + + Vector2 itemPosition = player.MountedCenter + itemRotation.ToRotationVector2() * pullback; + Vector2 itemSize = new Vector2(54, 38); + Vector2 itemOrigin = new Vector2(-24, 4); + + CalamityUtils.CleanHoldStyle(player, itemRotation, itemPosition, itemSize, itemOrigin); + + base.UseStyle(player, heldItemFrame); + } + + public override void UseItemFrame(Player player) + { + player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X)); + + float animProgress = 0.5f - player.itemTime / (float)player.itemTimeMax; + float rotation = (player.Center - player.Calamity().mouseWorld).ToRotation() * player.gravDir + MathHelper.PiOver2; + + player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, rotation); + } public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 1); public override void AddRecipes() diff --git a/Items/Weapons/DraedonsArsenal/PulsePistol.png b/Items/Weapons/DraedonsArsenal/PulsePistol.png index f5ae99fd92..20ff87d7f8 100644 Binary files a/Items/Weapons/DraedonsArsenal/PulsePistol.png and b/Items/Weapons/DraedonsArsenal/PulsePistol.png differ diff --git a/Items/Weapons/DraedonsArsenal/HeavyLaserRifle.cs b/Items/Weapons/DraedonsArsenal/ScattershotSkewer.cs similarity index 57% rename from Items/Weapons/DraedonsArsenal/HeavyLaserRifle.cs rename to Items/Weapons/DraedonsArsenal/ScattershotSkewer.cs index 01d8c9d04e..33cf49ae5f 100644 --- a/Items/Weapons/DraedonsArsenal/HeavyLaserRifle.cs +++ b/Items/Weapons/DraedonsArsenal/ScattershotSkewer.cs @@ -5,6 +5,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Rarities; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; using Terraria.DataStructures; @@ -13,63 +14,54 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.DraedonsArsenal { - [LegacyName("LaserRifle")] - public class HeavyLaserRifle : ModItem, ILocalizedModType + [LegacyName("HeavyLaserRifle")] + public class ScattershotSkewer : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; - public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/LaserRifleFire"); public override void SetDefaults() { CalamityGlobalItem modItem = Item.Calamity(); - Item.width = 84; - Item.height = 28; + Item.width = 64; + Item.height = 36; Item.DamageType = DamageClass.Ranged; - Item.damage = 210; + Item.damage = 196; Item.knockBack = 4f; - Item.useTime = 25; - Item.useAnimation = 25; + Item.useTime = 45; + Item.useAnimation = 35; Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = FireSound; Item.noMelee = true; + Item.channel = true; + Item.noUseGraphic = true; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 5f; modItem.UsesCharge = true; modItem.MaxCharge = 190f; - modItem.ChargePerUse = 0.125f; + modItem.ChargePerUse = 0.001f; // Charge depletion is done in the holdout, but it needs a small fee to prevent usage at 0% + } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true; + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/ScattershotSkewerGlow").Value); } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (velocity.Length() > 5f) - { - velocity.Normalize(); - velocity *= 5f; - } - for (int i = 0; i < 2; i++) - { - float SpeedX = velocity.X + Main.rand.Next(-1, 2) * 0.05f; - float SpeedY = velocity.Y + Main.rand.Next(-1, 2) * 0.05f; - Projectile.NewProjectile(source, position, new Vector2(SpeedX, SpeedY), ModContent.ProjectileType(), damage, knockback, player.whoAmI, i, 0f); - } + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 1); + holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); return false; } public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 4); - public override Vector2? HoldoutOffset() - { - return new Vector2(-20, 0); - } - public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/DraedonsArsenal/ScattershotSkewer.png b/Items/Weapons/DraedonsArsenal/ScattershotSkewer.png new file mode 100644 index 0000000000..bd3c28d67f Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/ScattershotSkewer.png differ diff --git a/Items/Weapons/DraedonsArsenal/ScattershotSkewerGlow.png b/Items/Weapons/DraedonsArsenal/ScattershotSkewerGlow.png new file mode 100644 index 0000000000..dc1111d379 Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/ScattershotSkewerGlow.png differ diff --git a/Items/Weapons/DraedonsArsenal/Taser.cs b/Items/Weapons/DraedonsArsenal/Taser.cs index af84e0175b..f736f38e1e 100644 --- a/Items/Weapons/DraedonsArsenal/Taser.cs +++ b/Items/Weapons/DraedonsArsenal/Taser.cs @@ -5,7 +5,9 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Sounds; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -14,27 +16,30 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public class Taser : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; + public static readonly SoundStyle Fire = new("CalamityMod/Sounds/Item/TaserLaunch") { Volume = 0.6f }; public override void SetDefaults() { CalamityGlobalItem modItem = Item.Calamity(); - Item.width = 50; - Item.height = 26; - Item.damage = 16; + Item.width = 42; + Item.height = 24; Item.DamageType = DamageClass.Ranged; - Item.useAnimation = Item.useTime = 28; - Item.knockBack = 0.25f; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 25f; - - Item.UseSound = CommonCalamitySounds.PlasmaBoltSound; - Item.useStyle = ItemUseStyleID.Shoot; + Item.damage = 20; + Item.knockBack = 0f; + Item.useTime = Item.useAnimation = 28; Item.autoReuse = true; + Item.reuseDelay = 15; + + Item.useStyle = ItemUseStyleID.Shoot; + Item.UseSound = Fire; Item.noMelee = true; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 6f; + modItem.UsesCharge = true; modItem.MaxCharge = 50f; modItem.ChargePerUse = 0.05f; @@ -42,8 +47,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + public override Vector2? HoldoutOffset() => new Vector2(5f, 0f); public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 1); - public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/DraedonsArsenal/Taser.png b/Items/Weapons/DraedonsArsenal/Taser.png index 16aeb51518..d493b95d2e 100644 Binary files a/Items/Weapons/DraedonsArsenal/Taser.png and b/Items/Weapons/DraedonsArsenal/Taser.png differ diff --git a/Items/Weapons/DraedonsArsenal/TrackingDisk.cs b/Items/Weapons/DraedonsArsenal/TrackingDisk.cs index 8853f072ea..857568aad3 100644 --- a/Items/Weapons/DraedonsArsenal/TrackingDisk.cs +++ b/Items/Weapons/DraedonsArsenal/TrackingDisk.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { CalamityGlobalItem modItem = Item.Calamity(); - Item.width = 30; - Item.height = 34; + Item.width = 58; + Item.height = 48; Item.damage = 16; Item.DamageType = RogueDamageClass.Instance; Item.useTime = 40; @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal modItem.UsesCharge = true; modItem.MaxCharge = 50f; - modItem.ChargePerUse = 0.07f; + modItem.ChargePerUse = 0.05f; } 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/DraedonsArsenal/TrackingDisk.png b/Items/Weapons/DraedonsArsenal/TrackingDisk.png index 4ddea6ac7d..f56766fafb 100644 Binary files a/Items/Weapons/DraedonsArsenal/TrackingDisk.png and b/Items/Weapons/DraedonsArsenal/TrackingDisk.png differ diff --git a/Items/Weapons/Magic/AethersWhisper.cs b/Items/Weapons/Magic/AethersWhisper.cs index f240be95f0..ebb944edd7 100644 --- a/Items/Weapons/Magic/AethersWhisper.cs +++ b/Items/Weapons/Magic/AethersWhisper.cs @@ -39,7 +39,6 @@ namespace CalamityMod.Items.Weapons.Magic { CreateRecipe(). AddIngredient(). - AddIngredient(). AddIngredient(3). AddTile(TileID.LunarCraftingStation). Register(); diff --git a/Items/Weapons/Magic/ApoctosisArray.cs b/Items/Weapons/Magic/ApoctosisArray.cs index b641a22307..079f04f32a 100644 --- a/Items/Weapons/Magic/ApoctosisArray.cs +++ b/Items/Weapons/Magic/ApoctosisArray.cs @@ -1,5 +1,6 @@ using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -14,53 +15,49 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 130; Item.height = 58; - Item.damage = 99; + Item.damage = 69; Item.DamageType = DamageClass.Magic; - Item.mana = 12; - Item.useAnimation = 7; - Item.useTime = 7; + Item.mana = 7; + Item.useAnimation = 5; + Item.useTime = 5; Item.useStyle = ItemUseStyleID.Shoot; - Item.knockBack = 6.75f; - Item.UseSound = SoundID.Item91; + Item.knockBack = 6f; Item.autoReuse = true; Item.noMelee = true; - Item.value = CalamityGlobalItem.RarityPurpleBuyPrice; - Item.rare = ItemRarityID.Purple; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 8f; + Item.channel = true; + Item.noUseGraphic = true; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 3f; + + Item.value = CalamityGlobalItem.RarityRedBuyPrice; + Item.rare = ItemRarityID.Red; } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] == 0; - public override Vector2? HoldoutOffset() => new Vector2(-25, 0); - - public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) + // Makes the rotation of the mouse around the player sync in multiplayer. + public override void HoldItem(Player player) => player.Calamity().mouseRotationListener = true; + public override bool AltFunctionUse(Player player) => true; + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - float manaRatio = (float)player.statMana / player.statManaMax2; - bool injectionNerf = player.Calamity().astralInjection; - if (injectionNerf) - manaRatio = MathHelper.Min(manaRatio, 0.65f); - - // 20% to 160% damage. Astral Injection caps it at 111% damage. - float damageRatio = 0.2f + 1.4f * manaRatio; - damage = (int)(damage * damageRatio); + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/Magic/ApoctosisArrayGlow").Value); } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - float manaRatio = (float)player.statMana / player.statManaMax2; - bool injectionNerf = player.Calamity().astralInjection; - if (injectionNerf) - manaRatio = MathHelper.Min(manaRatio, 0.65f); - - Projectile proj = Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockback, player.whoAmI); - proj.scale = 0.75f + 0.75f * manaRatio; + Projectile holdout; + if (player.Calamity().mouseRight && player.whoAmI == Main.myPlayer && !Main.mapFullscreen && !Main.blockMouse) + { + holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, 5); + } + else + holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, 0); + holdout.velocity = player.Calamity().mouseWorld - player.RotatedRelativePoint(player.MountedCenter); return false; } - public override void AddRecipes() { CreateRecipe(). AddIngredient(). - AddIngredient(ItemID.LunarBar, 5). + AddIngredient(ItemID.FragmentSolar, 6). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Magic/ApoctosisArrayGlow.png b/Items/Weapons/Magic/ApoctosisArrayGlow.png new file mode 100644 index 0000000000..99d6a2db8a Binary files /dev/null and b/Items/Weapons/Magic/ApoctosisArrayGlow.png differ diff --git a/Items/Weapons/Magic/IonBlaster.cs b/Items/Weapons/Magic/IonBlaster.cs index 68f3fa069c..00ed3a7ef7 100644 --- a/Items/Weapons/Magic/IonBlaster.cs +++ b/Items/Weapons/Magic/IonBlaster.cs @@ -1,5 +1,6 @@ using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -10,50 +11,50 @@ namespace CalamityMod.Items.Weapons.Magic public class IonBlaster : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; + public override void SetStaticDefaults() + { + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; + } public override void SetDefaults() { Item.width = 68; Item.height = 38; - Item.damage = 29; + Item.damage = 42; Item.DamageType = DamageClass.Magic; - Item.mana = 10; - Item.useAnimation = 10; - Item.useTime = 10; + Item.mana = 8; + Item.useAnimation = 7; + Item.useTime = 7; Item.useStyle = ItemUseStyleID.Shoot; - Item.knockBack = 5.5f; - Item.UseSound = SoundID.Item91; + Item.knockBack = 6f; Item.autoReuse = true; Item.noMelee = true; - Item.shoot = ModContent.ProjectileType(); + Item.channel = true; + Item.noUseGraphic = true; + Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 3f; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] == 0; - public override Vector2? HoldoutOffset() => new Vector2(-5, 0); - - public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) + // Makes the rotation of the mouse around the player sync in multiplayer. + public override void HoldItem(Player player) => player.Calamity().mouseRotationListener = true; + public override bool AltFunctionUse(Player player) => true; + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - float manaRatio = (float)player.statMana / player.statManaMax2; - bool injectionNerf = player.Calamity().astralInjection; - if (injectionNerf) - manaRatio = MathHelper.Min(manaRatio, 0.65f); - - // 20% to 160% damage. Astral Injection caps it at 111% damage. - float damageRatio = 0.2f + 1.4f * manaRatio; - damage = (int)(damage * damageRatio); + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/Magic/IonBlasterGlow").Value); } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - float manaRatio = (float)player.statMana / player.statManaMax2; - bool injectionNerf = player.Calamity().astralInjection; - if (injectionNerf) - manaRatio = MathHelper.Min(manaRatio, 0.65f); - - Projectile proj = Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockback, player.whoAmI); - proj.scale = 0.75f + 0.75f * manaRatio; + Projectile holdout; + if (player.Calamity().mouseRight && player.whoAmI == Main.myPlayer && !Main.mapFullscreen && !Main.blockMouse) + { + holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, 5); + } + else + holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, 0); + holdout.velocity = player.Calamity().mouseWorld - player.RotatedRelativePoint(player.MountedCenter); return false; } diff --git a/Items/Weapons/Magic/IonBlasterGlow.png b/Items/Weapons/Magic/IonBlasterGlow.png new file mode 100644 index 0000000000..80a35987da Binary files /dev/null and b/Items/Weapons/Magic/IonBlasterGlow.png differ diff --git a/Items/Weapons/Magic/Lazhar.cs b/Items/Weapons/Magic/Lazhar.cs deleted file mode 100644 index 152ffbb9a2..0000000000 --- a/Items/Weapons/Magic/Lazhar.cs +++ /dev/null @@ -1,50 +0,0 @@ -using CalamityMod.Projectiles.Magic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Magic -{ - public class Lazhar : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Weapons.Magic"; - public override void SetDefaults() - { - Item.width = 42; - Item.height = 20; - Item.damage = 76; - Item.DamageType = DamageClass.Magic; - Item.mana = 4; - Item.useTime = 7; - Item.useAnimation = 7; - Item.useStyle = ItemUseStyleID.Shoot; - Item.noMelee = true; - Item.knockBack = 5f; - Item.value = CalamityGlobalItem.RarityRedBuyPrice; - Item.rare = ItemRarityID.Red; - Item.UseSound = SoundID.Item12; - Item.autoReuse = true; - Item.shootSpeed = 15f; - Item.shoot = ModContent.ProjectileType(); - } - - public override Vector2? HoldoutOffset() => new Vector2(-5, 0); - - public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) - { - velocity.X += (float)Main.rand.Next(-15, 16) * 0.05f; - velocity.Y += (float)Main.rand.Next(-15, 16) * 0.05f; - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.SpaceGun). - AddIngredient(ItemID.HeatRay). - AddIngredient(ItemID.FragmentSolar, 6). - AddTile(TileID.LunarCraftingStation). - Register(); - } - } -} diff --git a/Items/Weapons/Magic/Lazhar.png b/Items/Weapons/Magic/Lazhar.png deleted file mode 100644 index d250d2920e..0000000000 Binary files a/Items/Weapons/Magic/Lazhar.png and /dev/null differ diff --git a/Items/Weapons/Ranged/NullificationPistol.cs b/Items/Weapons/Ranged/NullificationPistol.cs index c5bd838ea6..f196a583e4 100644 --- a/Items/Weapons/Ranged/NullificationPistol.cs +++ b/Items/Weapons/Ranged/NullificationPistol.cs @@ -26,10 +26,10 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 52; Item.height = 28; - Item.damage = 180; + Item.damage = 190; Item.DamageType = DamageClass.Ranged; - Item.useTime = 20; - Item.useAnimation = 20; + Item.useTime = 18; + Item.useAnimation = 18; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 0.1f; diff --git a/Items/Weapons/Rogue/CrystalPiercer.cs b/Items/Weapons/Rogue/CrystalPiercer.cs index f7b115b4da..3a54076ed3 100644 --- a/Items/Weapons/Rogue/CrystalPiercer.cs +++ b/Items/Weapons/Rogue/CrystalPiercer.cs @@ -39,7 +39,9 @@ namespace CalamityMod.Items.Weapons.Rogue Main.projectile[stealth].Calamity().stealthStrike = true; Main.projectile[stealth].aiStyle = -1; Main.projectile[stealth].tileCollide = false; + Main.projectile[stealth].usesIDStaticNPCImmunity = false; Main.projectile[stealth].usesLocalNPCImmunity = true; + Main.projectile[stealth].localNPCHitCooldown = 10; } return false; } diff --git a/Items/Weapons/Rogue/RotBall.cs b/Items/Weapons/Rogue/RotBall.cs index 89cf7dcd29..374b63d451 100644 --- a/Items/Weapons/Rogue/RotBall.cs +++ b/Items/Weapons/Rogue/RotBall.cs @@ -41,7 +41,6 @@ namespace CalamityMod.Items.Weapons.Rogue if (stealth.WithinBounds(Main.maxProjectiles)) { Main.projectile[stealth].Calamity().stealthStrike = true; - Main.projectile[stealth].usesLocalNPCImmunity = true; } return false; } diff --git a/Items/Weapons/Rogue/ToothBall.cs b/Items/Weapons/Rogue/ToothBall.cs index 2799f984b0..686a7719a8 100644 --- a/Items/Weapons/Rogue/ToothBall.cs +++ b/Items/Weapons/Rogue/ToothBall.cs @@ -41,7 +41,6 @@ namespace CalamityMod.Items.Weapons.Rogue if (stealth.WithinBounds(Main.maxProjectiles)) { Main.projectile[stealth].Calamity().stealthStrike = true; - Main.projectile[stealth].usesLocalNPCImmunity = true; } return false; } diff --git a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson index b86411f793..06606aa88c 100644 --- a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson +++ b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson @@ -71,6 +71,7 @@ AuroraSpirit: Thought to be no more than an old wives' tale, sightings of aurora BloomSlime: Imbued with profaned energy, this slime wishes to see the world reduced to ashes to ensure the suffering it brings is no more. However, the simplicity of their form makes it difficult for the slain goddess to fully impose her will onto them. Bohldohr: Bohldohrs were made to serve the lihzahrds, being crafted from ancient stone and brought to life with magical power in the twilight of the great Lihzahrd Dynasty. But the sun sets on every civilization, and once their deity abandoned them, they were left to fend for themselves. CladCrab: Strong enough to carry an entire mound, these land crustaceans were hard pressed for survival during the Crusade. With no other option, they added rock and stone to their list of protections, allowing them to continue thriving. +CloudElemental: Part of a solitary elemental that rarely appears aside from when her domain is at its strongest. Many attempts were made by what remained of Yharim's forces to hunt down the elementals after Azafure fell. Only now that the war has passed do the weaker elementals dare return. GemCrawler: Relatives to the Ilmeran Sea's prismbacks. The aquatic lizards ended up in the wild after being taken in as pets, though without the proper nutrients to grow prisms on their back, many grew the next best thing– precious gems. BlightSlime: Slimes that have absorbed some of the blighted godly essence. Riddled with impurity, they are now more putrid flesh than gelatin and, having taken in such an amount that they seem ready to burst. Yet unlike most slimes which have relatively basic minds, these seem to be collecting mass with a purpose. Cryon: Archmage Permafrost went through great pains to not take part in combat himself, instead molding cryons to act as his personal guardians. Noticing the spread of godly essence just as many other creatures have, they have come out of stasis to combat any signs of it so that they may defend their master. @@ -93,7 +94,6 @@ ScornEater: For one to be weak of will does not inherently mean they are weak of ShockstormShuttle: Mining devices and scouts for a civilization from a long lost world. They now seek whatever resources are left on other nearby planets, and perhaps even this world as a potential replacement for their ruined home. Shroomble: Mushrooms offer surprisingly effective regenerative agents to human bodies. This is commonly attributed to their abundance of Life, and visibly, "abundance" is often an understatement. Sunskater: To the civilization that lived far above clouds, sunskaters were seen as a good omen. These creatures inspired hope in those who saw them, that their society might live on for as long as the sun's light bathes the world. -ThiccWaifu: Part of a solitary elemental that rarely appears aside from when her domain is at its strongest. Many attempts were made by what remained of Yharim's forces to hunt down the elementals after Azafure fell. Only now that the war has passed do the weaker elementals dare return. WildBumblefuck: Though but an adolescent dragonfolly, it poses a great threat to all around it regardless of its age. Their species survived the draconic purges by reproducing rapidly and becoming highly reclusive, alongside developing a hyper-aggressive nature. WulfrumAmplifier: These amplifiers empower fellow wulfrum machines through a surprisingly advanced tesla field. While the field is harmless to any organic beings that pass through it, wulfrum machines are designed to receive energy from it which allows them to run at peak efficiency. WulfrumDrone: The purpose the wulfrum machines once fulfilled can most clearly be seen through the drones: to harass the basic troopers of Yharim's forces. They were not threatening enough to be a priority target, though their laser attacks could be quite deadly if allowed to fully power up. @@ -137,11 +137,11 @@ Sharkoon: The bulbous Sharkoon wanders the reefs on the outskirts of the Sunken Stormlion: Some Ilmerian survivors claim that enough magical lightning surged through the sea during its final days that there existed not a single drop of water without levin coursing through it. Even now, electricity remains buried in the sands, with several antlion species having learned to channel the former kingdom's power. //Town NPCs AndroombaFriendly: Reverse-engineered Androombas that have been retrofitted to spread the Steampunker's solutions rather than clean dust and debris off of floors. They can be used to purify the world– or ruin it further, if one so desires. -DILF: One of the world's foremost experts on magical theory, he is renowned for his skill with the arcane arts. In his days when he traveled with Yharim's entourage, he acted as the Godseeker's advisor, due to both his status and his distaste for actively participating in battle. -FAP: A princess from an unknown land. She drinks constantly in a vain attempt to escape the memories of her past, but is practically immune to alcohol. She makes a business of selling her mixtures, alcoholic and alchemic alike. -SEAHOE: The seventeenth ruler of the constitutional monarchy of Ilmeris since the tribes of the Ilmeran Sea unified, under the Electric Goddess, Otonilou, and the elusive God of the Seas. Alas, one cannot be a ruler without subjects, and while he remains respected by those who opposed Godseeker Yharim, his kingdom is no more. -THIEF: The bandit may have a bad habit of looting battlefields and taking what isn't theirs, but their actions are mostly motivated by their hatred of the obscenely rich who haven't truly earned the wealth they possess. Their methods are somewhat shady, but can always be relied upon to get a job done. -WITCH: Recruited to Yharim's forces late into the war, her magic overflows with such power that she is largely incapable of casting normal spells. Yet despite her great power, Calamitas prefers not to use it, as it takes a heavy toll on her psyche. +Archmage: One of the world's foremost experts on magical theory, he is renowned for his skill with the arcane arts. In his days when he traveled with Yharim's entourage, he acted as the Godseeker's advisor, due to both his status and his distaste for actively participating in battle. +Bandit: The bandit may have a bad habit of looting battlefields and taking what isn't theirs, but their actions are mostly motivated by their hatred of the obscenely rich who haven't truly earned the wealth they possess. Their methods are somewhat shady, but can always be relied upon to get a job done. +BrimstoneWitch: Recruited to Yharim's forces late into the war, her magic overflows with such power that she is largely incapable of casting normal spells. Yet despite her great power, Calamitas prefers not to use it, as it takes a heavy toll on her psyche. +Cirrus: A princess from an unknown land. She drinks constantly in a vain attempt to escape the memories of her past, but is practically immune to alcohol. She makes a business of selling her mixtures, alcoholic and alchemic alike. +SeaKing: The seventeenth ruler of the constitutional monarchy of Ilmeris since the tribes of the Ilmeran Sea unified, under the Electric Goddess, Otonilou, and the elusive God of the Seas. Alas, one cannot be a ruler without subjects, and while he remains respected by those who opposed Godseeker Yharim, his kingdom is no more. //Boss Minions Brimling: Extensions of the Brimstone Elemental herself, and part of her very being. Both she and her Brimlings are of a single mind, so she naturally cares for them just as she cares for herself. When heavily wounded, they withdraw into a cocoon to protect themselves from further harm. SoulSeeker: The Clone's attempt at wielding the souls of the damned as weapons, these retain slightly more autonomy than their Azafurian brethren. And yet given the striking resemblance the bear to the Clone's shell, it's arguable that they might be further from Calamitas' current soul seekers than those found in Azafure's ruins. diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 5a20b5cf25..b334ce1759 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -116,7 +116,11 @@ AmbrosialAmpoule: { AncientFossil: { DisplayName: Ancient Fossil - Tooltip: Increases mining speed by 10% + Tooltip: + ''' + Increases mining speed by 10% + Provides immunity to damage from falling blocks + ''' } AnechoicPlating: { @@ -202,8 +206,10 @@ ArchaicPowder: { DisplayName: Archaic Powder Tooltip: ''' - Increases mining speed by 15% - 5% increased damage reduction and +10 defense while underground or in the underworld + Increases mining speed by 30% + Provides immunity to damage from falling blocks and dart traps + 65% resistance to all damage from traps + Does not stack with downgrades ''' } @@ -211,7 +217,7 @@ AscendantInsignia: { DisplayName: Ascendant Insignia Tooltip: ''' - Increases wing flight time by 50%, movement and jump speed by 10%, and acceleration by 1.5x + Increases wing flight time by 50%, movement and jump speed by 15%, and acceleration by 1.5x Pressing [KEY] grants you the power of ascension, providing infinite flight time for 4 seconds Ascension has a 40 second cooldown ''' @@ -542,7 +548,12 @@ DarkSunRing: { DeadshotBrooch: { DisplayName: Deadshot Brooch - Tooltip: 10% increased ranged damage, 5% increased ranged critical strike chance and 20% reduced ammo usage + Tooltip: + ''' + 12% increased ranged damage, 7% increased ranged critical strike chance and 20% reduced ammo usage + Pressing [KEY] will automatically swap the order of ammos in your ammo slots + The ammo type swapped depends on the ammo of the weapon you are holding + ''' } DeepDiver: { @@ -850,7 +861,7 @@ GladiatorsLocket: { Tooltip: ''' Enemies drop a healing orb on kill - Gain an increase to your damage and movement speed the lower your health is, up to 20% + Gain an increase to your damage and movement speed the lower your health is, up to 20% at 50% life or below ''' } @@ -1287,7 +1298,8 @@ PlanebreakersPouch: { ''' 15% increased ranged damage, 5% increased ranged critical strike chance and 20% reduced ammo usage Grants a 20% chance to not consume arrows - Greatly increases all ranged projectile velocity + Pressing [KEY] will automatically swap the ammos in your ammo slots + The ammo type swapped depends on the ammo of the weapon you are holding ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson index 248ea0cf93..946cf85832 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson @@ -50,16 +50,25 @@ GaussPistol: { GaussRifle: { DisplayName: Gauss Rifle - Tooltip: Fires a devastating powerful high-velocity blast with absurd knockback -} - -HeavyLaserRifle: { - DisplayName: Heavy Laser Rifle Tooltip: ''' - Fires an incredibly accurate pair of destructive laser beams - [c/1FFBFF:'Though Godseeker Knights are often brutish, not all prefer close quarters melee combat.] - [c/1FFBFF:As such, Yharim personally requested that I create heavy weaponry for them despite being few in number.'] + A magnet powered energy rifle that fires piercing shots, creating magnetic implosions that pull in weak enemies on hit + Implosions only spawn on the first enemy hit by the beam + [c/1FFBFF:'Many soldiers underestimate the destructive capabilities of magnetism.] + [c/1FFBFF:This rifle has reliably pulled in skeptics of its crushing efficiency.'] + ''' +} + +HolofiberImmolator: { + DisplayName: Holofiber Immolator + Tooltip: + ''' + Fires three gravity-affected plasma drops which dissolve through foes + Holding quickly charges the bow, firing a homing plasma arrow + Plasma arrows will detonate after impact, creating stronger explosions if stuck into tiles + Holding will repeatedly fire uncharged shots + [c/1FFBFF:'The elegance of holofibre is unmatched.] + [c/1FFBFF:However, mechanical tension may have produced more consistent results.'] ''' } @@ -74,15 +83,6 @@ HydraulicVoltCrasher: { ''' } -MatterModulator: { - DisplayName: Matter Modulator - Tooltip: - ''' - Fires a burst of unstable matter that pierces infinitely but deals little damage - After striking a tile, the matter will gain enhanced damage and no longer pierce - ''' -} - MountedScanner: { DisplayName: Mounted Scanner Tooltip: Summons a powerful scanner module above your head that fires lasers at nearby enemies @@ -139,7 +139,12 @@ PulseDragon: { PulsePistol: { DisplayName: Pulse Pistol - Tooltip: Fires a pulse that arcs to a new target on enemy hits + Tooltip: + ''' + Fires a pulse orb that tracks nearby targets + After hitting an enemy, the pulse orb will split in two + Pulse orb pierce will not decrease when killing enemies + ''' } PulseRifle: { @@ -164,6 +169,19 @@ PulseTurretRemote: { ''' } +ScattershotSkewer: { + DisplayName: Scattershot Skewer + Tooltip: + ''' + Fires a spread of lasers + Holding charges the weapon, allowing it to thrust forward and impale enemies with an energy spear + Using the charged attack has a short cooldown + Holding will repeatedly fire uncharged shots + [c/1FFBFF:'There was much call from Yharim's forces for close range armaments.] + [c/1FFBFF:A laser lance with which to gore their foes was met with thunderous applause.'] + ''' +} + SnakeEyes: { DisplayName: Snake Eyes Tooltip: @@ -199,8 +217,8 @@ Taser: { DisplayName: Taser Tooltip: ''' - Shoots a hook that attaches to enemies and electrocutes them before returning - A slow, simple electric weapon, meant only for low ranking guards + Shoots a hook that attaches to enemies and rapidly electrocutes them before returning + After electrocuting an enemy enough, the hook will create a large electric burst on it ''' } @@ -228,8 +246,10 @@ TrackingDisk: { Tooltip: ''' Releases a flying disk that fires lasers at nearby enemies - This disk gains acceleration as it returns to the player - Stealth strikes fire lasers at a faster rate and distance, and can fire at multiple different targets + Lasers do not directly damage enemies, but instead apply a stacking laser burn effect + Once hit by enough lasers or sufficient time has passed, laser burn will deal direct damage + The disk gains acceleration as it returns to the player + Stealth strikes fire lasers at a faster rate and distance, can fire at multiple different targets, and lasers deal small amounts of damage ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index fa5537a35f..b6a8a7aef9 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -60,9 +60,11 @@ ApoctosisArray: { DisplayName: Apoctosis Array Tooltip: ''' - Fires ion blasts that speed up and then explode - Damage scales with how full your mana is - Using Astral Injection reduces the effectiveness of the mana boost + Rapidly fires an array of ion blasts with heavy armor penetration that accelerate and explode + Press to charge the blaster, restoring your mana until it reaches max + The more mana you restore, the stronger the arrow is when you release it + Charging for 90% of your max mana or more will reach max power + Holding this weapon disables the pickup of stars ''' } @@ -495,9 +497,11 @@ IonBlaster: { DisplayName: Ion Blaster Tooltip: ''' - Fires ion blasts that speed up and then explode - Damage scales with how full your mana is - Using Astral Injection reduces the effectiveness of the mana boost + Rapidly fires ion blasts with heavy armor penetration that accelerate and explode + Press to charge the blaster, restoring your mana until it reaches max + The more mana you restore, the stronger the burst is when you release it + Charging for 90% of your max mana or more will reach max power + Holding this weapon disables the pickup of stars ''' } @@ -519,11 +523,6 @@ LashesofChaos: { ''' } -Lazhar: { - DisplayName: Lazhar - Tooltip: Fires a highly volatile concentrated solar beam -} - LightGodsBrilliance: { DisplayName: Light God's Brilliance Tooltip: Casts small, homing light beads along with explosive light balls diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 3436e9adff..f221281fd1 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -749,7 +749,7 @@ Hellkite: { An ancient blade created during the Draconic Era by Azafure's finest forgemaster Swings a slow and heavy blade with powerful knockback Holding will begin charging a strengthened swing - Releasing while fully charged will unleash a devastating slash + Releasing while fully charged will unleash a devastating slash that always critically strikes [c/E1B65F:'Feel the strength of a blade forged through passion'] ''' TooltipGFB: @@ -757,7 +757,7 @@ Hellkite: { An ancient blade created during the Draconic Era by Azafure's finest forgemaster Swings a slow and heavy blade with powerful knockback Holding will begin charging a strengthened swing - Releasing while fully charged will unleash a devastating slash + Releasing while fully charged will unleash a devastating slash that always critically strikes [c/0C507F:'My beloved <3' -Xyk] ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index e4025b826b..d312f52466 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -467,9 +467,8 @@ FetidEmesis: { ''' Fires an accelerating stream of bullets until the barrel overheats When the barrel overheats, a spread of fetid chunks is vomited out - Holding while firing will hold in the chunks - If held in for long enough, more chunks will be fired - After firing, the gun must cool back down before it can be used again +After firing, the gun must cool back down before it can be used again + Pressing while firing will instantly launch the chunks 75% 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 ddacc2c83d..fa60f07171 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -1392,6 +1392,7 @@ Whitewater: { Flasks that hit enemies while glowing release four water spears that converge back on the flask's position If the flask hits an enemy or gets too far, it will return to the owner Stealth strikes create eight water spears and summon a swirling whitewater vortex that heals players and knocks back enemies + Allies that enter the vortex will heal for twice as long ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Keybinds.hjson b/Localization/en-US/Mods.CalamityMod.Keybinds.hjson index 193563e512..8f12f250f0 100644 --- a/Localization/en-US/Mods.CalamityMod.Keybinds.hjson +++ b/Localization/en-US/Mods.CalamityMod.Keybinds.hjson @@ -1,5 +1,6 @@ ActivateAccessoryParry.DisplayName: Activate Accessory Parry AdrenalineMode.DisplayName: Adrenaline Mode +AmmoCycle.DisplayName: Ammo Cycle Hotkey AngelicAllianceBlessing.DisplayName: Angelic Alliance Blessing ArmorSetBonus.DisplayName: Armor Set Bonus AscendantInsigniaHotKey.DisplayName: Ascendant Insignia Flight @@ -7,9 +8,8 @@ BoosterDash.DisplayName: Booster Dash DashDoubleTapOverride.DisplayName: Dash Double Tap Override ExoChairSlowDown.DisplayName: Exo Chair Slow Down GodSlayerDash.DisplayName: God Slayer Dash -GravistarSabatonHotkey.DisplayName: Gravistar Sabaton Slam +GravistarSabatonHotkey.DisplayName: Interstellar Stompers Slam NormalityRelocator.DisplayName: Normality Relocator RageMode.DisplayName: Rage Mode -SandCloakEffect.DisplayName: Sand Cloak Effect SpectralVeilTeleport.DisplayName: Spectral Veil Teleport TransformerHotKey.DisplayName: Transformer Hot Key diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index e12ca32fb9..9083290ac3 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -152,6 +152,7 @@ BloomSlime.DisplayName: Bloom Slime Bohldohr.DisplayName: Bohldohr BucketZombie.DisplayName: "{$NPCName.Zombie}" CladCrab.DisplayName: Clad Crab +CloudElemental.DisplayName: Cloud Elemental Cnidrion.DisplayName: Cnidrion CrawlerAmber.DisplayName: Amber Crawler CrawlerAmethyst.DisplayName: Amethyst Crawler @@ -192,7 +193,6 @@ SkeletronPrime2.DisplayName: Skeletron Prime Stormlion.DisplayName: Stormlion Sunskater.DisplayName: Sunskater SuperDummyNPC.DisplayName: Super Dummy -ThiccWaifu.DisplayName: Cloud Elemental WildBumblefuck.DisplayName: Draconic Swarmer WulfrumAmplifier.DisplayName: Wulfrum Amplifier WulfrumDrone.DisplayName: Wulfrum Drone @@ -302,7 +302,7 @@ YharonPhase2: Yharon, Resplendent Phoenix // Town NPCs, Pets, etc AndroombaFriendly.DisplayName: Androomba Pal -DILF: { +Archmage: { DisplayName: Archmage Census.SpawnCondition: Defeat Cryogen Name.Permafrost: Permafrost @@ -341,13 +341,137 @@ DILF: { } } -FAP: { +Bandit: { + DisplayName: Bandit + Census.SpawnCondition: Have a {$ItemName.PlatinumCoin} [i:PlatinumCoin] in your inventory after defeating Skeletron + + Name: { + Laura: Laura + Mie: Mie + Bonnie: Bonnie + Sarah: Sarah + Diane: Diane + Kate: Kate + Penelope: Penelope + Marisa: Marisa + Maribel: Maribel + Valerie: Valerie + Jessica: Jessica + Rowan: Rowan + Jessie: Jessie + Jade: Jade + Hearn: Hearn + Amber: Amber + Anne: Anne + Indiana: Indiana + } + + Chat: { + BloodMoon1: Oy, watch where you're going or I might just use you for dart practice. + BloodMoon2: Bet you'd look good as a pincushion, amiright? + BloodMoon3: Zombies don't dodge very well. Maybe you'll do a bit better. + BloodMoon4: Hey, careful over there. I've rigged the place. One wrong step and you're going to get a knife in your forehead. + Normal1: Anything is a weapon if you throw it hard enough. + Normal2: That's your chucking arm? You need to work out more. + Normal3: Listen here. It's all in the wrist, the wrist! Oh, forget it. + Normal4: Eh you know how it goes; steal from the rich, give to the poor, but I do take a cut of the profit. + Normal5: Snakes! Why does it always have to be snakes! + Normal6: It's super nice you know, to just have everything you want. Some people never got that luxury. + Normal7: It's not stealing! I'm just borrowing it until I die! + Night1: Hm, the stars are too bright tonight. Makes sneaking around a little more difficult. + Night2: You think those stars that fall occasionally would make good throwing weapons? + BrimstoneWitch: Hey, hey, has {0} seriously moved in here with us? Why??? + DrunkPrincess: I learned never to steal {0}'s drinks. She doesn't appreciate me right now, so I'll go back to hiding. + Merchant: Don't tell {0}, but I took some of his stuff and replaced it with Angel Statues. + NurseArmsDealer: Don't tell {0} that I was responsible for {1}'s injuries. + NamedLaura: The nice thing about maps is I can track anything that has fallen. + NamedPenelope: Imagine how fast you could throw if you just had more hands. + NamedValerie: I also take food for currency. + NamedRowan: Usually I only think of animals as food or target practice, but dragons are an exception. + Jungle: I'd rather not be here. This place has bad vibes, y'know? It brings back some unpleasant memories. + Party: Where is my party hat? Well, I stole it of course. + Hardmode1: All sorts of new weapons to be found and looted. Get to that, and I'll share some of my collection too! + Hardmode2: There's so much scrap around this land with valuable parts to them. Makes you wonder who could afford to leave em all around. + Hardmode3: Crypts, tombs, dungeons, those're all just treasure troves to me. The dead are dead, they've got nothing to do with it. + MoonLordDefeated1: If you find anything cool, make sure to drop by and show it to me, I promise I'll keep my hands off it. + MoonLordDefeated2: So many new things to steal, I can't think of where to start! + MoonLordDefeated3: If I end up angering some deities or whatever, would you mind taking the blame for me? + HasBoneGlove: Wouldn't be the first time I used remains as weapons. + HasValediction: Oh man, did you rip that off a shark!? Now that's a weapon! + } + + RefundButton: Refund + Refund1: Want in on a little secret? Since {0} always gets so much cash from you, I've been stealing some of it as we go. I need you to keep quiet about it, so here. + Refund2: Hey, if government officials can get tax, why can't I? The heck do you mean that these two things are nothing alike? + NoRefund: Sorry, I got nothing. Perhaps you could reforge something and come back later... + + TownNPCMood: { + Content: It's been going well! + NoHome: You have a place to bunk? Sleeping on the ground makes me stiff and sore. + LoveSpace: Less people makes getting away with certain things easier. + FarFromHome: I need to get back to my secret cache! What if someone got their hands on it while I was away!? + DislikeCrowded: I don't like this, too many possible eyewitnesses. + HateCrowded: Being around this many people makes me think I'M going to be robbed. + LikeBiome: I know that a lot of wealthy traders come through the desert at times. Makes it a great spot to nick their goods. + DislikeBiome: Too stifling, too humid. I get sluggish in these conditions, no good. + HateBiome: No one lives here, and why would they?! This place is a dump! + LikeNPC: "{NPCName} doesn't only keep spiky balls in his pockets, he keeps a ton of cash! He's too absentminded to notice I'm stealing from him too! I like that a lot!" + DislikeNPC: What a goody two shoes, {NPCName} is! I dislike her out of principle! …And because she has almost no material goods. + LikeNPC_Princess: I couldn't bear to steal anything from {NPCName}, she's so cute! + Princess_LovesNPC: "{NPCName} gifts me with nice exact replicas of other's things, I wonder how they do it!" + } +} + +BrimstoneWitch: { + DisplayName: Brimstone Witch + Census.SpawnCondition: Defeat Supreme Witch, Calamitas + Name.Calamitas: Calamitas + + Chat: { + EasterEgg: Mrrp is cringe. + Homeless1: I'm considering moving back to that old cave of mine. + Homeless2: I certainly can't return to Yharim's old dwellings now, have you got any places to stay? + Normal1: I can't pay rent, but if you've got any dead relative you want me to try and... what? You don't? + Normal2: One of these days, I was thinking of starting a garden with the flowers from the old capitol of hell. I love the smell of brimstone in the morning. + Normal3: I think I've settled comfortably, thank you very much. + Normal4: Many seasons have gone by since I first met with the Tyrant, and only now did I break free. I wish I'd been stronger... + Normal5: If you've got any curses you want dispelled... well I'm not your person. + BloodMoon1: Such an unnatural shade of red. Nothing like my brimstone flames. + BloodMoon2: I can't work with nights like these. The stars seem to have shrunk away in fear. + Night1: These undead are horrific, I can't stand to look at them. How could anyone be satisfied with such amateur work? + Night2: I don't think it's a stretch to say that astrology is utter nonsense... but it was a hobby of mine once. + DrunkPrincess: I wonder if {0} ever feels cold given how revealing her dress is. Perhaps she should cover up a bit more. + SeaKing: I cannot understand the Sea King. He does not seem to want me dead. That amount of compassion I just can't understand. + Party: If another person asks me if I can dance or not, I will light their hat on fire. + } + + EnchantButton: Enchant + + TownNPCMood: { + Content: I can't complain, really. + NoHome: Anywhere would be better than a cave with no bed or lighting. + LoveSpace: The quieter, the better. This is good. + FarFromHome: After being used to having people around for a bit, I miss it again. + DislikeCrowded: I really don't like how familiar some of these people are getting with me. + HateCrowded: I'm getting a headache from the pressure of having so many people around. + LikeBiome: I've never had the chance to live somewhere like this before. The trees and the songbirds… I quite like it. + DislikeBiome: Is this a sick joke? I can't bear to be here any longer, I've already tried to atone for my sins. + HateBiome: The spirits are unrestful here. It's really not a good feeling. + LikeNPC: "{NPCName} is someone who's had a terrible experience being cursed. He's put up with it quite well all that time, it's quite impressive honestly." + DislikeNPC: Such a racket! All {NPCName} does is make noise, day in and day out! I can't stand her! + LikeNPC_Princess: What a strangely pleasant kid {NPCName} is to be around. + Princess_LovesNPC: "{NPCName} is always lonely, it's why I want to hang out with her, no one should be left alone like that!" + } +} + +Cirrus: { DisplayName: Drunk Princess Census.SpawnCondition: Have {$Items.Potions.CirrusVodka.DisplayName} [i:CalamityMod/CirrusVodka] in your inventory in Hardmode or defeat Calamitas Clone/Plantera Name.Cirrus: Cirrus Chat: { - BossAlive: Why are you talking to me right now? Shouldn't you be bumbling around and dying for my amusement? + BossAlive: Why are you talking to me right now? Shouldn't you be bumbling about and dying for my amusement? + BossAliveAlt: You must be joking! Get back out there and FINISH THE FIGHT! Homeless1: I could smell my vodka from MILES away! Homeless2: Have any spare rooms available? Preferably candle-lit with a hefty supply of booze? BloodMoon1: I'm gonna make some Bloody Marys to relax, celery included. Want one? @@ -358,13 +482,13 @@ FAP: { Normal1: What do you want this time? I have an appointment to get my nails done in 5 minutes, make it quick. Normal1Alt: Whaddya need? I have candles and alcohols galore! Normal2: Maybe you should drink something that turns you into a magical flying unicorn, so you can be just like me. - Normal2Alt: Sometimes I think about returning to nature for a while to escape from all of this chaos. + Normal2Alt: Sometimes, I think about returning to nature for a while, to escape from all of this chaos. Normal3: Deals so good I'll [$$!$] myself! ...Sorry, I may have just had a minor stroke! Normal3Alt: I've been thinking more about the future lately. I can't say I'm not worried, but I'll be trying my best to make it better. Normal4: Did anyone ever tell you that large assets cause back pain? Well, they were right. - Normal4Alt: Do you have any idea how much extra money I make so {0} can afford her super fancy hair products? The back pain is worth it. + Normal4Alt: Do you have any idea how much extra money I make so {0} can afford her super-fancy hair products? Heh, the back pain is worth it. Archmage: "{0} can share a drink with me any time! ...Or maybe not, I'm not sure his old heart could take it." - BrimstoneWitch: The abuse {0} went through is something I can hardly comprehend. I'd offer her a drink, but I don't think she'd enjoy it. + BrimstoneWitch: The abuse {0} endured is something I can scarcely comprehend. I'd offer her a drink, but I don't think she'd enjoy it. Tavernkeep1: My booze will always be better than {0}'s, and nobody can convince me otherwise. Tavernkeep2: Tell {0} to stop calling me. He's not wanted. Tavernkeep3: I've had to tell baldie where my eyes are so many times that I've lost count. @@ -392,21 +516,24 @@ FAP: { Night3: You lost or something? I don't mind company, but I'd rather be left alone at night. Night3Alt: I do love gazing at the stars. You could join me, if you like. Night4: Are you sure you're 21? ...Alright, fine, but don't tell anyone I sold you these. - NightStylist: I should watch some movies with {0} tonight. You could come too, but only if you bring snacks for us. + NightStylist: I should watch some movies with {0} tonight. You could come too, but only if you bring snacks. Party: You'll always find me at parties where booze is involved... well, you'll always find BOOZE where I'M involved! - AcidRain: I'm melting! Put a stop to this inclement weather this instant before it ruins my hair! - Martians: You should probably deal with those ayy lmaos before anything else, but whatever. - CryogenDefeated: God I can't wait to smash some ice again! ...For drinks, of course. + PartyAlt: Y'know... this is fun and all, but I can't wait for the festivities to be over. + AcidRain: I'm melting! Put a stop to this inclement weather before it ruins my hair! + Martians: You should probably deal with those 'ayy lmaos' before doing anything else, but whatever. + CryogenDefeated: God, I can't wait to smash some ice again! ...For drinks, of course. LeviathanDefeated: How could you murder such a beautiful creature!? ...The blue one, not the obese cucumber. - MoonLordDefeated: Ever wondered why the Moon Lord needed so many tentacles? Uh... on second thought, I won't answer that. + MoonLordDefeated: Ever wondered why the Moon Lord needed so many tentacles? Uhm... on second thought, I won't answer that. PolterghastDefeated: I saw a ghost down by the old train tracks back at my homeland once, flailing wildly at the lily pads... frightening times those were. DoGDefeated: I hear it's amazing when the famous Devourer of Gods out in flap-jaw space, with the tuning fork, does a raw blink on Hara-kiri rock. I need scissors! 61! HasChibii: The hell is that? Looks like something I'd carry around if I was 5 years old. - HasAnahitaTrans: Nice scales... is it hot in here or is it just me? - HasVodka: Do you like my vodka? I created it by mixing fairy dust, crystallized cave sweat and other magical crap. + HasChibiiAlt: I won't judge you for having that creature in tow... but keep it the hell away from me. + HasAnahitaTrans: Nice scales... Is it hot in here, or is it just me? + HasVodka: Do you like my vodka? I created it by mixing fairy dust, crystallized cave sweat, and other magical crap. HasAlicorn1: So... you found my special bottle. Hope you enjoy it, I know I will. - HasAlicorn2: Be sure to dismount me once in a while, I get tired. And besides, I can't rip you off-I mean offer you excellent deals you won't find anywhere else if you're riding me 24/7. + HasAlicorn2: Be sure to dismount me once in a while, I get tired. And besides, I can't rip you off-I mean, offer you excellent deals you won't find anywhere else, if you're riding me 24/7. HasAlicorn3: Before you ask, no, I do NOT have a heart on my butt while in human form. Don't question my transformation preferences! + NewOutfit: It's so refreshing to finally wear something else. I still love my dress, of course, but it's not exactly ideal for exercising. } // Death Count stuffs @@ -423,25 +550,25 @@ FAP: { TownNPCMood: { Content: It's 5 o'clock somewhere. - NoHome: I need a place to crash! My drinks need to be properly cooled before they can be served! + NoHome: I need a place to crash! My drinks MUST be properly cooled before they can be served! LoveSpace: Finally, some peace and quiet. Large quantities of people tend to piss me off. - FarFromHome: I'm used to running away from home, but this is a little ridiculous. - DislikeCrowded: If one more person tells me 'it's happy hour somewhere' to try and get a discount, I'm going to snap! + FarFromHome: Don't get me wrong, I'm used to running away from home, but this is a little ridiculous. + DislikeCrowded: If one more person tells me 'it's happy hour somewhere', I'm going to snap! HateCrowded: No amount of alcohol can drown out the noise these people make! - LoveBiome: Other unicorns? Never thought I'd see the day! This place is incredible! - LikeBiome: A good breeze to cool some heads, that's the way to deal with customers who've had a few too many drinks! + LoveBiome: Other unicorns? I never thought I'd see the day... this place is incredible! + LikeBiome: Ah, a soothing breeze and a gorgeous view; a great way to calm some of my more 'unpleasant' patrons. DislikeBiome: This dry air and heat isn't good for my hair, or my drinks. - HateBiome: You think I can fix this mess with a magical friendship rainbow? That's not how it works, dumbass! Get me out of here already! + HateBiome: You think I can fix this place with a magical friendship rainbow? That's not how it works, so get me out of here already! LoveNPC_Stylist: "{NPCName} works wonders for my hair... among other things, hehe." LoveNPC_BestiaryGirl: "{NPCName} is so fluffy and squishy! She also says my alicorn form is 'mega rad'." - LikeNPC_Truffle: "{NPCName} makes me so hungry... I wonder how great of a trip he'd give..." + LikeNPC_DyeTrader: I tried inviting {NPCName} over for drinks a while back, but he didn't seem interested... oh well, his loss. LikeNPC_PartyGirl: "{NPCName} would make for a great bartender some day. She really knows how to liven the mood!" - DislikeNPC_DD2Bartender: "{NPCName} is so bald." + DislikeNPC_DD2Bartender: "{NPCName} is so bald. The sheen reflecting off his dome could legit blind someone, like, oh my god." DislikeNPC_TaxCollector: "{NPCName} had best keep his distance... he wouldn't want to wake up one morning with a pipe bomb in his mailbox." - HateNPC_GoblinTinkerer: "{NPCName} was so terrible that I had to FORCE him to have a better reforge system. Why would you house me next to him? Do you enjoy watching me relive the stress he gave me!?" - HateNPC_Angler: "{NPCName} never stops blabbering about his inane fishing quests. Get me away from him before I stomp him into the ground!" - LikeNPC_Princess: You think I'd dislike {NPCName} because we're too different? Quite the contrary, there's a lot we like to talk about, over non-alcoholic drinks of course. - Princess_LovesNPC: "{NPCName} has really interesting stories to tell, I've learned a lot from her already!" + HateNPC_GoblinTinkerer: "{NPCName} was so terrible that I had to FORCE him to stop ripping off his customers... why would you house me next to him!?" + HateNPC_Angler: "{NPCName} never stops blabbering about his inane fishing quests. Get me away from him before I punt him into the sulphurous sea!" + LikeNPC_Princess: You think I'd dislike {NPCName} because we're too different? Quite the contrary, there's a lot we like to talk about, over non-alcoholic drinks, of course. + Princess_LovesNPC: "{NPCName} has some fascinating stories to tell, I've learned quite a lot from her already." HateNPC: I hate {NPCName}. DislikeNPC: I dislike {NPCName}. LikeNPC: I like {NPCName}. @@ -449,7 +576,7 @@ FAP: { } } -SEAHOE: { +SeaKing: { DisplayName: Sea King Census.SpawnCondition: Defeat a Giant Clam after defeating the Desert Scourge Name.Amidias: Amidias @@ -533,126 +660,3 @@ SEAHOE: { Princess_LovesNPC: "{NPCName} always smiles when I'm nearby, I like being around him just for that!" } } - -THIEF: { - DisplayName: Bandit - Census.SpawnCondition: Have a {$ItemName.PlatinumCoin} [i:PlatinumCoin] in your inventory after defeating Skeletron - - Name: { - Laura: Laura - Mie: Mie - Bonnie: Bonnie - Sarah: Sarah - Diane: Diane - Kate: Kate - Penelope: Penelope - Marisa: Marisa - Maribel: Maribel - Valerie: Valerie - Jessica: Jessica - Rowan: Rowan - Jessie: Jessie - Jade: Jade - Hearn: Hearn - Amber: Amber - Anne: Anne - Indiana: Indiana - } - - Chat: { - BloodMoon1: Oy, watch where you're going or I might just use you for dart practice. - BloodMoon2: Bet you'd look good as a pincushion, amiright? - BloodMoon3: Zombies don't dodge very well. Maybe you'll do a bit better. - BloodMoon4: Hey, careful over there. I've rigged the place. One wrong step and you're going to get a knife in your forehead. - Normal1: Anything is a weapon if you throw it hard enough. - Normal2: That's your chucking arm? You need to work out more. - Normal3: Listen here. It's all in the wrist, the wrist! Oh, forget it. - Normal4: Eh you know how it goes; steal from the rich, give to the poor, but I do take a cut of the profit. - Normal5: Snakes! Why does it always have to be snakes! - Normal6: It's super nice you know, to just have everything you want. Some people never got that luxury. - Normal7: It's not stealing! I'm just borrowing it until I die! - Night1: Hm, the stars are too bright tonight. Makes sneaking around a little more difficult. - Night2: You think those stars that fall occasionally would make good throwing weapons? - BrimstoneWitch: Hey, hey, has {0} seriously moved in here with us? Why??? - DrunkPrincess: I learned never to steal {0}'s drinks. She doesn't appreciate me right now, so I'll go back to hiding. - Merchant: Don't tell {0}, but I took some of his stuff and replaced it with Angel Statues. - NurseArmsDealer: Don't tell {0} that I was responsible for {1}'s injuries. - NamedLaura: The nice thing about maps is I can track anything that has fallen. - NamedPenelope: Imagine how fast you could throw if you just had more hands. - NamedValerie: I also take food for currency. - NamedRowan: Usually I only think of animals as food or target practice, but dragons are an exception. - Jungle: I'd rather not be here. This place has bad vibes, y'know? It brings back some unpleasant memories. - Party: Where is my party hat? Well, I stole it of course. - Hardmode1: All sorts of new weapons to be found and looted. Get to that, and I'll share some of my collection too! - Hardmode2: There's so much scrap around this land with valuable parts to them. Makes you wonder who could afford to leave em all around. - Hardmode3: Crypts, tombs, dungeons, those're all just treasure troves to me. The dead are dead, they've got nothing to do with it. - MoonLordDefeated1: If you find anything cool, make sure to drop by and show it to me, I promise I'll keep my hands off it. - MoonLordDefeated2: So many new things to steal, I can't think of where to start! - MoonLordDefeated3: If I end up angering some deities or whatever, would you mind taking the blame for me? - HasBoneGlove: Wouldn't be the first time I used remains as weapons. - HasValediction: Oh man, did you rip that off a shark!? Now that's a weapon! - } - - RefundButton: Refund - Refund1: Want in on a little secret? Since {0} always gets so much cash from you, I've been stealing some of it as we go. I need you to keep quiet about it, so here. - Refund2: Hey, if government officials can get tax, why can't I? The heck do you mean that these two things are nothing alike? - NoRefund: Sorry, I got nothing. Perhaps you could reforge something and come back later... - - TownNPCMood: { - Content: It's been going well! - NoHome: You have a place to bunk? Sleeping on the ground makes me stiff and sore. - LoveSpace: Less people makes getting away with certain things easier. - FarFromHome: I need to get back to my secret cache! What if someone got their hands on it while I was away!? - DislikeCrowded: I don't like this, too many possible eyewitnesses. - HateCrowded: Being around this many people makes me think I'M going to be robbed. - LikeBiome: I know that a lot of wealthy traders come through the desert at times. Makes it a great spot to nick their goods. - DislikeBiome: Too stifling, too humid. I get sluggish in these conditions, no good. - HateBiome: No one lives here, and why would they?! This place is a dump! - LikeNPC: "{NPCName} doesn't only keep spiky balls in his pockets, he keeps a ton of cash! He's too absentminded to notice I'm stealing from him too! I like that a lot!" - DislikeNPC: What a goody two shoes, {NPCName} is! I dislike her out of principle! …And because she has almost no material goods. - LikeNPC_Princess: I couldn't bear to steal anything from {NPCName}, she's so cute! - Princess_LovesNPC: "{NPCName} gifts me with nice exact replicas of other's things, I wonder how they do it!" - } -} - -WITCH: { - DisplayName: Brimstone Witch - Census.SpawnCondition: Defeat Supreme Witch, Calamitas - Name.Calamitas: Calamitas - - Chat: { - EasterEgg: Mrrp is cringe. - Homeless1: I'm considering moving back to that old cave of mine. - Homeless2: I certainly can't return to Yharim's old dwellings now, have you got any places to stay? - Normal1: I can't pay rent, but if you've got any dead relative you want me to try and... what? You don't? - Normal2: One of these days, I was thinking of starting a garden with the flowers from the old capitol of hell. I love the smell of brimstone in the morning. - Normal3: I think I've settled comfortably, thank you very much. - Normal4: Many seasons have gone by since I first met with the Tyrant, and only now did I break free. I wish I'd been stronger... - Normal5: If you've got any curses you want dispelled... well I'm not your person. - BloodMoon1: Such an unnatural shade of red. Nothing like my brimstone flames. - BloodMoon2: I can't work with nights like these. The stars seem to have shrunk away in fear. - Night1: These undead are horrific, I can't stand to look at them. How could anyone be satisfied with such amateur work? - Night2: I don't think it's a stretch to say that astrology is utter nonsense... but it was a hobby of mine once. - DrunkPrincess: I wonder if {0} ever feels cold given how revealing her dress is. Perhaps she should cover up a bit more. - SeaKing: I cannot understand the Sea King. He does not seem to want me dead. That amount of compassion I just can't understand. - Party: If another person asks me if I can dance or not, I will light their hat on fire. - } - - EnchantButton: Enchant - - TownNPCMood: { - Content: I can't complain, really. - NoHome: Anywhere would be better than a cave with no bed or lighting. - LoveSpace: The quieter, the better. This is good. - FarFromHome: After being used to having people around for a bit, I miss it again. - DislikeCrowded: I really don't like how familiar some of these people are getting with me. - HateCrowded: I'm getting a headache from the pressure of having so many people around. - LikeBiome: I've never had the chance to live somewhere like this before. The trees and the songbirds… I quite like it. - DislikeBiome: Is this a sick joke? I can't bear to be here any longer, I've already tried to atone for my sins. - HateBiome: The spirits are unrestful here. It's really not a good feeling. - LikeNPC: "{NPCName} is someone who's had a terrible experience being cursed. He's put up with it quite well all that time, it's quite impressive honestly." - DislikeNPC: Such a racket! All {NPCName} does is make noise, day in and day out! I can't stand her! - LikeNPC_Princess: What a strangely pleasant kid {NPCName} is to be around. - Princess_LovesNPC: "{NPCName} is always lonely, it's why I want to hang out with her, no one should be left alone like that!" - } -} diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson index 9e64da189d..0808ef37fd 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson @@ -6,6 +6,7 @@ AcidicSaxMist.DisplayName: Acid Mist AetherBeam.DisplayName: Aether Beam AnahitasArpeggioNote.DisplayName: Anahita's Song Ancient2.DisplayName: Ancient Dust +ApoctosisBlast.DisplayName: Apoctosis Blast ApotheosisEnergy.DisplayName: Apotheosis Energy ApotheosisWorm.DisplayName: The Devourer of Gods AquamarineBolt.DisplayName: Aqua Bolt @@ -110,7 +111,6 @@ IonBlast.DisplayName: Ion Blast KeelhaulBubble.DisplayName: Keelhaul Bubble KeelhaulGeyserBottom.DisplayName: Keelhaul Geyser KeelhaulGeyserTop.DisplayName: Keelhaul Geyser -LazharSolarBeam.DisplayName: Concentrated Solar Beam LightBall.DisplayName: Light Ball LightBallExplosion.DisplayName: Light Explosion LightBead.DisplayName: Light Bead diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson index 953ee69725..2106b8f772 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson @@ -14,6 +14,9 @@ GaussFlux.DisplayName: Gauss Flux GaussPistolShot.DisplayName: Gauss Shot GaussRifleBlast.DisplayName: Gauss Blast GaussRifleExplosion.DisplayName: Gauss Explosion +ImmolationArrow.DisplayName: Immolation Arrow +ImmolationBurst.DisplayName: Immolation Burst +ImmolationSpray.DisplayName: Immolation Spray LaserRifleShot.DisplayName: Laser Rifle MassivePlasmaExplosion.DisplayName: Plasma Explosion MountedScannerLaser.DisplayName: Deathray @@ -28,6 +31,8 @@ PulsePistolShot.DisplayName: Pulse Bolt PulseRifleShot.DisplayName: Pulse Bolt PulseTurret.DisplayName: Pulse Turret PulseTurretShot.DisplayName: Pulse Bolt +ScattershotLance.DisplayName: Laser Lance +ScattershotLaser.DisplayName: Scattershot Laser SnakeEyesSummon.DisplayName: Snake Eyes SnakeEyesProjectile.DisplayName: Inescapable Bolt StarSwallowerAcid.DisplayName: Acid diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index 403a7a04c0..8f7aca918e 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -224,6 +224,7 @@ SuperradiantSawLingering.DisplayName: Ultraradiant Saw TauCannonBeam.DisplayName: Tau Cannon Beam TauCannonBolt.DisplayName: Tau Cannon Bolt TauCannonPortal.DisplayName: Tau Cannon Portal +TaserExplosion.DisplayName: Taser Explosion TelluricGlareArrow.DisplayName: Radiant Arrow TheMaelstromExplosion.DisplayName: Reaper Explosion TheMaelstromShark.DisplayName: Reaper Shark diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index d396cb2598..dc46a26af4 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -36,7 +36,7 @@ Revengeance: Revengeance RevMaster: Rev+Master RevLegend: Rev+Legend RevengeanceEnabled: Revengeance Mode is enabled -RevengeanceShortInfo: "[c/F54254:The intended Calamity experience!]" +RevengeanceShortInfo: "[c/F54254:The intended Calamity experience! Can only be enabled in Expert Mode!]" RevengeanceExpandedInfo: ''' [c/B55362:Enables the] [c/85FFE9:Adrenaline] [c/B55362:mechanic. You gain Adrenaline while fighting bosses. Getting hit drops Adrenaline back to 0] @@ -53,7 +53,7 @@ Death: Death DeathMaster: Death+Master DeathLegend: Death+Legend DeathEnabled: Death Mode is enabled -DeathShortInfo: "[c/C82DF7:A tougher challenge for the more experienced, or for those that want a step up from Revengeance Mode]" +DeathShortInfo: "[c/C82DF7:A far more difficult challenge than Revengeance Mode! Can only be enabled in Master Mode!]" DeathExpandedInfo: ''' [c/B834E0:All foes will pose a much larger threat with highly aggressive AIs and increased damage] diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.Wings.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.Wings.hjson index c5f021c106..9edc92b12c 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.Wings.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.Wings.hjson @@ -10,11 +10,7 @@ FinWings: ''' FlameWings: Multiplies all heat debuff damage by 1.25x FrozenWings: Multiplies all cold debuff damage by 1.25x -HarpyWings: - ''' - 10% increased movement speed - With Harpy Ring or Angel Treads equipped, most attacks sometimes launch feathers - ''' +HarpyWings: 10% increased movement speed LeafWings: +10 defense and permanent Dryad's Blessing TatteredFairyWings: You leave a trail of fairy dust as you fly WingsNebula: Increases the pickup range of Nebula armor's nebula boosters diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index 5a4c92113e..198423a825 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -429,8 +429,9 @@ SteampunkerChat: { StylistChat: { Hardmode: Please don't catch space lice. Or {0} lice. Or just lice in general. - DrunkPrincess1: "{0} is always trying to brighten my mood... even if, deep down, I know she's sad..." + DrunkPrincess1: "{0} is always trying to brighten my mood... even though, deep down, I know she's sad..." DrunkPrincess2: Sometimes I catch {0} sneaking up from behind me. + DrunkPrincess3: "{0} has been smiling more often lately, even without alcohol. I think I can thank you for that, at least somewhat." ProfanedSoulCrystal1: They look so cute and yet, I can feel their immense power just by being near them. What are you? ProfanedSoulCrystal2: I hate to break it to you, but you don't have hair to cut or style, hun. ProfanedDonuts: Aww, they're so cute, do they have names? diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index b348b67afa..e5aaf5bc23 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -1143,7 +1143,7 @@ namespace CalamityMod Mod dialogueMod = ExternalMods.dialogueTweak; if (dialogueMod != null) { - dialogueMod.Call("ReplaceShopButtonIcon", NPCType(), "Head"); + dialogueMod.Call("ReplaceShopButtonIcon", NPCType(), "Head"); } } #endregion diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index 6929085234..20bc8703cc 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -431,7 +431,7 @@ namespace CalamityMod.NPCs.AstrumAureus CalamityGlobalNPC.SetNewBossJustDowned(NPC); - CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType() }, DownedBossSystem.downedAstrumAureus); + CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType() }, DownedBossSystem.downedAstrumAureus); // If Astrum Aureus has not yet been killed, notify players of new Astral enemy drops if (!DownedBossSystem.downedAstrumAureus) diff --git a/NPCs/CalClone/CalamitasClone.cs b/NPCs/CalClone/CalamitasClone.cs index 95eeab7720..4a97327806 100644 --- a/NPCs/CalClone/CalamitasClone.cs +++ b/NPCs/CalClone/CalamitasClone.cs @@ -249,7 +249,7 @@ namespace CalamityMod.NPCs.CalClone CalamityGlobalNPC.SetNewBossJustDowned(NPC); - CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType() }, DownedBossSystem.downedCalamitasClone); + CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType() }, DownedBossSystem.downedCalamitasClone); // Mark the Calamitas Clone as dead DownedBossSystem.downedCalamitasClone = true; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index fda4fffcfb..8aa7c99fa5 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -338,6 +338,15 @@ namespace CalamityMod.NPCs public int veriumDoomTimer = 0; public int veriumDoomStacks = 0; public bool veriumDoomMarked = false; + + // Laser Burn Type (1 = applied damage added and dealt in a single hit, 2 = flat damage + extra flat damage from stacks, 0 = innactive) + public int laserBurnType = 0; + public int laserBurnDamage = 0; // Only used if laser burn type is 1 + public const int laserBurnTime = 300; + public int laserBurnTimer = 0; + public int laserBurnStacks = 0; + public bool laserBurnMarked = false; + /// /// Tracks the strength of Calamity's cursor effect; increments by 2 on every frame.
/// If this value reaches , the enemy is afflicted with True Vulnerability Hex. @@ -2872,9 +2881,9 @@ namespace CalamityMod.NPCs npc.dontTakeDamage = true; break; - // Make Fishron and Anahita Bubbles immune to damage in Rev+ Master Mode + // Make Fishron and Anahita Bubbles immune to damage in Death Mode case NPCID.DetonatingBubble: - npc.dontTakeDamage = Main.masterMode && CalamityWorld.revenge; + npc.dontTakeDamage = CalamityWorld.death; break; default: @@ -3845,6 +3854,11 @@ namespace CalamityMod.NPCs return calcDR; } + + public bool IsArmored() + { + return unbreakableDR && DR > 0.9f; + } #endregion #region Boss Head Slot @@ -3900,6 +3914,9 @@ namespace CalamityMod.NPCs { if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && Vector2.Distance(Main.LocalPlayer.Center, npc.Center) < BossZenDistance) Main.LocalPlayer.AddBuff(BuffType(), 2); + + if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && npc.type == NPCType() && Vector2.Distance(Main.LocalPlayer.Center, npc.Center) < BossZenDistance) + Main.LocalPlayer.AddBuff(BuffType(), 2); } if (npc.type != NPCType()) @@ -4040,7 +4057,7 @@ namespace CalamityMod.NPCs return QueenBeeAI.BuffedQueenBeeAI(npc, Mod); } - if (Main.masterMode && CalamityWorld.revenge) + if (CalamityWorld.death) { if (npc.type == NPCID.DetonatingBubble) return DukeFishronAI.BuffedDetonatingBubbleAI(npc, Mod); @@ -5776,6 +5793,9 @@ namespace CalamityMod.NPCs if (veriumDoomTimer > 0) veriumDoomTimer--; + if (laserBurnTimer > 0) + laserBurnTimer--; + if (veriumDoomTimer == 0 && veriumDoomMarked) { for (int d = 0; d < 14 + veriumDoomStacks; d++) @@ -5809,6 +5829,41 @@ namespace CalamityMod.NPCs } } + if (laserBurnTimer <= 0 && laserBurnMarked && laserBurnType > 0) + { + if (laserBurnType == 1) // Applied damage + Projectile.NewProjectile(npc.GetSource_FromThis(), npc.Center, Vector2.Zero, ProjectileType(), laserBurnDamage, 0, Main.myPlayer, npc.whoAmI); + if (laserBurnType == 2) // Flat damage + stacks + Projectile.NewProjectile(npc.GetSource_FromThis(), npc.Center, Vector2.Zero, ProjectileType(), 70 + (20 * laserBurnStacks), 0, Main.myPlayer, npc.whoAmI); + + for (int d = 0; d < (int)(6 + laserBurnStacks * 0.35f); d++) + { + float partScale = Main.rand.NextFloat(0.7f, 1f); + Vector2 partVel = (new Vector2(15, 15) * (laserBurnStacks * 0.025f)).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f); + for (int i = 0; i < 2; i++) + { + Particle sparks = new SparkParticle(npc.Center, partVel, false, 30, i == 0 ? partScale : partScale * 0.4f, i == 0 ? Color.Red : Color.White); + GeneralParticleHandler.SpawnParticle(sparks); + } + + Dust dust = Dust.NewDustPerfect(npc.Center, 278); + dust.velocity = (new Vector2(10, 10) * (laserBurnStacks * 0.05f)).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f) + new Vector2(0, -1); + dust.scale = Main.rand.NextFloat(0.8f, 1.1f); + dust.noGravity = false; + dust.color = Color.Red; + } + + SoundEngine.PlaySound(new("CalamityMod/Sounds/Item/LaserBurn") { Volume = 0.6f, PitchVariance = 0.15f }, npc.Center); + laserBurnMarked = false; + laserBurnStacks = 0; + laserBurnTimer = 0; + laserBurnDamage = 0; + } + + // Queen Bee is completely immune to having her movement impaired if not in a high difficulty mode. + if (npc.type == NPCID.QueenBee && !CalamityWorld.revenge && !BossRushEvent.BossRushActive) + return; + // Pearl Aura shard spawning // Slowing is handled in the general slowing code below if (pearlAura > 0) @@ -6261,6 +6316,11 @@ namespace CalamityMod.NPCs if (modPlayer.camper && !player.StandingStill()) modifiers.SourceDamage *= 0.1f; + if (IsArmored()) //Hide combat text so we can draw our own for armored NPCs + { + modifiers.HideCombatText(); + } + // True melee resists if (DesertScourgeIDList.Includes(npc.type) || EaterOfWorldsIDList.Includes(npc.type) || npc.type == NPCID.Creeper || PerforatorWormIDList.Includes(npc.type) || AquaticScourgeIDList.Includes(npc.type) || DestroyerIDList.Includes(npc.type) || @@ -6286,6 +6346,11 @@ namespace CalamityMod.NPCs MakeTownNPCsTakeMoreDamage(npc, projectile, Mod, ref modifiers); + if (IsArmored()) //Hide combat text so we can draw our own for armored NPCs + { + modifiers.HideCombatText(); + } + // Block natural falling stars from killing boss spawners randomly if ((projectile.type == ProjectileID.FallingStar && projectile.damage >= 1000) && (npc.type == NPCType() || npc.type == NPCType() || npc.type == NPCType())) modifiers.SourceDamage *= 0f; @@ -6479,7 +6544,25 @@ namespace CalamityMod.NPCs if ((projectile.penetrate > 1 || projectile.penetrate == -1) && !PierceResistExceptionList.Includes(projectile.type) && !projectile.CountsAsClass() && projectile.aiStyle != ProjAIStyleID.Flail && projectile.aiStyle != ProjAIStyleID.MechanicalPiranha && projectile.aiStyle != ProjAIStyleID.Yoyo) projectile.Calamity().timesPierced++; } + #endregion + #region OnHitBy overrides + public override void OnHitByProjectile(NPC npc, Projectile projectile, NPC.HitInfo hit, int damagedone) + { + if (IsArmored()) + { + CombatText.NewText(npc.Hitbox, Color.Gray, damagedone, hit.Crit); + } + } + public override void OnHitByItem(NPC npc, Player player, Item item, NPC.HitInfo hit, int damagedone) + { + if (IsArmored()) + { + CombatText.NewText(npc.Hitbox, Color.Gray, damagedone, hit.Crit); + } + } + #endregion + #region Whip Tag // Make whip tags multiplicative, by effectively reversing the process done to it private void EditWhipTagDamage(Projectile proj, NPC npc, ref NPC.HitModifiers modifiers) { @@ -7301,6 +7384,23 @@ namespace CalamityMod.NPCs } } + if (laserBurnTimer > 0) + { + int particleChance = Math.Max(3, 10 - (laserBurnStacks / 3)); + if (laserBurnTimer % particleChance == 0) + { + Vector2 randPosition = new Vector2(npc.position.X + Main.rand.Next(0, npc.width), npc.position.Y + Main.rand.Next(0, npc.height)); + Particle markedParticle = new GlowOrbParticle(randPosition, Vector2.Zero, false, Main.rand.Next(7, 9 + 1), Main.rand.NextFloat(0.3f, 0.45f) + (laserBurnStacks * 0.045f), Color.Red); + GeneralParticleHandler.SpawnParticle(markedParticle); + } + if (laserBurnType == 0) + { + Main.NewText("No Burn Type Set", Color.OrangeRed); + laserBurnMarked = false; + laserBurnTimer = 0; + } + } + if (voidfrost > 0) Voidfrost.DrawEffects(npc, ref drawColor); @@ -7402,7 +7502,7 @@ namespace CalamityMod.NPCs if (Main.LocalPlayer.Calamity().trippy || (npc.type == NPCID.KingSlime && CalamityWorld.LegendaryMode && CalamityWorld.revenge)) return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Main.DiscoR); - if (npc.type == NPCID.KingSlime && Main.masterMode && CalamityWorld.revenge) + if (npc.type == NPCID.KingSlime && CalamityWorld.death) return NPC.AnyNPCs(NPCType()) ? Color.Lerp(new Color(0, 0, 150, npc.alpha), new Color(125, 125, 255, npc.alpha), (float)Math.Sin(Main.GlobalTimeWrappedHourly) / 2f + 0.5f) : null; if (npc.type == NPCID.QueenBee && Main.zenithWorld) @@ -8384,7 +8484,7 @@ namespace CalamityMod.NPCs // His afterimages I can't get to work, so fuck it else if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType()) { - Texture2D npcTexture = (masterMode && revenge && npc.type == NPCID.SkeletronPrime) ? ExtraTextureRefs.ChadPrime.Value : TextureAssets.Npc[npc.type].Value; + Texture2D npcTexture = (death && npc.type == NPCID.SkeletronPrime) ? ExtraTextureRefs.ChadPrime.Value : TextureAssets.Npc[npc.type].Value; int frameHeight = npcTexture.Height / Main.npcFrameCount[npc.type]; npc.frame.Y = (int)newAI[3]; @@ -8447,7 +8547,7 @@ namespace CalamityMod.NPCs spriteBatch.Draw(npcTexture, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, npc.GetAlpha(drawColor), npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f); Color eyesColor = new Color(200, 200, 200, 0); - if (masterMode && revenge) + if (death) { int alpha = 192; eyesColor = npc.type == NPCType() ? new Color(150, 100, 255, alpha) : new Color(255, 255, 0, alpha); @@ -8540,7 +8640,7 @@ namespace CalamityMod.NPCs public override bool? DrawHealthBar(NPC npc, byte hbPosition, ref float scale, ref Vector2 position) { - if ((CalamityWorld.revenge && Main.masterMode) || BossRushEvent.BossRushActive) + if (CalamityWorld.death || BossRushEvent.BossRushActive) { if (npc.type == NPCID.Creeper) { diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 40e1b12dbe..55206d6a05 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -505,9 +505,10 @@ namespace CalamityMod.NPCs break; // Fire Imp - // Ashen Stalactite @ 10% Normal, 16.67% Expert+ + // Ashen Stalactite @ 4%, 14.28% after defeating EoW/BoC case NPCID.FireImp: - npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 10, 6)); + npcLoot.AddIf((info) => !NPC.downedBoss2, ModContent.ItemType(), 25); + npcLoot.AddIf((info) => NPC.downedBoss2, ModContent.ItemType(), 7); break; // Demon, Voodoo Demon @@ -1929,7 +1930,7 @@ DukeEditFailed: case NPCID.TheDestroyer: SetNewShopVariable(new int[] { NPCID.Demolitionist, NPCID.DD2Bartender, NPCID.Stylist, NPCID.Truffle }, NPC.downedMechBossAny); - SetNewShopVariable(new int[] { NPCID.Stylist, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }, NPC.downedMechBoss1 || !NPC.downedMechBoss2 || !NPC.downedMechBoss3); + SetNewShopVariable(new int[] { NPCID.Stylist, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }, NPC.downedMechBoss1 || !NPC.downedMechBoss2 || !NPC.downedMechBoss3); SetNewBossJustDowned(npc); if (!NPC.downedMechBoss1 && CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) @@ -1941,7 +1942,7 @@ DukeEditFailed: if (lastTwinStanding) { SetNewShopVariable(new int[] { NPCID.Demolitionist, NPCID.DD2Bartender, NPCID.Stylist, NPCID.Truffle }, NPC.downedMechBossAny); - SetNewShopVariable(new int[] { NPCID.Stylist, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }, !NPC.downedMechBoss1 || NPC.downedMechBoss2 || !NPC.downedMechBoss3); + SetNewShopVariable(new int[] { NPCID.Stylist, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }, !NPC.downedMechBoss1 || NPC.downedMechBoss2 || !NPC.downedMechBoss3); SetNewBossJustDowned(npc); if (!NPC.downedMechBoss2 && CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) @@ -1951,7 +1952,7 @@ DukeEditFailed: case NPCID.SkeletronPrime: SetNewShopVariable(new int[] { NPCID.Demolitionist, NPCID.DD2Bartender, NPCID.Stylist, NPCID.Truffle }, NPC.downedMechBossAny); - SetNewShopVariable(new int[] { NPCID.Stylist, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }, !NPC.downedMechBoss1 || !NPC.downedMechBoss2 || NPC.downedMechBoss3); + SetNewShopVariable(new int[] { NPCID.Stylist, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }, !NPC.downedMechBoss1 || !NPC.downedMechBoss2 || NPC.downedMechBoss3); SetNewBossJustDowned(npc); if (!NPC.downedMechBoss3 && CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) @@ -1959,7 +1960,7 @@ DukeEditFailed: break; case NPCID.Plantera: - SetNewShopVariable(new int[] { NPCID.WitchDoctor, NPCID.Truffle, NPCID.BestiaryGirl, ModContent.NPCType(), ModContent.NPCType() }, NPC.downedPlantBoss); + SetNewShopVariable(new int[] { NPCID.WitchDoctor, NPCID.Truffle, NPCID.BestiaryGirl, ModContent.NPCType(), ModContent.NPCType() }, NPC.downedPlantBoss); SetNewBossJustDowned(npc); // Spawn Perennial Ore if Plantera has never been killed @@ -1983,19 +1984,19 @@ DukeEditFailed: break; case NPCID.Everscream: - SetNewShopVariable(new int[] { ModContent.NPCType() }, NPC.downedChristmasTree || !NPC.downedChristmasSantank || !NPC.downedChristmasIceQueen); + SetNewShopVariable(new int[] { ModContent.NPCType() }, NPC.downedChristmasTree || !NPC.downedChristmasSantank || !NPC.downedChristmasIceQueen); break; case NPCID.SantaNK1: - SetNewShopVariable(new int[] { ModContent.NPCType() }, !NPC.downedChristmasTree || NPC.downedChristmasSantank || !NPC.downedChristmasIceQueen); + SetNewShopVariable(new int[] { ModContent.NPCType() }, !NPC.downedChristmasTree || NPC.downedChristmasSantank || !NPC.downedChristmasIceQueen); break; case NPCID.IceQueen: - SetNewShopVariable(new int[] { ModContent.NPCType() }, !NPC.downedChristmasTree || !NPC.downedChristmasSantank || NPC.downedChristmasIceQueen); + SetNewShopVariable(new int[] { ModContent.NPCType() }, !NPC.downedChristmasTree || !NPC.downedChristmasSantank || NPC.downedChristmasIceQueen); break; case NPCID.Golem: - SetNewShopVariable(new int[] { NPCID.ArmsDealer, NPCID.Cyborg, NPCID.Steampunker, NPCID.Wizard, NPCID.WitchDoctor, NPCID.DD2Bartender, ModContent.NPCType(), ModContent.NPCType() }, NPC.downedGolemBoss); + SetNewShopVariable(new int[] { NPCID.ArmsDealer, NPCID.Cyborg, NPCID.Steampunker, NPCID.Wizard, NPCID.WitchDoctor, NPCID.DD2Bartender, ModContent.NPCType(), ModContent.NPCType() }, NPC.downedGolemBoss); SetNewBossJustDowned(npc); // If Golem has never been killed, send a message about the Plague. @@ -2030,7 +2031,7 @@ DukeEditFailed: break; case NPCID.MoonLordCore: - SetNewShopVariable(new int[] { NPCID.Princess, ModContent.NPCType() }, NPC.downedMoonlord); + SetNewShopVariable(new int[] { NPCID.Princess, ModContent.NPCType() }, NPC.downedMoonlord); SetNewBossJustDowned(npc); string key5 = "Mods.CalamityMod.Status.Progression.MoonBossText"; diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 599e4f4b0b..ccf0720218 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -682,11 +682,11 @@ namespace CalamityMod.NPCs (NPCID.Cyborg,(Player player) => player.Calamity().newCyborgInventory, (Player player, bool enabled) =>{ player.Calamity().newCyborgInventory = enabled; }), (NPCID.Princess, (Player player) => player.Calamity().newPrincessInventory,(Player player, bool enabled) =>{ player.Calamity().newPrincessInventory = enabled; }), (NPCID.SkeletonMerchant, (Player player) => player.Calamity().newSkeletonMerchantInventory, (Player player, bool enabled) =>{ player.Calamity().newSkeletonMerchantInventory = enabled; }), - (NPCType(), (Player player) => player.Calamity().newAmidiasInventory,(Player player, bool enabled) =>{ player.Calamity().newAmidiasInventory = enabled; }), - (NPCType(), (Player player) => player.Calamity().newBanditInventory,(Player player, bool enabled) =>{ player.Calamity().newBanditInventory = enabled; }), - (NPCType(), (Player player) => player.Calamity().newCirrusInventory,(Player player, bool enabled) =>{ player.Calamity().newCirrusInventory = enabled; }), - (NPCType(), (Player player) => player.Calamity().newPermafrostInventory,(Player player, bool enabled) =>{ player.Calamity().newPermafrostInventory = enabled; }), - (NPCType(), (Player player) => player.Calamity().newCalamitasInventory,(Player player, bool enabled) =>{ player.Calamity().newCalamitasInventory = enabled; }) // lol + (NPCType(), (Player player) => player.Calamity().newAmidiasInventory,(Player player, bool enabled) =>{ player.Calamity().newAmidiasInventory = enabled; }), + (NPCType(), (Player player) => player.Calamity().newBanditInventory,(Player player, bool enabled) =>{ player.Calamity().newBanditInventory = enabled; }), + (NPCType(), (Player player) => player.Calamity().newCirrusInventory,(Player player, bool enabled) =>{ player.Calamity().newCirrusInventory = enabled; }), + (NPCType(), (Player player) => player.Calamity().newPermafrostInventory,(Player player, bool enabled) =>{ player.Calamity().newPermafrostInventory = enabled; }), + (NPCType(), (Player player) => player.Calamity().newCalamitasInventory,(Player player, bool enabled) =>{ player.Calamity().newCalamitasInventory = enabled; }) // lol }; public void TownNPCAlertSystem(NPC npc, Mod mod, SpriteBatch spriteBatch) @@ -764,10 +764,10 @@ namespace CalamityMod.NPCs #region NPC Chat public override void GetChat(NPC npc, ref string chat) { - int fapsol = NPC.FindFirstNPC(NPCType()); - int permadong = NPC.FindFirstNPC(NPCType()); - int seahorse = NPC.FindFirstNPC(NPCType()); - int thief = NPC.FindFirstNPC(NPCType()); + int cirrus = NPC.FindFirstNPC(NPCType()); + int permadong = NPC.FindFirstNPC(NPCType()); + int seahorse = NPC.FindFirstNPC(NPCType()); + int thief = NPC.FindFirstNPC(NPCType()); int angelstatue = NPC.FindFirstNPC(NPCID.Merchant); switch (npc.type) @@ -820,8 +820,8 @@ namespace CalamityMod.NPCs chat = CalamityUtils.GetTextValue("Vanilla.DryadChat.DarksunEclipse"); else if (Main.rand.NextBool(5) && Main.LocalPlayer.ZoneGlowshroom) { - if (Main.rand.NextBool() && fapsol != -1) - chat = CalamityUtils.GetText("Vanilla.DryadChat.DrunkPrincessShroom").Format(Main.npc[fapsol].GivenName); + if (Main.rand.NextBool() && cirrus != -1) + chat = CalamityUtils.GetText("Vanilla.DryadChat.DrunkPrincessShroom").Format(Main.npc[cirrus].GivenName); else chat = CalamityUtils.GetTextValue("Vanilla.DryadChat.Mushroom"); } @@ -863,8 +863,8 @@ namespace CalamityMod.NPCs chat = CalamityUtils.GetTextValue("Vanilla.MechanicChat.Eclipse"); else if (Main.rand.NextBool(5) && AcidRainEvent.AcidRainEventIsOngoing) chat = CalamityUtils.GetTextValue("Vanilla.MechanicChat.AcidRain"); - else if (Main.rand.NextBool(5) && fapsol != -1) - chat = CalamityUtils.GetText("Vanilla.MechanicChat.DrunkPrincess").Format(Main.npc[fapsol].GivenName); + else if (Main.rand.NextBool(5) && cirrus != -1) + chat = CalamityUtils.GetText("Vanilla.MechanicChat.DrunkPrincess").Format(Main.npc[cirrus].GivenName); break; case NPCID.Merchant: @@ -913,8 +913,8 @@ namespace CalamityMod.NPCs case NPCID.PartyGirl: if (Main.rand.NextBool(4) && Main.eclipse) chat = CalamityUtils.GetTextValue("Vanilla.PartyGirlChat.Eclipse" + Main.rand.Next(1, 2 + 1)); - else if (Main.rand.NextBool(10) && fapsol != -1) - chat = CalamityUtils.GetText("Vanilla.PartyGirlChat.DrunkPrincess").Format(Main.npc[fapsol].GivenName); + else if (Main.rand.NextBool(10) && cirrus != -1) + chat = CalamityUtils.GetText("Vanilla.PartyGirlChat.DrunkPrincess").Format(Main.npc[cirrus].GivenName); break; case NPCID.Pirate: @@ -922,7 +922,7 @@ namespace CalamityMod.NPCs chat = CalamityUtils.GetTextValue("Vanilla.PirateChat.PreLeviathan"); else if (Main.rand.NextBool(5) && DownedBossSystem.downedAquaticScourge) chat = CalamityUtils.GetTextValue("Vanilla.PirateChat.WetScourgeDefeated"); - else if (Main.rand.NextBool(5) && fapsol != -1) + else if (Main.rand.NextBool(5) && cirrus != -1) chat = CalamityUtils.GetTextValue("Vanilla.PirateChat.DrunkPrincess"); else if (Main.rand.NextBool(5) && seahorse != -1) chat = CalamityUtils.GetText("Vanilla.PirateChat.SeaKing").Format(Main.npc[seahorse].GivenName); @@ -950,8 +950,12 @@ namespace CalamityMod.NPCs string worldEvil = Language.GetTextValue("LegacyMisc." + (WorldGen.crimson ? 102 : 101)); if (Main.rand.NextBool(15) && Main.hardMode) chat = CalamityUtils.GetText("Vanilla.StylistChat.Hardmode").Format(worldEvil); - if (Main.rand.NextBool(15) && fapsol != -1) - chat = CalamityUtils.GetText("Vanilla.StylistChat.DrunkPrincess" + (ChildSafety.Disabled ? Main.rand.Next(1, 2 + 1) : 1)).Format(Main.npc[fapsol].GivenName); + if (Main.rand.NextBool(15) && cirrus != -1) + { + int noChildSafetyCirrusLines = NPC.downedMoonlord ? Main.rand.Next(2, 3 + 1) : Main.rand.Next(1, 2 + 1); + int childSafetyCirrusLines = NPC.downedMoonlord ? 3 : 1; + chat = CalamityUtils.GetText("Vanilla.StylistChat.DrunkPrincess" + (ChildSafety.Disabled ? noChildSafetyCirrusLines : childSafetyCirrusLines)).Format(Main.npc[cirrus].GivenName); + } if ((Main.rand.NextBool(npc.GivenName == "Amber" ? 10 : 15)) && Main.LocalPlayer.Calamity().pSoulArtifact) { if (Main.LocalPlayer.Calamity().profanedCrystalBuffs) @@ -964,8 +968,8 @@ namespace CalamityMod.NPCs case NPCID.DD2Bartender: if (Main.rand.NextBool(5) && !Main.dayTime && Main.moonPhase == 0) chat = CalamityUtils.GetTextValue("Vanilla.TavernkeepChat.FullMoon"); - else if (Main.rand.NextBool(10) && fapsol != -1) - chat = CalamityUtils.GetText("Vanilla.TavernkeepChat.DrunkPrincess").Format(Main.npc[fapsol].GivenName); + else if (Main.rand.NextBool(10) && cirrus != -1) + chat = CalamityUtils.GetText("Vanilla.TavernkeepChat.DrunkPrincess").Format(Main.npc[cirrus].GivenName); break; case NPCID.TaxCollector: @@ -995,13 +999,13 @@ namespace CalamityMod.NPCs break; case NPCID.TravellingMerchant: - if (Main.rand.NextBool(5) && fapsol != -1 && angelstatue != -1) - chat = CalamityUtils.GetText("Vanilla.TravellingMerchantChat.DrunkPrincessMerchant").Format(Main.npc[fapsol].GivenName, Main.npc[angelstatue].GivenName); + if (Main.rand.NextBool(5) && cirrus != -1 && angelstatue != -1) + chat = CalamityUtils.GetText("Vanilla.TravellingMerchantChat.DrunkPrincessMerchant").Format(Main.npc[cirrus].GivenName, Main.npc[angelstatue].GivenName); break; case NPCID.Truffle: - if (Main.rand.NextBool(4) && fapsol != -1) - chat = CalamityUtils.GetText("Vanilla.TruffleChat.DrunkPrincess").Format(Main.npc[fapsol].GivenName); + if (Main.rand.NextBool(4) && cirrus != -1) + chat = CalamityUtils.GetText("Vanilla.TruffleChat.DrunkPrincess").Format(Main.npc[cirrus].GivenName); else if (Main.rand.NextBool(8)) chat = CalamityUtils.GetTextValue("Vanilla.TruffleChat.Normal"); break; @@ -1116,7 +1120,7 @@ namespace CalamityMod.NPCs .AddWithCustomValue(ItemID.WormholePotion, Item.buyPrice(silver: 5), Condition.HappyEnoughToSellPylons); shop.Add(ItemID.Flare, hasFlareGunUpgrade) .Add(ItemID.BlueFlare, hasFlareGunUpgrade) - .AddWithCustomValue(ItemID.AngelStatue, Item.buyPrice(gold: 5), Condition.NpcIsPresent(NPCType())) + .AddWithCustomValue(ItemID.AngelStatue, Item.buyPrice(gold: 5), Condition.NpcIsPresent(NPCType())) .AddWithCustomValue(ItemID.Burger, Item.buyPrice(gold: 5), Condition.HappyEnoughToSellPylons, Condition.DownedSkeletron) .AddWithCustomValue(ItemID.Hotdog, Item.buyPrice(gold: 5), Condition.HappyEnoughToSellPylons, Condition.DownedSkeletron) .AddWithCustomValue(ItemID.CoffeeCup, Item.buyPrice(gold: 2), Condition.HappyEnoughToSellPylons); @@ -1151,8 +1155,8 @@ namespace CalamityMod.NPCs .Add(ItemType(), revengeance) .Add(ItemType(), revengeance) .AddWithCustomValue(ItemID.StylistKilLaKillScissorsIWish, Item.buyPrice(gold: 15)) - .Add(ItemType(), Condition.NpcIsPresent(NPCType()), drunk) - .AddWithCustomValue(ItemID.ChocolateChipCookie, Item.buyPrice(gold: 3), Condition.HappyEnoughToSellPylons, Condition.NpcIsPresent(NPCType())); + .Add(ItemType(), Condition.NpcIsPresent(NPCType()), drunk) + .AddWithCustomValue(ItemID.ChocolateChipCookie, Item.buyPrice(gold: 3), Condition.HappyEnoughToSellPylons, Condition.NpcIsPresent(NPCType())); } if (type == NPCID.Cyborg) @@ -1243,12 +1247,12 @@ namespace CalamityMod.NPCs { shop.AddWithCustomValue(ItemID.PrincessWeapon, Item.buyPrice(gold: 50)) .Add(ItemType()) - .Add(ItemID.AppleJuice, Condition.NpcIsPresent(NPCType())) - .Add(ItemID.FruitJuice, Condition.NpcIsPresent(NPCType())) - .Add(ItemID.Lemonade, Condition.NpcIsPresent(NPCType())) - .Add(ItemID.PrismaticPunch, Condition.NpcIsPresent(NPCType())) - .Add(ItemID.SmoothieofDarkness, Condition.NpcIsPresent(NPCType())) - .Add(ItemID.TropicalSmoothie, Condition.NpcIsPresent(NPCType())); + .Add(ItemID.AppleJuice, Condition.NpcIsPresent(NPCType())) + .Add(ItemID.FruitJuice, Condition.NpcIsPresent(NPCType())) + .Add(ItemID.Lemonade, Condition.NpcIsPresent(NPCType())) + .Add(ItemID.PrismaticPunch, Condition.NpcIsPresent(NPCType())) + .Add(ItemID.SmoothieofDarkness, Condition.NpcIsPresent(NPCType())) + .Add(ItemID.TropicalSmoothie, Condition.NpcIsPresent(NPCType())); } if (type == NPCID.SkeletonMerchant) diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index cc397cdec9..bdf1c00e8a 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -1450,9 +1450,9 @@ namespace CalamityMod.NPCs.Cryogen CalamityGlobalNPC.SetNewBossJustDowned(NPC); // Spawn Permafrost if he isn't in the world - int permafrostNPC = NPC.FindFirstNPC(ModContent.NPCType()); + int permafrostNPC = NPC.FindFirstNPC(ModContent.NPCType()); 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); + 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 if (!DownedBossSystem.downedCryogen) diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index d36c95b8ea..d377a711a7 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -2563,7 +2563,7 @@ namespace CalamityMod.NPCs.DevourerofGods CalamityGlobalNPC.SetNewBossJustDowned(NPC); - CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType() }, DownedBossSystem.downedDoG); + CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType() }, DownedBossSystem.downedDoG); // If DoG has not been killed yet, notify players that the holiday moons are buffed if (!DownedBossSystem.downedDoG) diff --git a/NPCs/Leviathan/Anahita.cs b/NPCs/Leviathan/Anahita.cs index 91b399e929..04d468c868 100644 --- a/NPCs/Leviathan/Anahita.cs +++ b/NPCs/Leviathan/Anahita.cs @@ -634,7 +634,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.ai[1] += 1f; float attackDivisor = 140f - (int)(30f * enrageScale); - float telegraphOffset = (masterMode && revenge) ? 45f : 60f; + float telegraphOffset = death ? 45f : 60f; if (!leviAlive || phase4) { attackDivisor -= (float)Math.Ceiling(50f * (1f - lifeRatio)); diff --git a/NPCs/NormalNPCs/ThiccWaifu.cs b/NPCs/NormalNPCs/CloudElemental.cs similarity index 99% rename from NPCs/NormalNPCs/ThiccWaifu.cs rename to NPCs/NormalNPCs/CloudElemental.cs index 1af0826051..11bbb3861e 100644 --- a/NPCs/NormalNPCs/ThiccWaifu.cs +++ b/NPCs/NormalNPCs/CloudElemental.cs @@ -20,7 +20,7 @@ using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.NormalNPCs { - public class ThiccWaifu : ModNPC + public class CloudElemental : ModNPC { public enum AttackState { @@ -103,7 +103,7 @@ namespace CalamityMod.NPCs.NormalNPCs { BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Sky, BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Rain, - new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.ThiccWaifu") + new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.CloudElemental") }); } diff --git a/NPCs/NormalNPCs/ThiccWaifu.png b/NPCs/NormalNPCs/CloudElemental.png similarity index 100% rename from NPCs/NormalNPCs/ThiccWaifu.png rename to NPCs/NormalNPCs/CloudElemental.png diff --git a/NPCs/NormalNPCs/ThiccWaifuAttack.png b/NPCs/NormalNPCs/CloudElementalAttack.png similarity index 100% rename from NPCs/NormalNPCs/ThiccWaifuAttack.png rename to NPCs/NormalNPCs/CloudElementalAttack.png diff --git a/NPCs/OldDuke/OldDuke.cs b/NPCs/OldDuke/OldDuke.cs index d9fd23d8cd..a0aa82aad3 100644 --- a/NPCs/OldDuke/OldDuke.cs +++ b/NPCs/OldDuke/OldDuke.cs @@ -411,7 +411,7 @@ namespace CalamityMod.NPCs.OldDuke CalamityGlobalNPC.SetNewBossJustDowned(NPC); - CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType() }, DownedBossSystem.downedBoomerDuke); + CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType() }, DownedBossSystem.downedBoomerDuke); // Mark Old Duke as dead DownedBossSystem.downedBoomerDuke = true; diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index 0f3fb7b17c..664d6123eb 100644 --- a/NPCs/SunkenSea/GiantClam.cs +++ b/NPCs/SunkenSea/GiantClam.cs @@ -525,9 +525,9 @@ namespace CalamityMod.NPCs.SunkenSea { // Spawn Amidias if he isn't in the world // This doesn't check for Desert Scourge because Giant Clam only spawns post-Desert Scourge - int amidiasNPC = NPC.FindFirstNPC(ModContent.NPCType()); + int amidiasNPC = NPC.FindFirstNPC(ModContent.NPCType()); if (amidiasNPC == -1 && Main.netMode != NetmodeID.MultiplayerClient) - NPC.NewNPC(NPC.GetSource_Death(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC(NPC.GetSource_Death(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); // Mark Giant Clam as dead DownedBossSystem.downedCLAM = true; diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 73e8d2c5f5..9b61f820d5 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -794,7 +794,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Make the town NPC spawn. if (Main.netMode != NetmodeID.MultiplayerClient) - NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y + 12, cirrus ? ModContent.NPCType() : ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y + 12, cirrus ? ModContent.NPCType() : ModContent.NPCType()); } NPC.active = false; @@ -3447,7 +3447,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Spawn the SCal NPC directly where the boss was if (!BossRushEvent.BossRushActive) - NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y + 12, cirrus ? ModContent.NPCType() : ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y + 12, cirrus ? ModContent.NPCType() : ModContent.NPCType()); // Mark Calamitas as defeated DownedBossSystem.downedCalamitas = true; diff --git a/NPCs/TownNPCs/DILF.cs b/NPCs/TownNPCs/Archmage.cs similarity index 98% rename from NPCs/TownNPCs/DILF.cs rename to NPCs/TownNPCs/Archmage.cs index d95b687593..1be98d5a41 100644 --- a/NPCs/TownNPCs/DILF.cs +++ b/NPCs/TownNPCs/Archmage.cs @@ -25,7 +25,8 @@ using Terraria.Utilities; namespace CalamityMod.NPCs.TownNPCs { [AutoloadHead] - public class DILF : ModNPC + [LegacyName("DILF")] + public class Archmage : ModNPC { public override void SetStaticDefaults() { @@ -71,7 +72,7 @@ namespace CalamityMod.NPCs.TownNPCs bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] { BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Snow, - new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.DILF") + new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.Archmage") }); } diff --git a/NPCs/TownNPCs/DILF.png b/NPCs/TownNPCs/Archmage.png similarity index 100% rename from NPCs/TownNPCs/DILF.png rename to NPCs/TownNPCs/Archmage.png diff --git a/NPCs/TownNPCs/DILF_Head.png b/NPCs/TownNPCs/Archmage_Head.png similarity index 100% rename from NPCs/TownNPCs/DILF_Head.png rename to NPCs/TownNPCs/Archmage_Head.png diff --git a/NPCs/TownNPCs/THIEF.cs b/NPCs/TownNPCs/Bandit.cs similarity index 98% rename from NPCs/TownNPCs/THIEF.cs rename to NPCs/TownNPCs/Bandit.cs index 575123f552..b102150c3c 100644 --- a/NPCs/TownNPCs/THIEF.cs +++ b/NPCs/TownNPCs/Bandit.cs @@ -24,7 +24,8 @@ using Terraria.Utilities; namespace CalamityMod.NPCs.TownNPCs { [AutoloadHead] - public class THIEF : ModNPC + [LegacyName("THIEF")] + public class Bandit : ModNPC { public static Asset AltTexture; @@ -76,7 +77,7 @@ namespace CalamityMod.NPCs.TownNPCs bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] { BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert, - new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.THIEF") + new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.Bandit") }); } @@ -156,12 +157,12 @@ namespace CalamityMod.NPCs.TownNPCs dialogue.Add(this.GetLocalizedValue("Chat.Night2")); } - int witch = NPC.FindFirstNPC(ModContent.NPCType()); + int witch = NPC.FindFirstNPC(ModContent.NPCType()); if (witch != -1) dialogue.Add(this.GetLocalization("Chat.BrimstoneWitch").Format(Main.npc[witch].GivenName)); //please help me I'm stuck in a children's video game - Fabsol - int cirrusIndex = NPC.FindFirstNPC(ModContent.NPCType()); + int cirrusIndex = NPC.FindFirstNPC(ModContent.NPCType()); if (cirrusIndex != -1) dialogue.Add(this.GetLocalization("Chat.DrunkPrincess").Format(Main.npc[cirrusIndex].GivenName)); diff --git a/NPCs/TownNPCs/THIEF.png b/NPCs/TownNPCs/Bandit.png similarity index 100% rename from NPCs/TownNPCs/THIEF.png rename to NPCs/TownNPCs/Bandit.png diff --git a/NPCs/TownNPCs/THIEFAlt.png b/NPCs/TownNPCs/BanditAlt.png similarity index 100% rename from NPCs/TownNPCs/THIEFAlt.png rename to NPCs/TownNPCs/BanditAlt.png diff --git a/NPCs/TownNPCs/THIEF_Head.png b/NPCs/TownNPCs/Bandit_Head.png similarity index 100% rename from NPCs/TownNPCs/THIEF_Head.png rename to NPCs/TownNPCs/Bandit_Head.png diff --git a/NPCs/TownNPCs/WITCH.cs b/NPCs/TownNPCs/BrimstoneWitch.cs similarity index 99% rename from NPCs/TownNPCs/WITCH.cs rename to NPCs/TownNPCs/BrimstoneWitch.cs index bf23526d8f..29717bcce1 100644 --- a/NPCs/TownNPCs/WITCH.cs +++ b/NPCs/TownNPCs/BrimstoneWitch.cs @@ -22,7 +22,8 @@ using SCalBoss = CalamityMod.NPCs.SupremeCalamitas.SupremeCalamitas; namespace CalamityMod.NPCs.TownNPCs { [AutoloadHead] - public class WITCH : ModNPC + [LegacyName("WITCH")] + public class BrimstoneWitch : ModNPC { public override void SetStaticDefaults() { @@ -71,7 +72,7 @@ namespace CalamityMod.NPCs.TownNPCs bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] { BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.WITCH") + new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.BrimstoneWitch") }); } @@ -672,11 +673,11 @@ namespace CalamityMod.NPCs.TownNPCs } } - int fab = NPC.FindFirstNPC(NPCType()); - if (fab != -1 && ChildSafety.Disabled) - dialogue.Add(this.GetLocalization("Chat.DrunkPrincess").Format(Main.npc[fab].GivenName), 1.45); + int cirrus = NPC.FindFirstNPC(NPCType()); + if (cirrus != -1 && ChildSafety.Disabled) + dialogue.Add(this.GetLocalization("Chat.DrunkPrincess").Format(Main.npc[cirrus].GivenName), 1.45); - if (NPC.AnyNPCs(NPCType())) + if (NPC.AnyNPCs(NPCType())) dialogue.Add(this.GetLocalizedValue("Chat.SeaKing"), 1.45); if (BirthdayParty.PartyIsUp) diff --git a/NPCs/TownNPCs/WITCH.png b/NPCs/TownNPCs/BrimstoneWitch.png similarity index 100% rename from NPCs/TownNPCs/WITCH.png rename to NPCs/TownNPCs/BrimstoneWitch.png diff --git a/NPCs/TownNPCs/WITCH_Head.png b/NPCs/TownNPCs/BrimstoneWitch_Head.png similarity index 100% rename from NPCs/TownNPCs/WITCH_Head.png rename to NPCs/TownNPCs/BrimstoneWitch_Head.png diff --git a/NPCs/TownNPCs/FAP.cs b/NPCs/TownNPCs/Cirrus.cs similarity index 94% rename from NPCs/TownNPCs/FAP.cs rename to NPCs/TownNPCs/Cirrus.cs index 8c4f00cfe8..4b0de8366a 100644 --- a/NPCs/TownNPCs/FAP.cs +++ b/NPCs/TownNPCs/Cirrus.cs @@ -28,7 +28,8 @@ using Terraria.Utilities; namespace CalamityMod.NPCs.TownNPCs { [AutoloadHead] - public class FAP : ModNPC + [LegacyName("FAP")] + public class Cirrus : ModNPC { public static Asset AltTexture; @@ -42,6 +43,7 @@ namespace CalamityMod.NPCs.TownNPCs NPCID.Sets.AttackTime[Type] = 60; NPCID.Sets.AttackAverageChance[Type] = 15; NPCID.Sets.ShimmerTownTransform[Type] = false; + // Happiness is so fucking dogshit, I swear to christ. - Fabsol NPC.Happiness .SetBiomeAffection(AffectionLevel.Love) .SetBiomeAffection(AffectionLevel.Like) @@ -49,7 +51,7 @@ namespace CalamityMod.NPCs.TownNPCs .SetBiomeAffection(AffectionLevel.Hate) .SetNPCAffection(NPCID.Stylist, AffectionLevel.Love) .SetNPCAffection(NPCID.BestiaryGirl, AffectionLevel.Love) - .SetNPCAffection(NPCID.Truffle, AffectionLevel.Like) + .SetNPCAffection(NPCID.DyeTrader, AffectionLevel.Like) .SetNPCAffection(NPCID.PartyGirl, AffectionLevel.Like) .SetNPCAffection(NPCID.DD2Bartender, AffectionLevel.Dislike) .SetNPCAffection(NPCID.TaxCollector, AffectionLevel.Dislike) @@ -87,7 +89,7 @@ namespace CalamityMod.NPCs.TownNPCs bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] { BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheHallow, - new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.FAP") + new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.Cirrus") }); } @@ -650,6 +652,17 @@ namespace CalamityMod.NPCs.TownNPCs CalamityWorld.spawnedCirrus = true; } + // I'm not sure what to do here, because she's always called Cirrus. - Fabsol + /*public override void ModifyTypeName(ref string typeName) + { + int wife = NPC.FindFirstNPC(NPCID.Stylist); + bool wifeIsAround = wife != -1; + bool beLessDrunk = wifeIsAround && NPC.downedMoonlord; + + if (beLessDrunk) + typeName = "Cirrus"; + }*/ + public override bool CanTownNPCSpawn(int numTownNPCs) { if (NPC.AnyNPCs(ModContent.NPCType()) && Main.zenithWorld) @@ -680,8 +693,15 @@ namespace CalamityMod.NPCs.TownNPCs SoundEngine.PlaySound(CnidarianJellyfishOnTheString.SlapSound, player.Center); } + bool worldIsSafer = NPC.downedMoonlord; + if (CalamityUtils.AnyBossNPCS()) - return this.GetLocalizedValue("Chat.BossAlive"); + { + if (!worldIsSafer) + return this.GetLocalizedValue("Chat.BossAlive"); + else + return this.GetLocalizedValue("Chat.BossAliveAlt"); + } if (NPC.homeless) return this.GetLocalizedValue("Chat.Homeless" + Main.rand.Next(1, 2 + 1)); @@ -690,7 +710,6 @@ namespace CalamityMod.NPCs.TownNPCs bool isHappy = Main.ShopHelper.GetShoppingSettings(player, NPC).PriceAdjustment < 1D; bool wifeIsAround = wife != -1; bool wifeIsHappy = wifeIsAround ? Main.ShopHelper.GetShoppingSettings(player, Main.npc[wife]).PriceAdjustment < 1D : false; - bool worldIsSafer = NPC.downedMoonlord; bool beLessDrunk = wifeIsAround && worldIsSafer; if (Main.bloodMoon) @@ -730,6 +749,8 @@ namespace CalamityMod.NPCs.TownNPCs if (ChildSafety.Disabled) dialogue.Add(this.GetLocalization("Chat.Normal4Alt").Format(Main.npc[wife].GivenName)); + + dialogue.Add(this.GetLocalizedValue("Chat.NewOutfit")); } int tavernKeep = NPC.FindFirstNPC(NPCID.DD2Bartender); @@ -742,11 +763,11 @@ namespace CalamityMod.NPCs.TownNPCs dialogue.Add(this.GetLocalizedValue("Chat.Tavernkeep3")); } - int permadong = NPC.FindFirstNPC(ModContent.NPCType()); + int permadong = NPC.FindFirstNPC(ModContent.NPCType()); if (permadong != -1) dialogue.Add(this.GetLocalization("Chat.Archmage").Format(Main.npc[permadong].GivenName)); - int witch = NPC.FindFirstNPC(ModContent.NPCType()); + int witch = NPC.FindFirstNPC(ModContent.NPCType()); if (witch != -1) dialogue.Add(this.GetLocalization("Chat.BrimstoneWitch").Format(Main.npc[witch].GivenName)); @@ -834,45 +855,65 @@ namespace CalamityMod.NPCs.TownNPCs dialogue.Add(this.GetLocalization("Chat.NightStylist").Format(Main.npc[wife].GivenName)); } + // She needs to be drunk to enjoy festive events, otherwise, she dislikes them. - Fabsol if (BirthdayParty.PartyIsUp) - dialogue.Add(this.GetLocalizedValue("Chat.Party")); + { + if (!beLessDrunk) + dialogue.Add(this.GetLocalizedValue("Chat.Party")); + else + dialogue.Add(this.GetLocalizedValue("Chat.PartyAlt")); + } + // She loves her hair and freaks out if it's threatened. Also a reference to the wicked witch of the west. - Fabsol if (AcidRainEvent.AcidRainEventIsOngoing) dialogue.Add(this.GetLocalizedValue("Chat.AcidRain")); + // ayy lmao meme reference (this isn't 4th-wall breaking enough to be put in GFB-only imo). - Fabsol if (Main.invasionType == InvasionID.MartianMadness) dialogue.Add(this.GetLocalizedValue("Chat.Martians")); + // Reference to insane thoughts I had years ago. - Fabsol if (DownedBossSystem.downedCryogen && ChildSafety.Disabled) dialogue.Add(this.GetLocalizedValue("Chat.CryogenDefeated")); + // Reference to the old Leviathan sprite. - Fabsol if (DownedBossSystem.downedLeviathan) dialogue.Add(this.GetLocalizedValue("Chat.LeviathanDefeated")); - if (NPC.downedMoonlord) + // Risque tentacle implication... - Fabsol + if (NPC.downedMoonlord && ChildSafety.Disabled) dialogue.Add(this.GetLocalizedValue("Chat.MoonLordDefeated")); + // Reference to some crazy shit I thought up at one point. - Fabsol if (DownedBossSystem.downedPolterghast) dialogue.Add(this.GetLocalizedValue("Chat.PolterghastDefeated")); - if (DownedBossSystem.downedDoG) + // MGS2 meme line. - Fabsol + if (DownedBossSystem.downedDoG && Main.zenithWorld) dialogue.Add(this.GetLocalizedValue("Chat.DoGDefeated")); + // Cirrus doesn't like the creature. - Fabsol if (player.Calamity().chibii) - dialogue.Add(this.GetLocalizedValue("Chat.HasChibii")); + { + if (!isHappy) + dialogue.Add(this.GetLocalizedValue("Chat.HasChibii")); + else + dialogue.Add(this.GetLocalizedValue("Chat.HasChibiiAlt")); + } - if (player.Calamity().aquaticHeart && !player.Calamity().aquaticHeartHide && ChildSafety.Disabled) + // She likes fish people (including Amidias, but she has no comments for him yet). - Fabsol + if (player.Calamity().aquaticHeart && !player.Calamity().aquaticHeartHide && ChildSafety.Disabled && isHappy) dialogue.Add(this.GetLocalizedValue("Chat.HasAnahitaTrans")); if (player.Calamity().cirrusVodka) dialogue.Add(this.GetLocalizedValue("Chat.HasVodka")); - if (player.HasItem(ModContent.ItemType())) + // These are all a bit too risque for children to be seeing lol - Fabsol + if (player.HasItem(ModContent.ItemType()) && ChildSafety.Disabled) { dialogue.Add(this.GetLocalizedValue("Chat.HasAlicorn1")); dialogue.Add(this.GetLocalizedValue("Chat.HasAlicorn2")); - if (ChildSafety.Disabled) - dialogue.Add(this.GetLocalizedValue("Chat.HasAlicorn3")); + dialogue.Add(this.GetLocalizedValue("Chat.HasAlicorn3")); } return dialogue; diff --git a/NPCs/TownNPCs/FAP.png b/NPCs/TownNPCs/Cirrus.png similarity index 100% rename from NPCs/TownNPCs/FAP.png rename to NPCs/TownNPCs/Cirrus.png diff --git a/NPCs/TownNPCs/FAPAlt.png b/NPCs/TownNPCs/CirrusAlt.png similarity index 100% rename from NPCs/TownNPCs/FAPAlt.png rename to NPCs/TownNPCs/CirrusAlt.png diff --git a/NPCs/TownNPCs/FAPShimmered_Head.png b/NPCs/TownNPCs/CirrusShimmered_Head.png similarity index 100% rename from NPCs/TownNPCs/FAPShimmered_Head.png rename to NPCs/TownNPCs/CirrusShimmered_Head.png diff --git a/NPCs/TownNPCs/FAP_Head.png b/NPCs/TownNPCs/Cirrus_Head.png similarity index 100% rename from NPCs/TownNPCs/FAP_Head.png rename to NPCs/TownNPCs/Cirrus_Head.png diff --git a/NPCs/TownNPCs/FAP_Shimmered.png b/NPCs/TownNPCs/Cirrus_Shimmered.png similarity index 100% rename from NPCs/TownNPCs/FAP_Shimmered.png rename to NPCs/TownNPCs/Cirrus_Shimmered.png diff --git a/NPCs/TownNPCs/SEAHOE.cs b/NPCs/TownNPCs/SeaKing.cs similarity index 97% rename from NPCs/TownNPCs/SEAHOE.cs rename to NPCs/TownNPCs/SeaKing.cs index de394643ba..9e2c6cd3e8 100644 --- a/NPCs/TownNPCs/SEAHOE.cs +++ b/NPCs/TownNPCs/SeaKing.cs @@ -20,7 +20,8 @@ using Terraria.Utilities; namespace CalamityMod.NPCs.TownNPCs { [AutoloadHead] - public class SEAHOE : ModNPC + [LegacyName("SEAHOE")] + public class SeaKing : ModNPC { public override void SetStaticDefaults() { @@ -67,7 +68,7 @@ namespace CalamityMod.NPCs.TownNPCs bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] { BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean, - new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.SEAHOE") + new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.SeaKing") }); } @@ -109,11 +110,11 @@ namespace CalamityMod.NPCs.TownNPCs dialogue.Add(this.GetLocalization("Chat.Angler2").Format(Main.npc[lilBitch].GivenName)); } - int witch = NPC.FindFirstNPC(ModContent.NPCType()); + int witch = NPC.FindFirstNPC(ModContent.NPCType()); if (witch != -1) dialogue.Add(this.GetLocalizedValue("Chat.BrimstoneWitch")); - int cirrus = NPC.FindFirstNPC(ModContent.NPCType()); + int cirrus = NPC.FindFirstNPC(ModContent.NPCType()); if (cirrus != -1) dialogue.Add(this.GetLocalization("Chat.DrunkPrincess").Format(Main.npc[cirrus].GivenName)); diff --git a/NPCs/TownNPCs/SEAHOE.png b/NPCs/TownNPCs/SeaKing.png similarity index 100% rename from NPCs/TownNPCs/SEAHOE.png rename to NPCs/TownNPCs/SeaKing.png diff --git a/NPCs/TownNPCs/SEAHOE_Head.png b/NPCs/TownNPCs/SeaKing_Head.png similarity index 100% rename from NPCs/TownNPCs/SEAHOE_Head.png rename to NPCs/TownNPCs/SeaKing_Head.png diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs index f239af92eb..e458db81c1 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs @@ -22,7 +22,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses NPC.crimsonBoss = npc.whoAmI; bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Get a target @@ -43,7 +42,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (tile.WallType == WallID.CrimstoneUnsafe) enrage = false; - float enrageScale = bossRush ? 1.5f : masterMode ? 0.5f : 0f; + float enrageScale = bossRush ? 1.5f : death ? 0.5f : 0f; if (((npc.position.Y / 16f) < Main.worldSurface && enrage) || bossRush) { npc.Calamity().CurrentlyEnraged = !bossRush; @@ -153,19 +152,19 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool phase7 = lifeRatio < 0.1f; // Spawn Creepers in Master Mode - if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] == 1f && masterMode && phase3) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] == 1f && death && phase3) { npc.localAI[0] = 2f; SpawnMasterModeCreepers(); } - if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] == 2f && masterMode && phase5) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] == 2f && death && phase5) { npc.localAI[0] = 3f; SpawnMasterModeCreepers(); } - if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] == 3f && masterMode && phase7) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] == 3f && death && phase7) { npc.localAI[0] = 4f; SpawnMasterModeCreepers(); @@ -237,20 +236,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { float velocityScale = death ? 6f : 4.5f; float velocityBoost = velocityScale * (1f - lifeRatio); - float nonChargeSpeed = (masterMode ? 24f : 18f) + velocityBoost + 3f * enrageScale; + float nonChargeSpeed = (death ? 24f : 18f) + velocityBoost + 3f * enrageScale; if (Main.getGoodWorld) nonChargeSpeed *= 1.15f; - float minInertia = death ? 60f : 75f; - float maxInertia = death ? 80f : 100f; - if (masterMode) - { - minInertia -= 10f; - maxInertia -= 10f; - } + float minInertia = death ? 50f : 75f; + float maxInertia = death ? 70f : 100f; float inertia = MathHelper.Lerp(minInertia, maxInertia, lifeRatio); - Vector2 destination = Main.player[npc.target].Center + (masterMode ? Main.player[npc.target].velocity * 20f * enrageScale : Vector2.Zero); + Vector2 destination = Main.player[npc.target].Center + (death ? Main.player[npc.target].velocity * 20f * enrageScale : Vector2.Zero); Vector2 idealVelocity = (destination - npc.Center).SafeNormalize(Vector2.UnitY) * nonChargeSpeed; npc.velocity = (npc.velocity * (inertia - 1f) + idealVelocity) / inertia; } @@ -296,7 +290,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses SoundEngine.PlaySound(SoundID.ForceRoarPitched, npc.Center); // Velocity - npc.velocity = (Main.player[npc.target].Center + (masterMode ? Main.player[npc.target].velocity * 20f * enrageScale : Vector2.Zero) - npc.Center).SafeNormalize(Vector2.UnitY) * chargeVelocity; + npc.velocity = (Main.player[npc.target].Center + (death ? Main.player[npc.target].velocity * 20f * enrageScale : Vector2.Zero) - npc.Center).SafeNormalize(Vector2.UnitY) * chargeVelocity; if (Main.getGoodWorld) npc.velocity *= 1.15f; } @@ -340,7 +334,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.ai[2] -= 1f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * (-chargeVelocity - 2f * enrageScale); - if (masterMode) + if (death) npc.velocity *= 1.5f; if (Main.getGoodWorld) npc.velocity *= 1.15f; @@ -430,23 +424,17 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { int type = ProjectileID.BloodShot; int damage = npc.GetProjectileDamage(type); - int numProj = death ? 6 : 4; - int spread = death ? 22 : 15; + int numProj = death ? 9 : 4; + int spread = death ? 32 : 15; if (phase7) { - numProj = death ? 4 : 2; - spread = death ? 15 : 10; + numProj = death ? 7 : 2; + spread = death ? 25 : 10; } else if (phase5) { - numProj = death ? 5 : 3; - spread = death ? 30 : 20; - } - - if (masterMode) - { - numProj += 3; - spread += 10; + numProj = death ? 8 : 3; + spread = death ? 40 : 20; } float rotation = MathHelper.ToRadians(spread); @@ -469,28 +457,22 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { int type = ProjectileID.BloodNautilusShot; int damage = npc.GetProjectileDamage(type); - int numProj = death ? 9 : 7; - int spread = death ? 45 : 40; + int numProj = death ? 13 : 7; + int spread = death ? 60 : 40; if (phase7) { - numProj = death ? 3 : 2; - spread = death ? 8 : 5; + numProj = death ? 7 : 2; + spread = death ? 23 : 5; } else if (phase5) { - numProj = death ? 4 : 2; - spread = death ? 15 : 10; + numProj = death ? 8 : 2; + spread = death ? 30 : 10; } else if (phase4) { - numProj = death ? 5 : 3; - spread = death ? 15 : 10; - } - - if (masterMode) - { - numProj += 4; - spread += 15; + numProj = death ? 9 : 3; + spread = death ? 30 : 10; } float rotation = MathHelper.ToRadians(spread); @@ -535,7 +517,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = playerLocation < 0 ? 1f : -1f; npc.ai[2] = 0f; - int maxRandomTime = phase7 ? (masterMode ? 10 : 30) : (masterMode ? 20 : 60); + int maxRandomTime = phase7 ? (death ? 10 : 30) : (death ? 20 : 60); npc.ai[3] = Main.rand.Next(maxRandomTime) + 1; npc.localAI[1] = 0f; npc.alpha = 0; @@ -687,7 +669,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = playerLocation < 0 ? 1f : -1f; npc.ai[2] = 0f; - int maxRandomTime = phase7 ? (masterMode ? 10 : 30) : (masterMode ? 20 : 60); + int maxRandomTime = phase7 ? (death ? 10 : 30) : (death ? 20 : 60); npc.ai[3] = Main.rand.Next(maxRandomTime) + 1; } else @@ -744,7 +726,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float targetXDistPhase1 = Main.player[npc.target].Center.X - brainCenterPhase1.X; float targetYDistPhase1 = Main.player[npc.target].Center.Y - brainCenterPhase1.Y; float targetDistancePhase1 = (float)Math.Sqrt(targetXDistPhase1 * targetXDistPhase1 + targetYDistPhase1 * targetYDistPhase1); - float maxMoveVelocity = (death ? (masterMode ? 4f : 2f) : (masterMode ? 3f : 1.5f)) + velocityScale; + float maxMoveVelocity = (death ? 4f : 1.5f) + velocityScale; if (Main.getGoodWorld) maxMoveVelocity *= 2f; @@ -769,7 +751,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!despawn) npc.localAI[1] += (death ? 2f : 1f) + velocityScale; - if (npc.localAI[1] >= (masterMode ? 540f : 360f)) + if (npc.localAI[1] >= (death ? 540f : 360f)) { // Teleport location npc.localAI[1] = 0f; @@ -877,7 +859,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Get a target @@ -885,7 +866,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityUtils.CalamityTargeting(npc, default); float enrageScaleMax = 2f; - float enrageScale = bossRush ? enrageScaleMax : masterMode ? 0.5f : 0f; + float enrageScale = bossRush ? enrageScaleMax : death ? 0.5f : 0f; if ((npc.position.Y / 16f) < Main.worldSurface) enrageScale += 0.5f; if (!Main.player[npc.target].ZoneCrimson) @@ -903,7 +884,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses creeperCount = GetBrainOfCthuluCreepersCountRevDeath(); float creeperRatio = 1f; - if (masterMode && brainIsInPhase2) + if (death && brainIsInPhase2) { bool brainIsInPhase3 = Main.npc[NPC.crimsonBoss].localAI[0] == 2f; bool brainIsInPhase5 = Main.npc[NPC.crimsonBoss].localAI[0] == 3f; @@ -948,7 +929,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float brainXDist = Main.npc[NPC.crimsonBoss].Center.X - creeperCenter.X; float brainYDist = Main.npc[NPC.crimsonBoss].Center.Y - creeperCenter.Y; float brainDistance = (float)Math.Sqrt(brainXDist * brainXDist + brainYDist * brainYDist); - float velocity = (death ? (masterMode ? 16f : 12f) : (masterMode ? 12f : 8f)) + chargeAggressionScale; + float velocity = (death ? 16f : 8f) + chargeAggressionScale; velocity += 2f * enrageScale; if (brainIsInPhase2) { @@ -1004,7 +985,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Always fully visible while charging npc.alpha = 0; - float chargeVelocity = (death ? (masterMode ? 12f : 9f) : (masterMode ? 9f : 6f)) + chargeAggressionScale; + float chargeVelocity = (death ? 12f : 6f) + chargeAggressionScale; chargeVelocity += 2f * enrageScale; float returnToBrainGateValue = 1f; if (!brainIsInPhase2) @@ -1012,7 +993,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - Vector2 destination = Main.player[npc.target].Center + (masterMode ? Main.player[npc.target].velocity * 20f : Vector2.Zero); + Vector2 destination = Main.player[npc.target].Center + (death ? Main.player[npc.target].velocity * 20f : Vector2.Zero); Vector2 targetDirection = destination - npc.Center; targetDirection = targetDirection.SafeNormalize(Vector2.UnitY); if (Main.getGoodWorld) @@ -1023,12 +1004,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else { targetDirection *= chargeVelocity; - float inertia = masterMode ? 75f : 100f; + float inertia = death ? 75f : 100f; npc.velocity = (npc.velocity * (inertia - 1f) + targetDirection) / inertia; } // Return to Brain after a set time - float chargeDistance = masterMode ? 900f : 600f; + float chargeDistance = death ? 900f : 600f; returnToBrainGateValue = chargeDistance / chargeVelocity; } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs index f37fe91619..2e195a2c06 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs @@ -36,15 +36,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phases bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; - bool phase2 = lifeRatio < 0.85f || masterMode; - bool phase3 = lifeRatio < 0.7f || masterMode; - bool phase4 = lifeRatio < (masterMode ? 0.8f : 0.55f); - bool phase5 = lifeRatio < (masterMode ? 0.6f : 0.4f); - bool phase6 = lifeRatio < (masterMode ? 0.4f : 0.25f); - bool phase7 = masterMode && lifeRatio < 0.2f; - bool phase8 = masterMode && lifeRatio < 0.1f; + bool phase2 = lifeRatio < 0.85f || death; + bool phase3 = lifeRatio < 0.7f || death; + bool phase4 = lifeRatio < (death ? 0.8f : 0.55f); + bool phase5 = lifeRatio < (death ? 0.6f : 0.4f); + bool phase6 = lifeRatio < (death ? 0.4f : 0.25f); + bool phase7 = death && lifeRatio < 0.2f; + bool phase8 = death && lifeRatio < 0.1f; // Variables bool isCultist = npc.type == NPCID.CultistBoss; @@ -52,7 +51,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float predictionDistance = 480f; float distanceAboveTarget = -240f; - float moveSpeed = masterMode ? (death ? 300f : 150f) : (death ? 100f : 75f); + float moveSpeed = death ? 300f : 75f; int iceMistDamage = isCultist ? npc.GetProjectileDamage(ProjectileID.CultistBossIceMist) : 0; int fireballDamage = isCultist ? npc.GetProjectileDamage(ProjectileID.CultistBossFireBall) : npc.GetProjectileDamage(ProjectileID.CultistBossFireBallClone); @@ -61,9 +60,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int iceMistFireRate = phase2 ? 50 : 60; float iceMistSpeed = (phase6 ? 12f : 10f) + (death ? (1f - lifeRatio) : 0f); int iceMistAmt = phase3 ? 2 : 1; - int fireballFireRate = (phase5 ? 10 : 12) - (masterMode ? 6 : 0); + int fireballFireRate = (phase5 ? 10 : 12) - (death ? 6 : 0); float fireballSpeed = ((phase7 ? 8f : phase6 ? 7f : 6f) + (death ? (1f - lifeRatio) : 0f)) * (isCultist ? 1f : 0.5f); - int fireballAmt = masterMode ? 20 : 4; + int fireballAmt = death ? 20 : 4; int lightningOrbPhaseTime = phase2 ? 90 : 120; int ancientLightSpawnRate = phase7 ? 20 : phase4 ? 25 : 30; int ancientLightAmt = phase7 ? 4 : phase4 ? 3 : 2; @@ -607,8 +606,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Projectile.NewProjectile(npc.GetSource_FromAI(), shadowFireballDirection, shadowFireballVelocity, ProjectileID.CultistBossFireBallClone, fireballDamage, 0f, Main.myPlayer); } - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y + (masterMode ? 210f : -100f), 0f, 0f, ProjectileID.CultistBossLightningOrb, lightningDamage, 0f, Main.myPlayer); - if (masterMode) + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y + (death ? 210f : -100f), 0f, 0f, ProjectileID.CultistBossLightningOrb, lightningDamage, 0f, Main.myPlayer); + if (death) { Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + 210f, npc.Center.Y - 210f, 0f, 0f, ProjectileID.CultistBossLightningOrb, lightningDamage, 0f, Main.myPlayer); Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X - 210f, npc.Center.Y - 210f, 0f, 0f, ProjectileID.CultistBossLightningOrb, lightningDamage, 0f, Main.myPlayer); @@ -1103,12 +1102,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static bool BuffedAncientDoomAI(NPC npc, Mod mod) { bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; npc.damage = npc.defDamage = 0; float duration = 420f; float spawnAnimTime = 120f; - int rateOfChange = masterMode ? 2 : 1; + int rateOfChange = death ? 2 : 1; float splitProjVelocity = death ? 4.5f : 3f; // Percent life remaining for Cultist or Eidolon Wyrm @@ -1212,7 +1210,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses kill = true; if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalProjectiles = CalamityWorld.LegendaryMode ? 9 : (Main.npc[(int)npc.ai[0]].type == NPCID.CultistBoss && !phase3) ? 8 : masterMode ? 5 : 4; + int totalProjectiles = CalamityWorld.LegendaryMode ? 9 : (Main.npc[(int)npc.ai[0]].type == NPCID.CultistBoss && !phase3) ? 8 : death ? 5 : 4; float radians = MathHelper.TwoPi / totalProjectiles; Vector2 spinningPoint = new Vector2(0f, -splitProjVelocity); for (int k = 0; k < totalProjectiles; k++) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs index f89cc0576c..e981b3ac3c 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs @@ -35,7 +35,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Difficulty bools bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Projectile types and damage @@ -267,8 +266,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[1] >= (float)scoopRubbleGateValue) { Point sourceTileCoords = npc.Top.ToTileCoordinates(); - int numRubble = death ? (masterMode ? 60 : 40) : (masterMode ? 32 : 20); - int distancedByThisManyTiles = death ? (masterMode ? 3 : 4) : (masterMode ? 4 : 5); + int numRubble = death ? 60 : 20; + int distancedByThisManyTiles = death ? 3 : 5; sourceTileCoords.X += npc.direction * 3; sourceTileCoords.Y -= 10; int screenShakeGateValue = (int)npc.ai[1] - scoopRubbleGateValue; @@ -315,11 +314,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.TargetClosest(); if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalProjectiles = (masterMode ? 7 : 5) + (int)MathHelper.Lerp(0f, 11f, 1f - lifeRatio); + int totalProjectiles = (death ? 7 : 5) + (int)MathHelper.Lerp(0f, 11f, 1f - lifeRatio); float velocityMultIncrement = ((totalProjectiles + 1) / (float)totalProjectiles) - 1f; - float randomRadialOffset = MathHelper.ToRadians(MathHelper.Lerp(0f, masterMode ? 270f : 180f, 1f - lifeRatio)); + float randomRadialOffset = MathHelper.ToRadians(MathHelper.Lerp(0f, death ? 270f : 180f, 1f - lifeRatio)); float radians = MathHelper.TwoPi / totalProjectiles + randomRadialOffset; - float velocity = (masterMode ? 9f : 7f) + MathHelper.Lerp(0f, 3.5f, 1f - lifeRatio); + float velocity = (death ? 9f : 7f) + MathHelper.Lerp(0f, 3.5f, 1f - lifeRatio); Vector2 spinningPoint = new Vector2(0f, -velocity); for (int k = 0; k < totalProjectiles; k++) { @@ -376,7 +375,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.TargetClosest(); if (Main.netMode != NetmodeID.MultiplayerClient) { - int handAmount = (int)MathHelper.Lerp(masterMode ? 5f : 3f, masterMode ? 12f : 10f, 1f - lifeRatio); + int handAmount = (int)MathHelper.Lerp(death ? 5f : 3f, death ? 12f : 10f, 1f - lifeRatio); for (int i = 0; i < handAmount; i++) { RandomizeInsanityShadowFor(Main.player[npc.target], death, isHostile: true, out var spawnposition, out var spawnvelocity, out var ai, out var ai2); diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs index 60cacab362..2d1b34725c 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs @@ -68,7 +68,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = calamityGlobalNPC.newAI[1] < DRIncreaseTime; @@ -77,8 +76,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float lifeRatio = npc.life / (float)npc.lifeMax; // Phases based on life percentage - bool phase2 = lifeRatio < 0.85f || masterMode; - bool phase3 = lifeRatio < 0.7f || masterMode; + bool phase2 = lifeRatio < 0.85f || death; + bool phase3 = lifeRatio < 0.7f || death; bool startFlightPhase = lifeRatio < 0.5f; bool phase4 = lifeRatio < (death ? 0.4f : 0.25f); bool phase5 = lifeRatio < (death ? 0.2f : 0.1f); @@ -182,7 +181,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else { - if (masterMode && !bossRush && npc.localAI[3] == 1f) + if (death && !bossRush && npc.localAI[3] == 1f) { for (int i = 0; i < Main.maxNPCs; i++) { @@ -215,14 +214,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool spitLaserSpreads = death; // Height of the box used to calculate whether The Destroyer should fly at its target or not - int noFlyZoneBoxHeight = masterMode ? 1500 : 1800; + int noFlyZoneBoxHeight = death ? 1500 : 1800; // Speed and movement variables - float speed = masterMode ? 0.2f : 0.1f; - float turnSpeed = masterMode ? 0.3f : 0.15f; + float speed = death ? 0.2f : 0.1f; + float turnSpeed = death ? 0.3f : 0.15f; // Max velocity - float segmentVelocity = flyAtTarget ? (masterMode ? 22.5f : 15f) : (masterMode ? 30f : 20f); + float segmentVelocity = flyAtTarget ? (death ? 22.5f : 15f) : (death ? 30f : 20f); // Increase velocity based on distance float velocityMultiplier = increaseSpeedMore ? 2f : increaseSpeed ? 1.5f : 1f; @@ -290,7 +289,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Regenerate Probes in Master Mode if the number of Probes is less than 40 and the number of living NPCs is less than the segment count + 40 (this limit is here just in case) // This doesn't happen if Oblivion is alive - if (masterMode && probeLaunched && !oblivionAlive) + if (death && probeLaunched && !oblivionAlive) { npc.localAI[2] += 1f; if (npc.localAI[2] >= 600f) @@ -410,8 +409,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 projectileVelocity = (player.Center - npc.Center).SafeNormalize(Vector2.UnitY) * velocity; - int numProj = calamityGlobalNPC.newAI[0] % 60f == 0f ? (masterMode ? 9 : 7) : (masterMode ? 6 : 4); - int spread = masterMode ? 38 : 26; + int numProj = calamityGlobalNPC.newAI[0] % 60f == 0f ? (death ? 9 : 7) : (death ? 6 : 4); + int spread = death ? 38 : 26; float rotation = MathHelper.ToRadians(spread); for (int i = 0; i < numProj; i++) { @@ -442,7 +441,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set laser color and type if (calamityGlobalNPC.destroyerLaserColor == -1 && !probeLaunched) { - if (Main.rand.NextBool(masterMode ? OneInXChanceToFireLaser / (phase5 ? 4 : phase4 ? 3 : 2) : OneInXChanceToFireLaser)) + if (Main.rand.NextBool(death ? OneInXChanceToFireLaser / (phase5 ? 4 : phase4 ? 3 : 2) : OneInXChanceToFireLaser)) { int random = phase3 ? 4 : phase2 ? 3 : 2; switch (Main.rand.Next(random)) @@ -473,8 +472,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Laser rate of fire - float shootProjectileTime = death ? (masterMode ? (phase5 ? 120f : phase4 ? 150f : 180f) : 270f) : (masterMode ? (phase5 ? 150f : phase4 ? 210f : 270f) : 450f); - float bodySegmentTime = npc.ai[0] * (masterMode ? 20f : 30f); + float shootProjectileTime = death ? (phase5 ? 120f : phase4 ? 150f : 180f) : 450f; + float bodySegmentTime = npc.ai[0] * (death ? 20f : 30f); float shootProjectileGateValue = bodySegmentTime + shootProjectileTime; float laserTimerIncrement = (calamityGlobalNPC.newAI[0] > shootProjectileGateValue - LaserTelegraphTime) ? 1f : 2f; if (ableToFireLaser) @@ -528,7 +527,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Shoot nothing if probe has been launched if (calamityGlobalNPC.newAI[0] >= shootProjectileGateValue && ableToFireLaser) { - if (!masterMode) + if (!death) { int numProbeSegments = 0; for (int i = 0; i < Main.maxNPCs; i++) @@ -545,7 +544,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) { - if (masterMode) + if (death) { int numProbeSegments = 0; for (int i = 0; i < Main.maxNPCs; i++) @@ -561,7 +560,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Laser speed - float projectileSpeed = (masterMode ? 4.5f : 3.5f) + Main.rand.NextFloat() * 1.5f; + float projectileSpeed = (death ? 4.5f : 3.5f) + Main.rand.NextFloat() * 1.5f; projectileSpeed += enrageScale; // Set projectile damage and type @@ -607,14 +606,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.netUpdate = true; - if (masterMode) + if (death) { calamityGlobalNPC.destroyerLaserColor = -1; npc.SyncDestroyerLaserColor(); } } - if (!masterMode) + if (!death) { calamityGlobalNPC.destroyerLaserColor = -1; npc.SyncDestroyerLaserColor(); @@ -846,7 +845,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!shouldFly) { npc.velocity.Y += 0.15f; - if (masterMode && npc.velocity.Y > 0f && Math.Abs(npc.Center.Y - player.Center.Y) > 360f) + if (death && npc.velocity.Y > 0f && Math.Abs(npc.Center.Y - player.Center.Y) > 360f) npc.velocity.Y += 0.05f; if (npc.velocity.Y > segmentVelocity) @@ -1037,7 +1036,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Force the fucker to turn around in ground phase in Master // Turns slower if Oblivion is alive, for fairness - if (npc.type == NPCID.TheDestroyer && masterMode && !flyAtTarget) + if (npc.type == NPCID.TheDestroyer && death && !flyAtTarget) { if (npc.Distance(player.Center) > 2000f) npc.velocity += (player.Center - npc.Center).SafeNormalize(Vector2.UnitY) * (oblivionAlive ? speed : turnSpeed); @@ -1742,7 +1741,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static bool BuffedProbeAI(NPC npc, Mod mod) { bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; + bool death = CalamityWorld.death || bossRush; bool oblivionAlive = npc.ai[1] == 1f; // Get a target @@ -1754,8 +1753,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (targetData.Type == NPCTargetType.Player) targetDead = Main.player[npc.target].dead; - float velocity = bossRush ? 12f : masterMode ? 8.4f : 7.2f; - float acceleration = bossRush ? 0.1f : masterMode ? 0.07f : 0.06f; + float velocity = bossRush ? 12f : death ? 8.4f : 7.2f; + float acceleration = bossRush ? 0.1f : death ? 0.07f : 0.06f; float deceleration = 1f - acceleration; if (targetDead) @@ -1785,7 +1784,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int i = 0; i < Main.maxNPCs; i++) { - if (masterMode && !bossRush && npc.ai[1] == 0f) + if (death && !bossRush && npc.ai[1] == 0f) { if (Main.npc[i].active && (Main.npc[i].type == ModContent.NPCType() || Main.npc[i].type == NPCID.SkeletronPrime)) npc.ai[1] = 1f; @@ -1860,7 +1859,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.dontTakeDamage = false; npc.localAI[0] += 1f; - if ((npc.justHit && !masterMode) || targetDead) + if ((npc.justHit && !death) || targetDead) npc.localAI[0] = 0f; float laserGateValue = NPC.IsMechQueenUp ? ProbeLaserGateValue_Mechdusa : bossRush ? ProbeLaserGateValue_BossRush : ProbeLaserGateValue_Rev; @@ -1883,7 +1882,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses damage = (int)(damage * secondMechMultiplier); } - int totalProjectiles = oblivionAlive ? 2 : (CalamityWorld.death || bossRush) ? 3 : 1; + int totalProjectiles = oblivionAlive ? 2 : death ? 3 : 1; Vector2 projectileVelocity = (targetData.Center - npc.Center).SafeNormalize(Vector2.UnitY) * velocity; if (NPC.IsMechQueenUp) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs index 35155e34b6..744526387f 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs @@ -20,12 +20,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Variables bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; - bool masterModeSurprise = lifeRatio >= 0.9f && masterMode; - bool phase2 = lifeRatio < (masterMode ? 0.6f : 0.7f); - bool phase3 = lifeRatio < (masterMode ? 0.3f : 0.4f); - bool phase4 = lifeRatio < (masterMode ? 0.1f : 0.2f); + bool masterModeSurprise = lifeRatio >= 0.9f && death; + bool phase2 = lifeRatio < (death ? 0.6f : 0.7f); + bool phase3 = lifeRatio < (death ? 0.3f : 0.4f); + bool phase4 = lifeRatio < (death ? 0.1f : 0.2f); bool phase2AI = npc.ai[0] > 4f; bool phase3AI = npc.ai[0] > 9f; bool charging = npc.ai[3] < 10f; @@ -180,7 +179,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (masterMode) + if (death) { idlePhaseTimer -= 6; idlePhaseAcceleration *= 1.2f; @@ -202,7 +201,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses calamityGlobalNPC.newAI[0] = 0f; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, Vector2.Zero, ProjectileID.SharknadoBolt, 0, 0f, Main.myPlayer, 1f, npc.target + 1, (enrage || masterMode) ? 1 : 0); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, Vector2.Zero, ProjectileID.SharknadoBolt, 0, 0f, Main.myPlayer, 1f, npc.target + 1, (enrage || death) ? 1 : 0); npc.netUpdate = true; } @@ -426,7 +425,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] = 0f; if (enrage) npc.ai[2] = sharknadoPhaseTimer - 40; - else if (masterMode) + else if (death) npc.ai[2] = sharknadoPhaseTimer - 60; } @@ -805,7 +804,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses SoundEngine.PlaySound(SoundID.Zombie20, npc.Center); if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == sharknadoPhaseTimer - 30) - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, Vector2.Zero, ProjectileID.SharknadoBolt, 0, 0f, Main.myPlayer, 1f, npc.target + 1, (enrage || masterMode) ? 1 : 0); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, Vector2.Zero, ProjectileID.SharknadoBolt, 0, 0f, Main.myPlayer, 1f, npc.target + 1, (enrage || death) ? 1 : 0); npc.ai[2] += 1f; if (npc.ai[2] >= sharknadoPhaseTimer) @@ -1024,7 +1023,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Spawn bubbles during charge in Master Mode (these bubbles have special behavior that makes them float upward, doing no damage, before returning to their normal behavior) - if (masterMode && phase4) + if (death && phase4) { if (npc.ai[2] % (bubbleBelchPhaseDivisor * 2) == 0f) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs index 0a14411d83..a246c16b25 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs @@ -21,7 +21,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Causes it to split far more in death mode @@ -70,17 +69,17 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phases // Cursed Flame phase - bool phase2 = lifeRatio < 0.8f || masterMode; + bool phase2 = lifeRatio < 0.8f || death; // Boost velocity by 20% phase - bool phase3 = lifeRatio < 0.4f || masterMode; + bool phase3 = lifeRatio < 0.4f || death; // Boost velocity by 50% phase - bool phase4 = lifeRatio < (masterMode ? 0.5f : 0.2f); + bool phase4 = lifeRatio < (death ? 0.5f : 0.2f); // Go fucking crazy in Master Mode - bool phase5 = lifeRatio < 0.1f && masterMode; - bool phase6 = lifeRatio < 0.05f && masterMode; + bool phase5 = lifeRatio < 0.1f && death; + bool phase6 = lifeRatio < 0.05f && death; // Fire projectiles if (Main.netMode != NetmodeID.MultiplayerClient) @@ -93,7 +92,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else npc.localAI[1] -= 1f; - int vileSpitGateValue = (int)MathHelper.Lerp(masterMode ? 45f : 90f, 900f, lifeRatio); + int vileSpitGateValue = (int)MathHelper.Lerp(death ? 45f : 90f, 900f, lifeRatio); if (Main.getGoodWorld) vileSpitGateValue = (int)(vileSpitGateValue * 0.5f); @@ -123,7 +122,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (phase2) { if (Collision.CanHitLine(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) - calamityGlobalNPC.newAI[0] += ((npc.justHit && masterMode && calamityGlobalNPC.newAI[0] < 30f) ? 10f : 1f); + calamityGlobalNPC.newAI[0] += ((npc.justHit && death && calamityGlobalNPC.newAI[0] < 30f) ? 10f : 1f); else calamityGlobalNPC.newAI[0] -= 1f; @@ -190,10 +189,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.type == NPCID.EaterofWorldsHead) { // Amount of segments to spawn. - int segmentSpawnAmount = (int)(masterMode ? (totalSegments / TotalMasterModeWorms) : totalSegments); + int segmentSpawnAmount = (int)(death ? (totalSegments / TotalMasterModeWorms) : totalSegments); // Spawn additional worms of reduced length in Master Mode. - if (masterMode) + if (death) { Vector2 additionalWormSpawnLocation = new Vector2(spawnX, spawnY); int randomXLimit = 80; @@ -345,12 +344,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!inTiles && npc.type == NPCID.EaterofWorldsHead) { Rectangle rectangle = new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height); - int noFlyZone = death ? 800 : 900; + int noFlyZone = death ? (800 - (phase5 ? 400 : 200)) : 900; noFlyZone -= (int)(enrageScale * 200f); - - if (masterMode) - noFlyZone -= phase5 ? 400 : 200; - if (noFlyZone < 100) noFlyZone = 100; @@ -401,7 +396,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses segmentAcceleration += 0.04f * (enrageScale + 1f); } - if (masterMode) + if (death) { segmentVelocity += (npc.justHit ? 8f : 2f); segmentAcceleration += (npc.justHit ? 0.16f : 0.04f); @@ -472,7 +467,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!inTiles) { npc.velocity.Y += death ? 0.1375f : 0.11f; - if (masterMode && npc.velocity.Y > 0f) + if (death && npc.velocity.Y > 0f) npc.velocity.Y += 0.07f; if (npc.velocity.Y > segmentVelocity) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs index 38e7b92ae5..778d63ffa4 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs @@ -18,7 +18,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Difficulty bools. bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Rotation @@ -30,8 +29,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Percent life remaining. float lifeRatio = npc.life / (float)npc.lifeMax; - float phase2LifeRatio = masterMode ? 0.7f : 0.6f; - float phase3LifeRatio = masterMode ? 0.3f : 0.15f; + float phase2LifeRatio = death ? 0.7f : 0.6f; + float phase3LifeRatio = death ? 0.3f : 0.15f; bool phase2 = npc.AI_120_HallowBoss_IsInPhase2(); bool phase3 = lifeRatio <= phase3LifeRatio; @@ -450,7 +449,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } npc.ai[1] += 1f; - extraPhaseTime = (dayTimeEnrage ? (masterMode ? 30f : 36f) : (masterMode ? 60f : 72f)) + 30f * lessTimeSpentPerPhaseMultiplier; + extraPhaseTime = (dayTimeEnrage ? (death ? 30f : 36f) : (death ? 60f : 72f)) + 30f * lessTimeSpentPerPhaseMultiplier; if (npc.ai[1] >= 60f + extraPhaseTime) { npc.ai[0] = 1f; @@ -494,7 +493,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] == 0f) SoundEngine.PlaySound(SoundID.Item162, npc.Center); - float lanceGateValue = masterMode ? 75f : 100f; + float lanceGateValue = death ? 75f : 100f; if (npc.ai[1] >= 6f && npc.ai[1] < 54f) { @@ -514,7 +513,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int i = 0; i < lanceAmount; i++) { int lanceFrequency = (int)(npc.ai[1] / (dayTimeEnrage ? 2f : 3f)); - lanceRotation += (masterMode ? 5 : 4) * i; + lanceRotation += (death ? 5 : 4) * i; Vector2 lanceDirection = Vector2.UnitX.RotatedBy((float)Math.PI / (lanceRotation * 2) + lanceFrequency * ((float)Math.PI / lanceRotation)); if (calamityGlobalNPC.newAI[3] == 0f) lanceDirection.X += (lanceDirection.X > 0f) ? 0.5f : -0.5f; @@ -651,7 +650,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (phase3) { if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(npc.GetSource_FromAI(), everlastingRainbowSpawn + spinningpoint.RotatedBy(-MathHelper.PiOver2) * 30f, spinningpoint * (masterMode ? 3f : 2f) * initialVelocity, projectileType2, projectileDamage2, 0f, Main.myPlayer, npc.target, projRotationMultiplier); + Projectile.NewProjectile(npc.GetSource_FromAI(), everlastingRainbowSpawn + spinningpoint.RotatedBy(-MathHelper.PiOver2) * 30f, spinningpoint * (death ? 3f : 2f) * initialVelocity, projectileType2, projectileDamage2, 0f, Main.myPlayer, npc.target, projRotationMultiplier); } } @@ -710,7 +709,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } npc.ai[1] += 1f; - extraPhaseTime = (dayTimeEnrage ? (masterMode ? 105f : 110f) : (masterMode ? 140f : 150f)) + 30f * lessTimeSpentPerPhaseMultiplier; // 112.5 is too little + extraPhaseTime = (dayTimeEnrage ? (death ? 105f : 110f) : (death ? 140f : 150f)) + 30f * lessTimeSpentPerPhaseMultiplier; // 112.5 is too little if (npc.ai[1] >= totalSunDancePhaseTime + extraPhaseTime) { npc.ai[0] = 1f; @@ -745,8 +744,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { SoundEngine.PlaySound(SoundID.Item162, npc.Center); - float totalProjectiles = masterMode ? 18f : 15f; - float lanceSpacing = masterMode ? 150f : 175f; + float totalProjectiles = death ? 18f : 15f; + float lanceSpacing = death ? 150f : 175f; float lanceWallSize = totalProjectiles * lanceSpacing; Vector2 lanceSpawnOffset = targetData9.Center; @@ -758,7 +757,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float lanceWallSizeMult = 1.4f; totalProjectiles += 5f; lanceSpacing += 50f; - lanceWallSize *= (masterMode ? 0.75f : 0.5f); + lanceWallSize *= (death ? 0.75f : 0.5f); float direction = 1f; int randomLanceWallType; @@ -1021,7 +1020,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] == 0f) SoundEngine.PlaySound(SoundID.Item162, npc.Center); - float lanceGateValue2 = masterMode ? 75f : 100f; + float lanceGateValue2 = death ? 75f : 100f; if (npc.ai[1] >= 6f && npc.ai[1] < 54f) { @@ -1145,7 +1144,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int projectileType = ProjectileID.HallowBossRainbowStreak; int projectileDamage = npc.GetProjectileDamage(projectileType) * projectileDamageMultiplier; - Vector2 vector = new Vector2(0f, (death ? -24f : -22f) - (phase3 ? ((masterMode ? 6f : 4f) * streakHomeTime) : 0f)).RotatedBy(MathHelper.TwoPi * streakHomeTime); + Vector2 vector = new Vector2(0f, (death ? -24f : -22f) - (phase3 ? ((death ? 6f : 4f) * streakHomeTime) : 0f)).RotatedBy(MathHelper.TwoPi * streakHomeTime); if (Main.netMode != NetmodeID.MultiplayerClient) { int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projRandomOffset, vector, projectileType, projectileDamage, 0f, Main.myPlayer, npc.target, streakHomeTime); @@ -1180,7 +1179,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] += 1f; extraPhaseTime = (dayTimeEnrage ? 36f : 72f) + 30f * lessTimeSpentPerPhaseMultiplier; - if (npc.ai[1] >= (masterMode ? 105f : 120f) + extraPhaseTime) + if (npc.ai[1] >= (death ? 105f : 120f) + extraPhaseTime) { npc.ai[0] = 1f; npc.ai[1] = 0f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs index 16ace81fa3..a44b972fce 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs @@ -24,15 +24,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float lifeRatio = npc.life / (float)npc.lifeMax; bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Phases - float phase2LifeRatio = masterMode ? 0.75f : 0.6f; - float phase3LifeRatio = masterMode ? 0.4f : 0.3f; - float finalPhaseRevLifeRatio = masterMode ? 0.2f : 0.15f; - float penultimatePhaseDeathLifeRatio = masterMode ? 0.3f : 0.2f; - float finalPhaseDeathLifeRatio = masterMode ? 0.15f : 0.1f; + float phase2LifeRatio = death ? 0.75f : 0.6f; + float phase3LifeRatio = death ? 0.4f : 0.3f; + float finalPhaseRevLifeRatio = death ? 0.2f : 0.15f; + float penultimatePhaseDeathLifeRatio = death ? 0.3f : 0.2f; + float finalPhaseDeathLifeRatio = death ? 0.15f : 0.1f; bool phase2 = lifeRatio < phase2LifeRatio; bool phase3 = lifeRatio < phase3LifeRatio; bool finalPhaseRev = lifeRatio < finalPhaseRevLifeRatio; @@ -42,9 +41,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float lineUpDist = death ? 15f : 20f; // Servant and projectile velocity, the projectile velocity is multiplied by 2 - float servantAndProjectileVelocity = (death ? 8f : 6f) + (masterMode ? 2f : 0f); + float servantAndProjectileVelocity = death ? 10f : 6f; - float enrageScale = bossRush ? 2.25f : masterMode ? 0.5f : 0f; + float enrageScale = bossRush ? 2.25f : death ? 0.5f : 0f; if (Main.IsItDay()) { npc.Calamity().CurrentlyEnraged = !bossRush; @@ -151,7 +150,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses hoverAcceleration += 0.08f; } - float attackSwitchTimer = (masterMode ? 120f : 180f) - (death ? 180f * (1f - lifeRatio) : 0f); + float attackSwitchTimer = death ? (120f - 180f * (1f - lifeRatio)) : 180f; bool timeToCharge = npc.ai[2] >= attackSwitchTimer; Vector2 hoverDestination = Main.player[npc.target].Center - Vector2.UnitY * 400f; Vector2 idealVelocity = npc.SafeDirectionTo(hoverDestination) * (hoverSpeed + (timeToCharge ? ((npc.ai[2] - attackSwitchTimer) * 0.01f) : 0f)); @@ -173,7 +172,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!Main.player[npc.target].dead) npc.ai[3] += 1f; - float servantSpawnGateValue = death ? (masterMode ? 10f : 20f) : (masterMode ? 25f : 40f); + float servantSpawnGateValue = death ? 10f : 40f; if (Main.getGoodWorld) servantSpawnGateValue *= 0.8f; @@ -240,13 +239,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - int chargeDelay = masterMode ? 75 : 95; - if (death) - chargeDelay -= (int)Math.Round(30f * (1f - lifeRatio)); + int chargeDelay = death ? (75 - (int)Math.Round(30f * (1f - lifeRatio))) : 95; if (Main.getGoodWorld) chargeDelay -= 30; - float slowDownGateValue = chargeDelay * (death ? (masterMode ? 0.85f : 0.75f) : (masterMode ? 0.75f : 0.65f)); + float slowDownGateValue = chargeDelay * (death ? 0.85f : 0.65f); npc.ai[2] += 1f; if (npc.ai[2] >= slowDownGateValue) @@ -258,7 +255,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (decelerationScalar < 0f) decelerationScalar = 0f; - npc.velocity *= (MathHelper.Lerp(masterMode ? 0.76f : 0.92f, masterMode ? 0.88f : 0.96f, decelerationScalar)); + npc.velocity *= (MathHelper.Lerp(death ? 0.76f : 0.92f, death ? 0.88f : 0.96f, decelerationScalar)); if (Main.getGoodWorld) npc.velocity *= 0.99f; @@ -333,7 +330,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] += phaseChangeRate; if (npc.ai[1] % servantSpawnGateValue == 0f) { - float servantVelocity = masterMode ? 11.3f : 5.65f; + float servantVelocity = death ? 11.3f : 5.65f; Vector2 servantSpawnVelocity = Main.rand.NextVector2CircularEdge(servantVelocity, servantVelocity); if (Main.getGoodWorld) servantSpawnVelocity *= 3f; @@ -342,7 +339,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int spawnType = NPCID.ServantofCthulhu; - if (masterMode) + if (death) { int maxBloodServants = 2; bool spawnBloodServant = NPC.CountNPCS(ModContent.NPCType()) < maxBloodServants; @@ -466,13 +463,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses hoverAcceleration += 0.1f; } - float phaseLimit = (masterMode ? 160f : 200f) - (death ? 150f * (phase2LifeRatio - lifeRatio) : 0f); + float phaseLimit = death ? (160f - 150f * (phase2LifeRatio - lifeRatio)) : 200f; bool timeToCharge = npc.ai[2] >= phaseLimit; Vector2 idealHoverVelocity = npc.SafeDirectionTo(hoverDestination) * (hoverSpeed + (timeToCharge ? ((npc.ai[2] - phaseLimit) * 0.01f) : 0f)); npc.SimpleFlyMovement(idealHoverVelocity, hoverAcceleration + (timeToCharge ? ((npc.ai[2] - phaseLimit) * 0.001f) : 0f)); npc.ai[2] += 1f; - float projectileGateValue = (lifeRatio < 0.5f && death) ? (masterMode ? 40f : 50f) : (masterMode ? 60f : 80f); + float projectileGateValue = (lifeRatio < 0.5f && death) ? 40f : (death ? 60f : 80f); if (npc.ai[2] % projectileGateValue == 0f && shootProjectile) { Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * servantAndProjectileVelocity * 2f; @@ -481,8 +478,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { int type = ProjectileID.BloodNautilusShot; int damage = npc.GetProjectileDamage(type); - int numProj = masterMode ? 4 : 3; - int spread = masterMode ? 12 : 10; + int numProj = death ? 4 : 3; + int spread = death ? 12 : 10; float rotation = MathHelper.ToRadians(spread); for (int i = 0; i < numProj; i++) { @@ -532,11 +529,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = setDamage; - int phase2ChargeDelay = masterMode ? 70 : 85; - if (death) - phase2ChargeDelay -= (int)Math.Round(25f * (phase2LifeRatio - lifeRatio)); + int phase2ChargeDelay = death ? (70 - (int)Math.Round(25f * (phase2LifeRatio - lifeRatio))) : 85; - float slowDownGateValue = phase2ChargeDelay * (death ? (masterMode ? 0.9f : 0.85f) : (masterMode ? 0.85f : 0.75f)); + float slowDownGateValue = phase2ChargeDelay * (death ? 0.9f : 0.75f); npc.ai[2] += 1f; if (npc.ai[2] >= slowDownGateValue) @@ -548,7 +543,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (decelerationScalar < 0f) decelerationScalar = 0f; - npc.velocity *= (MathHelper.Lerp(masterMode ? 0.6f : 0.9f, masterMode ? 0.7f : 0.95f, decelerationScalar)); + npc.velocity *= (MathHelper.Lerp(death ? 0.6f : 0.9f, death ? 0.7f : 0.95f, decelerationScalar)); if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1) npc.velocity.X = 0f; if (npc.velocity.Y > -0.1 && npc.velocity.Y < 0.1) @@ -605,10 +600,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float targetVelocity = Math.Abs(Main.player[npc.target].velocity.X) + Math.Abs(Main.player[npc.target].velocity.Y) / 4f; targetVelocity += 10f - targetVelocity; - if (targetVelocity < (masterMode ? 2f : 5f)) - targetVelocity = (masterMode ? 2f : 5f); - if (targetVelocity > (masterMode ? 6f : 15f)) - targetVelocity = (masterMode ? 6f : 15f); + if (targetVelocity < (death ? 2f : 5f)) + targetVelocity = (death ? 2f : 5f); + if (targetVelocity > (death ? 6f : 15f)) + targetVelocity = (death ? 6f : 15f); if (npc.ai[2] == -1f) { @@ -763,7 +758,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int spawnType = NPCID.ServantofCthulhu; bool spawnServant = false; float enrageScaleToPass = enrageScale; - if (masterMode) + if (death) { int maxBloodServants = 2; bool spawnBloodServant = NPC.CountNPCS(ModContent.NPCType()) < maxBloodServants; @@ -860,9 +855,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses break; } - calamityGlobalNPC.newAI[0] += ((masterMode && calamityGlobalNPC.newAI[0] % 2f != 0f) ? Main.rand.Next(2) + 1f : 1f); + calamityGlobalNPC.newAI[0] += ((death && calamityGlobalNPC.newAI[0] % 2f != 0f) ? Main.rand.Next(2) + 1f : 1f); if (calamityGlobalNPC.newAI[0] > 3f) - calamityGlobalNPC.newAI[0] = masterMode ? Main.rand.Next(2) : 0f; + calamityGlobalNPC.newAI[0] = death ? Main.rand.Next(2) : 0f; npc.SyncExtraAI(); } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs index 8f28c3ad03..e75fd3ccdd 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs @@ -23,7 +23,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phases bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; bool phase2 = lifeRatio < 0.75f; bool phase3 = lifeRatio < 0.5f; @@ -33,7 +32,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] = 1f; - int numFists = masterMode ? 2 : 1; + int numFists = death ? 2 : 1; for (int i = 0; i < numFists; i++) { float fistPunchTimeOffset = i * 30f; @@ -231,7 +230,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] > 0f) { - npc.ai[1] += (masterMode ? 2f : 1f); + npc.ai[1] += (death ? 2f : 1f); if (Main.getGoodWorld) npc.ai[1] += 100f; @@ -263,7 +262,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - if (masterMode) + if (death) { float straightUpJumpHeight = 640f; if (npc.ai[3] == 0f) @@ -283,7 +282,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.noTileCollide = true; npc.ai[2] += 1f; - float jumpVelocity = death ? 26f : 24f; + float jumpVelocity = 26f; if (enrage) jumpVelocity *= 1.25f; if (turboEnrage) @@ -368,7 +367,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.noTileCollide = true; npc.ai[2] += 1f; - float jumpVelocity = death ? 23f : 21f; + float jumpVelocity = 21f; if (enrage) jumpVelocity *= 1.25f; if (turboEnrage) @@ -420,7 +419,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses void NormalJump() { float velocityBoost = death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio); - float velocityX = (masterMode ? 9f : 6f) + velocityBoost; + float velocityX = (death ? 9f : 6f) + velocityBoost; if (enrage) velocityX *= 1.5f; @@ -519,9 +518,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Main.dust[fiery2].velocity.X *= 2f; } - float projectileVelocity = masterMode ? 9f : 7.5f; - if (death) - projectileVelocity *= 1.25f; + float projectileVelocity = death ? 11.25f : 7.5f; if (enrage) projectileVelocity *= 1.5f; if (turboEnrage) @@ -533,7 +530,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses destination.Normalize(); destination *= projectileVelocity; int totalFireballsPerSide = 3; - int totalIterations = (turboEnrage && Main.getGoodWorld) ? 11 : masterMode ? 25 : 35; + int totalIterations = (turboEnrage && Main.getGoodWorld) ? 11 : death ? 25 : 35; float rotation = MathHelper.ToRadians(90); for (int i = 0; i < totalIterations; i++) { @@ -605,7 +602,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.Bottom.Y < Main.player[npc.target].position.Y || npc.ai[2] == 1f) { float fallSpeedBoost = death ? 1.2f * (1f - lifeRatio) : 0.8f * (1f - lifeRatio); - float fallSpeed = (masterMode ? 0.3f : 0.2f) + fallSpeedBoost; + float fallSpeed = (death ? 0.3f : 0.2f) + fallSpeedBoost; if (enrage) fallSpeed *= 2f; @@ -615,14 +612,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else { float velocityChangeBoost = death ? 0.18f * (1f - lifeRatio) : 0.12f * (1f - lifeRatio); - float velocityXChange = (masterMode ? 0.3f : 0.2f) + velocityChangeBoost; + float velocityXChange = (death ? 0.3f : 0.2f) + velocityChangeBoost; if (npc.direction < 0) npc.velocity.X -= velocityXChange; else if (npc.direction > 0) npc.velocity.X += velocityXChange; float velocityBoost = death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio); - float velocityXCap = (masterMode ? 9f : 6f) + velocityBoost; + float velocityXCap = (death ? 9f : 6f) + velocityBoost; if (enrage) velocityXCap *= 3f; @@ -703,7 +700,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Player player = Main.player[npc.target]; bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Enrage if the target isn't inside the temple @@ -727,7 +723,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (bossRush || Main.getGoodWorld) enrage = true; - float aggression = turboEnrage ? (Main.getGoodWorld ? 4f : 3f) : enrage ? 2f : death ? (masterMode ? 1.7f : 1.5f) : (masterMode ? 1.4f : 1f); + float aggression = turboEnrage ? (Main.getGoodWorld ? 4f : 3f) : enrage ? 2f : death ? 1.7f : 1f; Vector2 fistCenter = golem.Center + golem.velocity + new Vector2(0f, -9f * npc.scale); fistCenter.X += (float)((npc.type == NPCID.GolemFistLeft) ? -84 : 78) * npc.scale; @@ -755,7 +751,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool canPunch = npc.alpha == 0 && (npc.type == NPCID.GolemFistLeft && npc.Center.X + 100f > player.Center.X) || (npc.type == NPCID.GolemFistRight && npc.Center.X - 100f < player.Center.X); if (canPunch) { - float fistShootSpeed = masterMode ? Main.rand.NextFloat(aggression * 0.5f, aggression * 2f) : aggression; + float fistShootSpeed = death ? Main.rand.NextFloat(aggression * 0.5f, aggression * 2f) : aggression; npc.ai[1] += fistShootSpeed; if (npc.life < npc.lifeMax / 2) npc.ai[1] += fistShootSpeed; @@ -763,7 +759,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] += fistShootSpeed; } - float fistPunchGateValue = masterMode ? 120f : 40f; + float fistPunchGateValue = death ? 120f : 40f; if (npc.ai[1] >= fistPunchGateValue) { if (canPunch) @@ -775,7 +771,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = 0f; // Net update in Master due to rng - if (masterMode) + if (death) npc.ForceNetUpdate(); } } @@ -896,7 +892,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float maxPunchDistance = 700f; int explosionLimit = 2; - if (masterMode) + if (death) { if (npc.life < npc.lifeMax / 2) { @@ -918,7 +914,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.noTileCollide = true; npc.ai[0] = 0f; - if (masterMode) + if (death) { int type = ProjectileID.InfernoHostileBlast; bool shootExplosion = true; @@ -1024,7 +1020,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float lifeRatio = npc.life / (float)npc.lifeMax; bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Count body parts @@ -1093,7 +1088,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int type = ProjectileID.Fireball; int damage = npc.GetProjectileDamage(type); - int fireballAmount = masterMode ? 2 : 1; + int fireballAmount = death ? 2 : 1; Vector2 fireballVelocity = new Vector2(headFireballTargetX, headFireballTargetY); for (int i = 0; i < fireballAmount; i++) Projectile.NewProjectile(npc.GetSource_FromAI(), headCent, fireballVelocity * (1f / (i + 1)), type, damage, 0f, Main.myPlayer); @@ -1145,7 +1140,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int type = ProjectileID.Fireball; int damage = npc.GetProjectileDamage(type); - int fireballAmount = masterMode ? 3 : 1; + int fireballAmount = death ? 3 : 1; Vector2 fireballVelocity = new Vector2(fireballFistsDedTargetX, fireballFistsDedTargetY); for (int i = 0; i < fireballAmount; i++) { @@ -1179,7 +1174,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else projectileFirePos.X += 18f * npc.scale; - float laserSpeed = masterMode ? 15f : 12f; + float laserSpeed = death ? 15f : 12f; float laserTargetXDist = Main.player[npc.target].Center.X - projectileFirePos.X; float laserTargetYDist = Main.player[npc.target].Center.Y - projectileFirePos.Y; float laserTargetDistance = (float)Math.Sqrt(laserTargetXDist * laserTargetXDist + laserTargetYDist * laserTargetYDist); @@ -1208,7 +1203,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.localAI[1] == 1f) projectileFirePos.X += 30f * npc.scale; - float extraLaserSpeed = masterMode ? 15f : 12f; + float extraLaserSpeed = death ? 15f : 12f; float extraLaserTargetX = Main.player[npc.target].Center.X - projectileFirePos.X; float extraLaserTargetY = Main.player[npc.target].Center.Y - projectileFirePos.Y; float extraLaserTargetDist = (float)Math.Sqrt(extraLaserTargetX * extraLaserTargetX + extraLaserTargetY * extraLaserTargetY); @@ -1274,11 +1269,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phases bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; - bool phase2 = lifeRatio < 0.7f || golemLifeRatio < 0.85f || masterMode; - bool phase3 = lifeRatio < 0.55f || golemLifeRatio < 0.7f || masterMode; - bool phase4 = lifeRatio < 0.4f || golemLifeRatio < 0.55f || masterMode; + bool phase2 = lifeRatio < 0.7f || golemLifeRatio < 0.85f || death; + bool phase3 = lifeRatio < 0.55f || golemLifeRatio < 0.7f || death; + bool phase4 = lifeRatio < 0.4f || golemLifeRatio < 0.55f || death; // Enrage if the target isn't inside the temple bool enrage = true; @@ -1449,7 +1443,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 freeHeadCenter = new Vector2(npc.Center.X, npc.Center.Y + 20f * npc.scale); float freeHeadSpeed = turboEnrage ? 24f : enrage ? 18f : 6f; - if (masterMode) + if (death) freeHeadSpeed *= 1.25f; float freeHeadTargetX = Main.player[npc.target].Center.X - freeHeadCenter.X; @@ -1460,7 +1454,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses freeHeadTargetX *= freeHeadTargetDist; freeHeadTargetY *= freeHeadTargetDist; - int projectileType = (phase3 || masterMode) ? ProjectileID.InfernoHostileBolt : ProjectileID.Fireball; + int projectileType = (phase3 || death) ? ProjectileID.InfernoHostileBolt : ProjectileID.Fireball; int damage = npc.GetProjectileDamage(projectileType); float ai0 = projectileType == ProjectileID.InfernoHostileBolt ? Main.player[npc.target].Center.X : 0f; float ai1 = projectileType == ProjectileID.InfernoHostileBolt ? Main.player[npc.target].Center.Y : 0f; @@ -1497,7 +1491,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses freeHeadProjSpawn.X += 14f * npc.scale; float freeHeadProjSpeed = 5f + (death ? 5f * (1f - combinedLifeRatio) : 3f * (1f - combinedLifeRatio)); - if (masterMode) + if (death) { if (i == 0) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs index 08a9375b6c..b41e77b6e9 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs @@ -34,7 +34,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Phases based on life percentage @@ -52,22 +51,22 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool spawnBlueCrystal = lifeRatio < 0.3f; // Check if the crystals are alive - bool crystalAlive = true; + bool redCrystalAlive = true; bool blueCrystalAlive = false; bool greenCrystalAlive = true; if (spawnGreenCrystal) { - if (masterMode) + if (death) greenCrystalAlive = NPC.AnyNPCs(ModContent.NPCType()); } if (phase3) - crystalAlive = NPC.AnyNPCs(ModContent.NPCType()); + redCrystalAlive = NPC.AnyNPCs(ModContent.NPCType()); if (spawnBlueCrystal) { - if (masterMode) + if (death) blueCrystalAlive = NPC.AnyNPCs(ModContent.NPCType()); } @@ -83,8 +82,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Dust color when the blue crystal is alive Color dustColor = Color.Lerp(new Color(0, 0, 150, npc.alpha), new Color(125, 125, 255, npc.alpha), (float)Math.Sin(Main.GlobalTimeWrappedHourly) / 2f + 0.5f); - // Master Mode Crystal spawning - if (masterMode) + // Death Mode Crystal spawning + if (death) { if (spawnGreenCrystal && npc.Calamity().newAI[0] == 0f) { @@ -242,7 +241,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Faster fall if (npc.velocity.Y > 0f) { - float fallSpeedBonus = (bossRush ? 0.1f : death ? 0.05f : 0f) + (!crystalAlive ? 0.1f : 0f) + (masterMode ? 0.1f : 0f); + float fallSpeedBonus = (bossRush ? 0.2f : death ? 0.15f : 0f) + (!redCrystalAlive ? 0.1f : 0f); npc.velocity.Y += fallSpeedBonus; } @@ -285,7 +284,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Get closer to activating teleport if (npc.ai[2] < teleportGateValue) { - if (!Collision.CanHitLine(npc.Center, 0, 0, Main.player[npc.target].Center, 0, 0) || Math.Abs(npc.Top.Y - Main.player[npc.target].Bottom.Y) > (masterMode ? 160f : 320f)) + if (!Collision.CanHitLine(npc.Center, 0, 0, Main.player[npc.target].Center, 0, 0) || Math.Abs(npc.Top.Y - Main.player[npc.target].Bottom.Y) > (death ? 160f : 320f)) npc.ai[2] += death ? 3f : 2f; else npc.ai[2] += 1f; @@ -300,8 +299,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses teleporting = true; npc.aiAction = 1; - float teleportRate = crystalAlive ? 1f : 2f; - if (masterMode) + float teleportRate = redCrystalAlive ? 1f : 2f; + if (death) teleportRate *= 2f; npc.ai[0] += teleportRate; @@ -350,8 +349,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses teleporting = true; npc.aiAction = 0; - float teleportRate = crystalAlive ? 1f : 2f; - if (masterMode) + float teleportRate = redCrystalAlive ? 1f : 2f; + if (death) teleportRate *= 2f; if (npc.ai[0] == 0f) @@ -487,7 +486,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.velocity.Y *= 0.6f; } - if (masterMode) + if (death) npc.velocity.X *= 1.4f; if (bossRush) @@ -503,8 +502,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Change jump velocity else if (npc.target < Main.maxPlayers) { - float jumpVelocityLimit = crystalAlive ? 3f : 4.5f; - if (masterMode) + float jumpVelocityLimit = redCrystalAlive ? 3f : 4.5f; + if (death) jumpVelocityLimit += 3f; if (Main.getGoodWorld) jumpVelocityLimit = 8f; @@ -514,13 +513,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if ((npc.direction == -1 && npc.velocity.X < 0.1) || (npc.direction == 1 && npc.velocity.X > -0.1)) { npc.velocity.X += (bossRush ? 0.4f : death ? 0.25f : 0.2f) * npc.direction; - if (masterMode) + if (death) npc.velocity.X += 0.3f * npc.direction; } else { npc.velocity.X *= bossRush ? 0.9f : death ? 0.92f : 0.93f; - if (masterMode) + if (death) npc.velocity.X *= 0.9f; } } @@ -573,11 +572,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.life + slimeSpawnThreshold < npc.ai[3]) { npc.ai[3] = npc.life; - int slimeAmt = Main.rand.Next(1, 3); + int slimeAmt = death ? 1 : Main.rand.Next(1, 3); for (int i = 0; i < slimeAmt; i++) { - float minLowerLimit = death ? 5f : 0f; - float maxLowerLimit = death ? 7f : 2f; + float minLowerLimit = 0f; + float maxLowerLimit = 2f; int minTypeChoice = (int)MathHelper.Lerp(minLowerLimit, 5f, 1f - lifeRatio2); int maxTypeChoice = (int)MathHelper.Lerp(maxLowerLimit, 7f, 1f - lifeRatio2); @@ -613,7 +612,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (((Main.raining && Main.hardMode) || bossRush) && Main.rand.NextBool(50)) npcType = NPCID.RainbowSlime; - if (masterMode) + if (death) { switch (Main.rand.Next(3)) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs index f849a006f7..b228164acb 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs @@ -32,7 +32,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Get a target @@ -46,10 +45,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float phase2LifeRatio = 0.5f; bool addThornBallsToGatlingAttack = lifeRatio < 0.85f; bool addSporeGasBlastToGatlingAttack = lifeRatio < 0.75f; - bool useNewGatlingAttackVariant = addSporeGasBlastToGatlingAttack && masterMode; + bool useNewGatlingAttackVariant = addSporeGasBlastToGatlingAttack && death; bool phase2 = lifeRatio <= phase2LifeRatio; bool phase3 = lifeRatio < 0.35f; - bool vomitFreeTentacles = lifeRatio < 0.25f && masterMode; + bool vomitFreeTentacles = lifeRatio < 0.25f && death; bool phase4 = lifeRatio < 0.2f; // Contact damage values for phase 2 @@ -63,8 +62,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Check for Jungle bool surface = !bossRush && Main.player[npc.target].position.Y < Main.worldSurface * 16.0; - // Tentacle limites - int maxTentaclesAfterFirstTentaclePhase = death ? (masterMode ? 4 : 3) : (masterMode ? 3 : 2); + // Tentacle limits + int maxTentaclesAfterFirstTentaclePhase = death ? 4 : 2; int maxFreeTentaclesAfterFirstTentaclePhase = maxTentaclesAfterFirstTentaclePhase * 2; float speedUpDistance = 480f; @@ -162,14 +161,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (death) { - velocity += velocity * 0.25f * (1f - lifeRatio); - acceleration += acceleration * 0.25f * (1f - lifeRatio); - } - - if (masterMode) - { - velocity += velocity * 0.1f * (1f - lifeRatio); - acceleration += acceleration * 0.1f * (1f - lifeRatio); + velocity += velocity * 0.35f * (1f - lifeRatio); + acceleration += acceleration * 0.35f * (1f - lifeRatio); if (phase2) { float aggressionScale = (phase2LifeRatio - lifeRatio) / phase2LifeRatio; @@ -306,7 +299,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (addSporeGasBlastToGatlingAttack) { SoundEngine.PlaySound(SoundID.Item74, npc.Center); - int totalProjectiles = masterMode ? 36 : 30; + int totalProjectiles = death ? 36 : 30; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); @@ -316,7 +309,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { Vector2 projectileVelocity = spinningPoint.RotatedBy(radians * k); Vector2 spawnOffset = npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 50f; - float randomSpeed = Main.rand.NextFloat(0.8f, masterMode ? 1.5f : 1.2f); + float randomSpeed = Main.rand.NextFloat(0.8f, death ? 1.5f : 1.2f); int dustType = 74; Vector2 dustVelocity = projectileVelocity * randomSpeed; @@ -350,7 +343,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (doneWithTentaclePhase && !charging && !despawn) { float timeToChargeIncrement = phase4 ? 2f : phase3 ? 1.5f : 1f; - if (masterMode) + if (death) timeToChargeIncrement *= 2f; npc.ai[3] += timeToChargeIncrement; @@ -367,7 +360,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses velocity *= MathHelper.Lerp(MovementVelocityMultiplierForSlowAttacks, 1f, (float)Math.Pow(absValueOfTimer / SeedGatlingDuration, 2D)); // Shoot homing pink bulb projectiles that leave behind lingering pink clouds - float shootBulbGateValue = death ? (masterMode ? 150f : 90f) : (masterMode ? 200f : 120f); + float shootBulbGateValue = death ? 150f : 120f; if (addSporeGasBlastToGatlingAttack) shootBulbGateValue *= 0.8f; @@ -407,9 +400,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[3] <= StopChargeGateValue) { bool canChargeAgain = phase4 ? true : phase3 ? Main.rand.NextBool() : false; - bool chargeAgain = canChargeAgain && masterMode && calamityGlobalNPC.newAI[2] == 0f; + bool chargeAgain = canChargeAgain && death && calamityGlobalNPC.newAI[2] == 0f; npc.ai[3] = chargeAgain ? -2f : 0f; - calamityGlobalNPC.newAI[2] = (masterMode && calamityGlobalNPC.newAI[2] == 0f && chargeAgain) ? 1f : 0f; + calamityGlobalNPC.newAI[2] = (death && calamityGlobalNPC.newAI[2] == 0f && chargeAgain) ? 1f : 0f; npc.SyncExtraAI(); if (!vomitFreeTentacles && !secondCharge) @@ -443,7 +436,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { int projectileType = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(projectileType); - float randomVelocityMultiplier = secondCharge ? 0.05f : masterMode ? 0.3f : 0.2f; + float randomVelocityMultiplier = secondCharge ? 0.05f : death ? 0.3f : 0.2f; Vector2 projectileVelocity = npc.velocity * Main.rand.NextVector2CircularEdge(randomVelocityMultiplier, randomVelocityMultiplier); Vector2 spawnOffset = npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 30f; @@ -504,7 +497,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } float timeToLineUpChargeDecrement = phase4 ? 2f : 1f; - if (masterMode) + if (death) timeToLineUpChargeDecrement *= 2f; npc.ai[3] -= timeToLineUpChargeDecrement; @@ -537,7 +530,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { Vector2 projectileVelocity = spinningPoint.RotatedBy(radians * k); Vector2 spawnOffset = npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 50f; - float randomSpeed = Main.rand.NextFloat(0.8f, secondCharge ? 1f : masterMode ? 1.5f : 1.2f); + float randomSpeed = Main.rand.NextFloat(0.8f, secondCharge ? 1f : death ? 1.5f : 1.2f); int dustType = 74; Vector2 dustVelocity2 = projectileVelocity * randomSpeed; @@ -574,9 +567,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (phase3) maxDistanceFromHooks += 150f; if (death) + { maxDistanceFromHooks += maxDistanceFromHooks * 0.2f * (1f - lifeRatio); - if (masterMode) maxDistanceFromHooks += 200f; + } if (distanceFromTarget >= maxDistanceFromHooks) { @@ -658,7 +652,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.getGoodWorld) npc.localAI[1] += 1f; - float shootProjectileGateValue = death ? (masterMode ? 30f : 40f) : (masterMode ? 45f : 60f); + float shootProjectileGateValue = death ? 30f : 60f; if (npc.localAI[1] >= shootProjectileGateValue) { npc.localAI[1] = 0f; @@ -682,9 +676,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - bool shootPoisonSeed = (CalamityWorld.LegendaryMode || Main.rand.NextBool(masterMode ? 2 : 4)) && !shootThornBall; + bool shootPoisonSeed = (CalamityWorld.LegendaryMode || Main.rand.NextBool(death ? 2 : 4)) && !shootThornBall; int projectileType = shootThornBall ? ProjectileID.ThornBall : shootPoisonSeed ? ProjectileID.PoisonSeedPlantera : ProjectileID.SeedPlantera; - float projectileSpeed = masterMode ? 16f : 14f; + float projectileSpeed = death ? 16f : 14f; int damage = npc.GetProjectileDamage(projectileType); Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY); Vector2 spawnOffset = npc.Center + projectileVelocity * 70f; @@ -734,7 +728,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[0] == 1f) { npc.localAI[0] = 2f; - int totalTentacles = death ? (masterMode ? 12 : 10) : (masterMode ? 10 : 8); + int totalTentacles = death ? 12 : 8; if (Main.getGoodWorld) totalTentacles += 6; if (CalamityWorld.LegendaryMode) @@ -771,7 +765,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool noAttachedTentacles = !NPC.AnyNPCs(NPCID.PlanterasTentacle); bool noFreeTentacles = !NPC.AnyNPCs(ModContent.NPCType()); float tentacleIdleTimerDecrement = (noAttachedTentacles && noFreeTentacles) ? 4f : noAttachedTentacles ? 2f : 1f; - if (masterMode) + if (death) tentacleIdleTimerDecrement *= 2f; npc.ai[2] -= tentacleIdleTimerDecrement; @@ -889,7 +883,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (masterMode && Main.netMode != NetmodeID.MultiplayerClient) + if (death && Main.netMode != NetmodeID.MultiplayerClient) { float sporeSpeed = 12f; Vector2 sporeVelocity = projectileVelocity * sporeSpeed; @@ -976,7 +970,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Variables bool enrage = BossRushEvent.BossRushActive; bool despawn = false; - bool masterMode = Main.masterMode || enrage; bool death = CalamityWorld.death || enrage; // Despawn if Plantera is gone @@ -1019,7 +1012,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.localAI[0] = 0f; // Timer dictating whether to pick a new location or not - float moveBoost = death ? (masterMode ? 6f : 4f) * (1f - lifeRatio) : (masterMode ? 3f : 2f) * (1f - lifeRatio); + float moveBoost = death ? 6f * (1f - lifeRatio) : 2f * (1f - lifeRatio); npc.localAI[0] -= 1f + moveBoost; if (enrage) npc.localAI[0] -= 6f; @@ -1088,7 +1081,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[0] > 0f && npc.ai[1] > 0f) { // Hook movement velocity - float velocityBoost = death ? (masterMode ? 9f : 6f) * (1f - lifeRatio) : (masterMode ? 5f : 3f) * (1f - lifeRatio); + float velocityBoost = death ? 9f * (1f - lifeRatio) : 3f * (1f - lifeRatio); float velocity = 7f + velocityBoost; if (enrage) velocity *= 2f; @@ -1145,7 +1138,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses dust.fadeIn = 0.7f; } - bool masterMode = Main.masterMode || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (Main.getGoodWorld) @@ -1218,7 +1210,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float tentacleDistance = MathHelper.Lerp(50f, 100f + (extendedDistanceFromPlantera * 300f), npc.localAI[0] / extendTime); float deceleration = (death ? 0.5f : 0.8f) / (1f + extendedDistanceFromPlantera); - if (masterMode) + if (death) { tentacleAcceleration *= 1.2f; extendedDistanceFromPlantera *= 1.1f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs index 0082f2844f..65dc62059c 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs @@ -24,7 +24,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityUtils.CalamityTargeting(npc, CalamityTargetingParameters.BossDefaults); bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; bool enrage = true; @@ -61,7 +60,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float lifeRatio = npc.life / (float)npc.lifeMax; // Bee spawn limit - int beeLimit = masterMode ? 9 : 15; + int beeLimit = death ? 9 : 15; // Queen Bee Bee count int totalBees = 0; @@ -86,7 +85,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool hornetLimitReached = false; // Only run this when necessary - if (masterMode) + if (death) { // Queen Bee Hornet count int totalHornets = 0; @@ -205,7 +204,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int phase; int maxRandom = phase4 ? 5 : 4; do phase = Main.rand.Next(maxRandom); - while (phase == npc.ai[1] || phase == 1 || (phase == 2 && phase4) || (masterMode && phase6 && phase == 3)); + while (phase == npc.ai[1] || phase == 1 || (phase == 2 && phase4) || (death && phase6 && phase == 3)); bool charging = phase == 0; @@ -221,13 +220,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] = (phase == 5 && phase5) ? (Main.rand.NextBool() ? 1f : -1f) : phase == 5 ? 1f : 0f; // Velocity for the charges - if (masterMode) + if (death) npc.ai[3] = charging ? ((phase6 ? 27f : phase5 ? 16f : phase4 ? 27f : phase2 ? 22f : 17f) + 3f * enrageScale) : 0f; else npc.ai[3] = charging ? ((phase6 ? 25f : phase5 ? 14f : phase4 ? 25f : phase2 ? 20f : 15f) + 3f * enrageScale) : 0f; // Distance for the charges - if (masterMode) + if (death) calamityGlobalNPC.newAI[1] = charging ? ((phase6 ? 700f : phase5 ? 300f : phase4 ? 600f : phase2 ? 500f : 400f) - 50f * enrageScale) : 0f; else calamityGlobalNPC.newAI[1] = charging ? ((phase6 ? 750f : phase5 ? 350f : phase4 ? 650f : phase2 ? 550f : 450f) - 50f * enrageScale) : 0f; @@ -248,7 +247,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeAmt = phase6 ? 1 : phase5 ? 3 : phase4 ? 2 : 1; int masterModeChargeLimit = death ? (phase5 ? 2 : 1) : (phase5 ? 3 : 2); - if (masterMode && chargeAmt > masterModeChargeLimit) + if (death && chargeAmt > masterModeChargeLimit) chargeAmt = masterModeChargeLimit; // Switch to a random phase if chargeAmt has been exceeded @@ -274,9 +273,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float chargeDistanceY = phase6 ? 100f : phase4 ? 50f : 20f; chargeDistanceY += 50f * enrageScale; if (death) + { chargeDistanceY += MathHelper.Lerp(0f, 100f, 1f - lifeRatio); - if (masterMode) chargeDistanceY *= 2f; + } float distanceFromTargetX = Math.Abs(npc.Center.X - Main.player[npc.target].Center.X); float distanceFromTargetY = Math.Abs(npc.Center.Y - Main.player[npc.target].Center.Y); @@ -316,7 +316,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float chargeAccelerationX = (phase4 ? 0.9f : phase2 ? 0.7f : 0.5f) + 0.25f * enrageScale; float chargeAccelerationY = (phase4 ? 0.45f : phase2 ? 0.35f : 0.25f) + 0.125f * enrageScale; - if (masterMode) + if (death) { chargeVelocityX += 2f; chargeVelocityY += 4f; @@ -389,7 +389,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses shouldCharge = true; } if (enrageScale > 0f && shouldCharge) - npc.velocity *= MathHelper.Lerp(0.5f, masterMode ? 0.9f : 1f, 1f - enrageScale / maxEnrageScale); + npc.velocity *= MathHelper.Lerp(0.5f, death ? 0.9f : 1f, 1f - enrageScale / maxEnrageScale); // Keep moving if (npc.ai[2] != 1f) @@ -399,7 +399,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.velocity.X = velocity * npc.direction; float accelerateGateValue = phase6 ? 30f : phase5 ? 10f : 90f; - if (masterMode) + if (death) accelerateGateValue *= 0.75f; if (enrageScale > 0f) accelerateGateValue *= 0.75f; @@ -410,11 +410,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.SyncExtraAI(); float velocityXLimit = velocity * 2f; if (Math.Abs(npc.velocity.X) < velocityXLimit) - npc.velocity.X *= (masterMode ? 1.02f : 1.01f); + npc.velocity.X *= (death ? 1.02f : 1.01f); } // Spawn bees - float beeSpawnGateValue = masterMode ? 16f : 20f; + float beeSpawnGateValue = death ? 16f : 20f; bool spawnBee = phase4 && calamityGlobalNPC.newAI[0] % beeSpawnGateValue == 0f && Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height); if (spawnBee) { @@ -430,7 +430,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else spawnType = NPCID.Hellbat; } - else if (masterMode) + else if (death) { int random = hornetLimitReached ? 0 : beeLimitReached ? Main.rand.Next(6, 12) : Main.rand.Next(12); switch (random) @@ -491,9 +491,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Slow down npc.localAI[0] = 0f; - npc.velocity *= (masterMode ? 0.8f : 0.9f); + npc.velocity *= (death ? 0.8f : 0.9f); - float chargeDeceleration = masterMode ? 0.2f : 0.1f; + float chargeDeceleration = death ? 0.2f : 0.1f; if (phase2) { npc.velocity *= 0.9f; @@ -531,14 +531,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.spriteDirection = npc.direction; // Get target location - float beeAttackAccel = death ? 0.3f : 0.24f; + float beeAttackAccel = death ? 0.6f : 0.24f; float beeAttackSpeed = 12f + enrageScale * 3f; - if (masterMode) - { - beeAttackAccel *= 2f; + if (death) beeAttackSpeed *= 1.5f; - } bool canHitTarget = Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height); float distanceAboveTarget = !canHitTarget ? 0f : 320f; @@ -547,7 +544,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Go to bee spawn phase calamityGlobalNPC.newAI[0] += 1f; - if ((Vector2.Distance(npc.Center, hoverDestination) < 400f && canHitTarget) || calamityGlobalNPC.newAI[0] >= (masterMode ? 90f : 180f)) + if ((Vector2.Distance(npc.Center, hoverDestination) < 400f && canHitTarget) || calamityGlobalNPC.newAI[0] >= (death ? 90f : 180f)) { npc.ai[0] = 1f; npc.ai[1] = 0f; @@ -570,13 +567,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Get target location and spawn bees from ass float beeAttackHoverSpeed = 16f + enrageScale * 4f; - float beeAttackHoverAccel = death ? 0.4f : 0.3f; + float beeAttackHoverAccel = death ? 0.8f : 0.3f; - if (masterMode) - { - beeAttackHoverAccel *= 2f; + if (death) beeAttackHoverSpeed *= 1.5f; - } Vector2 beeSpawnLocation = new Vector2(npc.Center.X + (Main.rand.Next(20) * npc.direction), npc.position.Y + npc.height * 0.8f); Vector2 beeSpawnCollisionLocation = new Vector2(beeSpawnLocation.X, beeSpawnLocation.Y - 30f); @@ -626,7 +620,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else spawnType = NPCID.Hellbat; } - else if (masterMode) + else if (death) { int random = hornetLimitReached ? 0 : beeLimitReached ? Main.rand.Next(6, 12) : Main.rand.Next(12); switch (random) @@ -684,7 +678,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.spriteDirection = npc.direction; // Go to a random phase - float numSpawns = phase3 ? (masterMode ? 1f : 2f) : (masterMode ? 3f : 5f); + float numSpawns = phase3 ? (death ? 1f : 2f) : (death ? 3f : 5f); if (npc.ai[2] > numSpawns || (beeLimitReached && hornetLimitReached)) { npc.ai[0] = -1f; @@ -711,7 +705,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (enrageScale > 0f) stingerAttackAccel = MathHelper.Lerp(phase6 ? 0.3f : 0.24f, phase6 ? 0.6f : 0.48f, enrageScale / maxEnrageScale); - if (masterMode) + if (death) { stingerAttackSpeed *= 1.1f; stingerAttackAccel *= 1.2f; @@ -735,7 +729,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { float stingerSpeed = (phase3 ? 6f : 5f) + enrageScale; - if (masterMode) + if (death) stingerSpeed += 1f; float stingerTargetX = Main.player[npc.target].Center.X - stingerSpawnLocation.X; @@ -770,7 +764,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Go to a random phase float numStingerShots = phase6 ? 5f : phase2 ? 8f : 15f; - if (masterMode) + if (death) numStingerShots = (float)Math.Round(numStingerShots * 0.5f); if (npc.ai[1] > stingerAttackTimer * numStingerShots) @@ -824,7 +818,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (enrageScale > 0f) stingerAttackAccel = MathHelper.Lerp(phase6 ? 0.9f : 0.7f, phase6 ? 2.4f : 1.8f, enrageScale / maxEnrageScale); - if (masterMode) + if (death) { stingerAttackSpeed *= 1.1f; stingerAttackAccel *= 1.2f; @@ -858,7 +852,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { float stingerSpeed = (phase6 ? 5f : 4f) + enrageScale; - if (masterMode) + if (death) stingerSpeed += 1f; Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * stingerSpeed; @@ -866,7 +860,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int numProj = death ? (phase6 ? 7 : phase5 ? 11 : 15) : (phase6 ? 5 : phase5 ? 9 : 13); int spread = phase6 ? 30 : phase5 ? 50 : 60; - if (masterMode) + if (death) { numProj += (phase6 ? 2 : phase5 ? 4 : 6); spread += (phase6 ? 10 : phase5 ? 15 : 20); @@ -903,7 +897,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else npc.velocity *= 0.8f; - float idleTime = masterMode ? 120f : 180f; + float idleTime = death ? 120f : 180f; if (npc.ai[1] >= phaseLimit + idleTime) { npc.ai[0] = -1f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs index ef5b7d0e3c..9e895f7809 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs @@ -16,7 +16,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { // Difficulty bools bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Percent life remaining @@ -25,9 +24,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float slimeScale = 1f; bool teleported = false; bool phase2 = lifeRatio <= 0.5f; - bool phase3 = lifeRatio <= (masterMode ? 0.5f : 0.4f); - bool phase4 = lifeRatio <= (masterMode ? 0.5f : 0.2f); - bool phase5 = lifeRatio <= 0.25f && masterMode; + bool phase3 = lifeRatio <= (death ? 0.5f : 0.4f); + bool phase4 = lifeRatio <= (death ? 0.5f : 0.2f); + bool phase5 = lifeRatio <= 0.25f && death; // Spawn settings if (npc.localAI[0] == 0f) @@ -60,7 +59,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Teleport - float teleportGateValue = masterMode ? 300f : 600f; + float teleportGateValue = death ? 300f : 600f; if (!Main.player[npc.target].dead && npc.timeLeft > 10 && !phase2 && npc.ai[3] >= teleportGateValue && npc.ai[0] == 0f && npc.velocity.Y == 0f) { // Avoid cheap bullshit @@ -315,7 +314,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Gore.NewGore(npc.GetSource_FromAI(), npc.Center + new Vector2(-40f, -npc.height / 2), npc.velocity, GoreID.QueenSlimeCrown); // Spawn spread of projectiles in Master Mode - if (masterMode) + if (death) { int numGelProjectiles = 12; if (Main.getGoodWorld) @@ -445,7 +444,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] += 1f; } - if (masterMode) + if (death) npc.velocity.X *= (death ? 1.4f : 1.2f); npc.noTileCollide = true; @@ -455,16 +454,16 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target >= Main.maxPlayers) break; - float jumpVelocity = bossRush ? 9f : death ? (masterMode ? 7f : 5.5f) : (masterMode ? 6f : 4.5f); + float jumpVelocity = bossRush ? 9f : death ? 7f : 4.5f; if (Main.getGoodWorld) jumpVelocity = 12f; if ((npc.direction == 1 && npc.velocity.X < jumpVelocity) || (npc.direction == -1 && npc.velocity.X > 0f - jumpVelocity)) { if ((npc.direction == -1 && npc.velocity.X < 0.1) || (npc.direction == 1 && npc.velocity.X > -0.1)) - npc.velocity.X += (bossRush ? 1f : death ? (masterMode ? 0.45f : 0.35f) : (masterMode ? 0.4f : 0.3f)) * npc.direction; + npc.velocity.X += (bossRush ? 1f : death ? 0.45f : 0.3f) * npc.direction; else - npc.velocity.X *= bossRush ? 0.8f : death ? (masterMode ? 0.85f : 0.9f) : (masterMode ? 0.88f : 0.91f); + npc.velocity.X *= bossRush ? 0.8f : death ? 0.85f : 0.91f; } if (!Main.player[npc.target].dead) @@ -515,7 +514,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Bottom, Vector2.Zero, type, damage, 0f, Main.myPlayer); // Line of explosions in Master Mode - if (masterMode) + if (death) { float expandDelay = 0f; int maxSmashes = death ? 22 : 16; @@ -537,7 +536,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Eruption of crystals in phase 3 if (npc.ai[0] == 6f && phase3) { - float projectileVelocity = masterMode ? (death ? 18f : 15f) : 12f; + float projectileVelocity = death ? 18f : 12f; type = ProjectileID.QueenSlimeMinionBlueSpike; damage = npc.GetProjectileDamage(type); Vector2 destination = (new Vector2(npc.Center.X, npc.Center.Y - 100f) - npc.Center).SafeNormalize(Vector2.UnitY); @@ -638,7 +637,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int projectileAmt = 2; int type = ProjectileID.QueenSlimeMinionBlueSpike; int damage = npc.GetProjectileDamage(type); - Vector2 velocityIncrease = masterMode ? (Vector2.UnitY * (death ? 4f : 2f)) : Vector2.Zero; + Vector2 velocityIncrease = death ? (Vector2.UnitY * 4f) : Vector2.Zero; for (int i = 0; i < projectileAmt; i++) { int totalProjectiles = 2; @@ -691,7 +690,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.velocity = center - npc.Center; npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero); - npc.velocity *= bossRush ? 30f : death ? (masterMode ? 27.3f : 26f) : (masterMode ? 25.2f : 24f); + npc.velocity *= bossRush ? 30f : death ? 27.3f : 24f; } else npc.velocity.Y *= 0.95f; @@ -845,7 +844,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Spawn small slimes // Don't spawn any slimes in final phase - if (npc.life <= 0 || (phase4 && !masterMode)) + if (npc.life <= 0 || (phase4 && !death)) return false; if (Main.netMode == NetmodeID.MultiplayerClient) @@ -862,7 +861,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } float slimeSpawnHealthGateValue = CalamityWorld.LegendaryMode ? 0.01f : phase3 ? 0.04f : phase2 ? 0.03f : 0.025f; - if (masterMode) + if (death) slimeSpawnHealthGateValue *= 0.5f; int slimeSpawnThreshold = (int)(npc.lifeMax * slimeSpawnHealthGateValue); @@ -1645,15 +1644,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { // Difficulty bools bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode; - bool death = CalamityWorld.death; + bool death = CalamityWorld.death || bossRush; npc.noTileCollide = true; npc.noGravity = true; - float flyVelocity = bossRush ? 24f : death ? (masterMode ? 21f : 18f) : (masterMode ? 19f : 16f); - float flyAcceleration = bossRush ? 0.3f : death ? (masterMode ? 0.18f : 0.14f) : (masterMode ? 0.16f : 0.12f); - float flyDistanceY = masterMode ? 350f : 450f; + float flyVelocity = bossRush ? 24f : death ? 21f : 16f; + float flyAcceleration = bossRush ? 0.3f : death ? 0.18f : 0.12f; + float flyDistanceY = death ? 350f : 450f; Vector2 desiredVelocity = npc.Center; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs index a26d087d4d..d182231f38 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs @@ -23,19 +23,18 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; // Phases - float phase2LifeRatio = masterMode ? 1f : 0.85f; - float phase3LifeRatio = masterMode ? 0.9f : 0.7f; + float phase2LifeRatio = death ? 1f : 0.85f; + float phase3LifeRatio = death ? 0.9f : 0.7f; float respawnHandsLifeRatio = 0.5f; - float phase4LifeRatio = masterMode ? 0.4f : 0.3f; - float useSkullSpreadsAfterChargeLifeRatio = masterMode ? 0.3f : 0.2f; - float phase5LifeRatio = masterMode ? 0.2f : 0.1f; + float phase4LifeRatio = death ? 0.4f : 0.3f; + float useSkullSpreadsAfterChargeLifeRatio = death ? 0.3f : 0.2f; + float phase5LifeRatio = death ? 0.2f : 0.1f; // Begin firing spreads of skulls phase bool phase2 = lifeRatio < phase2LifeRatio; @@ -88,13 +87,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses void SpawnHands() { int skeletronHand = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.SkeletronHand, npc.whoAmI); - Main.npc[skeletronHand].ai[0] = masterMode ? -1.3f : -1f; + Main.npc[skeletronHand].ai[0] = death ? -1.3f : -1f; Main.npc[skeletronHand].ai[1] = npc.whoAmI; Main.npc[skeletronHand].target = npc.target; Main.npc[skeletronHand].netUpdate = true; skeletronHand = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.SkeletronHand, npc.whoAmI); - Main.npc[skeletronHand].ai[0] = masterMode ? 1.3f : 1f; + Main.npc[skeletronHand].ai[0] = death ? 1.3f : 1f; Main.npc[skeletronHand].ai[1] = npc.whoAmI; Main.npc[skeletronHand].ai[3] = 150f; Main.npc[skeletronHand].Calamity().newAI[2] = 150f; @@ -105,7 +104,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (death) { skeletronHand = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.SkeletronHand, npc.whoAmI); - Main.npc[skeletronHand].ai[0] = masterMode ? -1.3f : -1f; + Main.npc[skeletronHand].ai[0] = -1.3f; Main.npc[skeletronHand].Calamity().newAI[0] = -1f; Main.npc[skeletronHand].ai[1] = npc.whoAmI; Main.npc[skeletronHand].ai[3] = respawnHands ? -75f : 0f; @@ -114,7 +113,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Main.npc[skeletronHand].netUpdate = true; skeletronHand = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.SkeletronHand, npc.whoAmI); - Main.npc[skeletronHand].ai[0] = masterMode ? 1.3f : 1f; + Main.npc[skeletronHand].ai[0] = 1.3f; Main.npc[skeletronHand].Calamity().newAI[0] = -1f; Main.npc[skeletronHand].ai[1] = npc.whoAmI; Main.npc[skeletronHand].ai[3] = respawnHands ? 75f : 150f; @@ -194,7 +193,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Reduce the amount of skulls per spread in later phases due to near-constant teleporting - if (!masterMode && numProj > 3) + if (!death && numProj > 3) { if (phase4) numProj--; @@ -340,7 +339,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Teleport - if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[3] >= teleportGateValue + 120 && (!(npc.ai[1] == 1f && phase3) || masterMode)) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[3] >= teleportGateValue + 120 && (!(npc.ai[1] == 1f && phase3) || death)) { // Teleport dust for (int m = 0; m < 30; m++) @@ -365,7 +364,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Skull shooting - if ((handsDead || masterMode) && npc.ai[1] == 0f && !phase4) + if ((handsDead || death) && npc.ai[1] == 0f && !phase4) { float skullProjFrequency = bossRush ? 15f : phase2 ? (48f - (death ? 17.5f * (1f - lifeRatio) : 0f)) : 60f; if (Main.getGoodWorld) @@ -391,7 +390,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int skullProjectile = Projectile.NewProjectile(npc.GetSource_FromAI(), skullFiringPos, skullProjDirection, type, damage, 0f, Main.myPlayer, -1f); Main.projectile[skullProjectile].timeLeft = 600; - if (masterMode && handsDead) + if (death && handsDead) { skullProjDirection = new Vector2(skullProjTargetX, skullProjTargetY).SafeNormalize(Vector2.UnitY); skullProjDirection *= skullProjSpeed * 2f; @@ -411,7 +410,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.damage = 0; calamityGlobalNPC.newAI[1] += 1f; - float chargePhaseChangeRateBoost = phase5 ? (death ? 24f : 14f) : phase4 ? (death ? 8f : 6f) : (((masterMode && death) ? 6f : 4f) * ((1f - lifeRatio) / (1f - phase4LifeRatio))); + float chargePhaseChangeRateBoost = phase5 ? (death ? 24f : 14f) : phase4 ? (death ? 8f : 6f) : ((death ? 6f : 4f) * ((1f - lifeRatio) / (1f - phase4LifeRatio))); if (!handsDead) chargePhaseChangeRateBoost *= 0.5f; @@ -422,10 +421,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[1] > chargePhaseGateValue) npc.localAI[1] = chargePhaseGateValue; - float forcedMoveAwayTime = death ? 30f : 45f; - if (masterMode) - forcedMoveAwayTime *= 0.5f; - + float forcedMoveAwayTime = death ? 15f : 45f; float canChargeDistance = phase3 ? 480f : 320f; // 20 tile distance, 30 tile distance in phase 3 bool hasMovedForcedDistance = npc.localAI[2] >= forcedMoveAwayTime; bool canCharge = Vector2.Distance(Main.player[npc.target].Center, npc.Center) >= canChargeDistance; @@ -448,11 +444,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - float headYAcceleration = (Main.getGoodWorld ? 0.07f : masterMode ? 0.06f : 0.04f) + (death ? 0.04f * (1f - lifeRatio) : 0f); + float headYAcceleration = (Main.getGoodWorld ? 0.07f : death ? (0.06f + 0.04f * (1f - lifeRatio)) : 0.04f); float headYTopSpeed = headYAcceleration * 100f; - float headXAcceleration = (Main.getGoodWorld ? 0.21f : masterMode ? 0.16f : 0.08f) + (death ? 0.08f * (1f - lifeRatio) : 0f); + float headXAcceleration = (Main.getGoodWorld ? 0.21f : death ? (0.16f + 0.08f * (1f - lifeRatio)) : 0.08f); float headXTopSpeed = headXAcceleration * 100f; - float deceleration = Main.getGoodWorld ? 0.83f : masterMode ? 0.86f : 0.89f; + float deceleration = Main.getGoodWorld ? 0.83f : death ? 0.86f : 0.89f; if (bossRush) { @@ -620,10 +616,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 240f) { - float shadowFlameProjectileSpeed = death ? 5f : 4f; - if (masterMode) - shadowFlameProjectileSpeed *= 1.2f; - + float shadowFlameProjectileSpeed = death ? 6f : 4f; Vector2 initialProjectileVelocity = npc.Center.DirectionTo(Main.player[npc.target].Center) * shadowFlameProjectileSpeed; int type = ProjectileID.Shadowflames; int damage = npc.GetProjectileDamage(type); @@ -646,7 +639,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } bool dontGoMach10 = false; - float dashPhaseTime = masterMode ? 210f : 300f; + float dashPhaseTime = death ? 210f : 300f; if (npc.ai[2] >= dashPhaseTime) { if (Main.getGoodWorld) @@ -691,7 +684,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 perturbedSpeed = initialProjectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, k / (float)(chargeSkullAmt - 1))); int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center - perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer, -1f); Main.projectile[proj].timeLeft = 600; - if (masterMode) + if (death) { int proj2 = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center - perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer, -2f); Main.projectile[proj2].timeLeft = 600; @@ -731,12 +724,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses headSpinVelocityMult += velocityBoost; } - float altDashStopDistance = death ? (masterMode ? 320f : 360f) : (masterMode ? 360f : 400f); + float altDashStopDistance = death ? 320f : 400f; float headSpeedIncreaseDist = phase3 ? altDashStopDistance : 160f; if (headSpinTargetDist > headSpeedIncreaseDist) { float velocityMult = phase3 ? 0.00075f : 0.0015f; - float baseDistanceVelocityMult = 1f + MathHelper.Clamp((headSpinTargetDist - headSpeedIncreaseDist) * 0.0015f, 0.05f, masterMode ? 2f : 1.5f); + float baseDistanceVelocityMult = 1f + MathHelper.Clamp((headSpinTargetDist - headSpeedIncreaseDist) * 0.0015f, 0.05f, death ? 2f : 1.5f); headSpinVelocityMult *= baseDistanceVelocityMult; } @@ -834,7 +827,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Get a target @@ -844,7 +836,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float yMultiplier = 1f; if (calamityGlobalNPC.newAI[0] != 0f) yMultiplier = calamityGlobalNPC.newAI[0]; - if (masterMode) + if (death) yMultiplier *= 1.3f; // Inflict 0 damage for 3 seconds after spawning @@ -906,9 +898,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float velocityMultiplier = MathHelper.Lerp(death ? 0.6f : 0.7f, 1f, skeletronLifeRatio); float velocityIncrement = MathHelper.Lerp(0.2f, death ? 0.4f : 0.3f, 1f - skeletronLifeRatio); float handSwipeVelocity = MathHelper.Lerp(16f, death ? 24f : 20f, 1f - skeletronLifeRatio); - float deceleration = Main.getGoodWorld ? 0.78f : masterMode ? 0.82f : 0.86f; + float deceleration = Main.getGoodWorld ? 0.78f : death ? 0.82f : 0.86f; - if (masterMode) + if (death) { velocityMultiplier *= 0.75f; velocityIncrement *= 1.5f; @@ -916,11 +908,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses deceleration *= 0.75f; } - float handSwipeDistance = masterMode ? HandSwipeDistance_Master : HandSwipeDistance; + float handSwipeDistance = death ? HandSwipeDistance_Master : HandSwipeDistance; float handSwipeDuration = handSwipeDistance / handSwipeVelocity; float slapGateValue = HandSlapGateValue; - float slapTimerIncrement = MathHelper.Lerp(masterMode ? 1.5f : 1f, masterMode ? 3f : 2f, 1f - skeletronLifeRatio); + float slapTimerIncrement = MathHelper.Lerp(death ? 1.5f : 1f, death ? 3f : 2f, 1f - skeletronLifeRatio); if (phase3) slapTimerIncrement *= (death ? 2.5f : 2f); else if (phase2) @@ -1094,7 +1086,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.netUpdate = true; // Spawn projectiles - if (masterMode && Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && !cancelSlap) + if (death && Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && !cancelSlap) { if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -1153,7 +1145,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.netUpdate = true; // Spawn projectiles - if (masterMode && Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && !cancelSlap) + if (death && Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && !cancelSlap) { if (Main.netMode != NetmodeID.MultiplayerClient) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs index 91ae7eb218..de242d0fac 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs @@ -22,7 +22,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Get a target @@ -44,7 +43,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { // Spawn second head in Master Mode // The main head owns the Saw and the Laser in Master Mode - if (masterMode) + if (death) { int head = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType(), npc.whoAmI); Main.npc[head].ai[0] = npc.whoAmI; @@ -99,7 +98,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.SyncExtraAI(); } - if (masterMode) + if (death) { if (!Main.npc[(int)npc.ai[0]].active || Main.npc[(int)npc.ai[0]].aiStyle != NPCAIStyleID.SkeletronPrimeHead) { @@ -178,9 +177,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phases bool phase2 = lifeRatio < 0.66f; - bool spawnDestroyer = lifeRatio < 0.75f && masterMode && !bossRush && npc.localAI[2] == 0f; + bool spawnDestroyer = lifeRatio < 0.75f && death && !bossRush && npc.localAI[2] == 0f; bool phase3 = lifeRatio < 0.33f; - bool spawnRetinazer = lifeRatio < 0.5f && masterMode && !bossRush && npc.localAI[2] == 1f; + bool spawnRetinazer = lifeRatio < 0.5f && death && !bossRush && npc.localAI[2] == 1f; // Spawn The Destroyer in Master Mode (just like Oblivion from Avalon) if (spawnDestroyer) @@ -305,16 +304,16 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Start other phases; if arms are dead, start with spin phase bool otherHeadChargingOrSpinning = Main.npc[(int)npc.ai[0]].ai[1] == 5f || Main.npc[(int)npc.ai[0]].ai[1] == 1f; - if (phase2 || CalamityWorld.LegendaryMode || allArmsDead || masterMode) + if (phase2 || CalamityWorld.LegendaryMode || allArmsDead || death) { // Start spin phase after 1.5 seconds npc.ai[2] += phase3 ? 1.5f : 1f; - if (npc.ai[2] >= (90f - (death ? (masterMode ? 15f : 60f) * (1f - lifeRatio) : 0f)) && (!otherHeadChargingOrSpinning || !masterMode || phase3) && (canUseAttackInMaster || !masterMode)) + if (npc.ai[2] >= (90f - (death ? 15f * (1f - lifeRatio) : 0f)) && (!otherHeadChargingOrSpinning || !death || phase3) && (canUseAttackInMaster || !death)) { bool shouldSpinAround = npc.ai[1] == 4f && npc.position.Y < Main.player[npc.target].position.Y - 320f && Vector2.Distance(Main.player[npc.target].Center, npc.Center) < 600f && Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 400f; - bool shouldCharge = masterMode && !phase2 && !allArmsDead && !CalamityWorld.LegendaryMode; + bool shouldCharge = death && !phase2 && !allArmsDead && !CalamityWorld.LegendaryMode; if (shouldCharge) { npc.ai[2] = 0f; @@ -342,7 +341,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else npc.rotation = npc.velocity.X / 15f; - float acceleration = (bossRush ? 0.16f : masterMode ? 0.12f : 0.1f) + (death ? 0.05f * (1f - lifeRatio) : 0f); + float acceleration = bossRush ? 0.2f : (death ? (0.12f + 0.05f * (1f - lifeRatio)) : 0.1f); float accelerationMult = 1f; if (!cannonAlive) { @@ -358,11 +357,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses acceleration += 0.0125f; if (!sawAlive) acceleration += 0.0125f; - if (masterMode) + if (death) acceleration *= accelerationMult; float topVelocity = acceleration * 100f; - float deceleration = masterMode ? 0.7f : 0.85f; + float deceleration = death ? 0.7f : 0.85f; float headDecelerationUpDist = 0f; float headDecelerationDownDist = 0f; @@ -435,7 +434,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.localAI[0] = 0f; - int totalProjectiles = bossRush ? 24 : death ? (masterMode ? 15 : 18) : 12; + int totalProjectiles = bossRush ? 24 : death ? 15 : 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = ProjectileID.DeathLaser; int damage = npc.GetProjectileDamage(type); @@ -493,7 +492,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float headTargetY = Main.player[npc.target].Center.Y - headPosition.Y; float headTargetDistance = (float)Math.Sqrt(headTargetX * headTargetX + headTargetY * headTargetY); - float speed = bossRush ? 12f : (masterMode ? 8f : 6f); + float speed = bossRush ? 12f : death ? 8f : 6f; if (phase2) speed += 0.5f; if (phase3) @@ -645,9 +644,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = npc.velocity.X / 50f; - float skullSpawnDivisor = bossRush ? 9f : death ? 15f - (float)Math.Round((masterMode ? 3f : 5f) * (1f - lifeRatio)) : 15f; + float skullSpawnDivisor = bossRush ? 9f : death ? 15f - (float)Math.Round(3f * (1f - lifeRatio)) : 15f; float totalSkulls = 12f; - int skullSpread = bossRush ? 250 : death ? (masterMode ? 125 : 150) : 100; + int skullSpread = bossRush ? 250 : death ? 125 : 100; // Spin for about 3 seconds // Decreasing this number will INCREASE how fast he moves while spinning @@ -688,7 +687,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 headCenter = npc.Center; - float enragedHeadSpeed = (masterMode ? 5f : 4f) + (death ? (masterMode ? 1f : 2f) * (1f - lifeRatio) : 0f); + float enragedHeadSpeed = death ? (5f + (1f - lifeRatio)) : 4f; float enragedHeadSkullTargetX = Main.player[npc.target].Center.X - headCenter.X + Main.rand.Next(-20, 21); float enragedHeadSkullTargetY = Main.player[npc.target].Center.Y - headCenter.Y + Main.rand.Next(-20, 21); float enragedHeadSkullTargetDist = (float)Math.Sqrt(enragedHeadSkullTargetX * enragedHeadSkullTargetX + enragedHeadSkullTargetY * enragedHeadSkullTargetY); @@ -717,7 +716,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[0] % 3f == 0f) { - int probeLimit = death ? (masterMode ? 3 : 4) : 2; + int probeLimit = death ? 3 : 2; if (NPC.CountNPCS(NPCID.Probe) < probeLimit) NPC.NewNPC(npc.GetSource_FromAI(), (int)headCenter.X, (int)headCenter.Y + 30, NPCID.Probe); } @@ -756,14 +755,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = npc.velocity.X / 15f; - float flightVelocity = bossRush ? 24f : death ? 21f : 18f; - float flightAcceleration = bossRush ? 1f : death ? 0.8f : 0.6f; - - if (masterMode) - { - flightVelocity += 4f; - flightAcceleration += 0.16f; - } + float flightVelocity = bossRush ? 29f : death ? 25f : 18f; + float flightAcceleration = bossRush ? 1.12f : death ? 0.96f : 0.6f; Vector2 destination = new Vector2(Main.player[npc.target].Center.X, Main.player[npc.target].Center.Y - 420f); npc.SimpleFlyMovement((destination - npc.Center).SafeNormalize(Vector2.UnitY) * flightVelocity, flightAcceleration); @@ -772,8 +765,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.localAI[3] += 1f; if (Vector2.Distance(npc.Center, destination) < 80f || npc.ai[2] > 0f || npc.localAI[3] > 120f) { - float missileSpawnDivisor = death ? 8f : (masterMode ? 10f : 12f); - float totalMissiles = masterMode ? 12f : 10f; + float missileSpawnDivisor = death ? 10f : 12f; + float totalMissiles = death ? 12f : 10f; npc.ai[2] += 1f; if (npc.ai[2] % missileSpawnDivisor == 0f) { @@ -825,7 +818,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static bool BuffedPrimeLaserAI(NPC npc, Mod mod) { bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Get a target @@ -885,7 +877,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool normalLaserRotation = npc.localAI[1] % 2f == 0f; // Movement - float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f)); + float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f; float accelerationMult = 1f; if (!cannonAlive) { @@ -896,11 +888,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses acceleration += 0.025f; if (!sawAlive) acceleration += 0.025f; - if (masterMode) + if (death) acceleration *= accelerationMult; float topVelocity = acceleration * 100f; - float deceleration = masterMode ? 0.6f : 0.8f; + float deceleration = death ? 0.6f : 0.8f; if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y - 70f) { @@ -960,7 +952,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!sawAlive) npc.ai[3] += 1f; - if (npc.ai[3] >= (masterMode ? 200f : 800f)) + if (npc.ai[3] >= (death ? 200f : 800f)) { npc.target = Main.npc[(int)npc.ai[1]].target; npc.localAI[0] = 0f; @@ -1056,7 +1048,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[0] >= 120f) { npc.localAI[0] = 0f; - int totalProjectiles = bossRush ? 32 : (masterMode ? 24 : 16); + int totalProjectiles = bossRush ? 32 : death ? 24 : 16; float radians = MathHelper.TwoPi / totalProjectiles; int type = ProjectileID.DeathLaser; int damage = npc.GetProjectileDamage(type); @@ -1094,7 +1086,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static bool BuffedPrimeCannonAI(NPC npc, Mod mod) { bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Get a target @@ -1171,7 +1162,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!sawAlive) npc.ai[3] += 1f; - if (npc.ai[3] >= (masterMode ? 200f : 800f)) + if (npc.ai[3] >= (death ? 200f : 800f)) { npc.target = Main.npc[(int)npc.ai[1]].target; npc.localAI[0] = 0f; @@ -1208,7 +1199,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Movement - float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f)); + float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f; float accelerationMult = 1f; if (!laserAlive) { @@ -1219,11 +1210,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses acceleration += 0.025f; if (!sawAlive) acceleration += 0.025f; - if (masterMode) + if (death) acceleration *= accelerationMult; float topVelocity = acceleration * 100f; - float deceleration = masterMode ? 0.6f : 0.8f; + float deceleration = death ? 0.6f : 0.8f; if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y - 70f) { @@ -1374,7 +1365,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static bool BuffedPrimeViceAI(NPC npc, Mod mod) { bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Get a target @@ -1439,7 +1429,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Return to the head if (npc.ai[2] == 99f) { - float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f)); + float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f; float accelerationMult = 1f; if (!cannonAlive) { @@ -1453,11 +1443,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } if (!sawAlive) acceleration += 0.025f; - if (masterMode) + if (death) acceleration *= accelerationMult; float topVelocity = acceleration * 100f; - float deceleration = masterMode ? 0.6f : 0.8f; + float deceleration = death ? 0.6f : 0.8f; if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y + 20f) { @@ -1521,7 +1511,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!sawAlive) npc.ai[3] += 1f; - if (npc.ai[3] >= (masterMode ? 150f : 600f)) + if (npc.ai[3] >= (death ? 150f : 600f)) { npc.target = Main.npc[(int)npc.ai[1]].target; npc.ai[2] += 1f; @@ -1529,7 +1519,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.netUpdate = true; } - float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f)); + float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f; float accelerationMult = 1f; if (!cannonAlive) { @@ -1543,11 +1533,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } if (!sawAlive) acceleration += 0.025f; - if (masterMode) + if (death) acceleration *= accelerationMult; float topVelocity = acceleration * 100f; - float deceleration = masterMode ? 0.6f : 0.8f; + float deceleration = death ? 0.6f : 0.8f; if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y + 100f) { @@ -1601,7 +1591,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Charge towards the player if (npc.ai[2] == 1f) { - float deceleration = masterMode ? 0.75f : 0.8f; + float deceleration = death ? 0.75f : 0.8f; if (npc.velocity.Y > 0f) npc.velocity.Y *= deceleration; @@ -1743,7 +1733,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static bool BuffedPrimeSawAI(NPC npc, Mod mod) { bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Get a target @@ -1806,7 +1795,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[2] == 99f) { - float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f)); + float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f; float accelerationMult = 1f; if (!cannonAlive) { @@ -1820,11 +1809,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } if (!viceAlive) acceleration += 0.025f; - if (masterMode) + if (death) acceleration *= accelerationMult; float topVelocity = acceleration * 100f; - float deceleration = masterMode ? 0.6f : 0.8f; + float deceleration = death ? 0.6f : 0.8f; if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y + 20f) { @@ -1884,7 +1873,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!viceAlive) npc.ai[3] += 1f; - if (npc.ai[3] >= (masterMode ? 90f : 180f)) + if (npc.ai[3] >= (death ? 90f : 180f)) { npc.target = Main.npc[(int)npc.ai[1]].target; npc.ai[2] += 1f; @@ -1892,7 +1881,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.netUpdate = true; } - float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f)); + float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f; float accelerationMult = 1f; if (!cannonAlive) { @@ -1906,11 +1895,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } if (!viceAlive) acceleration += 0.025f; - if (masterMode) + if (death) acceleration *= accelerationMult; float topVelocity = acceleration * 100f; - float deceleration = masterMode ? 0.6f : 0.8f; + float deceleration = death ? 0.6f : 0.8f; if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y + 100f) { @@ -1968,7 +1957,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float sawArmChargeTargetY = Main.npc[(int)npc.ai[1]].position.Y + 230f - sawArmChargePos.Y; npc.rotation = (float)Math.Atan2(sawArmChargeTargetY, sawArmChargeTargetX) + MathHelper.PiOver2; - float deceleration = masterMode ? 0.875f : 0.9f; + float deceleration = death ? 0.875f : 0.9f; npc.velocity.X *= deceleration; npc.velocity.Y -= 0.5f; if (npc.velocity.Y < -12f) @@ -2022,7 +2011,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeVelocity += 1.5f; if (!viceAlive) chargeVelocity += 1.5f; - if (masterMode) + if (death) chargeVelocity *= 1.25f; Vector2 sawArmOtherChargePos = npc.Center; @@ -2033,11 +2022,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses sawArmOtherChargeTargetX *= sawArmOtherChargeTargetDist; sawArmOtherChargeTargetY *= sawArmOtherChargeTargetDist; - float acceleration = bossRush ? 0.3f : death ? 0.1f : 0.08f; - if (masterMode) - acceleration *= 1.25f; - - float deceleration = masterMode ? 0.6f : 0.8f; + float acceleration = bossRush ? 0.3f : death ? 0.125f : 0.08f; + float deceleration = death ? 0.6f : 0.8f; if (npc.velocity.X > sawArmOtherChargeTargetX) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs index 867dc6f4b9..9f3d027fee 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs @@ -18,7 +18,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Get a target @@ -29,7 +28,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityUtils.CalamityTargeting(npc, options); } - float enrageScale = bossRush ? 0.5f : masterMode ? 0.3f : 0f; + float enrageScale = bossRush ? 0.5f : death ? 0.3f : 0f; if (Main.IsItDay() || bossRush) { npc.Calamity().CurrentlyEnraged = !bossRush; @@ -79,7 +78,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Check for Oblivion in Master Mode bool oblivionAlive = false; - if (masterMode && !bossRush && npc.localAI[3] == 1f) + if (death && !bossRush && npc.localAI[3] == 1f) { for (int i = 0; i < Main.maxNPCs; i++) { @@ -92,7 +91,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Foveanator spawn - if (!oblivionAlive && masterMode && calamityGlobalNPC.newAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient && !bossRush) + if (!oblivionAlive && death && calamityGlobalNPC.newAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient && !bossRush) { NPC.SpawnOnPlayer(npc.FindClosestPlayer(), ModContent.NPCType()); calamityGlobalNPC.newAI[0] = 1f; @@ -102,25 +101,25 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool foveanatorAlive = NPC.AnyNPCs(ModContent.NPCType()); // Phase HP ratios - float phase2LifeRatio = oblivionAlive ? 0.5f : masterMode ? 0.85f : 0.7f; - float finalPhaseLifeRatio = masterMode ? 0.4f : 0.25f; + float phase2LifeRatio = oblivionAlive ? 0.5f : death ? 0.85f : 0.7f; + float finalPhaseLifeRatio = death ? 0.4f : 0.25f; // Movement variables - float phase1MaxSpeedIncrease = masterMode ? 2f : 4f; - float phase1MaxAccelerationIncrease = masterMode ? 0.025f : 0.05f; - float phase1MaxChargeSpeedIncrease = masterMode ? 3f : 6f; + float phase1MaxSpeedIncrease = death ? 2f : 4f; + float phase1MaxAccelerationIncrease = death ? 0.025f : 0.05f; + float phase1MaxChargeSpeedIncrease = death ? 3f : 6f; // Phase duration variables - float phase1MaxLaserPhaseDurationDecrease = masterMode ? 120f : 300f; + float phase1MaxLaserPhaseDurationDecrease = death ? 120f : 300f; // If Oblivion is alive reduce aggression of all attacks if (oblivionAlive) { - phase1MaxSpeedIncrease = masterMode ? 1f : 2f; - phase1MaxAccelerationIncrease = masterMode ? 0.0125f : 0.025f; - phase1MaxChargeSpeedIncrease = masterMode ? 1.5f : 3f; + phase1MaxSpeedIncrease = death ? 1f : 2f; + phase1MaxAccelerationIncrease = death ? 0.0125f : 0.025f; + phase1MaxChargeSpeedIncrease = death ? 1.5f : 3f; - phase1MaxLaserPhaseDurationDecrease = masterMode ? 60f : 150f; + phase1MaxLaserPhaseDurationDecrease = death ? 60f : 150f; } // Phase checks @@ -199,7 +198,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else npc.SimpleFlyMovement(idealVelocity * maxVelocity, acceleration); - float phaseGateValue = (masterMode ? 300f : 450f) - (death ? phase1MaxLaserPhaseDurationDecrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); + float phaseGateValue = death ? (300f - phase1MaxLaserPhaseDurationDecrease * ((1f - lifeRatio) / (1f - phase2LifeRatio))) : 450f; float laserGateValue = oblivionAlive ? 60f : foveanatorAlive ? 45f : 30f; if (NPC.IsMechQueenUp) { @@ -283,13 +282,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.damage = npc.defDamage; npc.ai[2] += 1f; - float decelerateGateValue = (masterMode ? 36f : 32f) + (death ? (masterMode ? 6f : 12f) * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); + float decelerateGateValue = (death ? 36f : 32f) + (death ? 6f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); if (npc.ai[2] >= decelerateGateValue) { // Avoid cheap bullshit npc.damage = 0; - float decelerationMultiplier = (masterMode ? 0.84f : 0.92f) - (death ? (masterMode ? 0.16f : 0.32f) * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); + float decelerationMultiplier = (death ? 0.84f : 0.92f) - (death ? 0.16f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); npc.velocity *= decelerationMultiplier; if (Math.Abs(npc.velocity.X) < 0.1) @@ -300,7 +299,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else npc.rotation = npc.velocity.ToRotation() - MathHelper.PiOver2; - float delayBeforeChargingAgain = (masterMode ? 48f : 56f) - (death ? (masterMode ? 3f : 6f) * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); + float delayBeforeChargingAgain = (death ? 48f : 56f) - (death ? 3f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); if (npc.ai[2] >= delayBeforeChargingAgain + (oblivionAlive ? 15f : 0f)) { npc.ai[3] += 1f; @@ -366,7 +365,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation += npc.ai[2]; npc.ai[1] += 1f; - if (masterMode && npc.ai[2] >= 0.2f) + if (death && npc.ai[2] >= 0.2f) { if (npc.ai[1] % 10f == 0f) { @@ -603,7 +602,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } npc.ai[2] += spazAlive ? 1f : 1.5f; - if (npc.ai[2] >= (masterMode ? 150f : 180f) - (death ? (masterMode ? 60f : 90f) * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f)) + if (npc.ai[2] >= (death ? 150f : 180f) - (death ? 60f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f)) { npc.ai[1] = finalPhase ? 4f : 0f; npc.ai[2] = 0f; @@ -707,7 +706,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] = 0f; float chargeIncrement = 1f; - if (masterMode && Main.rand.NextBool() && npc.ai[3] < (spazAlive ? 1f : 3f)) + if (death && Main.rand.NextBool() && npc.ai[3] < (spazAlive ? 1f : 3f)) { chargeIncrement = 2f; @@ -781,7 +780,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Get a target @@ -792,7 +790,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityUtils.CalamityTargeting(npc, options); } - float enrageScale = bossRush ? 0.5f : masterMode ? 0.3f : 0f; + float enrageScale = bossRush ? 0.5f : death ? 0.3f : 0f; if (Main.IsItDay() || bossRush) { npc.Calamity().CurrentlyEnraged = !bossRush; @@ -847,7 +845,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Check for Oblivion in Master Mode bool oblivionAlive = false; - if (masterMode && !bossRush && npc.localAI[3] == 1f) + if (death && !bossRush && npc.localAI[3] == 1f) { for (int i = 0; i < Main.maxNPCs; i++) { @@ -862,27 +860,27 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool foveanatorAlive = NPC.AnyNPCs(ModContent.NPCType()); // Phase HP ratios - float phase2LifeRatio = oblivionAlive ? 0.5f : masterMode ? 0.85f : 0.7f; - float finalPhaseLifeRatio = masterMode ? 0.3f : 0.15f; + float phase2LifeRatio = oblivionAlive ? 0.5f : death ? 0.85f : 0.7f; + float finalPhaseLifeRatio = death ? 0.3f : 0.15f; // Movement variables - float phase1MaxSpeedIncrease = masterMode ? 2.25f : 4.5f; - float phase1MaxAccelerationIncrease = masterMode ? 0.075f : 0.15f; - float phase1MaxChargeSpeedIncrease = masterMode ? 3f : 6f; + float phase1MaxSpeedIncrease = death ? 2.25f : 4.5f; + float phase1MaxAccelerationIncrease = death ? 0.075f : 0.15f; + float phase1MaxChargeSpeedIncrease = death ? 3f : 6f; // Phase duration variables - float phase1MaxCursedFlamePhaseDurationDecrease = masterMode ? 80f : 200f; - float phase1MaxChargesDecrease = masterMode ? 2f : 4f; + float phase1MaxCursedFlamePhaseDurationDecrease = death ? 80f : 200f; + float phase1MaxChargesDecrease = death ? 2f : 4f; // If Oblivion is alive reduce aggression of all attacks if (oblivionAlive) { - phase1MaxSpeedIncrease = masterMode ? 1.125f : 2.25f; - phase1MaxAccelerationIncrease = masterMode ? 0.0375f : 0.075f; - phase1MaxChargeSpeedIncrease = masterMode ? 1.5f : 3f; + phase1MaxSpeedIncrease = death ? 1.125f : 2.25f; + phase1MaxAccelerationIncrease = death ? 0.0375f : 0.075f; + phase1MaxChargeSpeedIncrease = death ? 1.5f : 3f; - phase1MaxCursedFlamePhaseDurationDecrease = masterMode ? 40f : 100f; - phase1MaxChargesDecrease = masterMode ? 1f : 2f; + phase1MaxCursedFlamePhaseDurationDecrease = death ? 40f : 100f; + phase1MaxChargesDecrease = death ? 1f : 2f; } // Phase checks @@ -1041,7 +1039,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] += 1f; - float timeBeforeSlowDown = masterMode ? 30f : 10f; + float timeBeforeSlowDown = death ? 30f : 10f; if (npc.ai[2] >= timeBeforeSlowDown) { // Avoid cheap bullshit @@ -1059,7 +1057,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = npc.velocity.ToRotation() - MathHelper.PiOver2; // Charge 8 times - float chargeTime = masterMode ? 45f : 25f; + float chargeTime = death ? 45f : 25f; if (npc.ai[2] >= chargeTime + (oblivionAlive ? 15f : 0f)) { // Reset AI array and go to cursed fireball phase @@ -1126,7 +1124,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation += npc.ai[2]; npc.ai[1] += 1f; - if (masterMode && npc.ai[2] >= 0.2f) + if (death && npc.ai[2] >= 0.2f) { if (npc.ai[1] % 10f == 0f) { @@ -1236,7 +1234,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { // Boost speed if too far from target if (distanceFromDestination > distanceFromTarget) - maxVelocity += MathHelper.Lerp(0f, oblivionAlive ? 3f : masterMode ? 8f : 6f, MathHelper.Clamp((distanceFromDestination - distanceFromTarget) / 1000f, 0f, 1f)); + maxVelocity += MathHelper.Lerp(0f, oblivionAlive ? 3f : death ? 8f : 6f, MathHelper.Clamp((distanceFromDestination - distanceFromTarget) / 1000f, 0f, 1f)); if (Main.getGoodWorld) { @@ -1302,7 +1300,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses flamethrowerVelocity = (npc.rotation + MathHelper.PiOver2).ToRotationVector2() * flamethrowerSpeed + npc.velocity * 0.5f; Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 25f, flamethrowerVelocity, type, damage, 0f, Main.myPlayer); - if (masterMode && npc.ai[3] % 30f == 0f) + if (death && npc.ai[3] % 30f == 0f) { type = npc.ai[3] % 60f == 0f ? ModContent.ProjectileType() : ProjectileID.CursedFlameHostile; damage = npc.GetProjectileDamage(type); @@ -1526,7 +1524,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ForceNetUpdate(false); float chargeIncrement = 1f; - if (masterMode && Main.rand.NextBool() && npc.ai[3] < (retAlive ? 2f : 3f)) + if (death && Main.rand.NextBool() && npc.ai[3] < (retAlive ? 2f : 3f)) chargeIncrement = 2f; npc.ai[3] += chargeIncrement; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs index 59a4702655..9b0df45190 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs @@ -21,7 +21,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Despawn @@ -82,7 +81,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] += 1f; if (npc.ai[2] == 0f) { - if (masterMode) + if (death) npc.ai[1] += 2f; if (phase2) @@ -113,11 +112,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (NPC.CountNPCS(NPCID.LeechHead) < 10) { int leechSpawn = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X), (int)(npc.Center.Y + 20f), NPCID.LeechHead, 1); - int leechVelocity = masterMode ? 12 : 9; + int leechVelocity = death ? 12 : 9; Main.npc[leechSpawn].velocity.X = npc.direction * leechVelocity; } - if (phase2 || masterMode) + if (phase2 || death) { // Get target vector Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * npc.velocity.Length(); @@ -128,7 +127,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Main.projectile[proj].timeLeft = 600; Main.projectile[proj].tileCollide = false; - if (masterMode) + if (death) { float fireballVelocity = npc.velocity.Length() + 3f; projectileVelocity = projectileVelocity.SafeNormalize(Vector2.UnitY) * fireballVelocity; @@ -250,7 +249,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float halfAverageScreenWidth = 960f; float distanceBeforeSlowingDown = 640f; - float timeBeforeEnrage = (masterMode ? 150f : 600f) - (death ? (masterMode ? 130f : 390f) * (1f - lifeRatio) : 0f); + float timeBeforeEnrage = death ? (150f - 130f * (1f - lifeRatio)) : 600f; float speedMult = 1f; if (bossRush) @@ -309,7 +308,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses speedMult += 0.2f; float masterModeVelocityBoost = 0f; - if (masterMode) + if (death) { float velocityBoostStartDistance = distanceBeforeSlowingDown; float velocityBoostMaxDistance = velocityBoostStartDistance * 1.5f; @@ -325,7 +324,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float velocityX = (bossRush ? 7f : death ? 3.5f : 2f) + masterModeVelocityBoost + velocityBoost; velocityX *= speedMult; - if (masterMode) + if (death) velocityX *= 1.2f; if (Main.getGoodWorld) @@ -442,7 +441,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (bossRush) chance /= 4; - else if (masterMode) + else if (death) chance /= 2; if (chance < 2) @@ -450,7 +449,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.rand.NextBool(chance)) { - int maxHungriesBasedOnHP = (int)Math.Round(MathHelper.Lerp(masterMode ? 2f : 1f, masterMode ? 8f : 4f, npc.life / (float)npc.lifeMax)); + int maxHungriesBasedOnHP = (int)Math.Round(MathHelper.Lerp(death ? 2f : 1f, death ? 8f : 4f, npc.life / (float)npc.lifeMax)); if (NPC.CountNPCS(NPCID.TheHungry) < maxHungriesBasedOnHP) { int hungryAmt = 0; @@ -466,7 +465,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } int maxValue = 1 + hungryAmt * 2; - if (masterMode) + if (death) maxValue /= 2; if (maxValue < 2) @@ -513,21 +512,21 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses mouthYPosition = (mouthYPosition + Main.wofDrawAreaTop) / 2f; int eyeSpawn = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X, (int)mouthYPosition, NPCID.WallofFleshEye, npc.whoAmI); Main.npc[eyeSpawn].ai[0] = 1f; - if (masterMode) + if (death) Main.npc[eyeSpawn].ai[3] = 1f; mouthYPosition = (Main.wofDrawAreaBottom + Main.wofDrawAreaTop) / 2; mouthYPosition = (mouthYPosition + Main.wofDrawAreaBottom) / 2f; eyeSpawn = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X, (int)mouthYPosition, NPCID.WallofFleshEye, npc.whoAmI); Main.npc[eyeSpawn].ai[0] = -1f; - if (masterMode) + if (death) Main.npc[eyeSpawn].ai[3] = -1f; mouthYPosition = (Main.wofDrawAreaBottom + Main.wofDrawAreaTop) / 2; mouthYPosition = (mouthYPosition + Main.wofDrawAreaBottom) / 2f; - int maxHungries = masterMode ? 16 : 11; - float maxOffset = masterMode ? (0.2f / 3f) : 0.1f; + int maxHungries = death ? 16 : 11; + float maxOffset = death ? (0.2f / 3f) : 0.1f; for (int j = 0; j < maxHungries; j++) { int hungrySpawn = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X, (int)mouthYPosition, NPCID.TheHungry, npc.whoAmI); @@ -549,22 +548,25 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses return false; } + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + CalamityUtils.CalamityTargeting(npc, default); - float acceleration = Main.masterMode ? 0.15f : 0.12f; + float acceleration = death ? 0.15f : 0.12f; float distanceFromWall = 300f; npc.damage = npc.defDamage; npc.defense = npc.defDefense; if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.5) { - npc.damage = Main.masterMode ? 180 : 120; + npc.damage = death ? 180 : 120; npc.defense = 30; - acceleration += Main.masterMode ? 0.1f : 0.08f; + acceleration += death ? 0.1f : 0.08f; } else if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.75) { - npc.damage = Main.masterMode ? 135 : 90; + npc.damage = death ? 135 : 90; npc.defense = 20; - acceleration += Main.masterMode ? 0.05f : 0.04f; + acceleration += death ? 0.05f : 0.04f; } if (npc.whoAmI % 4 == 0) @@ -652,7 +654,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (wallLifeRatio < 0.1f) velocityBoost += 0.9f; - velocityBoost *= Main.masterMode ? 1.5f : 1.25f; + velocityBoost *= death ? 1.5f : 1.25f; velocityBoost += 0.3f; maxVelocity += velocityBoost * 0.35f; if (npc.Center.X < Main.npc[Main.wofNPCIndex].Center.X && Main.npc[Main.wofNPCIndex].velocity.X > 0f) @@ -701,7 +703,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); bool bossRush = BossRushEvent.BossRushActive; - bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; // Avoid cheap bullshit @@ -729,7 +730,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Velocity, direction, and position bool shouldFireLasers = true; float phase2LifeRatio = 0.5f; - bool masterModeDetach = lifeRatio < phase2LifeRatio && masterMode; + bool masterModeDetach = lifeRatio < phase2LifeRatio && death; bool canHit = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height); if (!masterModeDetach) { diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index e7165ba3ad..e67348f628 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -3037,7 +3037,7 @@ namespace CalamityMod.NPCs.Yharon if (BossRushEvent.BossRushActive) return; - CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType() }, DownedBossSystem.downedYharon); + CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType() }, DownedBossSystem.downedYharon); CalamityGlobalNPC.SetNewBossJustDowned(NPC); // If Yharon has not been killed yet, notify players of Auric Ore diff --git a/Packets/Worlds/WantToRefundReforgesPacket.cs b/Packets/Worlds/WantToRefundReforgesPacket.cs index fd019a0ab4..440cd6791b 100644 --- a/Packets/Worlds/WantToRefundReforgesPacket.cs +++ b/Packets/Worlds/WantToRefundReforgesPacket.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Packets if (!Main.dedServ) return; - int banditIdx = NPC.FindFirstNPC(ModContent.NPCType()); + int banditIdx = NPC.FindFirstNPC(ModContent.NPCType()); if (banditIdx == -1) return; @@ -37,7 +37,7 @@ namespace CalamityMod.Packets if (bandit == null || !bandit.active) return; - THIEF.DoRefund(bandit); + Bandit.DoRefund(bandit); } } } diff --git a/Particles/CustomSprite.cs b/Particles/CustomSprite.cs index 0b18707b4d..2fee8656b7 100644 --- a/Particles/CustomSprite.cs +++ b/Particles/CustomSprite.cs @@ -12,9 +12,8 @@ namespace CalamityMod.Particles { bool addBlend = false; bool important = false; - bool AffectedByGravity = false; - string Tex = ""; + Texture2D Tex; int frames = 1; int currentFrame = 1; @@ -31,6 +30,22 @@ namespace CalamityMod.Particles public override int FrameVariants => frames; public CustomSprite(Vector2 relativePosition, Vector2 velocity, int lifetime, string tex, float scale, Color color, float grav = 0f, bool AddativeBlend = true, bool needed = false, int frameCount = 1, int frame = 0) + { + maxGravity = grav; + Position = relativePosition; + Velocity = velocity; + Scale = scale; + Lifetime = lifetime; + addBlend = AddativeBlend; + important = needed; + Color = color; + Tex = ModContent.Request(tex).Value; + frames = frameCount; + currentFrame = frame; + } + + // Overload which takes a Texture2D instead of a string for the texture to use + public CustomSprite(Vector2 relativePosition, Vector2 velocity, int lifetime, Texture2D tex, float scale, Color color, float grav = 0f, bool AddativeBlend = true, bool needed = false, int frameCount = 1, int frame = 0) { maxGravity = grav; Position = relativePosition; @@ -70,11 +85,9 @@ namespace CalamityMod.Particles public override void CustomDraw(SpriteBatch spriteBatch) { - Asset tex = ModContent.Request(Tex); + Rectangle fr = Tex.Frame(1, frames, 0, currentFrame); - Rectangle fr = tex.Frame(1, frames, 0, currentFrame); - - Main.EntitySpriteDraw(tex.Value, Position - Main.screenPosition, fr, Color.Lerp(Color.Transparent, Color, Opacity), Rotation, new Vector2(tex.Width() * 0.5f, tex.Height() / frames * 0.5f), 1f, SpriteEffects.None); + Main.EntitySpriteDraw(Tex, Position - Main.screenPosition, fr, Color.Lerp(Color.Transparent, Color, Opacity), Rotation, new Vector2(Tex.Width * 0.5f, Tex.Height / frames * 0.5f), 1f, SpriteEffects.None); } } } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 5592b1d952..3094503635 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -526,7 +526,7 @@ namespace CalamityMod.Projectiles homingEndTime += 60f; // Stop homing when within a certain distance of the target - if (Vector2.Distance(projectile.Center, Main.player[num133].Center) < (revSkeletronPrimeHomingSkull ? (((Main.masterMode && CalamityWorld.revenge) || BossRushEvent.BossRushActive) ? 192f : 120f) : 96f) && projectile.ai[1] < homingEndTime) + if (Vector2.Distance(projectile.Center, Main.player[num133].Center) < (revSkeletronPrimeHomingSkull ? ((CalamityWorld.death || BossRushEvent.BossRushActive) ? 192f : 120f) : 96f) && projectile.ai[1] < homingEndTime) projectile.ai[1] = homingEndTime; if (projectile.ai[1] < homingEndTime && projectile.ai[1] > homingStartTime) @@ -1246,16 +1246,16 @@ namespace CalamityMod.Projectiles else if (projectile.type == ProjectileID.HallowBossRainbowStreak && projectile.hostile) { - bool revMasterMode = (Main.masterMode && CalamityWorld.revenge) || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; bool spreadOut = false; bool homeIn = false; float spreadOutCutoffTime = EmpressRainbowStreakSpreadOutCutoff; - float homeInCutoffTime = NPC.ShouldEmpressBeEnraged() ? (revMasterMode ? 55f : 65f) : (revMasterMode ? 70f : 80f); + float homeInCutoffTime = NPC.ShouldEmpressBeEnraged() ? (death ? 55f : 65f) : (death ? 70f : 80f); float spreadDeceleration = 0.97f; - float minAcceleration = revMasterMode ? 0.075f : 0.05f; - float maxAcceleration = revMasterMode ? 0.15f : 0.1f; - float homingVelocity = revMasterMode ? 36f : 30f; + float minAcceleration = death ? 0.075f : 0.05f; + float maxAcceleration = death ? 0.15f : 0.1f; + float homingVelocity = death ? 36f : 30f; float maxVelocity = homingVelocity * 1.5f; float accelerationToMaxVelocity = 1.01f; @@ -4223,6 +4223,26 @@ namespace CalamityMod.Projectiles } #endregion + #region On Hit NPC + public override void OnHitNPC(Projectile projectile, NPC target, NPC.HitInfo hit, int damageDone) + { + // Implementation of shared static iframes. + // If this projectile does not use static iframes, or is not registered to share them, then do nothing. + if (!projectile.usesIDStaticNPCImmunity || !SharedStaticIFrames.Includes(projectile.type)) + return; + + // Get the set of shared static iframe projectile types. + // If it's empty, then do nothing. + IList sharedWithProjectiles = SharedStaticIFrames.GetSharedStaticIFrames(projectile.type); + if (sharedWithProjectiles.Count <= 0) + return; + + // Apply the appropriate shared static iframes to all projectile types with which it is shared. + foreach (int projType in sharedWithProjectiles) + Projectile.perIDStaticNPCImmunity[projType][target.whoAmI] = Main.GameUpdateCount + (uint)projectile.idStaticNPCHitCooldown; + } + #endregion + #region Can Damage + Can Hit public override bool? CanDamage(Projectile projectile) { diff --git a/Projectiles/CalamityGlobalProjectileTweaks.cs b/Projectiles/CalamityGlobalProjectileTweaks.cs index ca4d8b8321..f443bd8369 100644 --- a/Projectiles/CalamityGlobalProjectileTweaks.cs +++ b/Projectiles/CalamityGlobalProjectileTweaks.cs @@ -16,13 +16,13 @@ namespace CalamityMod.Projectiles { // Various shorthands for projectiles which receive very simple changes, such as setting one flag. IProjectileTweak[] defenseDamage = Do(DefenseDamage); - IProjectileTweak[] trueMelee = Do(TrueMelee); - IProjectileTweak[] trueMeleeNoSpeed = Do(TrueMeleeNoSpeed); + IProjectileTweak[] trueMelee = Do(TrueMelee, DefaultIDStaticIFrames); // All the tweaked true melee projectiles need to be changed from global to static as well + IProjectileTweak[] trueMeleeNoSpeed = Do(TrueMeleeNoSpeed, DefaultIDStaticIFrames); IProjectileTweak[] pointBlank = Do(PointBlank); IProjectileTweak[] standardBulletTweaks = Do(PointBlank, ExtraUpdatesDelta(+2)); IProjectileTweak[] standardChainsawTweaks = Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+15), LocalIFrames(5)); IProjectileTweak[] standardDrillTweaks = Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+25), LocalIFrames(5)); - IProjectileTweak[] counterweightTweaks = Do(MaxUpdatesExact(2), IDStaticIFrames(10)); + IProjectileTweak[] counterweightTweaks = Do(MaxUpdatesExact(2), DefaultIDStaticIFrames); // Shorthand for changing all the stats of a yoyo at once. This handles extra update related math for you. // For topSpeed, put in how fast you want the yoyo to be EXACTLY: it will be divided out in extra updates for you. @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles { ProjectileID.Gradient, RebalanceYoyo(-1f, 384f, 36f, 1, 12) }, // original: 12s lifetime | 275px range | 15px/f top speed | 0 extra updates - { ProjectileID.HelFire, RebalanceYoyo(-1f, 368f, 42f, 2, 12) }, + { ProjectileID.HelFire, RebalanceYoyo(-1f, 352f, 42f, 2, 12) }, // original: 11s lifetime | 225px range | 14px/f top speed | 0 extra updates { ProjectileID.HiveFive, RebalanceYoyo(24f, 320f, 20f, 0, 15) }, @@ -116,14 +116,14 @@ namespace CalamityMod.Projectiles { ProjectileID.AdamantiteChainsaw, standardChainsawTweaks }, { ProjectileID.AdamantiteDrill, standardDrillTweaks }, { ProjectileID.AdamantiteGlaive, Do(TrueMelee, LocalIFrames(7)) }, - { ProjectileID.Anchor, Do(ExtraUpdatesExact(1)) }, - { ProjectileID.Arkhalis, Do(TrueMeleeNoSpeed, ScaleExact(1.25f)) }, - { ProjectileID.Bee, Do(PiercingExact(2)) }, - { ProjectileID.BeeArrow, Do(PointBlank, ExtraUpdatesExact(1)) }, + { ProjectileID.Anchor, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, + { ProjectileID.Arkhalis, Do(TrueMeleeNoSpeed, ScaleExact(1.25f), IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes + { ProjectileID.Bee, Do(PiercingExact(2), DefaultIDStaticIFrames) }, + { ProjectileID.BeeArrow, Do(PointBlank, ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.BlackCounterweight, counterweightTweaks }, { ProjectileID.BlueCounterweight, counterweightTweaks }, { ProjectileID.BlueMoon, Do(ExtraUpdatesExact(1)) }, - { ProjectileID.Bullet, standardBulletTweaks }, + { ProjectileID.Bullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.BulletHighVelocity, Do(PointBlank, LocalIFrames(-1)) }, { ProjectileID.ButchersChainsaw, Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+15), LocalIFrames(5), ScaleExact(1.5f)) }, { ProjectileID.ChlorophyteChainsaw, standardChainsawTweaks }, @@ -132,45 +132,45 @@ namespace CalamityMod.Projectiles { ProjectileID.CobaltChainsaw, standardChainsawTweaks }, { ProjectileID.CobaltDrill, standardDrillTweaks }, { ProjectileID.CobaltNaginata, Do(TrueMelee, LocalIFrames(9)) }, - { ProjectileID.CrystalBullet, standardBulletTweaks }, + { ProjectileID.CrystalBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.CrystalVileShardHead, Do(LocalIFrames(23)) }, { ProjectileID.CrystalVileShardShaft, Do(LocalIFrames(23)) }, - { ProjectileID.CursedBullet, standardBulletTweaks }, + { ProjectileID.CursedBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.ClusterRocketI, Do(LocalIFrames(15)) }, { ProjectileID.ClusterFragmentsI, Do(IDStaticIFrames(15)) }, { ProjectileID.ClusterRocketII, Do(LocalIFrames(15)) }, { ProjectileID.ClusterFragmentsII, Do(IDStaticIFrames(15)) }, - { ProjectileID.ClusterSnowmanRocketI, Do(LocalIFrames(15)) }, + { ProjectileID.ClusterSnowmanRocketI, Do(LocalIFrames(15)) }, { ProjectileID.ClusterSnowmanRocketII, Do(LocalIFrames(15)) }, - { ProjectileID.DD2SquireSonicBoom, Do(PiercingExact(3)) }, // Flying Dragon + { ProjectileID.DD2SquireSonicBoom, Do(PiercingExact(3), DefaultIDStaticIFrames) }, // Flying Dragon { ProjectileID.EmeraldBolt, Do(NoPiercing) }, { ProjectileID.EmpressBlade, Do(LocalIFrames(30)) }, // Terraprisma - { ProjectileID.EnchantedBoomerang, Do(ExtraUpdatesExact(1)) }, - { ProjectileID.ExplosiveBullet, standardBulletTweaks }, + { ProjectileID.EnchantedBoomerang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, + { ProjectileID.ExplosiveBullet, Do(PointBlank, ExtraUpdatesDelta(+2), IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes { ProjectileID.FairyQueenRangedItemShot, Do(PiercingExact(7), ExtraUpdatesExact(1)) }, // Eventide Convert - { ProjectileID.FlaironBubble, Do(ExtraUpdatesExact(1), TimeLeftExact(150)) }, - { ProjectileID.Flamarang, Do(ExtraUpdatesExact(2)) }, + { ProjectileID.FlaironBubble, Do(ExtraUpdatesExact(1), TimeLeftExact(150), DefaultIDStaticIFrames) }, + { ProjectileID.Flamarang, Do(ExtraUpdatesExact(2), DefaultIDStaticIFrames) }, { ProjectileID.Flames, Do(IDStaticIFrames(5)) }, // Flamethrower AND Elf Melter flames - { ProjectileID.FlamingJack, Do(ExtraUpdatesExact(1)) }, + { ProjectileID.FlamingJack, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.FlowerPetal, Do(MaxUpdatesExact(4), LocalIFrames(10)) }, // Orichalcum armor { ProjectileID.FlowerPow, Do(ExtraUpdatesExact(1)) }, - { ProjectileID.FlyingKnife, Do(ExtraUpdatesExact(1)) }, - { ProjectileID.FrostBoltStaff, Do(ExtraUpdatesExact(1)) }, - { ProjectileID.FruitcakeChakram, Do(ExtraUpdatesExact(1)) }, - { ProjectileID.GiantBee, Do(PiercingExact(2)) }, + { ProjectileID.FlyingKnife, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, + { ProjectileID.FrostBoltStaff, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, + { ProjectileID.FruitcakeChakram, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, + { ProjectileID.GiantBee, Do(PiercingExact(2), DefaultIDStaticIFrames) }, { ProjectileID.GladiusStab, Do(TrueMelee, LocalIFrames(-1)) }, - { ProjectileID.GoldenBullet, standardBulletTweaks }, - { ProjectileID.GoldenShowerFriendly, Do(PiercingExact(2)) }, + { ProjectileID.GoldenBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, + { ProjectileID.GoldenShowerFriendly, Do(PiercingExact(2), DefaultIDStaticIFrames) }, { ProjectileID.GreenCounterweight, counterweightTweaks }, { ProjectileID.Hamdrax, standardDrillTweaks }, // Drax (never internally renamed since 1.1) - { ProjectileID.IceBoomerang, Do(ExtraUpdatesExact(1)) }, + { ProjectileID.IceBoomerang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.IceSickle, Do(ExtraUpdatesExact(1)) }, - { ProjectileID.IchorBullet, standardBulletTweaks }, - { ProjectileID.InfluxWaver, Do(ExtraUpdatesExact(1)) }, - { ProjectileID.InfernoFriendlyBolt, Do(ExtraUpdatesExact(1)) }, - { ProjectileID.InfernoFriendlyBlast, Do(ExtraUpdatesExact(2)) }, + { ProjectileID.IchorBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, + { ProjectileID.InfluxWaver, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, + { ProjectileID.InfernoFriendlyBolt, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, + { ProjectileID.InfernoFriendlyBlast, Do(ExtraUpdatesExact(2), DefaultIDStaticIFrames) }, { ProjectileID.LaserDrill, Do(ArmorPenetrationDelta(+25), LocalIFrames(5)) }, - { ProjectileID.LightDisc, Do(MaxUpdatesExact(3)) }, + { ProjectileID.LightDisc, Do(MaxUpdatesExact(3), DefaultIDStaticIFrames) }, { ProjectileID.LostSoulHostile, Do(TileCollide) }, // Ragged Caster { ProjectileID.MeteorShot, standardBulletTweaks }, { ProjectileID.Meowmere, Do(PiercingExact(3), LocalIFrames(-1)) }, @@ -181,14 +181,14 @@ namespace CalamityMod.Projectiles { ProjectileID.MythrilChainsaw, standardChainsawTweaks }, { ProjectileID.MythrilDrill, standardDrillTweaks }, { ProjectileID.MythrilHalberd, Do(TrueMelee, LocalIFrames(8)) }, - { ProjectileID.NanoBullet, standardBulletTweaks }, + { ProjectileID.NanoBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.NebulaDrill, standardDrillTweaks }, { ProjectileID.NebulaLaser, Do(ExtraUpdatesDelta(-1)) }, { ProjectileID.OrichalcumChainsaw, standardChainsawTweaks }, { ProjectileID.OrichalcumDrill, standardDrillTweaks }, { ProjectileID.PalladiumChainsaw, standardChainsawTweaks }, { ProjectileID.PalladiumDrill, standardDrillTweaks }, - { ProjectileID.PartyBullet, standardBulletTweaks }, + { ProjectileID.PartyBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.PoisonFang, Do(LocalIFrames(10)) }, { ProjectileID.PurpleCounterweight, counterweightTweaks }, { ProjectileID.QueenSlimeGelAttack, Do(NoPiercing) }, @@ -200,20 +200,20 @@ namespace CalamityMod.Projectiles { ProjectileID.RocketFireworkYellow, Do(TimeLeftDelta(+45)) }, { ProjectileID.SawtoothShark, Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+15), LocalIFrames(6)) }, { ProjectileID.ShadowBeamHostile, Do(ExtraUpdatesExact(1)) }, - { ProjectileID.Shroomerang, Do(ExtraUpdatesExact(1)) }, + { ProjectileID.Shroomerang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.SolarFlareDrill, standardDrillTweaks }, { ProjectileID.StardustDrill, standardDrillTweaks }, - { ProjectileID.Starfury, Do(TimeLeftExact(75)) }, + { ProjectileID.Starfury, Do(TimeLeftExact(75), DefaultIDStaticIFrames) }, { ProjectileID.StarWrath, Do(NoPiercing) }, { ProjectileID.Sunfury, Do(ExtraUpdatesExact(1)) }, - { ProjectileID.SwordBeam, Do(ExtraUpdatesExact(2)) }, // Beam Sword projectile - { ProjectileID.Terragrim, Do(TrueMeleeNoSpeed, ScaleExact(1.25f)) }, - { ProjectileID.ThunderStaffShot, Do(PiercingExact(3)) }, //Thunder Zapper projectile + { ProjectileID.SwordBeam, Do(ExtraUpdatesExact(2), DefaultIDStaticIFrames) }, // Beam Sword projectile + { ProjectileID.Terragrim, Do(TrueMeleeNoSpeed, ScaleExact(1.25f), IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes + { ProjectileID.ThunderStaffShot, Do(PiercingExact(3), DefaultIDStaticIFrames) }, //Thunder Zapper projectile { ProjectileID.TitaniumChainsaw, standardChainsawTweaks }, { ProjectileID.TitaniumDrill, standardDrillTweaks }, - { ProjectileID.Trimarang, Do(ExtraUpdatesExact(1)) }, + { ProjectileID.Trimarang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.TrueNightsEdge, Do(PiercingExact(4)) }, - { ProjectileID.VenomBullet, standardBulletTweaks }, + { ProjectileID.VenomBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.VenomFang, Do(LocalIFrames(10)) }, { ProjectileID.VortexDrill, standardDrillTweaks }, { ProjectileID.Wasp, Do(PiercingExact(2)) }, @@ -236,7 +236,7 @@ namespace CalamityMod.Projectiles { ProjectileID.ObsidianSwordfish, trueMelee }, { ProjectileID.OrichalcumHalberd, trueMelee }, { ProjectileID.PalladiumPike, trueMelee }, - { ProjectileID.PiercingStarlight, trueMelee }, + { ProjectileID.PiercingStarlight, Do(TrueMelee, IDStaticIFrames(4)) }, // Has an exception in Vanilla iframe code, uses 4 iframes { ProjectileID.PlatinumShortswordStab, trueMelee }, { ProjectileID.RulerStab, trueMelee }, { ProjectileID.ShadowJoustingLance, trueMelee }, @@ -254,41 +254,41 @@ namespace CalamityMod.Projectiles #endregion #region CATEGORY 4: Point Blank support - { ProjectileID.Blizzard, pointBlank }, // Blizzard Staff projectiles, re-used in Frostbite Blaster. - { ProjectileID.BlueFlare, pointBlank }, - { ProjectileID.BoneArrow, pointBlank }, - { ProjectileID.CandyCorn, pointBlank }, - { ProjectileID.ChlorophyteArrow, pointBlank }, - { ProjectileID.ChlorophyteBullet, pointBlank }, - { ProjectileID.CrimsandBallGun, pointBlank }, - { ProjectileID.CrystalDart, pointBlank }, - { ProjectileID.CursedArrow, pointBlank }, - { ProjectileID.CursedDart, pointBlank }, + { ProjectileID.Blizzard, Do(PointBlank, DefaultIDStaticIFrames) }, // Blizzard Staff projectiles, re-used in Frostbite Blaster. + { ProjectileID.BlueFlare, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.BoneArrow, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.CandyCorn, Do(PointBlank, IDStaticIFrames(7)) }, // Has an exception in Vanilla iframe code, uses 7 iframes + { ProjectileID.ChlorophyteArrow, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.ChlorophyteBullet, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.CrimsandBallGun, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.CrystalDart, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.CursedArrow, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.CursedDart, Do(PointBlank, DefaultIDStaticIFrames) }, { ProjectileID.DD2PhoenixBowShot, pointBlank }, // Phantom Phoenix - { ProjectileID.EbonsandBallGun, pointBlank }, - { ProjectileID.FireArrow, pointBlank }, - { ProjectileID.Flare, pointBlank }, - { ProjectileID.FrostburnArrow, pointBlank }, + { ProjectileID.EbonsandBallGun, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.FireArrow, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.Flare, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.FrostburnArrow, Do(PointBlank, DefaultIDStaticIFrames) }, { ProjectileID.Harpoon, pointBlank }, - { ProjectileID.Hellwing, pointBlank }, - { ProjectileID.HellfireArrow, pointBlank }, - { ProjectileID.HolyArrow, pointBlank }, - { ProjectileID.IchorArrow, pointBlank }, - { ProjectileID.JestersArrow, pointBlank }, + { ProjectileID.Hellwing, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.HellfireArrow, Do(PointBlank, ExtraUpdatesDelta(+2)) }, + { ProjectileID.HolyArrow, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.IchorArrow, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.JestersArrow, Do(PointBlank, DefaultIDStaticIFrames) }, { ProjectileID.MoonlordArrow, pointBlank }, // Luminite Arrow - { ProjectileID.PainterPaintball, pointBlank }, - { ProjectileID.PearlSandBallGun, pointBlank }, - { ProjectileID.PhantasmArrow, pointBlank }, - { ProjectileID.PoisonDartBlowgun, pointBlank }, - { ProjectileID.PulseBolt, pointBlank }, - { ProjectileID.SandBallGun, pointBlank }, - { ProjectileID.Seed, pointBlank }, - { ProjectileID.ShadowFlameArrow, pointBlank }, - { ProjectileID.SnowBallFriendly, pointBlank }, - { ProjectileID.Stake, pointBlank }, - { ProjectileID.UnholyArrow, pointBlank }, - { ProjectileID.VenomArrow, pointBlank }, - { ProjectileID.WoodenArrowFriendly, pointBlank }, + { ProjectileID.PainterPaintball, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.PearlSandBallGun, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.PhantasmArrow, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.PoisonDartBlowgun, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.PulseBolt, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.SandBallGun, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.Seed, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.ShadowFlameArrow, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.SnowBallFriendly, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.Stake, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.UnholyArrow, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.VenomArrow, Do(PointBlank, DefaultIDStaticIFrames) }, + { ProjectileID.WoodenArrowFriendly, Do(PointBlank, DefaultIDStaticIFrames) }, #endregion #region CATEGORY 5: Defense Damage support @@ -327,6 +327,319 @@ namespace CalamityMod.Projectiles { ProjectileID.ThornBall, Do(Main.zenithWorld ? IgnoreWater : DontIgnoreWater, DefenseDamage) }, // Plantera bouncing thorn balls { ProjectileID.UnholyTridentHostile, defenseDamage }, #endregion + + #region CATEGORY 6: Static Iframe changes + {ProjectileID.AbigailCounter, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Ale, Do(DefaultIDStaticIFrames)}, + {ProjectileID.AmberBolt, Do(DefaultIDStaticIFrames)}, + {ProjectileID.AmethystBolt, Do(DefaultIDStaticIFrames)}, + {ProjectileID.AshBallFalling, Do(DefaultIDStaticIFrames)}, + {ProjectileID.BallofFire, Do(DefaultIDStaticIFrames)}, + {ProjectileID.BallofFrost, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Bananarang, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Bat, Do(DefaultIDStaticIFrames)}, + {ProjectileID.BeeHive, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Beenade, Do(DefaultIDStaticIFrames)}, + {ProjectileID.BlackCat, Do(DefaultIDStaticIFrames)}, + {ProjectileID.BloodArrow, Do(DefaultIDStaticIFrames)}, + {ProjectileID.BloodButcherer, Do(DefaultIDStaticIFrames)}, + {ProjectileID.BloodNautilusTears, Do(DefaultIDStaticIFrames)}, + {ProjectileID.BloodWater, Do(DefaultIDStaticIFrames)}, + {ProjectileID.BloodyMachete, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Bomb, Do(DefaultIDStaticIFrames)}, + {ProjectileID.BombFish, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Bone, Do(DefaultIDStaticIFrames)}, + {ProjectileID.BoneArrowFromMerchant, Do(DefaultIDStaticIFrames)}, + {ProjectileID.BoneDagger, Do(DefaultIDStaticIFrames)}, + {ProjectileID.BoneJavelin, Do(DefaultIDStaticIFrames)}, + {ProjectileID.BookOfSkullsSkull, Do(DefaultIDStaticIFrames)}, + {ProjectileID.BookStaffShot, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Boulder, Do(DefaultIDStaticIFrames)}, + {ProjectileID.BoulderStaffOfEarth, Do(DefaultIDStaticIFrames)}, + {ProjectileID.BouncyBomb, Do(DefaultIDStaticIFrames)}, + {ProjectileID.BouncyBoulder, Do(DefaultIDStaticIFrames)}, + {ProjectileID.BouncyDynamite, Do(DefaultIDStaticIFrames)}, + {ProjectileID.BouncyGrenade, Do(DefaultIDStaticIFrames)}, + {ProjectileID.BoxingGlove, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Bubble, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Bunny, Do(DefaultIDStaticIFrames)}, + {ProjectileID.CannonballFriendly, Do(DefaultIDStaticIFrames)}, + {ProjectileID.CavelingGardener, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Celeb2Rocket, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Celeb2RocketExplosive, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Celeb2RocketExplosiveLarge, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Celeb2RocketLarge, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Celeb2Weapon, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ChainGuillotine, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ChainKnife, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ChargedBlasterCannon, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ChargedBlasterLaser, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ChargedBlasterOrb, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ChlorophytePartisan, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ClothiersCurse, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ClusterMineI, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ClusterMineII, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ClusterSnowmanFragmentsI, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ClusterSnowmanFragmentsII, Do(DefaultIDStaticIFrames)}, + {ProjectileID.CoinPortal, Do(DefaultIDStaticIFrames)}, + {ProjectileID.CombatWrench, Do(IDStaticIFrames(7))}, // Has an exception in Vanilla iframe code, uses 7 iframes + {ProjectileID.CopperCoin, Do(DefaultIDStaticIFrames)}, + {ProjectileID.CorruptSpray, Do(DefaultIDStaticIFrames)}, + {ProjectileID.CrimsandBallFalling, Do(DefaultIDStaticIFrames)}, + {ProjectileID.CrimsonHeart, Do(DefaultIDStaticIFrames)}, + {ProjectileID.CrimsonSpray, Do(DefaultIDStaticIFrames)}, + {ProjectileID.CrystalLeaf, Do(DefaultIDStaticIFrames)}, + {ProjectileID.CrystalLeafShot, Do(DefaultIDStaticIFrames)}, + {ProjectileID.CrystalPulse, Do(DefaultIDStaticIFrames)}, + {ProjectileID.CrystalPulse2, Do(DefaultIDStaticIFrames)}, + {ProjectileID.CrystalShard, Do(DefaultIDStaticIFrames)}, + {ProjectileID.CrystalStorm, Do(DefaultIDStaticIFrames)}, + {ProjectileID.CursedDartFlame, Do(DefaultIDStaticIFrames)}, + {ProjectileID.CursedFlameFriendly, Do(DefaultIDStaticIFrames)}, + {ProjectileID.CursedFlare, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Daybreak, Do(DefaultIDStaticIFrames)}, + {ProjectileID.DD2PhoenixBow, Do(DefaultIDStaticIFrames)}, + {ProjectileID.DemonScythe, Do(DefaultIDStaticIFrames)}, + {ProjectileID.DiamondBolt, Do(DefaultIDStaticIFrames)}, + {ProjectileID.DirtBall, Do(DefaultIDStaticIFrames)}, + {ProjectileID.DirtBomb, Do(DefaultIDStaticIFrames)}, + {ProjectileID.DirtSpray, Do(DefaultIDStaticIFrames)}, + {ProjectileID.DirtStickyBomb, Do(DefaultIDStaticIFrames)}, + {ProjectileID.DripplerFlailExtraBall, Do(DefaultIDStaticIFrames)}, + {ProjectileID.DryadsWardCircle, Do(DefaultIDStaticIFrames)}, + {ProjectileID.DryBomb, Do(DefaultIDStaticIFrames)}, + {ProjectileID.DryMine, Do(DefaultIDStaticIFrames)}, + {ProjectileID.DryRocket, Do(DefaultIDStaticIFrames)}, + {ProjectileID.DrySnowmanRocket, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Dynamite, Do(DefaultIDStaticIFrames)}, + {ProjectileID.EatersBite, Do(DefaultIDStaticIFrames)}, + {ProjectileID.EbonsandBallFalling, Do(DefaultIDStaticIFrames)}, + {ProjectileID.EighthNote, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Electrosphere, Do(IDStaticIFrames(8))}, // Has an exception in Vanilla iframe code, uses 8 iframes + {ProjectileID.ElectrosphereMissile, Do(DefaultIDStaticIFrames)}, + {ProjectileID.EnchantedBeam, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Explosives, Do(DefaultIDStaticIFrames)}, + {ProjectileID.FallingStar, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Flairon, Do(DefaultIDStaticIFrames)}, + {ProjectileID.FlamesTrap, Do(DefaultIDStaticIFrames)}, + {ProjectileID.FlowerPowPetal, Do(DefaultIDStaticIFrames)}, + {ProjectileID.FrostArrow, Do(DefaultIDStaticIFrames)}, + {ProjectileID.FrostDaggerfish, Do(DefaultIDStaticIFrames)}, + {ProjectileID.GasTrap, Do(DefaultIDStaticIFrames)}, + {ProjectileID.GelBalloon, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Geode, Do(DefaultIDStaticIFrames)}, + {ProjectileID.GeyserTrap, Do(DefaultIDStaticIFrames)}, + {ProjectileID.GoldCoin, Do(DefaultIDStaticIFrames)}, + {ProjectileID.GolemFist, Do(DefaultIDStaticIFrames)}, + {ProjectileID.GreenLaser, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Grenade, Do(DefaultIDStaticIFrames)}, + {ProjectileID.HallowSpray, Do(DefaultIDStaticIFrames)}, + {ProjectileID.HallowStar, Do(DefaultIDStaticIFrames)}, + {ProjectileID.HeatRay, Do(DefaultIDStaticIFrames)}, + {ProjectileID.HolyWater, Do(DefaultIDStaticIFrames)}, + {ProjectileID.HoneyBomb, Do(DefaultIDStaticIFrames)}, + {ProjectileID.HoneyGrenade, Do(DefaultIDStaticIFrames)}, + {ProjectileID.HoneyMine, Do(DefaultIDStaticIFrames)}, + {ProjectileID.HoneyRocket, Do(DefaultIDStaticIFrames)}, + {ProjectileID.HoneySnowmanRocket, Do(DefaultIDStaticIFrames)}, + {ProjectileID.HornetStinger, Do(DefaultIDStaticIFrames)}, + {ProjectileID.HoundiusShootiusFireball, Do(DefaultIDStaticIFrames)}, + {ProjectileID.IceBlock, Do(DefaultIDStaticIFrames)}, + {ProjectileID.IceBolt, Do(DefaultIDStaticIFrames)}, + {ProjectileID.IchorDart, Do(DefaultIDStaticIFrames)}, + {ProjectileID.JackOLantern, Do(DefaultIDStaticIFrames)}, + {ProjectileID.JavelinFriendly, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Landmine, Do(DefaultIDStaticIFrames)}, + {ProjectileID.LaserMachinegun, Do(DefaultIDStaticIFrames)}, + {ProjectileID.LaserMachinegunLaser, Do(DefaultIDStaticIFrames)}, + {ProjectileID.LastPrism, Do(DefaultIDStaticIFrames)}, + {ProjectileID.LastPrismLaser, Do(IDStaticIFrames(5))}, // Has an exception in Vanilla iframe code, uses 5 iframes + {ProjectileID.LavaBomb, Do(DefaultIDStaticIFrames)}, + {ProjectileID.LavaMine, Do(DefaultIDStaticIFrames)}, + {ProjectileID.LavaRocket, Do(DefaultIDStaticIFrames)}, + {ProjectileID.LavaSnowmanRocket, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Leaf, Do(DefaultIDStaticIFrames)}, + {ProjectileID.LifeCrystalBoulder, Do(DefaultIDStaticIFrames)}, + {ProjectileID.MagicMissile, Do(IDStaticIFrames(8))}, // Has an exception in Vanilla iframe code, uses 8 iframes + {ProjectileID.MagnetSphereBolt, Do(DefaultIDStaticIFrames)}, + {ProjectileID.MechanicWrench, Do(IDStaticIFrames(7))}, // Has an exception in Vanilla iframe code, uses 7 iframes + {ProjectileID.MedusaHead, Do(DefaultIDStaticIFrames)}, + {ProjectileID.MedusaHeadRay, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Meteor1, Do(IDStaticIFrames(5))}, // Has an exception in Vanilla iframe code, uses 5 iframes + {ProjectileID.Meteor2, Do(IDStaticIFrames(5))}, // Has an exception in Vanilla iframe code, uses 5 iframes + {ProjectileID.Meteor3, Do(IDStaticIFrames(5))}, // Has an exception in Vanilla iframe code, uses 5 iframes + {ProjectileID.MinecartMechLaser, Do(DefaultIDStaticIFrames)}, + {ProjectileID.MiniBoulder, Do(DefaultIDStaticIFrames)}, + {ProjectileID.MiniMinotaur, Do(DefaultIDStaticIFrames)}, + {ProjectileID.MiniNukeMineI, Do(DefaultIDStaticIFrames)}, + {ProjectileID.MiniNukeMineII, Do(DefaultIDStaticIFrames)}, + {ProjectileID.MiniNukeRocketI, Do(DefaultIDStaticIFrames)}, + {ProjectileID.MiniNukeRocketII, Do(DefaultIDStaticIFrames)}, + {ProjectileID.MiniNukeSnowmanRocketI, Do(DefaultIDStaticIFrames)}, + {ProjectileID.MiniNukeSnowmanRocketII, Do(DefaultIDStaticIFrames)}, + {ProjectileID.MiniRetinaLaser, Do(DefaultIDStaticIFrames)}, + {ProjectileID.MiniSharkron, Do(DefaultIDStaticIFrames)}, + {ProjectileID.MolotovCocktail, Do(DefaultIDStaticIFrames)}, + {ProjectileID.MolotovFire, Do(DefaultIDStaticIFrames)}, + {ProjectileID.MolotovFire2, Do(DefaultIDStaticIFrames)}, + {ProjectileID.MolotovFire3, Do(DefaultIDStaticIFrames)}, + {ProjectileID.MonkStaffT3_AltShot, Do(DefaultIDStaticIFrames)}, + {ProjectileID.MudBall, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Mushroom, Do(DefaultIDStaticIFrames)}, + {ProjectileID.MushroomSpray, Do(DefaultIDStaticIFrames)}, + {ProjectileID.NailFriendly, Do(IDStaticIFrames(1))}, // Has an exception in Vanilla iframe code, uses 1 iframe + {ProjectileID.NebulaArcanumExplosionShot, Do(DefaultIDStaticIFrames)}, + {ProjectileID.NebulaArcanumExplosionShotShard, Do(DefaultIDStaticIFrames)}, + {ProjectileID.NebulaBlaze1, Do(IDStaticIFrames(5))}, // Has an exception in Vanilla iframe code, uses 5 iframes + {ProjectileID.NebulaBlaze2, Do(IDStaticIFrames(5))}, // Has an exception in Vanilla iframe code, uses 5 iframes + {ProjectileID.NettleBurstEnd, Do(DefaultIDStaticIFrames)}, + {ProjectileID.NettleBurstLeft, Do(DefaultIDStaticIFrames)}, + {ProjectileID.NettleBurstRight, Do(DefaultIDStaticIFrames)}, + {ProjectileID.NightBeam, Do(DefaultIDStaticIFrames)}, + {ProjectileID.NorthPoleSnowflake, Do(DefaultIDStaticIFrames)}, + {ProjectileID.NorthPoleSpear, Do(DefaultIDStaticIFrames)}, + {ProjectileID.NorthPoleWeapon, Do(DefaultIDStaticIFrames)}, + {ProjectileID.NurseSyringeHeal, Do(DefaultIDStaticIFrames)}, + {ProjectileID.NurseSyringeHurt, Do(DefaultIDStaticIFrames)}, + {ProjectileID.OrnamentFriendly, Do(DefaultIDStaticIFrames)}, + {ProjectileID.OrnamentStar, Do(DefaultIDStaticIFrames)}, + {ProjectileID.PaladinsHammerFriendly, Do(DefaultIDStaticIFrames)}, + {ProjectileID.PaperAirplaneA, Do(DefaultIDStaticIFrames)}, + {ProjectileID.PaperAirplaneB, Do(DefaultIDStaticIFrames)}, + {ProjectileID.PartyGirlGrenade, Do(DefaultIDStaticIFrames)}, + {ProjectileID.PearlSandBallFalling, Do(DefaultIDStaticIFrames)}, + {ProjectileID.PewMaticHornShot, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Phantasm, Do(DefaultIDStaticIFrames)}, + {ProjectileID.PineNeedleFriendly, Do(DefaultIDStaticIFrames)}, + {ProjectileID.PlatinumCoin, Do(DefaultIDStaticIFrames)}, + {ProjectileID.PoisonDart, Do(DefaultIDStaticIFrames)}, + {ProjectileID.PoisonDartTrap, Do(DefaultIDStaticIFrames)}, + {ProjectileID.PoisonedKnife, Do(DefaultIDStaticIFrames)}, + {ProjectileID.PossessedHatchet, Do(DefaultIDStaticIFrames)}, + {ProjectileID.PrincessWeapon, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ProximityMineI, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ProximityMineII, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ProximityMineIII, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ProximityMineIV, Do(DefaultIDStaticIFrames)}, + {ProjectileID.PureSpray, Do(DefaultIDStaticIFrames)}, + {ProjectileID.PurificationPowder, Do(DefaultIDStaticIFrames)}, + {ProjectileID.PurpleLaser, Do(DefaultIDStaticIFrames)}, + {ProjectileID.PygmySpear, Do(DefaultIDStaticIFrames)}, + {ProjectileID.QuarterNote, Do(DefaultIDStaticIFrames)}, + {ProjectileID.RainbowFlare, Do(DefaultIDStaticIFrames)}, + {ProjectileID.RocketFireworksBoxBlue, Do(DefaultIDStaticIFrames)}, + {ProjectileID.RocketFireworksBoxGreen, Do(DefaultIDStaticIFrames)}, + {ProjectileID.RocketFireworksBoxRed, Do(DefaultIDStaticIFrames)}, + {ProjectileID.RocketFireworksBoxYellow, Do(DefaultIDStaticIFrames)}, + {ProjectileID.RocketI, Do(DefaultIDStaticIFrames)}, + {ProjectileID.RocketII, Do(DefaultIDStaticIFrames)}, + {ProjectileID.RocketIII, Do(DefaultIDStaticIFrames)}, + {ProjectileID.RocketIV, Do(DefaultIDStaticIFrames)}, + {ProjectileID.RocketSnowmanI, Do(DefaultIDStaticIFrames)}, + {ProjectileID.RocketSnowmanII, Do(DefaultIDStaticIFrames)}, + {ProjectileID.RocketSnowmanIII, Do(DefaultIDStaticIFrames)}, + {ProjectileID.RocketSnowmanIV, Do(DefaultIDStaticIFrames)}, + {ProjectileID.RollingCactus, Do(DefaultIDStaticIFrames)}, + {ProjectileID.RollingCactusSpike, Do(DefaultIDStaticIFrames)}, + {ProjectileID.RottenEgg, Do(DefaultIDStaticIFrames)}, + {ProjectileID.RubyBolt, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SandBallFalling, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SandSpray, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SantaBombs, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SantankMountRocket, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SapphireBolt, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ScarabBomb, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ScutlixLaser, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ScutlixLaserFriendly, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SeedlerNut, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SeedlerThorn, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ShadowBeamFriendly, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ShadowFlameKnife, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ShellPileFalling, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ShimmerArrow, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ShimmerFlare, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Shuriken, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SiltBall, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SilverBullet, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SilverCoin, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SkyFracture, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SlushBall, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SnowSpray, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SolarCounter, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SolarFlareRay, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SoulDrain, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SpearTrap, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SpelunkerFlare, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Spider, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SpiderEgg, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SpikyBall, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SpikyBallTrap, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SpiritFlame, Do(IDStaticIFrames(5))}, // Has an exception in Vanilla iframe code, uses 5 iframes + {ProjectileID.SporeGas, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SporeGas2, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SporeGas3, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SporeTrap, Do(DefaultIDStaticIFrames)}, + {ProjectileID.SporeTrap2, Do(DefaultIDStaticIFrames)}, + {ProjectileID.StarAnise, Do(DefaultIDStaticIFrames)}, + {ProjectileID.StarCannonStar, Do(DefaultIDStaticIFrames)}, + {ProjectileID.StardustCellMinion, Do(DefaultIDStaticIFrames)}, + {ProjectileID.StardustCellMinionShot, Do(DefaultIDStaticIFrames)}, + {ProjectileID.StardustGuardianExplosion, Do(DefaultIDStaticIFrames)}, + {ProjectileID.StickyBomb, Do(DefaultIDStaticIFrames)}, + {ProjectileID.StickyDynamite, Do(DefaultIDStaticIFrames)}, + {ProjectileID.StickyGrenade, Do(DefaultIDStaticIFrames)}, + {ProjectileID.StormTigerGem, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Stynger, Do(IDStaticIFrames(7))}, // Has an exception in Vanilla iframe code, uses 7 iframes + {ProjectileID.StyngerShrapnel, Do(DefaultIDStaticIFrames)}, + {ProjectileID.TentacleSpike, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ThornChakram, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ThrowingKnife, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ThunderSpear, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ThunderSpearShot, Do(DefaultIDStaticIFrames)}, + {ProjectileID.TiedEighthNote, Do(DefaultIDStaticIFrames)}, + {ProjectileID.TitaniumStormShard, Do(DefaultIDStaticIFrames)}, + {ProjectileID.TopazBolt, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ToxicBubble, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ToxicCloud, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ToxicCloud2, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ToxicCloud3, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ToxicFlask, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Truffle, Do(DefaultIDStaticIFrames)}, + {ProjectileID.TruffleSpore, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Typhoon, Do(IDStaticIFrames(6))}, // Has an exception in Vanilla iframe code, uses 6 iframes + {ProjectileID.UFOLaser, Do(DefaultIDStaticIFrames)}, + {ProjectileID.UFOMinion, Do(DefaultIDStaticIFrames)}, + {ProjectileID.UnholyTridentFriendly, Do(DefaultIDStaticIFrames)}, + {ProjectileID.UnholyWater, Do(DefaultIDStaticIFrames)}, + {ProjectileID.VampireKnife, Do(DefaultIDStaticIFrames)}, + {ProjectileID.VenomDartTrap, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ViciousPowder, Do(DefaultIDStaticIFrames)}, + {ProjectileID.VilePowder, Do(DefaultIDStaticIFrames)}, + {ProjectileID.VilethornBase, Do(DefaultIDStaticIFrames)}, + {ProjectileID.VilethornTip, Do(DefaultIDStaticIFrames)}, + {ProjectileID.VortexBeater, Do(DefaultIDStaticIFrames)}, + {ProjectileID.VortexBeaterRocket, Do(DefaultIDStaticIFrames)}, + {ProjectileID.VortexVortexLightning, Do(DefaultIDStaticIFrames)}, + {ProjectileID.VortexVortexPortal, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Waffle, Do(DefaultIDStaticIFrames)}, + {ProjectileID.WandOfFrostingFrost, Do(DefaultIDStaticIFrames)}, + {ProjectileID.WandOfSparkingSpark, Do(DefaultIDStaticIFrames)}, + {ProjectileID.WaterBolt, Do(DefaultIDStaticIFrames)}, + {ProjectileID.WaterStream, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Web, Do(DefaultIDStaticIFrames)}, + {ProjectileID.WetBomb, Do(DefaultIDStaticIFrames)}, + {ProjectileID.WetMine, Do(DefaultIDStaticIFrames)}, + {ProjectileID.WetRocket, Do(DefaultIDStaticIFrames)}, + {ProjectileID.WetSnowmanRocket, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Wisp, Do(DefaultIDStaticIFrames)}, + {ProjectileID.WoodenBoomerang, Do(DefaultIDStaticIFrames)}, + {ProjectileID.Xenopopper, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ZapinatorLaser, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ZoologistStrikeGreen, Do(DefaultIDStaticIFrames)}, + {ProjectileID.ZoologistStrikeRed, Do(DefaultIDStaticIFrames)}, + + #endregion + }; } @@ -472,6 +785,7 @@ namespace CalamityMod.Projectiles } } internal static IProjectileTweak IDStaticIFrames(int f) => new IDStaticIFrameRule(f); + internal static IProjectileTweak DefaultIDStaticIFrames => new IDStaticIFrameRule(10); #endregion #region Ignore Water diff --git a/Projectiles/DraedonsArsenal/GaussRifleBlast.cs b/Projectiles/DraedonsArsenal/GaussRifleBlast.cs index c45efa1f29..cc03f8632e 100644 --- a/Projectiles/DraedonsArsenal/GaussRifleBlast.cs +++ b/Projectiles/DraedonsArsenal/GaussRifleBlast.cs @@ -1,8 +1,6 @@ -using System; -using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; -using Terraria.Audio; using Terraria.ModLoader; namespace CalamityMod.Projectiles.DraedonsArsenal @@ -11,59 +9,97 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { public new string LocalizationCategory => "Projectiles.Misc"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public float Time - { - get => Projectile.ai[0]; - set => Projectile.ai[0] = value; - } - public override void SetDefaults() { - Projectile.width = Projectile.height = 40; + Projectile.width = Projectile.height = 20; Projectile.friendly = true; Projectile.DamageType = DamageClass.Ranged; - Projectile.extraUpdates = 1; - Projectile.timeLeft = 300; + Projectile.timeLeft = 600; + Projectile.extraUpdates = 0; + Projectile.penetrate = -1; + Projectile.tileCollide = true; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; } - public override void AI() { - Time++; - Projectile.tileCollide = Time > 3f; - if (!Main.dedServ) + if (Projectile.timeLeft == 600) { - // Idle dust. - for (int i = 0; i < 10; i++) + for (int i = 0; i < 3; i++) { - float angle = i / 10f * MathHelper.TwoPi; - for (int j = 0; j < 4; j++) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center, 263); - dust.velocity = angle.ToRotationVector2().RotatedByRandom(0.25f) * Main.rand.NextFloat(6f, 8f); - dust.noGravity = true; - dust.scale = 1.6f; - } - } - // Ring dust. - for (int i = 0; i < 4; i++) - { - float angle = Projectile.velocity.ToRotation() + (i / 4f * MathHelper.TwoPi) + Time / 24f; - float radius = (float)Math.Sin(Time / 7.5f) * 40f + 10f; - Dust dust = Dust.NewDustPerfect(Projectile.Center + angle.ToRotationVector2() * radius, 226); - dust.velocity = Vector2.Zero; - dust.noGravity = true; - dust.scale = 1.5f; + Particle Square = new GlowSquareParticle(Projectile.Center, Projectile.velocity.RotatedByRandom(0.5f) * Main.rand.NextFloat(1f, 3f), false, 15, Main.rand.NextFloat(0.5f, 1.2f), Color.Goldenrod, false, Main.rand.NextFloat(-3, 3)); + GeneralParticleHandler.SpawnParticle(Square); } } + if (Projectile.extraUpdates < 30 && Projectile.timeLeft % 3 == 0) + Projectile.extraUpdates++; + Player Owner = Main.player[Projectile.owner]; + float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); + if (Projectile.timeLeft % 2 == 0 && targetDist < 1400 && Projectile.timeLeft <= 585) + { + float cLerp = Utils.GetLerpValue(500, 600, Projectile.timeLeft); + Particle spark = new GlowSparkParticle(Projectile.Center - Projectile.velocity * 0.5f, Projectile.velocity * 0.01f, false, 7, 0.08f, Color.Lerp(Color.Gold, Color.Goldenrod, cLerp), new Vector2(0.3f, 1), true, true); + GeneralParticleHandler.SpawnParticle(spark); + } + if (Main.rand.NextBool(7)) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(5, 5), 267); + dust.scale = Main.rand.NextFloat(0.5f, 1.1f); + dust.velocity = Projectile.velocity * Main.rand.NextFloat(-3, 3); + dust.noGravity = true; + dust.color = Main.rand.NextBool() ? Color.Gold : Color.Goldenrod; + } + if (Projectile.timeLeft == 600) + { + Particle pulse = new GlowSparkParticle(Projectile.Center, Projectile.velocity * 3, false, 8, 0.042f, Color.Goldenrod, new Vector2(1.5f, 0.9f), true); + GeneralParticleHandler.SpawnParticle(pulse); + } + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + Particle spark = new GlowSparkParticle(Projectile.Center, Projectile.velocity, false, 8, MathHelper.Clamp(0.06f - Projectile.numHits * 0.01f, 0f, 0.06f), Color.Goldenrod * 0.9f, new Vector2(1, 0.5f), true); + GeneralParticleHandler.SpawnParticle(spark); + + if (Projectile.numHits == 0) + { + Particle bolt2 = new CustomPulse(target.Center, Vector2.Zero, Color.Gold * 0.55f, "CalamityMod/Particles/BloomRing", Vector2.One, Main.rand.NextFloat(-10f, 10f), 1.4f, 0, 23); + GeneralParticleHandler.SpawnParticle(bolt2); + Particle bolt3 = new CustomPulse(target.Center, Vector2.Zero, Color.Gold * 0.35f, "CalamityMod/Particles/BloomRing", Vector2.One, Main.rand.NextFloat(-10f, 10f), 1.6f, 0, 18); + GeneralParticleHandler.SpawnParticle(bolt3); + + for (int i = 0; i < 8; i++) + { + Vector2 dustVel = Projectile.velocity.RotatedByRandom(100) * Main.rand.NextFloat(3f, 7f); + Dust dust = Dust.NewDustPerfect(target.Center + dustVel * 5, 267, -dustVel * 0.5f, 0, default, Main.rand.NextFloat(0.5f, 1f)); + dust.noGravity = true; + dust.color = Main.rand.NextBool() ? Color.Gold : Color.Goldenrod; + } + + Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage / 3, 0, Projectile.owner); + } + for (int i = 0; i < MathHelper.Clamp(5 - Projectile.numHits, 1, 5); i++) + { + Particle Square = new GlowSquareParticle(Projectile.Center, Projectile.velocity.RotatedByRandom(0.4f) * Main.rand.NextFloat(1f, 3f), false, 18, Main.rand.NextFloat(0.8f, 1.8f), Color.Goldenrod, false, Main.rand.NextFloat(-3, 3)); + GeneralParticleHandler.SpawnParticle(Square); + } + + if (Projectile.numHits > 0) + Projectile.damage = (int)(Projectile.damage * 0.84f); + if (Projectile.damage < 1) + Projectile.damage = 1; } public override void OnKill(int timeLeft) { - if (Main.myPlayer == Projectile.owner) + for (int i = 0; i < 5; i++) { - SoundEngine.PlaySound(GaussRifle.FireSound, Projectile.Center); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(5, 5), 66); + dust.scale = Main.rand.NextFloat(0.5f, 1.1f); + dust.velocity = Projectile.velocity.RotateRandom(0.3f) * Main.rand.NextFloat(1, 3); + dust.noGravity = true; + dust.color = Main.rand.NextBool() ? Color.LightYellow : Color.Gold; + dust.noLight = true; } } } diff --git a/Projectiles/DraedonsArsenal/GaussRifleExplosion.cs b/Projectiles/DraedonsArsenal/GaussRifleExplosion.cs index 4b65478c95..86d085f658 100644 --- a/Projectiles/DraedonsArsenal/GaussRifleExplosion.cs +++ b/Projectiles/DraedonsArsenal/GaussRifleExplosion.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.CalPlayer; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -9,41 +10,37 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public new string LocalizationCategory => "Projectiles.Misc"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - public float Time - { - get => Projectile.ai[0]; - set => Projectile.ai[0] = value; - } - public override void SetDefaults() { - Projectile.width = Projectile.height = 500; + Projectile.width = Projectile.height = 200; Projectile.friendly = true; Projectile.DamageType = DamageClass.Ranged; Projectile.tileCollide = false; + Projectile.timeLeft = 12; Projectile.penetrate = -1; - Projectile.timeLeft = 20; + Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 12; + Projectile.localNPCHitCooldown = -1; } public override void AI() { - Time++; - if (!Main.dedServ) + for (int i = 0; i < Main.maxNPCs; i++) { - for (int i = 0; i < 50; i++) + NPC target = Main.npc[i]; + if (target.CanBeMoved(true) && target.CanBeChasedBy(Projectile, false)) { - float angle = i / 30f * MathHelper.TwoPi; - Dust dust = Dust.NewDustPerfect(Projectile.Center, 261); - dust.velocity = angle.ToRotationVector2(); - dust.velocity = dust.velocity.RotatedByRandom(0.4f); - dust.velocity = dust.velocity.RotatedBy(Time / 60f * MathHelper.ToRadians(720f)); - dust.velocity *= Main.rand.NextFloat(20f, 50f); - dust.scale = Main.rand.NextFloat(1.2f, 1.6f); - dust.noGravity = true; + if (target != null && !CalamityPlayer.areThereAnyDamnBosses) + { + if (Vector2.Distance(target.Center, Projectile.Center) > 5 && Vector2.Distance(target.Center, Projectile.Center) < 500) + { + target.velocity += target.Center.DirectionTo(Projectile.Center).SafeNormalize(Vector2.UnitX) * 0.4f; + target.Center += target.Center.DirectionTo(Projectile.Center).SafeNormalize(Vector2.UnitX) * 0.8f; + } + } } } } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.width * 0.5f * Projectile.scale, targetHitbox); } } diff --git a/Projectiles/DraedonsArsenal/HolofiberImmolatorHoldout.cs b/Projectiles/DraedonsArsenal/HolofiberImmolatorHoldout.cs new file mode 100644 index 0000000000..93e6c4f824 --- /dev/null +++ b/Projectiles/DraedonsArsenal/HolofiberImmolatorHoldout.cs @@ -0,0 +1,204 @@ +using CalamityMod.Items; +using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class HolofiberImmolatorHoldout : BaseGunHoldoutProjectile + { + public new string LocalizationCategory => "Projectiles.Misc"; + public override int AssociatedItemID => ModContent.ItemType(); + public override float MaxOffsetLengthFromArm => 15f; + public override float OffsetXUpwards => -0f; + public override float BaseOffsetY => -0f; + public override float OffsetYDownwards => 0f; + + public static int FramesPerLoad = 13; + public static int MaxLoadableShots = 15; + public static float BulletSpeed = 12f; + public SlotId ChargeSlot; + public Color mainColor = Color.Lerp(Color.Chartreuse, Color.White, 0.35f); + public int time = 0; + + public ref float CurrentChargingFrames => ref Projectile.ai[0]; + public ref float ShotsLoaded => ref Projectile.ai[1]; + public int chargeMax = 0; + public int downtime = 0; + public bool ChargeLV1 => CurrentChargingFrames >= chargeMax; + + public override void KillHoldoutLogic() + { + if (Owner.CantUseHoldout(false) || HeldItem.type != Owner.ActiveItem().type) + Projectile.Kill(); + } + public override void OnSpawn(IEntitySource source) + { + OffsetLengthFromArm = 15; + Player Owner = Main.player[Projectile.owner]; + chargeMax = (int)(Owner.itemAnimationMax * 1.5f); + + SoundStyle sound = new("CalamityMod/Sounds/Item/ImmolatorCharge"); + ChargeSlot = SoundEngine.PlaySound(sound with { Volume = 0.7f, IsLooped = true }, Projectile.Center); + } + + public override void HoldoutAI() + { + CalamityGlobalItem modItem = Owner.ActiveItem().Calamity(); + Vector2 mountedCenter = Owner.MountedCenter; + Vector2 ownerToMouse = Owner.Calamity().mouseWorld - mountedCenter; + if (SoundEngine.TryGetActiveSound(ChargeSlot, out var ChargeSound) && ChargeSound.IsPlaying) + ChargeSound.Position = Projectile.Center; + + // Fire if the owner stops channeling or otherwise cannot use the weapon. + if ((Owner.CantUseHoldout() || Owner.Calamity().mouseRight) && downtime == 0 && time >= 1) + { + KeepRefreshingLifetime = false; + + Projectile.timeLeft = Owner.Calamity().mouseRight ? Owner.itemAnimationMax * 2 : Owner.itemAnimationMax; + downtime = Owner.itemAnimationMax; + if (Owner.Calamity().mouseRight) + CurrentChargingFrames = 0; + + // Big Shot mode + if (ChargeLV1) + { + ChargeSound?.Stop(); + SoundStyle sound = new("CalamityMod/Sounds/Item/ImmolatorFire"); + SoundEngine.PlaySound(sound with { Volume = 0.7f, Pitch = 0.3f }, Projectile.Center); + + Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * BulletSpeed; + int charge2Damage = (int)(Projectile.damage * 2.5f); + float charge2KB = Projectile.knockBack * 3f; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity * 2, ModContent.ProjectileType(), charge2Damage, charge2KB, Projectile.owner); + + for (int i = 0; i <= 25; i++) + { + Dust dust = Dust.NewDustPerfect(GunTipPosition - Projectile.velocity * 15, 267, shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.2f, 1.2f), 0, default, Main.rand.NextFloat(0.5f, 1.3f)); + dust.noGravity = true; + dust.color = mainColor; + } + CurrentChargingFrames = 0; + if (modItem.Charge > 0) + modItem.Charge -= 0.06f; + else + Projectile.Kill(); + } + // Spread Fire mode + else + { + ChargeSound?.Stop(); + SoundStyle sound = new("CalamityMod/Sounds/Item/ImmolatorFire"); + SoundEngine.PlaySound(sound with { Volume = 0.7f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f) }, Projectile.Center); + + Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * BulletSpeed; + for (int i = 0; i < 3; i++) + { + Vector2 fireVec = shootVelocity.RotatedBy((i == 0 ? 0.4f : i == 2 ? -0.4f : 0) * Utils.GetLerpValue(chargeMax * 1.1f, 0, CurrentChargingFrames, true)); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, fireVec * MathHelper.Clamp((2 * (Utils.GetLerpValue(0, chargeMax, CurrentChargingFrames, true))), 0.5f, 2), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + } + for (int i = 0; i <= 4; i++) + { + Dust dust = Dust.NewDustPerfect(GunTipPosition - Projectile.velocity * 15, 267, shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.9f, 1.2f), 0, default, Main.rand.NextFloat(0.4f, 1.1f)); + dust.noGravity = true; + dust.color = mainColor; + } + CurrentChargingFrames = 0; + if (modItem.Charge > 0) + modItem.Charge -= 0.025f; + else + Projectile.Kill(); + } + } + else if (downtime == 0) + { + CurrentChargingFrames++; + // Charge-up visuals + if (CurrentChargingFrames >= 10) + { + float particleScale = Utils.GetLerpValue(0, chargeMax, CurrentChargingFrames, true); + float strength = particleScale; + Vector3 DustLight = mainColor.ToVector3(); + Lighting.AddLight(GunTipPosition, DustLight * strength); + } + + // Full charge dusts + if (CurrentChargingFrames == chargeMax) + { + ChargeSound?.Stop(); + for (int i = 0; i < 20; i++) + { + Dust chargefull = Dust.NewDustPerfect(GunTipPosition, 278); + chargefull.velocity = (MathHelper.TwoPi * i / 20f).ToRotationVector2() * 4f + Owner.velocity * 0.5f; + chargefull.scale = Main.rand.NextFloat(0.6f, 0.8f); + chargefull.noGravity = false; + chargefull.color = mainColor; + } + SoundStyle sound = new("CalamityMod/Sounds/Item/ImmolatorChargeLoop"); + ChargeSlot = SoundEngine.PlaySound(sound with { Volume = 0.7f, IsLooped = true }, Projectile.Center); + } + + if (CurrentChargingFrames > chargeMax && Main.rand.NextBool()) + { + Dust chargefull = Dust.NewDustPerfect(GunTipPosition, 278); + chargefull.velocity = Projectile.velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(5, 9); + chargefull.scale = Main.rand.NextFloat(0.2f, 0.4f); + chargefull.noGravity = true; + chargefull.color = mainColor; + } + } + + if (downtime == 1 && !Owner.Calamity().mouseRight) + Projectile.Kill(); + + if (downtime > 0) + downtime--; + + time++; + } + public override void OnKill(int timeLeft) + { + if (SoundEngine.TryGetActiveSound(ChargeSlot, out var ChargeSound)) + ChargeSound?.Stop(); + } + public override bool PreDraw(ref Color lightColor) + { + if (time < 2) + return false; + + Vector2 tipPosition = Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.Zero).RotatedBy(-0.05f * Projectile.direction) * 10f; + + float fade = Utils.GetLerpValue(chargeMax / 3, chargeMax, CurrentChargingFrames, true); + + Texture2D texture = ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/HolofiberImmolator").Value; + Texture2D glowTexture = ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/HolofiberImmolatorGlow").Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Color drawColor = Projectile.GetAlpha(lightColor); + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = texture.Size() * 0.5f; + SpriteEffects flipSprite = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + Texture2D rechargeTexture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + Texture2D pointTexture = ModContent.Request("CalamityMod/Particles/GlowSpark").Value; + + Main.EntitySpriteDraw(texture, drawPosition, null, drawColor, drawRotation, rotationPoint, Projectile.scale, flipSprite); + Main.EntitySpriteDraw(glowTexture, drawPosition, null, Color.White, drawRotation, rotationPoint, Projectile.scale, flipSprite); + + if (CurrentChargingFrames > 0 && downtime == 0) + { + float randSize = Main.rand.NextFloat(0.8f, 1.2f); + Main.EntitySpriteDraw(rechargeTexture, tipPosition - Main.screenPosition, null, mainColor with { A = 0 }, Projectile.rotation, rechargeTexture.Size() * 0.5f, 0.25f * Utils.GetLerpValue(0, chargeMax, CurrentChargingFrames, true) * randSize, SpriteEffects.None, 0); + Main.EntitySpriteDraw(rechargeTexture, tipPosition - Main.screenPosition, null, Color.White with { A = 0 }, Projectile.rotation, rechargeTexture.Size() * 0.5f, 0.15f * Utils.GetLerpValue(0, chargeMax, CurrentChargingFrames, true) * randSize, SpriteEffects.None, 0); + + Main.EntitySpriteDraw(pointTexture, tipPosition - Main.screenPosition + (Projectile.velocity * 15 * fade), null, mainColor with { A = 0 } * fade, Projectile.velocity.RotatedBy(MathHelper.ToRadians(90f)).ToRotation(), pointTexture.Size() * 0.5f, new Vector2(0.5f, 0.9f) * 0.035f * fade * randSize * (CurrentChargingFrames == chargeMax ? 1.5f : 1), flipSprite); + } + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/ImmolationArrow.cs b/Projectiles/DraedonsArsenal/ImmolationArrow.cs new file mode 100644 index 0000000000..1ce4b8c049 --- /dev/null +++ b/Projectiles/DraedonsArsenal/ImmolationArrow.cs @@ -0,0 +1,245 @@ +using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class ImmolationArrow : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public ref float time => ref Projectile.ai[0]; + public Color mainColor = Color.Lerp(Color.Chartreuse, Color.White, 0.35f); + + public NPC chosenTarget; + public bool stuckInTarget = false; + public bool stuckInGround = false; + public bool canDamage = true; + public bool canStick = true; + public int stuckTimer = 90; + public Vector2 placementCenter; + float placementDistance; + Vector2 placementVelocity; + public Vector2 storedVelocity; + public bool collideWithTiles = true; + public Vector2 startingVel; + + NPC closestTarget; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; + ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + } + public override void SetDefaults() + { + Projectile.width = Projectile.height = 40; + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.DamageType = DamageClass.Ranged; + Projectile.timeLeft = 180; + Projectile.extraUpdates = 2; + Projectile.penetrate = -1; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + public override void AI() + { + Player Owner = Main.player[Projectile.owner]; + float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); + + if (closestTarget != null && closestTarget.life <= 0) + closestTarget = null; + + if (time == 0) + { + startingVel = Projectile.velocity; + closestTarget = (Projectile.Center + Projectile.velocity * 2).ClosestNPCAt(150); + } + else + { + NPC attemptGetTarget = (Projectile.Center + Projectile.velocity * 2).ClosestNPCAt(150); + if (attemptGetTarget != null) + closestTarget = attemptGetTarget; + } + + if (stuckInGround) + { + Projectile.rotation = storedVelocity.ToRotation() + MathHelper.PiOver2; + stuckTimer--; + + if (stuckTimer <= 0) + { + Projectile.Kill(); + } + } + if (!stuckInTarget && !stuckInGround) + { + storedVelocity = Projectile.velocity; + Projectile.rotation = (storedVelocity).ToRotation() + MathHelper.PiOver2; + if (time > 5 && !stuckInTarget) + { + if (Main.rand.NextBool(3) && canStick) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(6) ? 278 : 263, -Projectile.velocity); + dust.scale = dust.type == 278 ? Main.rand.NextFloat(0.3f, 0.6f) : Main.rand.NextFloat(0.6f, 1.4f); + dust.velocity = -Projectile.velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.1f, 0.7f); + dust.noGravity = true; + dust.color = mainColor; + } + + if (targetDist < 1400f) + { + Particle spark = new SparkParticle(Projectile.Center, -Projectile.velocity, false, 6, 1.3f, mainColor * 0.7f); + GeneralParticleHandler.SpawnParticle(spark); + + if (Main.rand.NextBool(6)) + { + Vector2 placement = Projectile.Center + Main.rand.NextVector2Circular(12, 12); + float speed = Main.rand.NextFloat(0.2f, 0.7f); + Particle spark2 = new GlowOrbParticle(placement, -Projectile.velocity * speed, false, 7, Main.rand.NextFloat(0.4f, 0.7f), mainColor); + GeneralParticleHandler.SpawnParticle(spark2); + } + } + if (closestTarget != null && Projectile.numHits < 1 && closestTarget.CanBeChasedBy(Projectile)) + { + Vector2 moveTotarget = (closestTarget.Center - Projectile.Center).SafeNormalize(Vector2.UnitX); + if (Projectile.velocity.Length() < 20) + Projectile.velocity = Projectile.velocity * 0.95f + moveTotarget * 0.28f; + else + Projectile.velocity *= 0.8f; + } + } + } + else if (stuckInTarget) + { + Projectile.rotation = (storedVelocity).SafeNormalize(Vector2.UnitX).ToRotation() + MathHelper.PiOver2; + + placementCenter = chosenTarget.Center + placementVelocity * placementDistance; + + Projectile.Center = placementCenter; + + stuckTimer--; + + if (chosenTarget.life <= 0) + stuckTimer = 0; + + if (stuckTimer <= 0) + { + Projectile.Kill(); + } + } + if (stuckInTarget || stuckInGround) + { + if (Main.rand.NextBool(8)) + { + float speed = Main.rand.NextFloat(0.2f, 1.5f); + Particle spark = new SparkParticle(Projectile.Center, -storedVelocity * speed, false, 23, 0.7f * speed, mainColor * 0.7f); + GeneralParticleHandler.SpawnParticle(spark); + } + if (Main.rand.NextBool()) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(6) ? 278 : 263, -Projectile.velocity); + dust.scale = dust.type == 278 ? Main.rand.NextFloat(0.3f, 0.6f) : Main.rand.NextFloat(0.6f, 1.4f); + dust.velocity = (new Vector2(35, 35).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 0.7f)) * Utils.GetLerpValue(90, 0, stuckTimer); + dust.noGravity = true; + dust.color = mainColor; + } + } + time++; + + if (collideWithTiles && Collision.SolidCollision(Projectile.Center, 4, 4)) // Vanilla tile collision messes with velocity so we use this instead + { + canDamage = false; + stuckInGround = true; + + storedVelocity = Projectile.velocity; + Projectile.velocity = Vector2.Zero; + SoundStyle sound = new("CalamityMod/Sounds/NPCHit/RavagerRockPillarHit1"); + SoundEngine.PlaySound(sound with { Volume = 0.25f, Pitch = Main.rand.NextFloat(-0.3f, -0.6f) }, Projectile.Center); + Projectile.rotation = storedVelocity.ToRotation() + MathHelper.PiOver2; + collideWithTiles = false; + SoundStyle sound2 = new("CalamityMod/Sounds/Item/ImmolatorPreExplode"); + SoundEngine.PlaySound(sound2 with { Volume = 0.3f, Pitch = 0.5f }, Projectile.Center); + SoundEngine.PlaySound(HolofiberImmolator.PlasmaSound with { Volume = 0.8f, Pitch = Main.rand.NextFloat(-0.3f, -0.4f) }, Projectile.Center); + } + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (Projectile.numHits > 0) + Projectile.damage = (int)(Projectile.damage * 0.88f); + if (Projectile.damage < 1) + Projectile.damage = 1; + + if (!stuckInTarget && canStick) + { + if (Projectile.timeLeft < 600) + Projectile.timeLeft = 600; + collideWithTiles = false; + canDamage = false; + placementDistance = -Vector2.Distance(target.Center, Projectile.Center); + placementVelocity = (target.Center - Projectile.Center).SafeNormalize(Vector2.UnitX); + placementCenter = placementVelocity * (placementDistance * 0.01f); + chosenTarget = target; + stuckInTarget = true; + storedVelocity = Projectile.velocity; + Projectile.velocity = Vector2.Zero; + for (int i = 0; i <= 11; i++) + { + int dustStyle = Main.rand.NextBool() ? 66 : 263; + Dust dust = Dust.NewDustPerfect(Projectile.Center + storedVelocity.SafeNormalize(Vector2.UnitX) * 38 + Main.rand.NextVector2Circular(12, 12), dustStyle, Projectile.velocity); + dust.scale = Main.rand.NextFloat(0.7f, 1.1f); + dust.velocity = storedVelocity.RotatedByRandom(0.2f) * Main.rand.NextFloat(0.8f, 2.1f); + dust.noGravity = true; + dust.color = mainColor; + } + SoundStyle sound = new("CalamityMod/Sounds/Item/ImmolatorPreExplode"); + SoundEngine.PlaySound(sound with { Volume = 0.3f, Pitch = 0.5f }, Projectile.Center); + SoundEngine.PlaySound(HolofiberImmolator.PlasmaSound with { Volume = 0.8f, Pitch = Main.rand.NextFloat(-0.3f, -0.4f) }, Projectile.Center); + } + } + public override void OnKill(int timeLeft) + { + float bonus = (stuckInGround ? 2f : 1); + float explosionDamage = (stuckInGround ? 2.3f : 0.5f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * explosionDamage), Projectile.knockBack * 2, Projectile.owner, 0, bonus != 1 ? 1 : 0); + Particle bolt2 = new CustomPulse(Projectile.Center, Vector2.Zero, mainColor * 0.75f, "CalamityMod/Particles/BloomRing", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 1.2f * bonus, 26); + GeneralParticleHandler.SpawnParticle(bolt2); + + Particle bolt3 = new CustomPulse(Projectile.Center, Vector2.Zero, mainColor * 0.75f, "CalamityMod/Particles/PlasmaExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.07f * bonus, 14); + GeneralParticleHandler.SpawnParticle(bolt3); + + SoundStyle sound = new("CalamityMod/Sounds/Item/PlasmaBig"); + SoundEngine.PlaySound(sound with { Volume = 1f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f) }, Projectile.Center); + } + public override bool? CanDamage() => canDamage ? null : false; + public override bool PreDraw(ref Color lightColor) + { + if (time < 1) + return false; + + Asset tex = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/ImmolationArrow"); + + if (!stuckInGround && !stuckInTarget && false) + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], mainColor with { A = 0 }, 1, tex.Value); + + float randSize = Main.rand.NextFloat(0.7f, 1.2f); + for (int i = 0; i < 3; i++) + { + Vector2 scale = Projectile.scale * new Vector2(0.5f * (1 - i * 0.25f), 1) * 1.5f * (1 - i * 0.3f) * randSize; + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, null, mainColor with { A = 0 } * 0.5f, Projectile.rotation, tex.Size() * 0.5f, scale, SpriteEffects.None); + } + if (stuckInTarget || stuckInGround) + { + Vector2 scale = 1.1f * new Vector2(0.5f, 1) * 1.5f * randSize; + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, null, Color.White with { A = 0 } * Utils.GetLerpValue(90, 30, stuckTimer, true), Projectile.rotation, tex.Size() * 0.5f, scale, SpriteEffects.None); + } + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/ImmolationArrow.png b/Projectiles/DraedonsArsenal/ImmolationArrow.png new file mode 100644 index 0000000000..cda292fffe Binary files /dev/null and b/Projectiles/DraedonsArsenal/ImmolationArrow.png differ diff --git a/Projectiles/DraedonsArsenal/ImmolationBurst.cs b/Projectiles/DraedonsArsenal/ImmolationBurst.cs new file mode 100644 index 0000000000..f73a3757d3 --- /dev/null +++ b/Projectiles/DraedonsArsenal/ImmolationBurst.cs @@ -0,0 +1,36 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class ImmolationBurst : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public override void SetDefaults() + { + Projectile.width = Projectile.height = 150; + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.DamageType = DamageClass.Ranged; + Projectile.timeLeft = 2; + Projectile.penetrate = -1; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + public override void AI() + { + if (Projectile.ai[1] == 1) + Projectile.scale = 2f; + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (Projectile.numHits > 0) + Projectile.damage = (int)(Projectile.damage * 0.88f); + if (Projectile.damage < 1) + Projectile.damage = 1; + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.width * 0.5f * Projectile.scale, targetHitbox); + } +} diff --git a/Projectiles/DraedonsArsenal/ImmolationSpray.cs b/Projectiles/DraedonsArsenal/ImmolationSpray.cs new file mode 100644 index 0000000000..8cde23aa2c --- /dev/null +++ b/Projectiles/DraedonsArsenal/ImmolationSpray.cs @@ -0,0 +1,96 @@ +using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class ImmolationSpray : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public ref float time => ref Projectile.ai[0]; + public Color mainColor = Color.Lerp(Color.Chartreuse, Color.White, 0.35f); + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; + ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + } + public override void SetDefaults() + { + Projectile.width = Projectile.height = 20; + Projectile.friendly = true; + Projectile.tileCollide = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.timeLeft = 300; + Projectile.extraUpdates = 3; + Projectile.penetrate = -1; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + public override void AI() + { + Player Owner = Main.player[Projectile.owner]; + float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + if (time > 5 && targetDist < 1400f) + { + Projectile.velocity.Y += 0.18f; + Projectile.velocity.X *= 0.9835f; + + if (Main.rand.NextBool(3)) + { + Vector2 placement = Projectile.Center + Main.rand.NextVector2Circular(8, 8); + float speed = Main.rand.NextFloat(0.2f, 0.7f); + Particle spark = new GlowOrbParticle(placement, -Projectile.velocity * speed, false, 7, Main.rand.NextFloat(0.4f, 0.7f), mainColor); + GeneralParticleHandler.SpawnParticle(spark); + + Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(6) ? 278 : 263, -Projectile.velocity); + dust.scale = dust.type == 278 ? Main.rand.NextFloat(0.2f, 0.5f) : Main.rand.NextFloat(0.4f, 1.1f); + dust.velocity = (new Vector2(3, 3).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 0.7f)); + dust.noGravity = true; + dust.color = mainColor; + } + } + time++; + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + SoundEngine.PlaySound(HolofiberImmolator.PlasmaSound with { Volume = 0.5f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f) }, Projectile.Center); + + if (Projectile.numHits > 0) + Projectile.damage = (int)(Projectile.damage * 0.8f); + if (Projectile.damage < 1) + Projectile.damage = 1; + } + public override bool OnTileCollide(Vector2 oldVelocity) + { + Player Owner = Main.player[Projectile.owner]; + float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); + if (targetDist < 1400) + { + Particle spark = new GlowOrbParticle(Projectile.Center + oldVelocity.SafeNormalize(Vector2.UnitX) * 11, Projectile.velocity * 0.001f, false, 60, 1.6f, mainColor); + GeneralParticleHandler.SpawnParticle(spark); + } + return true; + } + public override bool PreDraw(ref Color lightColor) + { + if (time < 1) + return false; + + Asset tex = ModContent.Request("CalamityMod/Particles/GlowSpark"); + + //CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], mainColor with { A = 0 } * 0.3f, 1, tex.Value); + float squash = Utils.GetLerpValue(-3, 10, Projectile.velocity.Length(), true); + for (int i = 0; i < 2; i++) + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, null, mainColor with { A = 0 } * 0.6f, Projectile.rotation, tex.Size() * 0.5f, new Vector2(0.4f, squash) * 0.045f * (i == 0 ? 0.6f : 1), SpriteEffects.None); + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/LaserRifleShot.cs b/Projectiles/DraedonsArsenal/LaserRifleShot.cs deleted file mode 100644 index 8e084688a8..0000000000 --- a/Projectiles/DraedonsArsenal/LaserRifleShot.cs +++ /dev/null @@ -1,132 +0,0 @@ -using System; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.DraedonsArsenal -{ - public class LaserRifleShot : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Misc"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - private int dust = 127; - - public override void SetDefaults() - { - Projectile.width = 2; - Projectile.height = 2; - Projectile.friendly = true; - Projectile.DamageType = DamageClass.Ranged; - Projectile.penetrate = 1; - Projectile.extraUpdates = 100; - Projectile.timeLeft = 600; - } - - public override void AI() - { - Lighting.AddLight(Projectile.Center, 0.2f, 0.1f, 0f); - - float createDustVar = 12f; - Projectile.localAI[0] += 1f; - if (Projectile.localAI[0] > createDustVar) - { - for (int i = 0; i < 2; i++) - { - int laserDust = Dust.NewDust(Projectile.Center, 0, 0, dust, 0f, 0f, 160, Projectile.ai[0] == 0f ? default : new Color(255, 255, 0), 2f); - Main.dust[laserDust].noGravity = true; - Main.dust[laserDust].position = Projectile.Center; - Main.dust[laserDust].velocity = Projectile.velocity; - } - } - - if (Projectile.localAI[0] == createDustVar) - LaserBurst(1.8f, 3f); - } - - public override void OnKill(int timeLeft) - { - int height = 60; - Projectile.position = Projectile.Center; - Projectile.width = Projectile.height = height; - Projectile.Center = Projectile.position; - Projectile.maxPenetrate = -1; - Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.Damage(); - - LaserBurst(2.4f, 4.2f); // 60 dusts - - for (int i = 0; i < 100; i++) - { - int killDust = Dust.NewDust(Projectile.Center, 6, 6, dust, 0f, 0f, 100, default, 2f); - float killDustX = Main.dust[killDust].velocity.X; - float killDustY = Main.dust[killDust].velocity.Y; - - if (killDustX == 0f && killDustY == 0f) - killDustX = 1f; - - float killDustVelocity = (float)Math.Sqrt(killDustX * killDustX + killDustY * killDustY); - killDustVelocity = 4f / killDustVelocity; - killDustX *= killDustVelocity; - killDustY *= killDustVelocity; - - Dust dust2 = Main.dust[killDust]; - dust2.velocity *= 0.5f; - dust2.velocity.X = dust2.velocity.X + killDustX; - dust2.velocity.Y = dust2.velocity.Y + killDustY; - dust2.noGravity = true; - } - } - - private void LaserBurst(float speed1, float speed2) - { - float angleRandom = 0.05f; - - for (int i = 0; i < 20; i++) - { - float dustSpeed = Main.rand.NextFloat(speed1, speed2); - Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); - dustVel = dustVel.RotatedBy(-angleRandom); - dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - - int burstDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dust, dustVel.X, dustVel.Y, 200, default, 2.5f); - Main.dust[burstDust].position = Projectile.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * (float)Main.rand.NextDouble() * Projectile.width / 2f; - Main.dust[burstDust].noGravity = true; - - Dust dust2 = Main.dust[burstDust]; - dust2.velocity *= 3f; - dust2 = Main.dust[burstDust]; - - burstDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dust, dustVel.X, dustVel.Y, 100, default, 1.9f); - Main.dust[burstDust].position = Projectile.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * (float)Main.rand.NextDouble() * Projectile.width / 2f; - - dust2 = Main.dust[burstDust]; - dust2.velocity *= 2f; - - Main.dust[burstDust].noGravity = true; - Main.dust[burstDust].fadeIn = 1f; - Main.dust[burstDust].color = Color.Orange * 0.5f; - - dust2 = Main.dust[burstDust]; - } - for (int j = 0; j < 10; j++) - { - float dustSpeed = Main.rand.NextFloat(speed1, speed2); - Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); - dustVel = dustVel.RotatedBy(-angleRandom); - dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - - int burstDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dust, dustVel.X, dustVel.Y, 0, default, 3.2f); - Main.dust[burstDust2].position = Projectile.Center + Vector2.UnitX.RotatedByRandom(MathHelper.Pi).RotatedBy(Projectile.velocity.ToRotation()) * Projectile.width / 3f; - Main.dust[burstDust2].noGravity = true; - - Dust dust2 = Main.dust[burstDust2]; - dust2.velocity *= 0.5f; - dust2 = Main.dust[burstDust2]; - } - } - } -} diff --git a/Projectiles/DraedonsArsenal/PulsePistolShot.cs b/Projectiles/DraedonsArsenal/PulsePistolShot.cs index 55ad51e8d3..8e9409845e 100644 --- a/Projectiles/DraedonsArsenal/PulsePistolShot.cs +++ b/Projectiles/DraedonsArsenal/PulsePistolShot.cs @@ -1,7 +1,9 @@ using System; using System.Collections.Generic; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -12,119 +14,208 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public new string LocalizationCategory => "Projectiles.Misc"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - public NPC Target - { - get => Main.npc[(int)Projectile.ai[0]]; - set => Projectile.ai[0] = value.whoAmI; - } - public float Time - { - get => Projectile.ai[1]; - set => Projectile.ai[1] = value; - } - public List NPCsAlreadyHit = new List(); - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailingMode[Type] = 2; - ProjectileID.Sets.TrailCacheLength[Type] = 12; - ProjectileID.Sets.CultistIsResistantTo[Type] = true; - } - + private Color mainColor = Color.Orchid; + private bool doDamage = false; + private NPC closestTarget = null; + private NPC lastTarget = null; + private float distance; + private int timesItCanHit = 1; public override void SetDefaults() { Projectile.width = 16; Projectile.height = 16; Projectile.friendly = true; Projectile.DamageType = DamageClass.Magic; - Projectile.penetrate = 1; - Projectile.extraUpdates = 10; - Projectile.timeLeft = 120 * (1 + Projectile.extraUpdates); + Projectile.penetrate = -1; + Projectile.extraUpdates = 1; + Projectile.timeLeft = 1240; + Projectile.tileCollide = false; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 20; } public override void AI() { - Time++; - if (Time >= 10f || NPCsAlreadyHit.Count > 0) + // If it's hit targeted enemies enough, kill it + if (timesItCanHit <= 0) { - if (NPCsAlreadyHit.Count > 0) + if (Projectile.ai[1] < 5) { - float angleOffset = MathHelper.WrapAngle(Projectile.AngleTo(Target.Center) - Projectile.velocity.ToRotation()); - angleOffset = MathHelper.Clamp(angleOffset, -0.2f, 0.2f); - Projectile.velocity = Projectile.velocity.RotatedBy(angleOffset); + Projectile uwa = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, (Projectile.velocity.SafeNormalize(Vector2.UnitX) * 5).RotatedBy(0.3f) * 0.5f, Projectile.type, Projectile.damage / 4, Projectile.knockBack / 2, Projectile.owner, 0, 5); + Projectile uwaAgain = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, (Projectile.velocity.SafeNormalize(Vector2.UnitX) * 5).RotatedBy(-0.3f) * 0.5f, Projectile.type, Projectile.damage / 4, Projectile.knockBack / 2, Projectile.owner, 0, 5); + uwa.penetrate = 1; + uwaAgain.penetrate = 1; } - float radiusFactor = MathHelper.Lerp(0f, 1f, Utils.GetLerpValue(10f, 50f, Time, true)); + Projectile.Kill(); + return; + } - Dust dust = Dust.NewDustPerfect(Projectile.Center, 234); - dust.noGravity = true; - dust.velocity = Vector2.Zero; - dust.scale = 1.6f; + Lighting.AddLight(Projectile.Center, 0.3f, 0f, 0.5f); + Player Owner = Main.player[Projectile.owner]; + float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); + Projectile.rotation = Projectile.velocity.ToRotation(); - // Only the initial shot should have a circle of dust, to prevent potential dust overload. - if (NPCsAlreadyHit.Count == 0) + float createDustVar = 10f; + + if (Projectile.localAI[0] == 0) + { + if (Projectile.ai[1] == 1) + SoundEngine.PlaySound(SoundID.DD2_DarkMageCastHeal with { Volume = 1.7f, Pitch = 0.3f }, Projectile.Center); + } + + if (targetDist < 1400f) + { + GlowOrbParticle spark = new GlowOrbParticle(Projectile.Center, -Projectile.velocity * Main.rand.NextFloat(-0.01f, 0.01f), false, 5, 1.7f - Projectile.ai[1] * 0.18f, Main.rand.NextBool(3) ? Color.DarkViolet : mainColor); + GeneralParticleHandler.SpawnParticle(spark); + } + if (targetDist < 1400f && Main.rand.NextBool()) + { + GlowOrbParticle spark = new GlowOrbParticle(Projectile.Center + Projectile.velocity * Main.rand.NextFloat(-2f, 2f), -Projectile.velocity * Main.rand.NextFloat(-0.01f, 0.01f), false, 5, 1.7f - Projectile.ai[1] * 0.18f, Main.rand.NextBool(3) ? Color.DarkViolet : mainColor); + GeneralParticleHandler.SpawnParticle(spark); + } + + if (Projectile.localAI[0] > 90) + { + // Velocity must look like it has stoped, but can't actually be zero otherwise homing code doesn't work + if (Projectile.localAI[0] == 91) + Projectile.velocity *= 0.001f; + + // When they begin the homing after a hit of spawning, do a few visuals + if (Projectile.localAI[0] == 120) { - for (int i = 0; i < 5; i++) + distance = 3000; + + SoundStyle fire = new("CalamityMod/Sounds/Item/PulseSound"); + SoundEngine.PlaySound(fire with { Volume = 0.35f, Pitch = 0.3f, MaxInstances = -1 }, Projectile.Center); + + + Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, mainColor, new Vector2(1f, 1f), Main.rand.NextFloat(12f, 25f), 0f, 0.5f, 15); + GeneralParticleHandler.SpawnParticle(pulse); + + for (int k = 0; k < 6; k++) { - float offsetRotationAngle = Projectile.velocity.ToRotation() + Time / 20f; - float radius = (14f + (float)Math.Cos(Time / 13f) * 6f) * radiusFactor; - Vector2 dustPosition = Projectile.Center; - dustPosition += offsetRotationAngle.ToRotationVector2().RotatedBy(i / 5f * MathHelper.TwoPi) * radius; - dust = Dust.NewDustPerfect(dustPosition, Main.rand.NextBool(3) ? 234 : 173); + Dust dust = Dust.NewDustPerfect(Projectile.Center, 66); + dust.scale = Main.rand.NextFloat(0.6f, 1.1f); + dust.velocity = new Vector2(6, 6).RotatedByRandom(100) * Main.rand.NextFloat(0.05f, 0.8f); dust.noGravity = true; - dust.velocity = -Projectile.velocity; - dust.scale = 0.8f; + dust.color = Main.rand.NextBool(3) ? Color.DarkViolet : mainColor; + dust.noLight = true; + } + } + // Homing code + if (Projectile.localAI[0] > 120) + { + // Do damage if it's near its target otherwise don't, this is to prevent excessive hits as orbs rail through worm bosses and such + if (closestTarget is not null) + doDamage = Vector2.Distance(Projectile.Center, closestTarget.Center) < 10; + else + doDamage = false; + + // Tracking code, originally was going to try only tracking the closest target not including the last target you hit, but I couldn't make it work + // Eventually I settled on how it works now and it seems to home consistently so I'm happy enough there + float projectileSpeed = 9.5f; + if (closestTarget is not null && closestTarget.active) + { + float targetDirectionRotation = Projectile.SafeDirectionTo(closestTarget.Center).ToRotation(); + float turningRate = 10f + Projectile.localAI[0] * 0.00008f; + Projectile.velocity = Projectile.velocity.ToRotation().AngleTowards(targetDirectionRotation, turningRate).ToRotationVector2() * projectileSpeed; + } + else + { + Projectile.velocity = Projectile.rotation.ToRotationVector2() * projectileSpeed; + Projectile.velocity *= 0.999f; + } + if (closestTarget is not null && Vector2.Distance(Projectile.Center, closestTarget.Center) < 10) + { + closestTarget = null; + distance = 3000; + } + + // Add extra updates as it hits more times, this smoothy increases the speed without destroying velocity based visual effects + Projectile.extraUpdates = 5 + (int)(Projectile.numHits * 0.3f); + { + // Actual homing movement + for (int index = 0; index < Main.npc.Length; index++) + { + if (Main.npc[index].CanBeChasedBy(null, false) || Main.npc[index] == lastTarget) + { + float extraDistance = (Main.npc[index].width / 2) + (Main.npc[index].height / 2); + + if (Vector2.Distance(Projectile.Center, Main.npc[index].Center) < (distance + extraDistance)) + { + closestTarget = Main.npc[index]; + distance = Vector2.Distance(Projectile.Center, Main.npc[index].Center); + } + } + } } } } + else + { + // Minor dust trail for when they first spawn + if (Main.rand.NextBool(5)) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(5, 5), 66); + dust.scale = Main.rand.NextFloat(0.8f, 1.4f); + dust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.2f, 0.5f); + dust.noGravity = true; + dust.color = Main.rand.NextBool(3) ? Color.DarkViolet : mainColor; + dust.noLight = true; + } + Projectile.velocity *= 0.98f; + } + + // Visuals for the shot as it exits the tip of the rifle + if (Projectile.localAI[0] == createDustVar) + PulseBurst(4f, 5f); + + Projectile.localAI[0]++; } - public override bool? CanDamage() => Time > Projectile.MaxUpdates; + + public override bool? CanHitNPC(NPC target) => doDamage ? null : false; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (!NPCsAlreadyHit.Contains(target)) - NPCsAlreadyHit.Add(target); + bool onKill = target.life <= 0; + + // Set some values to get ready for it to home again for its next hit + lastTarget = target; + distance = 3000; + Projectile.localAI[0] = 60; + Projectile.velocity *= MathHelper.Clamp(1.5f - Projectile.numHits * 0.5f, 1f, 1.5f); - // If the maximum amount of targets have already been hit, die early. - if (Projectile.frameCounter >= 4) + for (int i = 0; i <= 2; i++) { - Projectile.Kill(); - return; + SquishyLightParticle energy = new SquishyLightParticle(Projectile.Center, (Projectile.velocity * 2).RotatedByRandom(0.7f) * Main.rand.NextFloat(0.1f, 0.4f), Main.rand.NextFloat(0.1f, 0.25f), Main.rand.NextBool(3) ? Color.DarkViolet : mainColor, Main.rand.Next(20, 30 + 1), 0.25f, 2f); + GeneralParticleHandler.SpawnParticle(energy); } - float minDistance = 600f; - List potentialTargets = new List(); - foreach (NPC n in Main.ActiveNPCs) + if (target == closestTarget) + timesItCanHit--; + + if (onKill) { - bool legalTarget = n != target && n.CanBeChasedBy(null); - float distanceToTarget = Projectile.Distance(n.Center); - if (legalTarget && distanceToTarget < minDistance && !NPCsAlreadyHit.Contains(n)) - { - minDistance = distanceToTarget; - // The NPCs at the bottom will always be at the bottom of the list because it works via a minimum distance. - potentialTargets.Add(n); - } + timesItCanHit += 2; + Projectile.timeLeft += 90; } - - if (potentialTargets.Count == 0) + } + private void PulseBurst(float speed1, float speed2) + { + for (int i = 0; i <= 8; i++) { - Projectile.Kill(); - return; + Dust dust = Dust.NewDustPerfect(Projectile.Center, 66); + dust.scale = Main.rand.NextFloat(0.4f, 1.4f); + dust.velocity = (Projectile.velocity * 4).RotateRandom(0.6f) * Main.rand.NextFloat(0.2f, 0.9f); + dust.noGravity = true; + dust.color = Main.rand.NextBool(3) ? Color.DarkViolet : mainColor; + dust.noLight = true; + } + for (int i = 0; i <= 8; i++) + { + SquishyLightParticle energy = new SquishyLightParticle(Projectile.Center, (Projectile.velocity * 4).RotatedByRandom(0.6f) * Main.rand.NextFloat(0.1f, 0.4f), Main.rand.NextFloat(0.2f, 0.6f), Main.rand.NextBool(3) ? Color.DarkViolet : mainColor, Main.rand.Next(30, 40 + 1), 0.25f, 2f); + GeneralParticleHandler.SpawnParticle(energy); } - - potentialTargets.Reverse(); // Move the closest NPCs to the top for convenience when indexing. - int maxIndex = Math.Min(potentialTargets.Count, 2); // Pick 1 out of the 2 closest NPCs. - NPC toHit = potentialTargets[Main.rand.Next(0, maxIndex)]; - - // A netcode block such as Main.myPlayer == projectile.owner is not required. OnHitNPC is only run client-side. - Projectile splitShot = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, - Projectile.velocity, - Projectile.type, - Projectile.damage, - Projectile.knockBack, - Projectile.owner, - toHit.whoAmI); - splitShot.frameCounter = Projectile.frameCounter + 1; - ((PulsePistolShot)splitShot.ModProjectile).NPCsAlreadyHit.AddRange(NPCsAlreadyHit); - ((PulsePistolShot)splitShot.ModProjectile).NPCsAlreadyHit.Add(toHit); - Projectile.Kill(); } } } diff --git a/Projectiles/DraedonsArsenal/PulseRifleShot.cs b/Projectiles/DraedonsArsenal/PulseRifleShot.cs index 9c88cdbd0e..bf23501b3b 100644 --- a/Projectiles/DraedonsArsenal/PulseRifleShot.cs +++ b/Projectiles/DraedonsArsenal/PulseRifleShot.cs @@ -264,7 +264,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal if (onKill) { - timesItCanHit += 1; + timesItCanHit += 2; Projectile.timeLeft += 90; } } diff --git a/Projectiles/DraedonsArsenal/ScattershotLance.cs b/Projectiles/DraedonsArsenal/ScattershotLance.cs new file mode 100644 index 0000000000..032a7b12ac --- /dev/null +++ b/Projectiles/DraedonsArsenal/ScattershotLance.cs @@ -0,0 +1,105 @@ +using System; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class ScattershotLance : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public Vector2 startVel = Vector2.Zero; + public int time = 0; + public override void SetDefaults() + { + Projectile.width = 35; + Projectile.height = 35; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.penetrate = -1; + Projectile.timeLeft = 11; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + + public override void AI() + { + Lighting.AddLight(Projectile.Center, Color.Red.ToVector3()); + Player Owner = Main.player[Projectile.owner]; + float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); + + if (time == 0) + { + startVel = Projectile.velocity; + for (int i = 0; i <= 9; i++) + { + Particle spark = new SparkParticle(Projectile.Center, Projectile.velocity.RotatedByRandom(0.5) * Main.rand.NextFloat(0.2f, 1f), false, 55, Main.rand.NextFloat(0.2f, 1.8f), Color.Red); + GeneralParticleHandler.SpawnParticle(spark); + + SparkParticle spark2 = new SparkParticle(Projectile.Center, Projectile.velocity.RotatedByRandom(0.5) * Main.rand.NextFloat(0.2f, 1f), false, 25, Main.rand.NextFloat(0.1f, 0.8f), Color.White); + GeneralParticleHandler.SpawnParticle(spark2); + } + for (int i = 0; i <= 15; i++) + { + Dust chargefull = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(40, 40), 278); + chargefull.velocity = Projectile.velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.2f, 2f); + chargefull.scale = Main.rand.NextFloat(0.4f, 0.8f); + chargefull.noGravity = true; + chargefull.color = Color.Red; + } + } + Projectile.rotation = startVel.ToRotation() + MathHelper.PiOver2; + Projectile.velocity = Vector2.Zero; + time++; + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (Projectile.numHits == 0) + { + SoundStyle sound = new("CalamityMod/Sounds/Item/MeldShoot"); + SoundEngine.PlaySound(sound with { Volume = 1f }, Projectile.Center); + //Particle spark = new GlowSparkParticle(target.Center, startVel.SafeNormalize(Vector2.UnitY) * 20, false, 9, 0.1f, Color.Red, new Vector2(1f, 1.1f), true, true, 0.8f); + //GeneralParticleHandler.SpawnParticle(spark); + } + for (int i = 0; i < MathHelper.Clamp(25 - Projectile.numHits * 4, 1, 10); i++) + { + Vector2 velocity = startVel.RotatedByRandom(0.5f) * Main.rand.NextFloat(0.1f, 1.4f); + Particle nanoDust = new NanoParticle(target.Center, velocity, Main.rand.NextBool(3) ? Color.Crimson : Color.Red, Main.rand.NextFloat(0.4f, 1f), 35, Main.rand.NextBool(), true); + GeneralParticleHandler.SpawnParticle(nanoDust); + } + if (Projectile.numHits > 0) + Projectile.damage = (int)(Projectile.damage * 0.88f); + if (Projectile.damage < 1) + Projectile.damage = 1; + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (startVel == Vector2.Zero) + return false; + // If the target is touching the beam's hitbox (which is a small rectangle vaguely overlapping the host crystal), that's good enough. + if (projHitbox.Intersects(targetHitbox)) + return true; + // Otherwise, perform an AABB line collision check to check the whole beam. + float _ = float.NaN; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Projectile.Center + startVel * 12, Projectile.width * Projectile.scale, ref _); + } + public override bool PreDraw(ref Color lightColor) + { + if (time < 1) + return false; + Texture2D pointTexture = ModContent.Request("CalamityMod/Particles/GlowSpark").Value; + float fade = Utils.GetLerpValue(0, 5, Projectile.timeLeft, true); + for (int i = 0; i < 5; i++) + Main.EntitySpriteDraw(pointTexture, Projectile.Center - Main.screenPosition + (startVel * (2 + (i * 2)) * fade), null, Color.Red with { A = 0 } * fade, Projectile.rotation, pointTexture.Size() * 0.5f, new Vector2(0.4f, 0.9f) * (0.12f - (i * 0.0165f)), SpriteEffects.None); + for (int i = 0; i < 5; i++) + Main.EntitySpriteDraw(pointTexture, Projectile.Center - Main.screenPosition + (startVel * (2 + (i * 2)) * fade), null, Color.White with { A = 0 } * 0.8f * fade, Projectile.rotation, pointTexture.Size() * 0.5f, new Vector2(0.4f, 0.9f) * (0.12f - (i * 0.0165f)) * 0.7f, SpriteEffects.None); + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/ScattershotLaser.cs b/Projectiles/DraedonsArsenal/ScattershotLaser.cs new file mode 100644 index 0000000000..80246df64a --- /dev/null +++ b/Projectiles/DraedonsArsenal/ScattershotLaser.cs @@ -0,0 +1,66 @@ +using System; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class ScattershotLaser : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + private int dust = 127; + public int time = 0; + public override void SetDefaults() + { + Projectile.width = 7; + Projectile.height = 7; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.penetrate = 1; + Projectile.extraUpdates = 9; + Projectile.timeLeft = 600; + } + + public override void AI() + { + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + Lighting.AddLight(Projectile.Center, Color.Red.ToVector3() * 0.4f); + Player Owner = Main.player[Projectile.owner]; + float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); + + if (time > 15 && targetDist < 1400) + { + if (Projectile.timeLeft % 6 == 0) + { + Particle spark = new LineParticle(Projectile.Center, Projectile.velocity * 0.01f, false, 8, 1.7f, Color.Red); + GeneralParticleHandler.SpawnParticle(spark); + } + if (Projectile.timeLeft % 5 == 0) + { + SparkParticle spark2 = new SparkParticle(Projectile.Center, Projectile.velocity * 0.01f, false, 3, 0.7f, Color.White); + GeneralParticleHandler.SpawnParticle(spark2); + } + } + + time++; + } + + public override void OnKill(int timeLeft) + { + for (int i = 0; i < 4; i++) + { + Vector2 velocity = (Projectile.velocity * 5).RotatedByRandom(0.5f) * Main.rand.NextFloat(0.1f, 0.8f); + Particle nanoDust = new NanoParticle(Projectile.Center, velocity, Main.rand.NextBool(3) ? Color.Crimson : Color.Red, Main.rand.NextFloat(0.4f, 1f), 20, Main.rand.NextBool(), true); + GeneralParticleHandler.SpawnParticle(nanoDust); + Dust dust = Dust.NewDustPerfect(Projectile.Center, 278, (Projectile.velocity * 5).RotatedByRandom(0.3f) * Main.rand.NextFloat(0.1f, 0.8f), 0, default, Main.rand.NextFloat(0.3f, 0.5f)); + dust.noGravity = true; + dust.color = Color.Red; + } + } + } +} diff --git a/Projectiles/DraedonsArsenal/ScattershotSkewerHoldout.cs b/Projectiles/DraedonsArsenal/ScattershotSkewerHoldout.cs new file mode 100644 index 0000000000..2f0e377c20 --- /dev/null +++ b/Projectiles/DraedonsArsenal/ScattershotSkewerHoldout.cs @@ -0,0 +1,273 @@ +using System; +using CalamityMod.Cooldowns; +using CalamityMod.Items; +using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class ScattershotSkewerHoldout : BaseGunHoldoutProjectile + { + public new string LocalizationCategory => "Projectiles.Misc"; + public override int AssociatedItemID => ModContent.ItemType(); + public override float MaxOffsetLengthFromArm => 30f; + public override float RecoilResolveSpeed => 0.1f; + public override float OffsetXUpwards => -0f; + public override float BaseOffsetY => -0f; + public override float OffsetYDownwards => 0f; + + public static float BulletSpeed = 12f; + public SlotId ChargeSlot; + public SlotId StartSlot; + public Color mainColor = Color.Lerp(Color.Red, Color.White, 0f); + public int time = 0; + public int chargeAttackTimer = 10; + public bool doingChargeAttack = false; + + public ref float CurrentChargingFrames => ref Projectile.ai[0]; + public int chargeMax = 0; + public int downtime = 0; + public bool ChargeLV1 => CurrentChargingFrames >= chargeMax; + + public override void KillHoldoutLogic() + { + if (Owner.CantUseHoldout(false) || HeldItem.type != Owner.ActiveItem().type) + Projectile.Kill(); + } + public override void OnSpawn(IEntitySource source) + { + OffsetLengthFromArm = 30; + Player Owner = Main.player[Projectile.owner]; + chargeMax = (int)(Owner.itemAnimationMax * 2.1f); + + if (Owner.Calamity().arsenalCooldown <= 0) + { + SoundStyle sound = new("CalamityMod/Sounds/Item/ScattershotCharge"); + StartSlot = SoundEngine.PlaySound(sound with { Volume = 0.9f }, Projectile.Center); + } + } + + public override void HoldoutAI() + { + CalamityGlobalItem modItem = Owner.ActiveItem().Calamity(); + Vector2 mountedCenter = Owner.MountedCenter; + Vector2 ownerToMouse = Owner.Calamity().mouseWorld - mountedCenter; + if (SoundEngine.TryGetActiveSound(ChargeSlot, out var ChargeSound) && ChargeSound.IsPlaying) + ChargeSound.Position = Projectile.Center; + if (SoundEngine.TryGetActiveSound(StartSlot, out var StartSound) && StartSound.IsPlaying) + StartSound.Position = Projectile.Center; + + // Fire if the owner stops channeling or otherwise cannot use the weapon. + if (((Owner.CantUseHoldout() || (Owner.Calamity().mouseRight || Owner.Calamity().arsenalCooldown > 0)) && downtime == 0 && time >= 1) || doingChargeAttack) + { + KeepRefreshingLifetime = false; + + Projectile.timeLeft = Owner.Calamity().mouseRight ? Owner.itemAnimationMax * 2 : Owner.itemAnimationMax; + downtime = Owner.itemAnimationMax; + + // Big Shot mode + if ((ChargeLV1 && Owner.Calamity().arsenalCooldown <= 0) || doingChargeAttack) + { + if (chargeAttackTimer == 10) + { + doingChargeAttack = true; + Projectile.timeLeft += chargeAttackTimer; + OffsetLengthFromArm -= 20; + } + else + { + if (chargeAttackTimer == 3) + { + OffsetLengthFromArm += 35; + ChargeSound?.Stop(); + SoundStyle sound = new("CalamityMod/Sounds/Item/ScattershotChargeShoot"); + SoundEngine.PlaySound(sound with { Volume = 0.9f }, Projectile.Center); + Owner.Calamity().GeneralScreenShakePower = 6f; + } + if (chargeAttackTimer <= 0) + { + Owner.Calamity().arsenalCooldown = 500; + Owner.AddCooldown(ArsenalPower.ID, 500); + + Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * BulletSpeed; + int charge2Damage = (int)(Projectile.damage * 60); // Seems high but its on a cooldown and is a melee attack so might be okay + float charge2KB = Projectile.knockBack * 3f; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity * 2, ModContent.ProjectileType(), charge2Damage, charge2KB, Projectile.owner); + + for (int i = 0; i <= 25; i++) + { + Dust dust = Dust.NewDustPerfect(GunTipPosition - Projectile.velocity * 15, 267, shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.2f, 1.2f), 0, default, Main.rand.NextFloat(0.5f, 1.3f)); + dust.noGravity = true; + dust.color = mainColor; + } + CurrentChargingFrames = 0; + if (modItem.Charge > 0) + modItem.Charge -= 0.25f; + else + Projectile.Kill(); + + chargeAttackTimer = 10; + doingChargeAttack = false; + } + } + if (doingChargeAttack) + chargeAttackTimer--; + } + // Spread Fire mode + else + { + StartSound?.Stop(); + OffsetLengthFromArm -= 10; + ChargeSound?.Stop(); + SoundStyle sound = new("CalamityMod/Sounds/Item/ScattershotShoot"); + SoundEngine.PlaySound(sound with { Volume = 0.7f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f) }, Projectile.Center); + + Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * BulletSpeed * 0.3f; + + float angle1 = MathHelper.ToRadians(3f); + for (int i = 0; i < 2; i++) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center - shootVelocity * 8, shootVelocity.RotatedBy(angle1), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center - shootVelocity * 4, shootVelocity.RotatedBy(angle1 * 0.7f) * 0.9f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + angle1 *= -1; + } + + float angle2 = MathHelper.ToRadians(5f); + for (int i = 0; i < 2; i++) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center - shootVelocity * 8, shootVelocity.RotatedBy(angle2) * 0.95f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + angle2 *= -1; + } + CurrentChargingFrames = 0; + if (modItem.Charge > 0) + modItem.Charge -= 0.1f; + else + Projectile.Kill(); + } + } + else if (downtime == 0) + { + CurrentChargingFrames++; + // Charge-up visuals + if (CurrentChargingFrames >= 10) + { + float particleScale = Utils.GetLerpValue(0, chargeMax, CurrentChargingFrames, true); + float strength = particleScale; + Vector3 DustLight = mainColor.ToVector3(); + Lighting.AddLight(GunTipPosition, DustLight * strength); + } + + // Full charge dusts + if (CurrentChargingFrames == chargeMax) + { + OffsetLengthFromArm += 10; + ChargeSound?.Stop(); + for (int i = 0; i < 20; i++) + { + Dust chargefull = Dust.NewDustPerfect(GunTipPosition, 66); + chargefull.velocity = (MathHelper.TwoPi * i / 20f).ToRotationVector2() * 4f + Owner.velocity * 0.5f; + chargefull.scale = Main.rand.NextFloat(0.6f, 0.8f); + chargefull.noGravity = true; + chargefull.color = mainColor; + } + SoundStyle sound = new("CalamityMod/Sounds/Item/ScattershotChargeLoop"); + ChargeSlot = SoundEngine.PlaySound(sound with { Volume = 0.7f, IsLooped = true }, Projectile.Center); + } + + if (CurrentChargingFrames > 10) + { + for (int i = 0; i < 2; i++) + { + Vector2 spawnPos = Projectile.Center + Main.rand.NextVector2Circular(25, 25); + + Particle spark = new LineParticle(spawnPos, (GunTipPosition - spawnPos).SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(1, 4), false, 4, Main.rand.NextFloat(0.3f, 0.45f), Color.Red); + GeneralParticleHandler.SpawnParticle(spark); + } + } + } + + if (!doingChargeAttack) + { + if (downtime == 1 && !Owner.Calamity().mouseRight) + Projectile.Kill(); + + if (downtime > 0) + downtime--; + + if ((Owner.Calamity().mouseRight || Owner.Calamity().arsenalCooldown > 0)) + CurrentChargingFrames = 0; + + if (Owner.Calamity().mouseRight) + { + StartSound?.Stop(); + } + } + + time++; + } + public override void OnKill(int timeLeft) + { + if (SoundEngine.TryGetActiveSound(ChargeSlot, out var ChargeSound)) + ChargeSound?.Stop(); + if (SoundEngine.TryGetActiveSound(StartSlot, out var StartSound)) + StartSound?.Stop(); + } + public override bool PreDraw(ref Color lightColor) + { + if (time < 2) + return false; + + float fade = Utils.GetLerpValue(chargeMax / 3, chargeMax, CurrentChargingFrames, true); + + Texture2D texture = ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/ScattershotSkewer").Value; + Texture2D glowTexture = ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/ScattershotSkewerGlow").Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition + new Vector2(0, -3); + + if (CurrentChargingFrames > 10 && !Owner.CantUseHoldout() && !Owner.Calamity().mouseRight && CurrentChargingFrames < chargeMax) + { + float rumble = Utils.GetLerpValue(10, chargeMax, CurrentChargingFrames, true); + drawPosition += Main.rand.NextVector2Circular(5 * rumble, 5 * rumble); + } + + Color drawColor = Projectile.GetAlpha(lightColor); + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = texture.Size() * 0.5f; + SpriteEffects flipSprite = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + Texture2D rechargeTexture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + Texture2D pointTexture = ModContent.Request("CalamityMod/Particles/GlowSpark").Value; + + Main.EntitySpriteDraw(texture, drawPosition, null, drawColor, drawRotation, rotationPoint, Projectile.scale, flipSprite); + + if (CurrentChargingFrames > 10 && downtime == 0) + { + for (int i = 0; i < 3; i++) + { + Color auraColor = Color.White with { A = 0 } * Utils.GetLerpValue(10, chargeMax, CurrentChargingFrames, true) * 0.6f; + Vector2 rotationalDrawOffset = (MathHelper.TwoPi * i / 7f + Main.GlobalTimeWrappedHourly * 40f).ToRotationVector2(); + rotationalDrawOffset *= 3; + Main.EntitySpriteDraw(glowTexture, drawPosition + rotationalDrawOffset, null, auraColor, drawRotation, rotationPoint, Projectile.scale, flipSprite); + } + + float randSize = Main.rand.NextFloat(0.4f, 0.9f); + Main.EntitySpriteDraw(rechargeTexture, GunTipPosition - Main.screenPosition + Projectile.velocity * 5, null, mainColor with { A = 0 }, Projectile.rotation, rechargeTexture.Size() * 0.5f, 0.25f * Utils.GetLerpValue(0, chargeMax, CurrentChargingFrames, true) * randSize, SpriteEffects.None, 0); + Main.EntitySpriteDraw(rechargeTexture, GunTipPosition - Main.screenPosition + Projectile.velocity * 5, null, Color.White with { A = 0 }, Projectile.rotation, rechargeTexture.Size() * 0.5f, 0.15f * Utils.GetLerpValue(0, chargeMax, CurrentChargingFrames, true) * randSize, SpriteEffects.None, 0); + + //Main.EntitySpriteDraw(pointTexture, tipPosition - Main.screenPosition + (Projectile.velocity * 15 * fade), null, mainColor with { A = 0 } * fade, Projectile.velocity.RotatedBy(MathHelper.ToRadians(90f)).ToRotation(), pointTexture.Size() * 0.5f, new Vector2(0.5f, 0.9f) * 0.035f * fade * randSize * (CurrentChargingFrames == chargeMax ? 1.5f : 1), flipSprite); + } + + Main.EntitySpriteDraw(glowTexture, drawPosition, null, Color.White, drawRotation, rotationPoint, Projectile.scale, flipSprite); + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/TaserExplosion.cs b/Projectiles/DraedonsArsenal/TaserExplosion.cs new file mode 100644 index 0000000000..8cc00129fa --- /dev/null +++ b/Projectiles/DraedonsArsenal/TaserExplosion.cs @@ -0,0 +1,47 @@ +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Ranged +{ + public class TaserExplosion : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public float radius = 100; + public override void SetDefaults() + { + Projectile.width = 200; + Projectile.height = 200; + Projectile.friendly = true; + Projectile.ignoreWater = false; + Projectile.tileCollide = false; + Projectile.penetrate = -1; + Projectile.timeLeft = 2; + Projectile.DamageType = DamageClass.Ranged; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + target.AddBuff(ModContent.BuffType(), 300); + + if (Projectile.numHits > 0) + Projectile.damage = (int)(Projectile.damage * 0.8f); + if (Projectile.damage < 1) + Projectile.damage = 1; + } + + public override void AI() + { + if (Projectile.ai[0] == 0) + radius = 200; + } + + public override bool PreDraw(ref Color lightColor) + { + return false; + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, radius, targetHitbox); + } +} diff --git a/Projectiles/DraedonsArsenal/TaserHook.cs b/Projectiles/DraedonsArsenal/TaserHook.cs index fc876533ee..b20aca6b8d 100644 --- a/Projectiles/DraedonsArsenal/TaserHook.cs +++ b/Projectiles/DraedonsArsenal/TaserHook.cs @@ -1,8 +1,11 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; using Terraria; -using Terraria.ID; +using Terraria.Audio; using Terraria.ModLoader; namespace CalamityMod.Projectiles.DraedonsArsenal @@ -10,6 +13,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public class TaserHook : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Misc"; + public static readonly SoundStyle Explode = new("CalamityMod/Sounds/Item/ElectricBurst") { Volume = 0.8f }; public enum TaserAIState { Firing, @@ -35,51 +39,88 @@ namespace CalamityMod.Projectiles.DraedonsArsenal set => Projectile.localAI[0] = value; } - public const float ReelbackSpeed = 25f; + public const float ReelbackSpeed = 40f; + public Color hookColor = Color.SlateGray; + public SlotId Hum { get; set; } public override void SetDefaults() { Projectile.width = 14; - Projectile.height = 14; + Projectile.height = 10; Projectile.friendly = true; Projectile.penetrate = 2; + Projectile.extraUpdates = 3; Projectile.tileCollide = true; Projectile.ownerHitCheck = true; Projectile.DamageType = DamageClass.Ranged; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 8; + Projectile.localNPCHitCooldown = 15; } public override void AI() { - Time++; + if (AIState != TaserAIState.Firing) + Time++; Player player = Main.player[Projectile.owner]; + hookColor = Color.Lerp(hookColor, Color.SlateGray, 0.25f); + + float distanceFromPlayer = Projectile.Distance(player.Center); switch (AIState) { case TaserAIState.Firing: - float distanceFromPlayer = Projectile.Distance(player.Center); - if (distanceFromPlayer > 600f || Time >= 90f) + if (distanceFromPlayer > 800f || Time >= 90f) GoToAIState(TaserAIState.ReelingBack); break; case TaserAIState.Electrocuting: - // Reel back to the player if the target has been killed or a second has passed. - if (!Main.npc[ElectrocutionTarget].active || Time >= 60f) + if (distanceFromPlayer > 800f) + GoToAIState(TaserAIState.ReelingBack); + + if (SoundEngine.TryGetActiveSound(Hum, out var hum) && hum.IsPlaying) { + hum.Position = player.Center; + hum.Pitch = MathHelper.Lerp(0f, 1f, Utils.GetLerpValue(0f, 150, Time, true)); + } + // electric explosion; + if (Time == 150 || !Main.npc[ElectrocutionTarget].active) + { + SoundEngine.PlaySound(Explode, Projectile.Center); + Projectile.localNPCHitCooldown = 15; + + for (int i = 0; i < 30; i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, 226, new Vector2(15, 15).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1f)); + dust.scale = Main.rand.NextFloat(0.6f, 0.9f); + Dust dust2 = Dust.NewDustPerfect(Projectile.Center, 66, new Vector2(13, 13).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1f)); + dust2.scale = Main.rand.NextFloat(0.9f, 1.4f); + dust2.noGravity = true; + dust2.color = Color.Cyan; + } + DirectionalPulseRing pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Cyan * 0.5f, new Vector2(1, 1), 0, 0, 3.5f, 13); + GeneralParticleHandler.SpawnParticle(pulse); + + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage * 2, Projectile.knockBack * 5, Projectile.owner, 0); + Time = 0; GoToAIState(TaserAIState.ReelingBack); return; } - - Projectile.Center = Main.npc[ElectrocutionTarget].Center; + if (Main.npc[ElectrocutionTarget].active) + Projectile.Center = Main.npc[ElectrocutionTarget].Center; break; case TaserAIState.ReelingBack: // Kill the gun and the hook if the hook has returned to the gun. + if (SoundEngine.TryGetActiveSound(Hum, out var hum2) && hum2.IsPlaying) + { + hum2?.Stop(); + } if (Projectile.Hitbox.Intersects(player.Hitbox)) { + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/DudFire") with { Volume = 0.5f, Pitch = 0.3f }, Projectile.Center); Projectile.Kill(); return; } Projectile.tileCollide = false; - Projectile.velocity = Projectile.SafeDirectionTo(player.Center) * ReelbackSpeed; + Projectile.extraUpdates = 5; + Projectile.velocity = Projectile.SafeDirectionTo(player.Center) * (ReelbackSpeed / Projectile.extraUpdates); break; } @@ -111,18 +152,24 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override bool PreDraw(ref Color lightColor) { Player player = Main.player[Projectile.owner]; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Utils.DrawLine(Main.spriteBatch, player.MountedCenter, Projectile.Center, Color.Cyan, Color.White, 4f); + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Utils.DrawLine(Main.spriteBatch, player.MountedCenter, Projectile.Center, hookColor, hookColor, 3); Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, lightColor, Projectile.rotation, texture.Size() * 0.5f, Projectile.scale, SpriteEffects.None, 0); return false; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { + Projectile.tileCollide = false; + if (Projectile.localNPCHitCooldown > 7 && target == Main.npc[ElectrocutionTarget]) + Projectile.localNPCHitCooldown -= 1; + hookColor = Color.Cyan; target.AddBuff(ModContent.BuffType(), 120); if (AIState == TaserAIState.Firing) { + Projectile.Center = target.Center; + Projectile.extraUpdates = 0; if (!Main.dedServ) { for (int i = 0; i < 50; i++) @@ -138,6 +185,10 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } ElectrocutionTarget = target.whoAmI; Time = 0f; + + SoundStyle charge = new("CalamityMod/Sounds/Item/LowHum"); + Hum = SoundEngine.PlaySound(charge with { Volume = 1.6f, IsLooped = true }, Projectile.Center); + GoToAIState(TaserAIState.Electrocuting); } } diff --git a/Projectiles/DraedonsArsenal/TaserHook.png b/Projectiles/DraedonsArsenal/TaserHook.png index 1efdfb0ad7..9dd6e3ffc9 100644 Binary files a/Projectiles/DraedonsArsenal/TaserHook.png and b/Projectiles/DraedonsArsenal/TaserHook.png differ diff --git a/Projectiles/DraedonsArsenal/TrackingDiskLaser.cs b/Projectiles/DraedonsArsenal/TrackingDiskLaser.cs index 7e42868aea..09f57b62a9 100644 --- a/Projectiles/DraedonsArsenal/TrackingDiskLaser.cs +++ b/Projectiles/DraedonsArsenal/TrackingDiskLaser.cs @@ -1,6 +1,8 @@ -using Terraria; -using Terraria.ID; +using CalamityMod.Particles; +using Terraria; using Terraria.ModLoader; +using Microsoft.Xna.Framework; +using CalamityMod.NPCs; namespace CalamityMod.Projectiles.DraedonsArsenal { @@ -14,8 +16,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal get => Projectile.localAI[0]; set => Projectile.localAI[0] = value; } - - public override void SetStaticDefaults() => ProjectileID.Sets.CultistIsResistantTo[Type] = true; public override void SetDefaults() { Projectile.width = 2; @@ -31,30 +31,68 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void AI() { - Lighting.AddLight(Projectile.Center, 0.2f, 0.1f, 0f); - + Player Owner = Main.player[Projectile.owner]; + float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); Time++; - if (Time >= 10f) + if (Time == 1) { - for (int i = 0; i < 2; i++) + for (int i = 0; i < 7; i++) { - Dust dust = Dust.NewDustDirect(Projectile.Center, 0, 0, DustID.TheDestroyer, 0f, 0f, 160, default, 2f); - dust.position = Projectile.Center; - dust.velocity = Projectile.velocity; - dust.scale = Projectile.scale; + Dust dust = Dust.NewDustPerfect(Projectile.Center, 267); + dust.velocity = (Projectile.velocity * 3).RotatedByRandom(0.4f) * Main.rand.NextFloat(0.3f, 1f); + dust.scale = Main.rand.NextFloat(0.6f, 0.8f); dust.noGravity = true; + dust.color = Color.Red; + } + } + if (Time >= 15f) + { + if (Projectile.timeLeft % 11 == 0 && targetDist < 1400) + { + Particle spark = new LineParticle(Projectile.Center - Projectile.velocity * 10, -Projectile.velocity * 0.01f, false, 4, 1.5f * Projectile.scale, Color.Red); + GeneralParticleHandler.SpawnParticle(spark); + } + if (Projectile.timeLeft % 2 == 0 && targetDist < 1400) + { + Particle spark2 = new LineParticle(Projectile.Center - Projectile.velocity * 10, -Projectile.velocity * 0.01f, false, 4, 0.35f * Projectile.scale, Color.White); + GeneralParticleHandler.SpawnParticle(spark2); } } } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + // Handles giving the NPC the laser burn effect + CalamityGlobalNPC modNPC = target.Calamity(); + if (!modNPC.laserBurnMarked) + { + modNPC.laserBurnMarked = true; + modNPC.laserBurnType = 1; + modNPC.laserBurnTimer = CalamityGlobalNPC.laserBurnTime; + } + modNPC.laserBurnTimer -= modNPC.laserBurnStacks * 2; + modNPC.laserBurnDamage += (int)(Projectile.damage * 0.2f); + + modNPC.laserBurnStacks++; + + if (Projectile.scale == 1) + { + Projectile.damage = 1; + modifiers.HideCombatText(); + } + else + modifiers.SourceDamage *= 0.15f; + } public override void OnKill(int timeLeft) { - Projectile.ExpandHitboxBy(60); - Projectile.maxPenetrate = -1; - Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.Damage(); + for (int i = 0; i < 7; i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, 267); + dust.velocity = (Projectile.velocity * 3 * Projectile.scale).RotatedByRandom(0.3f) * Main.rand.NextFloat(0.3f, 1f); + dust.scale = Main.rand.NextFloat(0.4f, 0.7f) * Projectile.scale; + dust.noGravity = true; + dust.color = Color.Red; + } } } } diff --git a/Projectiles/DraedonsArsenal/TrackingDiskProjectile.cs b/Projectiles/DraedonsArsenal/TrackingDiskProjectile.cs index 5bb2ae7fd9..f9d518e7c2 100644 --- a/Projectiles/DraedonsArsenal/TrackingDiskProjectile.cs +++ b/Projectiles/DraedonsArsenal/TrackingDiskProjectile.cs @@ -2,6 +2,8 @@ using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -12,6 +14,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { public new string LocalizationCategory => "Projectiles.Misc"; public override string Texture => "CalamityMod/Items/Weapons/DraedonsArsenal/TrackingDisk"; + public NPC extraShotTarget; public bool ReturningToPlayer { @@ -25,40 +28,47 @@ namespace CalamityMod.Projectiles.DraedonsArsenal set => Projectile.ai[1] = value; } - public const int LaserFireRate = 22; - public const int LaserFireRateStealth = 18; - public const int MaxLaserCountPerShot = 4; // This only applies to stealth strikes. - public const float MaxTargetSearchDistance = 480f; + public const int LaserFireRate = 19; + public const int LaserFireRateStealth = 15; + public const int MaxLaserCountPerShot = 2; // This only applies to stealth strikes. + public const float MaxTargetSearchDistance = 600f; public const float MaxTargetSearchStealth = 800f; public const float ReturnAccelerationFactor = 0.0012f; - public const float ReturnMaxSpeed = 12f; + public const float ReturnMaxSpeed = 6f; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Type] = 4; - ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 7; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { - Projectile.width = 30; - Projectile.height = 30; + Projectile.width = 58; + Projectile.height = 48; Projectile.friendly = true; Projectile.penetrate = -1; - Projectile.extraUpdates = 1; + Projectile.extraUpdates = 2; + Projectile.tileCollide = false; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() { - Lighting.AddLight(Projectile.Center, Color.Red.ToVector3()); + Lighting.AddLight(Projectile.Center, Color.Red.ToVector3() * 0.4f); Player player = Main.player[Projectile.owner]; Time++; + + if (Time == 5) + Projectile.tileCollide = true; + if (!ReturningToPlayer) { - if (Time >= 45f) + if (Time >= 55f) { ReturningToPlayer = true; Projectile.tileCollide = false; @@ -72,13 +82,13 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile.Kill(); // This is done instead of a Normalize or DirectionTo call because the variables needed are already present and calculating the square root again would be unnecessary. - Vector2 idealVelocity = (player.Center - Projectile.Center) / distanceFromPlayer * ReturnMaxSpeed; + Vector2 idealVelocity = (player.Center - Projectile.Center) / distanceFromPlayer * ReturnMaxSpeed * (Projectile.Calamity().stealthStrike ? Utils.GetLerpValue(90, 300, Time, true) * 1.5f : Utils.GetLerpValue(60, 300, Time, true)); Projectile.velocity.X += Math.Sign(idealVelocity.X - Projectile.velocity.X) * (ReturnAccelerationFactor * Time); Projectile.velocity.Y += Math.Sign(idealVelocity.Y - Projectile.velocity.Y) * (ReturnAccelerationFactor * Time); if (Time % (Projectile.Calamity().stealthStrike ? LaserFireRateStealth : LaserFireRate) == 0f) - AttemptToFireLasers((int)(Projectile.damage * 0.25)); + AttemptToFireLasers(Projectile.damage); if (Main.myPlayer == Projectile.owner) { @@ -87,7 +97,12 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } } - Projectile.rotation += 0.25f; + if (ReturningToPlayer) + { + Projectile.rotation += 0.28f * Utils.GetLerpValue(30, 300, Time, true); + } + else + Projectile.rotation += 0.15f; } public void AttemptToFireLasers(int damage) @@ -105,16 +120,29 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { if (targetCount >= MaxLaserCountPerShot) break; - Projectile laser = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, - Projectile.SafeDirectionTo(target.Center) * 4f, + Vector2 spawnLocation = Projectile.Center + new Vector2(25, 0).RotatedBy(Projectile.rotation * Utils.GetLerpValue(300, 30, Time, true)); + Projectile laser = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), spawnLocation, + (spawnLocation - target.Center).SafeNormalize(Vector2.UnitX) * -3f, ModContent.ProjectileType(), - (int)(damage * 0.6f), + (int)(damage), Projectile.knockBack, Projectile.owner, 1f); laser.scale *= 1.6f; laser.netUpdate = true; targetCount++; + extraShotTarget = target; + } + if (targetCount == 1) + { + Vector2 spawnLocation = Projectile.Center + new Vector2(25, 0).RotatedBy(-Projectile.rotation * Utils.GetLerpValue(300, 30, Time, true)); + Projectile laser = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), spawnLocation, + (spawnLocation - extraShotTarget.Center).SafeNormalize(Vector2.UnitX) * -3f, + ModContent.ProjectileType(), + (int)(damage), + Projectile.knockBack, + Projectile.owner, + 1f); } } else @@ -122,7 +150,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal NPC potentialTarget = Projectile.Center.ClosestNPCAt(MaxTargetSearchDistance); if (potentialTarget != null) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.SafeDirectionTo(potentialTarget.Center) * 3f, ModContent.ProjectileType(), damage, Projectile.knockBack, Projectile.owner); + Vector2 spawnLocation = Projectile.Center + new Vector2(25, 0).RotatedBy(Projectile.rotation * 0.4f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnLocation, (spawnLocation - potentialTarget.Center).SafeNormalize(Vector2.UnitX) * -3f, ModContent.ProjectileType(), damage, Projectile.knockBack, Projectile.owner); } } } @@ -141,7 +170,21 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, ProjectileID.Sets.TrailCacheLength[Type]); + Asset texture = ModContent.Request(Texture); + + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Vector2 rotationPoint = texture.Size() * 0.5f; + Vector2 origin = texture.Size() * 0.5f; + + Texture2D rechargeTexture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, ProjectileID.Sets.TrailCacheLength[Projectile.type], null, true, false); + // Glow Orb + Main.EntitySpriteDraw(rechargeTexture, drawPosition, null, Color.Red with { A = 0 } * 0.65f, Projectile.rotation, rechargeTexture.Size() * 0.5f, 0.4f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(rechargeTexture, drawPosition, null, Color.White with { A = 0 } * 0.35f, Projectile.rotation, rechargeTexture.Size() * 0.5f, 0.2f, SpriteEffects.None, 0); + + Main.EntitySpriteDraw(texture.Value, drawPosition, null, lightColor, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + return false; } } diff --git a/Projectiles/DraedonsArsenal/UnstableMatter.cs b/Projectiles/DraedonsArsenal/UnstableMatter.cs deleted file mode 100644 index 34f8e8b7b6..0000000000 --- a/Projectiles/DraedonsArsenal/UnstableMatter.cs +++ /dev/null @@ -1,104 +0,0 @@ -using System; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.DraedonsArsenal -{ - public class UnstableMatter : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Misc"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public bool HasCollidedWithATile - { - get => Projectile.ai[0] == 1f; - set => Projectile.ai[0] = value.ToInt(); - } - - public float Time - { - get => Projectile.ai[1]; - set => Projectile.ai[1] = value; - } - - public override void SetDefaults() - { - Projectile.width = 10; - Projectile.height = 10; - Projectile.friendly = true; - Projectile.DamageType = DamageClass.Ranged; - Projectile.tileCollide = true; - Projectile.penetrate = -1; - Projectile.timeLeft = 480; - } - - public override void AI() - { - // Cast some lime light at the projectile's position. - Lighting.AddLight(Projectile.Center, Color.GreenYellow.ToVector3()); - Time++; - if (Time >= 10f) - GenerateIdleDust(); - } - - public void GenerateIdleDust() - { - if (Main.dedServ) - return; - - // Release some dust outward. - // The faster the projectile itself is, the slower the dust, and the longer it lasts. - // This is done to give the projectile a "streak" movement the faster it is versus a expansion. - int dustCount = HasCollidedWithATile ? 5 : 12; - float baseSpeedRatio = Utils.GetLerpValue(6f, 14f, Projectile.velocity.Length(), true); - float speed = MathHelper.Lerp(6f, 1.8f, (float)Math.Pow(baseSpeedRatio, 3f)); - if (!HasCollidedWithATile) - speed += MathHelper.Lerp(-6f, 4f, Utils.GetLerpValue(10f, 150f, Time, true)); - float persistence = MathHelper.Lerp(0f, 0.8f, baseSpeedRatio); - for (int i = 0; i < dustCount; i++) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center, 107); - dust.velocity = Main.rand.NextVector2CircularEdge(speed, speed) - Projectile.velocity; - dust.fadeIn = persistence; - dust.scale = 0.9f; - dust.noGravity = true; - } - } - - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - if (!HasCollidedWithATile) - modifiers.SourceDamage /= 3; - else if (Projectile.penetrate == -1) - Projectile.penetrate = 1; - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - // Register the tile collision, if one has not happened yet. - if (!HasCollidedWithATile) - { - HasCollidedWithATile = true; - - // And bounce off the tile. Or towards a nearby enemy, if there is one. - NPC potentialTarget = Projectile.Center.ClosestNPCAt(700f, false); - if (potentialTarget != null) - Projectile.velocity = Projectile.SafeDirectionTo(potentialTarget.Center); - else - { - if (Projectile.velocity.X != oldVelocity.X) - Projectile.velocity.X = -oldVelocity.X; - if (Projectile.velocity.Y != oldVelocity.Y) - Projectile.velocity.Y = -oldVelocity.Y; - } - - Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 14f; - - Projectile.netUpdate = true; - return false; - } - return true; - } - } -} diff --git a/Projectiles/Enemy/ToxicMinnowCloud.cs b/Projectiles/Enemy/ToxicMinnowCloud.cs index fa67dcad89..f5ba29a1d1 100644 --- a/Projectiles/Enemy/ToxicMinnowCloud.cs +++ b/Projectiles/Enemy/ToxicMinnowCloud.cs @@ -25,6 +25,8 @@ namespace CalamityMod.Projectiles.Enemy Projectile.ignoreWater = true; Projectile.timeLeft = 600; Projectile.alpha = 120; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Healing/GladiatorHealOrb.cs b/Projectiles/Healing/GladiatorHealOrb.cs index a7ce7ed980..3659aadfad 100644 --- a/Projectiles/Healing/GladiatorHealOrb.cs +++ b/Projectiles/Healing/GladiatorHealOrb.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Projectiles.Healing public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public int target = -1; + public ref float heal => ref Projectile.ai[0]; public override void SetStaticDefaults() { @@ -39,6 +40,7 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { + Projectile.scale = MathHelper.Lerp((heal / 8), 1, 0.65f); float maxDistance = 150f; if (target < 0) { @@ -76,8 +78,7 @@ namespace CalamityMod.Projectiles.Healing float playerDist = playerVector.Length(); if (playerDist < 50f && Projectile.position.X < player.position.X + player.width && Projectile.position.X + Projectile.width > player.position.X && Projectile.position.Y < player.position.Y + player.height && Projectile.position.Y + Projectile.height > player.position.Y) { - int heal = 10; - player.HealPlayer(heal, HealTextType.Local); + player.HealPlayer((int)heal, HealTextType.Local); SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/OrbHeal", 5) { Volume = 0.15f }, Projectile.Center); @@ -108,8 +109,8 @@ namespace CalamityMod.Projectiles.Healing intensity *= Projectile.timeLeft / 60f; } // Become smaller the futher along the old positions we are. - Vector2 outerScale = new Vector2(1f) * intensity; - Vector2 innerScale = new Vector2(1f) * intensity * 0.7f; + Vector2 outerScale = new Vector2(1f) * Projectile.scale * intensity; + Vector2 innerScale = new Vector2(1f) * Projectile.scale * intensity * 0.7f; outerColor *= intensity; innerColor *= intensity; Main.EntitySpriteDraw(lightTexture, drawPosition, null, outerColor, 0f, lightTexture.Size() * 0.5f, outerScale * 0.25f, SpriteEffects.None, 0); diff --git a/Projectiles/Magic/AbyssBall.cs b/Projectiles/Magic/AbyssBall.cs index 7b1c806410..96d90b3332 100644 --- a/Projectiles/Magic/AbyssBall.cs +++ b/Projectiles/Magic/AbyssBall.cs @@ -21,6 +21,8 @@ namespace CalamityMod.Projectiles.Magic Projectile.tileCollide = false; Projectile.timeLeft = 300; Projectile.DamageType = DamageClass.Magic; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Magic/AcidicSaxBubble.cs b/Projectiles/Magic/AcidicSaxBubble.cs index 740ff708e4..75a229df18 100644 --- a/Projectiles/Magic/AcidicSaxBubble.cs +++ b/Projectiles/Magic/AcidicSaxBubble.cs @@ -31,6 +31,8 @@ namespace CalamityMod.Projectiles.Magic Projectile.DamageType = DamageClass.Magic; Projectile.penetrate = -1; Projectile.alpha = 255; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Magic/ApoctosisArrayHoldout.cs b/Projectiles/Magic/ApoctosisArrayHoldout.cs new file mode 100644 index 0000000000..6e4ab6c4d4 --- /dev/null +++ b/Projectiles/Magic/ApoctosisArrayHoldout.cs @@ -0,0 +1,353 @@ +using System; +using CalamityMod.Dusts; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class ApoctosisArrayHoldout : BaseGunHoldoutProjectile + { + public override int AssociatedItemID => ModContent.ItemType(); + public override Vector2 GunTipPosition => base.GunTipPosition - Vector2.UnitY.RotatedBy(Projectile.rotation) * 1.5f * Projectile.spriteDirection; + public override float MaxOffsetLengthFromArm => 47f; + public override float OffsetXUpwards => -5f; + public override float BaseOffsetY => -13f; + public override float OffsetYDownwards => 5f; + public override float WeaponTurnSpeed => 0.35f; + public override float RecoilResolveSpeed => shootingTimer >= 0 ? 0.3f : 0.05f; + + public bool firing => Projectile.ai[2] == 0; + public ref float shootingTimer => ref Projectile.ai[0]; + public ref float manaPower => ref Projectile.ai[1]; + public Color effectsColor { get; set; } = Color.Crimson; + public int fireRate => Owner.HeldItem.useAnimation; + public bool fullyCharged = false; + public int time = 0; + public int shotNum = 0; + public SlotId ionHum { get; set; } + + public override void KillHoldoutLogic() + { + if (Owner.dead) + { + if (SoundEngine.TryGetActiveSound(ionHum, out var hum) && hum.IsPlaying) + { + hum?.Stop(); + } + Projectile.Kill(); + } + } + + public override void HoldoutAI() + { + bool isAtMaxMana = ((float)Owner.statMana / (float)Owner.statManaMax2) >= 1; + Projectile.timeLeft++; + + if (time == 0) + shootingTimer = fireRate; + + if (shootingTimer < 0) + { + OnCooldown(); + shootingTimer++; + if (shootingTimer == 0) + { + shootingTimer = fireRate; + if (SoundEngine.TryGetActiveSound(ionHum, out var hum) && hum.IsPlaying) + { + hum?.Stop(); + } + } + return; + } + + if (HeldItem.type != Owner.ActiveItem().type) + { + if (manaPower > 0) + shootingTimer = -75; + if (SoundEngine.TryGetActiveSound(ionHum, out var hum) && hum.IsPlaying) + { + hum?.Stop(); + } + Projectile.Kill(); + } + + if (shootingTimer == 0) + { + if (firing) + { + if (Owner.Calamity().mouseRight) + { + Projectile.ai[2] = 5; + return; + } + if (Owner.CheckMana(HeldItem, -1, true, false)) + { + Shoot(false); + shootingTimer = fireRate; + } + else + { + SoundEngine.PlaySound(SoundID.MaxMana with { Pitch = -0.5f }, Projectile.Center); + shootingTimer = -40; + } + } + else // Charging mode + { + if (SoundEngine.TryGetActiveSound(ionHum, out var hum) && hum.IsPlaying) + { + hum.Position = Projectile.Center; + hum.Pitch = MathHelper.Lerp(-0.5f, 0.1f, manaPower); + } + else + { + SoundStyle charge = new("CalamityMod/Sounds/Item/IonChargeLoop"); + ionHum = SoundEngine.PlaySound(charge with { Volume = 0.7f, IsLooped = true }, Projectile.Center); + } + + if (Owner.Calamity().mouseRight) + { + if (!isAtMaxMana) + { + // This gives mana recharge a consistent rate rather than being variable by a frame + // Without it the mana recharge rate would change if you started charging on an even value rather than an odd one + if (manaPower == 0) + time = 100; + + if (time % 2 == 0) + { + Owner.statMana += (int)(Owner.statManaMax2 * 0.025f); // 80 frames to reach max mana + manaPower += 0.0275f; // 72 frames to reach max power + // Mana power reaches max at 90% mana regained + + if (Owner.statMana > Owner.statManaMax2) + Owner.statMana = Owner.statManaMax2; + } + if (manaPower > 1) + manaPower = 1; + + Vector2 vel = Projectile.velocity.RotateRandom(0.7f) * Main.rand.NextFloat(7, 14); + Dust dust2 = Dust.NewDustPerfect(GunTipPosition + vel * 10, ModContent.DustType(), -vel); + dust2.scale = Main.rand.NextFloat(0.35f, 0.55f); + dust2.noGravity = true; + dust2.color = Main.rand.NextBool() ? Color.Lerp(effectsColor, Color.White, 0.5f) : effectsColor; + } + + if (isAtMaxMana && !fullyCharged && manaPower >= 0.25f) + { + SoundStyle fullCharge = new("CalamityMod/Sounds/Item/DudFire"); + for (int i = 0; i < 2; i++) + SoundEngine.PlaySound(fullCharge with { Volume = .6f, Pitch = -0.7f + i * 1.5f, MaxInstances = 2 }, Projectile.Center); + fullyCharged = true; + OffsetLengthFromArm -= 7f * manaPower; + } + + OffsetLengthFromArm += 1.3f * manaPower; + } + else + { + if (fullyCharged) + { + Shoot(true); + fullyCharged = false; + } + else // Failure to full charge + { + SoundEngine.PlaySound(SoundID.Item109 with { Volume = 0.7f, Pitch = 1f }, Projectile.Center); + for (int i = 0; i < 10; i++) + { + Vector2 vel = Projectile.velocity.RotateRandom(Math.PI); + Dust dust2 = Dust.NewDustPerfect(GunTipPosition, ModContent.DustType(), -vel); + dust2.scale = Main.rand.NextFloat(0.95f, 1.35f) * (manaPower + 0.3f); + dust2.noGravity = false; + dust2.color = Main.rand.NextBool() ? Color.Lerp(effectsColor, Color.White, 0.5f) : effectsColor; + } + } + manaPower = 0; + shootingTimer = -75; + Projectile.ai[2] = 0; // Return to regular firing mode + } + } + } + else + { + if (!Owner.Calamity().mouseRight && !Main.mouseLeft) + { + if (SoundEngine.TryGetActiveSound(ionHum, out var hum) && hum.IsPlaying) + { + hum?.Stop(); + } + Projectile.Kill(); + } + } + + if (shootingTimer > 0) + shootingTimer--; + + time++; + } + public void OnCooldown() + { + Projectile.timeLeft++; + + if (SoundEngine.TryGetActiveSound(ionHum, out var hum) && hum.IsPlaying) + { + float lerp = Utils.GetLerpValue(-60, 0, shootingTimer, true); + hum.Position = Projectile.Center; + hum.Pitch = MathHelper.Lerp(0f, -0.6f, lerp); + hum.Volume = 1 - lerp; + } + + Vector2 smokeVel = new Vector2(0, -6) * Main.rand.NextFloat(0.1f, 1.1f); + Particle smoke = new HeavySmokeParticle(GunTipPosition, smokeVel, Color.SlateGray, Main.rand.Next(40, 60 + 1), Main.rand.NextFloat(0.3f, 0.6f), 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool()); + GeneralParticleHandler.SpawnParticle(smoke); + } + public void Shoot(bool big) + { + float manaPercent = ((float)Owner.statMana / (float)Owner.statManaMax2); + Vector2 shootDirection = Projectile.velocity.SafeNormalize(Vector2.Zero); + Vector2 firingVelocity = (shootDirection * 4); + float damageBoost = Math.Max((manaPower * 55) * (manaPower >= 1 ? 1.3f : 1f), 1); + + if (big) + { + if (SoundEngine.TryGetActiveSound(ionHum, out var hum) && hum.IsPlaying) + { + hum?.Stop(); + } + + SoundStyle fire = new("CalamityMod/Sounds/Item/ImpalerLaunch"); + for (int i = 0; i < (manaPower >= 1 ? 2 : 1); i++) + SoundEngine.PlaySound(fire with { Volume = 0.9f, Pitch = -0.7f, MaxInstances = 2 }, Projectile.Center); + + SoundStyle fire2 = new("CalamityMod/Sounds/Item/PulseRifleFire"); + SoundEngine.PlaySound(fire2 with { Volume = 0.75f, Pitch = (manaPower >= 1 ? 0.7f : 0.5f) }, Projectile.Center); + + Owner.Calamity().GeneralScreenShakePower = 12f * manaPower; + float projSpeedMult = (manaPower + 0.4f) * (manaPower >= 1 ? 3f : 2f); + + float variance = Main.rand.NextFloat(-0.8f, 0.8f); + Vector2 vel = firingVelocity * projSpeedMult; + if (Main.myPlayer == Projectile.owner) + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, vel, ModContent.ProjectileType(), (int)(Projectile.damage * damageBoost), Projectile.knockBack * 4, Projectile.owner, 0, 0, 5); + + OffsetLengthFromArm -= 24f * manaPower; + Owner.velocity -= Projectile.velocity * 14f * manaPower; + Projectile.rotation += 0.5f * Projectile.direction; + + for (int i = 0; i < Math.Max(3, 30 * manaPower); i++) + { + Particle sparks = new SparkParticle(GunTipPosition, Projectile.velocity.RotatedByRandom(0.7f) * Main.rand.NextFloat(7, 25), false, 35, Main.rand.NextFloat(0.5f, 0.9f), Main.rand.NextBool() ? Color.Lerp(effectsColor, Color.White, 0.5f) : effectsColor); + GeneralParticleHandler.SpawnParticle(sparks); + } + Particle pulse3 = new CustomSpark(GunTipPosition, shootDirection * 7, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false, 23, 0.085f * manaPower, effectsColor, new Vector2(2f, 0.7f), shrinkSpeed: 0.1f); + GeneralParticleHandler.SpawnParticle(pulse3); + Particle pulse4 = new CustomSpark(GunTipPosition, shootDirection * 13, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false, 18, 0.06f * manaPower, effectsColor, new Vector2(2f, 0.7f), shrinkSpeed: 0.1f); + GeneralParticleHandler.SpawnParticle(pulse4); + } + else + { + SoundStyle shoot = new("CalamityMod/Sounds/Item/ApoctosisShoot"); + SoundEngine.PlaySound(shoot with { Volume = 0.25f, Pitch = 0.5f - 1.1f * manaPercent, MaxInstances = -1 }, Projectile.Center); + if (shotNum % 2 == 0) + { + if (Main.myPlayer == Projectile.owner) + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0); + for (int k = 1; k <= 10; k++) + { + Color useColor = Main.rand.NextBool() ? Color.Lerp(effectsColor, Color.White, 0.3f) : effectsColor; + Vector2 shootVel = (shootDirection * 15).RotatedByRandom(0.5f) * Main.rand.NextFloat(0.1f, 1.8f); + + Dust dust2 = Dust.NewDustPerfect(GunTipPosition, ModContent.DustType(), shootVel); + dust2.scale = Main.rand.NextFloat(0.85f, 1f); + dust2.noGravity = true; + dust2.color = useColor; + + if (k % 2 == 0) + { + Particle blast = new CustomSpark(GunTipPosition, Projectile.velocity * 3 * k, "CalamityMod/Particles/BloomLineSoftEdge", false, 11, 0.04f, useColor, new Vector2(1f, 0.8f), shrinkSpeed: 0.8f); + GeneralParticleHandler.SpawnParticle(blast); + } + } + } + else + { + for (int i = -1; i <= 1; i += 2) + { + Vector2 vel = firingVelocity.RotatedBy(0.23f * i); + if (Main.myPlayer == Projectile.owner) + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, vel, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, i); + + shootDirection = shootDirection.RotatedBy(0.23f * i); + for (int k = 1; k <= 10; k++) + { + Color useColor = Main.rand.NextBool() ? Color.Lerp(effectsColor, Color.White, 0.3f) : effectsColor; + Vector2 shootVel = (shootDirection * 15).RotatedByRandom(0.5f) * Main.rand.NextFloat(0.1f, 1.8f); + + Dust dust2 = Dust.NewDustPerfect(GunTipPosition, ModContent.DustType(), shootVel); + dust2.scale = Main.rand.NextFloat(0.85f, 1f); + dust2.noGravity = true; + dust2.color = useColor; + + if (k % 2 == 0) + { + Particle blast = new CustomSpark(GunTipPosition, vel.SafeNormalize(Vector2.UnitX) * 3 * k, "CalamityMod/Particles/BloomLineSoftEdge", false, 11, 0.04f, useColor, new Vector2(1f, 0.8f), shrinkSpeed: 0.8f); + GeneralParticleHandler.SpawnParticle(blast); + } + } + } + } + OffsetLengthFromArm -= 5f; + + shotNum++; + } + } + public override bool PreDraw(ref Color lightColor) + { + float manaPercent = ((float)Owner.statMana / (float)Owner.statManaMax2); + if (time < 2) + return false; + Texture2D tex = TextureAssets.Projectile[Type].Value; + Texture2D texGlow = ModContent.Request("CalamityMod/Items/Weapons/Magic/ApoctosisArrayGlow").Value; + Texture2D tex2 = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + Texture2D sparkle = ModContent.Request("CalamityMod/Particles/HalfStar").Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Vector2 shake = Main.rand.NextVector2Circular(2, 2) * manaPower; + + Main.EntitySpriteDraw(tex, drawPosition + shake, null, Projectile.GetAlpha(lightColor), drawRotation, tex.Size() * 0.5f, Projectile.scale, flipSprite); + + Main.EntitySpriteDraw(texGlow, drawPosition + shake, null, Color.White, drawRotation, texGlow.Size() * 0.5f, Projectile.scale, flipSprite); + + if (shootingTimer >= 0) + { + float reverseManaPower = MathHelper.Lerp(0.7f, 0.1f, manaPower > 0 ? (1 - manaPower) : manaPercent); + for (int i = 0; i < 5; i++) + { + float iMult = (1 - 0.1f * i); + if (manaPower > 0) + Main.EntitySpriteDraw(tex2, GunTipPosition - Main.screenPosition + shake, null, Color.Lerp(effectsColor, Color.White, i * 0.1f) with { A = 0 }, Main.rand.NextFloat(-5f, 5f), tex2.Size() * 0.5f, new Vector2(1f, 0.35f) * 0.75f * manaPower * Main.rand.NextFloat(0.7f, 1.3f) * iMult, flipSprite); + + for (int b = -1; b <= 1; b += 2) + { + float sine = MathHelper.Lerp(((float)Math.Sin(Main.GlobalTimeWrappedHourly * (firing ? 20f : 35f) / MathHelper.Pi)), reverseManaPower * b, 0.75f); + Vector2 scale = new Vector2(0.3f, 1f * sine * b) * (Main.rand.NextFloat(3f, 4.5f) * iMult + manaPower * 1.2f); + float rotation = Projectile.rotation + (time * manaPower * Math.Max(i - 2, 0) * 0.2f) + MathHelper.PiOver4 * b; + Main.EntitySpriteDraw(sparkle, Projectile.Center - Main.screenPosition + Projectile.velocity.RotatedBy(0.44f * Projectile.direction) * 11.7f, null, Color.Lerp(effectsColor, Color.White, i * 0.1f) with { A = 0 }, rotation, sparkle.Size() * 0.5f, scale, flipSprite); + } + } + } + return false; + } + } +} diff --git a/Projectiles/Magic/ApoctosisBlast.cs b/Projectiles/Magic/ApoctosisBlast.cs new file mode 100644 index 0000000000..55327155f1 --- /dev/null +++ b/Projectiles/Magic/ApoctosisBlast.cs @@ -0,0 +1,112 @@ +using System; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Magic +{ + public class ApoctosisBlast : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Magic"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public ref float time => ref Projectile.ai[0]; + public bool chargeShot => Projectile.ai[2] == 5; + public bool onSpawn = true; + public float sine = 0; + public override void SetDefaults() + { + Projectile.width = Projectile.height = 40; + Projectile.friendly = true; + Projectile.penetrate = 1; + Projectile.extraUpdates = 7; + Projectile.ignoreWater = false; + Projectile.timeLeft = 600; + Projectile.DamageType = DamageClass.Magic; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + + public override void AI() + { + Projectile.rotation = Projectile.velocity.ToRotation(); + sine = (float)Math.Sin(Main.GlobalTimeWrappedHourly * 40 / MathHelper.Pi); + if (onSpawn) + { + Projectile.penetrate = -1; + Projectile.extraUpdates = 20; + Projectile.tileCollide = false; + onSpawn = false; + } + Projectile.velocity *= 0.98f; + + if (Projectile.velocity.Length() > 1 && time > 3) + { + Vector2 placement = Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 60; + Particle spark = new GlowSparkParticle(placement, -Projectile.velocity * 0.1f, false, 35, 0.08f, Color.Crimson, new Vector2(0.4f, 1.3f), true, false, 0); + GeneralParticleHandler.SpawnParticle(spark); + + Vector2 vel = -Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.4f) * Main.rand.NextFloat(3.5f, 14f); + if (time % 2 == 0) + { + Particle trail = new CustomSpark(placement + Main.rand.NextVector2Circular(9, 9), vel, "CalamityMod/Particles/GlowSquareParticle", false, Main.rand.Next(17, 42), Main.rand.NextFloat(1.4f, 3.5f), Main.rand.NextBool() ? Color.Lerp(Color.Crimson, Color.White, 0.5f) : Color.Crimson, new Vector2(1f, 1f), extraRotation: MathHelper.PiOver4); + GeneralParticleHandler.SpawnParticle(trail); + } + } + + + Lighting.AddLight(Projectile.Center, Color.Crimson.ToVector3() * 0.8f); + time++; + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + float minMult = 0.2f; + int hitsToMinMult = 15; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + modifiers.SourceDamage *= damageMult; + + for (int i = 0; i < 15; i++) + { + Particle sparks = new SparkParticle(Projectile.Center, Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.7f) * Main.rand.NextFloat(7, 25), false, 35, Main.rand.NextFloat(0.5f, 0.9f), Main.rand.NextBool() ? Color.Lerp(Color.Crimson, Color.White, 0.5f) : Color.Crimson); + GeneralParticleHandler.SpawnParticle(sparks); + } + } + public override void OnKill(int timeLeft) + { + + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + Player Owner = Main.player[Projectile.owner]; + if (time <= 1) + { + float _ = float.NaN; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Owner.Center, Projectile.width, ref _); + } + else + return base.Colliding(projHitbox, targetHitbox); + } + public override bool PreDraw(ref Color lightColor) + { + if (time == 0) + return false; + Texture2D tex2 = ModContent.Request("CalamityMod/Particles/GlowSpark").Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + float drawRotation = Projectile.rotation - MathHelper.PiOver2; + float timeleftFade = Utils.GetLerpValue(0, 190, Projectile.timeLeft, true); + + for (int i = 0; i < 10; i++) + { + float iMult = (1 - 0.06f * i); + Vector2 scale = new Vector2((1.2f - 0.8f * iMult) * timeleftFade, 0.2f + 3 * iMult) * iMult * 0.04f; + Vector2 bodyScale = new Vector2((1.2f - 0.8f * iMult) * timeleftFade, 0.2f + 5 * iMult) * iMult * 0.04f; + for (int b = -1; b <= 1; b += 2) + Main.EntitySpriteDraw(tex2, drawPosition - Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(0.35f * b * (15 - i) * 0.06f * sine) * 65, null, Color.Lerp(Color.Crimson, Color.White, i * 0.05f) with { A = 0 } * iMult * timeleftFade, drawRotation + 0.2f * b * sine, tex2.Size() * 0.5f, scale, SpriteEffects.None); + + Main.EntitySpriteDraw(tex2, drawPosition - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 125, null, Color.Lerp(Color.Crimson, Color.White, i * 0.05f) with { A = 0 } * iMult * timeleftFade, drawRotation, tex2.Size() * 0.5f, bodyScale, SpriteEffects.None); + } + + return false; + } + } +} diff --git a/Projectiles/Magic/AstralCrystal.cs b/Projectiles/Magic/AstralCrystal.cs index 296fb9b03d..188e0b38ce 100644 --- a/Projectiles/Magic/AstralCrystal.cs +++ b/Projectiles/Magic/AstralCrystal.cs @@ -30,6 +30,8 @@ namespace CalamityMod.Projectiles.Magic Projectile.extraUpdates = 2; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void OnKill(int timeLeft) diff --git a/Projectiles/Magic/AstralCrystalInvisibleExplosion.cs b/Projectiles/Magic/AstralCrystalInvisibleExplosion.cs index a958dd9dc9..3fbe159a25 100644 --- a/Projectiles/Magic/AstralCrystalInvisibleExplosion.cs +++ b/Projectiles/Magic/AstralCrystalInvisibleExplosion.cs @@ -17,6 +17,8 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Magic/AtlantisSpear.cs b/Projectiles/Magic/AtlantisSpear.cs index 09533fe2b7..6c8a87d6fe 100644 --- a/Projectiles/Magic/AtlantisSpear.cs +++ b/Projectiles/Magic/AtlantisSpear.cs @@ -12,10 +12,10 @@ namespace CalamityMod.Projectiles.Magic { public new string LocalizationCategory => "Projectiles.Magic"; public bool devourer = DownedBossSystem.downedDoG; - public static int TotalSegments = 16; - public float damageMultiplier = 1f; - public int time = 0; - public float fade = 1; + private static int TotalSegments = 16; + private float damageMultiplier = 1f; + private int time = 0; + private float fade = 1; public override void SetDefaults() { @@ -29,6 +29,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.extraUpdates = (Main.zenithWorld && devourer) ? 1 : 0; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = (Main.zenithWorld && devourer) ? 2 : 8; + Projectile.appliesImmunityTimeOnSingleHits = true; } public override void AI() diff --git a/Projectiles/Magic/BloodRay.cs b/Projectiles/Magic/BloodRay.cs index 04b524b607..76cc9a31f0 100644 --- a/Projectiles/Magic/BloodRay.cs +++ b/Projectiles/Magic/BloodRay.cs @@ -24,6 +24,8 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = 10; Projectile.extraUpdates = 100; Projectile.timeLeft = Lifetime; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Magic/DarkSparkPrism.cs b/Projectiles/Magic/DarkSparkPrism.cs index a512651328..bf2299ddcd 100644 --- a/Projectiles/Magic/DarkSparkPrism.cs +++ b/Projectiles/Magic/DarkSparkPrism.cs @@ -29,6 +29,8 @@ namespace CalamityMod.Projectiles.Magic Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; Projectile.ignoreWater = true; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void SendExtraAI(BinaryWriter writer) diff --git a/Projectiles/Magic/IceCluster.cs b/Projectiles/Magic/IceCluster.cs index 40d362af69..4ce8847842 100644 --- a/Projectiles/Magic/IceCluster.cs +++ b/Projectiles/Magic/IceCluster.cs @@ -26,6 +26,8 @@ namespace CalamityMod.Projectiles.Magic Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; Projectile.coldDamage = true; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Magic/IonBlast.cs b/Projectiles/Magic/IonBlast.cs index 972d4d5541..9155789df3 100644 --- a/Projectiles/Magic/IonBlast.cs +++ b/Projectiles/Magic/IonBlast.cs @@ -1,8 +1,13 @@ using System; -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using rail; using Terraria; using Terraria.Audio; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic @@ -10,81 +15,131 @@ namespace CalamityMod.Projectiles.Magic public class IonBlast : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Type] = 4; - ProjectileID.Sets.TrailingMode[Type] = 0; - } - + public ref float time => ref Projectile.ai[0]; + public bool chargeShot => Projectile.ai[2] == 5; + public bool onSpawn = true; public override void SetDefaults() { - Projectile.width = Projectile.height = 14; + Projectile.width = Projectile.height = 30; Projectile.friendly = true; - Projectile.alpha = 255; Projectile.penetrate = 1; - Projectile.extraUpdates = 2; + Projectile.extraUpdates = 7; Projectile.ignoreWater = false; - Projectile.timeLeft = 120; + Projectile.timeLeft = 280; Projectile.DamageType = DamageClass.Magic; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + Projectile.ArmorPenetration = 40; } public override void AI() { Projectile.rotation = Projectile.velocity.ToRotation(); - Projectile.velocity *= 1.015f; - if (Projectile.alpha > 0) + if (chargeShot) { - Projectile.alpha -= 3; - } - if (Projectile.alpha < 0) - { - Projectile.alpha = 0; - } - Lighting.AddLight((int)Projectile.Center.X / 16, (int)Projectile.Center.Y / 16, 1f, 0f, 0.2f); - float projTimer = 100f; - float timerIncr = 3f; - if (Projectile.ai[1] == 0f) - { - Projectile.localAI[0] += timerIncr; - if (Projectile.localAI[0] > projTimer) + if (onSpawn) { - Projectile.localAI[0] = projTimer; + Projectile.penetrate = -1; + Projectile.extraUpdates = 6; + Projectile.timeLeft = 190; + Projectile.tileCollide = false; + onSpawn = false; + } + Projectile.velocity *= 0.975f; + + if (Projectile.timeLeft > 45 && time > 3) + { + Particle trail = new SparkParticle(Projectile.Center, -Projectile.velocity * 0.01f, false, 15, 1f, Color.Crimson * 0.6f); + GeneralParticleHandler.SpawnParticle(trail); } } else { - Projectile.localAI[0] -= timerIncr; - if (Projectile.localAI[0] <= 0f) + if (Projectile.ai[1] != 0 && time > 18) + Projectile.velocity = Projectile.velocity.RotatedBy(0.003f * -Projectile.ai[1]); + + if (Projectile.velocity.Length() < 17) + Projectile.velocity *= 1.005f; + + Vector2 vel = -Projectile.velocity.SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(0.5f, 4.5f); + + if (time % 3 == 0) { - Projectile.Kill(); + Particle trail = new CustomSpark(Projectile.Center + Main.rand.NextVector2Circular(6, 6), vel, "CalamityMod/Particles/GlowSquareParticle", false, Main.rand.Next(7, 12), Main.rand.NextFloat(0.5f, 0.8f), Main.rand.NextBool() ? Color.Lerp(Color.Crimson, Color.White, 0.5f) : Color.Crimson, new Vector2(1f, 1f), extraRotation: MathHelper.PiOver4); + GeneralParticleHandler.SpawnParticle(trail); } } - } + Lighting.AddLight(Projectile.Center, Color.Crimson.ToVector3() * 0.5f); + time++; + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + float minMult = 0.2f; + int hitsToMinMult = 5; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + modifiers.SourceDamage *= damageMult; + } public override void OnKill(int timeLeft) { - Projectile.position = Projectile.Center; - Projectile.width = Projectile.height = 32; - Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); - Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2); - Projectile.maxPenetrate = -1; - Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.Damage(); - SoundEngine.PlaySound(SoundID.Item92, Projectile.Center); - int randDustAmt = Main.rand.Next(15, 30); - for (int i = 0; i < randDustAmt; i++) + if (!chargeShot) { - int reddish = Dust.NewDust(Projectile.Center - Projectile.velocity / 2f, 0, 0, DustID.Firework_Red, 0f, 0f, 100, default, 1f); - Main.dust[reddish].velocity *= 2f; - Main.dust[reddish].noGravity = true; + SoundEngine.PlaySound(SoundID.Item92 with { Volume = 0.4f }, Projectile.Center); + + Particle blastfx = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Crimson, "CalamityMod/Particles/BloomRingThinLarge", Vector2.One, 0, 0.02f, 0.053f, 17); + GeneralParticleHandler.SpawnParticle(blastfx); + Particle blastfx2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Lerp(Color.Crimson, Color.White, 0.5f), "CalamityMod/Particles/BloomRingThinLarge", Vector2.One, 0, 0.02f, 0.06f, 15); + GeneralParticleHandler.SpawnParticle(blastfx2); + + for (int i = 0; i < 15; i++) + { + Dust dust2 = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), Vector2.One.RotatedByRandom(Math.PI) * Main.rand.NextFloat(3, 7)); + dust2.scale = Main.rand.NextFloat(0.85f, 1f); + dust2.noGravity = true; + dust2.color = Main.rand.NextBool() ? Color.Lerp(Color.Crimson, Color.White, 0.5f) : Color.Crimson; + } + + // Create Blast + float blastSize = 60; + float minMultiplier = 0.25f; + int hitsToMinMult = 6; + Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.3f), 0, Projectile.owner, blastSize, minMultiplier, hitsToMinMult); + blast.timeLeft = 10; + blast.DamageType = DamageClass.Magic; + blast.ArmorPenetration = 25; } } - + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + Player Owner = Main.player[Projectile.owner]; + if (time <= 1) + { + float _ = float.NaN; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Owner.Center, Projectile.width, ref _); + } + else + return base.Colliding(projHitbox, targetHitbox); + } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); + Texture2D tex = TextureAssets.Projectile[Type].Value; + Texture2D tex2 = ModContent.Request("CalamityMod/Particles/GlowSpark").Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + float drawRotation = Projectile.rotation; + float timeleftFade = Utils.GetLerpValue(0, 60, Projectile.timeLeft, true); + if (chargeShot) + { + for (int i = 0; i < 5; i++) + { + float iMult = (1 - 0.1f * i); + Main.EntitySpriteDraw(tex2, drawPosition, null, Color.Lerp(Color.Crimson, Color.White, i * 0.1f) with { A = 0 } * iMult * timeleftFade, drawRotation, tex2.Size() * 0.5f, new Vector2(0.2f + 2 * iMult, (1.2f - 1f * iMult) * timeleftFade) * iMult * 0.03f, SpriteEffects.None); + } + } + else + { + for (int i = 0; i < 5; i++) + Main.EntitySpriteDraw(tex, drawPosition, null, Color.Lerp(Color.Crimson, Color.White, i * 0.1f) with { A = 0 } * (1 - 0.1f * i), drawRotation, tex.Size() * 0.5f, (1 - 0.1f * i), SpriteEffects.None); + } return false; } } diff --git a/Projectiles/Magic/IonBlasterHoldout.cs b/Projectiles/Magic/IonBlasterHoldout.cs new file mode 100644 index 0000000000..a49602f0fe --- /dev/null +++ b/Projectiles/Magic/IonBlasterHoldout.cs @@ -0,0 +1,309 @@ +using System; +using CalamityMod.Dusts; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class IonBlasterHoldout : BaseGunHoldoutProjectile + { + public override int AssociatedItemID => ModContent.ItemType(); + public override Vector2 GunTipPosition => base.GunTipPosition - Vector2.UnitY.RotatedBy(Projectile.rotation) * 1.5f * Projectile.spriteDirection; + public override float MaxOffsetLengthFromArm => 30f; + public override float OffsetXUpwards => -5f; + public override float BaseOffsetY => -9f; + public override float OffsetYDownwards => 5f; + public override float WeaponTurnSpeed => 0.35f; + public override float RecoilResolveSpeed => shootingTimer >= 0 ? 0.3f : 0.05f; + + public bool firing => Projectile.ai[2] == 0; + public ref float shootingTimer => ref Projectile.ai[0]; + public ref float manaPower => ref Projectile.ai[1]; + public Color effectsColor { get; set; } = Color.Crimson; + public int fireRate => Owner.HeldItem.useAnimation; + public bool fullyCharged = false; + public int time = 0; + public int shotNum = 0; + public SlotId ionHum { get; set; } + + public override void KillHoldoutLogic() + { + if (Owner.dead) + { + if (SoundEngine.TryGetActiveSound(ionHum, out var hum) && hum.IsPlaying) + { + hum?.Stop(); + } + Projectile.Kill(); + } + } + + public override void HoldoutAI() + { + bool isAtMaxMana = ((float)Owner.statMana / (float)Owner.statManaMax2) >= 1; + Projectile.timeLeft++; + + if (time == 0) + shootingTimer = fireRate; + + if (shootingTimer < 0) + { + OnCooldown(); + shootingTimer++; + if (shootingTimer == 0) + { + shootingTimer = fireRate; + if (SoundEngine.TryGetActiveSound(ionHum, out var hum) && hum.IsPlaying) + { + hum?.Stop(); + } + } + return; + } + + if (HeldItem.type != Owner.ActiveItem().type) + { + if (manaPower > 0) + shootingTimer = -75; + if (SoundEngine.TryGetActiveSound(ionHum, out var hum) && hum.IsPlaying) + { + hum?.Stop(); + } + Projectile.Kill(); + } + + if (shootingTimer == 0) + { + if (firing) + { + if (Owner.Calamity().mouseRight) + { + Projectile.ai[2] = 5; + return; + } + if (Owner.CheckMana(HeldItem, -1, true, false)) + { + Shoot(false); + shootingTimer = fireRate; + } + else + { + SoundEngine.PlaySound(SoundID.MaxMana with { Pitch = -0.5f }, Projectile.Center); + shootingTimer = -40; + } + } + else // Charging mode + { + if (SoundEngine.TryGetActiveSound(ionHum, out var hum) && hum.IsPlaying) + { + hum.Position = Projectile.Center; + hum.Pitch = MathHelper.Lerp(-0.5f, 0.1f, manaPower); + } + else + { + SoundStyle charge = new("CalamityMod/Sounds/Item/IonChargeLoop"); + ionHum = SoundEngine.PlaySound(charge with { Volume = 0.7f, IsLooped = true }, Projectile.Center); + } + + if (Owner.Calamity().mouseRight) + { + if (!isAtMaxMana) + { + // This gives mana recharge a consistent rate rather than being variable by a frame + // Without it the mana recharge rate would change if you started charging on an even value rather than an odd one + if (manaPower == 0) + time = 100; + + if (time % 2 == 0) + { + Owner.statMana += (int)(Owner.statManaMax2 * 0.025f); // 80 frames to reach max mana + manaPower += 0.0275f; // 72 frames to reach max power + // Mana power reaches max at 90% mana regained + + if (Owner.statMana > Owner.statManaMax2) + Owner.statMana = Owner.statManaMax2; + } + if (manaPower > 1) + manaPower = 1; + + Vector2 vel = Projectile.velocity.RotateRandom(0.7f) * Main.rand.NextFloat(7, 14); + Dust dust2 = Dust.NewDustPerfect(GunTipPosition + vel * 10, ModContent.DustType(), -vel); + dust2.scale = Main.rand.NextFloat(0.35f, 0.55f); + dust2.noGravity = true; + dust2.color = Main.rand.NextBool() ? Color.Lerp(effectsColor, Color.White, 0.5f) : effectsColor; + } + + if (isAtMaxMana && !fullyCharged && manaPower >= 0.25f) + { + SoundStyle fullCharge = new("CalamityMod/Sounds/Item/DudFire"); + for (int i = 0; i < 2; i++) + SoundEngine.PlaySound(fullCharge with { Volume = .6f, Pitch = -0.7f + i * 1.5f, MaxInstances = 2 }, Projectile.Center); + fullyCharged = true; + OffsetLengthFromArm -= 7f * manaPower; + } + + OffsetLengthFromArm += 1.3f * manaPower; + } + else + { + if (fullyCharged) + { + Shoot(true); + fullyCharged = false; + } + else // Failure to full charge + { + SoundEngine.PlaySound(SoundID.Item109 with { Volume = 0.7f, Pitch = 1f }, Projectile.Center); + for (int i = 0; i < 10; i++) + { + Vector2 vel = Projectile.velocity.RotateRandom(Math.PI); + Dust dust2 = Dust.NewDustPerfect(GunTipPosition, ModContent.DustType(), -vel); + dust2.scale = Main.rand.NextFloat(0.95f, 1.35f) * (manaPower + 0.3f); + dust2.noGravity = false; + dust2.color = Main.rand.NextBool() ? Color.Lerp(effectsColor, Color.White, 0.5f) : effectsColor; + } + } + manaPower = 0; + shootingTimer = -75; + Projectile.ai[2] = 0; // Return to regular firing mode + } + } + } + else + { + if (!Owner.Calamity().mouseRight && !Main.mouseLeft) + { + if (SoundEngine.TryGetActiveSound(ionHum, out var hum) && hum.IsPlaying) + { + hum?.Stop(); + } + Projectile.Kill(); + } + } + + if (shootingTimer > 0) + shootingTimer--; + + time++; + } + public void OnCooldown() + { + Projectile.timeLeft++; + + if (SoundEngine.TryGetActiveSound(ionHum, out var hum) && hum.IsPlaying) + { + float lerp = Utils.GetLerpValue(-60, 0, shootingTimer, true); + hum.Position = Projectile.Center; + hum.Pitch = MathHelper.Lerp(0f, -0.6f, lerp); + hum.Volume = 1 - lerp; + } + + Vector2 smokeVel = new Vector2(0, -6) * Main.rand.NextFloat(0.1f, 1.1f); + Particle smoke = new HeavySmokeParticle(GunTipPosition, smokeVel, Color.SlateGray, Main.rand.Next(40, 60 + 1), Main.rand.NextFloat(0.3f, 0.6f), 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool()); + GeneralParticleHandler.SpawnParticle(smoke); + } + public void Shoot(bool big) + { + float manaPercent = ((float)Owner.statMana / (float)Owner.statManaMax2); + Vector2 shootDirection = Projectile.velocity.SafeNormalize(Vector2.Zero); + Vector2 firingVelocity = (shootDirection * 4); + float damageBoost = (manaPower >= 1 ? 1.7f : 1.5f); + + if (big) + { + if (SoundEngine.TryGetActiveSound(ionHum, out var hum) && hum.IsPlaying) + { + hum?.Stop(); + } + if (manaPower >= 1) + { + SoundStyle fire = new("CalamityMod/Sounds/Item/ImpalerLaunch"); + SoundEngine.PlaySound(fire with { Volume = 0.8f, Pitch = -0.6f }, Projectile.Center); + } + SoundStyle fire2 = new("CalamityMod/Sounds/Item/LanceofDestinyStrong"); + SoundEngine.PlaySound(fire2 with { Volume = 0.4f, Pitch = (manaPower >= 1 ? 0.8f : 0.6f) }, Projectile.Center); + + Owner.Calamity().GeneralScreenShakePower = 6f * manaPower; + int maxProj = (int)(manaPower * 24 * (manaPower >= 1 ? 1 : 0.5f)); + for (int i = 0; i < maxProj; i++) + { + float variance = Main.rand.NextFloat(-0.5f, 0.5f); + Vector2 vel = firingVelocity.RotatedBy(variance * 0.3f) * (1 - Math.Abs(variance)) * (i % 2 == 0 ? 0.7f : 1) * Main.rand.NextFloat(5f, 5.5f); + if (Main.myPlayer == Projectile.owner) + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, vel, ModContent.ProjectileType(), (int)(Projectile.damage * damageBoost), Projectile.knockBack * 2, Projectile.owner, 0, 0, 5); + } + OffsetLengthFromArm -= 24f * manaPower; + Owner.velocity -= Projectile.velocity * 12f * manaPower; + + for (int i = 0; i < Math.Max(3, 30 * manaPower); i++) + { + Particle sparks = new SparkParticle(GunTipPosition, Projectile.velocity.RotatedByRandom(0.7f) * Main.rand.NextFloat(7, 25), false, 35, Main.rand.NextFloat(0.5f, 0.9f), Main.rand.NextBool() ? Color.Lerp(effectsColor, Color.White, 0.5f) : effectsColor); + GeneralParticleHandler.SpawnParticle(sparks); + } + Particle pulse3 = new CustomSpark(GunTipPosition, shootDirection * 9, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false, 17, 0.06f, effectsColor, new Vector2(2f, 0.7f), shrinkSpeed: 0.1f); + GeneralParticleHandler.SpawnParticle(pulse3); + } + else + { + SoundEngine.PlaySound(SoundID.Item91 with { Volume = 0.5f, Pitch = 0.8f - 1.3f * manaPercent }, Projectile.Center); + + if (Main.myPlayer == Projectile.owner) + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + OffsetLengthFromArm -= 5f; + + for (int k = 1; k <= 10; k++) + { + Color useColor = Main.rand.NextBool() ? Color.Lerp(effectsColor, Color.White, 0.3f) : effectsColor; + Vector2 shootVel = (shootDirection * 15).RotatedByRandom(0.5f) * Main.rand.NextFloat(0.1f, 1.8f); + + Dust dust2 = Dust.NewDustPerfect(GunTipPosition, ModContent.DustType(), shootVel); + dust2.scale = Main.rand.NextFloat(0.85f, 1f); + dust2.noGravity = true; + dust2.color = useColor; + + if (k % 2 == 0) + { + Particle blast = new CustomSpark(GunTipPosition, Projectile.velocity * 3 * k, "CalamityMod/Particles/BloomLineSoftEdge", false, 11, 0.04f, useColor, new Vector2(1f, 0.8f), shrinkSpeed: 0.8f); + GeneralParticleHandler.SpawnParticle(blast); + } + } + shotNum++; + } + } + public override bool PreDraw(ref Color lightColor) + { + if (time < 2) + return false; + Texture2D tex = TextureAssets.Projectile[Type].Value; + Texture2D texGlow = ModContent.Request("CalamityMod/Items/Weapons/Magic/IonBlasterGlow").Value; + Texture2D tex2 = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Vector2 shake = Main.rand.NextVector2Circular(2, 2) * manaPower; + + Main.EntitySpriteDraw(tex, drawPosition + shake, null, Projectile.GetAlpha(lightColor), drawRotation, tex.Size() * 0.5f, Projectile.scale, flipSprite); + + Main.EntitySpriteDraw(texGlow, drawPosition + shake, null, Color.White, drawRotation, texGlow.Size() * 0.5f, Projectile.scale, flipSprite); + + if (manaPower > 0 && shootingTimer >= 0) + { + for (int i = 0; i < 4; i++) + { + float iMult = (1 - 0.1f * i); + Main.EntitySpriteDraw(tex2, GunTipPosition - Main.screenPosition + shake, null, Color.Lerp(effectsColor, Color.White, i * 0.1f) with { A = 0 }, Main.rand.NextFloat(-5f, 5f), tex2.Size() * 0.5f, new Vector2(1f, 0.55f) * 0.5f * manaPower * Main.rand.NextFloat(0.7f, 1.3f) * iMult, flipSprite); + } + } + return false; + } + } +} diff --git a/Projectiles/Magic/LazharSolarBeam.cs b/Projectiles/Magic/LazharSolarBeam.cs deleted file mode 100644 index 41cd01de7b..0000000000 --- a/Projectiles/Magic/LazharSolarBeam.cs +++ /dev/null @@ -1,55 +0,0 @@ -using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Magic -{ - public class LazharSolarBeam : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Magic"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 4; - Projectile.height = 4; - Projectile.friendly = true; - Projectile.DamageType = DamageClass.Magic; - Projectile.penetrate = 1; - Projectile.extraUpdates = 100; - Projectile.timeLeft = 300; - } - - public override void AI() - { - Projectile.localAI[0] += 1f; - if (Projectile.localAI[0] > 4f) - { - for (int i = 0; i < 4; i++) - { - Vector2 projPos = Projectile.position; - projPos -= Projectile.velocity * ((float)i * 0.25f); - Projectile.alpha = 255; - int heatGold = Dust.NewDust(projPos, 1, 1, DustID.GoldCoin, 0f, 0f, 0, default, 1f); - Main.dust[heatGold].position = projPos; - Main.dust[heatGold].scale = (float)Main.rand.Next(70, 110) * 0.013f; - Main.dust[heatGold].velocity *= 0.2f; - } - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(BuffID.Daybreak, 180); - if (Projectile.owner == Main.myPlayer) - { - int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), Projectile.knockBack, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].DamageType = DamageClass.Magic; - } - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Daybreak, 180); - } -} diff --git a/Projectiles/Magic/LightningArc.cs b/Projectiles/Magic/LightningArc.cs index 441739fc9c..8f43f46666 100644 --- a/Projectiles/Magic/LightningArc.cs +++ b/Projectiles/Magic/LightningArc.cs @@ -26,6 +26,8 @@ namespace CalamityMod.Projectiles.Magic Projectile.timeLeft = 20; Projectile.penetrate = 5; Projectile.tileCollide = true; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } diff --git a/Projectiles/Magic/NightOrb.cs b/Projectiles/Magic/NightOrb.cs index c5373229e3..0bfd8ae7cc 100644 --- a/Projectiles/Magic/NightOrb.cs +++ b/Projectiles/Magic/NightOrb.cs @@ -16,6 +16,8 @@ namespace CalamityMod.Projectiles.Magic Projectile.timeLeft = 30; Projectile.DamageType = DamageClass.Magic; Projectile.ignoreWater = true; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Magic/NightsRayBeam.cs b/Projectiles/Magic/NightsRayBeam.cs index 0e38e73656..f004db67aa 100644 --- a/Projectiles/Magic/NightsRayBeam.cs +++ b/Projectiles/Magic/NightsRayBeam.cs @@ -23,6 +23,8 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = 10; Projectile.extraUpdates = 100; Projectile.timeLeft = 150; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Magic/RancorLargeCinder.cs b/Projectiles/Magic/RancorLargeCinder.cs index a27ef75db1..ac874b32c1 100644 --- a/Projectiles/Magic/RancorLargeCinder.cs +++ b/Projectiles/Magic/RancorLargeCinder.cs @@ -21,6 +21,8 @@ namespace CalamityMod.Projectiles.Magic Projectile.friendly = true; Projectile.timeLeft = 300; Projectile.ignoreWater = true; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Magic/StickyFeather.cs b/Projectiles/Magic/StickyFeather.cs index 96822f36ce..d33a69bb29 100644 --- a/Projectiles/Magic/StickyFeather.cs +++ b/Projectiles/Magic/StickyFeather.cs @@ -25,6 +25,8 @@ namespace CalamityMod.Projectiles.Magic Projectile.DamageType = DamageClass.Magic; Projectile.aiStyle = ProjAIStyleID.Nail; AIType = ProjectileID.NailFriendly; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 1; } public override void AI() @@ -35,10 +37,6 @@ namespace CalamityMod.Projectiles.Magic } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.immune[Projectile.owner] = 1; - } public override void OnKill(int timeLeft) { diff --git a/Projectiles/Magic/UberBubble.cs b/Projectiles/Magic/UberBubble.cs index 3bd8f7fb9c..36f9ad6e48 100644 --- a/Projectiles/Magic/UberBubble.cs +++ b/Projectiles/Magic/UberBubble.cs @@ -22,6 +22,8 @@ namespace CalamityMod.Projectiles.Magic Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.Magic; Projectile.timeLeft = 30; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Magic/WaterLeechProj.cs b/Projectiles/Magic/WaterLeechProj.cs index cc1d8ddeb6..a07c9598a1 100644 --- a/Projectiles/Magic/WaterLeechProj.cs +++ b/Projectiles/Magic/WaterLeechProj.cs @@ -25,6 +25,8 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.timeLeft = 540; Projectile.DamageType = DamageClass.Magic; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Magic/WyvernFeatherGreen.cs b/Projectiles/Magic/WyvernFeatherGreen.cs index 74c6d6ee5f..809db702cf 100644 --- a/Projectiles/Magic/WyvernFeatherGreen.cs +++ b/Projectiles/Magic/WyvernFeatherGreen.cs @@ -25,6 +25,8 @@ namespace CalamityMod.Projectiles.Magic Projectile.DamageType = DamageClass.Magic; Projectile.aiStyle = ProjAIStyleID.Nail; AIType = ProjectileID.NailFriendly; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Magic/WyvernFeatherPink.cs b/Projectiles/Magic/WyvernFeatherPink.cs index c336051740..c4ae4715b3 100644 --- a/Projectiles/Magic/WyvernFeatherPink.cs +++ b/Projectiles/Magic/WyvernFeatherPink.cs @@ -25,6 +25,8 @@ namespace CalamityMod.Projectiles.Magic Projectile.DamageType = DamageClass.Magic; Projectile.aiStyle = ProjAIStyleID.Nail; AIType = ProjectileID.NailFriendly; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Magic/WyvernFeatherPurple.cs b/Projectiles/Magic/WyvernFeatherPurple.cs index fbc4db8a6d..c80d9b0306 100644 --- a/Projectiles/Magic/WyvernFeatherPurple.cs +++ b/Projectiles/Magic/WyvernFeatherPurple.cs @@ -25,6 +25,8 @@ namespace CalamityMod.Projectiles.Magic Projectile.DamageType = DamageClass.Magic; Projectile.aiStyle = ProjAIStyleID.Nail; AIType = ProjectileID.NailFriendly; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Melee/ArkOfTheAncients_ParryHoldout.cs b/Projectiles/Melee/ArkOfTheAncients_ParryHoldout.cs index cb5eb85d89..7f071091f0 100644 --- a/Projectiles/Melee/ArkOfTheAncients_ParryHoldout.cs +++ b/Projectiles/Melee/ArkOfTheAncients_ParryHoldout.cs @@ -35,6 +35,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.friendly = true; Projectile.penetrate = -1; Projectile.noEnchantmentVisuals = true; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override bool? CanDamage() => Timer <= ParryTime && AlreadyParried == 0f; diff --git a/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs b/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs index c9e6cc4e7a..cf2aace6b5 100644 --- a/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs +++ b/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs @@ -39,6 +39,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.friendly = true; Projectile.penetrate = -1; Projectile.noEnchantmentVisuals = true; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override bool? CanDamage() => Timer <= ParryTime && AlreadyParried == 0f; diff --git a/Projectiles/Melee/ArkOfTheElements_ParryHoldout.cs b/Projectiles/Melee/ArkOfTheElements_ParryHoldout.cs index 6c3de2de20..65c40923ae 100644 --- a/Projectiles/Melee/ArkOfTheElements_ParryHoldout.cs +++ b/Projectiles/Melee/ArkOfTheElements_ParryHoldout.cs @@ -39,6 +39,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.friendly = true; Projectile.penetrate = -1; Projectile.noEnchantmentVisuals = true; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override bool? CanDamage() => Timer <= ParryTime && AlreadyParried == 0f; diff --git a/Projectiles/Melee/BloodBall.cs b/Projectiles/Melee/BloodBall.cs index f9ad15cf39..6cce44387c 100644 --- a/Projectiles/Melee/BloodBall.cs +++ b/Projectiles/Melee/BloodBall.cs @@ -19,6 +19,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.timeLeft = 200; Projectile.DamageType = DamageClass.Melee; Projectile.tileCollide = false; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Melee/BrinyTyphoonBubble.cs b/Projectiles/Melee/BrinyTyphoonBubble.cs index 3fbd52fcf1..0957b0a141 100644 --- a/Projectiles/Melee/BrinyTyphoonBubble.cs +++ b/Projectiles/Melee/BrinyTyphoonBubble.cs @@ -26,6 +26,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.alpha = 255; Projectile.penetrate = -1; Projectile.timeLeft = 5; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs b/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs index e36d1e29dd..f8d4d6935c 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs @@ -70,6 +70,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.friendly = true; Projectile.penetrate = -1; Projectile.extraUpdates = 1; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs b/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs index 0022918305..8c7e3ac1c3 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs @@ -37,6 +37,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.friendly = true; Projectile.penetrate = -1; Projectile.extraUpdates = 1; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Melee/ClamCrusherFlail.cs b/Projectiles/Melee/ClamCrusherFlail.cs index 3ce47bbf54..6d1015e6c7 100644 --- a/Projectiles/Melee/ClamCrusherFlail.cs +++ b/Projectiles/Melee/ClamCrusherFlail.cs @@ -25,6 +25,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.DamageType = DamageClass.MeleeNoSpeed; Projectile.alpha = 255; Projectile.tileCollide = false; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Melee/DarkBall.cs b/Projectiles/Melee/DarkBall.cs index 93c4930826..e0c9b5272e 100644 --- a/Projectiles/Melee/DarkBall.cs +++ b/Projectiles/Melee/DarkBall.cs @@ -20,6 +20,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.timeLeft = 200; Projectile.DamageType = DamageClass.Melee; Projectile.tileCollide = false; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Melee/EntropicFlechette.cs b/Projectiles/Melee/EntropicFlechette.cs index 11d5b2620c..e0151b3c6e 100644 --- a/Projectiles/Melee/EntropicFlechette.cs +++ b/Projectiles/Melee/EntropicFlechette.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Melee if (time > 65) { - if (!Main.dedServ) + if (Main.myPlayer == Projectile.owner) { Particle spark2 = new CustomSpark(Projectile.Center, -Projectile.velocity * 0.4f, "CalamityMod/Particles/GlowSpark2", false, (int)MathHelper.Clamp(9 * sizeVariance, 3, 9), MathHelper.Clamp(0.03f * sizeVariance, 0.01f, 0.03f), Color.Black * 0.6f, new Vector2(1.2f, 0.5f), false, shrinkSpeed: 1.1f); GeneralParticleHandler.SpawnParticle(spark2); diff --git a/Projectiles/Melee/HellkiteHoldout.cs b/Projectiles/Melee/HellkiteHoldout.cs index a268bfaeb9..f9fc98014c 100644 --- a/Projectiles/Melee/HellkiteHoldout.cs +++ b/Projectiles/Melee/HellkiteHoldout.cs @@ -415,10 +415,13 @@ namespace CalamityMod.Projectiles.Melee } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + if (chargedSwing) + modifiers.SetCrit(); + float minMult = 0.25f; int hitsToMinMult = 10; float damageMult = Utils.Remap(pierceReduction, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= (chargedSwing ? 4.5f * (GFBMulti) : 1) * damageMult; + modifiers.SourceDamage *= (chargedSwing ? 3f * (GFBMulti) : 1) * damageMult; } public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Melee/LaserFountain.cs b/Projectiles/Melee/LaserFountain.cs index 2bcf99ec00..1df4e4245f 100644 --- a/Projectiles/Melee/LaserFountain.cs +++ b/Projectiles/Melee/LaserFountain.cs @@ -18,6 +18,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.tileCollide = false; Projectile.timeLeft = 60; Projectile.DamageType = DamageClass.Melee; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Melee/MarniteDeconstructorProj.cs b/Projectiles/Melee/MarniteDeconstructorProj.cs index 1d006e1ea9..86d7dff494 100644 --- a/Projectiles/Melee/MarniteDeconstructorProj.cs +++ b/Projectiles/Melee/MarniteDeconstructorProj.cs @@ -34,6 +34,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.hide = true; Projectile.ownerHitCheck = true; Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override bool ShouldUpdatePosition() => false; diff --git a/Projectiles/Melee/MarniteObliteratorProj.cs b/Projectiles/Melee/MarniteObliteratorProj.cs index d110a46fa3..f79b3244d9 100644 --- a/Projectiles/Melee/MarniteObliteratorProj.cs +++ b/Projectiles/Melee/MarniteObliteratorProj.cs @@ -36,6 +36,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.hide = true; Projectile.ownerHitCheck = true; Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override bool ShouldUpdatePosition() => false; diff --git a/Projectiles/Melee/MendedBiomeBlade_DecaysRetortDash.cs b/Projectiles/Melee/MendedBiomeBlade_DecaysRetortDash.cs index 56c512c9e4..fb19dc0660 100644 --- a/Projectiles/Melee/MendedBiomeBlade_DecaysRetortDash.cs +++ b/Projectiles/Melee/MendedBiomeBlade_DecaysRetortDash.cs @@ -31,6 +31,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 60; Projectile.timeLeft = 20; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Melee/MendedBiomeBlade_TrueBitingEmbrace.cs b/Projectiles/Melee/MendedBiomeBlade_TrueBitingEmbrace.cs index 5b12d990e1..b05763bebb 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TrueBitingEmbrace.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TrueBitingEmbrace.cs @@ -70,6 +70,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.friendly = true; Projectile.penetrate = -1; Projectile.extraUpdates = 1; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs b/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs index 1ae29e68d9..56033def56 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs @@ -42,6 +42,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.friendly = true; Projectile.penetrate = -1; Projectile.extraUpdates = 1; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Melee/RendingNeedle.cs b/Projectiles/Melee/RendingNeedle.cs index 6c4ad50df0..89d7090ef5 100644 --- a/Projectiles/Melee/RendingNeedle.cs +++ b/Projectiles/Melee/RendingNeedle.cs @@ -34,6 +34,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.timeLeft = (int)MaxTime; Projectile.DamageType = DamageClass.Melee; Projectile.tileCollide = false; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Melee/Spears/AmidiasTridentProj.cs b/Projectiles/Melee/Spears/AmidiasTridentProj.cs index 1581375c55..de63e02e4b 100644 --- a/Projectiles/Melee/Spears/AmidiasTridentProj.cs +++ b/Projectiles/Melee/Spears/AmidiasTridentProj.cs @@ -23,6 +23,8 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.penetrate = -1; Projectile.ownerHitCheck = true; Projectile.hide = true; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/SausageMakerSpear.cs b/Projectiles/Melee/Spears/SausageMakerSpear.cs index c46d1c22cd..0bb3d152c0 100644 --- a/Projectiles/Melee/Spears/SausageMakerSpear.cs +++ b/Projectiles/Melee/Spears/SausageMakerSpear.cs @@ -22,6 +22,8 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.ignoreWater = true; Projectile.penetrate = -1; Projectile.ownerHitCheck = true; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/YateveoBloomSpear.cs b/Projectiles/Melee/Spears/YateveoBloomSpear.cs index 5acc6d3ecc..3fcda3e30c 100644 --- a/Projectiles/Melee/Spears/YateveoBloomSpear.cs +++ b/Projectiles/Melee/Spears/YateveoBloomSpear.cs @@ -22,6 +22,8 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.ignoreWater = true; Projectile.penetrate = -1; Projectile.ownerHitCheck = true; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/TrueArkOfTheAncients_ParryHoldout.cs b/Projectiles/Melee/TrueArkOfTheAncients_ParryHoldout.cs index 172fff2d28..0f208bdc5b 100644 --- a/Projectiles/Melee/TrueArkOfTheAncients_ParryHoldout.cs +++ b/Projectiles/Melee/TrueArkOfTheAncients_ParryHoldout.cs @@ -35,6 +35,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.friendly = true; Projectile.penetrate = -1; Projectile.noEnchantmentVisuals = true; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override bool? CanDamage() => Timer <= ParryTime && AlreadyParried == 0f; diff --git a/Projectiles/Ranged/AstralSandgun.cs b/Projectiles/Ranged/AstralSandgun.cs index dd09fb1abf..fca008bd42 100644 --- a/Projectiles/Ranged/AstralSandgun.cs +++ b/Projectiles/Ranged/AstralSandgun.cs @@ -18,6 +18,8 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = -1; Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void OnKill(int timeLeft) diff --git a/Projectiles/Ranged/DrataliornusExoArrow.cs b/Projectiles/Ranged/DrataliornusExoArrow.cs index 97ec9ede47..26f7ad0d44 100644 --- a/Projectiles/Ranged/DrataliornusExoArrow.cs +++ b/Projectiles/Ranged/DrataliornusExoArrow.cs @@ -23,6 +23,8 @@ namespace CalamityMod.Projectiles.Ranged Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.Ranged; Projectile.arrow = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 0; } public override void AI() @@ -62,8 +64,6 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.immune[Projectile.owner] = 0; - target.AddBuff(ModContent.BuffType(), 180); } diff --git a/Projectiles/Ranged/FetidEmesisHoldout.cs b/Projectiles/Ranged/FetidEmesisHoldout.cs index 36081c683c..6a4d3e1a42 100644 --- a/Projectiles/Ranged/FetidEmesisHoldout.cs +++ b/Projectiles/Ranged/FetidEmesisHoldout.cs @@ -1,17 +1,13 @@ -using CalamityMod.Buffs.DamageOverTime; +using System; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Utilities; using Terraria; using Terraria.Audio; using Terraria.GameContent; using Terraria.ModLoader; -using Terraria.ID; -using System; -using CalamityMod.Dusts; namespace CalamityMod.Projectiles.Ranged { @@ -28,8 +24,6 @@ namespace CalamityMod.Projectiles.Ranged public ref float shootingTimer => ref Projectile.ai[2]; // Dual functions for rapid fire shooting cooldown and recoil public bool isTired => cooldownTimer > 0; public float revSpeed = 1; - public bool isHoldingIn = false; - public bool holdingInBonus = false; public bool secondShot = true; public int maxFrames = 420; public int initialFireTime = 45; @@ -37,14 +31,12 @@ namespace CalamityMod.Projectiles.Ranged public override void KillHoldoutLogic() { - if ( !isTired && (Owner.CantUseHoldout(false) || HeldItem.type != Owner.ActiveItem().type)) + if (!isTired && (Owner.CantUseHoldout(false) || HeldItem.type != Owner.ActiveItem().type)) Projectile.Kill(); } public override void HoldoutAI() { - isHoldingIn = Owner.Calamity().mouseRight; - if (!isTired && (Owner.CantUseHoldout() || HeldItem.type != Owner.ActiveItem().type)) cooldownTimer = (int)(Utils.Remap(revFrames, 0, 350, 40, 180, true)); if (isTired) @@ -92,81 +84,43 @@ namespace CalamityMod.Projectiles.Ranged revFrames++; shineScale *= 0.77f; - if (revFrames >= maxFrames && !isTired) + if (revFrames >= maxFrames && !isTired || (Owner.Calamity().mouseRight && revFrames > 2 )) { - if (isHoldingIn) - { - if (revFrames == maxFrames + 120) - { - holdingInBonus = true; - SoundEngine.PlaySound(SoundID.NPCHit14 with { Volume = 1f, Pitch = 0.3f }, Projectile.Center); - for (int i = 0; i < 25; i++) - { - Vector2 dustVel = Vector2.One.RotatedByRandom(100) * Main.rand.NextFloat(4, 8); - Dust dust2 = Dust.NewDustPerfect(GunTipPosition + dustVel, 278, dustVel * 0.7f); - dust2.scale = Main.rand.NextFloat(0.45f, 0.9f); - dust2.noGravity = true; - dust2.color = Color.Lerp(Color.White, Main.rand.NextBool(4) ? Color.Chartreuse : Color.Green, 0.7f); - } - Particle pulse = new CustomPulse(GunTipPosition, Vector2.Zero, Color.Chartreuse, "CalamityMod/Particles/HighResFoggyCircleHardEdge", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.05f, 14); - GeneralParticleHandler.SpawnParticle(pulse); - } + Owner.Calamity().GeneralScreenShakePower = 6.5f; + OffsetLengthFromArm -= 35f; + cooldownTimer = (int)MathHelper.Lerp((int)(Utils.Remap(revFrames, 0, 350, 40, 180, true)), 180, 0.7f); + SoundStyle bigShot = new("CalamityMod/Sounds/Custom/Perforator/PerfHiveIchorShoot"); + SoundStyle bigShotGun = new("CalamityMod/Sounds/Item/FlakKrakenShoot"); + SoundEngine.PlaySound(bigShot with { Pitch = -0.2f, Volume = 0.6f }, Projectile.Center); + SoundEngine.PlaySound(bigShotGun with { Volume = 0.6f }, Projectile.Center); - Dust dust = Dust.NewDustPerfect(GunTipPosition, Main.rand.NextBool(5) ? 28 : 215, (Projectile.velocity * 2).RotatedByRandom(0.3f) * Main.rand.NextFloat(0.1f, 1.5f), 0, default, Main.rand.NextFloat(0.6f, 1.4f)); - dust.noGravity = true; - if (revFrames % 20 == 0) - { - SoundStyle tired = new("CalamityMod/Sounds/Custom/OldDukeHuff"); - SoundEngine.PlaySound(tired with { Volume = 0.3f, Pitch = 0.3f }, Projectile.Center); - for (int i = 0; i <= 3; i++) - { - Dust dust5 = Dust.NewDustPerfect(GunTipPosition, 267, (Projectile.velocity * 5f).RotatedByRandom(0.4f) * Main.rand.NextFloat(0.1f, 1.5f), 0, default, Main.rand.NextFloat(0.9f, 1.2f)); - dust5.noGravity = true; - dust5.color = Color.Chartreuse; - } - } + int chunkDamage = (int)(Projectile.damage * 2.5f); + Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 13; + + Particle pulse3 = new GlowSparkParticle(GunTipPosition - shootVelocity, shootVelocity, false, 12, 0.035f, Color.Chartreuse, new Vector2(2.5f, 0.9f), true); + GeneralParticleHandler.SpawnParticle(pulse3); + + Particle pulse2 = new CustomPulse(GunTipPosition, Projectile.velocity * 14.5f, Color.Chartreuse * 0.7f, "CalamityMod/Particles/DustyCircleHardEdge", new Vector2(0.4f, 1f), Projectile.velocity.ToRotation(), 0.13f, 0, 34); + GeneralParticleHandler.SpawnParticle(pulse2); + Particle pulse = new CustomPulse(GunTipPosition, Projectile.velocity * 9f, Color.Chartreuse * 0.7f, "CalamityMod/Particles/FlameExplosion", new Vector2(0.4f, 1f), Projectile.velocity.ToRotation(), 0.25f, 0, 34); + GeneralParticleHandler.SpawnParticle(pulse); + + float velBonus = 1.1f; + for (int i = 0; i <= 5; i++) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedBy(-0.03f * i * velBonus) * (1 - i * 0.08f) * velBonus, ModContent.ProjectileType(), chunkDamage, Projectile.knockBack * 3, Projectile.owner, -i, 0, velBonus); } - else + for (int j = 0; j <= 5; j++) { - Owner.Calamity().GeneralScreenShakePower = 6.5f; - OffsetLengthFromArm -= 35f; - cooldownTimer = holdingInBonus ? 230 : 180; - SoundStyle bigShot = new("CalamityMod/Sounds/Custom/Perforator/PerfHiveIchorShoot"); - SoundStyle bigShotGun = new("CalamityMod/Sounds/Item/FlakKrakenShoot"); - SoundEngine.PlaySound(bigShot with { Pitch = -0.2f, Volume = 0.6f }, Projectile.Center); - SoundEngine.PlaySound(bigShotGun with { Volume = 0.6f }, Projectile.Center); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedBy(0.03f * j * velBonus) * (1 - j * 0.08f) * velBonus, ModContent.ProjectileType(), chunkDamage, Projectile.knockBack * 3, Projectile.owner, j, 0, velBonus); + } + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity * velBonus, ModContent.ProjectileType(), chunkDamage, Projectile.knockBack * 3, Projectile.owner, 20, 0, velBonus); - int chunkDamage = (int)(Projectile.damage * (2f + (holdingInBonus ? 1 : 0))); - Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 13; - if (holdingInBonus) - { - Particle pulse2 = new CustomPulse(GunTipPosition, Projectile.velocity * 14.5f, Color.Chartreuse * 0.7f, "CalamityMod/Particles/DustyCircleHardEdge", new Vector2(0.4f, 1f), Projectile.velocity.ToRotation(), 0.13f, 0, 34); - GeneralParticleHandler.SpawnParticle(pulse2); - Particle pulse = new CustomPulse(GunTipPosition, Projectile.velocity * 9f, Color.Chartreuse * 0.7f, "CalamityMod/Particles/FlameExplosion", new Vector2(0.4f, 1f), Projectile.velocity.ToRotation(), 0.25f, 0, 34); - GeneralParticleHandler.SpawnParticle(pulse); - } - for (int y = 0; y < (holdingInBonus ? 3 : 1); y++) - { - float velBonus = 1 - y * 0.2f; - for (int i = 0; i <= 5; i++) - { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedBy(-0.03f * i * velBonus) * (1 - i * 0.08f) * velBonus, ModContent.ProjectileType(), chunkDamage, Projectile.knockBack * 3, Projectile.owner, -i, 0, velBonus); - } - for (int j = 0; j <= 5; j++) - { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedBy(0.03f * j * velBonus) * (1 - j * 0.08f) * velBonus, ModContent.ProjectileType(), chunkDamage, Projectile.knockBack * 3, Projectile.owner, j, 0, velBonus); - } - Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity * velBonus, ModContent.ProjectileType(), chunkDamage, Projectile.knockBack * 3, Projectile.owner, 20, 0, velBonus); - - for (int i = 0; i <= 18; i++) - { - Dust dust = Dust.NewDustPerfect(GunTipPosition, 66, shootVelocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.1f, 1.5f), 0, default, Main.rand.NextFloat(0.6f, 1.4f)); - dust.noGravity = true; - dust.color = Color.Chartreuse; - } - Particle pulse = new GlowSparkParticle(GunTipPosition - shootVelocity, shootVelocity * velBonus, false, 12, 0.035f, Color.Chartreuse, new Vector2(2.5f, 0.9f), true); - GeneralParticleHandler.SpawnParticle(pulse); - } + for (int i = 0; i <= 18; i++) + { + Dust dust = Dust.NewDustPerfect(GunTipPosition, 66, shootVelocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.1f, 1.5f), 0, default, Main.rand.NextFloat(0.6f, 1.4f)); + dust.noGravity = true; + dust.color = Color.Chartreuse; } } } diff --git a/Projectiles/Ranged/Flash.cs b/Projectiles/Ranged/Flash.cs index 1c2fca754b..a5eb54f88e 100644 --- a/Projectiles/Ranged/Flash.cs +++ b/Projectiles/Ranged/Flash.cs @@ -22,6 +22,8 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = -1; Projectile.timeLeft = 5; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Ranged/HailstormBulletProj.cs b/Projectiles/Ranged/HailstormBulletProj.cs index 3ab6b52907..17620c79fa 100644 --- a/Projectiles/Ranged/HailstormBulletProj.cs +++ b/Projectiles/Ranged/HailstormBulletProj.cs @@ -44,6 +44,7 @@ namespace CalamityMod.Projectiles.Ranged { if (Projectile.localAI[0] == 0f) { + Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * 10.5f; startVelocity = Projectile.velocity; rotDirection = Main.rand.NextBool(); Projectile.velocity *= Main.rand.NextFloat(0.97f, 1.03f); @@ -90,17 +91,18 @@ namespace CalamityMod.Projectiles.Ranged for (int k = 0; k < points; k++) { Vector2 velocity = spinningPoint.RotatedBy(radians * k).RotatedBy(-0.45f * rotRando); - WaterFlavoredParticle subTrail = new WaterFlavoredParticle(Projectile.Center + velocity * 4.5f + addedPlacement, velocity * 7, false, 6, 0.65f, Color.SkyBlue); - GeneralParticleHandler.SpawnParticle(subTrail); + Particle ice = new CustomSpark(Projectile.Center + velocity * 4.5f + addedPlacement, velocity * 7, "CalamityMod/Particles/GlowBlade", false, 6, 0.025f, Color.SkyBlue * 0.9f, new Vector2(1.5f, 0.6f), true, true, shrinkSpeed: 0.9f, glowCenterScale: 0.8f, glowOpacity: 0.3f); + GeneralParticleHandler.SpawnParticle(ice); } - int onHitDamage = (int)(Projectile.damage * 0.5f); - Projectile flash = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), onHitDamage, 0f, Projectile.owner, target.whoAmI); - flash.DamageType = Projectile.DamageType; } } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + // This is about equivalent to the previous direct strike extra damage but can't also crit itself obviously + // Also it's not as impacted by defense, which is why it's a bit weaker, rather than being a full 1f + modifiers.CritDamage += 0.85f; + if (Projectile.numHits > 0) Projectile.damage = (int)(Projectile.damage * 0.5f); if (Projectile.damage < 1) diff --git a/Projectiles/Ranged/HellbornHoldout.cs b/Projectiles/Ranged/HellbornHoldout.cs index a4a486cd78..c37eb1104c 100644 --- a/Projectiles/Ranged/HellbornHoldout.cs +++ b/Projectiles/Ranged/HellbornHoldout.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Ranged drawRot += 0.75f * Projectile.direction * MathHelper.Clamp(fade, 0.3f, 1f); Lighting.AddLight(Projectile.Center, Color.Lerp(Color.OrangeRed, Color.White, 0.6f).ToVector3() * fade * 0.7f); - if (!hasPlayedSound && !Main.dedServ) + if (!hasPlayedSound && Main.myPlayer == Projectile.owner) { SoundStyle spin = new("CalamityMod/Sounds/Item/SpinningWoosh"); SoundSlot = SoundEngine.PlaySound(spin with { Volume = 0.01f, Pitch = -0.1f, IsLooped = true }, Projectile.Center); diff --git a/Projectiles/Ranged/OntologicalDespoilerBeam.cs b/Projectiles/Ranged/OntologicalDespoilerBeam.cs index 5aecd11315..181d634eea 100644 --- a/Projectiles/Ranged/OntologicalDespoilerBeam.cs +++ b/Projectiles/Ranged/OntologicalDespoilerBeam.cs @@ -33,6 +33,8 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.extraUpdates = 80; Projectile.tileCollide = false; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Ranged/PlagueExplosionFriendly.cs b/Projectiles/Ranged/PlagueExplosionFriendly.cs index 51358b057d..2e5e780578 100644 --- a/Projectiles/Ranged/PlagueExplosionFriendly.cs +++ b/Projectiles/Ranged/PlagueExplosionFriendly.cs @@ -22,6 +22,8 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = -1; Projectile.timeLeft = 60; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Ranged/PrismaticEnergyBlast.cs b/Projectiles/Ranged/PrismaticEnergyBlast.cs index e7f29f76f0..2d51675e1c 100644 --- a/Projectiles/Ranged/PrismaticEnergyBlast.cs +++ b/Projectiles/Ranged/PrismaticEnergyBlast.cs @@ -40,6 +40,8 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 100; Projectile.extraUpdates = 1; Projectile.timeLeft = 450; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override bool PreAI() diff --git a/Projectiles/Ranged/SputterCometBig.cs b/Projectiles/Ranged/SputterCometBig.cs index 7f227bbb77..85150cc826 100644 --- a/Projectiles/Ranged/SputterCometBig.cs +++ b/Projectiles/Ranged/SputterCometBig.cs @@ -68,9 +68,7 @@ namespace CalamityMod.Projectiles.Ranged SoundEngine.PlaySound(SoundID.Item93, Projectile.position); if (Projectile.owner == Main.myPlayer) { - int flash = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)Projectile.damage * 0.5), 0f, Projectile.owner, 0f, 0f); - Main.projectile[flash].usesLocalNPCImmunity = true; - Main.projectile[flash].localNPCHitCooldown = 10; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)Projectile.damage * 0.5), 0f, Projectile.owner, 0f, 0f); } for (int k = 0; k < 5; k++) { diff --git a/Projectiles/Ranged/TyphoonBubble.cs b/Projectiles/Ranged/TyphoonBubble.cs index 08be6cba30..719bedb2bc 100644 --- a/Projectiles/Ranged/TyphoonBubble.cs +++ b/Projectiles/Ranged/TyphoonBubble.cs @@ -25,6 +25,8 @@ namespace CalamityMod.Projectiles.Ranged Projectile.alpha = 255; Projectile.penetrate = -1; Projectile.timeLeft = 1; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Rogue/AshenStalactiteDebris.cs b/Projectiles/Rogue/AshenStalactiteDebris.cs index 45e2583878..00bd07fc53 100644 --- a/Projectiles/Rogue/AshenStalactiteDebris.cs +++ b/Projectiles/Rogue/AshenStalactiteDebris.cs @@ -19,6 +19,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.penetrate = -1; Projectile.timeLeft = 50; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Rogue/BallisticPoisonBombProj.cs b/Projectiles/Rogue/BallisticPoisonBombProj.cs index 828e638019..f4d204e888 100644 --- a/Projectiles/Rogue/BallisticPoisonBombProj.cs +++ b/Projectiles/Rogue/BallisticPoisonBombProj.cs @@ -20,6 +20,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.tileCollide = false; Projectile.DamageType = RogueDamageClass.Instance; Projectile.ignoreWater = true; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Rogue/BlazingStarProj.cs b/Projectiles/Rogue/BlazingStarProj.cs index 79ce3bb0d0..a7270c0862 100644 --- a/Projectiles/Rogue/BlazingStarProj.cs +++ b/Projectiles/Rogue/BlazingStarProj.cs @@ -34,6 +34,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.penetrate = 5; Projectile.timeLeft = Lifetime; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Rogue/BrimbladeProj.cs b/Projectiles/Rogue/BrimbladeProj.cs index e12364e225..17c0a27023 100644 --- a/Projectiles/Rogue/BrimbladeProj.cs +++ b/Projectiles/Rogue/BrimbladeProj.cs @@ -22,6 +22,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.timeLeft = 180; AIType = ProjectileID.WoodenBoomerang; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) diff --git a/Projectiles/Rogue/CorpusAvertorStealth.cs b/Projectiles/Rogue/CorpusAvertorStealth.cs index 99f36ef71e..57b5178d67 100644 --- a/Projectiles/Rogue/CorpusAvertorStealth.cs +++ b/Projectiles/Rogue/CorpusAvertorStealth.cs @@ -37,6 +37,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.penetrate = -1; Projectile.MaxUpdates = 4; Projectile.timeLeft = 300; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Rogue/CrystalPiercerProjectile.cs b/Projectiles/Rogue/CrystalPiercerProjectile.cs index 61cb9505f0..a47d434f18 100644 --- a/Projectiles/Rogue/CrystalPiercerProjectile.cs +++ b/Projectiles/Rogue/CrystalPiercerProjectile.cs @@ -26,7 +26,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.timeLeft = 600; AIType = ProjectileID.BoneJavelin; Projectile.DamageType = RogueDamageClass.Instance; - Projectile.localNPCHitCooldown = 10; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Rogue/DynamicPursuerElectricity.cs b/Projectiles/Rogue/DynamicPursuerElectricity.cs index 9e44160aad..c8b26e7e8f 100644 --- a/Projectiles/Rogue/DynamicPursuerElectricity.cs +++ b/Projectiles/Rogue/DynamicPursuerElectricity.cs @@ -43,6 +43,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.extraUpdates = 10; Projectile.timeLeft = 60 * Projectile.extraUpdates; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; // Readjust the velocity magnitude the moment this projectile is created // to make velocity setting outside the scope of this projectile less irritating diff --git a/Projectiles/Rogue/FrostyFlareProj.cs b/Projectiles/Rogue/FrostyFlareProj.cs index f101b2cb23..a405ddaa85 100644 --- a/Projectiles/Rogue/FrostyFlareProj.cs +++ b/Projectiles/Rogue/FrostyFlareProj.cs @@ -20,6 +20,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.penetrate = -1; Projectile.timeLeft = 300; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Rogue/FrostyFlareStealth.cs b/Projectiles/Rogue/FrostyFlareStealth.cs index e485108463..33bc7eb8a3 100644 --- a/Projectiles/Rogue/FrostyFlareStealth.cs +++ b/Projectiles/Rogue/FrostyFlareStealth.cs @@ -20,6 +20,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.penetrate = -1; Projectile.timeLeft = 300; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Rogue/GildedDaggerProj.cs b/Projectiles/Rogue/GildedDaggerProj.cs index bafb14937a..9a13c9403b 100644 --- a/Projectiles/Rogue/GildedDaggerProj.cs +++ b/Projectiles/Rogue/GildedDaggerProj.cs @@ -23,6 +23,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.penetrate = 2; Projectile.timeLeft = 600; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Rogue/GleamingDaggerProj.cs b/Projectiles/Rogue/GleamingDaggerProj.cs index 2adb2139bb..1546b0b997 100644 --- a/Projectiles/Rogue/GleamingDaggerProj.cs +++ b/Projectiles/Rogue/GleamingDaggerProj.cs @@ -23,6 +23,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.penetrate = 2; Projectile.timeLeft = 600; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Rogue/InfernalKrisProjectile.cs b/Projectiles/Rogue/InfernalKrisProjectile.cs index 60d4e259a8..ecc722a3bd 100644 --- a/Projectiles/Rogue/InfernalKrisProjectile.cs +++ b/Projectiles/Rogue/InfernalKrisProjectile.cs @@ -29,6 +29,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.penetrate = 2; Projectile.timeLeft = 300; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Rogue/InfestedClawmerangProj.cs b/Projectiles/Rogue/InfestedClawmerangProj.cs index ab0c7314d9..d7f2386bdb 100644 --- a/Projectiles/Rogue/InfestedClawmerangProj.cs +++ b/Projectiles/Rogue/InfestedClawmerangProj.cs @@ -22,6 +22,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.timeLeft = 300; AIType = ProjectileID.WoodenBoomerang; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Rogue/LeonidProgenitorBombshell.cs b/Projectiles/Rogue/LeonidProgenitorBombshell.cs index 8ecefdb0c6..507789ee06 100644 --- a/Projectiles/Rogue/LeonidProgenitorBombshell.cs +++ b/Projectiles/Rogue/LeonidProgenitorBombshell.cs @@ -78,8 +78,6 @@ namespace CalamityMod.Projectiles.Rogue if (flash.WithinBounds(Main.maxProjectiles)) { Main.projectile[flash].DamageType = RogueDamageClass.Instance; - Main.projectile[flash].usesLocalNPCImmunity = true; - Main.projectile[flash].localNPCHitCooldown = 10; } Vector2 pos = new Vector2(Projectile.Center.X + Projectile.width * 0.5f + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); diff --git a/Projectiles/Rogue/LionfishProj.cs b/Projectiles/Rogue/LionfishProj.cs index 6d6bd45d06..c048eb3b75 100644 --- a/Projectiles/Rogue/LionfishProj.cs +++ b/Projectiles/Rogue/LionfishProj.cs @@ -24,6 +24,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.alpha = 255; Projectile.DamageType = RogueDamageClass.Instance; Projectile.timeLeft = CalamityUtils.SecondsToFrames(20f); + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Rogue/NightsGazeSpark.cs b/Projectiles/Rogue/NightsGazeSpark.cs index a33e54ff06..0ec456a0ee 100644 --- a/Projectiles/Rogue/NightsGazeSpark.cs +++ b/Projectiles/Rogue/NightsGazeSpark.cs @@ -21,6 +21,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.timeLeft = lifetime; Projectile.DamageType = RogueDamageClass.Instance; Projectile.localAI[0] = 10f; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Rogue/NightsGazeStar.cs b/Projectiles/Rogue/NightsGazeStar.cs index 69829d8f21..5efba5e5e6 100644 --- a/Projectiles/Rogue/NightsGazeStar.cs +++ b/Projectiles/Rogue/NightsGazeStar.cs @@ -29,6 +29,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.timeLeft = lifetime; Projectile.DamageType = RogueDamageClass.Instance; Projectile.localAI[0] = 10f; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs b/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs index dac74b5b0d..14b31a2c20 100644 --- a/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs +++ b/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs @@ -105,11 +105,6 @@ namespace CalamityMod.Projectiles.Rogue Parent = Main.projectile[(int)Projectile.ai[0]]; } - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - target.immune[Projectile.owner] = 0; - } - public override bool PreDraw(ref Color lightColor) { for (int i = 1; i < Projectile.oldPos.Length; i++) diff --git a/Projectiles/Rogue/SandDollarProj.cs b/Projectiles/Rogue/SandDollarProj.cs index d6a3686639..85e86a89df 100644 --- a/Projectiles/Rogue/SandDollarProj.cs +++ b/Projectiles/Rogue/SandDollarProj.cs @@ -18,6 +18,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.aiStyle = ProjAIStyleID.Boomerang; Projectile.timeLeft = 300; AIType = ProjectileID.Bananarang; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Rogue/SphereSpiked.cs b/Projectiles/Rogue/SphereSpiked.cs index 7d2c53512d..cde5d6edc4 100644 --- a/Projectiles/Rogue/SphereSpiked.cs +++ b/Projectiles/Rogue/SphereSpiked.cs @@ -27,6 +27,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.timeLeft = 300; AIType = ProjectileID.WoodenBoomerang; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Rogue/SphereYellow.cs b/Projectiles/Rogue/SphereYellow.cs index cfa9694d3b..fd4022c0cc 100644 --- a/Projectiles/Rogue/SphereYellow.cs +++ b/Projectiles/Rogue/SphereYellow.cs @@ -25,6 +25,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.timeLeft = 300; AIType = ProjectileID.WoodenBoomerang; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Rogue/ToothBallProjectile.cs b/Projectiles/Rogue/ToothBallProjectile.cs index dda87de504..3aa6c9ac5d 100644 --- a/Projectiles/Rogue/ToothBallProjectile.cs +++ b/Projectiles/Rogue/ToothBallProjectile.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.timeLeft = 600; AIType = ProjectileID.ThrowingKnife; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 30; } diff --git a/Projectiles/Rogue/WebBallBol.cs b/Projectiles/Rogue/WebBallBol.cs index 14840d8a11..278ffb7121 100644 --- a/Projectiles/Rogue/WebBallBol.cs +++ b/Projectiles/Rogue/WebBallBol.cs @@ -18,6 +18,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.timeLeft = 300; Projectile.DamageType = RogueDamageClass.Instance; Projectile.aiStyle = ProjAIStyleID.GroundProjectile; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Rogue/WhitewaterAura.cs b/Projectiles/Rogue/WhitewaterAura.cs index 954ae22133..cc86ca7ba0 100644 --- a/Projectiles/Rogue/WhitewaterAura.cs +++ b/Projectiles/Rogue/WhitewaterAura.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.ignoreWater = true; Projectile.DamageType = RogueDamageClass.Instance; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; + Projectile.localNPCHitCooldown = 20; } public override void AI() @@ -38,9 +38,9 @@ namespace CalamityMod.Projectiles.Rogue Player player = Main.player[playerIndex]; float targetDist = Vector2.Distance(player.Center, Projectile.Center); - if (targetDist < 200f * areaScale && time % 15 == 0) + if (targetDist < 200f * areaScale && player.Calamity().whitewaterHeal == 0) { - player.HealPlayer(1); + player.Calamity().whitewaterHeal = (player.whoAmI == Projectile.owner ? 300 : 600); } } @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 300); Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center); - target.MoveNPC(launchVel, 6, true); + target.MoveNPC(launchVel, 9, true); } public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Rogue/WhitewaterProj.cs b/Projectiles/Rogue/WhitewaterProj.cs index 58ff0fc987..1bc378ec2d 100644 --- a/Projectiles/Rogue/WhitewaterProj.cs +++ b/Projectiles/Rogue/WhitewaterProj.cs @@ -179,7 +179,7 @@ namespace CalamityMod.Projectiles.Rogue } } } - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.1f), Projectile.knockBack, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.2f), Projectile.knockBack, Projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/Summon/BloodRain.cs b/Projectiles/Summon/BloodRain.cs index 9d79d29582..c03465dcfd 100644 --- a/Projectiles/Summon/BloodRain.cs +++ b/Projectiles/Summon/BloodRain.cs @@ -27,6 +27,8 @@ namespace CalamityMod.Projectiles.Summon AIType = ProjectileID.RainFriendly; Projectile.extraUpdates = 1; Projectile.DamageType = DamageClass.Summon; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Summon/DaedalusLightning.cs b/Projectiles/Summon/DaedalusLightning.cs index 23d7b00dda..ee5d8a1c2d 100644 --- a/Projectiles/Summon/DaedalusLightning.cs +++ b/Projectiles/Summon/DaedalusLightning.cs @@ -40,6 +40,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.extraUpdates = 20; Projectile.timeLeft = 45 * Projectile.extraUpdates; Projectile.DamageType = DamageClass.Summon; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; // Readjust the velocity magnitude the moment this projectile is created // to make velocity setting outside the scope of this projectile less irritating diff --git a/Projectiles/Summon/DeathstareBeam.cs b/Projectiles/Summon/DeathstareBeam.cs index 4c8b737425..19279ec247 100644 --- a/Projectiles/Summon/DeathstareBeam.cs +++ b/Projectiles/Summon/DeathstareBeam.cs @@ -26,6 +26,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.ignoreWater = true; Projectile.timeLeft = 10; Projectile.DamageType = DamageClass.Summon; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() { diff --git a/Projectiles/Summon/HerringMinion.cs b/Projectiles/Summon/HerringMinion.cs index 050a280eea..5821c667dc 100644 --- a/Projectiles/Summon/HerringMinion.cs +++ b/Projectiles/Summon/HerringMinion.cs @@ -33,6 +33,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.ignoreWater = true; Projectile.tileCollide = false; Projectile.minion = true; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Summon/SmallAresArms/ExoskeletonCannon.cs b/Projectiles/Summon/SmallAresArms/ExoskeletonCannon.cs index ad59ba6a1f..5b9c20254a 100644 --- a/Projectiles/Summon/SmallAresArms/ExoskeletonCannon.cs +++ b/Projectiles/Summon/SmallAresArms/ExoskeletonCannon.cs @@ -69,6 +69,8 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms Projectile.timeLeft = 900000; Projectile.scale = 1f; Projectile.DamageType = DamageClass.Summon; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void SendExtraAI(BinaryWriter writer) diff --git a/Projectiles/Summon/VoidConcentrationAura.cs b/Projectiles/Summon/VoidConcentrationAura.cs index 37970e73a4..91487ce95c 100644 --- a/Projectiles/Summon/VoidConcentrationAura.cs +++ b/Projectiles/Summon/VoidConcentrationAura.cs @@ -29,6 +29,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.timeLeft *= 5; Projectile.minion = true; Projectile.DamageType = DamageClass.Summon; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void SendExtraAI(BinaryWriter writer) diff --git a/Projectiles/Summon/VoidConcentrationBlackhole.cs b/Projectiles/Summon/VoidConcentrationBlackhole.cs index b79ca5a550..efed72d73c 100644 --- a/Projectiles/Summon/VoidConcentrationBlackhole.cs +++ b/Projectiles/Summon/VoidConcentrationBlackhole.cs @@ -45,6 +45,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.tileCollide = false; Projectile.scale = 0.01f; Projectile.DamageType = DamageClass.Summon; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } private void ApplySucc(NPC npc) diff --git a/Projectiles/Typeless/DarkIce.cs b/Projectiles/Typeless/DarkIce.cs index bc65e2df07..b601c92938 100644 --- a/Projectiles/Typeless/DarkIce.cs +++ b/Projectiles/Typeless/DarkIce.cs @@ -25,6 +25,8 @@ namespace CalamityMod.Projectiles.Typeless Projectile.extraUpdates = 1; Projectile.coldDamage = true; Projectile.npcProj = true; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Typeless/Luxor.cs b/Projectiles/Typeless/Luxor.cs index ca5210dd07..bc170f8aa9 100644 --- a/Projectiles/Typeless/Luxor.cs +++ b/Projectiles/Typeless/Luxor.cs @@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.rotation = Utils.DirectionTo(Projectile.Center, Owner.Calamity().mouseWorld).ToRotation() + MathHelper.PiOver2; - fxFade = (float)Math.Pow(Utils.GetLerpValue(30, 0, attackTimer, true), 3) + postFireBoost; + fxFade = moddedOwner.luxorsGiftVanity ? 1 : (float)Math.Pow(Utils.GetLerpValue(30, 0, attackTimer, true), 3) + postFireBoost; if (idleTimer >= 280) { @@ -121,81 +121,84 @@ namespace CalamityMod.Projectiles.Typeless } - if (attackTimer == 0 && moddedOwner.luxorHit) + if (!moddedOwner.luxorsGiftVanity) { - int attackSpeed = 0; - int attackDamage = 0; - int projType = 0; - switch (classType) + if (attackTimer == 0 && moddedOwner.luxorHit) { - case 0: attackSpeed = LuxorsGift.classlessAttackSpeed; attackDamage = LuxorsGift.classlessDamage; projType = ModContent.ProjectileType(); break; - case 1: attackSpeed = LuxorsGift.meleeAttackSpeed; attackDamage = LuxorsGift.meleeDamage; projType = ModContent.ProjectileType(); break; - case 2: attackSpeed = LuxorsGift.rangedAttackSpeed; attackDamage = LuxorsGift.rangedDamage; projType = ModContent.ProjectileType(); break; - case 3: attackSpeed = LuxorsGift.magicAttackSpeed; attackDamage = LuxorsGift.magicDamage; projType = ModContent.ProjectileType(); break; - case 4: attackSpeed = LuxorsGift.summonerAttackSpeed; attackDamage = LuxorsGift.summonerDamage; projType = ModContent.ProjectileType(); break; - case 5: attackSpeed = LuxorsGift.rogueAttackSpeed; attackDamage = LuxorsGift.rogueDamage; projType = ModContent.ProjectileType(); break; - } - float powerMult = Utils.GetLerpValue(-120, 140, attackSpeed, true); // An intensity multiplier based on the fire rate of the mode - if (Main.zenithWorld) // Just like old times - { - attackSpeed = 0; - attackDamage = Math.Max(1, (int)(Owner.HeldItem.damage * Utils.Remap(Owner.HeldItem.useAnimation, 3, 120, 0.025f, 1f, false))); - } - - for (int i = 0; i < (int)(20 * powerMult); i++) // Firing dust - { - Vector2 dustVel = (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2().RotatedByRandom(0.5f) * 12 * powerMult; - Dust dust = Dust.NewDustPerfect(tipPosition, ModContent.DustType(), dustVel * Main.rand.NextFloat(0.5f, 1.2f)); - dust.noGravity = !Main.rand.NextBool(3); - dust.scale = Main.rand.NextFloat(0.75f, 1.4f) * powerMult; - dust.color = usedColor; - dust.noLightEmittence = true; - } - if (classType == 1) // Melee shotgun - { - for (int i = -1; i <= 1; i++) + int attackSpeed = 0; + int attackDamage = 0; + int projType = 0; + switch (classType) { - Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, Utils.DirectionTo(tipPosition, Owner.Calamity().mouseWorld).RotatedBy(-0.12f * i * Main.rand.NextFloat(0.7f, 1f)) * (12 - Main.rand.NextFloat(0f, 0.6f) - Math.Abs(i)), projType, (int)(Owner.GetDamage(itemClass).ApplyTo(attackDamage)), 0f, Owner.whoAmI); + case 0: attackSpeed = LuxorsGift.classlessAttackSpeed; attackDamage = LuxorsGift.classlessDamage; projType = ModContent.ProjectileType(); break; + case 1: attackSpeed = LuxorsGift.meleeAttackSpeed; attackDamage = LuxorsGift.meleeDamage; projType = ModContent.ProjectileType(); break; + case 2: attackSpeed = LuxorsGift.rangedAttackSpeed; attackDamage = LuxorsGift.rangedDamage; projType = ModContent.ProjectileType(); break; + case 3: attackSpeed = LuxorsGift.magicAttackSpeed; attackDamage = LuxorsGift.magicDamage; projType = ModContent.ProjectileType(); break; + case 4: attackSpeed = LuxorsGift.summonerAttackSpeed; attackDamage = LuxorsGift.summonerDamage; projType = ModContent.ProjectileType(); break; + case 5: attackSpeed = LuxorsGift.rogueAttackSpeed; attackDamage = LuxorsGift.rogueDamage; projType = ModContent.ProjectileType(); break; + } + float powerMult = Utils.GetLerpValue(-120, 140, attackSpeed, true); // An intensity multiplier based on the fire rate of the mode + if (Main.zenithWorld) // Just like old times + { + attackSpeed = 0; + attackDamage = Math.Max(1, (int)(Owner.HeldItem.damage * Utils.Remap(Owner.HeldItem.useAnimation, 3, 120, 0.025f, 1f, false))); + } + + for (int i = 0; i < (int)(20 * powerMult); i++) // Firing dust + { + Vector2 dustVel = (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2().RotatedByRandom(0.5f) * 12 * powerMult; + Dust dust = Dust.NewDustPerfect(tipPosition, ModContent.DustType(), dustVel * Main.rand.NextFloat(0.5f, 1.2f)); + dust.noGravity = !Main.rand.NextBool(3); + dust.scale = Main.rand.NextFloat(0.75f, 1.4f) * powerMult; + dust.color = usedColor; + dust.noLightEmittence = true; + } + if (classType == 1) // Melee shotgun + { + for (int i = -1; i <= 1; i++) + { + Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, Utils.DirectionTo(tipPosition, Owner.Calamity().mouseWorld).RotatedBy(-0.12f * i * Main.rand.NextFloat(0.7f, 1f)) * (12 - Main.rand.NextFloat(0f, 0.6f) - Math.Abs(i)), projType, (int)(Owner.GetDamage(itemClass).ApplyTo(attackDamage)), 0f, Owner.whoAmI); + proj.ArmorPenetration = LuxorsGift.luxArmorPen; + } + for (int i = 0; i < 5; i++) // These are visual + { + Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, Utils.DirectionTo(tipPosition, Owner.Calamity().mouseWorld).RotatedByRandom(0.4f) * (12 - Main.rand.NextFloat(2f, 5f)), projType, (int)(Owner.GetDamage(itemClass).ApplyTo(attackDamage)), 0f, Owner.whoAmI, 5); + proj.timeLeft = 95; + } + } + else // Everything else + { + Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, Utils.DirectionTo(tipPosition, Owner.Calamity().mouseWorld) * 12, projType, (int)(Owner.GetDamage(itemClass).ApplyTo(attackDamage)), 0f, Owner.whoAmI); proj.ArmorPenetration = LuxorsGift.luxArmorPen; + if (classType == 5) // Rogue has gravity so velocity is adjusted a bit + proj.velocity.Y -= 1.5f; } - for (int i = 0; i < 5; i++) // These are visual + + SoundStyle blam = new("CalamityMod/Sounds/Item/GunShotSmall"); + SoundEngine.PlaySound(blam with { Volume = 0.35f, Pitch = Main.rand.NextFloat(0.6f, 0.8f) }, tipPosition); + SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact with { Volume = 0.7f, Pitch = 0.2f }, tipPosition); + + if (classType == 5 && rogueChain) { - Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, Utils.DirectionTo(tipPosition, Owner.Calamity().mouseWorld).RotatedByRandom(0.4f) * (12 - Main.rand.NextFloat(2f, 5f)), projType, (int)(Owner.GetDamage(itemClass).ApplyTo(attackDamage)), 0f, Owner.whoAmI, 5); - proj.timeLeft = 95; + rogueChain = false; + attackTimer = attackSpeed / 3; } + else + { + attackTimer = attackSpeed; + moddedOwner.luxorHit = false; + if (!CalamityClientConfig.Instance.Photosensitivity) + postFireBoost = 1.7f; + idleTimer = 0; + rogueChain = true; + } + Projectile.netUpdate = true; } - else // Everything else - { - Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, Utils.DirectionTo(tipPosition, Owner.Calamity().mouseWorld) * 12, projType, (int)(Owner.GetDamage(itemClass).ApplyTo(attackDamage)), 0f, Owner.whoAmI); - proj.ArmorPenetration = LuxorsGift.luxArmorPen; - if (classType == 5) // Rogue has gravity so velocity is adjusted a bit - proj.velocity.Y -= 1.5f; - } - - SoundStyle blam = new("CalamityMod/Sounds/Item/GunShotSmall"); - SoundEngine.PlaySound(blam with { Volume = 0.35f, Pitch = Main.rand.NextFloat(0.6f, 0.8f) }, tipPosition); - SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact with { Volume = 0.7f, Pitch = 0.2f }, tipPosition); - - if (classType == 5 && rogueChain) - { - rogueChain = false; - attackTimer = attackSpeed / 3; - } - else - { - attackTimer = attackSpeed; - moddedOwner.luxorHit = false; - if (!CalamityClientConfig.Instance.Photosensitivity) - postFireBoost = 1.7f; - idleTimer = 0; - rogueChain = true; - } - Projectile.netUpdate = true; + if (attackTimer > 0) + attackTimer--; + if (postFireBoost > 0) // Quickly fade out the increased poost fire visuals + postFireBoost -= 0.2f; } - if (attackTimer > 0) - attackTimer--; - if (postFireBoost > 0) // Quickly fade out the increased poost fire visuals - postFireBoost -= 0.2f; if (time % 2 == 0 && false) { @@ -210,7 +213,7 @@ namespace CalamityMod.Projectiles.Typeless float idleFade = Utils.GetLerpValue(280, 300, idleTimer, true); Lighting.AddLight(tipPosition, Color.Lerp(usedColor, Color.Lerp(usedColor, Color.White, 0.5f), idleFade).ToVector3() * (0.5f * MathHelper.Lerp(fxFade, 1, 0.55f) + 0.35f * idleFade)); - if (moddedOwner.luxorsGift) + if (moddedOwner.luxorsGift || moddedOwner.luxorsGiftVanity) Projectile.timeLeft++; else Projectile.Kill(); @@ -218,15 +221,17 @@ namespace CalamityMod.Projectiles.Typeless Projectile.Kill(); time++; - if (!moddedOwner.luxorHit) + if (!moddedOwner.luxorHit && !moddedOwner.luxorsGiftVanity) idleTimer++; + else if (moddedOwner.luxorsGiftVanity) + idleTimer = 0; } public override bool PreDraw(ref Color lightColor) { Asset tex = ModContent.Request(Texture); Texture2D bTexture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; Texture2D cTexture = ModContent.Request("CalamityMod/Particles/Light").Value; - float idleFade = (float)Math.Pow(Utils.GetLerpValue(280, 300, idleTimer, true), 5); + float idleFade = moddedOwner.luxorsGiftVanity ? 0 : (float)Math.Pow(Utils.GetLerpValue(280, 300, idleTimer, true), 5); Color drawColor = usedColor; Color bodyColor = Color.Lerp(lightColor, Color.Gold with { A = 0 }, idleFade); float drawMult = Math.Max(idleFade, fxFade); diff --git a/Projectiles/Typeless/SandBall.cs b/Projectiles/Typeless/SandBall.cs index c5f95893e9..6a43186f50 100644 --- a/Projectiles/Typeless/SandBall.cs +++ b/Projectiles/Typeless/SandBall.cs @@ -65,6 +65,8 @@ namespace CalamityMod.Projectiles.Typeless Projectile.width = Projectile.height = 10; Projectile.friendly = true; Projectile.penetrate = -1; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; if (Fired) { diff --git a/Projectiles/Typeless/StickyFeatherAero.cs b/Projectiles/Typeless/StickyFeatherAero.cs index 6da5082c5c..89e9e698c0 100644 --- a/Projectiles/Typeless/StickyFeatherAero.cs +++ b/Projectiles/Typeless/StickyFeatherAero.cs @@ -22,6 +22,8 @@ namespace CalamityMod.Projectiles.Typeless Projectile.alpha = 255; Projectile.aiStyle = ProjAIStyleID.Nail; AIType = ProjectileID.NailFriendly; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Typeless/WulfrumDrillProj.cs b/Projectiles/Typeless/WulfrumDrillProj.cs index 0bc98e5c28..e40f380574 100644 --- a/Projectiles/Typeless/WulfrumDrillProj.cs +++ b/Projectiles/Typeless/WulfrumDrillProj.cs @@ -29,6 +29,8 @@ namespace CalamityMod.Projectiles.Typeless Projectile.ownerHitCheck = true; Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; Projectile.scale = 0.93f; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override bool ShouldUpdatePosition() => false; diff --git a/Scenes/MusicScenes/SkeletronPrimeMasterMusicScene.cs b/Scenes/MusicScenes/SkeletronPrimeMasterMusicScene.cs index 77398c4c76..e5597c0d2e 100644 --- a/Scenes/MusicScenes/SkeletronPrimeMasterMusicScene.cs +++ b/Scenes/MusicScenes/SkeletronPrimeMasterMusicScene.cs @@ -9,6 +9,6 @@ namespace CalamityMod.Systems { public override int Music => MusicID.Boss3; // I spent 20 minutes trying to get this music to play while forgetting to actually override this in the first place _ YuH public override SceneEffectPriority Priority => SceneEffectPriority.BossLow; - public override bool IsSceneEffectActive(Player player) => Main.masterMode && CalamityWorld.revenge && NPC.AnyNPCs(NPCID.SkeletronPrime) && Main.npc[NPC.FindFirstNPC(NPCID.SkeletronPrime)].Distance(player.Center) <= 525f * 16f; + public override bool IsSceneEffectActive(Player player) => CalamityWorld.death && NPC.AnyNPCs(NPCID.SkeletronPrime) && Main.npc[NPC.FindFirstNPC(NPCID.SkeletronPrime)].Distance(player.Center) <= 525f * 16f; } } diff --git a/Skies/BossRushSky.cs b/Skies/BossRushSky.cs index c5c2d7c66c..7cc3f753df 100644 --- a/Skies/BossRushSky.cs +++ b/Skies/BossRushSky.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Skies private float GetIntensity() { if (ShouldDrawRegularly || Main.LocalPlayer?.Calamity().monolithBossRushShader > 0) - return 1f; + return 0.57f; float fadeRatio = BossRushEvent.StartTimer / (float)BossRushEvent.StartEffectTotalTime; return Utils.GetLerpValue(0.57f, 1f, fadeRatio, true); diff --git a/Sounds/Item/ApoctosisShoot.ogg b/Sounds/Item/ApoctosisShoot.ogg new file mode 100644 index 0000000000..bb04453a04 Binary files /dev/null and b/Sounds/Item/ApoctosisShoot.ogg differ diff --git a/Sounds/Item/ElectricBurst.ogg b/Sounds/Item/ElectricBurst.ogg new file mode 100644 index 0000000000..69a477afd8 Binary files /dev/null and b/Sounds/Item/ElectricBurst.ogg differ diff --git a/Sounds/Item/GaussFire.ogg b/Sounds/Item/GaussFire.ogg new file mode 100644 index 0000000000..00a153e283 Binary files /dev/null and b/Sounds/Item/GaussFire.ogg differ diff --git a/Sounds/Item/ImmolatorCharge.ogg b/Sounds/Item/ImmolatorCharge.ogg new file mode 100644 index 0000000000..82f4e347ba Binary files /dev/null and b/Sounds/Item/ImmolatorCharge.ogg differ diff --git a/Sounds/Item/ImmolatorChargeLoop.ogg b/Sounds/Item/ImmolatorChargeLoop.ogg new file mode 100644 index 0000000000..c6af65b241 Binary files /dev/null and b/Sounds/Item/ImmolatorChargeLoop.ogg differ diff --git a/Sounds/Item/ImmolatorFire.ogg b/Sounds/Item/ImmolatorFire.ogg new file mode 100644 index 0000000000..9badc286dd Binary files /dev/null and b/Sounds/Item/ImmolatorFire.ogg differ diff --git a/Sounds/Item/ImmolatorPreExplode.ogg b/Sounds/Item/ImmolatorPreExplode.ogg new file mode 100644 index 0000000000..94818619ef Binary files /dev/null and b/Sounds/Item/ImmolatorPreExplode.ogg differ diff --git a/Sounds/Item/IonChargeLoop.ogg b/Sounds/Item/IonChargeLoop.ogg new file mode 100644 index 0000000000..be6a482886 Binary files /dev/null and b/Sounds/Item/IonChargeLoop.ogg differ diff --git a/Sounds/Item/LaserBurn.ogg b/Sounds/Item/LaserBurn.ogg new file mode 100644 index 0000000000..4bb07b3d93 Binary files /dev/null and b/Sounds/Item/LaserBurn.ogg differ diff --git a/Sounds/Item/OracleHum.ogg b/Sounds/Item/OracleHum.ogg index d5cfe6cd1c..24cfa990b7 100644 Binary files a/Sounds/Item/OracleHum.ogg and b/Sounds/Item/OracleHum.ogg differ diff --git a/Sounds/Item/PlasmaBig.ogg b/Sounds/Item/PlasmaBig.ogg new file mode 100644 index 0000000000..279a160f02 Binary files /dev/null and b/Sounds/Item/PlasmaBig.ogg differ diff --git a/Sounds/Item/PlasmaSmall.ogg b/Sounds/Item/PlasmaSmall.ogg new file mode 100644 index 0000000000..221d5ffe95 Binary files /dev/null and b/Sounds/Item/PlasmaSmall.ogg differ diff --git a/Sounds/Item/ScattershotCharge.ogg b/Sounds/Item/ScattershotCharge.ogg new file mode 100644 index 0000000000..a571765a20 Binary files /dev/null and b/Sounds/Item/ScattershotCharge.ogg differ diff --git a/Sounds/Item/ScattershotChargeLoop.ogg b/Sounds/Item/ScattershotChargeLoop.ogg new file mode 100644 index 0000000000..bbf7d26fd3 Binary files /dev/null and b/Sounds/Item/ScattershotChargeLoop.ogg differ diff --git a/Sounds/Item/ScattershotChargeShoot.ogg b/Sounds/Item/ScattershotChargeShoot.ogg new file mode 100644 index 0000000000..a0fbf470cb Binary files /dev/null and b/Sounds/Item/ScattershotChargeShoot.ogg differ diff --git a/Sounds/Item/ScattershotShoot.ogg b/Sounds/Item/ScattershotShoot.ogg new file mode 100644 index 0000000000..a827d96e41 Binary files /dev/null and b/Sounds/Item/ScattershotShoot.ogg differ diff --git a/Sounds/Item/TaserLaunch.ogg b/Sounds/Item/TaserLaunch.ogg new file mode 100644 index 0000000000..1bf31cf9f5 Binary files /dev/null and b/Sounds/Item/TaserLaunch.ogg differ diff --git a/Systems/Collections/MagicGunIDList.cs b/Systems/Collections/MagicGunIDList.cs index bc6544d228..9bce514ec6 100644 --- a/Systems/Collections/MagicGunIDList.cs +++ b/Systems/Collections/MagicGunIDList.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Systems.Collections ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), diff --git a/Systems/Collections/NPCs/EnemyImmunitiesList.cs b/Systems/Collections/NPCs/EnemyImmunitiesList.cs index 667c66cc2b..60d1d76aa7 100644 --- a/Systems/Collections/NPCs/EnemyImmunitiesList.cs +++ b/Systems/Collections/NPCs/EnemyImmunitiesList.cs @@ -138,7 +138,7 @@ namespace CalamityMod.Systems.Collections NPCType(), NPCType(), NPCType(), - NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), diff --git a/Systems/Collections/NPCs/MinibossList.cs b/Systems/Collections/NPCs/MinibossList.cs index 97353eb626..f2e0ed4f62 100644 --- a/Systems/Collections/NPCs/MinibossList.cs +++ b/Systems/Collections/NPCs/MinibossList.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Systems.Collections NPCType(), NPCType(), NPCType(), - NPCType(), + NPCType(), NPCType(), NPCType(), NPCID.Pumpking, diff --git a/Systems/Collections/SharedStaticIFramesIDSet.cs b/Systems/Collections/SharedStaticIFramesIDSet.cs new file mode 100644 index 0000000000..d01cc7bd6a --- /dev/null +++ b/Systems/Collections/SharedStaticIFramesIDSet.cs @@ -0,0 +1,126 @@ +using System.Collections.Generic; +using CalamityMod.Projectiles.Magic; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A which contains an ProjectileID Set, created with the appropriate factory.
+ ///
+ /// This is populated from a much more human readable set of "shared iframe lists", contained in OnModLoad. + ///
+ public sealed class SharedStaticIFrames : ModSystem + { + public static IDictionary> SharedIFrameSets { get; private set; } + public static int[] SharedIFrameFactorySet { get; private set; } + + public override void PostSetupContent() + { + // This transient structure is used to make the setup of intended shared-iframe sets as easy as possible. + // + // If you want to add a new projectile to share iframes with any existing sets, just add it to that [ area ]. + // + // If you want to create a brand new shared iframe set, just add a new [ area ] at the bottom. + IList> setupLists = + [ + [ // Set 1: Vanilla bees (Hive Pack) + ProjectileID.Bee, + ProjectileID.GiantBee + ], + + [ // Set 2: Vilethorn + ProjectileID.VilethornBase, + ProjectileID.VilethornTip + ], + + [ // Set 3: Harp notes + ProjectileID.QuarterNote, + ProjectileID.EighthNote, + ProjectileID.TiedEighthNote + ], + + [ // Set 4: The North Pole + ProjectileID.NorthPoleWeapon, + ProjectileID.NorthPoleSpear, + ProjectileID.NorthPoleSnowflake, + ], + + [ // Set 5: All spore gas clouds + ProjectileID.SporeTrap, + ProjectileID.SporeTrap2, + ProjectileID.SporeGas, + ProjectileID.SporeGas2, + ProjectileID.SporeGas3 + ], + + [ // Set 6: Astral Staff and Asteroid Staff + ModContent.ProjectileType(), + ModContent.ProjectileType() + ], + + [ // Set 7: All toxic clouds + ProjectileID.ToxicCloud, + ProjectileID.ToxicCloud2, + ProjectileID.ToxicCloud3 + ] + ]; + + // Convert the above list-of-lists into a dictionary, where the key is the shared iframe projectile ID. + SharedIFrameSets = new SortedDictionary>(); + foreach (var innerList in setupLists) + { + int sharedIDForThisSet = innerList[0]; + SharedIFrameSets.Add(sharedIDForThisSet, innerList); + } + + // Now construct a vanilla Terraria Projectile ID Set using the appropriate factory. + + // Calculate the total length of the input buffer to the factory + int totalLength = 0; + foreach(var l in SharedIFrameSets.Values) + totalLength += l.Count; + + // Create the buffer and fill it + int[] buffer = new int[totalLength * 2]; + int idx = 0; + foreach (var sharedFrameList in setupLists) + { + int sharedIDForThisSet = sharedFrameList[0]; + + foreach (var projID in sharedFrameList) + { + buffer[idx++] = projID; + buffer[idx++] = sharedIDForThisSet; + } + } + + SharedIFrameFactorySet = ProjectileID.Sets.Factory.CreateIntSet(-1, buffer); + } + + public override void Unload() + { + SharedIFrameSets = null; + SharedIFrameFactorySet = null; + } + + /// + /// A shorthand method to check if this projectile shares static iframes in any way. + /// + public static bool Includes(int projType) => SharedIFrameFactorySet[projType] != -1; + + /// + /// The intended + /// + /// The projectile type to get the set of shared iframe projectile IDs for. + /// A list of projectile IDs that share static iframes with this projectile ID. This list may be empty. + public static IList GetSharedStaticIFrames(int projType) + { + int sharedSetID = SharedIFrameFactorySet[projType]; + bool setExists = SharedIFrameSets.TryGetValue(sharedSetID, out var ret); + + return setExists ? ret : []; + } + } +} diff --git a/Tiles/Furniture/CraftingStations/SCalAltar.cs b/Tiles/Furniture/CraftingStations/SCalAltar.cs index 7ce3ad11d3..78e76fe29a 100644 --- a/Tiles/Furniture/CraftingStations/SCalAltar.cs +++ b/Tiles/Furniture/CraftingStations/SCalAltar.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations Main.LocalPlayer.ConsumeItem(ModContent.ItemType(), true); for (int f = 0; f < Main.maxNPCs; f++) { - if (Main.npc[f].type == ModContent.NPCType() && Main.npc[f].active) + if (Main.npc[f].type == ModContent.NPCType() && Main.npc[f].active) { Main.npc[f].active = false; } diff --git a/Tiles/MonsterBanner.cs b/Tiles/MonsterBanner.cs index db5c9265c8..f373478e23 100644 --- a/Tiles/MonsterBanner.cs +++ b/Tiles/MonsterBanner.cs @@ -246,7 +246,7 @@ namespace CalamityMod.Tiles npc = NPCType(); break; case 58: - npc = NPCType(); + npc = NPCType(); break; case 59: npc = NPCType(); diff --git a/UI/BossHealthBarManager.cs b/UI/BossHealthBarManager.cs index 021fe2f7e6..5d523812fc 100644 --- a/UI/BossHealthBarManager.cs +++ b/UI/BossHealthBarManager.cs @@ -276,7 +276,7 @@ namespace CalamityMod.UI NPCType(), // Hardmode Modded. - NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), diff --git a/UI/ModeIndicator/ModeIndicatorUI.cs b/UI/ModeIndicator/ModeIndicatorUI.cs index 4e18a81e85..fd25bce7b1 100644 --- a/UI/ModeIndicator/ModeIndicatorUI.cs +++ b/UI/ModeIndicator/ModeIndicatorUI.cs @@ -354,7 +354,12 @@ namespace CalamityMod.UI.ModeIndicator modeHovered = true; text = GetDifficultyText(mode); - if (ClickingMouse) + + // Cannot switch to Death Mode if Master Mode isn't active. + // Cannot switch to Revengeance Mode if Master Mode is active. + // I hate how this is coded, it makes me want to smash my head through a wall. - Fabsol + bool cannotSwitchTo = (!Main.masterMode && mode == Difficulties[2]) || (Main.masterMode && mode == Difficulties[1]); + if (ClickingMouse && !cannotSwitchTo) SwitchToDifficulty(mode); } } diff --git a/UI/ResourceSets/CalamityResourceOverlay.cs b/UI/ResourceSets/CalamityResourceOverlay.cs index e4fb0c820a..b954995b71 100644 --- a/UI/ResourceSets/CalamityResourceOverlay.cs +++ b/UI/ResourceSets/CalamityResourceOverlay.cs @@ -153,16 +153,17 @@ namespace CalamityMod.UI.ResourceSets int deadPixels = (int)Math.Floor((snapshot.LifeMax - snapshot.Life) * pixelsPerLife); var bleedPixels = Math.Round(bleed * pixelsPerLife); - Color[] textureData = new Color[width * 12]; - + Color[] textureData = new Color[width * 12]; + // doze 19MAR2025 - I don't know if I could optimize this any further without switching to shaders. + // I don't expect performance issues, but at some point might be worth adding a config to disable the indicator in case of lag or accessibility concerns for (int i = 0; i < textureData.Length; i++) { - var bleedCol = new Color(0, 0, 0, 0); - if ((i % width < bleedPixels + deadPixels) && !(i % width < deadPixels)) + var i_MOD_width = i % width; //minor optimization, calculated here once instead of twice in the loop. + var bleedCol = Color.Transparent; + if ((i_MOD_width < bleedPixels + deadPixels) && !(i_MOD_width < deadPixels)) { bleedCol = barTextureData[((i % 12)+(i/width)*12)]; - //bleedCol = new Color(0f, 0.3f, 0.75f, 0.5f); } textureData[i] = bleedCol; diff --git a/Utilities/ItemUtils.cs b/Utilities/ItemUtils.cs index 621eae94e4..286212804b 100644 --- a/Utilities/ItemUtils.cs +++ b/Utilities/ItemUtils.cs @@ -187,12 +187,15 @@ namespace CalamityMod // Spears actually work fine with Legendary, but vanilla doesn't give it to them, so we won't either. else { + // 14MAR2025: Ozzatron: Add support for allowing Ruthless over Godly if the player has more than 100% crit chance of the appropriate class + bool has100Crit = Main.LocalPlayer.GetTotalCritChance(item.DamageType) >= 100; + int[][] meleeNoSpeedReforgeTiers = new int[][] { /* 0 */ new int[] { PrefixID.Keen, PrefixID.Forceful, PrefixID.Strong }, /* 1 */ new int[] { PrefixID.Hurtful, PrefixID.Ruthless, PrefixID.Zealous }, /* 2 */ new int[] { PrefixID.Superior, PrefixID.Demonic }, - /* 3 */ new int[] { PrefixID.Godly } + /* 3 */ has100Crit ? new int[] { PrefixID.Godly, PrefixID.Ruthless } : new int[] { PrefixID.Godly } }; prefix = IteratePrefix(rand, meleeNoSpeedReforgeTiers, currentPrefix); } diff --git a/Utilities/NPCDebuffs.cs b/Utilities/NPCDebuffs.cs index 3a661d6d56..cdea134597 100644 --- a/Utilities/NPCDebuffs.cs +++ b/Utilities/NPCDebuffs.cs @@ -416,7 +416,7 @@ namespace CalamityMod { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { BuffID.Poisoned, BuffID.Venom }) }, - { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { BuffID.Electrified, ModContent.BuffType() }) }, + { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { BuffID.Electrified, ModContent.BuffType() }) }, { ModContent.NPCType(), slime }, { ModContent.NPCType(), slime }, diff --git a/World/BrimstoneCrag.cs b/World/BrimstoneCrag.cs index 960944a967..11024b1055 100644 --- a/World/BrimstoneCrag.cs +++ b/World/BrimstoneCrag.cs @@ -524,7 +524,7 @@ namespace CalamityMod.World if (!firstItem) { - contents.Insert(0, new ChestItem(ModContent.ItemType(), 1)); + contents.Insert(0, new ChestItem(ItemID.ObsidianWaterWalkingBoots, 1)); } else {