diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index 7abc394a1f..d675ac0b01 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -89,6 +89,10 @@ namespace CalamityMod.Buffs //Vanilla buffs switch (type) { + case BuffID.Archery: + tip = "20% increased arrow speed and 1.05x arrow damage"; + break; + case BuffID.Swiftness: tip = "15% increased movement speed"; break; diff --git a/Buffs/StatBuffs/AdrenalineMode.png b/Buffs/StatBuffs/AdrenalineMode.png index 555478a614..bedcc91f12 100644 Binary files a/Buffs/StatBuffs/AdrenalineMode.png and b/Buffs/StatBuffs/AdrenalineMode.png differ diff --git a/Buffs/StatBuffs/EvasionScarfBoost.cs b/Buffs/StatBuffs/EvasionScarfBoost.cs deleted file mode 100644 index 8e06699c94..0000000000 --- a/Buffs/StatBuffs/EvasionScarfBoost.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs.StatBuffs -{ - public class EvasionScarfBoost : ModBuff - { - public override void SetDefaults() - { - DisplayName.SetDefault("Evasion Scarf Boost"); - Description.SetDefault("10% increased damage, 10% increased crit chance, and 15% increased melee speed"); - Main.debuff[Type] = false; - Main.pvpBuff[Type] = true; - Main.buffNoSave[Type] = true; - longerExpertDebuff = false; - } - - public override void Update(Player player, ref int buffIndex) - { - player.Calamity().eScarfBoost = true; - } - } -} diff --git a/Buffs/StatBuffs/EvasionScarfBoost.png b/Buffs/StatBuffs/EvasionScarfBoost.png deleted file mode 100644 index 5e45380f0e..0000000000 Binary files a/Buffs/StatBuffs/EvasionScarfBoost.png and /dev/null differ diff --git a/Buffs/StatBuffs/HallowedRuneAtkBuff.cs b/Buffs/StatBuffs/HallowedRuneAtkBuff.cs index cda8a37727..a7dd6475f3 100644 --- a/Buffs/StatBuffs/HallowedRuneAtkBuff.cs +++ b/Buffs/StatBuffs/HallowedRuneAtkBuff.cs @@ -12,7 +12,6 @@ namespace CalamityMod.Buffs.StatBuffs Main.debuff[Type] = false; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; - Main.buffNoTimeDisplay[Type] = true; longerExpertDebuff = false; } diff --git a/Buffs/StatBuffs/HallowedRuneDefBuff.cs b/Buffs/StatBuffs/HallowedRuneDefBuff.cs index 4856abe2bf..22ed3eb7b9 100644 --- a/Buffs/StatBuffs/HallowedRuneDefBuff.cs +++ b/Buffs/StatBuffs/HallowedRuneDefBuff.cs @@ -12,7 +12,6 @@ namespace CalamityMod.Buffs.StatBuffs Main.debuff[Type] = false; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; - Main.buffNoTimeDisplay[Type] = true; longerExpertDebuff = false; } diff --git a/Buffs/StatBuffs/HallowedRuneRegenBuff.cs b/Buffs/StatBuffs/HallowedRuneRegenBuff.cs index c85e46f920..50968cfcde 100644 --- a/Buffs/StatBuffs/HallowedRuneRegenBuff.cs +++ b/Buffs/StatBuffs/HallowedRuneRegenBuff.cs @@ -12,7 +12,6 @@ namespace CalamityMod.Buffs.StatBuffs Main.debuff[Type] = false; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; - Main.buffNoTimeDisplay[Type] = true; longerExpertDebuff = false; } diff --git a/Buffs/StatBuffs/PhantomicArmourBuff.cs b/Buffs/StatBuffs/PhantomicArmourBuff.cs index fae17dd3a1..82e4305808 100644 --- a/Buffs/StatBuffs/PhantomicArmourBuff.cs +++ b/Buffs/StatBuffs/PhantomicArmourBuff.cs @@ -14,7 +14,6 @@ namespace CalamityMod.Buffs.StatBuffs Main.debuff[Type] = false; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; - Main.buffNoTimeDisplay[Type] = true; longerExpertDebuff = false; } diff --git a/Buffs/StatBuffs/PhantomicEmpowermentBuff.cs b/Buffs/StatBuffs/PhantomicEmpowermentBuff.cs index 52ba453934..868a457554 100644 --- a/Buffs/StatBuffs/PhantomicEmpowermentBuff.cs +++ b/Buffs/StatBuffs/PhantomicEmpowermentBuff.cs @@ -13,7 +13,6 @@ namespace CalamityMod.Buffs.StatBuffs Main.debuff[Type] = false; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; - Main.buffNoTimeDisplay[Type] = true; longerExpertDebuff = false; } diff --git a/Buffs/StatBuffs/PhantomicRestorationBuff.cs b/Buffs/StatBuffs/PhantomicRestorationBuff.cs index ace3972774..936c8c7af2 100644 --- a/Buffs/StatBuffs/PhantomicRestorationBuff.cs +++ b/Buffs/StatBuffs/PhantomicRestorationBuff.cs @@ -13,7 +13,6 @@ namespace CalamityMod.Buffs.StatBuffs Main.debuff[Type] = false; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; - Main.buffNoTimeDisplay[Type] = true; longerExpertDebuff = false; } diff --git a/Buffs/StatBuffs/ScarfMeleeBoost.cs b/Buffs/StatBuffs/ScarfMeleeBoost.cs deleted file mode 100644 index 2a769c3254..0000000000 --- a/Buffs/StatBuffs/ScarfMeleeBoost.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs.StatBuffs -{ - public class ScarfMeleeBoost : ModBuff - { - public override void SetDefaults() - { - DisplayName.SetDefault("Scarf Boost"); - Description.SetDefault("10% increased damage, 5% increased crit chance, and 5% increased melee speed"); - Main.debuff[Type] = false; - Main.pvpBuff[Type] = true; - Main.buffNoSave[Type] = true; - longerExpertDebuff = false; - } - - public override void Update(Player player, ref int buffIndex) - { - player.Calamity().sMeleeBoost = true; - } - } -} diff --git a/Buffs/StatBuffs/ScarfMeleeBoost.png b/Buffs/StatBuffs/ScarfMeleeBoost.png deleted file mode 100644 index 60b9c9e6db..0000000000 Binary files a/Buffs/StatBuffs/ScarfMeleeBoost.png and /dev/null differ diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 471890a35d..fa2574d6a7 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -32,6 +32,7 @@ using CalamityMod.NPCs.GreatSandShark; using CalamityMod.NPCs.Leviathan; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.PlaguebringerGoliath; +using CalamityMod.NPCs.PlagueEnemies; using CalamityMod.NPCs.Polterghast; using CalamityMod.NPCs.Providence; using CalamityMod.NPCs.Ravager; @@ -608,7 +609,8 @@ namespace CalamityMod.CalPlayer public int tarraMageHealCooldown = 0; public int tarraCrits = 0; public bool tarraRanged = false; - public bool tarraThrowing = false; + public int tarraRangedCooldown = 0; + public bool tarraThrowing = false; public bool tarragonImmunityCooldown = false; public bool tarragonImmunity = false; public int tarraThrowingCrits = 0; @@ -688,9 +690,10 @@ namespace CalamityMod.CalPlayer public int prismaticLasers = 0; public bool silvaSet = false; public bool silvaMage = false; - public bool silvaSummon = false; + public int silvaMageCooldown = 0; + public bool silvaSummon = false; public bool hasSilvaEffect = false; - public int silvaCountdown = 300; + public int silvaCountdown = 480; public bool auricSet = false; public bool omegaBlueChestplate = false; public bool omegaBlueSet = false; @@ -760,8 +763,6 @@ namespace CalamityMod.CalPlayer public bool xWrath = false; public bool graxDefense = false; public bool encased = false; - public bool sMeleeBoost = false; - public bool eScarfBoost = false; public bool tFury = false; public bool cadence = false; public bool omniscience = false; @@ -1777,8 +1778,6 @@ namespace CalamityMod.CalPlayer xWrath = false; graxDefense = false; encased = false; - sMeleeBoost = false; - eScarfBoost = false; tFury = false; cadence = false; omniscience = false; @@ -2048,8 +2047,10 @@ namespace CalamityMod.CalPlayer gSabatonFall = 0; gSabatonCooldown = 0; astralStarRainCooldown = 0; - bloodflareMageCooldown = 0; - tarraMageHealCooldown = 0; + silvaMageCooldown = 0; + bloodflareMageCooldown = 0; + tarraRangedCooldown = 0; + tarraMageHealCooldown = 0; bossRushImmunityFrameCurseTimer = 0; aBulwarkRareMeleeBoostTimer = 0; acidRoundMultiplier = 1D; @@ -2170,8 +2171,6 @@ namespace CalamityMod.CalPlayer kamiBoost = false; graxDefense = false; encased = false; - sMeleeBoost = false; - eScarfBoost = false; tFury = false; cadence = false; omniscience = false; @@ -2271,7 +2270,7 @@ namespace CalamityMod.CalPlayer silvaMage = false; silvaSummon = false; hasSilvaEffect = false; - silvaCountdown = 300; + silvaCountdown = 480; auricSet = false; omegaBlueChestplate = false; omegaBlueSet = false; @@ -3581,14 +3580,6 @@ namespace CalamityMod.CalPlayer { meleeSpeedMult += 0.1f; } - if (sMeleeBoost) - { - meleeSpeedMult += 0.05f; - } - if (eScarfBoost) - { - meleeSpeedMult += 0.15f; - } if (yPower) { meleeSpeedMult += 0.05f; @@ -4019,15 +4010,9 @@ namespace CalamityMod.CalPlayer private void OnDodge() { if (evasionScarf) - { - player.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(9f)); player.AddBuff(ModContent.BuffType(), player.chaosState ? CalamityUtils.SecondsToFrames(20f) : CalamityUtils.SecondsToFrames(13f)); - } else - { - player.AddBuff(ModContent.BuffType(), 540); player.AddBuff(ModContent.BuffType(), player.chaosState ? 1800 : 900); - } player.immune = true; player.immuneTime = player.longInvince ? 100 : 60; @@ -4261,7 +4246,7 @@ namespace CalamityMod.CalPlayer { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SilvaActivation"), (int)player.position.X, (int)player.position.Y); - player.AddBuff(ModContent.BuffType(), 300); + player.AddBuff(ModContent.BuffType(), 480); if (draconicSurge && !draconicSurgeCooldown) { @@ -4487,24 +4472,6 @@ namespace CalamityMod.CalPlayer } #endregion - #region Use Time Mult - public override float UseTimeMultiplier(Item item) - { - if (auricSet && godSlayerRanged) - { - if (item.ranged && item.useTime > 3) - return 1.05f; - } - if (auricSet && godSlayerThrowing) - { - if (player.statLife > (int)(player.statLifeMax2 * 0.5) && - item.Calamity().rogue && item.useTime > 3) - return 1.05f; - } - return 1f; - } - #endregion - #region Get Heal Life public override void GetHealLife(Item item, bool quickHeal, ref int healValue) { @@ -5179,10 +5146,6 @@ namespace CalamityMod.CalPlayer { #region MultiplierBoosts double damageMult = 1.0; - if (auricSet && godSlayerDamage && item.melee) - { - damageMult += 0.15; - } if (item.melee && item.type != ModContent.ItemType() && item.type != ModContent.ItemType()) { damageMult += trueMeleeDamage; @@ -5310,28 +5273,12 @@ namespace CalamityMod.CalPlayer damageMult += 0.05; } - if (auricSet && godSlayerDamage && isTrueMelee) - damageMult += 0.15; - if (enraged) damageMult += 1.25; - if (silvaCountdown <= 0 && hasSilvaEffect && silvaMage && proj.magic) - damageMult += 0.1; - - if (silvaCountdown <= 0 && hasSilvaEffect && silvaSummon && isSummon) - damageMult += 0.1; - - if (proj.type == ModContent.ProjectileType()) - { - if (target.buffImmune[ModContent.BuffType()]) - damageMult += 0.1; - } - - else if (proj.type == ProjectileID.InfernoFriendlyBlast) - { + if (proj.type == ProjectileID.InfernoFriendlyBlast) damageMult += 0.33; - } + if (brimflameFrenzy && brimflameSet) { if (proj.magic) @@ -7430,7 +7377,7 @@ namespace CalamityMod.CalPlayer player.AddBuff(ModContent.BuffType(), 180); } - if (fBarrier || (sirenBoobs && NPC.downedBoss3)) + if ((fBarrier || (sirenBoobs && NPC.downedBoss3)) && !areThereAnyDamnBosses) { Main.PlaySound(SoundID.Item, (int)player.position.X, (int)player.position.Y, 27); for (int m = 0; m < Main.maxNPCs; m++) @@ -8034,7 +7981,7 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < Main.maxNPCs; i++) { NPC npc = Main.npc[i]; - if (npc.active && !npc.dontTakeDamage && !npc.friendly && npc.immune[player.whoAmI] <= 0) + if (npc.active && !npc.dontTakeDamage && !npc.friendly && npc.Calamity().dashImmunityTime[player.whoAmI] <= 0) { Rectangle rect = npc.getRect(); if (rectangle.Intersects(rect) && (npc.noTileCollide || player.CanHit(npc))) @@ -8066,8 +8013,8 @@ namespace CalamityMod.CalPlayer player.ApplyDamageToNPC(npc, (int)num, num2, direction, crit); Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(135 * player.AverageDamage()), 20f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(90 * player.AverageDamage()), 5f, Main.myPlayer, 0f, 0f); - if (npc.immune[player.whoAmI] < 6) - npc.immune[player.whoAmI] = 6; + if (npc.Calamity().dashImmunityTime[player.whoAmI] < 6) + npc.Calamity().dashImmunityTime[player.whoAmI] = 6; npc.AddBuff(ModContent.BuffType(), 300); bool isImmune = false; for (int j = 0; j < player.hurtCooldowns.Length; j++) @@ -8093,7 +8040,7 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < Main.maxNPCs; i++) { NPC npc = Main.npc[i]; - if (npc.active && !npc.dontTakeDamage && !npc.friendly && npc.immune[player.whoAmI] <= 0) + if (npc.active && !npc.dontTakeDamage && !npc.friendly && npc.Calamity().dashImmunityTime[player.whoAmI] <= 0) { Rectangle rect = npc.getRect(); if (rectangle.Intersects(rect) && (npc.noTileCollide || player.CanHit(npc))) @@ -8125,8 +8072,8 @@ namespace CalamityMod.CalPlayer player.ApplyDamageToNPC(npc, (int)num, num2, direction, crit); Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(120 * player.AverageDamage()), 15f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(80 * player.AverageDamage()), 5f, Main.myPlayer, 0f, 0f); - if (npc.immune[player.whoAmI] < 6) - npc.immune[player.whoAmI] = 6; + if (npc.Calamity().dashImmunityTime[player.whoAmI] < 6) + npc.Calamity().dashImmunityTime[player.whoAmI] = 6; bool isImmune = false; for (int j = 0; j < player.hurtCooldowns.Length; j++) { @@ -8151,7 +8098,7 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < Main.maxNPCs; i++) { NPC npc = Main.npc[i]; - if (npc.active && !npc.dontTakeDamage && !npc.friendly && npc.immune[player.whoAmI] <= 0) + if (npc.active && !npc.dontTakeDamage && !npc.friendly && npc.Calamity().dashImmunityTime[player.whoAmI] <= 0) { Rectangle rect = npc.getRect(); if (rectangle.Intersects(rect) && (npc.noTileCollide || player.CanHit(npc))) @@ -8182,8 +8129,8 @@ namespace CalamityMod.CalPlayer } player.ApplyDamageToNPC(npc, (int)num, num2, direction, crit); Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(60 * player.AverageDamage()), 15f, Main.myPlayer, 0f, 0f); - if (npc.immune[player.whoAmI] < 6) - npc.immune[player.whoAmI] = 6; + if (npc.Calamity().dashImmunityTime[player.whoAmI] < 6) + npc.Calamity().dashImmunityTime[player.whoAmI] = 6; bool isImmune = false; for (int j = 0; j < player.hurtCooldowns.Length; j++) { @@ -8208,7 +8155,7 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < Main.maxNPCs; i++) { NPC npc = Main.npc[i]; - if (npc.active && !npc.dontTakeDamage && !npc.friendly && npc.immune[player.whoAmI] <= 0) + if (npc.active && !npc.dontTakeDamage && !npc.friendly && npc.Calamity().dashImmunityTime[player.whoAmI] <= 0) { Rectangle rect = npc.getRect(); if (rectangle.Intersects(rect) && (npc.noTileCollide || player.CanHit(npc))) @@ -8238,8 +8185,8 @@ namespace CalamityMod.CalPlayer direction = 1; } player.ApplyDamageToNPC(npc, (int)num, num2, direction, crit); - if (npc.immune[player.whoAmI] < 6) - npc.immune[player.whoAmI] = 6; + if (npc.Calamity().dashImmunityTime[player.whoAmI] < 6) + npc.Calamity().dashImmunityTime[player.whoAmI] = 6; npc.AddBuff(ModContent.BuffType(), 60); bool isImmune = false; for (int j = 0; j < player.hurtCooldowns.Length; j++) @@ -8265,7 +8212,7 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < Main.maxNPCs; i++) { NPC npc = Main.npc[i]; - if (npc.active && !npc.dontTakeDamage && !npc.friendly && npc.immune[player.whoAmI] <= 0) + if (npc.active && !npc.dontTakeDamage && !npc.friendly && npc.Calamity().dashImmunityTime[player.whoAmI] <= 0) { Rectangle rect = npc.getRect(); if (rectangle.Intersects(rect) && (npc.noTileCollide || player.CanHit(npc))) @@ -8283,8 +8230,8 @@ namespace CalamityMod.CalPlayer direction = 1; } player.ApplyDamageToNPC(npc, (int)num, num2, direction, crit); - if (npc.immune[player.whoAmI] < 6) - npc.immune[player.whoAmI] = 6; + if (npc.Calamity().dashImmunityTime[player.whoAmI] < 6) + npc.Calamity().dashImmunityTime[player.whoAmI] = 6; npc.AddBuff(ModContent.BuffType(), 300); bool isImmune = false; for (int j = 0; j < player.hurtCooldowns.Length; j++) @@ -8310,7 +8257,7 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < Main.maxNPCs; i++) { NPC npc = Main.npc[i]; - if (npc.active && !npc.dontTakeDamage && !npc.friendly && npc.immune[player.whoAmI] <= 0) + if (npc.active && !npc.dontTakeDamage && !npc.friendly && npc.Calamity().dashImmunityTime[player.whoAmI] <= 0) { Rectangle rect = npc.getRect(); if (rectangle.Intersects(rect) && (npc.noTileCollide || player.CanHit(npc))) @@ -8355,8 +8302,8 @@ namespace CalamityMod.CalPlayer direction = 1; } player.ApplyDamageToNPC(npc, (int)num, num2, direction, crit); - if (npc.immune[player.whoAmI] < 6) - npc.immune[player.whoAmI] = 6; + if (npc.Calamity().dashImmunityTime[player.whoAmI] < 6) + npc.Calamity().dashImmunityTime[player.whoAmI] = 6; npc.AddBuff(ModContent.BuffType(), 600); bool isImmune = false; for (int j = 0; j < player.hurtCooldowns.Length; j++) @@ -9187,7 +9134,7 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < Main.maxNPCs; i++) { NPC nPC = Main.npc[i]; - if (nPC.active && !nPC.dontTakeDamage && !nPC.friendly && nPC.immune[player.whoAmI] == 0) + if (nPC.active && !nPC.dontTakeDamage && !nPC.friendly && nPC.Calamity().dashImmunityTime[player.whoAmI] <= 0) { Rectangle rect = nPC.getRect(); if (myRect.Intersects(rect) && (nPC.noTileCollide || Collision.CanHit(player.position, player.width, player.height, nPC.position, nPC.width, nPC.height))) @@ -9205,7 +9152,7 @@ namespace CalamityMod.CalPlayer { player.ApplyDamageToNPC(nPC, (int)Damage, Knockback, direction, false); } - nPC.immune[player.whoAmI] = NPCImmuneTime; + nPC.Calamity().dashImmunityTime[player.whoAmI] = NPCImmuneTime; bool isImmune = false; for (int j = 0; j < player.hurtCooldowns.Length; j++) { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index cf5e79bb47..e51794a7be 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -23,6 +23,7 @@ using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.Astral; using CalamityMod.NPCs.Crags; using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.NPCs.PlagueEnemies; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Environment; @@ -1105,8 +1106,12 @@ namespace CalamityMod.CalPlayer modPlayer.gSabatonFall--; if (modPlayer.astralStarRainCooldown > 0) modPlayer.astralStarRainCooldown--; + if (modPlayer.tarraRangedCooldown > 0) + modPlayer.tarraRangedCooldown--; if (modPlayer.bloodflareMageCooldown > 0) modPlayer.bloodflareMageCooldown--; + if (modPlayer.silvaMageCooldown > 0) + modPlayer.silvaMageCooldown--; if (modPlayer.tarraMageHealCooldown > 0) modPlayer.tarraMageHealCooldown--; if (modPlayer.featherCrownCooldown > 0) @@ -2477,17 +2482,6 @@ namespace CalamityMod.CalPlayer player.meleeDamage += 0.2f; } - if (modPlayer.eScarfBoost) - { - player.allDamage += 0.1f; - modPlayer.AllCritBoost(10); - } - if (modPlayer.sMeleeBoost) - { - player.allDamage += 0.1f; - modPlayer.AllCritBoost(5); - } - if (modPlayer.tFury) { player.meleeDamage += 0.3f; @@ -3643,8 +3637,8 @@ namespace CalamityMod.CalPlayer modPlayer.GetStatBonuses(); // True melee damage bonuses - double damageAdd = (modPlayer.dodgeScarf ? 0.15 : 0) + - (modPlayer.evasionScarf ? 0.1 : 0) + + double damageAdd = (modPlayer.dodgeScarf ? 0.1 : 0) + + (modPlayer.evasionScarf ? 0.05 : 0) + ((modPlayer.aBulwarkRare && modPlayer.aBulwarkRareMeleeBoostTimer > 0) ? 0.5 : 0) + (modPlayer.fungalSymbiote ? 0.15 : 0) + ((player.head == ArmorIDs.Head.MoltenHelmet && player.body == ArmorIDs.Body.MoltenBreastplate && player.legs == ArmorIDs.Legs.MoltenGreaves) ? 0.2 : 0) + diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 8a7635bdce..2862148680 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -242,21 +242,12 @@ namespace CalamityMod.CalPlayer } } } - if (modPlayer.tarraRanged && Main.rand.Next(0, 100) >= 88 && player.ownedProjectileCounts[ProjectileType()] < 5 && (proj.timeLeft <= 2 || proj.penetrate <= 1)) - { - int projAmt = Main.rand.Next(2, 4); - for (int projCount = 0; projCount < projAmt; projCount++) - { - Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - Projectile.NewProjectile(proj.Center, velocity, ProjectileType(), CalamityUtils.DamageSoftCap(proj.damage * 0.33, 65), 0f, proj.owner); - } - } if (npcCheck) { - if (modPlayer.tarraRanged && crit && proj.ranged) + if (modPlayer.tarraRanged && proj.ranged && modPlayer.tarraRangedCooldown <= 0) { - int leafAmt = Main.rand.Next(2, 4); - for (int l = 0; l < leafAmt; l++) + modPlayer.tarraRangedCooldown = 60; + for (int l = 0; l < 2; l++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); int FUCKYOU = Projectile.NewProjectile(position, velocity, ProjectileID.Leaf, CalamityUtils.DamageSoftCap(proj.damage * 0.25, 60), 0f, player.whoAmI); @@ -266,7 +257,15 @@ namespace CalamityMod.CalPlayer Main.projectile[FUCKYOU].netUpdate = true; } } - } + if (player.ownedProjectileCounts[ProjectileType()] < 2) + { + for (int projCount = 0; projCount < 2; projCount++) + { + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(proj.Center, velocity, ProjectileType(), CalamityUtils.DamageSoftCap(proj.damage * 0.33, 65), 0f, proj.owner); + } + } + } if (proj.type == ProjectileType()) { modPlayer.polarisBoostCounter += 1; @@ -306,8 +305,9 @@ namespace CalamityMod.CalPlayer } } } - if (modPlayer.silvaMage && proj.penetrate == 1 && Main.rand.Next(0, 100) >= 97) + if (modPlayer.silvaMage && modPlayer.silvaMageCooldown <= 0 && (proj.penetrate == 1 || proj.timeLeft <= 5)) { + modPlayer.silvaMageCooldown = 300; Main.PlaySound(SoundID.Zombie, (int)proj.position.X, (int)proj.position.Y, 103); CalamityGlobalProjectile.ExpandHitboxBy(proj, 96); for (int d = 0; d < 3; d++) @@ -327,6 +327,7 @@ namespace CalamityMod.CalPlayer proj.localNPCHitCooldown = 10; proj.usesLocalNPCImmunity = true; proj.Damage(); + proj.Kill(); } } #endregion diff --git a/CalamityLists.cs b/CalamityLists.cs index 7f20cdfeec..3ee41bc8d8 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -23,6 +23,7 @@ using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.Abyss; +using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.AquaticScourge; using CalamityMod.NPCs.Astral; using CalamityMod.NPCs.AstrumAureus; @@ -44,6 +45,7 @@ using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.OldDuke; using CalamityMod.NPCs.Perforator; using CalamityMod.NPCs.PlaguebringerGoliath; +using CalamityMod.NPCs.PlagueEnemies; using CalamityMod.NPCs.Providence; using CalamityMod.NPCs.Ravager; using CalamityMod.NPCs.Signus; @@ -311,11 +313,8 @@ namespace CalamityMod ProjectileID.MushroomSpear, ProjectileID.Gungnir, ProjectileID.ObsidianSwordfish, - ProjectileID.ChlorophytePartisan, ProjectileID.MonkStaffT1, ProjectileID.MonkStaffT2, - ProjectileID.MonkStaffT3, - ProjectileID.NorthPoleWeapon, // Tools ProjectileID.CobaltDrill, @@ -349,28 +348,14 @@ namespace CalamityMod ProjectileType(), ProjectileType(), ProjectileType(), - ProjectileType(), ProjectileType(), - ProjectileType(), ProjectileType(), ProjectileType(), - ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), ProjectileType(), - ProjectileType(), ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType() @@ -494,6 +479,8 @@ namespace CalamityMod NPCID.SkeletronHand, NPCID.WallofFlesh, NPCID.WallofFleshEye, + NPCID.PirateShipCannon, + NPCID.Probe, NPCID.Retinazer, NPCID.Spazmatism, NPCID.SkeletronPrime, @@ -502,7 +489,11 @@ namespace CalamityMod NPCID.PrimeLaser, NPCID.PrimeVice, NPCID.Plantera, + NPCID.PlanterasTentacle, + NPCID.Everscream, + NPCID.SantaNK1, NPCID.IceQueen, + NPCID.MourningWood, NPCID.Pumpking, NPCID.Mothron, NPCID.Golem, @@ -510,12 +501,21 @@ namespace CalamityMod NPCID.GolemHeadFree, NPCID.GolemFistRight, NPCID.GolemFistLeft, - NPCID.GolemHeadFree, + NPCID.MartianSaucerCore, + NPCID.MartianSaucerCannon, + NPCID.MartianSaucerTurret, NPCID.DukeFishron, NPCID.Sharkron, NPCID.Sharkron2, NPCID.CultistBoss, - NPCID.MoonLordHead, + NPCID.CultistDragonHead, + NPCID.CultistDragonBody1, + NPCID.CultistDragonBody2, + NPCID.CultistDragonBody3, + NPCID.CultistDragonBody4, + NPCID.CultistDragonTail, + NPCID.AncientCultistSquidhead, + NPCID.MoonLordHead, NPCID.MoonLordHand, NPCID.MoonLordCore, NPCID.MoonLordFreeEye, @@ -554,8 +554,47 @@ namespace CalamityMod NPCType(), NPCType(), NPCType(), - NPCType() - }; + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType() + }; confusionEnemyList = new List() { @@ -1269,7 +1308,8 @@ namespace CalamityMod sixtySixDamageBuffList = new List() { - ItemID.TrueNightsEdge, + ItemID.PulseBow, + ItemID.TrueNightsEdge, ItemID.MedusaHead, ItemID.StaffofEarth, ItemID.ChristmasTreeSword, @@ -1281,11 +1321,12 @@ namespace CalamityMod fiftyDamageBuffList = new List() { - ItemID.EldMelter, + ItemID.IceBow, + ItemID.Marrow, + ItemID.EldMelter, ItemID.Flamethrower, ItemID.MoonlordTurretStaff, ItemID.WaspGun, - ItemID.PulseBow, ItemID.PaladinsHammer, ItemID.SolarEruption, ItemID.DayBreak, @@ -1303,8 +1344,6 @@ namespace CalamityMod thirtyThreeDamageBuffList = new List() { ItemID.WandofSparking, - ItemID.IceBow, - ItemID.Marrow, ItemID.CrystalVileShard, ItemID.SoulDrain, ItemID.ClingerStaff, @@ -1341,6 +1380,52 @@ namespace CalamityMod tenDamageBuffList = new List() { + ItemID.WoodenArrow, + ItemID.FlamingArrow, + ItemID.UnholyArrow, + ItemID.JestersArrow, + ItemID.HellfireArrow, + ItemID.HolyArrow, + ItemID.CursedArrow, + ItemID.FrostburnArrow, + ItemID.ChlorophyteArrow, + ItemID.IchorArrow, + ItemID.VenomArrow, + ItemID.BoneArrow, + ItemID.EndlessQuiver, + ItemID.MoonlordArrow, + ItemID.DD2BetsyBow, + ItemID.BorealWoodBow, + ItemID.CopperBow, + ItemID.DemonBow, + ItemID.EbonwoodBow, + ItemID.GoldBow, + ItemID.HellwingBow, + ItemID.IronBow, + ItemID.LeadBow, + ItemID.MoltenFury, + ItemID.PalmWoodBow, + ItemID.PearlwoodBow, + ItemID.DD2PhoenixBow, + ItemID.PlatinumBow, + ItemID.RichMahoganyBow, + ItemID.ShadewoodBow, + ItemID.ShadowFlameBow, + ItemID.SilverBow, + ItemID.TendonBow, + ItemID.BeesKnees, + ItemID.TinBow, + ItemID.Tsunami, + ItemID.TungstenBow, + ItemID.WoodenBow, + ItemID.AdamantiteRepeater, + ItemID.ChlorophyteShotbow, + ItemID.CobaltRepeater, + ItemID.HallowedRepeater, + ItemID.MythrilRepeater, + ItemID.OrichalcumRepeater, + ItemID.PalladiumRepeater, + ItemID.TitaniumRepeater, ItemID.MagnetSphere, ItemID.BatScepter, ItemID.ElectrosphereLauncher @@ -1438,8 +1523,8 @@ namespace CalamityMod tenDamageNerfList = new List() { - ItemID.Phantasm, - ItemID.StarWrath + ItemID.DaedalusStormbow, + ItemID.StarWrath }; quarterDamageNerfList = new List() @@ -1447,7 +1532,6 @@ namespace CalamityMod ItemID.LastPrism, ItemID.DemonScythe, ItemID.Razorpine, - ItemID.DaedalusStormbow, ItemID.PhoenixBlaster, ItemID.InfluxWaver, ItemID.Xenopopper, diff --git a/ExtraTextures/ThanatosVentParticle.png b/ExtraTextures/ThanatosVentParticle.png new file mode 100644 index 0000000000..a66a5aa743 Binary files /dev/null and b/ExtraTextures/ThanatosVentParticle.png differ diff --git a/Gores/Thanatos/ThanatosVentParticle1.png b/Gores/Thanatos/ThanatosVentParticle1.png deleted file mode 100644 index ec84d9232c..0000000000 Binary files a/Gores/Thanatos/ThanatosVentParticle1.png and /dev/null differ diff --git a/Gores/Thanatos/ThanatosVentParticle2.png b/Gores/Thanatos/ThanatosVentParticle2.png deleted file mode 100644 index 50a693e93e..0000000000 Binary files a/Gores/Thanatos/ThanatosVentParticle2.png and /dev/null differ diff --git a/Gores/Thanatos/ThanatosVentParticle3.png b/Gores/Thanatos/ThanatosVentParticle3.png deleted file mode 100644 index 221e95e948..0000000000 Binary files a/Gores/Thanatos/ThanatosVentParticle3.png and /dev/null differ diff --git a/Items/Accessories/ArcanumoftheVoid.cs b/Items/Accessories/ArcanumoftheVoid.cs index fa9cf06b77..3935938937 100644 --- a/Items/Accessories/ArcanumoftheVoid.cs +++ b/Items/Accessories/ArcanumoftheVoid.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Items.Accessories item.value = CalamityGlobalItem.Rarity12BuyPrice; item.rare = ItemRarityID.Purple; item.Calamity().customRarity = CalamityRarity.Turquoise; - item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/CounterScarf.cs b/Items/Accessories/CounterScarf.cs index 18080d81f2..8130cd6267 100644 --- a/Items/Accessories/CounterScarf.cs +++ b/Items/Accessories/CounterScarf.cs @@ -11,9 +11,8 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Counter Scarf"); - Tooltip.SetDefault("True melee strikes deal 15% more damage\n" + + Tooltip.SetDefault("True melee strikes deal 10% more damage\n" + "Grants the ability to dash; dashing into an attack will cause you to dodge it\n" + - "After a dodge you will be granted a buff to all damage, melee speed, and all crit chance for a short time\n" + "After a successful dodge you must wait 15 seconds before you can dodge again\n" + "This cooldown will be twice as long if you have Chaos State\n" + "While on cooldown, Chaos State will last twice as long"); diff --git a/Items/Accessories/EldritchSoulArtifact.cs b/Items/Accessories/EldritchSoulArtifact.cs index 895edb0f2e..23e67b95ab 100644 --- a/Items/Accessories/EldritchSoulArtifact.cs +++ b/Items/Accessories/EldritchSoulArtifact.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Items.Accessories public override void SetDefaults() { - item.width = 28; - item.height = 28; + item.width = 64; + item.height = 58; item.accessory = true; item.value = CalamityGlobalItem.Rarity11BuyPrice; item.rare = ItemRarityID.Purple; diff --git a/Items/Accessories/EldritchSoulArtifact.png b/Items/Accessories/EldritchSoulArtifact.png index 0fc8022c9d..c872eb32d5 100644 Binary files a/Items/Accessories/EldritchSoulArtifact.png and b/Items/Accessories/EldritchSoulArtifact.png differ diff --git a/Items/Accessories/EvasionScarf.cs b/Items/Accessories/EvasionScarf.cs index fbebe616b3..c6a06dc16d 100644 --- a/Items/Accessories/EvasionScarf.cs +++ b/Items/Accessories/EvasionScarf.cs @@ -11,9 +11,8 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Evasion Scarf"); - Tooltip.SetDefault("True melee strikes deal 25% more damage\n" + + Tooltip.SetDefault("True melee strikes deal 15% more damage\n" + "Grants the ability to dash; dashing into an attack will cause you to dodge it\n" + - "After a dodge you will be granted a buff to all damage, melee speed, and all crit chance for a short time\n" + "After a successful dodge you must wait 13 seconds before you can dodge again\n" + "This cooldown will be 50 percent longer if you have Chaos State\n" + "While on cooldown, Chaos State will be 50 percent longer"); diff --git a/Items/Accessories/FrigidBulwark.cs b/Items/Accessories/FrigidBulwark.cs index b0fbdce54f..5fb817fe84 100644 --- a/Items/Accessories/FrigidBulwark.cs +++ b/Items/Accessories/FrigidBulwark.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Accessories public override void SetDefaults() { - item.width = 38; - item.height = 44; + item.width = 34; + item.height = 40; item.value = CalamityGlobalItem.Rarity7BuyPrice; item.rare = ItemRarityID.Lime; item.defense = 8; diff --git a/Items/Accessories/FrigidBulwark.png b/Items/Accessories/FrigidBulwark.png index 63f44d9187..a4c3edc11b 100644 Binary files a/Items/Accessories/FrigidBulwark.png and b/Items/Accessories/FrigidBulwark.png differ diff --git a/Items/Accessories/GiantShell.cs b/Items/Accessories/GiantShell.cs index dc7e4c31c8..6fa7e98690 100644 --- a/Items/Accessories/GiantShell.cs +++ b/Items/Accessories/GiantShell.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Items.Accessories public override void SetDefaults() { item.defense = 6; - item.width = 20; - item.height = 24; + item.width = 30; + item.height = 28; item.value = CalamityGlobalItem.Rarity1BuyPrice; item.rare = ItemRarityID.Blue; item.accessory = true; diff --git a/Items/Accessories/GiantShell.png b/Items/Accessories/GiantShell.png index b5efb638cd..1e3e44ac38 100644 Binary files a/Items/Accessories/GiantShell.png and b/Items/Accessories/GiantShell.png differ diff --git a/Items/Accessories/GravistarSabaton.cs b/Items/Accessories/GravistarSabaton.cs index b7ea4a4afe..5d72a08f37 100644 --- a/Items/Accessories/GravistarSabaton.cs +++ b/Items/Accessories/GravistarSabaton.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories { DisplayName.SetDefault("Gravistar Sabaton"); Tooltip.SetDefault("Tap the DOWN key to increase your fall speed for 5 seconds\n" + - "This has a 8 second cooldown\n" + + "This has an 8 second cooldown\n" + "Striking the ground with increased fall speed will cause an astral explosion"); } diff --git a/Items/Accessories/RampartofDeities.cs b/Items/Accessories/RampartofDeities.cs index d9d0b4fc39..1f522c8728 100644 --- a/Items/Accessories/RampartofDeities.cs +++ b/Items/Accessories/RampartofDeities.cs @@ -8,6 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { + [AutoloadEquip(EquipType.Shield)] public class RampartofDeities : ModItem { public override void SetStaticDefaults() @@ -26,8 +27,8 @@ namespace CalamityMod.Items.Accessories public override void SetDefaults() { - item.width = 38; - item.height = 44; + item.width = 64; + item.height = 62; item.value = CalamityGlobalItem.Rarity14BuyPrice; item.defense = 12; item.accessory = true; diff --git a/Items/Accessories/RampartofDeities.png b/Items/Accessories/RampartofDeities.png index 115623e6c8..a9edc4ae64 100644 Binary files a/Items/Accessories/RampartofDeities.png and b/Items/Accessories/RampartofDeities.png differ diff --git a/Items/Accessories/RampartofDeities_Shield.png b/Items/Accessories/RampartofDeities_Shield.png new file mode 100644 index 0000000000..9c9359a5e7 Binary files /dev/null and b/Items/Accessories/RampartofDeities_Shield.png differ diff --git a/Items/Ammo/ArcticArrow.cs b/Items/Ammo/ArcticArrow.cs index 6c58499897..04a923661c 100644 --- a/Items/Ammo/ArcticArrow.cs +++ b/Items/Ammo/ArcticArrow.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Ammo public override void SetDefaults() { - item.damage = 16; + item.damage = 18; item.ranged = true; item.width = 22; item.height = 36; diff --git a/Items/Ammo/BloodfireArrow.cs b/Items/Ammo/BloodfireArrow.cs index 5691cc88d9..303fb49dda 100644 --- a/Items/Ammo/BloodfireArrow.cs +++ b/Items/Ammo/BloodfireArrow.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Ammo public override void SetDefaults() { - item.damage = 26; + item.damage = 29; item.ranged = true; item.width = 14; item.height = 36; diff --git a/Items/Ammo/ElysianArrow.cs b/Items/Ammo/ElysianArrow.cs index f78dee1983..cf2930ecdb 100644 --- a/Items/Ammo/ElysianArrow.cs +++ b/Items/Ammo/ElysianArrow.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Ammo public override void SetDefaults() { - item.damage = 18; + item.damage = 20; item.ranged = true; item.width = 22; item.height = 36; diff --git a/Items/Ammo/IcicleArrow.cs b/Items/Ammo/IcicleArrow.cs index 1373462cb4..ac17b39ed5 100644 --- a/Items/Ammo/IcicleArrow.cs +++ b/Items/Ammo/IcicleArrow.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Ammo public override void SetDefaults() { - item.damage = 14; + item.damage = 15; item.ranged = true; item.consumable = true; item.width = 18; diff --git a/Items/Ammo/NapalmArrow.cs b/Items/Ammo/NapalmArrow.cs index a8fb3b28e6..032e8f60f5 100644 --- a/Items/Ammo/NapalmArrow.cs +++ b/Items/Ammo/NapalmArrow.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Ammo public override void SetDefaults() { - item.damage = 13; + item.damage = 14; item.ranged = true; item.width = 22; item.height = 36; diff --git a/Items/Ammo/TerraArrow.cs b/Items/Ammo/TerraArrow.cs index 8d50387403..12da4f9279 100644 --- a/Items/Ammo/TerraArrow.cs +++ b/Items/Ammo/TerraArrow.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Ammo public override void SetDefaults() { - item.damage = 14; + item.damage = 15; item.ranged = true; item.width = 22; item.height = 36; diff --git a/Items/Ammo/VanquisherArrow.cs b/Items/Ammo/VanquisherArrow.cs index 448e0a2f8a..c3a3efd966 100644 --- a/Items/Ammo/VanquisherArrow.cs +++ b/Items/Ammo/VanquisherArrow.cs @@ -2,7 +2,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -19,7 +18,7 @@ namespace CalamityMod.Items.Ammo public override void SetDefaults() { - item.damage = 22; + item.damage = 24; item.ranged = true; item.width = 22; item.height = 46; diff --git a/Items/Armor/AuricTeslaHelm.cs b/Items/Armor/AuricTeslaHelm.cs index 8a31de43d9..de05c1cd72 100644 --- a/Items/Armor/AuricTeslaHelm.cs +++ b/Items/Armor/AuricTeslaHelm.cs @@ -41,8 +41,7 @@ namespace CalamityMod.Items.Armor player.setBonus = "Melee Tarragon, Bloodflare and God Slayer effects\n" + "Enemies are more likely to target you\n" + "All projectiles spawn healing auric orbs on enemy hits\n" + - "Max run speed and acceleration boosted by 10%\n" + - "Your melee damage is multiplied based on how high your HP is; at full HP this effect is at max"; + "Max run speed and acceleration boosted by 10%"; CalamityPlayer modPlayer = player.Calamity(); modPlayer.tarraSet = true; modPlayer.tarraMelee = true; diff --git a/Items/Armor/AuricTeslaPlumedHelm.cs b/Items/Armor/AuricTeslaPlumedHelm.cs index 025e00b689..0975186372 100644 --- a/Items/Armor/AuricTeslaPlumedHelm.cs +++ b/Items/Armor/AuricTeslaPlumedHelm.cs @@ -41,7 +41,6 @@ namespace CalamityMod.Items.Armor player.setBonus = "Rogue Tarragon, Bloodflare and God Slayer armor effects\n" + "All projectiles spawn healing auric orbs on enemy hits\n" + "Max run speed and acceleration boosted by 10%\n" + - "Rogue weapon critical strikes will do 1.25 times damage while you are above 50% HP\n" + "Rogue stealth builds while not attacking and slower while moving, up to a max of 130\n" + "Once you have built max stealth, you will be able to perform a Stealth Strike\n" + "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + diff --git a/Items/Armor/SilvaHelmet.cs b/Items/Armor/SilvaHelmet.cs index 708b6c4bbe..9f318c27bc 100644 --- a/Items/Armor/SilvaHelmet.cs +++ b/Items/Armor/SilvaHelmet.cs @@ -45,10 +45,9 @@ namespace CalamityMod.Items.Armor player.setBonus = "75% increased minion damage and +5 max minions\n" + "All projectiles spawn healing leaf orbs on enemy hits\n" + "Max run speed and acceleration boosted by 5%\n" + - "If you are reduced to 1 HP you will not die from any further damage for 5 seconds\n" + + "If you are reduced to 1 HP you will not die from any further damage for 8 seconds\n" + "This effect only triggers once per life\n" + - "Summons an ancient leaf prism to blast your enemies with life energy\n" + - "After the silva invulnerability time your minions will deal 10% more damage"; + "Summons an ancient leaf prism to blast your enemies with life energy"; if (player.whoAmI == Main.myPlayer) { if (player.FindBuffIndex(ModContent.BuffType()) == -1) diff --git a/Items/Armor/SilvaMaskedCap.cs b/Items/Armor/SilvaMaskedCap.cs index fdd5a3f827..536bc0e960 100644 --- a/Items/Armor/SilvaMaskedCap.cs +++ b/Items/Armor/SilvaMaskedCap.cs @@ -44,10 +44,9 @@ namespace CalamityMod.Items.Armor modPlayer.silvaMage = true; player.setBonus = "All projectiles spawn healing leaf orbs on enemy hits\n" + "Max run speed and acceleration boosted by 5%\n" + - "If you are reduced to 1 HP you will not die from any further damage for 5 seconds\n" + + "If you are reduced to 1 HP you will not die from any further damage for 8 seconds\n" + "This effect only triggers once per life\n" + - "Magic projectiles have a 10% chance to cause a massive explosion on enemy hits\n" + - "After the silva invulnerability time your magic weapons will do 10% more damage"; + "Magic projectiles have a 10% chance to cause a massive explosion on enemy hits"; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/TarragonVisage.cs b/Items/Armor/TarragonVisage.cs index acf2a59ff7..f236ffe489 100644 --- a/Items/Armor/TarragonVisage.cs +++ b/Items/Armor/TarragonVisage.cs @@ -63,8 +63,7 @@ namespace CalamityMod.Items.Armor player.setBonus = "Reduces enemy spawn rates\n" + "Increased heart pickup range\n" + "Enemies have a chance to drop extra hearts on death\n" + - "Ranged critical strikes will cause an explosion of leaves\n" + - "Ranged projectiles have a chance to split into life energy on death by hitting an enemy"; + "Ranged projectiles split into homing life energy and leaves on death"; } public override void UpdateEquip(Player player) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 3c92764d68..ce34cce89d 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -215,6 +215,8 @@ namespace CalamityMod.Items } if (item.type == ItemID.StarCannon) item.UseSound = null; + if (item.type == ItemID.CelestialSigil) + item.consumable = false; } #endregion @@ -810,7 +812,15 @@ namespace CalamityMod.Items #region Modify Weapon Damage public override void ModifyWeaponDamage(Item item, Player player, ref float add, ref float mult, ref float flat) { - if (item.type < ItemID.Count) + // Nerf yoyo glove and bag because it's bad and stupid and dumb and bad. + if (player.yoyoGlove && ItemID.Sets.Yoyo[item.type]) + mult *= 0.66f; + + // Nerf archery potion damage buff from 1.2x to 1.05x. + if (item.useAmmo == AmmoID.Arrow && player.archery) + mult *= 0.875f; + + if (item.type < ItemID.Count) return; // Summon weapons specifically do not have their damage affected by charge. They still require charge to function however. diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 2594d33f8d..fe9dbd8078 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Items { // Apply standard post-ML rarities to the item's color first. Color? standardRarityColor = CalamityUtils.GetRarityColor(customRarity); - if (standardRarityColor.HasValue) + if (!item.expert && standardRarityColor.HasValue) nameLine.overrideColor = standardRarityColor.Value; #region Uniquely Colored Developer Items @@ -293,6 +293,10 @@ namespace CalamityMod.Items EditTooltipByNum(0, (line) => line.text += immunityLine); } + // Nerfed Archery Potion tooltip + if (item.type == ItemID.ArcheryPotion) + EditTooltipByNum(0, (line) => line.text = "20% increased arrow speed and 1.05x arrow damage"); + // Hand Warmer provides Death Mode cold protection and has a side bonus with Eskimo armor if (item.type == ItemID.HandWarmer) { @@ -323,7 +327,7 @@ namespace CalamityMod.Items // Black Belt and Master Ninja Gear have guaranteed dodges on a 60 second cooldown. #region Dodging Belt Tooltips string beltDodgeLine = "Grants the ability to dodge attacks\n" + - $"The dodge has a {CalamityPlayer.BeltDodgeCooldown} second cooldown which is shared with all other dodges and reflects"; + $"The dodge has a {CalamityPlayer.BeltDodgeCooldown / 60} second cooldown which is shared with all other dodges and reflects"; if (item.type == ItemID.BlackBelt) EditTooltipByNum(0, (line) => line.text = beltDodgeLine); if (item.type == ItemID.MasterNinjaGear) diff --git a/Items/Materials/BloodSample.cs b/Items/Materials/BloodSample.cs index 01b9f526d8..b8e413188f 100644 --- a/Items/Materials/BloodSample.cs +++ b/Items/Materials/BloodSample.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Items.Materials public override void SetDefaults() { - item.width = 16; - item.height = 22; + item.width = 26; + item.height = 34; item.maxStack = 999; item.value = Item.buyPrice(0, 0, 50, 0); item.rare = ItemRarityID.Green; diff --git a/Items/Materials/BloodSample.png b/Items/Materials/BloodSample.png index 52a28ee266..421a652516 100644 Binary files a/Items/Materials/BloodSample.png and b/Items/Materials/BloodSample.png differ diff --git a/Items/Materials/RuinousSoul.cs b/Items/Materials/RuinousSoul.cs index 2f7606bafe..e5c7030d4a 100644 --- a/Items/Materials/RuinousSoul.cs +++ b/Items/Materials/RuinousSoul.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.DataStructures; using Terraria.ModLoader; namespace CalamityMod.Items.Materials @@ -9,12 +10,13 @@ namespace CalamityMod.Items.Materials { DisplayName.SetDefault("Ruinous Soul"); Tooltip.SetDefault("A shard of the distant past"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); } public override void SetDefaults() { - item.width = 20; - item.height = 20; + item.width = 26; + item.height = 42; item.maxStack = 999; item.value = Item.buyPrice(0, 7, 0, 0); item.Calamity().customRarity = CalamityRarity.PureGreen; diff --git a/Items/Materials/RuinousSoul.png b/Items/Materials/RuinousSoul.png index 04dec2f3de..2f4f6d2463 100644 Binary files a/Items/Materials/RuinousSoul.png and b/Items/Materials/RuinousSoul.png differ diff --git a/Items/Materials/StormlionMandible.cs b/Items/Materials/StormlionMandible.cs index 99fd67a72f..45f3b367fd 100644 --- a/Items/Materials/StormlionMandible.cs +++ b/Items/Materials/StormlionMandible.cs @@ -10,13 +10,13 @@ namespace CalamityMod.Items.Materials public override void SetStaticDefaults() { DisplayName.SetDefault("Stormlion Mandible"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 8)); } public override void SetDefaults() { - item.width = 12; - item.height = 24; + item.width = 36; + item.height = 38; item.maxStack = 999; item.value = Item.sellPrice(silver: 1, copper: 40); item.rare = ItemRarityID.Blue; diff --git a/Items/Materials/StormlionMandible.png b/Items/Materials/StormlionMandible.png index 6a5f91d07d..4a248d6291 100644 Binary files a/Items/Materials/StormlionMandible.png and b/Items/Materials/StormlionMandible.png differ diff --git a/Items/SummonItems/Seafood.cs b/Items/SummonItems/Seafood.cs index 0af68efd6d..2e33f85676 100644 --- a/Items/SummonItems/Seafood.cs +++ b/Items/SummonItems/Seafood.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Items.SummonItems public override void SetDefaults() { - item.width = 28; - item.height = 28; + item.width = 26; + item.height = 24; item.maxStack = 20; item.rare = ItemRarityID.Pink; item.useAnimation = 45; diff --git a/Items/SummonItems/Seafood.png b/Items/SummonItems/Seafood.png index d8b63605d4..49a953c5e8 100644 Binary files a/Items/SummonItems/Seafood.png and b/Items/SummonItems/Seafood.png differ diff --git a/Items/Tools/BobbitHook.cs b/Items/Tools/BobbitHook.cs index f9c834c700..904c086a72 100644 --- a/Items/Tools/BobbitHook.cs +++ b/Items/Tools/BobbitHook.cs @@ -1,9 +1,10 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -using static Terraria.ModLoader.ModContent; using CalamityMod.Projectiles.Typeless; +using static Terraria.ModLoader.ModContent; + namespace CalamityMod.Items.Tools { public class BobbitHook : ModItem @@ -11,17 +12,18 @@ namespace CalamityMod.Items.Tools public override void SetStaticDefaults() { DisplayName.SetDefault("Bobbit Hook"); - Tooltip.SetDefault(@"Retracts upon attaching to a tile with extreme speeds -Reach: 40 -Launch Velocity: 25 -Pull Velocity: 28"); + Tooltip.SetDefault($@"Retracts upon attaching to a tile with extreme speeds +Reach: {BobbitHead.GrappleRangInTiles} +Launch Velocity: {BobbitHead.LaunchSpeed} +Reelback Velocity: {BobbitHead.ReelbackSpeed} +Pull Velocity: {BobbitHead.PullSpeed}"); } public override void SetDefaults() { // Instead of copying these values, we can clone and modify the ones we want to copy item.CloneDefaults(ItemID.AmethystHook); - item.shootSpeed = 25f; // how quickly the hook is shot. + item.shootSpeed = BobbitHead.LaunchSpeed; // How quickly the hook is shot. item.shoot = ProjectileType(); item.value = Item.buyPrice(1, 40, 0, 0); item.rare = ItemRarityID.Red; diff --git a/Items/Tools/PurityAxe.cs b/Items/Tools/PurityAxe.cs index 133b52367d..5bf188a4ab 100644 --- a/Items/Tools/PurityAxe.cs +++ b/Items/Tools/PurityAxe.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Tools item.damage = 43; item.melee = true; item.width = 58; - item.height = 46; + item.height = 54; item.useTime = 19; item.useAnimation = 19; item.useTurn = true; diff --git a/Items/Tools/PurityAxe.png b/Items/Tools/PurityAxe.png index 75b68ffd8d..7a4a9bd655 100644 Binary files a/Items/Tools/PurityAxe.png and b/Items/Tools/PurityAxe.png differ diff --git a/Items/Weapons/Melee/DragonRage.cs b/Items/Weapons/Melee/DragonRage.cs index 115134a6c8..e6670e844a 100644 --- a/Items/Weapons/Melee/DragonRage.cs +++ b/Items/Weapons/Melee/DragonRage.cs @@ -27,8 +27,8 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 14f; item.shoot = ModContent.ProjectileType(); - item.width = 68; - item.height = 82; + item.width = 128; + item.height = 140; item.noUseGraphic = true; item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.DD2_SkyDragonsFurySwing; diff --git a/Items/Weapons/Melee/DragonRage.png b/Items/Weapons/Melee/DragonRage.png index ca3c08ba59..4dada2773a 100644 Binary files a/Items/Weapons/Melee/DragonRage.png and b/Items/Weapons/Melee/DragonRage.png differ diff --git a/Items/Weapons/Melee/Terratomere.cs b/Items/Weapons/Melee/Terratomere.cs index 3aaf0a99a3..d06acaa6a6 100644 --- a/Items/Weapons/Melee/Terratomere.cs +++ b/Items/Weapons/Melee/Terratomere.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 64; - item.damage = 160; + item.damage = 260; item.melee = true; item.useAnimation = 21; item.useStyle = ItemUseStyleID.SwingThrow; diff --git a/Items/Weapons/Ranged/Alluvion.cs b/Items/Weapons/Ranged/Alluvion.cs index 0a795ae9c0..a04e4965b7 100644 --- a/Items/Weapons/Ranged/Alluvion.cs +++ b/Items/Weapons/Ranged/Alluvion.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 150; + item.damage = 165; item.ranged = true; item.width = 60; item.height = 90; diff --git a/Items/Weapons/Ranged/Arbalest.cs b/Items/Weapons/Ranged/Arbalest.cs index 84e4d61ad4..7cb7a5f98d 100644 --- a/Items/Weapons/Ranged/Arbalest.cs +++ b/Items/Weapons/Ranged/Arbalest.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 32; + item.damage = 36; item.ranged = true; item.width = 82; item.height = 34; diff --git a/Items/Weapons/Ranged/ArterialAssault.cs b/Items/Weapons/Ranged/ArterialAssault.cs index 0ad0be634b..2540705c3e 100644 --- a/Items/Weapons/Ranged/ArterialAssault.cs +++ b/Items/Weapons/Ranged/ArterialAssault.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 116; + item.damage = 128; item.ranged = true; item.width = 44; item.height = 100; diff --git a/Items/Weapons/Ranged/AstralRepeater.cs b/Items/Weapons/Ranged/AstralRepeater.cs index e321180af6..43525a57a8 100644 --- a/Items/Weapons/Ranged/AstralRepeater.cs +++ b/Items/Weapons/Ranged/AstralRepeater.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 90; + item.damage = 99; item.ranged = true; item.width = 38; item.height = 78; diff --git a/Items/Weapons/Ranged/AstrealDefeat.cs b/Items/Weapons/Ranged/AstrealDefeat.cs index 5cf4379c51..5dd3378fd9 100644 --- a/Items/Weapons/Ranged/AstrealDefeat.cs +++ b/Items/Weapons/Ranged/AstrealDefeat.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 139; + item.damage = 153; item.ranged = true; item.width = 40; item.height = 78; diff --git a/Items/Weapons/Ranged/Barinade.cs b/Items/Weapons/Ranged/Barinade.cs index f98abee769..df949f4a2a 100644 --- a/Items/Weapons/Ranged/Barinade.cs +++ b/Items/Weapons/Ranged/Barinade.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 8; + item.damage = 9; item.ranged = true; item.width = 30; item.height = 44; diff --git a/Items/Weapons/Ranged/Barinautical.cs b/Items/Weapons/Ranged/Barinautical.cs index 6b03d405bc..5497dd59bb 100644 --- a/Items/Weapons/Ranged/Barinautical.cs +++ b/Items/Weapons/Ranged/Barinautical.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 25; + item.damage = 28; item.ranged = true; item.width = 30; item.height = 42; diff --git a/Items/Weapons/Ranged/BladedgeGreatbow.cs b/Items/Weapons/Ranged/BladedgeGreatbow.cs index 545d583223..835e63e05b 100644 --- a/Items/Weapons/Ranged/BladedgeGreatbow.cs +++ b/Items/Weapons/Ranged/BladedgeGreatbow.cs @@ -12,12 +12,12 @@ namespace CalamityMod.Items.Weapons.Ranged { DisplayName.SetDefault("Bladedge Railbow"); Tooltip.SetDefault("Fires 4 arrows at once\n" + - "Fires 2 additional leafs"); + "Fires 2 additional leaves"); } public override void SetDefaults() { - item.damage = 25; + item.damage = 28; item.ranged = true; item.width = 74; item.height = 24; @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Ranged { float SpeedX = speedX + (float)Main.rand.Next(-60, 61) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-60, 61) * 0.05f; - int index = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0f, 0f); + int index = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI); Main.projectile[index].noDropItem = true; } Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); diff --git a/Items/Weapons/Ranged/BlossomFlux.cs b/Items/Weapons/Ranged/BlossomFlux.cs index 8368c9ad7b..76746e2800 100644 --- a/Items/Weapons/Ranged/BlossomFlux.cs +++ b/Items/Weapons/Ranged/BlossomFlux.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 22; + item.damage = 25; item.ranged = true; item.width = 38; item.height = 68; @@ -63,11 +63,11 @@ namespace CalamityMod.Items.Weapons.Ranged { if (player.altFunctionUse == 2) { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), (int)((double)damage * 4.0), knockBack * 60f, player.whoAmI, 0.0f, 0.0f); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), (int)(damage * 4D), knockBack * 60f, player.whoAmI); } else { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0.0f, 0.0f); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); } return false; } diff --git a/Items/Weapons/Ranged/BrimstoneFury.cs b/Items/Weapons/Ranged/BrimstoneFury.cs index 585546dc92..b2c3c43ffa 100644 --- a/Items/Weapons/Ranged/BrimstoneFury.cs +++ b/Items/Weapons/Ranged/BrimstoneFury.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 35; + item.damage = 39; item.ranged = true; item.width = 30; item.height = 58; diff --git a/Items/Weapons/Ranged/ClockworkBow.cs b/Items/Weapons/Ranged/ClockworkBow.cs index 2ea823ab10..d5cf85a26a 100644 --- a/Items/Weapons/Ranged/ClockworkBow.cs +++ b/Items/Weapons/Ranged/ClockworkBow.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 60; + item.damage = 66; item.ranged = true; item.width = 34; item.height = 100; @@ -94,7 +94,7 @@ namespace CalamityMod.Items.Weapons.Ranged num79 *= num80; float speedX4 = num78 + (float)Main.rand.Next(-600, 601) * 0.01f; float speedY5 = num79 + (float)Main.rand.Next(-600, 601) * 0.01f; - int projectile = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, num73, num74, i, 0f, 0f); + int projectile = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, num73, num74, i); Main.projectile[projectile].tileCollide = false; Main.projectile[projectile].timeLeft = 240; Main.projectile[projectile].noDropItem = true; diff --git a/Items/Weapons/Ranged/Contagion.cs b/Items/Weapons/Ranged/Contagion.cs index 20f30b579a..669d33a369 100644 --- a/Items/Weapons/Ranged/Contagion.cs +++ b/Items/Weapons/Ranged/Contagion.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 800; + item.damage = 880; item.ranged = true; item.width = 22; item.height = 50; diff --git a/Items/Weapons/Ranged/CorrodedCaustibow.cs b/Items/Weapons/Ranged/CorrodedCaustibow.cs index 945f52d4de..5c23f18ce0 100644 --- a/Items/Weapons/Ranged/CorrodedCaustibow.cs +++ b/Items/Weapons/Ranged/CorrodedCaustibow.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 80; + item.damage = 88; item.ranged = true; item.width = 30; item.height = 38; diff --git a/Items/Weapons/Ranged/CosmicBolter.cs b/Items/Weapons/Ranged/CosmicBolter.cs index af5ae67f9d..068e05a682 100644 --- a/Items/Weapons/Ranged/CosmicBolter.cs +++ b/Items/Weapons/Ranged/CosmicBolter.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 35; + item.damage = 39; item.ranged = true; item.width = 40; item.height = 76; diff --git a/Items/Weapons/Ranged/DaemonsFlame.cs b/Items/Weapons/Ranged/DaemonsFlame.cs index 10e9fed762..fea2ef351e 100644 --- a/Items/Weapons/Ranged/DaemonsFlame.cs +++ b/Items/Weapons/Ranged/DaemonsFlame.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 123; + item.damage = 135; item.width = 62; item.height = 128; item.useTime = 12; diff --git a/Items/Weapons/Ranged/DarkechoGreatbow.cs b/Items/Weapons/Ranged/DarkechoGreatbow.cs index 54265c5709..d125919ff9 100644 --- a/Items/Weapons/Ranged/DarkechoGreatbow.cs +++ b/Items/Weapons/Ranged/DarkechoGreatbow.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 34; + item.damage = 37; item.ranged = true; item.width = 34; item.height = 62; @@ -41,10 +41,10 @@ namespace CalamityMod.Items.Weapons.Ranged { float SpeedX = speedX + (float)Main.rand.Next(-30, 31) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-30, 31) * 0.05f; - int index = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0f, 0f); + int index = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI); Main.projectile[index].noDropItem = true; } - int projectile = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ProjectileID.CrystalDart, damage, knockBack, player.whoAmI, 0f, 0f); + int projectile = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ProjectileID.CrystalDart, damage / 2, knockBack, player.whoAmI); Main.projectile[projectile].penetrate = 3; return false; } diff --git a/Items/Weapons/Ranged/Deathwind.cs b/Items/Weapons/Ranged/Deathwind.cs index 36b8b1227b..11cf5186af 100644 --- a/Items/Weapons/Ranged/Deathwind.cs +++ b/Items/Weapons/Ranged/Deathwind.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 225; + item.damage = 248; item.ranged = true; item.width = 40; item.height = 82; @@ -50,11 +50,11 @@ namespace CalamityMod.Items.Weapons.Ranged float SpeedY = speedY + Main.rand.Next(-20, 21) * 0.05f; if (type == ProjectileID.WoodenArrowFriendly) { - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); } else { - int num121 = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)(damage * 0.8), knockBack, player.whoAmI, 0f, 0f); + int num121 = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)(damage * 0.8), knockBack, player.whoAmI); Main.projectile[num121].noDropItem = true; } } diff --git a/Items/Weapons/Ranged/Drataliornus.cs b/Items/Weapons/Ranged/Drataliornus.cs index a164c41246..f1ced9fdd0 100644 --- a/Items/Weapons/Ranged/Drataliornus.cs +++ b/Items/Weapons/Ranged/Drataliornus.cs @@ -24,7 +24,7 @@ Right click to fire two devastating barrages of five empowered fireballs. public override void SetDefaults() { - item.damage = 210; + item.damage = 231; item.knockBack = 1f; item.shootSpeed = 18f; item.useStyle = ItemUseStyleID.HoldingOut; diff --git a/Items/Weapons/Ranged/EffluviumBow.cs b/Items/Weapons/Ranged/EffluviumBow.cs index 7f93344f01..b6ea7a4a0c 100644 --- a/Items/Weapons/Ranged/EffluviumBow.cs +++ b/Items/Weapons/Ranged/EffluviumBow.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 51; + item.damage = 56; item.ranged = true; item.width = 26; item.height = 70; diff --git a/Items/Weapons/Ranged/EternalBlizzard.cs b/Items/Weapons/Ranged/EternalBlizzard.cs index b9cf8264a0..0655bc5e9f 100644 --- a/Items/Weapons/Ranged/EternalBlizzard.cs +++ b/Items/Weapons/Ranged/EternalBlizzard.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged } public override void SetDefaults() { - item.damage = 73; + item.damage = 80; item.ranged = true; item.width = 38; item.height = 62; @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Ranged { float SpeedX = speedX + (float)Main.rand.Next(-10, 11) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-10, 11) * 0.05f; - int index = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), (int)(damage * 0.7f), knockBack, player.whoAmI, 0f, 0f); + int index = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), (int)(damage * 0.7f), knockBack, player.whoAmI); Main.projectile[index].noDropItem = true; return true; diff --git a/Items/Weapons/Ranged/FlarewingBow.cs b/Items/Weapons/Ranged/FlarewingBow.cs index 6ba4c06caa..6c4e1d6f48 100644 --- a/Items/Weapons/Ranged/FlarewingBow.cs +++ b/Items/Weapons/Ranged/FlarewingBow.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 15; + item.damage = 17; item.ranged = true; item.width = 20; item.height = 62; @@ -55,12 +55,12 @@ namespace CalamityMod.Items.Weapons.Ranged } if (type == ProjectileID.WoodenArrowFriendly) { - int num123 = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + int num123 = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); Main.projectile[num123].noDropItem = true; } else { - int num123 = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); + int num123 = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, type, damage, knockBack, player.whoAmI); Main.projectile[num123].noDropItem = true; } } diff --git a/Items/Weapons/Ranged/Galeforce.cs b/Items/Weapons/Ranged/Galeforce.cs index 3ab6e4f38e..07fb34fb34 100644 --- a/Items/Weapons/Ranged/Galeforce.cs +++ b/Items/Weapons/Ranged/Galeforce.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 16; + item.damage = 18; item.ranged = true; item.width = 32; item.height = 52; @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Ranged for (int i = -8; i <= 8; i += 8) { Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(i)); - Projectile.NewProjectile(position, perturbedSpeed, ModContent.ProjectileType(), damage / 4, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position, perturbedSpeed, ModContent.ProjectileType(), damage / 4, 0f, player.whoAmI); } return true; } diff --git a/Items/Weapons/Ranged/Goobow.cs b/Items/Weapons/Ranged/Goobow.cs index 285b48b6cb..2683865d18 100644 --- a/Items/Weapons/Ranged/Goobow.cs +++ b/Items/Weapons/Ranged/Goobow.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 30; + item.damage = 33; item.ranged = true; item.width = 30; item.height = 50; diff --git a/Items/Weapons/Ranged/GreatbowofTurmoil.cs b/Items/Weapons/Ranged/GreatbowofTurmoil.cs index 94ee9b1fbb..ee6f68dc88 100644 --- a/Items/Weapons/Ranged/GreatbowofTurmoil.cs +++ b/Items/Weapons/Ranged/GreatbowofTurmoil.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 31; + item.damage = 34; item.ranged = true; item.width = 18; item.height = 36; @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons.Ranged { type = ProjectileID.FireArrow; } - int num121 = Projectile.NewProjectile(source + offset, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + int num121 = Projectile.NewProjectile(source + offset, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); Main.projectile[num121].noDropItem = true; } for (int i = 0; i < 2; i++) @@ -70,7 +70,7 @@ namespace CalamityMod.Items.Weapons.Ranged ProjectileID.HellfireArrow, ProjectileID.IchorArrow }); - int index = Projectile.NewProjectile(position, new Vector2(SpeedX, SpeedY), type, (int)(damage * 0.5f), knockBack, player.whoAmI, 0f, 0f); + int index = Projectile.NewProjectile(position, new Vector2(SpeedX, SpeedY), type, (int)(damage * 0.5f), knockBack, player.whoAmI); Main.projectile[index].noDropItem = true; Main.projectile[index].usesLocalNPCImmunity = true; Main.projectile[index].localNPCHitCooldown = 10; diff --git a/Items/Weapons/Ranged/HeavenlyGale.cs b/Items/Weapons/Ranged/HeavenlyGale.cs index 79778836df..cad26edbf9 100644 --- a/Items/Weapons/Ranged/HeavenlyGale.cs +++ b/Items/Weapons/Ranged/HeavenlyGale.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 180; + item.damage = 198; item.ranged = true; item.width = 44; item.height = 58; diff --git a/Items/Weapons/Ranged/LunarianBow.cs b/Items/Weapons/Ranged/LunarianBow.cs index a906748203..b7ac84a6a4 100644 --- a/Items/Weapons/Ranged/LunarianBow.cs +++ b/Items/Weapons/Ranged/LunarianBow.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 29; + item.damage = 32; item.ranged = true; item.width = 22; item.height = 62; diff --git a/Items/Weapons/Ranged/Malevolence.cs b/Items/Weapons/Ranged/Malevolence.cs index 62e7d7bde6..5f6ad22d3b 100644 --- a/Items/Weapons/Ranged/Malevolence.cs +++ b/Items/Weapons/Ranged/Malevolence.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 51; + item.damage = 56; item.ranged = true; item.width = 36; item.height = 58; diff --git a/Items/Weapons/Ranged/MandibleBow.cs b/Items/Weapons/Ranged/MandibleBow.cs index ef54421387..1efd420107 100644 --- a/Items/Weapons/Ranged/MandibleBow.cs +++ b/Items/Weapons/Ranged/MandibleBow.cs @@ -1,7 +1,6 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -//using TerrariaOverhaul; namespace CalamityMod.Items.Weapons.Ranged { @@ -14,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 13; + item.damage = 14; item.ranged = true; item.width = 22; item.height = 40; @@ -28,13 +27,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.UseSound = SoundID.Item5; item.autoReuse = false; item.shoot = ProjectileID.PurificationPowder; - item.shootSpeed = 30f; + item.shootSpeed = 15f; item.useAmmo = AmmoID.Arrow; } - - /*public void OverhaulInit() - { - this.SetTag("bow"); - }*/ } } diff --git a/Items/Weapons/Ranged/MarksmanBow.cs b/Items/Weapons/Ranged/MarksmanBow.cs index ef39ff086c..7e1aba9f60 100644 --- a/Items/Weapons/Ranged/MarksmanBow.cs +++ b/Items/Weapons/Ranged/MarksmanBow.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 27; + item.damage = 30; item.ranged = true; item.width = 36; item.height = 110; @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Ranged int randomExtraUpdates = Main.rand.Next(3); float SpeedX = speedX + Main.rand.NextFloat(-10f, 10f) * 0.05f; float SpeedY = speedY + Main.rand.NextFloat(-10f, 10f) * 0.05f; - int arrow = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0f, 0f); + int arrow = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI); Main.projectile[arrow].noDropItem = true; Main.projectile[arrow].extraUpdates += randomExtraUpdates; //0 to 2 extra updates if (type == ProjectileID.JestersArrow) diff --git a/Items/Weapons/Ranged/Monsoon.cs b/Items/Weapons/Ranged/Monsoon.cs index bfe974a56c..b83678ce00 100644 --- a/Items/Weapons/Ranged/Monsoon.cs +++ b/Items/Weapons/Ranged/Monsoon.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 110; + item.damage = 121; item.ranged = true; item.width = 46; item.height = 78; diff --git a/Items/Weapons/Ranged/NettlelineGreatbow.cs b/Items/Weapons/Ranged/NettlelineGreatbow.cs index 9e484532a9..12e903e8e3 100644 --- a/Items/Weapons/Ranged/NettlelineGreatbow.cs +++ b/Items/Weapons/Ranged/NettlelineGreatbow.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 66; + item.damage = 73; item.ranged = true; item.width = 36; item.height = 64; @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Ranged { value9 -= vector7; } - int num121 = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); + int num121 = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, type, damage, knockBack, player.whoAmI); Main.projectile[num121].noDropItem = true; } for (int i = 0; i < 2; i++) @@ -71,7 +71,7 @@ namespace CalamityMod.Items.Weapons.Ranged default: break; } - int index = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0f, 0f); + int index = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI); Main.projectile[index].noDropItem = true; } return false; diff --git a/Items/Weapons/Ranged/Phangasm.cs b/Items/Weapons/Ranged/Phangasm.cs index d7e01f2558..443615e0cd 100644 --- a/Items/Weapons/Ranged/Phangasm.cs +++ b/Items/Weapons/Ranged/Phangasm.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 100; + item.damage = 110; item.width = 20; item.height = 12; item.useTime = 12; diff --git a/Items/Weapons/Ranged/PlanetaryAnnihilation.cs b/Items/Weapons/Ranged/PlanetaryAnnihilation.cs index 613c13324a..cac500b1b0 100644 --- a/Items/Weapons/Ranged/PlanetaryAnnihilation.cs +++ b/Items/Weapons/Ranged/PlanetaryAnnihilation.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 53; + item.damage = 58; item.ranged = true; item.width = 58; item.height = 102; @@ -96,7 +96,7 @@ namespace CalamityMod.Items.Weapons.Ranged { float speedX4 = num78 + Main.rand.Next(-120, 121) * 0.02f; float speedY5 = num79 + Main.rand.Next(-120, 121) * 0.02f; - int num121 = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockBack, player.whoAmI, 0f, 0f); + int num121 = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockBack, player.whoAmI); Main.projectile[num121].noDropItem = true; } } diff --git a/Items/Weapons/Ranged/RaidersGlory.cs b/Items/Weapons/Ranged/RaidersGlory.cs index 8f1a6ee389..e9455cec62 100644 --- a/Items/Weapons/Ranged/RaidersGlory.cs +++ b/Items/Weapons/Ranged/RaidersGlory.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 40; + item.damage = 44; item.ranged = true; item.width = 50; item.height = 22; @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int projectile = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ProjectileID.IchorArrow, damage, knockBack, player.whoAmI, 0f, 0f); + int projectile = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ProjectileID.IchorArrow, damage, knockBack, player.whoAmI); Main.projectile[projectile].extraUpdates++; return false; } diff --git a/Items/Weapons/Ranged/Seabow.cs b/Items/Weapons/Ranged/Seabow.cs index 3885ee3097..88ea30d220 100644 --- a/Items/Weapons/Ranged/Seabow.cs +++ b/Items/Weapons/Ranged/Seabow.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 11; + item.damage = 12; item.ranged = true; item.width = 22; item.height = 46; @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged { float SpeedX = speedX + (float)Main.rand.Next(-30, 31) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-30, 31) * 0.05f; - Projectile.NewProjectile(position.X, position.Y, SpeedX * 0.5f, SpeedY * 0.5f, ModContent.ProjectileType(), (int)((double)damage * 0.4), 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position.X, position.Y, SpeedX * 0.5f, SpeedY * 0.5f, ModContent.ProjectileType(), (int)(damage * 0.4), 0f, player.whoAmI); return true; } diff --git a/Items/Weapons/Ranged/Shellshooter.cs b/Items/Weapons/Ranged/Shellshooter.cs index d76e7cdcbc..3239ae9374 100644 --- a/Items/Weapons/Ranged/Shellshooter.cs +++ b/Items/Weapons/Ranged/Shellshooter.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 30; + item.damage = 33; item.ranged = true; item.width = 30; item.height = 38; diff --git a/Items/Weapons/Ranged/TelluricGlare.cs b/Items/Weapons/Ranged/TelluricGlare.cs index e73b4c60e5..6d0280ffd7 100644 --- a/Items/Weapons/Ranged/TelluricGlare.cs +++ b/Items/Weapons/Ranged/TelluricGlare.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 160; + item.damage = 176; item.ranged = true; item.width = 54; item.height = 92; diff --git a/Items/Weapons/Ranged/TheBallista.cs b/Items/Weapons/Ranged/TheBallista.cs index 580fe39378..947b4357db 100644 --- a/Items/Weapons/Ranged/TheBallista.cs +++ b/Items/Weapons/Ranged/TheBallista.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 90; + item.damage = 99; item.ranged = true; item.width = 40; item.height = 70; diff --git a/Items/Weapons/Ranged/TheStorm.cs b/Items/Weapons/Ranged/TheStorm.cs index 3caceec9a9..21453f6289 100644 --- a/Items/Weapons/Ranged/TheStorm.cs +++ b/Items/Weapons/Ranged/TheStorm.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 22; + item.damage = 24; item.ranged = true; item.width = 34; item.height = 50; @@ -87,17 +87,17 @@ namespace CalamityMod.Items.Weapons.Ranged float speedY5 = num79 + (float)Main.rand.Next(-120, 121) * 0.01f; if (type == ProjectileID.WoodenArrowFriendly) { - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5 * 0.9f, ModContent.ProjectileType(), damage, num74, i, 0f, 0f); - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5 * 0.8f, ModContent.ProjectileType(), damage, num74, i, 0f, 0f); - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5 * 0.7f, ModContent.ProjectileType(), damage, num74, i, 0f, 0f); + Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5 * 0.9f, ModContent.ProjectileType(), damage, num74, i); + Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5 * 0.8f, ModContent.ProjectileType(), damage, num74, i); + Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5 * 0.7f, ModContent.ProjectileType(), damage, num74, i); } else { - int num121 = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5 * 0.9f, type, damage, num74, i, 0f, 0f); + int num121 = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5 * 0.9f, type, damage, num74, i); Main.projectile[num121].noDropItem = true; - int num122 = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5 * 0.8f, type, damage, num74, i, 0f, 0f); + int num122 = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5 * 0.8f, type, damage, num74, i); Main.projectile[num122].noDropItem = true; - int num123 = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5 * 0.7f, type, damage, num74, i, 0f, 0f); + int num123 = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5 * 0.7f, type, damage, num74, i); Main.projectile[num123].noDropItem = true; } } diff --git a/Items/Weapons/Ranged/Toxibow.cs b/Items/Weapons/Ranged/Toxibow.cs index 8e04d265c1..54d92d0889 100644 --- a/Items/Weapons/Ranged/Toxibow.cs +++ b/Items/Weapons/Ranged/Toxibow.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 8; + item.damage = 9; item.ranged = true; item.width = 20; item.height = 54; diff --git a/Items/Weapons/Ranged/Ultima.cs b/Items/Weapons/Ranged/Ultima.cs index e42439a840..19d0b237cf 100644 --- a/Items/Weapons/Ranged/Ultima.cs +++ b/Items/Weapons/Ranged/Ultima.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 105; + item.damage = 116; item.ranged = true; item.width = 44; item.height = 58; diff --git a/Items/Weapons/Ranged/WulfrumBow.cs b/Items/Weapons/Ranged/WulfrumBow.cs index 232004bc1d..1660639d10 100644 --- a/Items/Weapons/Ranged/WulfrumBow.cs +++ b/Items/Weapons/Ranged/WulfrumBow.cs @@ -2,7 +2,6 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; -//using TerrariaOverhaul; namespace CalamityMod.Items.Weapons.Ranged { @@ -15,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 10; + item.damage = 11; item.ranged = true; item.width = 27; item.height = 38; @@ -33,11 +32,6 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = AmmoID.Arrow; } - /*public void OverhaulInit() - { - this.SetTag("bow"); - }*/ - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Rogue/Celestus.cs b/Items/Weapons/Rogue/Celestus.cs index 4e02ac68b3..11fd20a13e 100644 --- a/Items/Weapons/Rogue/Celestus.cs +++ b/Items/Weapons/Rogue/Celestus.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { - item.damage = 340; + item.damage = 272; item.knockBack = 6f; item.useAnimation = item.useTime = 20; item.Calamity().rogue = true; diff --git a/Items/Weapons/Rogue/ExecutionersBlade.cs b/Items/Weapons/Rogue/ExecutionersBlade.cs index 7fee4adc76..050935ff19 100644 --- a/Items/Weapons/Rogue/ExecutionersBlade.cs +++ b/Items/Weapons/Rogue/ExecutionersBlade.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Weapons.Rogue { bool usingStealth = player.Calamity().StealthStrikeAvailable() && counter == 0; if (usingStealth) - damage = (int)(damage * 4.1); + damage = (int)(damage * 3.61); int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); if (usingStealth && stealth.WithinBounds(Main.maxProjectiles)) diff --git a/Items/Weapons/Rogue/Hypothermia.cs b/Items/Weapons/Rogue/Hypothermia.cs index efb15d0d20..ddd8c0c2d6 100644 --- a/Items/Weapons/Rogue/Hypothermia.cs +++ b/Items/Weapons/Rogue/Hypothermia.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.value = Item.buyPrice(1, 80, 0, 0); item.rare = ItemRarityID.Red; - item.damage = 197; + item.damage = 200; item.useAnimation = 21; item.useTime = 3; item.reuseDelay = 1; diff --git a/Items/Weapons/Rogue/ProfanedTrident.cs b/Items/Weapons/Rogue/ProfanedTrident.cs index f02356ae96..989447ddb2 100644 --- a/Items/Weapons/Rogue/ProfanedTrident.cs +++ b/Items/Weapons/Rogue/ProfanedTrident.cs @@ -38,6 +38,9 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { + if (player.Calamity().StealthStrikeAvailable()) + damage = (int)(damage * 0.6); + int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI); if (proj.WithinBounds(Main.maxProjectiles)) Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); diff --git a/Items/Weapons/Rogue/ShinobiBlade.cs b/Items/Weapons/Rogue/ShinobiBlade.cs index 03aa14f1b8..ac324c7b90 100644 --- a/Items/Weapons/Rogue/ShinobiBlade.cs +++ b/Items/Weapons/Rogue/ShinobiBlade.cs @@ -17,7 +17,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { - item.width = 30; + item.width = 16; + item.height = 42; item.damage = 15; item.noMelee = true; item.noUseGraphic = true; @@ -27,7 +28,6 @@ namespace CalamityMod.Items.Weapons.Rogue item.knockBack = 1f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 34; item.maxStack = 1; item.value = Item.buyPrice(0, 4, 0, 0); item.rare = ItemRarityID.Green; diff --git a/Items/Weapons/Rogue/ShinobiBlade.png b/Items/Weapons/Rogue/ShinobiBlade.png index 1cf29b4d30..023861ee02 100644 Binary files a/Items/Weapons/Rogue/ShinobiBlade.png and b/Items/Weapons/Rogue/ShinobiBlade.png differ diff --git a/Items/Weapons/Rogue/Supernova.cs b/Items/Weapons/Rogue/Supernova.cs index cbc7939b8b..a0819b7d78 100644 --- a/Items/Weapons/Rogue/Supernova.cs +++ b/Items/Weapons/Rogue/Supernova.cs @@ -43,6 +43,7 @@ Stealth strikes release energy as they fly"); { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { + damage = (int)(damage * 0.9f); int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; diff --git a/Items/Weapons/Summon/AngryChickenStaff.cs b/Items/Weapons/Summon/AngryChickenStaff.cs index 52d96df032..ca405e227c 100644 --- a/Items/Weapons/Summon/AngryChickenStaff.cs +++ b/Items/Weapons/Summon/AngryChickenStaff.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { item.mana = 50; - item.damage = 75; + item.damage = 83; item.useStyle = ItemUseStyleID.SwingThrow; item.width = 32; item.height = 32; diff --git a/Items/Weapons/Summon/StaffoftheMechworm.cs b/Items/Weapons/Summon/StaffoftheMechworm.cs index 4330c7e5f9..2f5d64f4fd 100644 --- a/Items/Weapons/Summon/StaffoftheMechworm.cs +++ b/Items/Weapons/Summon/StaffoftheMechworm.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.Summon public class StaffoftheMechworm : ModItem { // This value is also referenced by the God Slayer and Auric summoner helmets. - public const int BaseDamage = 137; // originally 325 + public const int BaseDamage = 144; // originally 325 public override void SetStaticDefaults() { DisplayName.SetDefault("Staff of the Mechworm"); diff --git a/NPCs/Abyss/ChaoticPuffer.cs b/NPCs/Abyss/ChaoticPuffer.cs index fcd393680e..444abd85a8 100644 --- a/NPCs/Abyss/ChaoticPuffer.cs +++ b/NPCs/Abyss/ChaoticPuffer.cs @@ -139,7 +139,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Abyss/ChaoticPufferGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/Abyss/ChaoticPufferGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Yellow); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/ChaoticPufferGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/Abyss/Cuttlefish.cs b/NPCs/Abyss/Cuttlefish.cs index 6d8a317490..aba420d53a 100644 --- a/NPCs/Abyss/Cuttlefish.cs +++ b/NPCs/Abyss/Cuttlefish.cs @@ -361,7 +361,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Abyss/CuttlefishGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/Abyss/CuttlefishGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Gold); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/CuttlefishGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/Abyss/DevilFish.cs b/NPCs/Abyss/DevilFish.cs index a243cacb4a..36e7903cc0 100644 --- a/NPCs/Abyss/DevilFish.cs +++ b/NPCs/Abyss/DevilFish.cs @@ -274,7 +274,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Abyss/DevilFishGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/Abyss/DevilFishGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Red); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/DevilFishGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/Abyss/DevilFishAlt.cs b/NPCs/Abyss/DevilFishAlt.cs index 6ae16ff161..e51d360bd4 100644 --- a/NPCs/Abyss/DevilFishAlt.cs +++ b/NPCs/Abyss/DevilFishAlt.cs @@ -274,7 +274,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Abyss/DevilFishGlowAlt").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/Abyss/DevilFishGlowAlt").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Red); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/DevilFishGlowAlt"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/Abyss/EidolonWyrmBody.cs b/NPCs/Abyss/EidolonWyrmBody.cs index b52e8ce6c9..130360d7ec 100644 --- a/NPCs/Abyss/EidolonWyrmBody.cs +++ b/NPCs/Abyss/EidolonWyrmBody.cs @@ -127,7 +127,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmBodyGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmBodyGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightYellow); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmBodyGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/Abyss/EidolonWyrmBodyAlt.cs b/NPCs/Abyss/EidolonWyrmBodyAlt.cs index 9af8ed6677..03a97848a6 100644 --- a/NPCs/Abyss/EidolonWyrmBodyAlt.cs +++ b/NPCs/Abyss/EidolonWyrmBodyAlt.cs @@ -127,7 +127,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmBodyAltGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmBodyAltGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightYellow); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmBodyAltGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/Abyss/EidolonWyrmBodyAltHuge.cs b/NPCs/Abyss/EidolonWyrmBodyAltHuge.cs index 1214a2b63e..bee2fbc7da 100644 --- a/NPCs/Abyss/EidolonWyrmBodyAltHuge.cs +++ b/NPCs/Abyss/EidolonWyrmBodyAltHuge.cs @@ -1,6 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; +using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -38,6 +39,16 @@ namespace CalamityMod.NPCs.Abyss npc.chaseable = false; } + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(npc.localAI[0]); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + npc.localAI[0] = reader.ReadSingle(); + } + public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) => false; public override void AI() @@ -81,7 +92,7 @@ namespace CalamityMod.NPCs.Abyss { if (Main.npc[(int)npc.ai[1]].Opacity > 0.5f) { - npc.Opacity += 0.15f; + npc.Opacity += 0.2f; if (npc.Opacity > 1f) npc.Opacity = 1f; } @@ -99,12 +110,12 @@ namespace CalamityMod.NPCs.Abyss { if (Vector2.Distance(npc.Center, Main.player[Main.npc[(int)npc.ai[2]].target].Center) > 160f) { - npc.ai[3] += 1f; + npc.localAI[0] += 1f; float shootShadowFireballGateValue = 90f; float divisor = 5f; - if (npc.ai[3] % divisor == 0f && npc.ai[3] >= shootShadowFireballGateValue) + if (npc.ai[3] % divisor == 0f && npc.localAI[0] >= shootShadowFireballGateValue) { - npc.ai[3] = 0f; + npc.localAI[0] = 0f; float distanceVelocityBoost = MathHelper.Clamp((Vector2.Distance(Main.npc[(int)npc.ai[2]].Center, Main.player[Main.npc[(int)npc.ai[2]].target].Center) - 1600f) * 0.025f, 0f, 16f); float fireballVelocity = (Main.player[Main.npc[(int)npc.ai[2]].target].Calamity().ZoneAbyssLayer4 ? 6f : 8f) + distanceVelocityBoost; Vector2 destination = Main.player[Main.npc[(int)npc.ai[2]].target].Center - npc.Center; @@ -163,7 +174,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2); Vector2 vector = center - Main.screenPosition; vector -= new Vector2(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmBodyAltGlowHuge").Width, ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmBodyAltGlowHuge").Height) * 0.5f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127, 127, 127, 0).MultiplyRGBA(Color.LightYellow) * npc.Opacity; Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmBodyAltGlowHuge"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/Abyss/EidolonWyrmBodyHuge.cs b/NPCs/Abyss/EidolonWyrmBodyHuge.cs index 51c99a9d51..c808772239 100644 --- a/NPCs/Abyss/EidolonWyrmBodyHuge.cs +++ b/NPCs/Abyss/EidolonWyrmBodyHuge.cs @@ -1,6 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; +using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -38,6 +39,16 @@ namespace CalamityMod.NPCs.Abyss npc.chaseable = false; } + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(npc.localAI[0]); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + npc.localAI[0] = reader.ReadSingle(); + } + public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) => false; public override void AI() @@ -81,7 +92,7 @@ namespace CalamityMod.NPCs.Abyss { if (Main.npc[(int)npc.ai[1]].Opacity > 0.5f) { - npc.Opacity += 0.15f; + npc.Opacity += 0.2f; if (npc.Opacity > 1f) npc.Opacity = 1f; } @@ -93,18 +104,18 @@ namespace CalamityMod.NPCs.Abyss npc.Opacity = 0f; } - bool shootShadowFireballs = (calamityGlobalNPC_Head.newAI[0] == (float)EidolonWyrmHeadHuge.Phase.ShadowFireballSpin && calamityGlobalNPC_Head.newAI[2] > 0f) || + bool spawnAncientLights = (calamityGlobalNPC_Head.newAI[0] == (float)EidolonWyrmHeadHuge.Phase.ShadowFireballSpin && calamityGlobalNPC_Head.newAI[2] > 0f) || (calamityGlobalNPC_Head.newAI[0] == (float)EidolonWyrmHeadHuge.Phase.FinalPhase && calamityGlobalNPC_Head.newAI[1] > 0f); - if (shootShadowFireballs && Main.netMode != NetmodeID.MultiplayerClient) + if (spawnAncientLights && Main.netMode != NetmodeID.MultiplayerClient) { if (Vector2.Distance(npc.Center, Main.player[Main.npc[(int)npc.ai[2]].target].Center) > 160f) { - npc.ai[3] += 1f; + npc.localAI[0] += 1f; float spawnAncientLightGateValue = 180f; float divisor = 10f; - if (npc.ai[0] % divisor == 0f && npc.ai[3] >= spawnAncientLightGateValue) + if (npc.ai[3] % divisor == 0f && npc.localAI[0] >= spawnAncientLightGateValue) { - npc.ai[3] = 0f; + npc.localAI[0] = 0f; float distanceVelocityBoost = MathHelper.Clamp((Vector2.Distance(Main.npc[(int)npc.ai[2]].Center, Main.player[Main.npc[(int)npc.ai[2]].target].Center) - 1600f) * 0.025f, 0f, 16f); float lightVelocity = (Main.player[Main.npc[(int)npc.ai[2]].target].Calamity().ZoneAbyssLayer4 ? 6f : 8f) + distanceVelocityBoost; Vector2 destination = Main.player[Main.npc[(int)npc.ai[2]].target].Center - npc.Center; @@ -163,7 +174,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2); Vector2 vector = center - Main.screenPosition; vector -= new Vector2(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmBodyGlowHuge").Width, ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmBodyGlowHuge").Height) * 0.5f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127, 127, 127, 0).MultiplyRGBA(Color.LightYellow) * npc.Opacity; Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmBodyGlowHuge"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index 6e15d84c4f..7515be8701 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -431,7 +431,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmHeadGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmHeadGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightYellow); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmHeadGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/Abyss/EidolonWyrmHeadHuge.cs b/NPCs/Abyss/EidolonWyrmHeadHuge.cs index ae640abc78..77075bb406 100644 --- a/NPCs/Abyss/EidolonWyrmHeadHuge.cs +++ b/NPCs/Abyss/EidolonWyrmHeadHuge.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; +using CalamityMod.Items.Potions; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; @@ -168,6 +170,7 @@ namespace CalamityMod.NPCs.Abyss Player player = Main.player[npc.target]; bool targetDownDeep = player.Calamity().ZoneAbyssLayer4; + bool targetOnMount = player.mount.Active; if (npc.ai[2] > 0f) npc.realLife = (int)npc.ai[2]; @@ -185,12 +188,12 @@ namespace CalamityMod.NPCs.Abyss if (!TailSpawned && npc.ai[0] == 0f) { int Previous = npc.whoAmI; - for (int num36 = 0; num36 < maxLength; num36++) + for (int i = 0; i < maxLength; i++) { int lol; - if (num36 >= 0 && num36 < minLength) + if (i >= 0 && i < minLength) { - if (num36 % 2 == 0) + if (i % 2 == 0) lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType(), npc.whoAmI); else lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType(), npc.whoAmI); @@ -204,6 +207,7 @@ namespace CalamityMod.NPCs.Abyss Main.npc[Previous].ai[0] = lol; NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol, 0f, 0f, 0f, 0); Previous = lol; + Main.npc[Previous].ai[3] = i; } TailSpawned = true; } @@ -213,17 +217,32 @@ namespace CalamityMod.NPCs.Abyss if (player.dead) { npc.TargetClosest(false); - - npc.velocity.Y += 2f; - if (npc.position.Y > Main.worldSurface * 16.0) - npc.velocity.Y += 2f; - - if (npc.position.Y > Main.rockLayer * 16.0) + player = Main.player[npc.target]; + if (player.dead) { - for (int a = 0; a < Main.maxNPCs; a++) + npc.ai[3] = 0f; + npc.localAI[0] = 0f; + npc.localAI[1] = 0f; + npc.localAI[2] = 0f; + npc.localAI[3] = 0f; + AIState = (float)Phase.ChargeOne; + calamityGlobalNPC.newAI[1] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 1f; + chargeVelocityScalar = 0f; + rotationDirection = 0; + + npc.velocity.Y += 2f; + if (npc.position.Y > Main.worldSurface * 16.0) + npc.velocity.Y += 2f; + + if (npc.position.Y > Main.rockLayer * 16.0) { - if (Main.npc[a].type == npc.type || Main.npc[a].type == ModContent.NPCType() || Main.npc[a].type == ModContent.NPCType() || Main.npc[a].type == ModContent.NPCType()) - Main.npc[a].active = false; + for (int a = 0; a < Main.maxNPCs; a++) + { + if (Main.npc[a].type == npc.type || Main.npc[a].type == ModContent.NPCType() || Main.npc[a].type == ModContent.NPCType() || Main.npc[a].type == ModContent.NPCType()) + Main.npc[a].active = false; + } } } } @@ -264,6 +283,20 @@ namespace CalamityMod.NPCs.Abyss float ancientDoomGateValue = 120f; float lightningChargePhaseGateValue = 180f; + // Adjust slowing debuff immunity + bool immuneToSlowingDebuffs = AIState == (float)Phase.FinalPhase || AIState == (float)Phase.ShadowFireballSpin; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; + npc.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; + // Adjust opacity bool invisiblePartOfChargePhase = calamityGlobalNPC.newAI[2] >= chargePhaseGateValue && calamityGlobalNPC.newAI[2] <= chargePhaseGateValue + 1f && (AIState == (float)Phase.ChargeOne || AIState == (float)Phase.ChargeTwo || AIState == (float)Phase.FastCharge); bool invisiblePartOfLightningChargePhase = calamityGlobalNPC.newAI[2] >= lightningChargePhaseGateValue && calamityGlobalNPC.newAI[2] <= lightningChargePhaseGateValue + 1f && AIState == (float)Phase.LightningCharge; @@ -271,7 +304,7 @@ namespace CalamityMod.NPCs.Abyss npc.dontTakeDamage = invisiblePartOfChargePhase || invisiblePartOfLightningChargePhase || invisiblePhase; if (!invisiblePartOfChargePhase && !invisiblePartOfLightningChargePhase && !invisiblePhase) { - npc.Opacity += 0.15f; + npc.Opacity += 0.2f; if (npc.Opacity > 1f) npc.Opacity = 1f; } @@ -513,7 +546,7 @@ namespace CalamityMod.NPCs.Abyss } float predictionAmt = targetDownDeep ? 45f : 60f; - float lightningVelocity = targetDownDeep ? 6f : 8f; + float lightningVelocity = (targetDownDeep && !targetOnMount) ? 6f : 8f; for (int i = 0; i < numProjectiles; i++) { // Predictive bolt @@ -1357,13 +1390,18 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2); Vector2 vector = center - Main.screenPosition; vector -= new Vector2(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmHeadGlowHuge").Width, ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmHeadGlowHuge").Height) * 0.5f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127, 127, 127, 0).MultiplyRGBA(Color.LightYellow) * npc.Opacity; Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmHeadGlowHuge"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); } - public override void NPCLoot() + public override void BossLoot(ref string name, ref int potionType) + { + potionType = ModContent.ItemType(); + } + + public override void NPCLoot() { DropHelper.DropItem(npc, ModContent.ItemType(), 80, 100); DropHelper.DropItem(npc, ModContent.ItemType()); diff --git a/NPCs/Abyss/EidolonWyrmTail.cs b/NPCs/Abyss/EidolonWyrmTail.cs index d39e8fde54..7220f9aa9a 100644 --- a/NPCs/Abyss/EidolonWyrmTail.cs +++ b/NPCs/Abyss/EidolonWyrmTail.cs @@ -126,7 +126,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmTailGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmTailGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightYellow); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmTailGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/Abyss/EidolonWyrmTailHuge.cs b/NPCs/Abyss/EidolonWyrmTailHuge.cs index e8eb77af1e..0c16cde15c 100644 --- a/NPCs/Abyss/EidolonWyrmTailHuge.cs +++ b/NPCs/Abyss/EidolonWyrmTailHuge.cs @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.Abyss { if (Main.npc[(int)npc.ai[1]].Opacity > 0.5f) { - npc.Opacity += 0.15f; + npc.Opacity += 0.2f; if (npc.Opacity > 1f) npc.Opacity = 1f; } @@ -139,7 +139,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2); Vector2 vector = center - Main.screenPosition; vector -= new Vector2(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmTailGlowHuge").Width, ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmTailGlowHuge").Height) * 0.5f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127, 127, 127, 0).MultiplyRGBA(Color.LightYellow) * npc.Opacity; Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmTailGlowHuge"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/Abyss/GiantSquid.cs b/NPCs/Abyss/GiantSquid.cs index 14c107de58..f9f9b6677f 100644 --- a/NPCs/Abyss/GiantSquid.cs +++ b/NPCs/Abyss/GiantSquid.cs @@ -220,7 +220,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Abyss/GiantSquidGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/Abyss/GiantSquidGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Cyan); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/GiantSquidGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/Abyss/GulperEelBody.cs b/NPCs/Abyss/GulperEelBody.cs index a4384fb3ac..a8a8cf7e47 100644 --- a/NPCs/Abyss/GulperEelBody.cs +++ b/NPCs/Abyss/GulperEelBody.cs @@ -127,7 +127,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Abyss/GulperEelBodyGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/Abyss/GulperEelBodyGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightYellow); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/GulperEelBodyGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/Abyss/GulperEelBodyAlt.cs b/NPCs/Abyss/GulperEelBodyAlt.cs index 5bbe2a2c98..e5a02e6d21 100644 --- a/NPCs/Abyss/GulperEelBodyAlt.cs +++ b/NPCs/Abyss/GulperEelBodyAlt.cs @@ -127,7 +127,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Abyss/GulperEelBodyAltGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/Abyss/GulperEelBodyAltGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightYellow); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/GulperEelBodyAltGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/Abyss/GulperEelHead.cs b/NPCs/Abyss/GulperEelHead.cs index 2c863ba15f..d022691127 100644 --- a/NPCs/Abyss/GulperEelHead.cs +++ b/NPCs/Abyss/GulperEelHead.cs @@ -314,7 +314,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Abyss/GulperEelHeadGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/Abyss/GulperEelHeadGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightYellow); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/GulperEelHeadGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/Abyss/GulperEelTail.cs b/NPCs/Abyss/GulperEelTail.cs index 5adc3cf9db..9ffad34b42 100644 --- a/NPCs/Abyss/GulperEelTail.cs +++ b/NPCs/Abyss/GulperEelTail.cs @@ -127,7 +127,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Abyss/GulperEelTailGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/Abyss/GulperEelTailGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightYellow); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/GulperEelTailGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/Abyss/Laserfish.cs b/NPCs/Abyss/Laserfish.cs index 0074ae953e..c2f0ead0b8 100644 --- a/NPCs/Abyss/Laserfish.cs +++ b/NPCs/Abyss/Laserfish.cs @@ -90,7 +90,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Abyss/LaserfishGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/Abyss/LaserfishGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Yellow); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/LaserfishGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/Abyss/LuminousCorvina.cs b/NPCs/Abyss/LuminousCorvina.cs index bcde43b0ae..2a464acdf2 100644 --- a/NPCs/Abyss/LuminousCorvina.cs +++ b/NPCs/Abyss/LuminousCorvina.cs @@ -262,7 +262,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Abyss/LuminousCorvinaGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/Abyss/LuminousCorvinaGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightBlue); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/LuminousCorvinaGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/Abyss/MirageJelly.cs b/NPCs/Abyss/MirageJelly.cs index a081bd6e18..4df2aebc7f 100644 --- a/NPCs/Abyss/MirageJelly.cs +++ b/NPCs/Abyss/MirageJelly.cs @@ -181,7 +181,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Abyss/MirageJellyGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/Abyss/MirageJellyGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Purple); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/MirageJellyGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/Abyss/ToxicMinnow.cs b/NPCs/Abyss/ToxicMinnow.cs index 00fe9f0ebe..519f43f74c 100644 --- a/NPCs/Abyss/ToxicMinnow.cs +++ b/NPCs/Abyss/ToxicMinnow.cs @@ -105,7 +105,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Abyss/ToxicMinnowGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/Abyss/ToxicMinnowGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightGreen); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/ToxicMinnowGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/Abyss/Viperfish.cs b/NPCs/Abyss/Viperfish.cs index 3baa6e3ecb..bd3f24e2a3 100644 --- a/NPCs/Abyss/Viperfish.cs +++ b/NPCs/Abyss/Viperfish.cs @@ -88,7 +88,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Abyss/ViperfishGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/Abyss/ViperfishGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Gold); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/ViperfishGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/AquaticScourge/AquaticScourgeBody.cs b/NPCs/AquaticScourge/AquaticScourgeBody.cs index e334514fd5..0e341dc802 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBody.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBody.cs @@ -82,7 +82,7 @@ namespace CalamityMod.NPCs.AquaticScourge Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); Color color = npc.GetAlpha(lightColor); if (Main.npc[(int)npc.ai[2]].Calamity().newAI[3] > 480f && (CalamityWorld.revenge || BossRushEvent.BossRushActive || CalamityWorld.malice)) diff --git a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs index 8d556fec1a..59f2339a34 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.AquaticScourge Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); Color color = npc.GetAlpha(lightColor); if (Main.npc[(int)npc.ai[2]].Calamity().newAI[3] > 480f && (CalamityWorld.revenge || BossRushEvent.BossRushActive || CalamityWorld.malice)) diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index 18ebbb9351..e7bb9fe125 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -97,7 +97,7 @@ namespace CalamityMod.NPCs.AquaticScourge Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); Color color = npc.GetAlpha(lightColor); if (npc.Calamity().newAI[3] > 480f && (CalamityWorld.revenge || BossRushEvent.BossRushActive || CalamityWorld.malice)) diff --git a/NPCs/AquaticScourge/AquaticScourgeTail.cs b/NPCs/AquaticScourge/AquaticScourgeTail.cs index 66b9a95990..147fd4bd66 100644 --- a/NPCs/AquaticScourge/AquaticScourgeTail.cs +++ b/NPCs/AquaticScourge/AquaticScourgeTail.cs @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.AquaticScourge Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); Color color = npc.GetAlpha(lightColor); if (Main.npc[(int)npc.ai[2]].Calamity().newAI[3] > 480f && (CalamityWorld.revenge || BossRushEvent.BossRushActive || CalamityWorld.malice)) diff --git a/NPCs/Astral/AstralProbe.cs b/NPCs/Astral/AstralProbe.cs index b6d9be2fb1..19031a1f44 100644 --- a/NPCs/Astral/AstralProbe.cs +++ b/NPCs/Astral/AstralProbe.cs @@ -221,7 +221,7 @@ namespace CalamityMod.NPCs.Astral Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2)); Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index eafd67ab14..542c154698 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -243,14 +243,14 @@ namespace CalamityMod.NPCs.AstrumAureus color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/AstrumAureus/AureusSpawnGlow"); @@ -265,7 +265,7 @@ namespace CalamityMod.NPCs.AstrumAureus color41 *= (float)(num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs b/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs index 807d4f4d5b..f4ac21e06f 100644 --- a/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs @@ -97,14 +97,14 @@ namespace CalamityMod.NPCs.AstrumDeus color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = npc.localAI[3] == 1f ? ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyAltGlow") : ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow"); @@ -121,7 +121,7 @@ namespace CalamityMod.NPCs.AstrumDeus color41 *= (num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); if (npc.localAI[3] != 1f) diff --git a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs index cbc4ff0eb1..2723515d0a 100644 --- a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs @@ -112,14 +112,14 @@ namespace CalamityMod.NPCs.AstrumDeus color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow"); @@ -136,7 +136,7 @@ namespace CalamityMod.NPCs.AstrumDeus color41 *= (num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); Color color43 = color42; diff --git a/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs b/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs index 210133b3d9..ffcde84d21 100644 --- a/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs @@ -96,14 +96,14 @@ namespace CalamityMod.NPCs.AstrumDeus color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusTailGlow"); @@ -119,7 +119,7 @@ namespace CalamityMod.NPCs.AstrumDeus color41 *= (num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/Bumblebirb/Bumblefuck.cs b/NPCs/Bumblebirb/Bumblefuck.cs index 5a37e2156b..ce206c6ccb 100644 --- a/NPCs/Bumblebirb/Bumblefuck.cs +++ b/NPCs/Bumblebirb/Bumblefuck.cs @@ -264,7 +264,7 @@ namespace CalamityMod.NPCs.Bumblebirb color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } @@ -319,7 +319,7 @@ namespace CalamityMod.NPCs.Bumblebirb color39 *= 1f - num157; Vector2 vector42 = npc.Center + ((float)num160 / (float)num156 * MathHelper.TwoPi + npc.rotation).ToRotationVector2() * scaleFactor9 * num157 - Main.screenPosition; vector42 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector42 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector42 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector42, npc.frame, color39, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } @@ -329,7 +329,7 @@ namespace CalamityMod.NPCs.Bumblebirb color2 = npc.GetAlpha(color2); Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, (phase3 && calamityGlobalNPC.newAI[3] == 1f ? color2 : npc.GetAlpha(lightColor)), npc.rotation, vector11, npc.scale, spriteEffects, 0f); if (phase2) @@ -360,7 +360,7 @@ namespace CalamityMod.NPCs.Bumblebirb color41 *= (float)(num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } @@ -372,7 +372,7 @@ namespace CalamityMod.NPCs.Bumblebirb color42 *= 1f - num157; Vector2 vector45 = npc.Center + ((float)num164 / (float)num156 * MathHelper.TwoPi + npc.rotation).ToRotationVector2() * scaleFactor9 * num157 - Main.screenPosition; vector45 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector45 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector45 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector45, npc.frame, color42, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/Bumblebirb/Bumblefuck2.cs b/NPCs/Bumblebirb/Bumblefuck2.cs index bc99f15fa2..c300b0016f 100644 --- a/NPCs/Bumblebirb/Bumblefuck2.cs +++ b/NPCs/Bumblebirb/Bumblefuck2.cs @@ -344,14 +344,14 @@ namespace CalamityMod.NPCs.Bumblebirb color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); return false; diff --git a/NPCs/Calamitas/Calamitas.cs b/NPCs/Calamitas/Calamitas.cs index 522c9e1df1..8f17bfe511 100644 --- a/NPCs/Calamitas/Calamitas.cs +++ b/NPCs/Calamitas/Calamitas.cs @@ -100,14 +100,14 @@ namespace CalamityMod.NPCs.Calamitas color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/CalamitasGlow"); @@ -122,7 +122,7 @@ namespace CalamityMod.NPCs.Calamitas color41 *= (num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/Calamitas/CalamitasRun.cs b/NPCs/Calamitas/CalamitasRun.cs index 203f7699c2..bcbe90e9e1 100644 --- a/NPCs/Calamitas/CalamitasRun.cs +++ b/NPCs/Calamitas/CalamitasRun.cs @@ -98,14 +98,14 @@ namespace CalamityMod.NPCs.Calamitas color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/CalamitasRunGlow"); @@ -120,7 +120,7 @@ namespace CalamityMod.NPCs.Calamitas color41 *= (float)(num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/Calamitas/CalamitasRun2.cs b/NPCs/Calamitas/CalamitasRun2.cs index efa62c49fd..4f297c5c02 100644 --- a/NPCs/Calamitas/CalamitasRun2.cs +++ b/NPCs/Calamitas/CalamitasRun2.cs @@ -98,14 +98,14 @@ namespace CalamityMod.NPCs.Calamitas color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/CalamitasRun2Glow"); @@ -120,7 +120,7 @@ namespace CalamityMod.NPCs.Calamitas color41 *= (float)(num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/Calamitas/CalamitasRun3.cs b/NPCs/Calamitas/CalamitasRun3.cs index e2fc49af79..47d4ebff58 100644 --- a/NPCs/Calamitas/CalamitasRun3.cs +++ b/NPCs/Calamitas/CalamitasRun3.cs @@ -117,14 +117,14 @@ namespace CalamityMod.NPCs.Calamitas color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/CalamitasRun3Glow"); @@ -139,7 +139,7 @@ namespace CalamityMod.NPCs.Calamitas color41 *= (float)(num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/Calamitas/LifeSeeker.cs b/NPCs/Calamitas/LifeSeeker.cs index df1f69aa99..ecae78c18f 100644 --- a/NPCs/Calamitas/LifeSeeker.cs +++ b/NPCs/Calamitas/LifeSeeker.cs @@ -76,14 +76,14 @@ namespace CalamityMod.NPCs.Calamitas color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/LifeSeekerGlow"); @@ -98,7 +98,7 @@ namespace CalamityMod.NPCs.Calamitas color41 *= (float)(num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/Calamitas/SoulSeeker.cs b/NPCs/Calamitas/SoulSeeker.cs index 2fd1154521..dcf59123b9 100644 --- a/NPCs/Calamitas/SoulSeeker.cs +++ b/NPCs/Calamitas/SoulSeeker.cs @@ -173,14 +173,14 @@ namespace CalamityMod.NPCs.Calamitas afterImageColor *= (afterImageAmt - a) / 15f; Vector2 afterimagePos = npc.oldPos[a] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; afterimagePos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - afterimagePos += origin * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + afterimagePos += origin * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, afterimagePos, npc.frame, afterImageColor, npc.rotation, origin, npc.scale, spriteEffects, 0f); } } Vector2 drawPos = npc.Center - Main.screenPosition; drawPos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - drawPos += origin * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + drawPos += origin * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, drawPos, npc.frame, npc.GetAlpha(lightColor), npc.rotation, origin, npc.scale, spriteEffects, 0f); texture = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/SoulSeekerGlow"); @@ -195,7 +195,7 @@ namespace CalamityMod.NPCs.Calamitas glowColor *= (afterImageAmt - a) / 15f; Vector2 afterimagePos = npc.oldPos[a] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; afterimagePos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - afterimagePos += origin * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + afterimagePos += origin * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, afterimagePos, npc.frame, glowColor, npc.rotation, origin, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 3ce8203a46..f65507dcf2 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Dusts; @@ -187,6 +188,20 @@ namespace CalamityMod.NPCs } } + // Adjust slowing debuff immunity + bool immuneToSlowingDebuffs = doSpiral; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; + npc.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; + if (Main.netMode != NetmodeID.MultiplayerClient) { if (head) @@ -1311,7 +1326,7 @@ namespace CalamityMod.NPCs } if (brotherAlive) { - calamityGlobalNPC.DR = 0.99f; + calamityGlobalNPC.DR = 0.9999f; calamityGlobalNPC.unbreakableDR = true; } else @@ -4590,6 +4605,20 @@ namespace CalamityMod.NPCs bool death = CalamityWorld.death || malice; Vector2 vector = npc.Center; + // Adjust slowing debuff immunity + bool immuneToSlowingDebuffs = npc.ai[0] == 3f || npc.ai[0] == 3.1f || npc.ai[0] == 3.2f; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; + npc.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; + // If target is outside the jungle for more than 3 seconds, enrage if (!player.ZoneJungle) { diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index 67ad19225b..ce4e8dccf5 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -1,9 +1,12 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Events; using CalamityMod.NPCs.Abyss; using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.Astral; using CalamityMod.NPCs.Crags; using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.NPCs.PlagueEnemies; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -2661,6 +2664,20 @@ namespace CalamityMod.NPCs if (Main.player[npc.target].dead) npc.ai[0] = 5f; + // Adjust slowing debuff immunity + bool immuneToSlowingDebuffs = npc.ai[0] == 0f; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; + npc.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; + if (npc.ai[0] == 5f) { npc.velocity.Y *= 0.98f; @@ -3674,7 +3691,7 @@ namespace CalamityMod.NPCs else if (npc.ai[1] == 2f) { npc.damage = 1000; - calamityGlobalNPC.DR = 0.99f; + calamityGlobalNPC.DR = 0.9999f; calamityGlobalNPC.unbreakableDR = true; npc.rotation += npc.direction * 0.3f; Vector2 vector21 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); @@ -5907,7 +5924,7 @@ namespace CalamityMod.NPCs npc.damage = (int)(npc.defDamage * 1.5); npc.defense = npc.defDefense + 10; - calamityGlobalNPC.DR = spazInPhase1 ? 0.99f : 0.2f; + calamityGlobalNPC.DR = spazInPhase1 ? 0.9999f : 0.2f; calamityGlobalNPC.unbreakableDR = spazInPhase1; npc.HitSound = SoundID.NPCHit4; @@ -6654,7 +6671,7 @@ namespace CalamityMod.NPCs // Increase defense and damage npc.damage = (int)(npc.defDamage * 1.5); npc.defense = npc.defDefense + 18; - calamityGlobalNPC.DR = retInPhase1 ? 0.99f : 0.2f; + calamityGlobalNPC.DR = retInPhase1 ? 0.9999f : 0.2f; calamityGlobalNPC.unbreakableDR = retInPhase1; // Change hit sound to metal @@ -7199,8 +7216,22 @@ namespace CalamityMod.NPCs Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); } - // Float near player - if (npc.ai[1] == 0f || npc.ai[1] == 4f) + // Adjust slowing debuff immunity + bool immuneToSlowingDebuffs = npc.ai[1] == 5f; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; + npc.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; + + // Float near player + if (npc.ai[1] == 0f || npc.ai[1] == 4f) { // Start other phases if arms are dead, start with spinning phase if (allArmsDead) @@ -7453,7 +7484,7 @@ namespace CalamityMod.NPCs if (npc.ai[1] == 2f) { npc.damage = 1000; - calamityGlobalNPC.DR = 0.99f; + calamityGlobalNPC.DR = 0.9999f; calamityGlobalNPC.unbreakableDR = true; npc.rotation += npc.direction * 0.3f; @@ -9471,7 +9502,7 @@ namespace CalamityMod.NPCs } else { - calamityGlobalNPC.DR = 0.99f; + calamityGlobalNPC.DR = 0.9999f; calamityGlobalNPC.unbreakableDR = true; } } @@ -10463,7 +10494,7 @@ namespace CalamityMod.NPCs if (turboEnrage) { - npc.Calamity().DR = 0.99f; + npc.Calamity().DR = 0.9999f; npc.Calamity().unbreakableDR = true; } else diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 9ec5392201..6514732f5e 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -58,6 +58,7 @@ using Terraria.Graphics.Effects; using Terraria.ID; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; +using CalamityMod.NPCs.PlagueEnemies; namespace CalamityMod.NPCs { @@ -102,6 +103,10 @@ namespace CalamityMod.NPCs // Max velocity used in contact damage scaling public float maxVelocity = 0f; + // Dash damage immunity timer + public const int maxPlayerImmunities = Main.maxPlayers + 1; + public int[] dashImmunityTime = new int[maxPlayerImmunities]; + // Town NPC shop alert animation variables public int shopAlertAnimTimer = 0; public int shopAlertAnimFrame = 0; @@ -384,6 +389,14 @@ namespace CalamityMod.NPCs NPCID.TheDestroyerTail }; + public static List ThanatosIDs = new List + { + NPCType(), + NPCType(), + NPCType(), + NPCType() + }; + public static List SkeletronPrimeIDs = new List { NPCID.SkeletronPrime, @@ -985,7 +998,10 @@ namespace CalamityMod.NPCs #region Set Defaults public override void SetDefaults(NPC npc) { - for (int m = 0; m < maxAIMod; m++) + for (int i = 0; i < maxPlayerImmunities; i++) + dashImmunityTime[i] = 0; + + for (int m = 0; m < maxAIMod; m++) newAI[m] = 0f; // Apply DR to vanilla NPCs. @@ -1848,7 +1864,8 @@ namespace CalamityMod.NPCs if (npc.type == NPCType() && !Main.dayTime) DRScalar = 10f; if ((DestroyerIDs.Contains(npc.type) && !NPC.downedPlantBoss) || (AquaticScourgeIDs.Contains(npc.type) && !NPC.downedPlantBoss) || - (AstrumDeusIDs.Contains(npc.type) && !NPC.downedMoonlord) || (StormWeaverIDs.Contains(npc.type) && !CalamityWorld.downedDoG)) + (AstrumDeusIDs.Contains(npc.type) && !NPC.downedMoonlord) || (StormWeaverIDs.Contains(npc.type) && !CalamityWorld.downedDoG) || + ThanatosIDs.Contains(npc.type)) DRScalar = 5f; // The limit for how much extra DR the boss can have @@ -1970,6 +1987,13 @@ namespace CalamityMod.NPCs { CalamityGlobalTownNPC.SetPatreonTownNPCName(npc, mod); + // Decrement each immune timer if it's greater than 0. + for (int i = 0; i < maxPlayerImmunities; i++) + { + if (dashImmunityTime[i] > 0) + dashImmunityTime[i]--; + } + if (CalamityPlayer.areThereAnyDamnBosses) { if (npc.velocity.Length() > maxVelocity) @@ -3689,7 +3713,12 @@ namespace CalamityMod.NPCs // Expert Mode resists, mostly worms if (Main.expertMode) { - if (AstrumDeusIDs.Contains(npc.type)) + if (ThanatosIDs.Contains(npc.type)) + { + GrenadeResist(projectile, ref damage); + PierceResistGlobal(projectile, ref damage); + } + else if (AstrumDeusIDs.Contains(npc.type)) { GrenadeResist(projectile, ref damage); PierceResistGlobal(projectile, ref damage); @@ -3899,13 +3928,23 @@ namespace CalamityMod.NPCs damage = (int)(damage * 0.8); if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) - damage = (int)(damage * 0.9); + damage = (int)(damage * 0.81); } - else if (npc.type == NPCType() || npc.type == NPCType()) + else if (npc.type == NPCType() || npc.type == NPCType()) { if (projectile.type == ProjectileType()) damage = (int)(damage * 0.9); } + else if (npc.type == NPCType()) + { + if (projectile.type == ProjectileType()) + damage = (int)(damage * 0.8); + } + else if (npc.type == NPCType()) + { + if (projectile.type == ProjectileType()) + damage = (int)(damage * 0.9); + } else if (npc.type == NPCID.CultistBoss) { if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index a47c0c1739..6e040ed565 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -120,14 +120,14 @@ namespace CalamityMod.NPCs.CeaselessVoid color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/CeaselessVoid/CeaselessVoidGlow"); @@ -142,7 +142,7 @@ namespace CalamityMod.NPCs.CeaselessVoid color41 *= (float)(num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/CeaselessVoid/DarkEnergy.cs b/NPCs/CeaselessVoid/DarkEnergy.cs index b21d9612ab..9412cd31e6 100644 --- a/NPCs/CeaselessVoid/DarkEnergy.cs +++ b/NPCs/CeaselessVoid/DarkEnergy.cs @@ -199,7 +199,7 @@ namespace CalamityMod.NPCs.CeaselessVoid Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); if (CalamityConfig.Instance.Afterimages) { @@ -211,7 +211,7 @@ namespace CalamityMod.NPCs.CeaselessVoid color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } @@ -232,7 +232,7 @@ namespace CalamityMod.NPCs.CeaselessVoid color41 *= (num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); Color color43 = color42; diff --git a/NPCs/Crabulon/CrabShroom.cs b/NPCs/Crabulon/CrabShroom.cs index ba46c99cd3..fa2a3ea716 100644 --- a/NPCs/Crabulon/CrabShroom.cs +++ b/NPCs/Crabulon/CrabShroom.cs @@ -92,7 +92,7 @@ namespace CalamityMod.NPCs.Crabulon Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Crabulon/CrabShroomGlow"); diff --git a/NPCs/Crabulon/CrabulonIdle.cs b/NPCs/Crabulon/CrabulonIdle.cs index fc3221a734..3898ad1aaa 100644 --- a/NPCs/Crabulon/CrabulonIdle.cs +++ b/NPCs/Crabulon/CrabulonIdle.cs @@ -625,7 +625,7 @@ namespace CalamityMod.NPCs.Crabulon Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2); Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(Main.npcTexture[npc.type].Width, Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f); if (npc.ai[0] > 2f) @@ -633,7 +633,7 @@ namespace CalamityMod.NPCs.Crabulon vector11 = new Vector2(textureAttack.Width / 2, textureAttack.Height / 2); vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(textureAttack.Width, textureAttack.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(textureAttack, vector43, npc.frame, npc.GetAlpha(drawColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); @@ -644,7 +644,7 @@ namespace CalamityMod.NPCs.Crabulon vector11 = new Vector2(texture.Width / 2, texture.Height / 2); vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, vector43, npc.frame, npc.GetAlpha(drawColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); diff --git a/NPCs/Crags/SoulSlurper.cs b/NPCs/Crags/SoulSlurper.cs index 13eedfc458..b6dffd4fc4 100644 --- a/NPCs/Crags/SoulSlurper.cs +++ b/NPCs/Crags/SoulSlurper.cs @@ -241,14 +241,14 @@ namespace CalamityMod.NPCs.Crags color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture.Width, (float)(texture.Height)) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture.Width, (float)(texture.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture = ModContent.GetTexture("CalamityMod/NPCs/Crags/SoulSlurperGlow"); @@ -263,7 +263,7 @@ namespace CalamityMod.NPCs.Crags color41 *= (float)(num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2((float)texture.Width, (float)(texture.Height)) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, npc.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0f); } } diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 2ce5d9644b..d3c2e2fb14 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -1009,7 +1009,7 @@ namespace CalamityMod.NPCs.Cryogen Vector2 origin = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2); Vector2 drawPos = npc.Center - Main.screenPosition; drawPos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - drawPos += origin * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + drawPos += origin * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, drawPos, npc.frame, npc.GetAlpha(drawColor), npc.rotation, origin, npc.scale, spriteEffects, 0f); return false; } diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index eedb1ac7ce..f40071661d 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -180,7 +180,7 @@ namespace CalamityMod.NPCs.DevourerofGods Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsBodyGlow"); diff --git a/NPCs/DevourerofGods/DevourerofGodsBody2.cs b/NPCs/DevourerofGods/DevourerofGodsBody2.cs index 14193dafde..2a8e7670cc 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody2.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody2.cs @@ -154,7 +154,7 @@ namespace CalamityMod.NPCs.DevourerofGods Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsBody2Glow"); diff --git a/NPCs/DevourerofGods/DevourerofGodsBodyS.cs b/NPCs/DevourerofGods/DevourerofGodsBodyS.cs index 15a07e3ff6..8e95007eec 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBodyS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBodyS.cs @@ -200,7 +200,7 @@ namespace CalamityMod.NPCs.DevourerofGods Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); if (!npc.dontTakeDamage) diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 3dc0107f23..70d762a4dc 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -877,7 +877,7 @@ namespace CalamityMod.NPCs.DevourerofGods Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsHeadGlow"); diff --git a/NPCs/DevourerofGods/DevourerofGodsHead2.cs b/NPCs/DevourerofGods/DevourerofGodsHead2.cs index daa98fb752..345e53a3f7 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead2.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead2.cs @@ -320,7 +320,7 @@ namespace CalamityMod.NPCs.DevourerofGods Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsHead2Glow"); diff --git a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs index 393cc02709..627b9464c0 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs @@ -1173,7 +1173,7 @@ namespace CalamityMod.NPCs.DevourerofGods Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); if (!npc.dontTakeDamage) diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index f95b708ee2..09348e7048 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -163,7 +163,7 @@ namespace CalamityMod.NPCs.DevourerofGods Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsTailGlow"); diff --git a/NPCs/DevourerofGods/DevourerofGodsTail2.cs b/NPCs/DevourerofGods/DevourerofGodsTail2.cs index 9a38cd2818..56d963d099 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail2.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail2.cs @@ -151,7 +151,7 @@ namespace CalamityMod.NPCs.DevourerofGods Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsTail2Glow"); diff --git a/NPCs/DevourerofGods/DevourerofGodsTailS.cs b/NPCs/DevourerofGods/DevourerofGodsTailS.cs index 5d2bcd4595..2bc0b738b9 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTailS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTailS.cs @@ -196,7 +196,7 @@ namespace CalamityMod.NPCs.DevourerofGods Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); if (!npc.dontTakeDamage) diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index 1438c463c2..f4777b1b0f 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -1,6 +1,9 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Events; +using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -15,10 +18,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { // Whether the body is venting heat or not, it is vulnerable to damage during venting private bool vulnerable = false; + public ThanatosSmokeParticleSet SmokeDrawer = new ThanatosSmokeParticleSet(-1, 4, 0f, 16f, 1.5f); public override void SetStaticDefaults() { - DisplayName.SetDefault("Thanatos"); + DisplayName.SetDefault("XM-05 Thanatos"); Main.npcFrameCount[npc.type] = 5; } @@ -27,12 +31,12 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos npc.Calamity().canBreakPlayerDefense = true; npc.npcSlots = 5f; npc.GetNPCDamage(); - npc.width = 148; - npc.height = 98; + npc.width = 88; + npc.height = 88; npc.defense = 100; - npc.DR_NERD(0.99f); + npc.DR_NERD(0.9999f); npc.Calamity().unbreakableDR = true; - npc.LifeMaxNERB(1000000, 1150000); + npc.LifeMaxNERB(1000000, 1150000, 500000); double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; @@ -80,6 +84,12 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (npc.ai[2] > 0f) npc.realLife = (int)npc.ai[2]; + // Difficulty modes + bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || malice; + bool revenge = CalamityWorld.revenge || malice; + bool expertMode = Main.expertMode || malice; + // Check if other segments are still alive, if not, die bool shouldDespawn = true; for (int i = 0; i < Main.maxNPCs; i++) @@ -113,7 +123,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { if (Main.npc[(int)npc.ai[1]].Opacity > 0.5f) { - npc.Opacity += 0.15f; + npc.Opacity += 0.2f; if (npc.Opacity > 1f) npc.Opacity = 1f; } @@ -134,11 +144,17 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { if (Main.netMode != NetmodeID.MultiplayerClient) { - npc.ai[3] += 1f; + // Only charge up lasers if not venting or firing lasers + if (npc.Calamity().newAI[0] == 0f) + npc.ai[3] += 1f; + if (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge) { - float divisor = 180f; - if ((npc.ai[3] % divisor == 0f && npc.localAI[2] % 10f == 0f) || npc.Calamity().newAI[0] > 0f) + float divisor = 120f; + int numSegments = ThanatosHead.minLength; + double numSegmentsAbleToFire = malice ? 25D : death ? 20D : revenge ? 17.5 : expertMode ? 15D : 10D; + float segmentDivisor = (float)Math.Round(numSegments / numSegmentsAbleToFire); + if ((npc.ai[3] % divisor == 0f && npc.localAI[2] % segmentDivisor == 0f) || npc.Calamity().newAI[0] > 0f) { // Body is vulnerable while firing lasers vulnerable = true; @@ -175,15 +191,12 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - float laserVelocity = 12f; for (int i = 0; i < numProjectiles; i++) { // Normal laser - Vector2 projectileDestination = targetCenterArray[i] - npc.Center; - Vector2 projectileVelocity = Vector2.Normalize(projectileDestination) * laserVelocity; int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.Center, projectileVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); } } } @@ -202,7 +215,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else { npc.ai[3] += 1f; - float shootProjectile = 60f; + float shootProjectile = 120f; float timer = npc.ai[0] + 15f; float divisor = timer + shootProjectile; if (npc.ai[3] % divisor == 0f || npc.Calamity().newAI[0] > 0f) @@ -242,8 +255,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - float predictionAmt = 20f; - float laserVelocity = 12f; + float predictionAmt = malice ? 40f : death ? 25f : revenge ? 20f : expertMode ? 15f : 5f; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"), npc.Center); for (int i = 0; i < numProjectiles; i++) { @@ -251,25 +265,17 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (calamityGlobalNPC_Head.newAI[1] == (float)ThanatosHead.SecondaryPhase.Passive) { // Normal laser - Vector2 projectileDestination = targetCenterArray[i] - npc.Center; - Vector2 projectileVelocity = Vector2.Normalize(projectileDestination) * laserVelocity; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.Center, projectileVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); } else { // Predictive laser - Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt - npc.Center; - Vector2 projectileVelocity = Vector2.Normalize(projectileDestination) * laserVelocity; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.Center, projectileVelocity, type, damage, 0f, Main.myPlayer); + Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt; + Projectile.NewProjectile(npc.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); // Opposite laser - projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt - npc.Center; - projectileVelocity = Vector2.Normalize(projectileDestination) * laserVelocity; - Projectile.NewProjectile(npc.Center, projectileVelocity, type, damage, 0f, Main.myPlayer); + projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt; + Projectile.NewProjectile(npc.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); } } } @@ -311,33 +317,39 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } + if (npc.Calamity().newAI[2] < ThanatosHead.immunityTime) + npc.Calamity().newAI[2] += 1f; + // Homing only works if vulnerable is true npc.chaseable = vulnerable; // Adjust DR based on vulnerable - npc.Calamity().DR = vulnerable ? 0f : 0.99f; + npc.Calamity().DR = vulnerable ? 0f : 0.9999f; npc.Calamity().unbreakableDR = !vulnerable; // Vent noise and steam + SmokeDrawer.ParticleSpawnRate = 9999999; if (vulnerable) { // Noise + float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.25f : 1f; if (npc.localAI[0] == 0f) - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ThanatosVent"), npc.Center); + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ThanatosVent").WithVolume(volume), npc.Center); // Steam float maxSteamTime = 180f; - int maxGores = 4; + npc.localAI[0] += 1f; if (npc.localAI[0] < maxSteamTime) { - npc.localAI[0] += 1f; - int goreAmt = maxGores - (int)Math.Round(npc.localAI[0] / 60f); - CalamityUtils.ExplosionGores(npc.Center, goreAmt, true, npc.velocity); + SmokeDrawer.BaseMoveRotation = npc.rotation - MathHelper.PiOver2; + SmokeDrawer.ParticleSpawnRate = 3; } } else npc.localAI[0] = 0f; + SmokeDrawer.Update(); + Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2); @@ -401,6 +413,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) { + if (npc.Calamity().newAI[2] < ThanatosHead.immunityTime) + damage *= 0.01; + return !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); } @@ -409,22 +424,22 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Swap between venting and non-venting frames CalamityGlobalNPC calamityGlobalNPC_Head = Main.npc[(int)npc.ai[2]].Calamity(); bool shootTrackingLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f; + npc.frameCounter += 1D; if (shootTrackingLasers) { - npc.frameCounter += 1D; - if (npc.Calamity().newAI[1] == 0f) + if (npc.Calamity().newAI[1] == 0f && npc.Calamity().newAI[0] > 0f) { if (npc.frameCounter >= 12D) { npc.frame.Y += frameHeight; npc.frameCounter = 0D; } - if (npc.frame.Y >= frameHeight * Main.npcFrameCount[npc.type]) - npc.frame.Y = frameHeight * Main.npcFrameCount[npc.type]; + int finalFrame = Main.npcFrameCount[npc.type] - 1; + if (npc.frame.Y > frameHeight * finalFrame) + npc.frame.Y = frameHeight * finalFrame; } else { - npc.frameCounter += 1D; if (npc.frameCounter >= 12D) { npc.frame.Y -= frameHeight; @@ -436,7 +451,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } else { - npc.frameCounter += 1D; if (npc.frameCounter >= 12D) { npc.frame.Y -= frameHeight; @@ -447,7 +461,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) { SpriteEffects spriteEffects = SpriteEffects.None; if (npc.spriteDirection == 1) @@ -458,11 +472,15 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos Vector2 center = npc.Center - Main.screenPosition; center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - center += vector * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + center += vector * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, center, npc.frame, npc.GetAlpha(drawColor), npc.rotation, vector, npc.scale, spriteEffects, 0f); texture = ModContent.GetTexture("CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosBody1Glow"); spriteBatch.Draw(texture, center, npc.frame, Color.White * npc.Opacity, npc.rotation, vector, npc.scale, spriteEffects, 0f); + + SmokeDrawer.DrawSet(npc.Center); + + return false; } public override bool CheckActive() => false; @@ -510,7 +528,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos int duration = vulnerable ? 120 : 60; player.AddBuff(BuffID.Ichor, duration); player.AddBuff(BuffID.CursedInferno, duration); - player.AddBuff(ModContent.BuffType(), duration / 4); player.AddBuff(ModContent.BuffType(), duration); player.AddBuff(ModContent.BuffType(), duration); player.AddBuff(ModContent.BuffType(), duration); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index f7c3d846d8..33d377f148 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -1,6 +1,9 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Events; +using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -15,10 +18,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { // Whether the body is venting heat or not, it is vulnerable to damage during venting private bool vulnerable = false; + public ThanatosSmokeParticleSet SmokeDrawer = new ThanatosSmokeParticleSet(-1, 4, 0f, 16f, 1.5f); public override void SetStaticDefaults() { - DisplayName.SetDefault("Thanatos"); + DisplayName.SetDefault("XM-05 Thanatos"); Main.npcFrameCount[npc.type] = 5; } @@ -27,12 +31,12 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos npc.Calamity().canBreakPlayerDefense = true; npc.npcSlots = 5f; npc.GetNPCDamage(); - npc.width = 136; - npc.height = 100; + npc.width = 90; + npc.height = 90; npc.defense = 100; - npc.DR_NERD(0.99f); + npc.DR_NERD(0.9999f); npc.Calamity().unbreakableDR = true; - npc.LifeMaxNERB(1000000, 1150000); + npc.LifeMaxNERB(1000000, 1150000, 500000); double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; @@ -80,6 +84,12 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (npc.ai[2] > 0f) npc.realLife = (int)npc.ai[2]; + // Difficulty modes + bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || malice; + bool revenge = CalamityWorld.revenge || malice; + bool expertMode = Main.expertMode || malice; + // Check if other segments are still alive, if not, die bool shouldDespawn = true; for (int i = 0; i < Main.maxNPCs; i++) @@ -113,7 +123,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { if (Main.npc[(int)npc.ai[1]].Opacity > 0.5f) { - npc.Opacity += 0.15f; + npc.Opacity += 0.2f; if (npc.Opacity > 1f) npc.Opacity = 1f; } @@ -134,11 +144,17 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { if (Main.netMode != NetmodeID.MultiplayerClient) { - npc.ai[3] += 1f; + // Only charge up lasers if not venting or firing lasers + if (npc.Calamity().newAI[0] == 0f) + npc.ai[3] += 1f; + if (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge) { - float divisor = 180f; - if ((npc.ai[3] % divisor == 0f && npc.localAI[2] % 10f == 0f) || npc.Calamity().newAI[0] > 0f) + float divisor = 120f; + int numSegments = ThanatosHead.minLength; + double numSegmentsAbleToFire = malice ? 25D : death ? 20D : revenge ? 17.5 : expertMode ? 15D : 10D; + float segmentDivisor = (float)Math.Round(numSegments / numSegmentsAbleToFire); + if ((npc.ai[3] % divisor == 0f && npc.localAI[2] % segmentDivisor == 0f) || npc.Calamity().newAI[0] > 0f) { // Body is vulnerable while firing lasers vulnerable = true; @@ -175,15 +191,12 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - float laserVelocity = 12f; for (int i = 0; i < numProjectiles; i++) { // Normal laser - Vector2 projectileDestination = targetCenterArray[i] - npc.Center; - Vector2 projectileVelocity = Vector2.Normalize(projectileDestination) * laserVelocity; int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.Center, projectileVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); } } } @@ -202,7 +215,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else { npc.ai[3] += 1f; - float shootProjectile = 60f; + float shootProjectile = 120f; float timer = npc.ai[0] + 15f; float divisor = timer + shootProjectile; if (npc.ai[3] % divisor == 0f || npc.Calamity().newAI[0] > 0f) @@ -242,8 +255,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - float predictionAmt = 20f; - float laserVelocity = 12f; + float predictionAmt = malice ? 40f : death ? 25f : revenge ? 20f : expertMode ? 15f : 5f; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"), npc.Center); for (int i = 0; i < numProjectiles; i++) { @@ -251,25 +265,17 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (calamityGlobalNPC_Head.newAI[1] == (float)ThanatosHead.SecondaryPhase.Passive) { // Normal laser - Vector2 projectileDestination = targetCenterArray[i] - npc.Center; - Vector2 projectileVelocity = Vector2.Normalize(projectileDestination) * laserVelocity; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.Center, projectileVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); } else { // Predictive laser - Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt - npc.Center; - Vector2 projectileVelocity = Vector2.Normalize(projectileDestination) * laserVelocity; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.Center, projectileVelocity, type, damage, 0f, Main.myPlayer); + Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt; + Projectile.NewProjectile(npc.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); // Opposite laser - projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt - npc.Center; - projectileVelocity = Vector2.Normalize(projectileDestination) * laserVelocity; - Projectile.NewProjectile(npc.Center, projectileVelocity, type, damage, 0f, Main.myPlayer); + projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt; + Projectile.NewProjectile(npc.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); } } } @@ -311,33 +317,39 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } + if (npc.Calamity().newAI[2] < ThanatosHead.immunityTime) + npc.Calamity().newAI[2] += 1f; + // Homing only works if vulnerable is true npc.chaseable = vulnerable; // Adjust DR based on vulnerable - npc.Calamity().DR = vulnerable ? 0f : 0.99f; + npc.Calamity().DR = vulnerable ? 0f : 0.9999f; npc.Calamity().unbreakableDR = !vulnerable; // Vent noise and steam + SmokeDrawer.ParticleSpawnRate = 9999999; if (vulnerable) { // Noise + float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.25f : 1f; if (npc.localAI[0] == 0f) - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ThanatosVent"), npc.Center); + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ThanatosVent").WithVolume(volume), npc.Center); // Steam float maxSteamTime = 180f; - int maxGores = 4; + npc.localAI[0] += 1f; if (npc.localAI[0] < maxSteamTime) { - npc.localAI[0] += 1f; - int goreAmt = maxGores - (int)Math.Round(npc.localAI[0] / 60f); - CalamityUtils.ExplosionGores(npc.Center, goreAmt, true, npc.velocity); + SmokeDrawer.BaseMoveRotation = npc.rotation - MathHelper.PiOver2; + SmokeDrawer.ParticleSpawnRate = 3; } } else npc.localAI[0] = 0f; + SmokeDrawer.Update(); + Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2); @@ -401,6 +413,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) { + if (npc.Calamity().newAI[2] < ThanatosHead.immunityTime) + damage *= 0.01; + return !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); } @@ -409,22 +424,22 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Swap between venting and non-venting frames CalamityGlobalNPC calamityGlobalNPC_Head = Main.npc[(int)npc.ai[2]].Calamity(); bool shootTrackingLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f; + npc.frameCounter += 1D; if (shootTrackingLasers) { - npc.frameCounter += 1D; - if (npc.Calamity().newAI[1] == 0f) + if (npc.Calamity().newAI[1] == 0f && npc.Calamity().newAI[0] > 0f) { if (npc.frameCounter >= 12D) { npc.frame.Y += frameHeight; npc.frameCounter = 0D; } - if (npc.frame.Y >= frameHeight * Main.npcFrameCount[npc.type]) - npc.frame.Y = frameHeight * Main.npcFrameCount[npc.type]; + int finalFrame = Main.npcFrameCount[npc.type] - 1; + if (npc.frame.Y > frameHeight * finalFrame) + npc.frame.Y = frameHeight * finalFrame; } else { - npc.frameCounter += 1D; if (npc.frameCounter >= 12D) { npc.frame.Y -= frameHeight; @@ -436,7 +451,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } else { - npc.frameCounter += 1D; if (npc.frameCounter >= 12D) { npc.frame.Y -= frameHeight; @@ -447,7 +461,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) { SpriteEffects spriteEffects = SpriteEffects.None; if (npc.spriteDirection == 1) @@ -458,11 +472,15 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos Vector2 center = npc.Center - Main.screenPosition; center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - center += vector * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + center += vector * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, center, npc.frame, npc.GetAlpha(drawColor), npc.rotation, vector, npc.scale, spriteEffects, 0f); texture = ModContent.GetTexture("CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosBody2Glow"); spriteBatch.Draw(texture, center, npc.frame, Color.White * npc.Opacity, npc.rotation, vector, npc.scale, spriteEffects, 0f); + + SmokeDrawer.DrawSet(npc.Center); + + return false; } public override bool CheckActive() => false; @@ -510,7 +528,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos int duration = vulnerable ? 120 : 60; player.AddBuff(BuffID.Ichor, duration); player.AddBuff(BuffID.CursedInferno, duration); - player.AddBuff(ModContent.BuffType(), duration / 4); player.AddBuff(ModContent.BuffType(), duration); player.AddBuff(ModContent.BuffType(), duration); player.AddBuff(ModContent.BuffType(), duration); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 2fc38539ec..31ef75de3f 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -1,6 +1,9 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Events; +using CalamityMod.Items.Potions; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -41,6 +44,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos set => npc.Calamity().newAI[1] = value; } + public ThanatosSmokeParticleSet SmokeDrawer = new ThanatosSmokeParticleSet(-1, 4, 0f, 16f, 1.5f); + + // Invincibility time for the first 10 seconds + public const float immunityTime = 600f; + // Whether the head is venting heat or not, it is vulnerable to damage during venting private bool vulnerable = false; @@ -57,7 +65,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos private const float soundDistance = 2800f; // Length variables - private const int minLength = 100; + public const int minLength = 100; private const int maxLength = 101; // Variable used to stop the segment spawning loop @@ -67,14 +75,14 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos private float chargeVelocityScalar = 0f; // Total duration of the deathray telegraph - private const float deathrayTelegraphDuration = 120f; + private const float deathrayTelegraphDuration = 180f; // Total duration of the deathray private const float deathrayDuration = 180f; public override void SetStaticDefaults() { - DisplayName.SetDefault("Thanatos"); + DisplayName.SetDefault("XM-05 Thanatos"); Main.npcFrameCount[npc.type] = 5; } @@ -83,12 +91,12 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos npc.Calamity().canBreakPlayerDefense = true; npc.npcSlots = 5f; npc.GetNPCDamage(); - npc.width = 104; - npc.height = 174; + npc.width = 164; + npc.height = 164; npc.defense = 80; - npc.DR_NERD(0.99f); + npc.DR_NERD(0.9999f); npc.Calamity().unbreakableDR = true; - npc.LifeMaxNERB(1000000, 1150000); + npc.LifeMaxNERB(1000000, 1150000, 500000); double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; @@ -311,7 +319,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Phase gate values float velocityAdjustTime = 20f; - float speedUpTime = 300f; + float speedUpTime = 480f; float slowDownTime = 120f; float chargePhaseGateValue = speedUpTime + slowDownTime; @@ -322,7 +330,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos npc.dontTakeDamage = invisiblePhase; if (!invisiblePhase) { - npc.Opacity += 0.15f; + npc.Opacity += 0.2f; if (npc.Opacity > 1f) npc.Opacity = 1f; } @@ -352,12 +360,19 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos float laserBarrageLocationDistance = turnDistance * 5f; // Velocity and turn speed values - float baseVelocity = 9f; - float turnSpeed = MathHelper.ToRadians(1f); - float chargeVelocityMult = MathHelper.Lerp(1f, 2f, chargeVelocityScalar); - float chargeTurnSpeedMult = MathHelper.Lerp(1f, 2f, chargeVelocityScalar); - float laserBarragePhaseVelocityMult = MathHelper.Lerp(1f, 2f, chargeVelocityScalar); - float laserBarragePhaseTurnSpeedMult = MathHelper.Lerp(1f, 8f, chargeVelocityScalar); + float baseVelocityMult = malice ? 1.3f : death ? 1.2f : revenge ? 1.15f : expertMode ? 1.1f : 1f; + float baseVelocity = 7f * baseVelocityMult; + float turnDegrees = baseVelocity * 0.11f; + if (berserk) + { + baseVelocity *= 1.2f; + turnDegrees *= 1.2f; + } + float turnSpeed = MathHelper.ToRadians(turnDegrees); + float chargeVelocityMult = MathHelper.Lerp(1f, 1.5f, chargeVelocityScalar); + float chargeTurnSpeedMult = MathHelper.Lerp(1f, 1.5f, chargeVelocityScalar); + float laserBarragePhaseVelocityMult = MathHelper.Lerp(1f, 1.5f, chargeVelocityScalar); + float laserBarragePhaseTurnSpeedMult = MathHelper.Lerp(1f, 3f, chargeVelocityScalar); float deathrayVelocityMult = MathHelper.Lerp(1f, 4f, chargeVelocityScalar); float deathrayTurnSpeedMult = MathHelper.Lerp(1f, 4f, chargeVelocityScalar); @@ -365,6 +380,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos float chargeVelocityScalarIncrement = 1f / speedUpTime; float chargeVelocityScalarDecrement = 1f / slowDownTime; + // Scalar to use during deathray phase + float deathrayVelocityScalarIncrement = 1f / deathrayDuration; + // Scalar to use during laser barrage, passive and immune phases float laserBarrageVelocityScalarIncrement = 0.01f; float laserBarrageVelocityScalarDecrement = 1f / velocityAdjustTime; @@ -560,7 +578,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Use a lerp to smoothly scale up velocity and turn speed if (calamityGlobalNPC.newAI[3] == 0f) { - chargeVelocityScalar += chargeVelocityScalarIncrement; + chargeVelocityScalar += deathrayVelocityScalarIncrement; if (chargeVelocityScalar >= 1f) { chargeVelocityScalar = 1f; @@ -572,7 +590,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } else { - chargeVelocityScalar -= chargeVelocityScalarDecrement; + // Reduce velocity scalar very quickly + chargeVelocityScalar -= deathrayVelocityScalarIncrement * 5f; if (chargeVelocityScalar < 0f) chargeVelocityScalar = 0f; } @@ -590,17 +609,38 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (calamityGlobalNPC.newAI[2] < deathrayTelegraphDuration) { // Fire deathray telegraph beams - if (Main.netMode != NetmodeID.MultiplayerClient) + if (calamityGlobalNPC.newAI[2] == 0f) { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int type = ModContent.ProjectileType(); + for (int b = 0; b < 6; b++) + { + int beam = Projectile.NewProjectile(npc.Center, Vector2.Zero, type, 0, 0f, 255, npc.whoAmI); + // Determine the initial offset angle of telegraph. It will be smoothened to give a "stretch" effect. + if (Main.projectile.IndexInRange(beam)) + { + float squishedRatio = (float)Math.Pow((float)Math.Sin(MathHelper.Pi * b / 6f), 2D); + float smoothenedRatio = MathHelper.SmoothStep(0f, 1f, squishedRatio); + Main.projectile[beam].ai[1] = MathHelper.Lerp(-0.74f, 0.74f, smoothenedRatio); + } + } + Projectile.NewProjectile(npc.Center, Vector2.Zero, type, 0, 0f, 255, npc.whoAmI); + } } } else { // Fire deathray - if (Main.netMode != NetmodeID.MultiplayerClient) + if (calamityGlobalNPC.newAI[2] == deathrayTelegraphDuration) { - + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(npc.Center, Vector2.Zero, type, damage, 0f, 255, npc.whoAmI); + } } } @@ -620,14 +660,18 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos break; } + if (npc.localAI[3] < immunityTime) + npc.localAI[3] += 1f; + // Homing only works if vulnerable is true npc.chaseable = vulnerable; // Adjust DR based on vulnerable - npc.Calamity().DR = vulnerable ? 0f : 0.99f; + npc.Calamity().DR = vulnerable ? 0f : 0.9999f; npc.Calamity().unbreakableDR = !vulnerable; // Vent noise and steam + SmokeDrawer.ParticleSpawnRate = 9999999; if (vulnerable) { // Noise @@ -636,17 +680,18 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Steam float maxSteamTime = 180f; - int maxGores = 4; + npc.localAI[1] += 1f; if (npc.localAI[1] < maxSteamTime) { - npc.localAI[1] += 1f; - int goreAmt = maxGores - (int)Math.Round(npc.localAI[1] / 60f); - CalamityUtils.ExplosionGores(npc.Center, goreAmt, true, npc.velocity); + SmokeDrawer.BaseMoveRotation = npc.rotation - MathHelper.PiOver2; + SmokeDrawer.ParticleSpawnRate = 3; } } else npc.localAI[1] = 0f; + SmokeDrawer.Update(); + // Increase velocity if velocity is ever zero if (npc.velocity == Vector2.Zero) npc.velocity = Vector2.Normalize(player.Center - npc.Center).SafeNormalize(Vector2.Zero) * baseVelocity; @@ -692,6 +737,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) { + if (npc.localAI[3] < immunityTime) + damage *= 0.01; + return !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); } @@ -704,9 +752,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void FindFrame(int frameHeight) // 5 total frames { // Swap between venting and non-venting frames + npc.frameCounter += 1D; if (AIState == (float)Phase.Charge || AIState == (float)Phase.UndergroundLaserBarrage) { - npc.frameCounter += 1D; if (npc.frameCounter >= 12D) { npc.frame.Y -= frameHeight; @@ -717,19 +765,19 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } else { - npc.frameCounter += 1D; if (npc.frameCounter >= 12D) { npc.frame.Y += frameHeight; npc.frameCounter = 0D; } - if (npc.frame.Y >= frameHeight * Main.npcFrameCount[npc.type]) - npc.frame.Y = frameHeight * Main.npcFrameCount[npc.type]; + int finalFrame = Main.npcFrameCount[npc.type] - 1; + if (npc.frame.Y >= frameHeight * finalFrame) + npc.frame.Y = frameHeight * finalFrame; } } - public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) - { + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { SpriteEffects spriteEffects = SpriteEffects.None; if (npc.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; @@ -739,14 +787,23 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos Vector2 center = npc.Center - Main.screenPosition; center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - center += vector * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + center += vector * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, center, npc.frame, npc.GetAlpha(drawColor), npc.rotation, vector, npc.scale, spriteEffects, 0f); texture = ModContent.GetTexture("CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosHeadGlow"); spriteBatch.Draw(texture, center, npc.frame, Color.White * npc.Opacity, npc.rotation, vector, npc.scale, spriteEffects, 0f); + + SmokeDrawer.DrawSet(npc.Center); + + return false; } - public override void NPCLoot() + public override void BossLoot(ref string name, ref int potionType) + { + potionType = ModContent.ItemType(); + } + + public override void NPCLoot() { /*DropHelper.DropItem(npc, ModContent.ItemType(), 80, 100); DropHelper.DropItem(npc, ModContent.ItemType()); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index 61dd111125..2f718d7be1 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Events; +using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -15,10 +17,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { // Whether the tail is venting heat or not, it is vulnerable to damage during venting private bool vulnerable = false; + public ThanatosSmokeParticleSet SmokeDrawer = new ThanatosSmokeParticleSet(-1, 4, 0f, 16f, 1.5f); public override void SetStaticDefaults() { - DisplayName.SetDefault("Thanatos"); + DisplayName.SetDefault("XM-05 Thanatos"); Main.npcFrameCount[npc.type] = 5; } @@ -27,12 +30,12 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos npc.Calamity().canBreakPlayerDefense = true; npc.npcSlots = 5f; npc.GetNPCDamage(); - npc.width = 84; - npc.height = 118; + npc.width = 76; + npc.height = 110; npc.defense = 120; - npc.DR_NERD(0.99f); + npc.DR_NERD(0.9999f); npc.Calamity().unbreakableDR = true; - npc.LifeMaxNERB(1000000, 1150000); + npc.LifeMaxNERB(1000000, 1150000, 500000); double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; @@ -80,6 +83,12 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (npc.ai[2] > 0f) npc.realLife = (int)npc.ai[2]; + // Difficulty modes + bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || malice; + bool revenge = CalamityWorld.revenge || malice; + bool expertMode = Main.expertMode || malice; + // Check if other segments are still alive, if not, die bool shouldDespawn = true; for (int i = 0; i < Main.maxNPCs; i++) @@ -113,7 +122,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { if (Main.npc[(int)npc.ai[1]].Opacity > 0.5f) { - npc.Opacity += 0.15f; + npc.Opacity += 0.2f; if (npc.Opacity > 1f) npc.Opacity = 1f; } @@ -134,11 +143,17 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { if (Main.netMode != NetmodeID.MultiplayerClient) { - npc.ai[3] += 1f; + // Only charge up lasers if not venting or firing lasers + if (npc.Calamity().newAI[0] == 0f) + npc.ai[3] += 1f; + if (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge) { - float divisor = 180f; - if ((npc.ai[3] % divisor == 0f && npc.localAI[2] % 10f == 0f) || npc.Calamity().newAI[0] > 0f) + float divisor = 120f; + int numSegments = ThanatosHead.minLength; + double numSegmentsAbleToFire = malice ? 25D : death ? 20D : revenge ? 17.5 : expertMode ? 15D : 10D; + float segmentDivisor = (float)Math.Round(numSegments / numSegmentsAbleToFire); + if ((npc.ai[3] % divisor == 0f && npc.localAI[2] % segmentDivisor == 0f) || npc.Calamity().newAI[0] > 0f) { // Body is vulnerable while firing lasers vulnerable = true; @@ -175,15 +190,12 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - float laserVelocity = 12f; for (int i = 0; i < numProjectiles; i++) { // Normal laser - Vector2 projectileDestination = targetCenterArray[i] - npc.Center; - Vector2 projectileVelocity = Vector2.Normalize(projectileDestination) * laserVelocity; int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.Center, projectileVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); } } } @@ -202,7 +214,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else { npc.ai[3] += 1f; - float shootProjectile = 60f; + float shootProjectile = 120f; float timer = npc.ai[0] + 15f; float divisor = timer + shootProjectile; if (npc.ai[3] % divisor == 0f || npc.Calamity().newAI[0] > 0f) @@ -242,8 +254,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - float predictionAmt = 20f; - float laserVelocity = 12f; + float predictionAmt = malice ? 40f : death ? 25f : revenge ? 20f : expertMode ? 15f : 5f; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"), npc.Center); for (int i = 0; i < numProjectiles; i++) { @@ -251,25 +264,17 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (calamityGlobalNPC_Head.newAI[1] == (float)ThanatosHead.SecondaryPhase.Passive) { // Normal laser - Vector2 projectileDestination = targetCenterArray[i] - npc.Center; - Vector2 projectileVelocity = Vector2.Normalize(projectileDestination) * laserVelocity; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.Center, projectileVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); } else { // Predictive laser - Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt - npc.Center; - Vector2 projectileVelocity = Vector2.Normalize(projectileDestination) * laserVelocity; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.Center, projectileVelocity, type, damage, 0f, Main.myPlayer); + Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt; + Projectile.NewProjectile(npc.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); // Opposite laser - projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt - npc.Center; - projectileVelocity = Vector2.Normalize(projectileDestination) * laserVelocity; - Projectile.NewProjectile(npc.Center, projectileVelocity, type, damage, 0f, Main.myPlayer); + projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt; + Projectile.NewProjectile(npc.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); } } } @@ -311,33 +316,39 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } + if (npc.Calamity().newAI[2] < ThanatosHead.immunityTime) + npc.Calamity().newAI[2] += 1f; + // Homing only works if vulnerable is true npc.chaseable = vulnerable; // Adjust DR based on vulnerable - npc.Calamity().DR = vulnerable ? 0f : 0.99f; + npc.Calamity().DR = vulnerable ? 0f : 0.9999f; npc.Calamity().unbreakableDR = !vulnerable; // Vent noise and steam + SmokeDrawer.ParticleSpawnRate = 9999999; if (vulnerable) { // Noise + float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.25f : 1f; if (npc.localAI[0] == 0f) - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ThanatosVent"), npc.Center); + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ThanatosVent").WithVolume(volume), npc.Center); // Steam float maxSteamTime = 180f; - int maxGores = 4; + npc.localAI[0] += 1f; if (npc.localAI[0] < maxSteamTime) { - npc.localAI[0] += 1f; - int goreAmt = maxGores - (int)Math.Round(npc.localAI[0] / 60f); - CalamityUtils.ExplosionGores(npc.Center, goreAmt, true, npc.velocity); + SmokeDrawer.BaseMoveRotation = npc.rotation - MathHelper.PiOver2; + SmokeDrawer.ParticleSpawnRate = 3; } } else npc.localAI[0] = 0f; + SmokeDrawer.Update(); + Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2); @@ -401,6 +412,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) { + if (npc.Calamity().newAI[2] < ThanatosHead.immunityTime) + damage *= 0.01; + return !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); } @@ -409,22 +423,22 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Swap between venting and non-venting frames CalamityGlobalNPC calamityGlobalNPC_Head = Main.npc[(int)npc.ai[2]].Calamity(); bool shootTrackingLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f; + npc.frameCounter += 1D; if (shootTrackingLasers) { - npc.frameCounter += 1D; - if (npc.Calamity().newAI[1] == 0f) + if (npc.Calamity().newAI[1] == 0f && npc.Calamity().newAI[0] > 0f) { if (npc.frameCounter >= 12D) { npc.frame.Y += frameHeight; npc.frameCounter = 0D; } - if (npc.frame.Y >= frameHeight * Main.npcFrameCount[npc.type]) - npc.frame.Y = frameHeight * Main.npcFrameCount[npc.type]; + int finalFrame = Main.npcFrameCount[npc.type] - 1; + if (npc.frame.Y > frameHeight * finalFrame) + npc.frame.Y = frameHeight * finalFrame; } else { - npc.frameCounter += 1D; if (npc.frameCounter >= 12D) { npc.frame.Y -= frameHeight; @@ -436,7 +450,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } else { - npc.frameCounter += 1D; if (npc.frameCounter >= 12D) { npc.frame.Y -= frameHeight; @@ -447,7 +460,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) { SpriteEffects spriteEffects = SpriteEffects.None; if (npc.spriteDirection == 1) @@ -458,11 +471,15 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos Vector2 center = npc.Center - Main.screenPosition; center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - center += vector * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + center += vector * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, center, npc.frame, npc.GetAlpha(drawColor), npc.rotation, vector, npc.scale, spriteEffects, 0f); texture = ModContent.GetTexture("CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosTailGlow"); spriteBatch.Draw(texture, center, npc.frame, Color.White * npc.Opacity, npc.rotation, vector, npc.scale, spriteEffects, 0f); + + SmokeDrawer.DrawSet(npc.Center); + + return false; } public override bool CheckActive() => false; @@ -511,7 +528,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos int duration = vulnerable ? 60 : 30; player.AddBuff(BuffID.Ichor, duration); player.AddBuff(BuffID.CursedInferno, duration); - player.AddBuff(ModContent.BuffType(), duration / 4); player.AddBuff(ModContent.BuffType(), duration); player.AddBuff(ModContent.BuffType(), duration); player.AddBuff(ModContent.BuffType(), duration); diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 11cde0cb95..fc52dfc390 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -146,7 +146,7 @@ namespace CalamityMod.NPCs.HiveMind { if (NPC.AnyNPCs(ModContent.NPCType())) { - npc.Calamity().DR = 0.99f; + npc.Calamity().DR = 0.9999f; npc.Calamity().unbreakableDR = true; } else diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index ac1f344a3f..19ffe9175f 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -1,4 +1,6 @@ -using CalamityMod.Events; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; @@ -169,7 +171,21 @@ namespace CalamityMod.NPCs.Leviathan npc.dontTakeDamage = spawnAnimation; - if (!player.active || player.dead || Vector2.Distance(player.Center, vector) > 5600f) + // Adjust slowing debuff immunity + bool immuneToSlowingDebuffs = npc.ai[0] == 2f; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; + npc.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; + + if (!player.active || player.dead || Vector2.Distance(player.Center, vector) > 5600f) { npc.TargetClosest(false); player = Main.player[npc.target]; diff --git a/NPCs/Leviathan/LeviathanStart.cs b/NPCs/Leviathan/LeviathanStart.cs index 7ff862c89c..c0bc063028 100644 --- a/NPCs/Leviathan/LeviathanStart.cs +++ b/NPCs/Leviathan/LeviathanStart.cs @@ -92,7 +92,7 @@ namespace CalamityMod.NPCs.Leviathan Vector2 drawPos = npc.Center - Main.screenPosition; drawPos -= new Vector2(drawTex.Width, drawTex.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - drawPos += origin * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + drawPos += origin * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(drawTex, drawPos, npc.frame, npc.GetAlpha(lightColor), npc.rotation, origin, npc.scale, spriteEffects, 0f); drawTex = ModContent.GetTexture("CalamityMod/NPCs/Leviathan/LeviathanStartGlow"); diff --git a/NPCs/NormalNPCs/Cnidrion.cs b/NPCs/NormalNPCs/Cnidrion.cs index a1b798e7cc..1493e67304 100644 --- a/NPCs/NormalNPCs/Cnidrion.cs +++ b/NPCs/NormalNPCs/Cnidrion.cs @@ -300,6 +300,7 @@ namespace CalamityMod.NPCs.NormalNPCs DropHelper.DropItem(npc, ItemID.Starfish, 1, 3); DropHelper.DropItem(npc, ItemID.Seashell, 1, 3); DropHelper.DropItem(npc, ModContent.ItemType(), 1, 3); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); } } } diff --git a/NPCs/OldDuke/OldDuke.cs b/NPCs/OldDuke/OldDuke.cs index f64d4e9fb2..18fc5484d2 100644 --- a/NPCs/OldDuke/OldDuke.cs +++ b/NPCs/OldDuke/OldDuke.cs @@ -232,7 +232,7 @@ namespace CalamityMod.NPCs.OldDuke color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } @@ -285,7 +285,7 @@ namespace CalamityMod.NPCs.OldDuke color39 *= 1f - num157; Vector2 vector42 = npc.Center + (num160 / (float)num156 * MathHelper.TwoPi + npc.rotation).ToRotationVector2() * scaleFactor9 * num157 - Main.screenPosition; vector42 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector42 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector42 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector42, npc.frame, color39, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } @@ -295,7 +295,7 @@ namespace CalamityMod.NPCs.OldDuke color2 = npc.GetAlpha(color2); Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, (npc.ai[0] > 9f ? color2 : npc.GetAlpha(lightColor)), npc.rotation, vector11, npc.scale, spriteEffects, 0f); if (npc.ai[0] >= 4f && npc.Calamity().newAI[1] != 1f) @@ -340,7 +340,7 @@ namespace CalamityMod.NPCs.OldDuke color41 *= (num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } @@ -352,7 +352,7 @@ namespace CalamityMod.NPCs.OldDuke color42 *= 1f - num157; Vector2 vector45 = npc.Center + (num164 / (float)num156 * MathHelper.TwoPi + npc.rotation).ToRotationVector2() * scaleFactor9 * num157 - Main.screenPosition; vector45 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector45 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector45 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector45, npc.frame, color42, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/OldDuke/OldDukeSharkron.cs b/NPCs/OldDuke/OldDukeSharkron.cs index 48dd29b190..12988856b5 100644 --- a/NPCs/OldDuke/OldDukeSharkron.cs +++ b/NPCs/OldDuke/OldDukeSharkron.cs @@ -183,14 +183,14 @@ namespace CalamityMod.NPCs.OldDuke color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); return false; diff --git a/NPCs/Perforator/PerforatorBodyLarge.cs b/NPCs/Perforator/PerforatorBodyLarge.cs index c4c1ba793d..4d31e22e11 100644 --- a/NPCs/Perforator/PerforatorBodyLarge.cs +++ b/NPCs/Perforator/PerforatorBodyLarge.cs @@ -92,7 +92,7 @@ namespace CalamityMod.NPCs.Perforator Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = npc.localAI[3] == 1f ? ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorBodyLargeAltGlow") : ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorBodyLargeGlow"); diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index e30a2177d4..d581177a2d 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -171,7 +171,7 @@ namespace CalamityMod.NPCs.Perforator Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorBodyMediumGlow"); diff --git a/NPCs/Perforator/PerforatorBodySmall.cs b/NPCs/Perforator/PerforatorBodySmall.cs index b38d262a4d..6bb0b5b173 100644 --- a/NPCs/Perforator/PerforatorBodySmall.cs +++ b/NPCs/Perforator/PerforatorBodySmall.cs @@ -92,7 +92,7 @@ namespace CalamityMod.NPCs.Perforator Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorBodySmallGlow"); diff --git a/NPCs/Perforator/PerforatorCyst.cs b/NPCs/Perforator/PerforatorCyst.cs index 36052600a3..a39976d752 100644 --- a/NPCs/Perforator/PerforatorCyst.cs +++ b/NPCs/Perforator/PerforatorCyst.cs @@ -50,7 +50,7 @@ namespace CalamityMod.NPCs.Perforator Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorCystGlow"); diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index d346c16b8c..f99789bd6f 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -502,7 +502,7 @@ namespace CalamityMod.NPCs.Perforator Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorHeadLargeGlow"); diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index 889b259962..74a3e72e3a 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -383,7 +383,7 @@ namespace CalamityMod.NPCs.Perforator Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorHeadMediumGlow"); diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index c7e1737b49..9b8705e5c8 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -437,7 +437,7 @@ namespace CalamityMod.NPCs.Perforator Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorHeadSmallGlow"); diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 23b73d341a..ba94da2886 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -413,7 +413,7 @@ namespace CalamityMod.NPCs.Perforator Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorHiveGlow"); diff --git a/NPCs/Perforator/PerforatorTailLarge.cs b/NPCs/Perforator/PerforatorTailLarge.cs index 57d0f734ea..6b15f31b17 100644 --- a/NPCs/Perforator/PerforatorTailLarge.cs +++ b/NPCs/Perforator/PerforatorTailLarge.cs @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.Perforator Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorTailLargeGlow"); diff --git a/NPCs/Perforator/PerforatorTailMedium.cs b/NPCs/Perforator/PerforatorTailMedium.cs index 244853f4b2..28b35c0ac9 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -138,7 +138,7 @@ namespace CalamityMod.NPCs.Perforator Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorTailMediumGlow"); diff --git a/NPCs/Perforator/PerforatorTailSmall.cs b/NPCs/Perforator/PerforatorTailSmall.cs index 87edea613e..354aa2f694 100644 --- a/NPCs/Perforator/PerforatorTailSmall.cs +++ b/NPCs/Perforator/PerforatorTailSmall.cs @@ -82,7 +82,7 @@ namespace CalamityMod.NPCs.Perforator Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorTailSmallGlow"); diff --git a/NPCs/NormalNPCs/PlagueBee.cs b/NPCs/PlagueEnemies/PlagueBee.cs similarity index 90% rename from NPCs/NormalNPCs/PlagueBee.cs rename to NPCs/PlagueEnemies/PlagueBee.cs index 3856a5a576..337d08d151 100644 --- a/NPCs/NormalNPCs/PlagueBee.cs +++ b/NPCs/PlagueEnemies/PlagueBee.cs @@ -8,7 +8,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.NPCs.NormalNPCs +namespace CalamityMod.NPCs.PlagueEnemies { public class PlagueBee : ModNPC { @@ -33,7 +33,6 @@ namespace CalamityMod.NPCs.NormalNPCs animationType = NPCID.Bee; npc.value = Item.buyPrice(0, 0, 5, 0); npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; npc.noGravity = true; npc.noTileCollide = false; banner = npc.type; @@ -62,17 +61,17 @@ namespace CalamityMod.NPCs.NormalNPCs color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); - texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/NormalNPCs/PlagueBeeGlow"); + texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/PlagueEnemies/PlagueBeeGlow"); Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); if (CalamityConfig.Instance.Afterimages) @@ -84,7 +83,7 @@ namespace CalamityMod.NPCs.NormalNPCs color41 *= (float)(num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } @@ -122,6 +121,7 @@ namespace CalamityMod.NPCs.NormalNPCs } if (npc.life <= 0) { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/PlagueSounds/PlagueBoom" + Main.rand.Next(1, 5)), npc.Center); for (int k = 0; k < 10; k++) { Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); diff --git a/NPCs/NormalNPCs/PlagueBee.png b/NPCs/PlagueEnemies/PlagueBee.png similarity index 100% rename from NPCs/NormalNPCs/PlagueBee.png rename to NPCs/PlagueEnemies/PlagueBee.png diff --git a/NPCs/NormalNPCs/PlagueBeeGlow.png b/NPCs/PlagueEnemies/PlagueBeeGlow.png similarity index 100% rename from NPCs/NormalNPCs/PlagueBeeGlow.png rename to NPCs/PlagueEnemies/PlagueBeeGlow.png diff --git a/NPCs/NormalNPCs/PlagueBeeLarge.cs b/NPCs/PlagueEnemies/PlagueBeeLarge.cs similarity index 90% rename from NPCs/NormalNPCs/PlagueBeeLarge.cs rename to NPCs/PlagueEnemies/PlagueBeeLarge.cs index 4fb181ef52..d1d391d517 100644 --- a/NPCs/NormalNPCs/PlagueBeeLarge.cs +++ b/NPCs/PlagueEnemies/PlagueBeeLarge.cs @@ -7,7 +7,8 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.NPCs.NormalNPCs + +namespace CalamityMod.NPCs.PlagueEnemies { public class PlagueBeeLarge : ModNPC { @@ -32,7 +33,6 @@ namespace CalamityMod.NPCs.NormalNPCs animationType = NPCID.Bee; npc.value = Item.buyPrice(0, 0, 10, 0); npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; npc.noGravity = true; npc.noTileCollide = false; banner = ModContent.NPCType(); @@ -61,17 +61,17 @@ namespace CalamityMod.NPCs.NormalNPCs color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); - texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/NormalNPCs/PlagueBeeGlow"); + texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/PlagueEnemies/PlagueBeeGlow"); Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); if (CalamityConfig.Instance.Afterimages) @@ -83,7 +83,7 @@ namespace CalamityMod.NPCs.NormalNPCs color41 *= (float)(num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } @@ -121,6 +121,7 @@ namespace CalamityMod.NPCs.NormalNPCs } if (npc.life <= 0) { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/PlagueSounds/PlagueBoom" + Main.rand.Next(1, 5)), npc.Center); for (int k = 0; k < 10; k++) { Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); diff --git a/NPCs/NormalNPCs/PlagueBeeLarge.png b/NPCs/PlagueEnemies/PlagueBeeLarge.png similarity index 100% rename from NPCs/NormalNPCs/PlagueBeeLarge.png rename to NPCs/PlagueEnemies/PlagueBeeLarge.png diff --git a/NPCs/NormalNPCs/PlaguedDerpling.cs b/NPCs/PlagueEnemies/PlaguedDerpling.cs similarity index 97% rename from NPCs/NormalNPCs/PlaguedDerpling.cs rename to NPCs/PlagueEnemies/PlaguedDerpling.cs index 0d99f51ae9..9ac9335c55 100644 --- a/NPCs/NormalNPCs/PlaguedDerpling.cs +++ b/NPCs/PlagueEnemies/PlaguedDerpling.cs @@ -8,7 +8,8 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.NPCs.NormalNPCs + +namespace CalamityMod.NPCs.PlagueEnemies { public class PlaguedDerpling : ModNPC { @@ -31,7 +32,6 @@ namespace CalamityMod.NPCs.NormalNPCs npc.knockBackResist = 0f; npc.value = Item.buyPrice(0, 0, 10, 0); npc.HitSound = SoundID.NPCHit22; - npc.DeathSound = SoundID.NPCDeath25; banner = npc.type; bannerItem = ModContent.ItemType(); } @@ -169,6 +169,7 @@ namespace CalamityMod.NPCs.NormalNPCs } if (npc.life <= 0) { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/PlagueSounds/PlagueBoom" + Main.rand.Next(1, 5)), npc.Center); for (int k = 0; k < 20; k++) { Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); diff --git a/NPCs/NormalNPCs/PlaguedDerpling.png b/NPCs/PlagueEnemies/PlaguedDerpling.png similarity index 100% rename from NPCs/NormalNPCs/PlaguedDerpling.png rename to NPCs/PlagueEnemies/PlaguedDerpling.png diff --git a/NPCs/NormalNPCs/PlaguedFlyingFox.cs b/NPCs/PlagueEnemies/PlaguedFlyingFox.cs similarity index 91% rename from NPCs/NormalNPCs/PlaguedFlyingFox.cs rename to NPCs/PlagueEnemies/PlaguedFlyingFox.cs index 6cc2b9a2e5..dc0f7e1d3f 100644 --- a/NPCs/NormalNPCs/PlaguedFlyingFox.cs +++ b/NPCs/PlagueEnemies/PlaguedFlyingFox.cs @@ -5,7 +5,8 @@ using CalamityMod.Items.Placeables.Banners; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.NPCs.NormalNPCs + +namespace CalamityMod.NPCs.PlagueEnemies { public class PlaguedFlyingFox : ModNPC { @@ -29,7 +30,6 @@ namespace CalamityMod.NPCs.NormalNPCs npc.knockBackResist = 0f; npc.value = Item.buyPrice(0, 0, 10, 0); npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath4; banner = npc.type; bannerItem = ModContent.ItemType(); } @@ -56,6 +56,7 @@ namespace CalamityMod.NPCs.NormalNPCs } if (npc.life <= 0) { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/PlagueSounds/PlagueBoom" + Main.rand.Next(1, 5)), npc.Center); for (int k = 0; k < 20; k++) { Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); diff --git a/NPCs/NormalNPCs/PlaguedFlyingFox.png b/NPCs/PlagueEnemies/PlaguedFlyingFox.png similarity index 100% rename from NPCs/NormalNPCs/PlaguedFlyingFox.png rename to NPCs/PlagueEnemies/PlaguedFlyingFox.png diff --git a/NPCs/NormalNPCs/PlaguedJungleSlime.cs b/NPCs/PlagueEnemies/PlaguedJungleSlime.cs similarity index 96% rename from NPCs/NormalNPCs/PlaguedJungleSlime.cs rename to NPCs/PlagueEnemies/PlaguedJungleSlime.cs index 955a322888..a8ca82cdbd 100644 --- a/NPCs/NormalNPCs/PlaguedJungleSlime.cs +++ b/NPCs/PlagueEnemies/PlaguedJungleSlime.cs @@ -8,7 +8,8 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.NPCs.NormalNPCs + +namespace CalamityMod.NPCs.PlagueEnemies { public class PlaguedJungleSlime : ModNPC { @@ -36,7 +37,6 @@ namespace CalamityMod.NPCs.NormalNPCs npc.noGravity = false; npc.noTileCollide = false; npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; banner = npc.type; bannerItem = ModContent.ItemType(); } @@ -114,6 +114,7 @@ namespace CalamityMod.NPCs.NormalNPCs } if (npc.life <= 0) { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/PlagueSounds/PlagueBoom" + Main.rand.Next(1, 5)), npc.Center); for (int k = 0; k < 20; k++) { Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); diff --git a/NPCs/NormalNPCs/PlaguedJungleSlime.png b/NPCs/PlagueEnemies/PlaguedJungleSlime.png similarity index 100% rename from NPCs/NormalNPCs/PlaguedJungleSlime.png rename to NPCs/PlagueEnemies/PlaguedJungleSlime.png diff --git a/NPCs/NormalNPCs/PlaguedTortoise.cs b/NPCs/PlagueEnemies/PlaguedTortoise.cs similarity index 91% rename from NPCs/NormalNPCs/PlaguedTortoise.cs rename to NPCs/PlagueEnemies/PlaguedTortoise.cs index 993fa93dff..7feecda54e 100644 --- a/NPCs/NormalNPCs/PlaguedTortoise.cs +++ b/NPCs/PlagueEnemies/PlaguedTortoise.cs @@ -5,7 +5,8 @@ using CalamityMod.Items.Placeables.Banners; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.NPCs.NormalNPCs + +namespace CalamityMod.NPCs.PlagueEnemies { public class PlaguedTortoise : ModNPC { @@ -28,7 +29,6 @@ namespace CalamityMod.NPCs.NormalNPCs animationType = NPCID.GiantTortoise; npc.value = Item.buyPrice(0, 0, 20, 0); npc.HitSound = SoundID.NPCHit24; - npc.DeathSound = SoundID.NPCDeath27; npc.noGravity = false; banner = npc.type; bannerItem = ModContent.ItemType(); @@ -42,6 +42,7 @@ namespace CalamityMod.NPCs.NormalNPCs } if (npc.life <= 0) { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/PlagueSounds/PlagueBoom" + Main.rand.Next(1, 5)), npc.Center); for (int k = 0; k < 20; k++) { Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); diff --git a/NPCs/NormalNPCs/PlaguedTortoise.png b/NPCs/PlagueEnemies/PlaguedTortoise.png similarity index 100% rename from NPCs/NormalNPCs/PlaguedTortoise.png rename to NPCs/PlagueEnemies/PlaguedTortoise.png diff --git a/NPCs/PlaguebringerGoliath/PlagueBeeG.cs b/NPCs/PlaguebringerGoliath/PlagueBeeG.cs index faab243375..26ea15450a 100644 --- a/NPCs/PlaguebringerGoliath/PlagueBeeG.cs +++ b/NPCs/PlaguebringerGoliath/PlagueBeeG.cs @@ -219,14 +219,14 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/NormalNPCs/PlagueBeeGlow"); @@ -241,7 +241,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath color41 *= (float)(num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs b/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs index 81ae75a984..9e71e33082 100644 --- a/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs +++ b/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs @@ -112,14 +112,14 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/NormalNPCs/PlagueBeeGlow"); @@ -134,7 +134,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath color41 *= (float)(num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index a4e3bd7450..6e5178b3a5 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -151,14 +151,14 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/PlaguebringerGoliath/PlagueHomingMissileGlow"); @@ -173,7 +173,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath color41 *= (float)(num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/PlaguebringerGoliath/PlagueMine.cs b/NPCs/PlaguebringerGoliath/PlagueMine.cs index ea383d9e3a..12ce326a39 100644 --- a/NPCs/PlaguebringerGoliath/PlagueMine.cs +++ b/NPCs/PlaguebringerGoliath/PlagueMine.cs @@ -143,7 +143,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2); Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 7b4e654352..e015eefacb 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -127,8 +127,22 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath bool revenge = CalamityWorld.revenge || malice; bool expertMode = Main.expertMode || malice; - // Light - Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.3f, 0.7f, 0f); + // Adjust slowing debuff immunity + bool immuneToSlowingDebuffs = npc.ai[0] == 0f || npc.ai[0] == 4f; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + npc.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; + npc.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; + + // Light + Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.3f, 0.7f, 0f); // Show message if (!halfLife && phase3 && expertMode) @@ -136,6 +150,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath string key = "Mods.CalamityMod.PlagueBossText"; Color messageColor = Color.Lime; CalamityUtils.DisplayLocalizedText(key, messageColor); + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, $"Sounds/Custom/PlagueSounds/PBGNukeWarning"), npc.Center); halfLife = true; } @@ -276,6 +291,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // A phase switch sync is a critical operation that must be synced. if (npc.netSpam >= 10) npc.netSpam = 9; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, $"Sounds/Custom/PlagueSounds/PBGAttackSwitch{Main.rand.Next(1, 3)}"), npc.Center); } } @@ -306,6 +322,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // A phase switch sync is a critical operation that must be synced. if (npc.netSpam >= 10) npc.netSpam = 9; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, $"Sounds/Custom/PlagueSounds/PBGAttackSwitch{Main.rand.Next(1, 3)}"), npc.Center); return; } @@ -362,7 +379,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.netUpdate = true; npc.netSpam -= 5; - Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0); + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/PlagueSounds/PBGDash"), npc.Center); return; } @@ -518,6 +535,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // A phase switch sync is a critical operation that must be synced. if (npc.netSpam >= 10) npc.netSpam = 9; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, $"Sounds/Custom/PlagueSounds/PBGAttackSwitch{Main.rand.Next(1, 3)}"), npc.Center); return; } @@ -599,6 +617,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // A phase switch sync is a critical operation that must be synced. if (npc.netSpam >= 10) npc.netSpam = 9; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, $"Sounds/Custom/PlagueSounds/PBGAttackSwitch{Main.rand.Next(1, 3)}"), npc.Center); } } @@ -680,6 +699,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // A phase switch sync is a critical operation that must be synced. if (npc.netSpam >= 10) npc.netSpam = 9; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, $"Sounds/Custom/PlagueSounds/PBGAttackSwitch{Main.rand.Next(1, 3)}"), npc.Center); } } @@ -752,6 +772,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // A phase switch sync is a critical operation that must be synced. if (npc.netSpam >= 10) npc.netSpam = 9; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, $"Sounds/Custom/PlagueSounds/PBGAttackSwitch{Main.rand.Next(1, 3)}"), npc.Center); } } @@ -775,6 +796,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // A phase switch sync is a critical operation that must be synced. if (npc.netSpam >= 10) npc.netSpam = 9; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, $"Sounds/Custom/PlagueSounds/PBGAttackSwitch{Main.rand.Next(1, 3)}"), npc.Center); return; } @@ -790,7 +812,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { if (MissileCountdown == 1) { - Main.PlaySound(SoundID.Item, (int)npc.position.X, (int)npc.position.Y, 116); + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/PlagueSounds/PBGBarrageLaunch"), npc.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs index 1eed0ee6a4..2ada7a26c3 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs @@ -565,14 +565,14 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); return false; diff --git a/NPCs/Polterghast/PhantomFuckYou.cs b/NPCs/Polterghast/PhantomFuckYou.cs index e1f431f5ee..9015c5b4dd 100644 --- a/NPCs/Polterghast/PhantomFuckYou.cs +++ b/NPCs/Polterghast/PhantomFuckYou.cs @@ -144,14 +144,14 @@ namespace CalamityMod.NPCs.Polterghast color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); return false; diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index 5cd1258aa3..c4f8ab0315 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -418,7 +418,7 @@ namespace CalamityMod.NPCs.Polterghast color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } @@ -430,7 +430,7 @@ namespace CalamityMod.NPCs.Polterghast Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, color, npc.rotation, vector11, npc.scale, spriteEffects, 0f); Texture2D texture2D16 = ModContent.GetTexture("CalamityMod/NPCs/Polterghast/PolterPhantomGlow"); @@ -442,7 +442,7 @@ namespace CalamityMod.NPCs.Polterghast { Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); Color color43 = color42; color43 = Color.Lerp(color43, color36, amount9); color43 = npc.GetAlpha(color43); diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 91afd6a9b0..07781cbfa9 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -1019,14 +1019,14 @@ namespace CalamityMod.NPCs.Polterghast color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Polterghast/PolterghastGlow"); @@ -1048,7 +1048,7 @@ namespace CalamityMod.NPCs.Polterghast color41 *= (num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); Color color43 = color42; diff --git a/NPCs/Polterghast/PolterghastHook.cs b/NPCs/Polterghast/PolterghastHook.cs index 32ba38daa4..4acb4bfdac 100644 --- a/NPCs/Polterghast/PolterghastHook.cs +++ b/NPCs/Polterghast/PolterghastHook.cs @@ -356,14 +356,14 @@ namespace CalamityMod.NPCs.Polterghast color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Polterghast/PolterghastHookGlow"); @@ -382,7 +382,7 @@ namespace CalamityMod.NPCs.Polterghast color41 *= (num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs index 69783fe160..671c920b85 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs @@ -385,14 +385,14 @@ namespace CalamityMod.NPCs.ProfanedGuardians color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianBossGlow"); @@ -408,7 +408,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians color41 *= (num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs index 196eae8887..5beea4876f 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs @@ -232,14 +232,14 @@ namespace CalamityMod.NPCs.ProfanedGuardians color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianBoss2Glow"); @@ -255,7 +255,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians color41 *= (num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs index 772cc7d613..8f0f4d1d9b 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs @@ -231,14 +231,14 @@ namespace CalamityMod.NPCs.ProfanedGuardians color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianBoss3Glow"); @@ -255,7 +255,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians color41 *= (num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); Color color43 = color42; diff --git a/NPCs/Providence/ProvSpawnDefense.cs b/NPCs/Providence/ProvSpawnDefense.cs index 1bb61cae78..2e44c17f11 100644 --- a/NPCs/Providence/ProvSpawnDefense.cs +++ b/NPCs/Providence/ProvSpawnDefense.cs @@ -147,14 +147,14 @@ namespace CalamityMod.NPCs.Providence color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianBoss2Glow"); @@ -170,7 +170,7 @@ namespace CalamityMod.NPCs.Providence color41 *= (float)(num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/Providence/ProvSpawnHealer.cs b/NPCs/Providence/ProvSpawnHealer.cs index 411f7d0e2f..059aa6a8af 100644 --- a/NPCs/Providence/ProvSpawnHealer.cs +++ b/NPCs/Providence/ProvSpawnHealer.cs @@ -134,14 +134,14 @@ namespace CalamityMod.NPCs.Providence color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianBoss3Glow"); @@ -158,7 +158,7 @@ namespace CalamityMod.NPCs.Providence color41 *= (float)(num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); Color color43 = color42; diff --git a/NPCs/Providence/ProvSpawnOffense.cs b/NPCs/Providence/ProvSpawnOffense.cs index 73c8e224e0..557065ce86 100644 --- a/NPCs/Providence/ProvSpawnOffense.cs +++ b/NPCs/Providence/ProvSpawnOffense.cs @@ -224,14 +224,14 @@ namespace CalamityMod.NPCs.Providence color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianBossGlow"); @@ -247,7 +247,7 @@ namespace CalamityMod.NPCs.Providence color41 *= (float)(num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 25cf8a729f..996af43130 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -1490,14 +1490,14 @@ namespace CalamityMod.NPCs.Providence color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); Color color37 = Color.Lerp(Color.White, nightTime ? Color.Cyan : Color.Yellow, 0.5f) * npc.Opacity; @@ -1513,7 +1513,7 @@ namespace CalamityMod.NPCs.Providence color41 *= (num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2(textureGlow.Width, textureGlow.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(textureGlow, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); Color color43 = color42; diff --git a/NPCs/Ravager/FlamePillar.cs b/NPCs/Ravager/FlamePillar.cs index 1716588517..5f1d4159f3 100644 --- a/NPCs/Ravager/FlamePillar.cs +++ b/NPCs/Ravager/FlamePillar.cs @@ -139,7 +139,7 @@ namespace CalamityMod.NPCs.Ravager Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2); Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index a37ea32161..b2fd9a1f86 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -636,7 +636,7 @@ namespace CalamityMod.NPCs.Ravager Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2); Vector2 vector = center - Main.screenPosition; vector -= new Vector2(ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerBodyGlow").Width, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerBodyGlow").Height / Main.npcFrameCount[npc.type]) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Color.Blue); spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerBodyGlow"), vector, npc.frame, color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/Signus/CosmicLantern.cs b/NPCs/Signus/CosmicLantern.cs index 7c8ca41672..b0206589a0 100644 --- a/NPCs/Signus/CosmicLantern.cs +++ b/NPCs/Signus/CosmicLantern.cs @@ -105,14 +105,14 @@ namespace CalamityMod.NPCs.Signus color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Signus/CosmicLanternGlow"); @@ -128,7 +128,7 @@ namespace CalamityMod.NPCs.Signus color41 *= (float)(num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/Signus/SignusBomb.cs b/NPCs/Signus/SignusBomb.cs index 49bf6e8a3e..fcb17a0a24 100644 --- a/NPCs/Signus/SignusBomb.cs +++ b/NPCs/Signus/SignusBomb.cs @@ -183,14 +183,14 @@ namespace CalamityMod.NPCs.Signus color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); return false; diff --git a/NPCs/StormWeaver/StormWeaverBodyNaked.cs b/NPCs/StormWeaver/StormWeaverBodyNaked.cs index 8e8733d12b..61728c5214 100644 --- a/NPCs/StormWeaver/StormWeaverBodyNaked.cs +++ b/NPCs/StormWeaver/StormWeaverBodyNaked.cs @@ -195,14 +195,14 @@ namespace CalamityMod.NPCs.StormWeaver color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); Color color = npc.GetAlpha(lightColor); if (Main.npc[(int)npc.ai[2]].Calamity().newAI[0] > 280f && (CalamityWorld.revenge || BossRushEvent.BossRushActive || CalamityWorld.malice)) diff --git a/NPCs/StormWeaver/StormWeaverHeadNaked.cs b/NPCs/StormWeaver/StormWeaverHeadNaked.cs index c256241bd9..de834511bd 100644 --- a/NPCs/StormWeaver/StormWeaverHeadNaked.cs +++ b/NPCs/StormWeaver/StormWeaverHeadNaked.cs @@ -580,14 +580,14 @@ namespace CalamityMod.NPCs.StormWeaver color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); Color color = npc.GetAlpha(lightColor); if (npc.Calamity().newAI[0] > 280f && (CalamityWorld.revenge || BossRushEvent.BossRushActive || CalamityWorld.malice)) diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index d12af0f5b2..467d5c8dfe 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -213,7 +213,7 @@ namespace CalamityMod.NPCs.StormWeaver Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/StormWeaver/StormWeaverTailGlow"); diff --git a/NPCs/StormWeaver/StormWeaverTailNaked.cs b/NPCs/StormWeaver/StormWeaverTailNaked.cs index d1de56d76c..cb35add269 100644 --- a/NPCs/StormWeaver/StormWeaverTailNaked.cs +++ b/NPCs/StormWeaver/StormWeaverTailNaked.cs @@ -195,14 +195,14 @@ namespace CalamityMod.NPCs.StormWeaver color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); Color color = npc.GetAlpha(lightColor); if (Main.npc[(int)npc.ai[2]].Calamity().newAI[0] > 280f && (CalamityWorld.revenge || BossRushEvent.BossRushActive || CalamityWorld.malice)) diff --git a/NPCs/SunkenSea/BlindedAngler.cs b/NPCs/SunkenSea/BlindedAngler.cs index 9a68f4b1e5..96b1ba525c 100644 --- a/NPCs/SunkenSea/BlindedAngler.cs +++ b/NPCs/SunkenSea/BlindedAngler.cs @@ -72,7 +72,7 @@ namespace CalamityMod.NPCs.SunkenSea Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/SunkenSea/BlindedAnglerGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/SunkenSea/BlindedAnglerGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightBlue); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/SunkenSea/BlindedAnglerGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/SunkenSea/EutrophicRay.cs b/NPCs/SunkenSea/EutrophicRay.cs index a5e9279d71..3de601059d 100644 --- a/NPCs/SunkenSea/EutrophicRay.cs +++ b/NPCs/SunkenSea/EutrophicRay.cs @@ -169,7 +169,7 @@ namespace CalamityMod.NPCs.SunkenSea Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/SunkenSea/EutrophicRayGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/SunkenSea/EutrophicRayGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightBlue); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/SunkenSea/EutrophicRayGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/SunkenSea/GhostBell.cs b/NPCs/SunkenSea/GhostBell.cs index 7374f4500c..249847c733 100644 --- a/NPCs/SunkenSea/GhostBell.cs +++ b/NPCs/SunkenSea/GhostBell.cs @@ -126,7 +126,7 @@ namespace CalamityMod.NPCs.SunkenSea Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/SunkenSea/GhostBellGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/SunkenSea/GhostBellGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightBlue); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/SunkenSea/GhostBellGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/SunkenSea/GhostBellSmall.cs b/NPCs/SunkenSea/GhostBellSmall.cs index 45cd962756..45bc1f1ada 100644 --- a/NPCs/SunkenSea/GhostBellSmall.cs +++ b/NPCs/SunkenSea/GhostBellSmall.cs @@ -132,7 +132,7 @@ namespace CalamityMod.NPCs.SunkenSea Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/SunkenSea/GhostBellSmallGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/SunkenSea/GhostBellSmallGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightBlue); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/SunkenSea/GhostBellSmallGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index e5cdc81ffe..02728272db 100644 --- a/NPCs/SunkenSea/GiantClam.cs +++ b/NPCs/SunkenSea/GiantClam.cs @@ -393,7 +393,7 @@ namespace CalamityMod.NPCs.SunkenSea Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/SunkenSea/GiantClamGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/SunkenSea/GiantClamGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightBlue); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/SunkenSea/GiantClamGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/SunkenSea/PrismTurtle.cs b/NPCs/SunkenSea/PrismTurtle.cs index 3cb89292a7..a76e13742d 100644 --- a/NPCs/SunkenSea/PrismTurtle.cs +++ b/NPCs/SunkenSea/PrismTurtle.cs @@ -110,7 +110,7 @@ namespace CalamityMod.NPCs.SunkenSea Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/SunkenSea/PrismTurtleGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/SunkenSea/PrismTurtleGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Blue); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/SunkenSea/PrismTurtleGlow"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); diff --git a/NPCs/SupremeCalamitas/SCalWormBody.cs b/NPCs/SupremeCalamitas/SCalWormBody.cs index 086b3c147d..a6265bf8d7 100644 --- a/NPCs/SupremeCalamitas/SCalWormBody.cs +++ b/NPCs/SupremeCalamitas/SCalWormBody.cs @@ -179,7 +179,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); if (npc.localAI[3] == 1f) diff --git a/NPCs/SupremeCalamitas/SCalWormHead.cs b/NPCs/SupremeCalamitas/SCalWormHead.cs index 45806567e3..bf98c7ff11 100644 --- a/NPCs/SupremeCalamitas/SCalWormHead.cs +++ b/NPCs/SupremeCalamitas/SCalWormHead.cs @@ -301,7 +301,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/SCalWormHeadGlow"); diff --git a/NPCs/SupremeCalamitas/SCalWormTail.cs b/NPCs/SupremeCalamitas/SCalWormTail.cs index de21c5caee..3fb861c106 100644 --- a/NPCs/SupremeCalamitas/SCalWormTail.cs +++ b/NPCs/SupremeCalamitas/SCalWormTail.cs @@ -161,7 +161,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/SCalWormTailGlow"); diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index 3be7354009..894bb0b395 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -192,14 +192,14 @@ namespace CalamityMod.NPCs.SupremeCalamitas color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/SoulSeekerSupremeGlow"); @@ -214,7 +214,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas color41 *= (float)(num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 62abf5c11a..72ca0be300 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -141,7 +141,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas public static int hoodlessHeadIconIndex; public static int hoodlessHeadIconP2Index; public static float normalDR = 0.25f; - public static float enragedDR = 0.99f; + public static float enragedDR = 0.9999f; private static readonly Color textColor = Color.Orange; private const int sepulcherSpawnCastTime = 75; @@ -2874,7 +2874,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture2D15.Width / 2f, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } @@ -2882,7 +2882,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas bool inPhase2 = npc.ai[0] >= 3f && npc.life > npc.lifeMax * 0.01; Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture2D15.Width / 2f, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); if (inPhase2) { diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index 1b7d98e028..2733c47632 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -76,6 +76,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas return; } + float totalLifeRatio = npc.life / (float)npc.lifeMax; + if (CalamityGlobalNPC.SCalCatastrophe != -1) + { + if (Main.npc[CalamityGlobalNPC.SCalCatastrophe].active) + totalLifeRatio += Main.npc[CalamityGlobalNPC.SCalCatastrophe].life / (float)Main.npc[CalamityGlobalNPC.SCalCatastrophe].lifeMax; + } + // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); @@ -94,8 +101,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas num677 *= 0.5f; } - bool deadBrother = !NPC.AnyNPCs(ModContent.NPCType()); - int scale = deadBrother ? 5 : 2; + int scale = (int)Math.Round(MathHelper.Lerp(2f, 6.5f, totalLifeRatio * 0.5f)); if (npc.ai[3] < distanceX) { npc.ai[3] += scale; @@ -155,11 +161,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas } if (npc.localAI[0] >= 120f) { - npc.ai[1] += 1f; - if (deadBrother || CalamityWorld.malice) - { - npc.ai[1] += 1f; - } + float fireRate = CalamityWorld.malice ? 2f : MathHelper.Lerp(1f, 2.5f, totalLifeRatio * 0.5f); + npc.ai[1] += fireRate; if (npc.ai[1] >= 60f) { npc.ai[1] = 0f; @@ -171,11 +174,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas Projectile.NewProjectile(npc.Center, new Vector2(-8f, 0f), type, damage, 0f, Main.myPlayer); } } - npc.ai[2] += 1f; - if (deadBrother || CalamityWorld.malice) - { - npc.ai[2] += 2f; - } + fireRate = CalamityWorld.malice ? 3f : MathHelper.Lerp(1f, 4f, totalLifeRatio * 0.5f); + npc.ai[2] += fireRate; if (npc.ai[2] >= 300f) { npc.ai[2] = 0f; @@ -231,14 +231,14 @@ namespace CalamityMod.NPCs.SupremeCalamitas color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/SupremeCataclysmGlow"); @@ -253,7 +253,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas color41 *= (float)(num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index cc53500596..03a6f65b55 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -76,6 +76,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas return; } + float totalLifeRatio = npc.life / (float)npc.lifeMax; + if (CalamityGlobalNPC.SCalCataclysm != -1) + { + if (Main.npc[CalamityGlobalNPC.SCalCataclysm].active) + totalLifeRatio += Main.npc[CalamityGlobalNPC.SCalCataclysm].life / (float)Main.npc[CalamityGlobalNPC.SCalCataclysm].lifeMax; + } + // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); @@ -94,9 +101,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas num677 *= 0.5f; } - bool deadBrother = !NPC.AnyNPCs(ModContent.NPCType()); - int scale = deadBrother ? 5 : 2; - if (npc.ai[3] < distanceX) + int scale = (int)Math.Round(MathHelper.Lerp(2f, 6.5f, totalLifeRatio * 0.5f)); + if (npc.ai[3] < distanceX) { npc.ai[3] += scale; distanceY -= scale; @@ -155,11 +161,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas } if (npc.localAI[0] >= 120f) { - npc.ai[1] += 1f; - if (deadBrother || CalamityWorld.malice) - { - npc.ai[1] += 1f; - } + float fireRate = CalamityWorld.malice ? 2f : MathHelper.Lerp(1f, 2.5f, totalLifeRatio * 0.5f); + npc.ai[1] += fireRate; if (npc.ai[1] >= 45f) { npc.ai[1] = 0f; @@ -171,12 +174,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas Projectile.NewProjectile(npc.Center, new Vector2(4f, 0f), type, damage, 0f, Main.myPlayer); } } - npc.ai[2] += 1f; - if (deadBrother || CalamityWorld.malice) - { - npc.ai[2] += 2f; - } - if (npc.ai[2] >= 300f) + fireRate = CalamityWorld.malice ? 3f : MathHelper.Lerp(1f, 4f, totalLifeRatio * 0.5f); + npc.ai[2] += fireRate; + if (npc.ai[2] >= 300f) { npc.ai[2] = 0f; float speed = 7f; @@ -231,14 +231,14 @@ namespace CalamityMod.NPCs.SupremeCalamitas color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/SupremeCatastropheGlow"); @@ -253,7 +253,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas color41 *= (float)(num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/Yharon/DetonatingFlare.cs b/NPCs/Yharon/DetonatingFlare.cs index 0d3cdb7b7c..3106e6a234 100644 --- a/NPCs/Yharon/DetonatingFlare.cs +++ b/NPCs/Yharon/DetonatingFlare.cs @@ -263,14 +263,14 @@ namespace CalamityMod.NPCs.Yharon color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); return false; diff --git a/NPCs/Yharon/DetonatingFlare2.cs b/NPCs/Yharon/DetonatingFlare2.cs index 7c2e284572..6af9c4baf2 100644 --- a/NPCs/Yharon/DetonatingFlare2.cs +++ b/NPCs/Yharon/DetonatingFlare2.cs @@ -95,14 +95,14 @@ namespace CalamityMod.NPCs.Yharon color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, SpriteEffects.None, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, SpriteEffects.None, 0f); return false; diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index f796b9c74a..fe8964ca63 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -2070,6 +2070,7 @@ namespace CalamityMod.NPCs.Yharon int direction = (targetData.Center.X > vectorCenter.X) ? 1 : -1; npc.velocity = new Vector2(direction, 0f) * fireballBreathPhaseVelocity; npc.direction = npc.spriteDirection = direction; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonFire"), npc.Center); } if (npc.ai[1] >= fireballBreathTimer) @@ -2131,6 +2132,7 @@ namespace CalamityMod.NPCs.Yharon npc.rotation += pie; npc.velocity = vector6 * splittingFireballBreathPhaseVelocity; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonFire"), npc.Center); } else { @@ -2674,7 +2676,7 @@ namespace CalamityMod.NPCs.Yharon color38 *= (num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector41 -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } @@ -2725,14 +2727,14 @@ namespace CalamityMod.NPCs.Yharon color39 *= 1f - num157; Vector2 vector42 = npc.Center + (num160 / (float)num156 * MathHelper.TwoPi + npc.rotation).ToRotationVector2() * scaleFactor9 * num157 - Main.screenPosition; vector42 -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector42 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector42 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, vector42, npc.frame, color39, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; vector43 -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, vector43, npc.frame, invincible ? invincibleColor : npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); if (flag8 || npc.ai[0] == 4f || startSecondAI) @@ -2801,7 +2803,7 @@ namespace CalamityMod.NPCs.Yharon color41 *= (num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; vector44 -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); if (flag9 || npc.ai[0] == 10f || startSecondAI) @@ -2829,7 +2831,7 @@ namespace CalamityMod.NPCs.Yharon color42 *= 1f - num157; Vector2 vector45 = npc.Center + (num164 / (float)num156 * MathHelper.TwoPi + npc.rotation).ToRotationVector2() * scaleFactor9 * num157 - Main.screenPosition; vector45 -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector45 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + vector45 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture, vector45, npc.frame, color42, npc.rotation, vector11, npc.scale, spriteEffects, 0f); if (flag9 || npc.ai[0] == 10f || startSecondAI) diff --git a/Particles/BaseParticleSet.cs b/Particles/BaseParticleSet.cs new file mode 100644 index 0000000000..8490181b26 --- /dev/null +++ b/Particles/BaseParticleSet.cs @@ -0,0 +1,77 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using System.Linq; +using Terraria; +using Terraria.ID; + +namespace CalamityMod.Particles +{ + public abstract class BaseParticleSet + { + public int LocalTimer { get; internal set; } + public int SetLifetime { get; internal set; } + public int ParticleSpawnRate; + public List Particles = new List(); + public abstract int ParticleLifetime { get; } + public abstract void UpdateBehavior(Particle particle); + public abstract Particle SpawnParticle(); + public abstract Color DetermineParticleColor(float lifetimeCompletion); + public abstract Texture2D ParticleTexture { get; } + public virtual int ParticleFrameVariants => 1; + public virtual Func OrderFunction { get; } = null; + + public BaseParticleSet(int setLifetime, int particleSpawnRate) + { + SetLifetime = setLifetime; + ParticleSpawnRate = particleSpawnRate; + } + + public virtual void Update() + { + // Don't perform any operations on the server. Doing so would be a waste of space as these sets are entirely based on drawcode. + if (Main.netMode == NetmodeID.Server) + return; + + bool closeToDeath = LocalTimer >= SetLifetime - ParticleLifetime && SetLifetime > 0; + if (LocalTimer % ParticleSpawnRate == 0 && !closeToDeath) + { + Particle particle = SpawnParticle(); + particle.Lifetime = ParticleLifetime; + particle.Variant = Main.rand.Next(ParticleFrameVariants); + Particles.Add(particle); + } + + // Update and increment the time of all particles. + for (int i = 0; i < Particles.Count; i++) + { + Particles[i].Time++; + UpdateBehavior(Particles[i]); + } + + // Clear all expired particles. + Particles.RemoveAll(particle => particle.Time >= particle.Lifetime); + LocalTimer++; + } + + public virtual void DrawSet(Vector2 basePosition) + { + if (Main.netMode == NetmodeID.Server) + return; + + IEnumerable orderedParticles = Particles; + if (OrderFunction != null) + orderedParticles = orderedParticles.OrderBy(OrderFunction); + + foreach (Particle particle in Particles.OrderBy(p => p.Time)) + { + Vector2 drawPosition = basePosition - Main.screenPosition + particle.RelativeOffset; + Color particleColor = DetermineParticleColor(particle.Time / (float)particle.Lifetime); + Rectangle frame = ParticleTexture.Frame(1, ParticleFrameVariants, 0, particle.Variant); + + Main.spriteBatch.Draw(ParticleTexture, drawPosition, frame, particleColor, 0f, frame.Size() * 0.5f, particle.Scale, SpriteEffects.None, 0f); + } + } + } +} \ No newline at end of file diff --git a/Particles/Particle.cs b/Particles/Particle.cs new file mode 100644 index 0000000000..cf3bac931f --- /dev/null +++ b/Particles/Particle.cs @@ -0,0 +1,21 @@ +using Microsoft.Xna.Framework; + +namespace CalamityMod.Particles +{ + public class Particle + { + public int Time; + public int Lifetime; + public int Variant; + public float Scale; + public Vector2 RelativeOffset; + public Particle(int lifetime, Vector2 relativeOffset, float scale, int variant = 0) + { + Time = 0; + Lifetime = lifetime; + Variant = variant; + Scale = scale; + RelativeOffset = relativeOffset; + } + } +} \ No newline at end of file diff --git a/Particles/ThanatosSmokeParticleSet.cs b/Particles/ThanatosSmokeParticleSet.cs new file mode 100644 index 0000000000..dba17d45f6 --- /dev/null +++ b/Particles/ThanatosSmokeParticleSet.cs @@ -0,0 +1,36 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Particles +{ + public class ThanatosSmokeParticleSet : BaseParticleSet + { + public float SpawnAreaCompactness; + public float RelativePower; + public float BaseMoveRotation; + public float MoveRotationOffset; + public override int ParticleLifetime => 50; + public override int ParticleFrameVariants => 3; + public override Texture2D ParticleTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/ThanatosVentParticle"); + public ThanatosSmokeParticleSet(int setLifetime, int particleSpawnRate, float baseMoveRotation, float spawnAreaCompactness, float relativePower) : + base(setLifetime, particleSpawnRate) + { + MoveRotationOffset = Main.rand.NextFloat(-0.36f, 0.36f); + BaseMoveRotation = baseMoveRotation; + SpawnAreaCompactness = spawnAreaCompactness; + RelativePower = relativePower; + } + + public override void UpdateBehavior(Particle particle) + { + particle.Scale += RelativePower * 0.02f; + particle.RelativeOffset -= (BaseMoveRotation + Main.rand.NextFloat(-0.38f, 0.38f)).ToRotationVector2() * RelativePower * 4.5f; + } + + public override Color DetermineParticleColor(float lifetimeCompletion) => Color.White * Utils.InverseLerp(1f, 0.85f, lifetimeCompletion, true); + + public override Particle SpawnParticle() => new Particle(ParticleLifetime, Main.rand.NextVector2Circular(1f, 1f) * SpawnAreaCompactness, 0.06f, Main.rand.Next(3)); + } +} \ No newline at end of file diff --git a/Projectiles/Boss/ExoDestroyerBeamStart.cs b/Projectiles/Boss/ExoDestroyerBeamStart.cs new file mode 100644 index 0000000000..1c88e0cb97 --- /dev/null +++ b/Projectiles/Boss/ExoDestroyerBeamStart.cs @@ -0,0 +1,269 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using CalamityMod.Events; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.IO; +using Terraria; +using Terraria.Enums; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Boss +{ + public class ExoDestroyerBeamStart : ModProjectile + { + public NPC ThingToAttachTo => Main.npc.IndexInRange((int)projectile.ai[0]) ? Main.npc[(int)projectile.ai[0]] : null; + public ref float Time => ref projectile.localAI[0]; + public ref float LengthOfLaser => ref projectile.localAI[1]; + public const int Lifetime = 180; + public const float BeamPosOffset = 16f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Thanatos Deathray"); + Main.projFrames[projectile.type] = 4; + } + + public override void SetDefaults() + { + projectile.Calamity().canBreakPlayerDefense = true; + projectile.width = 32; + projectile.height = 32; + projectile.hostile = true; + projectile.alpha = 255; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.timeLeft = 600; + cooldownSlot = 1; + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(Time); + writer.Write(LengthOfLaser); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + Time = reader.ReadSingle(); + LengthOfLaser = reader.ReadSingle(); + } + + public override void AI() + { + // Difficulty modes + bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || malice; + bool revenge = CalamityWorld.revenge || malice; + bool expertMode = Main.expertMode || malice; + + // Die if the thing to attach to disappears. + if (ThingToAttachTo is null || !ThingToAttachTo.active) + { + projectile.Kill(); + return; + } + + // The direction of the host NPC. + Vector2 hostNPCDirection = Vector2.Normalize(ThingToAttachTo.velocity); + + // Offset to move the beam forward so that it starts inside the NPC's mouth. + float beamStartForwardsOffset = -18f; + + // Set the starting location of the beam to the center of the NPC. + projectile.Center = ThingToAttachTo.Center; + // Add a fixed offset to align with the NPC's spritesheet (?) + projectile.position += hostNPCDirection * BeamPosOffset + new Vector2(0f, -ThingToAttachTo.gfxOffY); + // Add the forwards offset, measured in pixels. + projectile.position += hostNPCDirection * beamStartForwardsOffset; + + projectile.rotation = ThingToAttachTo.velocity.ToRotation(); + + Time++; + + float scale = 1f; + Time++; + if (Time >= Lifetime) + { + projectile.Kill(); + return; + } + + projectile.scale = (float)Math.Sin(Time * MathHelper.Pi / Lifetime) * 10f * scale; + if (projectile.scale > scale) + projectile.scale = scale; + + projectile.rotation = ThingToAttachTo.velocity.ToRotation(); + projectile.velocity = projectile.rotation.ToRotationVector2(); + + float arraySize = 3f; + Vector2 samplingPoint = projectile.Center; + float[] samples = new float[(int)arraySize]; + Collision.LaserScan(samplingPoint, projectile.velocity, projectile.width * projectile.scale, 2400f, samples); + float laserLength = 0f; + for (int i = 0; i < samples.Length; i++) + { + laserLength += samples[i]; + } + laserLength /= arraySize; + + // Fire laser through walls at max length if target cannot be seen + if (!Collision.CanHitLine(ThingToAttachTo.Center, 1, 1, Main.player[ThingToAttachTo.target].Center, 1, 1)) + laserLength = 2400f; + + float amount = 0.5f; + LengthOfLaser = MathHelper.Lerp(LengthOfLaser, laserLength, amount); + + // Fire beams along the laser + float divisor = expertMode ? 80f : 160f; + if (ThingToAttachTo.Calamity().newAI[2] % divisor == 0f && projectile.owner == Main.myPlayer) + { + Vector2 velocity = projectile.velocity; + velocity.Normalize(); + float distanceBetweenProjectiles = malice ? 160f : death ? 256f : revenge ? 288f : 320f; + Vector2 fireFrom = ThingToAttachTo.Center + velocity * distanceBetweenProjectiles; + int projectileAmt = (int)(LengthOfLaser / distanceBetweenProjectiles); + int type = ModContent.ProjectileType(); + int damage = projectile.GetProjectileDamage(ThingToAttachTo.type); + for (int i = 0; i < projectileAmt; i++) + { + int totalProjectiles = 2; + float radians = MathHelper.TwoPi / totalProjectiles; + for (int j = 0; j < totalProjectiles; j++) + { + Vector2 projVelocity = projectile.velocity.RotatedBy(radians * j + MathHelper.PiOver2); + Projectile.NewProjectile(fireFrom, projVelocity, type, damage, 0f, Main.myPlayer, 0f, -1f); + } + fireFrom += velocity * distanceBetweenProjectiles; + } + } + + int dustType = (int)CalamityDusts.Brimstone; + + // Spawn dust at the start of the beam + Vector2 dustPos = projectile.Center + projectile.velocity * 14f; + for (int i = 0; i < 2; i++) + { + float dustRot = projectile.velocity.ToRotation() + ((Main.rand.Next(2) == 1) ? -1f : 1f) * MathHelper.PiOver2; + float dustVelMult = (float)Main.rand.NextDouble() * 2f + 2f; + Vector2 dustVel = new Vector2((float)Math.Cos(dustRot) * dustVelMult, (float)Math.Sin(dustRot) * dustVelMult); + int dust = Dust.NewDust(dustPos, 0, 0, dustType, -dustVel.X, -dustVel.Y, 0, default, 1f); + Main.dust[dust].noGravity = true; + Main.dust[dust].scale = 1.7f; + } + + if (Main.rand.NextBool(5)) + { + Vector2 dustRot = projectile.velocity.RotatedBy(MathHelper.PiOver2, default) * ((float)Main.rand.NextDouble() - 0.5f) * projectile.width; + int dust = Dust.NewDust(dustPos + dustRot - Vector2.One * 4f, 8, 8, dustType, 0f, 0f, 100, default, 1.5f); + Main.dust[dust].velocity *= 0.5f; + Main.dust[dust].velocity.Y = Math.Abs(Main.dust[dust].velocity.Y); + } + + // Spawn dust at the end of the beam + dustPos = projectile.Center + projectile.velocity * (LengthOfLaser - 14f); + for (int i = 0; i < 2; i++) + { + float dustRot = projectile.velocity.ToRotation() + ((Main.rand.Next(2) == 1) ? -1f : 1f) * MathHelper.PiOver2; + float dustVelMult = (float)Main.rand.NextDouble() * 2f + 2f; + Vector2 dustVel = new Vector2((float)Math.Cos(dustRot) * dustVelMult, (float)Math.Sin(dustRot) * dustVelMult); + int dust = Dust.NewDust(dustPos, 0, 0, dustType, dustVel.X, dustVel.Y, 0, default, 1f); + Main.dust[dust].noGravity = true; + Main.dust[dust].scale = 1.7f; + } + + if (Main.rand.NextBool(5)) + { + Vector2 dustRot = projectile.velocity.RotatedBy(MathHelper.PiOver2, default) * ((float)Main.rand.NextDouble() - 0.5f) * projectile.width; + int dust = Dust.NewDust(dustPos + dustRot - Vector2.One * 4f, 8, 8, dustType, 0f, 0f, 100, default, 1.5f); + Main.dust[dust].velocity *= 0.5f; + Main.dust[dust].velocity.Y = -Math.Abs(Main.dust[dust].velocity.Y); + } + + DelegateMethods.v3_1 = new Vector3(0.3f, 0.65f, 0.7f); + Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * LengthOfLaser, projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CastLight)); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (projectile.velocity == Vector2.Zero) + return false; + + Texture2D beamStart = Main.projectileTexture[projectile.type]; + Texture2D beamMiddle = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/ExoDestroyerBeamMiddle"); + Texture2D beamEnd = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/ExoDestroyerBeamEnd"); + + float drawLength = LengthOfLaser; + Color color = new Color(250, 0, 0, 0); + + // Draw start of beam + Vector2 vector = projectile.Center - Main.screenPosition; + Rectangle? sourceRectangle = new Rectangle(0, 16 * (projectile.timeLeft / Main.projFrames[projectile.type] % 5), beamStart.Width, 16); + spriteBatch.Draw(beamStart, vector, sourceRectangle, color, projectile.rotation, beamStart.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + + // Draw middle of beam + drawLength -= (beamStart.Height / 2 + beamEnd.Height) * projectile.scale; + Vector2 center = projectile.Center; + center += projectile.velocity * projectile.scale * beamStart.Height / 2f; + if (drawLength > 0f) + { + float i = 0f; + Rectangle rectangle = new Rectangle(0, 16 * (projectile.timeLeft / Main.projFrames[projectile.type] % 5), beamMiddle.Width, 16); + while (i + 1f < drawLength) + { + if (drawLength - i < rectangle.Height) + rectangle.Height = (int)(drawLength - i); + + spriteBatch.Draw(beamMiddle, center - Main.screenPosition, rectangle, color, projectile.rotation, new Vector2(rectangle.Width / 2, 0f), projectile.scale, SpriteEffects.None, 0f); + + i += rectangle.Height * projectile.scale; + center += projectile.velocity * rectangle.Height * projectile.scale; + + rectangle.Y += 16; + if (rectangle.Y + rectangle.Height > beamMiddle.Height) + rectangle.Y = 0; + } + } + + // Draw end of beam + Vector2 vector2 = center - Main.screenPosition; + sourceRectangle = new Rectangle(0, 16 * (projectile.timeLeft / Main.projFrames[projectile.type] % 5), beamEnd.Width, 16); + spriteBatch.Draw(beamEnd, vector2, sourceRectangle, color, projectile.rotation, beamEnd.Frame(1, 1, 0, 0).Top(), projectile.scale, SpriteEffects.None, 0f); + + return false; + } + + public override void CutTiles() + { + DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; + Vector2 unit = projectile.velocity; + Utils.PlotTileLine(projectile.Center, projectile.Center + unit * LengthOfLaser, projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (projHitbox.Intersects(targetHitbox)) + return true; + + float collisionPoint = 0f; + if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center, projectile.Center + projectile.velocity * LengthOfLaser, 22f * projectile.scale, ref collisionPoint)) + return true; + + return false; + } + + public override void OnHitPlayer(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 360); + target.AddBuff(BuffID.OnFire, 360); + } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } + } +} diff --git a/Projectiles/Boss/ExoDestroyerBeamTelegraph.cs b/Projectiles/Boss/ExoDestroyerBeamTelegraph.cs index ef3e778b14..cd9d0560cf 100644 --- a/Projectiles/Boss/ExoDestroyerBeamTelegraph.cs +++ b/Projectiles/Boss/ExoDestroyerBeamTelegraph.cs @@ -6,22 +6,6 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { - // Code used in the demonstration video. - // This comment should be removed when implemented. - /*for (int b = 0; b < 6; b++) - * { - int beam = Projectile.NewProjectile(npc.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, 255, npc.whoAmI); - - // Determine the initial offset angle of telegraph. It will be smoothened to give a "stretch" effect. - if (Main.projectile.IndexInRange(beam)) - { - float squishedRatio = (float)Math.Pow((float)Math.Sin(MathHelper.Pi * b / 6f), 2D); - float smoothenedRatio = MathHelper.SmoothStep(0f, 1f, squishedRatio); - Main.projectile[beam].ai[1] = MathHelper.Lerp(-0.74f, 0.74f, smoothenedRatio); - } - } - Projectile.NewProjectile(npc.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, 255, npc.whoAmI); - */ public class ExoDestroyerBeamTelegraph : ModProjectile { public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; @@ -33,7 +17,8 @@ namespace CalamityMod.Projectiles.Boss public ref float Time => ref projectile.localAI[1]; public const int Lifetime = 180; public const float TelegraphWidth = 3600f; - public override void SetStaticDefaults() => DisplayName.SetDefault("Telegraph"); + public const float BeamPosOffset = 16f; + public override void SetStaticDefaults() => DisplayName.SetDefault("Telegraph"); public override void SetDefaults() { @@ -67,10 +52,21 @@ namespace CalamityMod.Projectiles.Boss return; } - projectile.Center = ThingToAttachTo.Center; + // The direction of the host NPC. + Vector2 hostNPCDirection = Vector2.Normalize(ThingToAttachTo.velocity); + + // Offset to move the beam forward so that it starts inside the NPC's mouth. + float beamStartForwardsOffset = -18f; + + // Set the starting location of the beam to the center of the NPC. + projectile.Center = ThingToAttachTo.Center; + // Add a fixed offset to align with the NPC's spritesheet (?) + projectile.position += hostNPCDirection * BeamPosOffset + new Vector2(0f, -ThingToAttachTo.gfxOffY); + // Add the forwards offset, measured in pixels. + projectile.position += hostNPCDirection * beamStartForwardsOffset; + + projectile.rotation = StartingRotationalOffset.AngleLerp(ConvergenceAngle, ConvergenceRatio) + ThingToAttachTo.velocity.ToRotation(); - // May want to change the ThingToAttachTo.velocity.ToRotation() part to instead just point towards a certain destination vector. - projectile.rotation = StartingRotationalOffset.AngleLerp(ConvergenceAngle, ConvergenceRatio) + ThingToAttachTo.velocity.ToRotation(); Time++; } diff --git a/Projectiles/Boss/ExoDestroyerLaser.cs b/Projectiles/Boss/ExoDestroyerLaser.cs index 883a397ace..f3456966c7 100644 --- a/Projectiles/Boss/ExoDestroyerLaser.cs +++ b/Projectiles/Boss/ExoDestroyerLaser.cs @@ -18,14 +18,18 @@ namespace CalamityMod.Projectiles.Boss set => projectile.ai[0] = value; } - public Vector2 OldVelocity; + public NPC ThingToAttachTo => Main.npc.IndexInRange((int)projectile.ai[1]) ? Main.npc[(int)projectile.ai[1]] : null; + + public Vector2 Destination; + public Vector2 Velocity; public const float TelegraphTotalTime = 30f; public const float TelegraphFadeTime = 15f; public const float TelegraphWidth = 4200f; + public const float LaserVelocity = 12f; - public override void SetStaticDefaults() + public override void SetStaticDefaults() { - DisplayName.SetDefault("Death Beam"); + DisplayName.SetDefault("Thanatos Beam"); Main.projFrames[projectile.type] = 4; } @@ -46,23 +50,25 @@ namespace CalamityMod.Projectiles.Boss public override void SendExtraAI(BinaryWriter writer) { - writer.WriteVector2(OldVelocity); - } + writer.WriteVector2(Destination); + writer.WriteVector2(Velocity); + } public override void ReceiveExtraAI(BinaryReader reader) { - OldVelocity = reader.ReadVector2(); - } + Destination = reader.ReadVector2(); + Velocity = reader.ReadVector2(); + } public override void AI() { - // Determine the relative opacities for each player based on their distance. - // This has a lower bound of 0.35 to prevent the laser from going completely invisible and players getting hit by cheap shots. - if (projectile.localAI[0] == 0f) - { - projectile.localAI[0] = 1f; - projectile.netUpdate = true; - } + // Determine the relative opacities for each player based on their distance. + // This has a lower bound of 0.35 to prevent the laser from going completely invisible and players getting hit by cheap shots. + if (projectile.localAI[0] == 0f) + { + projectile.localAI[0] = 1f; + projectile.netUpdate = true; + } projectile.frameCounter++; if (projectile.frameCounter > 8) @@ -75,6 +81,68 @@ namespace CalamityMod.Projectiles.Boss Lighting.AddLight(projectile.Center, 0.6f, 0f, 0f); + // If there is no NPC to attach to, run this instead. + if (projectile.ai[1] == -1f) + { + // Fade in after telegraphs have faded. + if (TelegraphDelay > TelegraphTotalTime) + { + if (projectile.alpha > 0) + projectile.alpha -= 25; + if (projectile.alpha < 0) + projectile.alpha = 0; + + // If a velocity is in reserve, set the true velocity to it and make it as "taken" by setting it to <0,0> + if (Velocity != Vector2.Zero) + { + projectile.velocity = Velocity * (CalamityWorld.malice ? 1.25f : 1f); + Velocity = Vector2.Zero; + projectile.netUpdate = true; + } + + // Direction and rotation. + if (projectile.velocity.X < 0f) + { + projectile.spriteDirection = -1; + projectile.rotation = (float)Math.Atan2((double)-(double)projectile.velocity.Y, (double)-(double)projectile.velocity.X); + } + else + { + projectile.spriteDirection = 1; + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); + } + } + else if (Velocity == Vector2.Zero) + { + Velocity = projectile.velocity; + projectile.velocity = Vector2.Zero; + projectile.netUpdate = true; + + // Direction and rotation. + if (projectile.velocity.X < 0f) + { + projectile.spriteDirection = -1; + projectile.rotation = (float)Math.Atan2((double)-(double)Velocity.Y, (double)-(double)Velocity.X); + } + else + { + projectile.spriteDirection = 1; + projectile.rotation = (float)Math.Atan2((double)Velocity.Y, (double)Velocity.X); + } + } + + TelegraphDelay++; + + return; + } + + // Die if the thing to attach to disappears. + if (ThingToAttachTo is null || !ThingToAttachTo.active) + { + projectile.Kill(); + return; + } + // Fade in after telegraphs have faded. if (TelegraphDelay > TelegraphTotalTime) { @@ -83,14 +151,15 @@ namespace CalamityMod.Projectiles.Boss if (projectile.alpha < 0) projectile.alpha = 0; - // If an old velocity is in reserve, set the true velocity to it and make it as "taken" by setting it to <0,0> - if (OldVelocity != Vector2.Zero) + // If a velocity is in reserve, set the true velocity to it and make it as "taken" by setting it to <0,0> + if (Velocity != Vector2.Zero) { - projectile.velocity = OldVelocity * (CalamityWorld.malice ? 1.25f : 1f); - OldVelocity = Vector2.Zero; + projectile.velocity = Velocity * (CalamityWorld.malice ? 1.25f : 1f); + Velocity = Vector2.Zero; projectile.netUpdate = true; } + // Direction and rotation. if (projectile.velocity.X < 0f) { projectile.spriteDirection = -1; @@ -102,22 +171,53 @@ namespace CalamityMod.Projectiles.Boss projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); } } - // Otherwise, be sure to save the velocity the projectile started with. It will be set again when the telegraph is over. - else if (OldVelocity == Vector2.Zero) + else if (Destination == Vector2.Zero) { - OldVelocity = projectile.velocity; - projectile.velocity = Vector2.Zero; + // Set start of telegraph to the npc center. + projectile.Center = ThingToAttachTo.Center; + + // Set destination of the laser, the target's center. + Destination = projectile.velocity; + + // Calculate and store the velocity that will be used for laser telegraph rotation and beam firing. + Vector2 projectileDestination = Destination - ThingToAttachTo.Center; + Velocity = Vector2.Normalize(projectileDestination) * LaserVelocity; + + // Set velocity to zero. + projectile.velocity = Vector2.Zero; projectile.netUpdate = true; + // Direction and rotation. if (projectile.velocity.X < 0f) { projectile.spriteDirection = -1; - projectile.rotation = (float)Math.Atan2((double)-(double)OldVelocity.Y, (double)-(double)OldVelocity.X); + projectile.rotation = (float)Math.Atan2((double)-(double)Velocity.Y, (double)-(double)Velocity.X); } else { projectile.spriteDirection = 1; - projectile.rotation = (float)Math.Atan2((double)OldVelocity.Y, (double)OldVelocity.X); + projectile.rotation = (float)Math.Atan2((double)Velocity.Y, (double)Velocity.X); + } + } + else + { + // Set start of telegraph to the npc center. + projectile.Center = ThingToAttachTo.Center; + + // Calculate and store the velocity that will be used for laser telegraph rotation and beam firing. + Vector2 projectileDestination = Destination - ThingToAttachTo.Center; + Velocity = Vector2.Normalize(projectileDestination) * LaserVelocity; + + // Direction and rotation. + if (projectile.velocity.X < 0f) + { + projectile.spriteDirection = -1; + projectile.rotation = (float)Math.Atan2((double)-(double)Velocity.Y, (double)-(double)Velocity.X); + } + else + { + projectile.spriteDirection = 1; + projectile.rotation = (float)Math.Atan2((double)Velocity.Y, (double)Velocity.X); } } @@ -168,8 +268,8 @@ namespace CalamityMod.Projectiles.Boss colorOuter *= 0.7f; colorInner *= 0.7f; - spriteBatch.Draw(laserTelegraph, projectile.Center - Main.screenPosition, null, colorInner, OldVelocity.ToRotation(), origin, scaleInner, SpriteEffects.None, 0f); - spriteBatch.Draw(laserTelegraph, projectile.Center - Main.screenPosition, null, colorOuter, OldVelocity.ToRotation(), origin, scaleOuter, SpriteEffects.None, 0f); + spriteBatch.Draw(laserTelegraph, projectile.Center - Main.screenPosition, null, colorInner, Velocity.ToRotation(), origin, scaleInner, SpriteEffects.None, 0f); + spriteBatch.Draw(laserTelegraph, projectile.Center - Main.screenPosition, null, colorOuter, Velocity.ToRotation(), origin, scaleOuter, SpriteEffects.None, 0f); return false; } } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 0dac39f74e..46857355e2 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1,5 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Events; +using CalamityMod.NPCs; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Melee; @@ -14,6 +15,7 @@ using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Utilities; using static Terraria.ModLoader.ModContent; namespace CalamityMod.Projectiles @@ -147,6 +149,30 @@ namespace CalamityMod.Projectiles projectile.idStaticNPCHitCooldown = 12; break; + case ProjectileID.WoodYoyo: + case ProjectileID.CorruptYoyo: + case ProjectileID.CrimsonYoyo: + case ProjectileID.JungleYoyo: + case ProjectileID.RedsYoyo: + case ProjectileID.ValkyrieYoyo: + case ProjectileID.Kraken: + case ProjectileID.Rally: + case ProjectileID.Code1: + case ProjectileID.Code2: + case ProjectileID.Valor: + case ProjectileID.Cascade: + case ProjectileID.Chik: + case ProjectileID.FormatC: + case ProjectileID.HelFire: + case ProjectileID.Amarok: + case ProjectileID.Gradient: + case ProjectileID.Yelets: + case ProjectileID.TheEyeOfCthulhu: + case ProjectileID.Terrarian: + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + break; + case ProjectileID.DD2BetsyFireball: case ProjectileID.DD2BetsyFlameBreath: case ProjectileID.CultistBossLightningOrbArc: @@ -332,7 +358,305 @@ namespace CalamityMod.Projectiles return false; } - if (CalamityWorld.revenge || BossRushEvent.BossRushActive || CalamityWorld.malice) + bool adultWyrmAlive = false; + if (CalamityGlobalNPC.adultEidolonWyrmHead != -1) + { + if (Main.npc[CalamityGlobalNPC.adultEidolonWyrmHead].active) + adultWyrmAlive = true; + } + + if (adultWyrmAlive) + { + if (projectile.type == ProjectileID.CultistBossFireBallClone) + { + if (projectile.ai[1] == 0f) + { + projectile.ai[1] = 1f; + Main.PlaySound(SoundID.Item34, projectile.position); + } + else if (projectile.ai[1] == 1f && Main.netMode != NetmodeID.MultiplayerClient) + { + int num13 = -1; + float num14 = 2000f; + for (int num15 = 0; num15 < Main.maxPlayers; num15++) + { + if (Main.player[num15].active && !Main.player[num15].dead) + { + Vector2 center2 = Main.player[num15].Center; + float num16 = Vector2.Distance(center2, projectile.Center); + if ((num16 < num14 || num13 == -1) && Collision.CanHit(projectile.Center, 1, 1, center2, 1, 1)) + { + num14 = num16; + num13 = num15; + } + } + } + + if (num14 < 20f) + { + projectile.Kill(); + return false; + } + + if (num13 != -1) + { + projectile.ai[1] = 21f; + projectile.ai[0] = num13; + projectile.netUpdate = true; + } + } + else if (projectile.ai[1] > 20f && projectile.ai[1] < 200f) + { + projectile.ai[1] += 1f; + int num17 = (int)projectile.ai[0]; + if (!Main.player[num17].active || Main.player[num17].dead) + { + projectile.ai[1] = 1f; + projectile.ai[0] = 0f; + projectile.netUpdate = true; + } + else + { + float num18 = projectile.velocity.ToRotation(); + Vector2 vector2 = Main.player[num17].Center - projectile.Center; + if (vector2.Length() < 20f) + { + projectile.Kill(); + return false; + } + + float targetAngle2 = vector2.ToRotation(); + if (vector2 == Vector2.Zero) + targetAngle2 = num18; + + float num19 = num18.AngleLerp(targetAngle2, 0.01f); + projectile.velocity = new Vector2(projectile.velocity.Length(), 0f).RotatedBy(num19); + } + } + + if (projectile.ai[1] >= 1f && projectile.ai[1] < 20f) + { + projectile.ai[1] += 1f; + if (projectile.ai[1] == 20f) + projectile.ai[1] = 1f; + } + + projectile.alpha -= 40; + if (projectile.alpha < 0) + projectile.alpha = 0; + + projectile.spriteDirection = projectile.direction; + + projectile.frameCounter++; + if (projectile.frameCounter >= 3) + { + projectile.frame++; + projectile.frameCounter = 0; + if (projectile.frame >= 4) + projectile.frame = 0; + } + + if (Main.rand.Next(4) == 0) + { + Vector2 value4 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy(projectile.velocity.ToRotation()); + int num23 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 100); + Main.dust[num23].velocity *= 0.1f; + Main.dust[num23].position = projectile.Center + value4 * projectile.width / 2f; + Main.dust[num23].fadeIn = 0.9f; + } + + if (Main.rand.Next(32) == 0) + { + Vector2 value5 = -Vector2.UnitX.RotatedByRandom(0.39269909262657166).RotatedBy(projectile.velocity.ToRotation()); + int num25 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 155, default, 0.8f); + Main.dust[num25].velocity *= 0.3f; + Main.dust[num25].position = projectile.Center + value5 * projectile.width / 2f; + if (Main.rand.Next(2) == 0) + Main.dust[num25].fadeIn = 1.4f; + } + + if (Main.rand.Next(2) == 0) + { + Vector2 value6 = -Vector2.UnitX.RotatedByRandom(0.78539818525314331).RotatedBy(projectile.velocity.ToRotation()); + int num27 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 27, 0f, 0f, 0, default, 1.2f); + Main.dust[num27].velocity *= 0.3f; + Main.dust[num27].noGravity = true; + Main.dust[num27].position = projectile.Center + value6 * projectile.width / 2f; + if (Main.rand.Next(2) == 0) + Main.dust[num27].fadeIn = 1.4f; + } + + return false; + } + else if (projectile.type == ProjectileID.CultistBossIceMist) + { + if (projectile.localAI[1] == 0f) + { + projectile.localAI[1] = 1f; + Main.PlaySound(SoundID.Item120, projectile.position); + } + + projectile.ai[0] += 1f; + + // Main projectile + float duration = 300f; + if (projectile.ai[1] == 1f) + { + if (projectile.ai[0] >= duration - 20f) + projectile.alpha += 10; + else + projectile.alpha -= 10; + + if (projectile.alpha < 0) + projectile.alpha = 0; + if (projectile.alpha > 255) + projectile.alpha = 255; + + if (projectile.ai[0] >= duration) + { + projectile.Kill(); + return false; + } + + int num103 = Player.FindClosest(projectile.Center, 1, 1); + Vector2 vector11 = Main.player[num103].Center - projectile.Center; + float scaleFactor2 = projectile.velocity.Length(); + vector11.Normalize(); + vector11 *= scaleFactor2; + projectile.velocity = (projectile.velocity * 15f + vector11) / 16f; + projectile.velocity.Normalize(); + projectile.velocity *= scaleFactor2; + + if (projectile.ai[0] % 60f == 0f && Main.netMode != NetmodeID.MultiplayerClient) + { + Vector2 vector50 = projectile.rotation.ToRotationVector2(); + Projectile.NewProjectile(projectile.Center, vector50, projectile.type, projectile.damage, projectile.knockBack, projectile.owner); + } + + projectile.rotation += (float)Math.PI / 30f; + + return false; + } + + // Split projectiles + projectile.position -= projectile.velocity; + + if (projectile.ai[0] >= duration - 260f) + projectile.alpha += 3; + else + projectile.alpha -= 40; + + if (projectile.alpha < 0) + projectile.alpha = 0; + if (projectile.alpha > 255) + projectile.alpha = 255; + + if (projectile.ai[0] >= duration - 255f) + { + projectile.Kill(); + return false; + } + + Vector2 value39 = new Vector2(0f, -720f).RotatedBy(projectile.velocity.ToRotation()); + float scaleFactor3 = projectile.ai[0] % (duration - 255f) / (duration - 255f); + Vector2 spinningpoint13 = value39 * scaleFactor3; + + for (int num724 = 0; num724 < 6; num724++) + { + Vector2 vector51 = projectile.Center + spinningpoint13.RotatedBy(num724 * ((float)Math.PI * 2f) / 6f); + int num726 = Dust.NewDust(vector51 + Utils.RandomVector2(Main.rand, -8f, 8f) / 2f, 8, 8, 197, 0f, 0f, 100, Color.Transparent); + Main.dust[num726].noGravity = true; + } + + return false; + } + else if (projectile.type == ProjectileID.CultistBossLightningOrbArc) + { + projectile.frameCounter++; + if (projectile.velocity == Vector2.Zero) + { + if (projectile.frameCounter >= projectile.extraUpdates * 2) + { + projectile.frameCounter = 0; + bool flag30 = true; + for (int num742 = 1; num742 < projectile.oldPos.Length; num742++) + { + if (projectile.oldPos[num742] != projectile.oldPos[0]) + flag30 = false; + } + + if (flag30) + { + projectile.Kill(); + return false; + } + } + } + else + { + if (projectile.frameCounter < projectile.extraUpdates * 2) + return false; + + projectile.frameCounter = 0; + float num748 = projectile.velocity.Length(); + UnifiedRandom unifiedRandom = new UnifiedRandom((int)projectile.ai[1]); + int num749 = 0; + Vector2 spinningpoint14 = -Vector2.UnitY; + while (true) + { + int num750 = unifiedRandom.Next(); + projectile.ai[1] = num750; + num750 %= 100; + float f = (float)num750 / 100f * ((float)Math.PI * 2f); + Vector2 vector55 = f.ToRotationVector2(); + if (vector55.Y > 0f) + { + vector55.Y *= -1f; + } + + bool flag31 = false; + if (vector55.Y > -0.02f) + { + flag31 = true; + } + if (vector55.X * (float)(projectile.extraUpdates + 1) * 2f * num748 + projectile.localAI[0] > 40f) + { + flag31 = true; + } + if (vector55.X * (float)(projectile.extraUpdates + 1) * 2f * num748 + projectile.localAI[0] < -40f) + { + flag31 = true; + } + + if (flag31) + { + if (num749++ >= 100) + { + projectile.velocity = Vector2.Zero; + projectile.localAI[1] = 1f; + break; + } + continue; + } + + spinningpoint14 = vector55; + + break; + } + + if (projectile.velocity != Vector2.Zero) + { + projectile.localAI[0] += spinningpoint14.X * (float)(projectile.extraUpdates + 1) * 2f * num748; + projectile.velocity = spinningpoint14.RotatedBy(projectile.ai[0] + (float)Math.PI / 2f) * num748; + projectile.rotation = projectile.velocity.ToRotation() + (float)Math.PI / 2f; + } + } + + return false; + } + } + + if (CalamityWorld.revenge || BossRushEvent.BossRushActive || CalamityWorld.malice) { if (projectile.type == ProjectileID.DemonSickle && CalamityPlayer.areThereAnyDamnBosses) { diff --git a/Projectiles/Magic/SlitheringEelBody.png b/Projectiles/Magic/SlitheringEelBody.png new file mode 100644 index 0000000000..0ceb4bf20e Binary files /dev/null and b/Projectiles/Magic/SlitheringEelBody.png differ diff --git a/Projectiles/Magic/SlitheringEelBody2.png b/Projectiles/Magic/SlitheringEelBody2.png new file mode 100644 index 0000000000..9ca8b31166 Binary files /dev/null and b/Projectiles/Magic/SlitheringEelBody2.png differ diff --git a/Projectiles/Magic/SlitheringEelProjectile.cs b/Projectiles/Magic/SlitheringEelProjectile.cs index 3627b8f9d9..52ee1e6edc 100644 --- a/Projectiles/Magic/SlitheringEelProjectile.cs +++ b/Projectiles/Magic/SlitheringEelProjectile.cs @@ -10,10 +10,22 @@ namespace CalamityMod.Projectiles.Magic { public class SlitheringEelProjectile : ModProjectile { + public struct EelSegment + { + public Vector2 CurrentPosition; + public float Rotation; + public EelSegment(Vector2 position, float rotation) + { + CurrentPosition = position; + Rotation = rotation; + } + } + + public EelSegment[] Segments = new EelSegment[10]; + public override void SetStaticDefaults() { DisplayName.SetDefault("Eel"); - Main.projFrames[projectile.type] = 4; ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; ProjectileID.Sets.TrailingMode[projectile.type] = 0; } @@ -28,67 +40,115 @@ namespace CalamityMod.Projectiles.Magic projectile.tileCollide = false; projectile.penetrate = -1; projectile.timeLeft = 360; - projectile.alpha = 0; + projectile.Opacity = 0f; } public override void AI() { - if (projectile.frameCounter++ % 8f == 7f) - { - projectile.frame++; - } - if (projectile.frame >= Main.projFrames[projectile.type]) - { - projectile.frame = 0; - } projectile.spriteDirection = (projectile.velocity.X > 0).ToDirectionInt(); - projectile.rotation = (projectile.spriteDirection * projectile.velocity).ToRotation(); - if (projectile.ai[0] >= 3f) + projectile.rotation = projectile.velocity.ToRotation(); + if (projectile.numHits >= 3f) { projectile.alpha += 5; if (projectile.alpha >= 255) - { projectile.Kill(); - } } + else + projectile.Opacity = MathHelper.Clamp(projectile.Opacity + 0.1f, 0f, 1f); + if (projectile.timeLeft % 80f < 35f && projectile.Distance(Main.MouseWorld) > 70f) { float angleToTarget = projectile.AngleTo(Main.MouseWorld); float angleDifference = MathHelper.WrapAngle(angleToTarget - projectile.velocity.ToRotation()); projectile.velocity = projectile.velocity.RotatedBy(angleDifference / 9f); } + if (projectile.timeLeft % 65f == 64f) - { Projectile.NewProjectile(projectile.Center, Vector2.UnitY * 7f, ModContent.ProjectileType(), projectile.damage / 2, 2f, projectile.owner); + + UpdateSegments(); + } + + public void UpdateSegments() + { + Vector2 aheadPosition = projectile.Center; + float aheadRotation = projectile.rotation; + + // Connect all segments to each-other and calculate their rotations. + for (int i = 0; i < Segments.Length; i++) + { + Vector2 offsetToDestination = aheadPosition - Segments[i].CurrentPosition; + + // This variant of segment attachment incorporates rotation. + // Given the fact that all segments will execute this code is succession, the + // result across the entire worm will exponentially decay over each segment, + // allowing for smooth rotations. This code is what the stardust dragon uses for its segmenting. + if (aheadRotation != projectile.rotation) + { + float offsetAngle = MathHelper.WrapAngle(aheadRotation - projectile.rotation) * 0.03f; + offsetToDestination = offsetToDestination.RotatedBy(offsetAngle); + } + Segments[i].Rotation = (aheadPosition - Segments[i].CurrentPosition).ToRotation(); + Segments[i].CurrentPosition = aheadPosition - offsetToDestination.SafeNormalize(Vector2.UnitY) * 13f; + + // Adjust the ahead positions before interating further. + aheadPosition = Segments[i].CurrentPosition; + aheadRotation = Segments[i].Rotation; } } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], new Color(255, 255, 255, 127), 1); + Texture2D headTexture = ModContent.GetTexture("CalamityMod/Projectiles/Magic/SlitheringEelProjectile"); + Texture2D bodyTexture = ModContent.GetTexture("CalamityMod/Projectiles/Magic/SlitheringEelBody"); + Texture2D bodyTexture2 = ModContent.GetTexture("CalamityMod/Projectiles/Magic/SlitheringEelBody2"); + Texture2D tailTexture = ModContent.GetTexture("CalamityMod/Projectiles/Magic/SlitheringEelTail"); + + Vector2 drawPosition; + lightColor = new Color(255, 255, 255, 127); + for (int i = 0; i < Segments.Length; i++) + { + Texture2D textureToUse = i % 2 == 1 ? bodyTexture2 : bodyTexture; + + // Use the tail texture for the last segment. + if (i == Segments.Length - 1) + textureToUse = tailTexture; + + drawPosition = Segments[i].CurrentPosition - Main.screenPosition; + spriteBatch.Draw(textureToUse, drawPosition, null, projectile.GetAlpha(lightColor), Segments[i].Rotation, textureToUse.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); + } + + drawPosition = projectile.Center - Main.screenPosition; + spriteBatch.Draw(headTexture, drawPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, headTexture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); return false; } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + for (int i = 0; i < Segments.Length; i++) + { + if (targetHitbox.Intersects(Utils.CenteredRectangle(Segments[i].CurrentPosition, Vector2.One * 12f))) + return true; + } + return null; + } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - projectile.ai[0]++; target.AddBuff(BuffID.Venom, 180); target.AddBuff(ModContent.BuffType(), 180); } public override void OnHitPvp(Player target, int damage, bool crit) { - projectile.ai[0]++; target.AddBuff(BuffID.Venom, 180); target.AddBuff(ModContent.BuffType(), 180); } public override void Kill(int timeLeft) { - for (int dust = 0; dust <= 22; dust++) - { + for (int i = 0; i < 23; i++) Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, (int)CalamityDusts.SulfurousSeaAcid, 0f, 0f); - } } } } diff --git a/Projectiles/Magic/SlitheringEelProjectile.png b/Projectiles/Magic/SlitheringEelProjectile.png index f7ccfeee32..fa25c2a990 100644 Binary files a/Projectiles/Magic/SlitheringEelProjectile.png and b/Projectiles/Magic/SlitheringEelProjectile.png differ diff --git a/Projectiles/Magic/SlitheringEelTail.png b/Projectiles/Magic/SlitheringEelTail.png new file mode 100644 index 0000000000..fbdcd3a789 Binary files /dev/null and b/Projectiles/Magic/SlitheringEelTail.png differ diff --git a/Projectiles/Melee/AtaraxiaSide.cs b/Projectiles/Melee/AtaraxiaSide.cs index 0f9e904df2..97f72d2132 100644 --- a/Projectiles/Melee/AtaraxiaSide.cs +++ b/Projectiles/Melee/AtaraxiaSide.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Melee { projVec = projVec.RotatedBy(angleVariance); if (projectile.owner == Main.myPlayer) - Projectile.NewProjectile(projectile.Center, projVec, splitID, damage, 1.5f, Main.myPlayer, 0.0f, 0.0f); + Projectile.NewProjectile(projectile.Center, projVec, splitID, damage, 1.5f, Main.myPlayer); } } } diff --git a/Projectiles/Melee/AtaraxiaSplit.cs b/Projectiles/Melee/AtaraxiaSplit.cs index f358d451b1..033acb4421 100644 --- a/Projectiles/Melee/AtaraxiaSplit.cs +++ b/Projectiles/Melee/AtaraxiaSplit.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Melee projectile.friendly = true; projectile.melee = true; projectile.penetrate = -1; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 6; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 6; projectile.timeLeft = 50; projectile.tileCollide = false; projectile.ignoreWater = true; diff --git a/Projectiles/Melee/DevilsSunriseProj.cs b/Projectiles/Melee/DevilsSunriseProj.cs index f3123d482c..6f943b40c1 100644 --- a/Projectiles/Melee/DevilsSunriseProj.cs +++ b/Projectiles/Melee/DevilsSunriseProj.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Melee public class DevilsSunriseProj : ModProjectile { private int red; - private int greenAndBlue = 100; + private const int greenAndBlue = 100; public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/DragonPowFlail.cs b/Projectiles/Melee/DragonPowFlail.cs index f011f2b2bd..e5b6761e92 100644 --- a/Projectiles/Melee/DragonPowFlail.cs +++ b/Projectiles/Melee/DragonPowFlail.cs @@ -139,7 +139,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { // Only perform hit effects after reaching approximately 75% of the way out. - if (projectile.WithinRange(Main.player[projectile.owner].Center, 1100f)) + if (Main.player[projectile.owner].WithinRange(target.Center, 620f)) return; // Inflicts Daybroken, Abyssal Flames and Holy Flames for 8 seconds on-hit diff --git a/Projectiles/Melee/DragonRageStaff.cs b/Projectiles/Melee/DragonRageStaff.cs index cefe9f0692..43dfe695e1 100644 --- a/Projectiles/Melee/DragonRageStaff.cs +++ b/Projectiles/Melee/DragonRageStaff.cs @@ -174,7 +174,7 @@ namespace CalamityMod.Projectiles.Melee modPlayer.dragonRageHits = 0; } - int proj = Projectile.NewProjectile(position, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + int proj = Projectile.NewProjectile(position, Vector2.Zero, ModContent.ProjectileType(), projectile.damage / 4, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); Main.projectile[proj].Calamity().forceMelee = true; } } @@ -190,7 +190,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 velocity = new Vector2(0f, speed); velocity = velocity.RotatedBy(angleStep * i * Main.rand.NextFloat(0.9f, 1.1f)); - Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage / 3, projectile.knockBack / 3f, projectile.owner); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage / 8, projectile.knockBack / 3f, projectile.owner); } } diff --git a/Projectiles/Melee/DragonRageStaff.png b/Projectiles/Melee/DragonRageStaff.png index 4d3ee425bb..38100f5016 100644 Binary files a/Projectiles/Melee/DragonRageStaff.png and b/Projectiles/Melee/DragonRageStaff.png differ diff --git a/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs b/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs index 0dfaea5c07..6668747b03 100644 --- a/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs +++ b/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs @@ -29,7 +29,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos projectile.melee = true; projectile.penetrate = -1; projectile.MaxUpdates = 2; - } + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 20; + } public override void AI() { diff --git a/Projectiles/Melee/Yoyos/AortaYoyo.cs b/Projectiles/Melee/Yoyos/AortaYoyo.cs index e5bfcda50f..6d8a19767e 100644 --- a/Projectiles/Melee/Yoyos/AortaYoyo.cs +++ b/Projectiles/Melee/Yoyos/AortaYoyo.cs @@ -29,7 +29,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos projectile.melee = true; projectile.penetrate = -1; projectile.MaxUpdates = 2; - } + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 20; + } public override void AI() { diff --git a/Projectiles/Melee/Yoyos/AzathothYoyo.cs b/Projectiles/Melee/Yoyos/AzathothYoyo.cs index 913f86b2b7..05ab6b164a 100644 --- a/Projectiles/Melee/Yoyos/AzathothYoyo.cs +++ b/Projectiles/Melee/Yoyos/AzathothYoyo.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Melee.Yoyos projectile.melee = true; projectile.penetrate = -1; projectile.MaxUpdates = 2; - projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 6; } diff --git a/Projectiles/Melee/Yoyos/ChaotrixYoyo.cs b/Projectiles/Melee/Yoyos/ChaotrixYoyo.cs index 4ce0697de8..11c79b1b5c 100644 --- a/Projectiles/Melee/Yoyos/ChaotrixYoyo.cs +++ b/Projectiles/Melee/Yoyos/ChaotrixYoyo.cs @@ -30,7 +30,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos projectile.melee = true; projectile.penetrate = -1; projectile.MaxUpdates = 2; - } + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 20; + } public override void AI() { diff --git a/Projectiles/Melee/Yoyos/CnidarianYoyo.cs b/Projectiles/Melee/Yoyos/CnidarianYoyo.cs index bb55dc6ec4..bf2addb6b9 100644 --- a/Projectiles/Melee/Yoyos/CnidarianYoyo.cs +++ b/Projectiles/Melee/Yoyos/CnidarianYoyo.cs @@ -27,6 +27,8 @@ namespace CalamityMod.Projectiles.Melee.Yoyos projectile.melee = true; projectile.penetrate = -1; projectile.MaxUpdates = 2; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 20; } public override void AI() diff --git a/Projectiles/Melee/Yoyos/GodsGambitYoyo.cs b/Projectiles/Melee/Yoyos/GodsGambitYoyo.cs index ac553a9faa..e1029e3e4b 100644 --- a/Projectiles/Melee/Yoyos/GodsGambitYoyo.cs +++ b/Projectiles/Melee/Yoyos/GodsGambitYoyo.cs @@ -26,6 +26,8 @@ namespace CalamityMod.Projectiles.Melee.Yoyos projectile.melee = true; projectile.penetrate = -1; projectile.MaxUpdates = 2; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 20; } public override void AI() diff --git a/Projectiles/Melee/Yoyos/LaceratorYoyo.cs b/Projectiles/Melee/Yoyos/LaceratorYoyo.cs index a758375420..201017c0db 100644 --- a/Projectiles/Melee/Yoyos/LaceratorYoyo.cs +++ b/Projectiles/Melee/Yoyos/LaceratorYoyo.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Melee.Yoyos projectile.melee = true; projectile.penetrate = -1; projectile.MaxUpdates = 2; - projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 8; } diff --git a/Projectiles/Melee/Yoyos/MicrowaveYoyo.cs b/Projectiles/Melee/Yoyos/MicrowaveYoyo.cs index c8440e1a43..cd4b7f222a 100644 --- a/Projectiles/Melee/Yoyos/MicrowaveYoyo.cs +++ b/Projectiles/Melee/Yoyos/MicrowaveYoyo.cs @@ -38,9 +38,8 @@ namespace CalamityMod.Projectiles.Melee.Yoyos projectile.melee = true; projectile.penetrate = -1; projectile.MaxUpdates = 2; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; + projectile.localNPCHitCooldown = 20; } public override void SendExtraAI(BinaryWriter writer) => writer.Write(soundCooldown); diff --git a/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs b/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs index 54f1f2c5d9..06eaece88a 100644 --- a/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs +++ b/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos // Ensures that the main AI only runs once per frame, despite the projectile's multiple updates private int extraUpdateCounter = 0; - private const int UpdatesPerFrame = 3; + private const int UpdatesPerFrame = 2; public override void SetStaticDefaults() { @@ -36,7 +36,6 @@ namespace CalamityMod.Projectiles.Melee.Yoyos projectile.melee = true; projectile.penetrate = -1; projectile.MaxUpdates = UpdatesPerFrame; - projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 3 * UpdatesPerFrame; } diff --git a/Projectiles/Melee/Yoyos/OblivionYoyo.cs b/Projectiles/Melee/Yoyos/OblivionYoyo.cs index a0ef4e0d6d..43df6ecdc5 100644 --- a/Projectiles/Melee/Yoyos/OblivionYoyo.cs +++ b/Projectiles/Melee/Yoyos/OblivionYoyo.cs @@ -29,6 +29,8 @@ namespace CalamityMod.Projectiles.Melee.Yoyos projectile.melee = true; projectile.penetrate = -1; projectile.MaxUpdates = 2; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 20; } public override void AI() diff --git a/Projectiles/Melee/Yoyos/OracleYoyo.cs b/Projectiles/Melee/Yoyos/OracleYoyo.cs index 0a405eba6c..e23ff9c76e 100644 --- a/Projectiles/Melee/Yoyos/OracleYoyo.cs +++ b/Projectiles/Melee/Yoyos/OracleYoyo.cs @@ -66,7 +66,6 @@ namespace CalamityMod.Projectiles.Melee.Yoyos projectile.melee = true; projectile.penetrate = -1; projectile.MaxUpdates = UpdatesPerFrame; - projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 3 * UpdatesPerFrame; } diff --git a/Projectiles/Melee/Yoyos/PandemicYoyo.cs b/Projectiles/Melee/Yoyos/PandemicYoyo.cs index 8966f1c388..2f1f74570b 100644 --- a/Projectiles/Melee/Yoyos/PandemicYoyo.cs +++ b/Projectiles/Melee/Yoyos/PandemicYoyo.cs @@ -27,6 +27,8 @@ namespace CalamityMod.Projectiles.Melee.Yoyos projectile.melee = true; projectile.penetrate = -1; projectile.MaxUpdates = 2; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 20; } public override void AI() diff --git a/Projectiles/Melee/Yoyos/QuagmireYoyo.cs b/Projectiles/Melee/Yoyos/QuagmireYoyo.cs index 0d53abad5f..e95d79ae4e 100644 --- a/Projectiles/Melee/Yoyos/QuagmireYoyo.cs +++ b/Projectiles/Melee/Yoyos/QuagmireYoyo.cs @@ -25,7 +25,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos projectile.friendly = true; projectile.melee = true; projectile.penetrate = -1; - } + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + } public override void AI() { diff --git a/Projectiles/Melee/Yoyos/RiptideYoyo.cs b/Projectiles/Melee/Yoyos/RiptideYoyo.cs index 569a1d2331..5c53857f7f 100644 --- a/Projectiles/Melee/Yoyos/RiptideYoyo.cs +++ b/Projectiles/Melee/Yoyos/RiptideYoyo.cs @@ -25,6 +25,8 @@ namespace CalamityMod.Projectiles.Melee.Yoyos projectile.alpha = 150; projectile.penetrate = -1; projectile.MaxUpdates = 2; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 20; } public override void AI() diff --git a/Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs b/Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs index 2814140d07..bd4b4337bb 100644 --- a/Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs +++ b/Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs @@ -26,6 +26,8 @@ namespace CalamityMod.Projectiles.Melee.Yoyos projectile.melee = true; projectile.penetrate = -1; projectile.MaxUpdates = 2; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 20; } public override void AI() diff --git a/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs b/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs index eaea97cb2c..4d2d4464ff 100644 --- a/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs +++ b/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs @@ -31,7 +31,6 @@ namespace CalamityMod.Projectiles.Melee.Yoyos projectile.melee = true; projectile.penetrate = -1; projectile.MaxUpdates = 2; - projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 8; } diff --git a/Projectiles/Melee/Yoyos/SulphurousGrabberYoyo.cs b/Projectiles/Melee/Yoyos/SulphurousGrabberYoyo.cs index 5cfd7e4e36..4ea86694f0 100644 --- a/Projectiles/Melee/Yoyos/SulphurousGrabberYoyo.cs +++ b/Projectiles/Melee/Yoyos/SulphurousGrabberYoyo.cs @@ -35,7 +35,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos projectile.friendly = true; projectile.melee = true; projectile.penetrate = -1; - } + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + } public override void AI() { diff --git a/Projectiles/Melee/Yoyos/VerdantYoyo.cs b/Projectiles/Melee/Yoyos/VerdantYoyo.cs index e610d28d43..758b45ac1c 100644 --- a/Projectiles/Melee/Yoyos/VerdantYoyo.cs +++ b/Projectiles/Melee/Yoyos/VerdantYoyo.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Melee.Yoyos projectile.melee = true; projectile.penetrate = -1; projectile.MaxUpdates = 2; - projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 9; } diff --git a/Projectiles/Melee/Yoyos/YinYoyo.cs b/Projectiles/Melee/Yoyos/YinYoyo.cs index 24a6695aa1..a6cb99b6ae 100644 --- a/Projectiles/Melee/Yoyos/YinYoyo.cs +++ b/Projectiles/Melee/Yoyos/YinYoyo.cs @@ -26,6 +26,8 @@ namespace CalamityMod.Projectiles.Melee.Yoyos projectile.melee = true; projectile.penetrate = -1; projectile.MaxUpdates = 2; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 20; } public override void AI() diff --git a/Projectiles/Ranged/ExoMark.cs b/Projectiles/Ranged/ExoMark.cs index c5fc26bde6..b73065b0fe 100644 --- a/Projectiles/Ranged/ExoMark.cs +++ b/Projectiles/Ranged/ExoMark.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.alpha = 255; projectile.penetrate = -1; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 9; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 9; } public override void AI() diff --git a/Projectiles/Ranged/ExoTornado.cs b/Projectiles/Ranged/ExoTornado.cs index b3bd669ef0..45f0fa1cff 100644 --- a/Projectiles/Ranged/ExoTornado.cs +++ b/Projectiles/Ranged/ExoTornado.cs @@ -22,9 +22,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.tileCollide = false; projectile.ranged = true; projectile.penetrate = -1; - projectile.timeLeft = 240; //1200 - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; + projectile.timeLeft = 240; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Ranged/IcicleArrowProj.cs b/Projectiles/Ranged/IcicleArrowProj.cs index d64bf468aa..bdf140f83f 100644 --- a/Projectiles/Ranged/IcicleArrowProj.cs +++ b/Projectiles/Ranged/IcicleArrowProj.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Ranged { float SpeedX = -projectile.velocity.X * Main.rand.Next(40, 70) * 0.01f + Main.rand.Next(-20, 21) * 0.4f; float SpeedY = -projectile.velocity.Y * Main.rand.Next(40, 70) * 0.01f + Main.rand.Next(-20, 21) * 0.4f; - Projectile.NewProjectile(projectile.Center.X + SpeedX, projectile.Center.Y + SpeedY, SpeedX, SpeedY, ProjectileID.CrystalShard, projectile.damage / 2, 0f, projectile.owner); + Projectile.NewProjectile(projectile.Center.X + SpeedX, projectile.Center.Y + SpeedY, SpeedX, SpeedY, ProjectileID.CrystalShard, projectile.damage / 3, 0f, projectile.owner); } } } diff --git a/Projectiles/Rogue/EclipsesStealth.cs b/Projectiles/Rogue/EclipsesStealth.cs index 77bba69aa6..257317e083 100644 --- a/Projectiles/Rogue/EclipsesStealth.cs +++ b/Projectiles/Rogue/EclipsesStealth.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.localAI[1] = Main.rand.Next(8, 14); // 8 to 13 frames between each spearfall int type = ModContent.ProjectileType(); - int smolDamage = (int)(projectile.damage * 0.28f); + int smolDamage = (int)(projectile.damage * 0.22f); float smolKB = 3f; // Used to be a 50% chance each spearfall for 1 or 2. Now is consistent. int numSpears = spawnTwoSpears ? 2 : 1; diff --git a/Projectiles/Rogue/FinalDawnThrow2.cs b/Projectiles/Rogue/FinalDawnThrow2.cs index d03fd0e7e9..4efe2a4d1b 100644 --- a/Projectiles/Rogue/FinalDawnThrow2.cs +++ b/Projectiles/Rogue/FinalDawnThrow2.cs @@ -87,11 +87,9 @@ namespace CalamityMod.Projectiles.Rogue player.heldProj = projectile.whoAmI; player.bodyFrame.Y = player.bodyFrame.Height; player.immuneNoBlink = true; - player.immuneTime = 10; - for (int k = 0; k < player.hurtCooldowns.Length; k++) - { - player.hurtCooldowns[k] = player.immuneTime; - } + player.immuneTime = 6; + for (int k = 0; k < player.hurtCooldowns.Length; k++) + player.hurtCooldowns[k] = player.immuneTime; // This is to make sure the player doesn't get yeeted out of the world, which crashes the game pretty much all of the time bool worldEdge = projectile.Center.X < 1000 || projectile.Center.Y < 1000 || projectile.Center.X > Main.maxTilesX * 16 - 1000 || projectile.Center.Y > Main.maxTilesY * 16 - 1000; diff --git a/Projectiles/Rogue/GodsParanoiaDart.cs b/Projectiles/Rogue/GodsParanoiaDart.cs index 9c3274131e..e7092419f6 100644 --- a/Projectiles/Rogue/GodsParanoiaDart.cs +++ b/Projectiles/Rogue/GodsParanoiaDart.cs @@ -44,11 +44,13 @@ namespace CalamityMod.Projectiles.Rogue projectile.velocity.Y = 12f; } - int num822 = Dust.NewDust(projectile.position, projectile.width, projectile.height, Main.rand.NextBool(3) ? 56 : 242, 0f, 0f, 0, default, 1f); - Dust dust = Main.dust[num822]; - dust.velocity *= 0.1f; - Main.dust[num822].scale = 1.3f; - Main.dust[num822].noGravity = true; + if (Main.rand.NextBool(3)) + { + Dust flame = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, Main.rand.NextBool(3) ? 56 : 242, 0f, 0f, 0, default, 1f); + flame.velocity *= 0.1f; + flame.scale = 1.3f; + flame.noGravity = true; + } } public override void Kill(int timeLeft) @@ -63,18 +65,17 @@ namespace CalamityMod.Projectiles.Rogue projectile.localNPCHitCooldown = -1; projectile.damage /= 2; projectile.Damage(); - for (int num621 = 0; num621 < 3; num621++) + for (int i = 0; i < 2; i++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(3) ? 56 : 242, 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 3f; + Dust flame = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, Main.rand.NextBool(3) ? 56 : 242, 0f, 0f, 100, default, 2f); + flame.velocity *= 3f; + if (Main.rand.NextBool(2)) + flame.scale = 0.5f; + if (Main.rand.NextBool(2)) { - Main.dust[num622].scale = 0.5f; - } - if (Main.rand.NextBool(2)) - { - Main.dust[num622].scale *= 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + flame.scale *= 0.5f; + flame.fadeIn = Main.rand.NextFloat(1f, 2f); } } } diff --git a/Projectiles/Rogue/GodsParanoiaProj.cs b/Projectiles/Rogue/GodsParanoiaProj.cs index 0de494c4ea..21811f8cb8 100644 --- a/Projectiles/Rogue/GodsParanoiaProj.cs +++ b/Projectiles/Rogue/GodsParanoiaProj.cs @@ -41,10 +41,10 @@ namespace CalamityMod.Projectiles.Rogue Lighting.AddLight(projectile.Center, 0.35f, 0f, 0.25f); if (Main.rand.NextBool(2)) { - int num137 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), 1, 1, Main.rand.NextBool(3) ? 56 : 242, 0f, 0f, 0, default, 0.5f); - Main.dust[num137].alpha = projectile.alpha; - Main.dust[num137].velocity *= 0f; - Main.dust[num137].noGravity = true; + Dust flame = Dust.NewDustDirect(projectile.position, 1, 1, Main.rand.NextBool(3) ? 56 : 242, 0f, 0f, 0, default, 0.5f); + flame.alpha = projectile.alpha; + flame.velocity = Vector2.Zero; + flame.noGravity = true; } projectile.StickyProjAI(50); diff --git a/Projectiles/Rogue/PhantasmalSoul.cs b/Projectiles/Rogue/PhantasmalSoul.cs index ca4365eeeb..352fdb98ea 100644 --- a/Projectiles/Rogue/PhantasmalSoul.cs +++ b/Projectiles/Rogue/PhantasmalSoul.cs @@ -14,8 +14,6 @@ namespace CalamityMod.Projectiles.Rogue private const int NoHitFrames = 10; private const int NoDrawFrames = 5; - public override string Texture => "CalamityMod/Projectiles/Melee/GhastlySoulSmall"; - public override void SetStaticDefaults() { DisplayName.SetDefault("Phantasmal Soul"); @@ -26,8 +24,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetDefaults() { - projectile.width = 30; - projectile.height = 30; + projectile.width = projectile.height = 36; projectile.alpha = 100; projectile.friendly = true; projectile.ignoreWater = true; diff --git a/Projectiles/Rogue/PhantasmalSoul.png b/Projectiles/Rogue/PhantasmalSoul.png new file mode 100644 index 0000000000..fe77251e7c Binary files /dev/null and b/Projectiles/Rogue/PhantasmalSoul.png differ diff --git a/Projectiles/Rogue/ShinobiBladeProjectile.cs b/Projectiles/Rogue/ShinobiBladeProjectile.cs index 1104b9bb3d..9e43321131 100644 --- a/Projectiles/Rogue/ShinobiBladeProjectile.cs +++ b/Projectiles/Rogue/ShinobiBladeProjectile.cs @@ -20,8 +20,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetDefaults() { - projectile.width = 10; - projectile.height = 10; + projectile.width = projectile.height = 16; projectile.friendly = true; projectile.penetrate = 1; projectile.timeLeft = 300; @@ -31,7 +30,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); - projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + MathHelper.ToRadians(45) * projectile.direction; + projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + MathHelper.PiOver2 * projectile.spriteDirection; if (Main.rand.NextBool(5)) { diff --git a/Projectiles/Summon/MidnightSunUFO.cs b/Projectiles/Summon/MidnightSunUFO.cs index e80e6b43e0..12c6f6f0ae 100644 --- a/Projectiles/Summon/MidnightSunUFO.cs +++ b/Projectiles/Summon/MidnightSunUFO.cs @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 destination = potentialTarget.Center - new Vector2((float)Math.Cos(angle) * potentialTarget.width * 0.65f, 250f); projectile.velocity = Vector2.Lerp(projectile.velocity, projectile.SafeDirectionTo(destination) * 24f, 0.03f); - if (projectile.ai[0] % 3f == 2f && potentialTarget.Top.Y > projectile.Bottom.Y) + if (projectile.ai[0] % 4f == 3f && potentialTarget.Top.Y > projectile.Bottom.Y) { Vector2 laserVelocity = projectile.SafeDirectionTo(potentialTarget.Center, Vector2.UnitY).RotatedByRandom(0.15f) * 25f; Projectile.NewProjectile(projectile.Bottom, laserVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); diff --git a/Projectiles/Typeless/BobbitHead.cs b/Projectiles/Typeless/BobbitHead.cs index 9853d2c331..7ac1093342 100644 --- a/Projectiles/Typeless/BobbitHead.cs +++ b/Projectiles/Typeless/BobbitHead.cs @@ -9,6 +9,10 @@ namespace CalamityMod.Projectiles.Typeless { public class BobbitHead : ModProjectile { + public const float PullSpeed = 24f; + public const float ReelbackSpeed = 28f; + public const float LaunchSpeed = 25f; + public const float GrappleRangInTiles = 40f; public override void SetStaticDefaults() { DisplayName.SetDefault("Bobbit Head"); @@ -38,10 +42,7 @@ namespace CalamityMod.Projectiles.Typeless } // Amethyst Hook is 300, Static Hook is 600, 16f = 1 tile - public override float GrappleRange() - { - return 640f; //40 tiles - } + public override float GrappleRange() => GrappleRangInTiles * 16f; public override void NumGrappleHooks(Player player, ref int numHooks) { @@ -51,12 +52,12 @@ namespace CalamityMod.Projectiles.Typeless // default is 11, Lunar is 24 public override void GrappleRetreatSpeed(Player player, ref float speed) { - speed = 28f; + speed = ReelbackSpeed; } public override void GrapplePullSpeed(Player player, ref float speed) { - speed = 24; + speed = PullSpeed; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Typeless/TarraEnergy.cs b/Projectiles/Typeless/TarraEnergy.cs index da23fa7c71..19236f4bfc 100644 --- a/Projectiles/Typeless/TarraEnergy.cs +++ b/Projectiles/Typeless/TarraEnergy.cs @@ -13,29 +13,26 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { - DisplayName.SetDefault("Round"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 3; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; + DisplayName.SetDefault("Tarra Energy"); } public override void SetDefaults() { - projectile.width = 8; - projectile.height = 8; - projectile.aiStyle = 1; + projectile.width = 4; + projectile.height = 4; projectile.friendly = true; projectile.penetrate = 1; - projectile.alpha = 255; - projectile.timeLeft = 120; + projectile.timeLeft = 200; projectile.extraUpdates = 1; - aiType = ProjectileID.Bullet; } + public override bool? CanHitNPC(NPC target) => projectile.timeLeft < 170 && target.CanBeChasedBy(projectile); + // Reduce damage of projectiles if more than the cap are active public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { int projectileCount = Main.player[projectile.owner].ownedProjectileCounts[projectile.type]; - int cap = 5; + int cap = 2; int oldDamage = damage; if (projectileCount > cap) { @@ -45,40 +42,24 @@ namespace CalamityMod.Projectiles.Typeless } } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); - for (int k = 0; k < projectile.oldPos.Length; k++) - { - Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); - spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); - } - return true; - } + public override void AI() + { + for (int num136 = 0; num136 < 2; num136++) + { + float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136; + float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136; + Vector2 dspeed = projectile.velocity * Main.rand.NextFloat(0.7f, 0.4f); + int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 107, 0f, 0f, 0, default, 1f); + Main.dust[num137].alpha = projectile.alpha; + Main.dust[num137].position.X = x2; + Main.dust[num137].position.Y = y2; + Main.dust[num137].velocity = dspeed; + Main.dust[num137].noGravity = true; + Main.dust[num137].noLight = true; + } - public override bool PreAI() - { - for (int num136 = 0; num136 < 2; num136++) - { - float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136; - float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136; - Vector2 dspeed = projectile.velocity * Main.rand.NextFloat(0.7f, 0.4f); - int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 107, 0f, 0f, 0, default, 1f); - Main.dust[num137].alpha = projectile.alpha; - Main.dust[num137].position.X = x2; - Main.dust[num137].position.Y = y2; - Main.dust[num137].velocity = dspeed; - Main.dust[num137].noGravity = true; - Main.dust[num137].noLight = true; - } - float num138 = (float)Math.Sqrt((double)(projectile.velocity.X * projectile.velocity.X + projectile.velocity.Y * projectile.velocity.Y)); - float num139 = projectile.localAI[0]; - if (num139 == 0f) - { - projectile.localAI[0] = num138; - } - return false; - } + if (projectile.timeLeft < 170) + CalamityGlobalProjectile.HomeInOnNPC(projectile, true, 600f, 9f, 20f); + } } } diff --git a/Sounds/Custom/PlagueSounds/PBGAttackSwitch1.cs b/Sounds/Custom/PlagueSounds/PBGAttackSwitch1.cs new file mode 100644 index 0000000000..ba5b5437dc --- /dev/null +++ b/Sounds/Custom/PlagueSounds/PBGAttackSwitch1.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom.PlagueSounds +{ + public class PBGAttackSwitch1 : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Custom/PlagueSounds/PBGAttackSwitch1.ogg b/Sounds/Custom/PlagueSounds/PBGAttackSwitch1.ogg new file mode 100644 index 0000000000..69a654c63c Binary files /dev/null and b/Sounds/Custom/PlagueSounds/PBGAttackSwitch1.ogg differ diff --git a/Sounds/Custom/PlagueSounds/PBGAttackSwitch2.cs b/Sounds/Custom/PlagueSounds/PBGAttackSwitch2.cs new file mode 100644 index 0000000000..d5413dea03 --- /dev/null +++ b/Sounds/Custom/PlagueSounds/PBGAttackSwitch2.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom.PlagueSounds +{ + public class PBGAttackSwitch2 : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Custom/PlagueSounds/PBGAttackSwitch2.ogg b/Sounds/Custom/PlagueSounds/PBGAttackSwitch2.ogg new file mode 100644 index 0000000000..54cb0b0662 Binary files /dev/null and b/Sounds/Custom/PlagueSounds/PBGAttackSwitch2.ogg differ diff --git a/Sounds/Custom/PlagueSounds/PBGBarrageLaunch.cs b/Sounds/Custom/PlagueSounds/PBGBarrageLaunch.cs new file mode 100644 index 0000000000..f02f87dad1 --- /dev/null +++ b/Sounds/Custom/PlagueSounds/PBGBarrageLaunch.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom.PlagueSounds +{ + public class PBGBarrageLaunch : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Custom/PlagueSounds/PBGBarrageLaunch.ogg b/Sounds/Custom/PlagueSounds/PBGBarrageLaunch.ogg new file mode 100644 index 0000000000..02e72e7388 Binary files /dev/null and b/Sounds/Custom/PlagueSounds/PBGBarrageLaunch.ogg differ diff --git a/Sounds/Custom/PlagueSounds/PBGDash.cs b/Sounds/Custom/PlagueSounds/PBGDash.cs new file mode 100644 index 0000000000..04e5d76618 --- /dev/null +++ b/Sounds/Custom/PlagueSounds/PBGDash.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom.PlagueSounds +{ + public class PBGDash : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Custom/PlagueSounds/PBGDash.ogg b/Sounds/Custom/PlagueSounds/PBGDash.ogg new file mode 100644 index 0000000000..d16923cd0b Binary files /dev/null and b/Sounds/Custom/PlagueSounds/PBGDash.ogg differ diff --git a/Sounds/Custom/PlagueSounds/PBGNukeWarning.cs b/Sounds/Custom/PlagueSounds/PBGNukeWarning.cs new file mode 100644 index 0000000000..05487222f3 --- /dev/null +++ b/Sounds/Custom/PlagueSounds/PBGNukeWarning.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom.PlagueSounds +{ + public class PBGNukeWarning : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Custom/PlagueSounds/PBGNukeWarning.ogg b/Sounds/Custom/PlagueSounds/PBGNukeWarning.ogg new file mode 100644 index 0000000000..9e0fc4077a Binary files /dev/null and b/Sounds/Custom/PlagueSounds/PBGNukeWarning.ogg differ diff --git a/Sounds/Custom/PlagueSounds/PlagueBoom1.cs b/Sounds/Custom/PlagueSounds/PlagueBoom1.cs new file mode 100644 index 0000000000..5b9254ea8b --- /dev/null +++ b/Sounds/Custom/PlagueSounds/PlagueBoom1.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom.PlagueSounds +{ + public class PlagueBoom1 : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Custom/PlagueSounds/PlagueBoom1.ogg b/Sounds/Custom/PlagueSounds/PlagueBoom1.ogg new file mode 100644 index 0000000000..71f1ef82f9 Binary files /dev/null and b/Sounds/Custom/PlagueSounds/PlagueBoom1.ogg differ diff --git a/Sounds/Custom/PlagueSounds/PlagueBoom2.cs b/Sounds/Custom/PlagueSounds/PlagueBoom2.cs new file mode 100644 index 0000000000..9a864fe308 --- /dev/null +++ b/Sounds/Custom/PlagueSounds/PlagueBoom2.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom.PlagueSounds +{ + public class PlagueBoom2 : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Custom/PlagueSounds/PlagueBoom2.ogg b/Sounds/Custom/PlagueSounds/PlagueBoom2.ogg new file mode 100644 index 0000000000..f74b47d4d5 Binary files /dev/null and b/Sounds/Custom/PlagueSounds/PlagueBoom2.ogg differ diff --git a/Sounds/Custom/PlagueSounds/PlagueBoom3.cs b/Sounds/Custom/PlagueSounds/PlagueBoom3.cs new file mode 100644 index 0000000000..b13ab47ede --- /dev/null +++ b/Sounds/Custom/PlagueSounds/PlagueBoom3.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom.PlagueSounds +{ + public class PlagueBoom3 : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Custom/PlagueSounds/PlagueBoom3.ogg b/Sounds/Custom/PlagueSounds/PlagueBoom3.ogg new file mode 100644 index 0000000000..b2bb1c78db Binary files /dev/null and b/Sounds/Custom/PlagueSounds/PlagueBoom3.ogg differ diff --git a/Sounds/Custom/PlagueSounds/PlagueBoom4.cs b/Sounds/Custom/PlagueSounds/PlagueBoom4.cs new file mode 100644 index 0000000000..5bb6a468ad --- /dev/null +++ b/Sounds/Custom/PlagueSounds/PlagueBoom4.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom.PlagueSounds +{ + public class PlagueBoom4 : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Custom/PlagueSounds/PlagueBoom4.ogg b/Sounds/Custom/PlagueSounds/PlagueBoom4.ogg new file mode 100644 index 0000000000..4064c083da Binary files /dev/null and b/Sounds/Custom/PlagueSounds/PlagueBoom4.ogg differ diff --git a/Sounds/Custom/ThanatosVent.cs b/Sounds/Custom/ThanatosVent.cs new file mode 100644 index 0000000000..0f1a0799d7 --- /dev/null +++ b/Sounds/Custom/ThanatosVent.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom +{ + public class ThanatosVent : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume * 1f; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Custom/YharonFire.cs b/Sounds/Custom/YharonFire.cs new file mode 100644 index 0000000000..41c010f6b6 --- /dev/null +++ b/Sounds/Custom/YharonFire.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom +{ + public class YharonFire : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Custom/YharonFire.ogg b/Sounds/Custom/YharonFire.ogg new file mode 100644 index 0000000000..e1684f2f2f Binary files /dev/null and b/Sounds/Custom/YharonFire.ogg differ diff --git a/UI/BossHealthBarManager.cs b/UI/BossHealthBarManager.cs index 08e7c65b0f..5c5cdae84a 100644 --- a/UI/BossHealthBarManager.cs +++ b/UI/BossHealthBarManager.cs @@ -103,11 +103,6 @@ namespace CalamityMod.UI OneToMany[NPCID.BrainofCthulhu] = BoC; OneToMany[NPCID.Creeper] = BoC; - int[] PerfWorm = new int[] { ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }; - OneToMany[ModContent.NPCType()] = PerfWorm; - OneToMany[ModContent.NPCType()] = PerfWorm; - OneToMany[ModContent.NPCType()] = PerfWorm; - int[] Skele = new int[] { NPCID.SkeletronHead, NPCID.SkeletronHand }; OneToMany[NPCID.SkeletronHead] = Skele; OneToMany[NPCID.SkeletronHand] = Skele; @@ -389,10 +384,10 @@ namespace CalamityMod.UI break; } - // Sort out the eater of worlds or medium perf worm splitting into multiple segments and multiple of them being heads - if (type == NPCID.EaterofWorldsHead || type == ModContent.NPCType()) + // Sort out the eater of worlds splitting into multiple segments and multiple of them being heads + if (type == NPCID.EaterofWorldsHead) { - if (Main.npc[id].type == NPCID.EaterofWorldsHead || Main.npc[id].type == ModContent.NPCType()) + if (Main.npc[id].type == NPCID.EaterofWorldsHead) { hasBar = true; } @@ -470,6 +465,7 @@ namespace CalamityMod.UI private int _comboStartHealth; private int _damageCountdown; public int EnrageTimer; + public int AttachedNPCType = -1; private NPC _npc { @@ -534,6 +530,7 @@ namespace CalamityMod.UI _npcLocation = id; _maxHealth = Main.npc[id].lifeMax; + AttachedNPCType = Main.npc[id].type; if (OneToMany.ContainsKey(Main.npc[id].type)) { @@ -564,7 +561,10 @@ namespace CalamityMod.UI dead = true; int life = _npc.life; - if (life < 0 || !_npc.active || _npc.lifeMax < 800) + + // NPCs appear to be able to occasionally be replaced by a new NPC faster than the bar can register the death of the last NPC. + // To midigate this, a special type check is put in place to catch unusual NPCs occupying the space of a would-be dead bar. + if (life < 0 || !_npc.active || _npc.lifeMax < 100 || _npc.type != AttachedNPCType) dead = true; if (_oneToMany) @@ -592,7 +592,7 @@ namespace CalamityMod.UI return; int currentLife = _npc.life; - bool enraged = _npc.Calamity().CurrentlyEnraged; + bool enraged = _npc.active && _npc.Calamity().CurrentlyEnraged; // Calculate current life based all types that are available and considered part of one boss if (_oneToMany) diff --git a/Utilities/NPCDebuffs.cs b/Utilities/NPCDebuffs.cs index 310a8bcd45..794f7ce459 100644 --- a/Utilities/NPCDebuffs.cs +++ b/Utilities/NPCDebuffs.cs @@ -17,6 +17,7 @@ using CalamityMod.NPCs.Leviathan; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.OldDuke; using CalamityMod.NPCs.PlaguebringerGoliath; +using CalamityMod.NPCs.PlagueEnemies; using CalamityMod.NPCs.Polterghast; using CalamityMod.NPCs.ProfanedGuardians; using CalamityMod.NPCs.Providence; diff --git a/Utilities/NPCStats.cs b/Utilities/NPCStats.cs index fa7cdb4daa..5709e12e23 100644 --- a/Utilities/NPCStats.cs +++ b/Utilities/NPCStats.cs @@ -804,6 +804,8 @@ namespace CalamityMod { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 400, 600, 632, 648, 948 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 350, 528, 556, 572, 834 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 500, 752, 788, 808, 1182 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 350, 528, 556, 572, 834 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 350, 528, 556, 572, 834 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 350, 528, 556, 572, 834 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 350, 528, 556, 572, 834 } },