diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 07a8e300a1..5f76a6e85f 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -2441,6 +2441,15 @@ namespace CalamityMod.CalPlayer bool useNebulaS = NPC.AnyNPCs(ModContent.NPCType()); player.ManageSpecialBiomeVisuals("CalamityMod:DevourerofGodsHeadS", useNebulaS); + bool useFlash = NPC.AnyNPCs(ModContent.NPCType()); + if (SkyManager.Instance["CalamityMod:StormWeaverFlash"] != null && useFlash != SkyManager.Instance["CalamityMod:StormWeaverFlash"].IsActive()) + { + if (useFlash) + SkyManager.Instance.Activate("CalamityMod:StormWeaverFlash", player.Center); + else + SkyManager.Instance.Deactivate("CalamityMod:StormWeaverFlash"); + } + bool useBrimstone = NPC.AnyNPCs(ModContent.NPCType()); player.ManageSpecialBiomeVisuals("CalamityMod:CalamitasRun3", useBrimstone); @@ -2451,13 +2460,9 @@ namespace CalamityMod.CalPlayer if (SkyManager.Instance["CalamityMod:Cryogen"] != null && useCryogen != SkyManager.Instance["CalamityMod:Cryogen"].IsActive()) { if (useCryogen) - { SkyManager.Instance.Activate("CalamityMod:Cryogen", player.Center); - } else - { SkyManager.Instance.Deactivate("CalamityMod:Cryogen"); - } } Point point = player.Center.ToTileCoordinates(); @@ -2485,13 +2490,17 @@ namespace CalamityMod.CalPlayer if (SkyManager.Instance["CalamityMod:Cryogen"] != null && cryogenActive != SkyManager.Instance["CalamityMod:Cryogen"].IsActive()) { if (cryogenActive) - { SkyManager.Instance.Activate("CalamityMod:Cryogen"); - } else - { SkyManager.Instance.Deactivate("CalamityMod:Cryogen"); - } + } + + if (SkyManager.Instance["CalamityMod:StormWeaverFlash"] != null && useFlash != SkyManager.Instance["CalamityMod:StormWeaverFlash"].IsActive()) + { + if (useFlash) + SkyManager.Instance.Activate("CalamityMod:StormWeaverFlash", player.Center); + else + SkyManager.Instance.Deactivate("CalamityMod:StormWeaverFlash"); } } @@ -3523,9 +3532,9 @@ namespace CalamityMod.CalPlayer } // Takes the % move speed boost and reduces it to a quarter to get the actual speed increase - // 400% move speed boost = 100% run speed boost, so an 8 run speed would become 16 with a 400% move speed stat + // 400% move speed boost = 80% run speed boost, so an 8 run speed would become 14.4 with a 400% move speed stat float accRunSpeedMin = player.accRunSpeed * 0.5f; - player.accRunSpeed += player.accRunSpeed * moveSpeedStat * 0.0025f; + player.accRunSpeed += player.accRunSpeed * moveSpeedStat * 0.002f; if (player.accRunSpeed < accRunSpeedMin) player.accRunSpeed = accRunSpeedMin; @@ -4490,16 +4499,26 @@ namespace CalamityMod.CalPlayer #region Get Weapon Damage And KB public override void ModifyWeaponDamage(Item item, ref float add, ref float mult, ref float flat) { + if (item.type == ModContent.ItemType()) + mult += GaelsGreatsword.BaseDamage / (float)GaelsGreatsword.BaseDamage - 1f; + if (flamethrowerBoost && item.ranged && (item.useAmmo == AmmoID.Gel || CalamityLists.flamethrowerList.Contains(item.type))) mult += hoverboardBoost ? 0.35f : 0.25f; - if (cinnamonRoll && CalamityLists.fireWeaponList.Contains(item.type)) - mult += 0.15f; + if (fireball && cinnamonRoll && CalamityLists.fireWeaponList.Contains(item.type)) + { + mult += 0.125f; + } + else + { + if (fireball && CalamityLists.fireWeaponList.Contains(item.type)) + mult += 0.05f; + + if (cinnamonRoll && CalamityLists.fireWeaponList.Contains(item.type)) + mult += 0.1f; + } if (evergreenGin && CalamityLists.natureWeaponList.Contains(item.type)) - mult += 0.15f; - - if (fireball && CalamityLists.fireWeaponList.Contains(item.type)) mult += 0.1f; if (eskimoSet && CalamityLists.iceWeaponList.Contains(item.type)) @@ -4518,45 +4537,34 @@ namespace CalamityMod.CalPlayer public override void GetWeaponKnockback(Item item, ref float knockback) { if (auricBoost) - { knockback *= 1f + (1f - modStealth) * 0.5f; - } + if (whiskey) - { knockback *= 1.04f; - } + if (tequila && Main.dayTime) - { knockback *= 1.03f; - } + if (tequilaSunrise && Main.dayTime) - { knockback *= 1.07f; - } + if (moscowMule) - { knockback *= 1.09f; - } + if (titanHeartMask && item.Calamity().rogue) - { knockback *= 1.05f; - } + if (titanHeartMantle && item.Calamity().rogue) - { knockback *= 1.05f; - } + if (titanHeartBoots && item.Calamity().rogue) - { knockback *= 1.05f; - } + if (titanHeartSet && item.Calamity().rogue) - { knockback *= 1.2f; - } + if (titanHeartSet && StealthStrikeAvailable() && item.Calamity().rogue) - { knockback *= 2f; - } } #endregion @@ -5278,7 +5286,7 @@ namespace CalamityMod.CalPlayer if (screwdriver) { if (proj.penetrate > 1 || proj.penetrate == -1) - damageMult += 0.1; + damageMult += 0.05; } if (auricSet && godSlayerDamage && isTrueMelee) @@ -5711,7 +5719,7 @@ namespace CalamityMod.CalPlayer contactDamageReduction += 0.1; if (vHex) - contactDamageReduction -= 0.3; + contactDamageReduction -= 0.1; if (irradiated) contactDamageReduction -= 0.1; @@ -6153,7 +6161,7 @@ namespace CalamityMod.CalPlayer projectileDamageReduction += 0.1; if (vHex) - projectileDamageReduction -= 0.3; + projectileDamageReduction -= 0.1; if (irradiated) projectileDamageReduction -= 0.1; @@ -6723,46 +6731,43 @@ namespace CalamityMod.CalPlayer } } } - #endregion + #endregion - #region On Hit - public override void OnHitByNPC(NPC npc, int damage, bool crit) - { - if (sulfurSet) - npc.AddBuff(BuffID.Poisoned, 120); + #region On Hit + public override void OnHitByNPC(NPC npc, int damage, bool crit) + { + if (sulfurSet) + npc.AddBuff(BuffID.Poisoned, 120); - if (CalamityWorld.revenge || CalamityWorld.malice) - { - if (npc.type == NPCID.ShadowFlameApparition || (npc.type == NPCID.ChaosBall && (Main.hardMode || areThereAnyDamnBosses))) - { - player.AddBuff(ModContent.BuffType(), 180); - } - else if (npc.type == NPCID.Spazmatism && npc.ai[0] != 1f && npc.ai[0] != 2f && npc.ai[0] != 0f) - { - player.AddBuff(BuffID.Bleeding, 300); - } - else if (npc.type == NPCID.Plantera && npc.life < npc.lifeMax / 2) - { - player.AddBuff(BuffID.Poisoned, 180); - player.AddBuff(BuffID.Venom, 180); - player.AddBuff(BuffID.Bleeding, 300); - } - else if (npc.type == NPCID.PlanterasTentacle) - { - player.AddBuff(BuffID.Poisoned, 120); - player.AddBuff(BuffID.Venom, 120); - player.AddBuff(BuffID.Bleeding, 180); - } - else if (npc.type == NPCID.AncientDoom) - { - player.AddBuff(ModContent.BuffType(), 120); - } - else if (npc.type == NPCID.AncientLight) - { - player.AddBuff(ModContent.BuffType(), 180); - } - } - } + if (npc.type == NPCID.ShadowFlameApparition || (npc.type == NPCID.ChaosBall && (Main.hardMode || areThereAnyDamnBosses))) + { + player.AddBuff(ModContent.BuffType(), 180); + } + else if (npc.type == NPCID.Spazmatism && npc.ai[0] != 1f && npc.ai[0] != 2f && npc.ai[0] != 0f) + { + player.AddBuff(BuffID.Bleeding, 300); + } + else if (npc.type == NPCID.Plantera && npc.life < npc.lifeMax / 2) + { + player.AddBuff(BuffID.Poisoned, 180); + player.AddBuff(BuffID.Venom, 180); + player.AddBuff(BuffID.Bleeding, 300); + } + else if (npc.type == NPCID.PlanterasTentacle) + { + player.AddBuff(BuffID.Poisoned, 120); + player.AddBuff(BuffID.Venom, 120); + player.AddBuff(BuffID.Bleeding, 180); + } + else if (npc.type == NPCID.AncientDoom) + { + player.AddBuff(ModContent.BuffType(), 120); + } + else if (npc.type == NPCID.AncientLight) + { + player.AddBuff(ModContent.BuffType(), 180); + } + } public override void OnHitByProjectile(Projectile proj, int damage, bool crit) { @@ -6781,7 +6786,7 @@ namespace CalamityMod.CalPlayer } } - if ((CalamityWorld.revenge || CalamityWorld.malice) && proj.hostile) + if (proj.hostile) { if (proj.type == ProjectileID.Explosives) { @@ -7427,7 +7432,10 @@ namespace CalamityMod.CalPlayer if (npcDist < freezeDist) { - float duration = Main.rand.Next(30 + (int)damage / 3, 80 + (int)damage / 2); + float duration = Main.rand.Next(10 + (int)damage / 4, 20 + (int)damage / 3); + if (duration > 120) + duration = 120; + npc.AddBuff(ModContent.BuffType(), (int)duration, false); } } @@ -8043,7 +8051,7 @@ namespace CalamityMod.CalPlayer } if (npc.immune[player.whoAmI] < 6) npc.immune[player.whoAmI] = 6; - npc.AddBuff(ModContent.BuffType(), 300); + npc.AddBuff(ModContent.BuffType(), 60); bool isImmune = false; for (int j = 0; j < player.hurtCooldowns.Length; j++) { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index a330e7c466..685c513ecd 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1483,7 +1483,7 @@ namespace CalamityMod.CalPlayer if (!npc.buffImmune[buffType] && Vector2.Distance(player.Center, npc.Center) <= freezeDist) { if (npc.FindBuffIndex(buffType) == -1) - npc.AddBuff(buffType, 120, false); + npc.AddBuff(buffType, 60, false); } } } @@ -2801,7 +2801,7 @@ namespace CalamityMod.CalPlayer if (modPlayer.vHex) { player.blind = true; - player.statDefense -= 30; + player.statDefense -= 10; player.moveSpeed -= 0.1f; if (player.wingTimeMax < 0) @@ -4013,7 +4013,7 @@ namespace CalamityMod.CalPlayer private static void EnduranceReductions(Player player, CalamityPlayer modPlayer) { if (modPlayer.vHex) - player.endurance -= 0.3f; + player.endurance -= 0.1f; if (modPlayer.irradiated) player.endurance -= 0.1f; diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 5c5942edcb..842948dacd 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -743,10 +743,6 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffType(), duration, false); target.AddBuff(BuffType(), duration, false); target.AddBuff(BuffType(), duration, false); - if (Main.rand.NextBool(5)) - { - target.AddBuff(BuffType(), duration, false); - } } if (modPlayer.cryogenSoul || modPlayer.frostFlare) { @@ -764,9 +760,6 @@ namespace CalamityMod.CalPlayer { CalamityUtils.Inflict246DebuffsNPC(target, BuffType()); } - - if (modPlayer.auricSet && modPlayer.godSlayerDamage && Main.rand.NextBool(4) && proj) - target.AddBuff(BuffType(), 60); } if (modPlayer.armorCrumbling || modPlayer.armorShattering) { @@ -823,7 +816,7 @@ namespace CalamityMod.CalPlayer if (modPlayer.tearMinions) { - target.AddBuff(BuffType(), 60); + target.AddBuff(BuffType(), 30); } if (modPlayer.shadowMinions) @@ -896,10 +889,6 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffType(), duration, false); target.AddBuff(BuffType(), duration, false); target.AddBuff(BuffType(), duration, false); - if (Main.rand.NextBool(5)) - { - target.AddBuff(BuffType(), duration, false); - } } if (modPlayer.aWeapon) { @@ -917,8 +906,6 @@ namespace CalamityMod.CalPlayer { CalamityUtils.Inflict246DebuffsPvp(target, BuffID.OnFire, 4f); } - if (modPlayer.auricSet && modPlayer.godSlayerDamage && Main.rand.NextBool(4) && proj) - target.AddBuff(BuffType(), 60); } if (modPlayer.armorCrumbling || modPlayer.armorShattering) { @@ -972,7 +959,7 @@ namespace CalamityMod.CalPlayer if (modPlayer.tearMinions) { - target.AddBuff(BuffType(), 60); + target.AddBuff(BuffType(), 30); } if (modPlayer.shadowMinions) diff --git a/CalamityMod.cs b/CalamityMod.cs index 0ef04fb52d..c9b2b04da4 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -258,6 +258,7 @@ namespace CalamityMod SkyManager.Instance["CalamityMod:Astral"] = new AstralSky(); SkyManager.Instance["CalamityMod:Cryogen"] = new CryogenSky(); + SkyManager.Instance["CalamityMod:StormWeaverFlash"] = new StormWeaverFlashSky(); CalamityShaders.LoadShaders(); diff --git a/Dusts/AstralBasic.cs b/Dusts/AstralBasic.cs index f771e84cdb..d9abf93c5b 100644 --- a/Dusts/AstralBasic.cs +++ b/Dusts/AstralBasic.cs @@ -13,14 +13,12 @@ namespace CalamityMod.Dusts public override bool Update(Dust dust) { - //update position + // Update position dust.position += dust.velocity; dust.scale -= 0.02f; if (dust.scale < 0.1f) - { dust.active = false; - } return false; } diff --git a/Dusts/CeaselessDust.cs b/Dusts/CeaselessDust.cs new file mode 100644 index 0000000000..c569eee0f8 --- /dev/null +++ b/Dusts/CeaselessDust.cs @@ -0,0 +1,35 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Dusts +{ + public class CeaselessDust : ModDust + { + public override void OnSpawn(Dust dust) + { + dust.noGravity = true; + } + + public override bool Update(Dust dust) + { + float scale = dust.scale; + Lighting.AddLight((int)(dust.position.X / 16f), (int)(dust.position.Y / 16f), scale * 0.4f, scale * 0.1f, scale); + + dust.position += dust.velocity; + dust.velocity *= 0.95f; + dust.scale -= 0.05f; + + if (dust.scale <= 0.05f) + dust.active = false; + + return false; + } + + public override Color? GetAlpha(Dust dust, Color lightColor) + { + int newColor = (int)(250f * dust.scale); + return new Color(newColor, newColor, newColor, 0); + } + } +} diff --git a/Dusts/CeaselessDust.png b/Dusts/CeaselessDust.png new file mode 100644 index 0000000000..de9e295d65 Binary files /dev/null and b/Dusts/CeaselessDust.png differ diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 838388d5f8..0847369958 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1570,7 +1570,7 @@ namespace CalamityMod.Items public override void HorizontalWingSpeeds(Item item, Player player, ref float speed, ref float acceleration) { CalamityPlayer modPlayer = player.Calamity(); - float moveSpeedBoost = modPlayer.moveSpeedStat * 0.0015f; + float moveSpeedBoost = modPlayer.moveSpeedStat * 0.001f; float flightSpeedMult = 1f + (modPlayer.soaring ? 0.1f : 0f) + diff --git a/Items/Potions/Alcohol/CinnamonRoll.cs b/Items/Potions/Alcohol/CinnamonRoll.cs index ebb6761c37..f90441a393 100644 --- a/Items/Potions/Alcohol/CinnamonRoll.cs +++ b/Items/Potions/Alcohol/CinnamonRoll.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Potions.Alcohol { DisplayName.SetDefault("Cinnamon Roll"); Tooltip.SetDefault(@"A great-tasting cinnamon whiskey with a touch of cream soda -Boosts mana regeneration rate and all fire-based weapon damage by 15% +Boosts mana regeneration rate and multiplies all fire-based weapon damage by 1.1 Cursed flame, shadowflame, god slayer inferno, brimstone flame, and frostburn weapons will not receive this benefit The weapon must be more fire-related than anything else Reduces defense by 10%"); diff --git a/Items/Potions/Alcohol/EvergreenGin.cs b/Items/Potions/Alcohol/EvergreenGin.cs index ef479c97ce..234647eb09 100644 --- a/Items/Potions/Alcohol/EvergreenGin.cs +++ b/Items/Potions/Alcohol/EvergreenGin.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Potions.Alcohol { DisplayName.SetDefault("Evergreen Gin"); Tooltip.SetDefault(@"It tastes like a Christmas tree if you can imagine that -Boosts nature-based weapon damage by 15% and damage reduction by 5% +Multiplies nature-based weapon damage by 1.1 and increases damage reduction by 5% Reduces life regen by 1"); } diff --git a/Items/Potions/Alcohol/Fireball.cs b/Items/Potions/Alcohol/Fireball.cs index ab948129bd..749c870248 100644 --- a/Items/Potions/Alcohol/Fireball.cs +++ b/Items/Potions/Alcohol/Fireball.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Potions.Alcohol { DisplayName.SetDefault("Fireball"); Tooltip.SetDefault(@"A great-tasting cinnamon whiskey -Boosts all fire-based weapon damage by 10% +Multiplies all fire-based weapon damage by 1.05 Cursed flame, shadowflame, god slayer inferno, brimstone flame, and frostburn weapons will not receive this benefit The weapon must be more fire-related than anything else Reduces life regen by 1"); diff --git a/Items/Potions/Alcohol/Screwdriver.cs b/Items/Potions/Alcohol/Screwdriver.cs index 59959d7b24..2848c8dd9a 100644 --- a/Items/Potions/Alcohol/Screwdriver.cs +++ b/Items/Potions/Alcohol/Screwdriver.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Potions.Alcohol { DisplayName.SetDefault("Screwdriver"); Tooltip.SetDefault(@"Do you have a screw loose? -Boosts piercing projectile damage by 10% +Multiplies piercing projectile damage by 1.05 Reduces life regen by 1"); } diff --git a/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs b/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs index a553b296cc..01199662ac 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs @@ -48,6 +48,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal 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 * 1.05); + int proj = Projectile.NewProjectile(position, new Vector2(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/Magic/HadopelagicEcho.cs b/Items/Weapons/Magic/HadopelagicEcho.cs index 6bd261712d..8fbdcfc37c 100644 --- a/Items/Weapons/Magic/HadopelagicEcho.cs +++ b/Items/Weapons/Magic/HadopelagicEcho.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 308; + item.damage = 230; item.magic = true; item.mana = 15; item.width = 60; diff --git a/Items/Weapons/Magic/PhoenixFlameBarrage.cs b/Items/Weapons/Magic/PhoenixFlameBarrage.cs index 7a41a48af3..3ca1053c46 100644 --- a/Items/Weapons/Magic/PhoenixFlameBarrage.cs +++ b/Items/Weapons/Magic/PhoenixFlameBarrage.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 116; + item.damage = 87; item.magic = true; item.mana = 20; item.width = 72; diff --git a/Items/Weapons/Magic/SubsumingVortex.cs b/Items/Weapons/Magic/SubsumingVortex.cs index 02018fb633..561aa64ca2 100644 --- a/Items/Weapons/Magic/SubsumingVortex.cs +++ b/Items/Weapons/Magic/SubsumingVortex.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 400; + item.damage = 300; item.magic = true; item.mana = 78; item.width = 38; diff --git a/Items/Weapons/Magic/T1000.cs b/Items/Weapons/Magic/T1000.cs index 872b6fc0b6..bbc3a8a0ec 100644 --- a/Items/Weapons/Magic/T1000.cs +++ b/Items/Weapons/Magic/T1000.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 142; + item.damage = 200; item.magic = true; item.mana = 10; item.width = 20; @@ -30,13 +30,13 @@ namespace CalamityMod.Items.Weapons.Magic item.noUseGraphic = true; item.channel = true; item.knockBack = 4f; - item.value = Item.buyPrice(1, 80, 0, 0); - item.rare = ItemRarityID.Red; - item.autoReuse = true; + item.value = CalamityGlobalItem.Rarity15BuyPrice; + item.rare = ItemRarityID.Purple; + item.autoReuse = true; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 24f; - item.Calamity().customRarity = CalamityRarity.DarkBlue; - } + item.Calamity().customRarity = CalamityRarity.Violet; + } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Magic { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 4); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); diff --git a/Items/Weapons/Magic/TheWand.cs b/Items/Weapons/Magic/TheWand.cs index cd3b8f6de5..43f34b0c29 100644 --- a/Items/Weapons/Magic/TheWand.cs +++ b/Items/Weapons/Magic/TheWand.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.Magic { public class TheWand : ModItem { - public static int BaseDamage = 799; + public static int BaseDamage = 599; public override void SetStaticDefaults() { diff --git a/Items/Weapons/Magic/VividClarity.cs b/Items/Weapons/Magic/VividClarity.cs index 5906f551c6..a602bd5e23 100644 --- a/Items/Weapons/Magic/VividClarity.cs +++ b/Items/Weapons/Magic/VividClarity.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 206; + item.damage = 155; item.magic = true; item.mana = 42; item.width = 90; diff --git a/Items/Weapons/Magic/VoidVortex.cs b/Items/Weapons/Magic/VoidVortex.cs index f90a0a480d..751de4be03 100644 --- a/Items/Weapons/Magic/VoidVortex.cs +++ b/Items/Weapons/Magic/VoidVortex.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 100; + item.damage = 75; item.magic = true; item.mana = 60; item.width = 130; diff --git a/Items/Weapons/Magic/YharimsCrystal.cs b/Items/Weapons/Magic/YharimsCrystal.cs index 7bf7114513..e69c022965 100644 --- a/Items/Weapons/Magic/YharimsCrystal.cs +++ b/Items/Weapons/Magic/YharimsCrystal.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 150; + item.damage = 125; item.magic = true; item.mana = 15; item.width = 16; diff --git a/Items/Weapons/Melee/AbsoluteZero.cs b/Items/Weapons/Melee/AbsoluteZero.cs index d7c10d6a05..3f04f7afad 100644 --- a/Items/Weapons/Melee/AbsoluteZero.cs +++ b/Items/Weapons/Melee/AbsoluteZero.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit) { target.AddBuff(BuffID.Frostburn, 600); - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 60); int p = Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), knockBack * 3f, player.whoAmI); Main.projectile[p].Kill(); @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { target.AddBuff(BuffID.Frostburn, 600); - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 60); int p = Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), 12f, player.whoAmI); Main.projectile[p].Kill(); diff --git a/Items/Weapons/Melee/ArkoftheCosmos.cs b/Items/Weapons/Melee/ArkoftheCosmos.cs index b835ee464c..3c22271df5 100644 --- a/Items/Weapons/Melee/ArkoftheCosmos.cs +++ b/Items/Weapons/Melee/ArkoftheCosmos.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 102; - item.damage = 200; + item.damage = 150; item.melee = true; item.useAnimation = 15; item.useTime = 15; @@ -34,8 +34,8 @@ namespace CalamityMod.Items.Weapons.Melee item.UseSound = SoundID.Item60; item.autoReuse = true; item.height = 102; - item.value = Item.buyPrice(2, 50, 0, 0); - item.rare = ItemRarityID.Red; + item.value = CalamityGlobalItem.Rarity15BuyPrice; + item.rare = ItemRarityID.Purple; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 28f; item.Calamity().customRarity = CalamityRarity.Violet; diff --git a/Items/Weapons/Melee/ArkoftheElements.cs b/Items/Weapons/Melee/ArkoftheElements.cs index 97a7a561a1..d7fc7a9786 100644 --- a/Items/Weapons/Melee/ArkoftheElements.cs +++ b/Items/Weapons/Melee/ArkoftheElements.cs @@ -125,7 +125,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } @@ -133,7 +133,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Items/Weapons/Melee/Ataraxia.cs b/Items/Weapons/Melee/Ataraxia.cs index c9c628fc7d..23f4d63bee 100644 --- a/Items/Weapons/Melee/Ataraxia.cs +++ b/Items/Weapons/Melee/Ataraxia.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.width = 94; item.height = 92; item.melee = true; - item.damage = 1460; + item.damage = 1095; item.knockBack = 2.5f; item.useAnimation = 19; item.useTime = 19; diff --git a/Items/Weapons/Melee/CosmicShiv.cs b/Items/Weapons/Melee/CosmicShiv.cs index 35f391275f..df5fba12a9 100644 --- a/Items/Weapons/Melee/CosmicShiv.cs +++ b/Items/Weapons/Melee/CosmicShiv.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Items.Weapons.Melee } target.AddBuff(ModContent.BuffType(), 420); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 420); target.AddBuff(ModContent.BuffType(), 420); target.AddBuff(ModContent.BuffType(), 420); target.AddBuff(ModContent.BuffType(), 360); @@ -92,7 +92,7 @@ namespace CalamityMod.Items.Weapons.Melee } target.AddBuff(ModContent.BuffType(), 420); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 420); target.AddBuff(ModContent.BuffType(), 420); target.AddBuff(ModContent.BuffType(), 420); target.AddBuff(ModContent.BuffType(), 360); diff --git a/Items/Weapons/Melee/DraedonsExoblade.cs b/Items/Weapons/Melee/DraedonsExoblade.cs index 325412deb3..a1c4df303f 100644 --- a/Items/Weapons/Melee/DraedonsExoblade.cs +++ b/Items/Weapons/Melee/DraedonsExoblade.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 80; - item.damage = 2000; + item.damage = 1500; item.useAnimation = 14; item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 14; diff --git a/Items/Weapons/Melee/DragonPow.cs b/Items/Weapons/Melee/DragonPow.cs index f56a3bfa8a..1cf75ab8cc 100644 --- a/Items/Weapons/Melee/DragonPow.cs +++ b/Items/Weapons/Melee/DragonPow.cs @@ -29,7 +29,7 @@ Summons a barrage of petals and waterfalls on enemy hits"); item.width = 76; item.height = 82; item.melee = true; - item.damage = 1800; + item.damage = 1350; item.knockBack = 9f; item.useAnimation = 20; item.useTime = 20; diff --git a/Items/Weapons/Melee/DragonRage.cs b/Items/Weapons/Melee/DragonRage.cs index e85f82064b..7119bbaa05 100644 --- a/Items/Weapons/Melee/DragonRage.cs +++ b/Items/Weapons/Melee/DragonRage.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.damage = 320; + item.damage = 240; item.knockBack = 7.5f; item.useAnimation = item.useTime = 25; item.melee = true; diff --git a/Items/Weapons/Melee/ElementalExcalibur.cs b/Items/Weapons/Melee/ElementalExcalibur.cs index ec07a8a2ad..d16adc1054 100644 --- a/Items/Weapons/Melee/ElementalExcalibur.cs +++ b/Items/Weapons/Melee/ElementalExcalibur.cs @@ -147,9 +147,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(ModContent.BuffType(), 30); target.AddBuff(ModContent.BuffType(), 240); - target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 240); target.AddBuff(ModContent.BuffType(), 240); target.AddBuff(BuffID.CursedInferno, 240); @@ -167,9 +166,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(ModContent.BuffType(), 30); target.AddBuff(ModContent.BuffType(), 240); - target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 240); target.AddBuff(ModContent.BuffType(), 240); target.AddBuff(BuffID.CursedInferno, 240); diff --git a/Items/Weapons/Melee/ElementalShortsword.cs b/Items/Weapons/Melee/ElementalShortsword.cs index bd57db77b9..816c701ad3 100644 --- a/Items/Weapons/Melee/ElementalShortsword.cs +++ b/Items/Weapons/Melee/ElementalShortsword.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } @@ -76,7 +76,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Items/Weapons/Melee/ExoGladius.cs b/Items/Weapons/Melee/ExoGladius.cs index 24dcf3aa11..c8dd5e0755 100644 --- a/Items/Weapons/Melee/ExoGladius.cs +++ b/Items/Weapons/Melee/ExoGladius.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 12; item.width = 56; item.height = 56; - item.damage = 1080; + item.damage = 810; item.melee = true; item.knockBack = 9.9f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/GlacialCrusher.cs b/Items/Weapons/Melee/GlacialCrusher.cs index bd7e3e1ac3..1e9344c060 100644 --- a/Items/Weapons/Melee/GlacialCrusher.cs +++ b/Items/Weapons/Melee/GlacialCrusher.cs @@ -14,14 +14,13 @@ namespace CalamityMod.Items.Weapons.Melee DisplayName.SetDefault("Glacial Crusher"); Tooltip.SetDefault("Fires very slow frost projectiles that gain strength as they travel and freeze enemies\n" + "Enemies are frozen for longer the further the projectile travels\n" + - "True melee strikes cause tremendous damage to frozen enemies\n" + - "Enemies that cannot be frozen take increased damage"); + "True melee strikes cause tremendous damage to frozen enemies"); } public override void SetDefaults() { item.width = 60; - item.damage = 65; + item.damage = 120; item.melee = true; item.useAnimation = 27; item.useTime = 27; @@ -40,19 +39,12 @@ namespace CalamityMod.Items.Weapons.Melee public override void MeleeEffects(Player player, Rectangle hitbox) { if (Main.rand.NextBool(3)) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 67); - } + Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 67); } public override void ModifyHitNPC(Player player, NPC target, ref int damage, ref float knockBack, ref bool crit) { - if (target.buffImmune[ModContent.BuffType()]) - { - damage *= 2; - knockBack *= 2f; - } - else if (target.Calamity().gState > 0) + if (target.Calamity().gState > 0) { damage *= 3; knockBack *= 3f; diff --git a/Items/Weapons/Melee/Murasama.cs b/Items/Weapons/Melee/Murasama.cs index 32c7adf8d9..8460065048 100644 --- a/Items/Weapons/Melee/Murasama.cs +++ b/Items/Weapons/Melee/Murasama.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Melee { item.height = 128; item.width = 56; - item.damage = 8001; + item.damage = 6001; item.melee = true; item.noMelee = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/Oracle.cs b/Items/Weapons/Melee/Oracle.cs index 429b2516dd..344be62473 100644 --- a/Items/Weapons/Melee/Oracle.cs +++ b/Items/Weapons/Melee/Oracle.cs @@ -10,9 +10,9 @@ namespace CalamityMod.Items.Weapons.Melee { public class Oracle : ModItem { - public const int YoyoBaseDamage = 150; - public const int AuraBaseDamage = 50; - public const int AuraMaxDamage = 160; + public const int YoyoBaseDamage = 115; + public const int AuraBaseDamage = 40; + public const int AuraMaxDamage = 120; public override void SetStaticDefaults() { diff --git a/Items/Weapons/Melee/PrismaticBreaker.cs b/Items/Weapons/Melee/PrismaticBreaker.cs index e5ccfb9e7f..da46d4a986 100644 --- a/Items/Weapons/Melee/PrismaticBreaker.cs +++ b/Items/Weapons/Melee/PrismaticBreaker.cs @@ -136,7 +136,6 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(BuffID.CursedInferno, 120); @@ -148,7 +147,6 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(BuffID.CursedInferno, 120); diff --git a/Items/Weapons/Melee/Swordsplosion.cs b/Items/Weapons/Melee/Swordsplosion.cs index 3fb9b30a30..8964ea5e7a 100644 --- a/Items/Weapons/Melee/Swordsplosion.cs +++ b/Items/Weapons/Melee/Swordsplosion.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 480); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 480); target.AddBuff(ModContent.BuffType(), 480); target.AddBuff(ModContent.BuffType(), 480); } @@ -114,7 +114,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType(), 480); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 480); target.AddBuff(ModContent.BuffType(), 480); target.AddBuff(ModContent.BuffType(), 480); } diff --git a/Items/Weapons/Melee/TeardropCleaver.cs b/Items/Weapons/Melee/TeardropCleaver.cs index bfcbd9389d..10d49af2b4 100644 --- a/Items/Weapons/Melee/TeardropCleaver.cs +++ b/Items/Weapons/Melee/TeardropCleaver.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 60); } } } diff --git a/Items/Weapons/Melee/TemporalFloeSword.cs b/Items/Weapons/Melee/TemporalFloeSword.cs index 6700d5f9b6..b5824845df 100644 --- a/Items/Weapons/Melee/TemporalFloeSword.cs +++ b/Items/Weapons/Melee/TemporalFloeSword.cs @@ -63,19 +63,13 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (Main.rand.NextBool(3)) - { - target.AddBuff(ModContent.BuffType(), 120); - } + target.AddBuff(ModContent.BuffType(), 60); target.AddBuff(BuffID.Frostburn, 600); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - if (Main.rand.NextBool(3)) - { - target.AddBuff(ModContent.BuffType(), 120); - } + target.AddBuff(ModContent.BuffType(), 60); target.AddBuff(BuffID.Frostburn, 600); } } diff --git a/Items/Weapons/Melee/Terratomere.cs b/Items/Weapons/Melee/Terratomere.cs index 758599b82d..3aaf0a99a3 100644 --- a/Items/Weapons/Melee/Terratomere.cs +++ b/Items/Weapons/Melee/Terratomere.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 30); if (!target.canGhostHeal || player.moonLeech) return; @@ -92,7 +92,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 30); if (player.moonLeech) return; diff --git a/Items/Weapons/Melee/TheBurningSky.cs b/Items/Weapons/Melee/TheBurningSky.cs index 4f077471c5..f8d2f52bbb 100644 --- a/Items/Weapons/Melee/TheBurningSky.cs +++ b/Items/Weapons/Melee/TheBurningSky.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 62; - item.damage = 80; + item.damage = 60; item.melee = true; item.useTime = 15; item.useAnimation = 15; diff --git a/Items/Weapons/Ranged/AcesHigh.cs b/Items/Weapons/Ranged/AcesHigh.cs index e505203d2b..13b704a3e8 100644 --- a/Items/Weapons/Ranged/AcesHigh.cs +++ b/Items/Weapons/Ranged/AcesHigh.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 639; + item.damage = 479; item.ranged = true; item.width = 48; item.height = 30; diff --git a/Items/Weapons/Ranged/ChickenCannon.cs b/Items/Weapons/Ranged/ChickenCannon.cs index 4ef99b3f93..9263922eb7 100644 --- a/Items/Weapons/Ranged/ChickenCannon.cs +++ b/Items/Weapons/Ranged/ChickenCannon.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 120; + item.damage = 90; item.ranged = true; item.width = 76; item.height = 24; diff --git a/Items/Weapons/Ranged/DragonsBreath.cs b/Items/Weapons/Ranged/DragonsBreath.cs index 21c4106769..7f23f120b5 100644 --- a/Items/Weapons/Ranged/DragonsBreath.cs +++ b/Items/Weapons/Ranged/DragonsBreath.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 105; + item.damage = 78; item.ranged = true; item.width = 64; item.height = 28; diff --git a/Items/Weapons/Ranged/Drataliornus.cs b/Items/Weapons/Ranged/Drataliornus.cs index a306d674b4..a164c41246 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 = 280; + item.damage = 210; item.knockBack = 1f; item.shootSpeed = 18f; item.useStyle = ItemUseStyleID.HoldingOut; diff --git a/Items/Weapons/Ranged/HeavenlyGale.cs b/Items/Weapons/Ranged/HeavenlyGale.cs index ecf0a47a9b..79778836df 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 = 240; + item.damage = 180; item.ranged = true; item.width = 44; item.height = 58; diff --git a/Items/Weapons/Ranged/MagnomalyCannon.cs b/Items/Weapons/Ranged/MagnomalyCannon.cs index e639a25e2f..9c6f2c15cd 100644 --- a/Items/Weapons/Ranged/MagnomalyCannon.cs +++ b/Items/Weapons/Ranged/MagnomalyCannon.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 580; + item.damage = 435; item.ranged = true; item.width = 84; item.height = 30; diff --git a/Items/Weapons/Ranged/Photoviscerator.cs b/Items/Weapons/Ranged/Photoviscerator.cs index be7b694689..da0b70c1b3 100644 --- a/Items/Weapons/Ranged/Photoviscerator.cs +++ b/Items/Weapons/Ranged/Photoviscerator.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 100; + item.damage = 75; item.ranged = true; item.width = 84; item.height = 30; diff --git a/Items/Weapons/Ranged/TyrannysEnd.cs b/Items/Weapons/Ranged/TyrannysEnd.cs index 8a09d669e7..f0fafacd23 100644 --- a/Items/Weapons/Ranged/TyrannysEnd.cs +++ b/Items/Weapons/Ranged/TyrannysEnd.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 1680; + item.damage = 1260; item.knockBack = 9.5f; item.ranged = true; item.useTime = 55; diff --git a/Items/Weapons/Rogue/Celestus.cs b/Items/Weapons/Rogue/Celestus.cs index 5762aa6bd6..4e02ac68b3 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 = 452; + item.damage = 340; item.knockBack = 6f; item.useAnimation = item.useTime = 20; item.Calamity().rogue = true; diff --git a/Items/Weapons/Rogue/CorpusAvertor.cs b/Items/Weapons/Rogue/CorpusAvertor.cs index 85cc695c66..ff44328602 100644 --- a/Items/Weapons/Rogue/CorpusAvertor.cs +++ b/Items/Weapons/Rogue/CorpusAvertor.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Rogue } // Gains 10% of missing health as base damage. - public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) + public override void SafeModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) { int lifeAmount = player.statLifeMax2 - player.statLife; flat += lifeAmount * 0.1f * player.RogueDamage(); diff --git a/Items/Weapons/Rogue/DeepSeaDumbbell.cs b/Items/Weapons/Rogue/DeepSeaDumbbell.cs index 7affbff433..d145fbe641 100644 --- a/Items/Weapons/Rogue/DeepSeaDumbbell.cs +++ b/Items/Weapons/Rogue/DeepSeaDumbbell.cs @@ -65,9 +65,9 @@ namespace CalamityMod.Items.Weapons.Rogue return base.CanUseItem(player); } - public override float UseTimeMultiplier(Player player) => player.altFunctionUse == 2 ? 5f / 9f : 1f; + public override float SafeSetUseTimeMultiplier(Player player) => player.altFunctionUse == 2 ? 5f / 9f : 1f; - public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) + public override void SafeModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) { mult += flexMult - 1f; } @@ -86,7 +86,7 @@ namespace CalamityMod.Items.Weapons.Rogue return false; } - int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); if (player.Calamity().StealthStrikeAvailable() && proj.WithinBounds(Main.maxProjectiles)) Main.projectile[proj].Calamity().stealthStrike = true; diff --git a/Items/Weapons/Rogue/EclipsesFall.cs b/Items/Weapons/Rogue/EclipsesFall.cs index 322d519d44..2635b81f18 100644 --- a/Items/Weapons/Rogue/EclipsesFall.cs +++ b/Items/Weapons/Rogue/EclipsesFall.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Rogue if (player.Calamity().StealthStrikeAvailable()) { type = ModContent.ProjectileType(); - damage = (int)(damage * 0.6); + damage = (int)(damage * 0.36); } int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); diff --git a/Items/Weapons/Rogue/ExecutionersBlade.cs b/Items/Weapons/Rogue/ExecutionersBlade.cs index ffabcf7c08..edb8f783e4 100644 --- a/Items/Weapons/Rogue/ExecutionersBlade.cs +++ b/Items/Weapons/Rogue/ExecutionersBlade.cs @@ -57,11 +57,13 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - if (player.Calamity().StealthStrikeAvailable() && counter == 0 && stealth.WithinBounds(Main.maxProjectiles)) - { + bool usingStealth = player.Calamity().StealthStrikeAvailable() && counter == 0; + if (usingStealth) + damage *= 2; + + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + if (usingStealth && stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; - } counter++; if (counter >= item.useAnimation / item.useTime) diff --git a/Items/Weapons/Rogue/FinalDawn.cs b/Items/Weapons/Rogue/FinalDawn.cs index 12a6ae9286..e8f4f344ce 100644 --- a/Items/Weapons/Rogue/FinalDawn.cs +++ b/Items/Weapons/Rogue/FinalDawn.cs @@ -16,9 +16,10 @@ namespace CalamityMod.Items.Weapons.Rogue "Stealth strikes perform a horizontal swing that leaves a lingering fire aura\n" + "Stealth strikes performed while pressing up fling yourself at the enemy and slice through them, causing homing fireballs to emerge"); } + public override void SafeSetDefaults() { - item.damage = 2000; + item.damage = 1500; item.Calamity().rogue = true; item.width = 78; item.height = 66; @@ -38,6 +39,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.channel = true; item.noUseGraphic = true; } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] + player.ownedProjectileCounts[ProjectileType()] + player.ownedProjectileCounts[ProjectileType()] + diff --git a/Items/Weapons/Rogue/Hypothermia.cs b/Items/Weapons/Rogue/Hypothermia.cs index 5247d31201..98b5179621 100644 --- a/Items/Weapons/Rogue/Hypothermia.cs +++ b/Items/Weapons/Rogue/Hypothermia.cs @@ -49,7 +49,8 @@ namespace CalamityMod.Items.Weapons.Rogue damage = (int)(damage * 1.55); if (player.Calamity().StealthStrikeAvailable() && player.itemAnimation == item.useAnimation - 1) //setting up the stealth strikes - { + { + damage *= 2; int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; diff --git a/Items/Weapons/Rogue/JawsOfOblivion.cs b/Items/Weapons/Rogue/JawsOfOblivion.cs index daa85d4e50..f0e3ca3140 100644 --- a/Items/Weapons/Rogue/JawsOfOblivion.cs +++ b/Items/Weapons/Rogue/JawsOfOblivion.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons.Rogue if (player.Calamity().StealthStrikeAvailable()) { - int p = Projectile.NewProjectile(position, currentDirection, type, damage, knockBack + 6f, player.whoAmI); + int p = Projectile.NewProjectile(position, currentDirection, type, (int)(damage * 1.8), knockBack + 6f, player.whoAmI); if (p.WithinBounds(Main.maxProjectiles)) Main.projectile[p].Calamity().stealthStrike = true; } diff --git a/Items/Weapons/Rogue/LeonidProgenitor.cs b/Items/Weapons/Rogue/LeonidProgenitor.cs index c536072ecf..f9c4b2476c 100644 --- a/Items/Weapons/Rogue/LeonidProgenitor.cs +++ b/Items/Weapons/Rogue/LeonidProgenitor.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Weapons.Rogue return base.CanUseItem(player); } - public override float UseTimeMultiplier (Player player) + public override float SafeSetUseTimeMultiplier(Player player) { if (player.Calamity().StealthStrikeAvailable() || player.altFunctionUse != 2) return 1f; diff --git a/Items/Weapons/Rogue/Malachite.cs b/Items/Weapons/Rogue/Malachite.cs index 89fef5abd9..b82323811f 100644 --- a/Items/Weapons/Rogue/Malachite.cs +++ b/Items/Weapons/Rogue/Malachite.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Weapons.Rogue return base.CanUseItem(player); } - public override float UseTimeMultiplier (Player player) + public override float SafeSetUseTimeMultiplier(Player player) { if (player.Calamity().StealthStrikeAvailable() || player.altFunctionUse == 2) return 1f; diff --git a/Items/Weapons/Rogue/NightsGaze.cs b/Items/Weapons/Rogue/NightsGaze.cs index 63b41e949f..ba3a074909 100644 --- a/Items/Weapons/Rogue/NightsGaze.cs +++ b/Items/Weapons/Rogue/NightsGaze.cs @@ -44,6 +44,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { + damage = (int)(damage * 1.22); int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI); if (p.WithinBounds(Main.maxProjectiles)) Main.projectile[p].Calamity().stealthStrike = true; diff --git a/Items/Weapons/Rogue/PhantasmalRuin.cs b/Items/Weapons/Rogue/PhantasmalRuin.cs index edb6b28409..5381430c3c 100644 --- a/Items/Weapons/Rogue/PhantasmalRuin.cs +++ b/Items/Weapons/Rogue/PhantasmalRuin.cs @@ -43,6 +43,7 @@ Stealth strikes continuously leave spectral clones in their wake"); { if (player.Calamity().StealthStrikeAvailable()) { + damage = (int)(damage * 1.22); 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/Rogue/ProfanedTrident.cs b/Items/Weapons/Rogue/ProfanedTrident.cs index 2202247069..2ff79176df 100644 --- a/Items/Weapons/Rogue/ProfanedTrident.cs +++ b/Items/Weapons/Rogue/ProfanedTrident.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 72; - item.damage = 400; + item.damage = 300; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 13; diff --git a/Items/Weapons/Rogue/RogueWeapon.cs b/Items/Weapons/Rogue/RogueWeapon.cs index e8bdb137b4..71498bbd17 100644 --- a/Items/Weapons/Rogue/RogueWeapon.cs +++ b/Items/Weapons/Rogue/RogueWeapon.cs @@ -78,10 +78,12 @@ namespace CalamityMod.Items.Weapons.Rogue // Add both the player's dedicated rogue damage and stealth strike damage as applicable. // Rogue weapons are internally throwing so they already benefit from throwing damage boosts. // 5E-06 to prevent downrounding is not needed anymore, added by TML itself - public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) + public sealed override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) { CalamityPlayer mp = player.Calamity(); + SafeModifyWeaponDamage(player, ref add, ref mult, ref flat); + // Both regular rogue damage stat and stealth damage are added to the weapon simultaneously. add += mp.throwingDamage + mp.stealthDamage - 1f; @@ -90,6 +92,8 @@ namespace CalamityMod.Items.Weapons.Rogue mult += StealthStrikePrefixBonus - 1f; } + public virtual void SafeModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) { } + // Simply add the player's dedicated rogue crit chance. // Rogue crit isn't boosted by Calamity universal crit boosts, so this won't double-add universal crit. public override void GetWeaponCrit(Player player, ref int crit) @@ -97,9 +101,10 @@ namespace CalamityMod.Items.Weapons.Rogue crit += player.Calamity().throwingCrit; } - public override float UseTimeMultiplier(Player player) + public sealed override float UseTimeMultiplier(Player player) { - float rogueAS = 1f; + float baseMultiplier = SafeSetUseTimeMultiplier(player); + float rogueAS = baseMultiplier == -1f ? 1f : baseMultiplier; if (player.Calamity().gloveOfPrecision) rogueAS -= 0.2f; if (player.Calamity().gloveOfRecklessness) @@ -109,6 +114,8 @@ namespace CalamityMod.Items.Weapons.Rogue return rogueAS; } + public virtual float SafeSetUseTimeMultiplier(Player player) => -1f; + public override void ModifyTooltips(List tooltips) { TooltipLine damageTooltip = tooltips.FirstOrDefault(x => x.Name == "Damage" && x.mod == "Terraria"); diff --git a/Items/Weapons/Rogue/Supernova.cs b/Items/Weapons/Rogue/Supernova.cs index c60b6af08b..cbc7939b8b 100644 --- a/Items/Weapons/Rogue/Supernova.cs +++ b/Items/Weapons/Rogue/Supernova.cs @@ -21,7 +21,7 @@ Stealth strikes release energy as they fly"); public override void SafeSetDefaults() { item.width = 34; - item.damage = 900; + item.damage = 675; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 24; diff --git a/Items/Weapons/Summon/CosmicImmaterializer.cs b/Items/Weapons/Summon/CosmicImmaterializer.cs index a0ded6555b..b99c68d965 100644 --- a/Items/Weapons/Summon/CosmicImmaterializer.cs +++ b/Items/Weapons/Summon/CosmicImmaterializer.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { item.mana = 100; - item.damage = 1200; + item.damage = 900; item.useStyle = ItemUseStyleID.SwingThrow; item.width = 74; item.height = 72; diff --git a/NPCs/Abyss/EidolonWyrmHeadHuge.cs b/NPCs/Abyss/EidolonWyrmHeadHuge.cs index cb46ca1c31..413da509b7 100644 --- a/NPCs/Abyss/EidolonWyrmHeadHuge.cs +++ b/NPCs/Abyss/EidolonWyrmHeadHuge.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Events; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Items.Weapons.Magic; @@ -70,27 +71,45 @@ namespace CalamityMod.NPCs.Abyss public override void AI() { - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } + CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); + + bool malice = CalamityWorld.malice; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive || malice; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive || malice; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive || malice; + + float lifeRatio = npc.life / (float)npc.lifeMax; + + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + + // Get a target + if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) + npc.TargetClosest(); + + // Despawn safety, make sure to target another player if the current player target is too far away + if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) + npc.TargetClosest(); + + Player player = Main.player[npc.target]; + if (npc.justHit || detectsPlayer || Main.player[npc.target].chaosState) { if (!detectsPlayer) { if (Main.netMode != NetmodeID.Server) - { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/Scare"), (int)Main.player[npc.target].position.X, (int)Main.player[npc.target].position.Y); - } + detectsPlayer = true; } npc.damage = 1500; } else - { npc.damage = 0; - } + npc.chaseable = detectsPlayer; + if (detectsPlayer) { if (npc.soundDelay <= 0 && Main.netMode != NetmodeID.Server) @@ -102,14 +121,12 @@ namespace CalamityMod.NPCs.Abyss else { if (Main.rand.NextBool(900) && Main.netMode != NetmodeID.Server) - { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/EidolonWyrmRoarClose").WithVolume(2.5f), (int)npc.position.X, (int)npc.position.Y); - } } + if (npc.ai[2] > 0f) - { npc.realLife = (int)npc.ai[2]; - } + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!TailSpawned && npc.ai[0] == 0f) @@ -148,8 +165,6 @@ namespace CalamityMod.NPCs.Abyss if (npc.localAI[0] >= 300f) { npc.localAI[0] = 0f; - npc.TargetClosest(true); - npc.netUpdate = true; int damage = Main.expertMode ? 300 : 400; float xPos = Main.rand.NextBool(2) ? npc.position.X + 200f : npc.position.X - 200f; Vector2 vector2 = new Vector2(xPos, npc.position.Y + Main.rand.Next(-200, 201)); @@ -214,13 +229,9 @@ namespace CalamityMod.NPCs.Abyss } if (npc.velocity.X < 0f) - { npc.spriteDirection = -1; - } else if (npc.velocity.X > 0f) - { npc.spriteDirection = 1; - } if (Main.player[npc.target].dead) { @@ -242,14 +253,10 @@ namespace CalamityMod.NPCs.Abyss npc.alpha -= 42; if (npc.alpha < 0) - { npc.alpha = 0; - } if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 6400f || !NPC.AnyNPCs(ModContent.NPCType())) - { npc.active = false; - } float num188 = speed; float num189 = turnSpeed; @@ -264,7 +271,7 @@ namespace CalamityMod.NPCs.Abyss if (!detectsPlayer) { num192 += 800; - if (Math.Abs(npc.Center.X - num191) < 400f) //500 + if (Math.Abs(npc.Center.X - num191) < 400f) { if (npc.velocity.X > 0f) { diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index da01d660ce..88790ec201 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -4100,33 +4100,8 @@ namespace CalamityMod.NPCs else if (npc.timeLeft < 1800) npc.timeLeft = 1800; - // Detect active tiles around Ceaseless Void - int radius = 30; // 30 tile radius - int diameter = radius * 2; - int npcCenterX = (int)(vector.X / 16f); - int npcCenterY = (int)(vector.Y / 16f); - Rectangle area = new Rectangle(npcCenterX - radius, npcCenterY - radius, diameter, diameter); - int nearbyActiveTiles = 0; // 0 to 3600 - for (int x = area.Left; x < area.Right; x++) - { - for (int y = area.Top; y < area.Bottom; y++) - { - if (Main.tile[x, y] != null) - { - if (Main.tile[x, y].nactive() && Main.tileSolid[Main.tile[x, y].type] && !Main.tileSolidTop[Main.tile[x, y].type] && !TileID.Sets.Platforms[Main.tile[x, y].type]) - nearbyActiveTiles++; - } - } - } - // Scale multiplier based on nearby active tiles - float tileEnrageMult = 1f; - if (nearbyActiveTiles < 1000) - tileEnrageMult += (1000 - nearbyActiveTiles) * 0.0005f; // Ranges from 1f to 1.5f - - // Maximize enrage during Malice Mode - if (malice && !BossRushEvent.BossRushActive) - tileEnrageMult = 1.5f; + float tileEnrageMult = (malice && !BossRushEvent.BossRushActive) ? 1.25f : 1f; // Set AI variable to be used by Dark Energies npc.ai[1] = tileEnrageMult; @@ -4134,14 +4109,11 @@ namespace CalamityMod.NPCs // Increase projectile fire rate based on number of nearby active tiles float projectileFireRateMultiplier = MathHelper.Lerp(0.5f, 1.5f, 1f - ((tileEnrageMult - 1f) / 0.5f)); - // Decrease projectile time left based on number of nearby active tiles - int baseProjectileTimeLeft = (int)(300f * tileEnrageMult); - // Succ attack if (!anyDarkEnergies) { // This is here because it's used in multiple places - float suckDistance = (malice ? 1920f : death ? 1600f : revenge ? 1440f : expertMode ? 1280f : 1040f) * tileEnrageMult; + float suckDistance = malice ? 1920f : death ? 1600f : revenge ? 1440f : expertMode ? 1280f : 1040f; // Move closer to the target before trying to succ if (movingDuringSuccPhase) @@ -4195,9 +4167,8 @@ namespace CalamityMod.NPCs if (Main.rand.NextBool(var)) { dustOffset = dustOffset.RotatedBy(angleIncrement); - int dust = Dust.NewDust(vector, 1, 1, (int)CalamityDusts.PurpleCosmolite); + int dust = Dust.NewDust(vector, 1, 1, ModContent.DustType()); Main.dust[dust].position = vector + dustOffset; - Main.dust[dust].noGravity = true; Main.dust[dust].fadeIn = 1f; Main.dust[dust].velocity = Vector2.Normalize(vector - Main.dust[dust].position) * dustVelocity; Main.dust[dust].scale = 3f - h; @@ -4241,7 +4212,11 @@ namespace CalamityMod.NPCs npc.HealEffect(-damageAmt, true); if (npc.life <= 0) - npc.StrikeNPCNoInteraction(9999, 0f, 0); + { + npc.life = 0; + npc.HitEffect(); + npc.checkDead(); + } npc.netUpdate = true; } @@ -4257,8 +4232,7 @@ namespace CalamityMod.NPCs for (int i = 0; i < numBeamPortals; i++) { float ai1 = i * degrees; - int proj = Projectile.NewProjectile(player.Center.X + (float)(Math.Sin(i * degrees) * beamPortalDistance), player.Center.Y + (float)(Math.Cos(i * degrees) * beamPortalDistance), 0f, 0f, type, damage, 0f, player.whoAmI, ai1, 0f); - Main.projectile[proj].timeLeft = baseProjectileTimeLeft / 2; + Projectile.NewProjectile(player.Center.X + (float)(Math.Sin(i * degrees) * beamPortalDistance), player.Center.Y + (float)(Math.Cos(i * degrees) * beamPortalDistance), 0f, 0f, type, damage, 0f, player.whoAmI, ai1, 0f); } } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 8635c1192c..b1d72a4266 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -3521,7 +3521,7 @@ namespace CalamityMod.NPCs npc.velocity *= 0.85f; else if (slowed > 0 || tesla > 0 || vaporfied > 0) npc.velocity *= 0.9f; - else if (kamiFlu > 0) + else if (kamiFlu > 420) npc.velocity = Vector2.Clamp(npc.velocity, new Vector2(-KamiDebuff.MaxNPCSpeed), new Vector2(KamiDebuff.MaxNPCSpeed)); } } @@ -3692,7 +3692,12 @@ namespace CalamityMod.NPCs damage = (int)(damage * 0.75); } } - else if (DevourerOfGodsIDs.Contains(npc.type)) + else if (npc.type == NPCType()) + { + GrenadeResist(projectile, ref damage); + PierceResistGlobal(projectile, ref damage); + } + else if (DevourerOfGodsIDs.Contains(npc.type)) { // No grenade or global pierce resist here, body DR covers this appropriately @@ -3708,11 +3713,20 @@ namespace CalamityMod.NPCs else if (projectile.type == ProjectileType()) damage = (int)(damage * 0.85); } - else if (CosmicGuardianIDs.Contains(npc.type) || npc.type == NPCType()) + else if (CosmicGuardianIDs.Contains(npc.type)) { GrenadeResist(projectile, ref damage); PierceResistGlobal(projectile, ref damage); } + else if (npc.type == NPCType()) + { + // 50% resist to Nuclear Fury + if (projectile.type == ProjectileType()) + damage = (int)(damage * 0.5); + + GrenadeResist(projectile, ref damage); + PierceResistGlobal(projectile, ref damage); + } else if (StormWeaverIDs.Contains(npc.type)) { GrenadeResist(projectile, ref damage); @@ -3877,13 +3891,15 @@ namespace CalamityMod.NPCs if (projectile.IsSummon() || projectile.aiStyle == 99) return; - if (projectile.penetrate == -1) - damage = (int)(damage * 0.5); - else if (projectile.penetrate > 1) - { - float newBaseDamage = damage * (float)Math.Pow(0.9, projectile.penetrate) / projectile.Calamity().ResistDamagePenaltyHarshness; - damage = (int)MathHelper.Clamp(newBaseDamage, damage * projectile.Calamity().ResistDamagePenaltyMinCapFactor, damage); - } + if (projectile.penetrate == -1) + { + damage = (int)(damage * 0.5); + } + else if (projectile.penetrate > 1) + { + float newBaseDamage = damage * (float)Math.Pow(0.9, projectile.penetrate) / projectile.Calamity().ResistDamagePenaltyHarshness; + damage = (int)MathHelper.Clamp(newBaseDamage, damage * projectile.Calamity().ResistDamagePenaltyMinCapFactor, damage); + } } #endregion diff --git a/NPCs/CeaselessVoid/DarkEnergy.cs b/NPCs/CeaselessVoid/DarkEnergy.cs index 4c937cdac4..94ccb55925 100644 --- a/NPCs/CeaselessVoid/DarkEnergy.cs +++ b/NPCs/CeaselessVoid/DarkEnergy.cs @@ -128,7 +128,7 @@ namespace CalamityMod.NPCs.CeaselessVoid // Distance from Ceaseless Void double maxDistance = malice ? 1200D : death ? 1040D : revenge ? 960D : expertMode ? 880D : minMaxDistance; double rateOfChangeIncrease = (maxDistance / minMaxDistance) - 1D; - double rateOfChange = (npc.ai[1] * 0.5f) + 1D + tileEnrageMult + rateOfChangeIncrease; + double rateOfChange = (npc.ai[1] * 0.5f) + 2D + (tileEnrageMult - 1f) + rateOfChangeIncrease; if (npc.Calamity().newAI[0] == 0f) { distance += rateOfChange; @@ -150,7 +150,7 @@ namespace CalamityMod.NPCs.CeaselessVoid // Rotation velocity float minRotationVelocity = 0.5f + tileEnrageMult - 1f; - float rotationVelocityIncrease = malice ? 0.4f : death ? 0.2f : revenge ? 0.15f : expertMode ? 0.1f : 0f; + float rotationVelocityIncrease = death ? 0.2f : revenge ? 0.15f : expertMode ? 0.1f : 0f; rotationVelocityIncrease += rotationVelocityIncrease * (npc.ai[1] * 0.5f); // Rotate around Ceaseless Void diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.png b/NPCs/ExoMechs/Thanatos/ThanatosBody1.png new file mode 100644 index 0000000000..23312b4833 Binary files /dev/null and b/NPCs/ExoMechs/Thanatos/ThanatosBody1.png differ diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.png b/NPCs/ExoMechs/Thanatos/ThanatosBody2.png new file mode 100644 index 0000000000..30f22df80b Binary files /dev/null and b/NPCs/ExoMechs/Thanatos/ThanatosBody2.png differ diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.png b/NPCs/ExoMechs/Thanatos/ThanatosHead.png new file mode 100644 index 0000000000..814198e065 Binary files /dev/null and b/NPCs/ExoMechs/Thanatos/ThanatosHead.png differ diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.png b/NPCs/ExoMechs/Thanatos/ThanatosTail.png new file mode 100644 index 0000000000..77ef4ee8de Binary files /dev/null and b/NPCs/ExoMechs/Thanatos/ThanatosTail.png differ diff --git a/NPCs/StormWeaver/StormWeaverBodyNaked.cs b/NPCs/StormWeaver/StormWeaverBodyNaked.cs index c632a419a7..f2328851e1 100644 --- a/NPCs/StormWeaver/StormWeaverBodyNaked.cs +++ b/NPCs/StormWeaver/StormWeaverBodyNaked.cs @@ -80,8 +80,6 @@ namespace CalamityMod.NPCs.StormWeaver public override void AI() { - bool expertMode = Main.expertMode; - if (invinceTime > 0) { invinceTime--; @@ -97,9 +95,7 @@ namespace CalamityMod.NPCs.StormWeaver Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); if (npc.ai[2] > 0f) - { npc.realLife = (int)npc.ai[2]; - } bool flag = false; if (npc.ai[1] <= 0f) @@ -128,11 +124,10 @@ namespace CalamityMod.NPCs.StormWeaver Main.dust[num935].noLight = true; } } + npc.alpha -= 42; if (npc.alpha < 0) - { npc.alpha = 0; - } } Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); @@ -144,6 +139,7 @@ namespace CalamityMod.NPCs.StormWeaver vector18.Y = (int)(vector18.Y / 16f) * 16; num191 -= vector18.X; num192 -= vector18.Y; + float num193 = (float)System.Math.Sqrt(num191 * num191 + num192 * num192); if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length) { @@ -155,7 +151,8 @@ namespace CalamityMod.NPCs.StormWeaver } catch { } - npc.rotation = (float)System.Math.Atan2(num192, num191) + 1.57f; + + npc.rotation = (float)System.Math.Atan2(num192, num191) + MathHelper.PiOver2; num193 = (float)System.Math.Sqrt(num191 * num191 + num192 * num192); int num194 = npc.width; num193 = (num193 - num194) / num193; @@ -164,14 +161,11 @@ namespace CalamityMod.NPCs.StormWeaver npc.velocity = Vector2.Zero; npc.position.X = npc.position.X + num191; npc.position.Y = npc.position.Y + num192; + if (num191 < 0f) - { npc.spriteDirection = -1; - } else if (num191 > 0f) - { npc.spriteDirection = 1; - } } } @@ -243,17 +237,22 @@ namespace CalamityMod.NPCs.StormWeaver public override void HitEffect(int hitDirection, double damage) { - if (npc.life <= 0) + for (int k = 0; k < 3; k++) + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, hitDirection, -1f, 0, default, 1f); + + if (npc.life <= 0) { Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SWNudeBody1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SWNudeBody2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SWNudeBody3"), 1f); + npc.position.X = npc.position.X + (npc.width / 2); npc.position.Y = npc.position.Y + (npc.height / 2); npc.width = 30; npc.height = 30; npc.position.X = npc.position.X - (npc.width / 2); npc.position.Y = npc.position.Y - (npc.height / 2); + for (int num621 = 0; num621 < 20; num621++) { int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); @@ -264,6 +263,7 @@ namespace CalamityMod.NPCs.StormWeaver Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } + for (int num623 = 0; num623 < 40; num623++) { int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 3f); diff --git a/NPCs/StormWeaver/StormWeaverHeadNaked.cs b/NPCs/StormWeaver/StormWeaverHeadNaked.cs index 46fb3c8d6e..6f3016351c 100644 --- a/NPCs/StormWeaver/StormWeaverHeadNaked.cs +++ b/NPCs/StormWeaver/StormWeaverHeadNaked.cs @@ -16,18 +16,24 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.NPCs.StormWeaver { [AutoloadBossHead] public class StormWeaverHeadNaked : ModNPC { - private const float BoltAngleSpread = 280; + private const float BoltAngleSpread = 280; private const float speed = 13f; private const float turnSpeed = 0.35f; private bool tail = false; private int invinceTime = 180; - public override void SetStaticDefaults() + // Lightning flash variables + public float lightning = 0f; + private float lightningDecay = 1f; + private float lightningSpeed = 0f; + + public override void SetStaticDefaults() { DisplayName.SetDefault("Storm Weaver"); NPCID.Sets.TrailingMode[npc.type] = 1; @@ -118,35 +124,30 @@ namespace CalamityMod.NPCs.StormWeaver npc.dontTakeDamage = false; } - if (!Main.raining && !BossRushEvent.BossRushActive && CalamityWorld.DoGSecondStageCountdown <= 0) - { + if (!Main.raining) CalamityUtils.StartRain(); - } - double lifeRatio = npc.life / (double)npc.lifeMax; + float lifeRatio = npc.life / (float)npc.lifeMax; // Increase aggression if player is taking a long time to kill the boss if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; - int lifePercentage = (int)(100.0 * lifeRatio); + // Start charging at the target + bool phase2 = lifeRatio < 0.7f; - int BoltProjectiles = 2; - if (lifePercentage < 33 || death) - { - BoltProjectiles = 4; - } - else if (lifePercentage < 66) - { - BoltProjectiles = 3; - } + // Lightning strike flash phase + bool phase3 = lifeRatio < 0.4f; + + // Become weak and cancel the storm + bool phase4 = npc.life / (float)npc.lifeMax < 0.05f; + + int boltProjectiles = (phase3 || death) ? 4 : phase2 ? 3 : 2; Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); if (npc.ai[2] > 0f) - { npc.realLife = (int)npc.ai[2]; - } // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -168,9 +169,7 @@ namespace CalamityMod.NPCs.StormWeaver npc.alpha -= 12; if (npc.alpha < 0) - { npc.alpha = 0; - } if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -199,7 +198,7 @@ namespace CalamityMod.NPCs.StormWeaver tail = true; } - if (expertMode) + if (expertMode && !phase4) { npc.localAI[0] += malice ? 1.5f : 1f; if (npc.localAI[0] >= 450f) @@ -225,11 +224,11 @@ namespace CalamityMod.NPCs.StormWeaver npc.localAI[1] = 0f; calamityGlobalNPC.newAI[0] = 0f; npc.TargetClosest(false); + npc.velocity.Y = npc.velocity.Y - 10f; if ((double)npc.position.Y < Main.topWorld + 16f) - { npc.velocity.Y = npc.velocity.Y - 10f; - } + if ((double)npc.position.Y < Main.topWorld + 16f) { CalamityWorld.DoGSecondStageCountdown = 0; @@ -240,7 +239,7 @@ namespace CalamityMod.NPCs.StormWeaver netMessage.Write(CalamityWorld.DoGSecondStageCountdown); netMessage.Send(); } - for (int num957 = 0; num957 < 200; num957++) + for (int num957 = 0; num957 < Main.maxNPCs; num957++) { if (Main.npc[num957].active && (Main.npc[num957].type == ModContent.NPCType() || Main.npc[num957].type == ModContent.NPCType() @@ -262,7 +261,7 @@ namespace CalamityMod.NPCs.StormWeaver netMessage.Write(CalamityWorld.DoGSecondStageCountdown); netMessage.Send(); } - for (int num957 = 0; num957 < 200; num957++) + for (int num957 = 0; num957 < Main.maxNPCs; num957++) { if (Main.npc[num957].type == ModContent.NPCType() || Main.npc[num957].type == ModContent.NPCType() @@ -274,13 +273,9 @@ namespace CalamityMod.NPCs.StormWeaver } if (npc.velocity.X < 0f) - { npc.spriteDirection = -1; - } else if (npc.velocity.X > 0f) - { npc.spriteDirection = 1; - } 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); @@ -288,63 +283,67 @@ namespace CalamityMod.NPCs.StormWeaver float num188 = malice ? 15f : revenge ? 13f : 12f; float num189 = malice ? 0.36f : revenge ? 0.31f : 0.28f; - calamityGlobalNPC.newAI[0] += 1f; - if (calamityGlobalNPC.newAI[0] >= 400f) + // Start charging at the player when in phase 2 + if (phase2 && !phase4) { - if (npc.localAI[1] == 0f) - npc.localAI[1] = 1f; - - if (calamityGlobalNPC.newAI[0] >= 500f) + calamityGlobalNPC.newAI[0] += 1f; + if (calamityGlobalNPC.newAI[0] >= 400f) { - npc.TargetClosest(); - npc.localAI[1] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - } + if (npc.localAI[1] == 0f) + npc.localAI[1] = 1f; - if (revenge) - { - if (npc.localAI[1] == 2f) + if (calamityGlobalNPC.newAI[0] >= 500f) { - num188 += Vector2.Distance(Main.player[npc.target].Center, npc.Center) * 0.01f * (1f - (float)lifeRatio); - num189 += Vector2.Distance(Main.player[npc.target].Center, npc.Center) * 0.0001f * (1f - (float)lifeRatio); - num188 *= 2f; - num189 *= 0.85f; - - float stopChargeDistance = 800f * npc.localAI[2]; - if (stopChargeDistance < 0) - { - if (npc.Center.X < Main.player[npc.target].Center.X + stopChargeDistance) - { - npc.localAI[1] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - } - } - else - { - if (npc.Center.X > Main.player[npc.target].Center.X + stopChargeDistance) - { - npc.localAI[1] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - } - } + npc.TargetClosest(); + npc.localAI[1] = 0f; + calamityGlobalNPC.newAI[0] = 0f; } - int dustAmt = 5; - for (int num1474 = 0; num1474 < dustAmt; num1474++) + if (revenge) { - Vector2 vector171 = Vector2.Normalize(npc.velocity) * new Vector2((npc.width + 50) / 2f, npc.height) * 0.75f; - vector171 = vector171.RotatedBy((num1474 - (dustAmt / 2 - 1)) * (double)MathHelper.Pi / (float)dustAmt) + npc.Center; - Vector2 value18 = ((float)(Main.rand.NextDouble() * MathHelper.Pi) - MathHelper.PiOver2).ToRotationVector2() * Main.rand.Next(3, 8); - int num1475 = Dust.NewDust(vector171 + value18, 0, 0, 206, value18.X, value18.Y, 100, default, 3f); - Main.dust[num1475].noGravity = true; - Main.dust[num1475].noLight = true; - Main.dust[num1475].velocity /= 4f; - Main.dust[num1475].velocity -= npc.velocity; + if (npc.localAI[1] == 2f) + { + num188 += Vector2.Distance(Main.player[npc.target].Center, npc.Center) * 0.01f * (0.7f - lifeRatio); + num189 += Vector2.Distance(Main.player[npc.target].Center, npc.Center) * 0.0001f * (0.7f - lifeRatio); + num188 *= 2f; + num189 *= 0.85f; + + float stopChargeDistance = 800f * npc.localAI[2]; + if (stopChargeDistance < 0) + { + if (npc.Center.X < Main.player[npc.target].Center.X + stopChargeDistance) + { + npc.localAI[1] = 0f; + calamityGlobalNPC.newAI[0] = 0f; + } + } + else + { + if (npc.Center.X > Main.player[npc.target].Center.X + stopChargeDistance) + { + npc.localAI[1] = 0f; + calamityGlobalNPC.newAI[0] = 0f; + } + } + } + + int dustAmt = 5; + for (int num1474 = 0; num1474 < dustAmt; num1474++) + { + Vector2 vector171 = Vector2.Normalize(npc.velocity) * new Vector2((npc.width + 50) / 2f, npc.height) * 0.75f; + vector171 = vector171.RotatedBy((num1474 - (dustAmt / 2 - 1)) * (double)MathHelper.Pi / (float)dustAmt) + npc.Center; + Vector2 value18 = ((float)(Main.rand.NextDouble() * MathHelper.Pi) - MathHelper.PiOver2).ToRotationVector2() * Main.rand.Next(3, 8); + int num1475 = Dust.NewDust(vector171 + value18, 0, 0, 206, value18.X, value18.Y, 100, default, 3f); + Main.dust[num1475].noGravity = true; + Main.dust[num1475].noLight = true; + Main.dust[num1475].velocity /= 4f; + Main.dust[num1475].velocity -= npc.velocity; + } } } + else if (revenge) + calamityGlobalNPC.newAI[0] += malice ? 4f : death ? 2f : 2f * (0.7f - lifeRatio); } - else if (revenge) - calamityGlobalNPC.newAI[0] += malice ? 4f : death ? 2f : 2f * (float)(1D - lifeRatio); float num48 = num188 * 1.3f; float num49 = num188 * 0.7f; @@ -363,48 +362,72 @@ namespace CalamityMod.NPCs.StormWeaver } } - if (npc.localAI[1] == 1f) + if (phase2 && !phase4) { - npc.localAI[1] = 2f; - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/LightningStrike"), (int)Main.player[npc.target].Center.X, (int)Main.player[npc.target].Center.Y); - - if (Main.netMode != NetmodeID.MultiplayerClient) + if (npc.localAI[1] == 1f) { - int speed2 = revenge ? 8 : 7; - if (npc.Calamity().enraged > 0) + // Play lightning sound on the target if not in phase 3 + Vector2 soundCenter = Main.player[npc.target].Center; + + // Play lightning sound on all nearby players if in phase 3 + if (phase3 && Main.netMode != NetmodeID.Server) { - speed2 += 1; + if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, npc.Center) < 2800f) + { + soundCenter = Main.player[Main.myPlayer].Center; + + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/LightningStrike"), (int)soundCenter.X, (int)soundCenter.Y); + + // Set how quickly the lightning flash dissipates + lightningDecay = Main.rand.NextFloat() * 0.05f + 0.008f; + + // Set how quickly the lightning flash intensifies + lightningSpeed = Main.rand.NextFloat() * 0.05f + 0.05f; + } } - float spawnX2 = npc.Center.X > Main.player[npc.target].Center.X ? 1000f : -1000f; - float spawnY2 = -1000f + Main.player[npc.target].Center.Y; - Vector2 baseSpawn = new Vector2(spawnX2 + Main.player[npc.target].Center.X, spawnY2); - Vector2 baseVelocity = Main.player[npc.target].Center - baseSpawn; - baseVelocity.Normalize(); - baseVelocity *= speed2; - for (int i = 0; i < BoltProjectiles; i++) + else + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/LightningStrike"), (int)soundCenter.X, (int)soundCenter.Y); + + npc.localAI[1] = 2f; + + if (Main.netMode != NetmodeID.MultiplayerClient) { - Vector2 source = baseSpawn; - source.X += i * 30 - (BoltProjectiles * 15); - Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-BoltAngleSpread / 2 + (BoltAngleSpread * i / BoltProjectiles))); - velocity.X = velocity.X + 3 * Main.rand.NextFloat() - 1.5f; - Vector2 vector94 = Main.player[npc.target].Center - source; - float ai = Main.rand.Next(100); - int type = ProjectileID.CultistBossLightningOrbArc; - int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(source, velocity, type, damage, 0f, Main.myPlayer, vector94.ToRotation(), ai); + int speed2 = revenge ? 8 : 7; + if (npc.Calamity().enraged > 0) + speed2 += 1; + + float spawnX2 = npc.Center.X > Main.player[npc.target].Center.X ? 1000f : -1000f; + float spawnY2 = -1000f + Main.player[npc.target].Center.Y; + Vector2 baseSpawn = new Vector2(spawnX2 + Main.player[npc.target].Center.X, spawnY2); + Vector2 baseVelocity = Main.player[npc.target].Center - baseSpawn; + baseVelocity.Normalize(); + baseVelocity *= speed2; + + for (int i = 0; i < boltProjectiles; i++) + { + Vector2 source = baseSpawn; + source.X += i * 30f - (boltProjectiles * 15f); + Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-BoltAngleSpread / 2 + (BoltAngleSpread * i / boltProjectiles))); + velocity.X = velocity.X + 3f * Main.rand.NextFloat() - 1.5f; + Vector2 vector94 = Main.player[npc.target].Center - source; + float ai = Main.rand.Next(100); + int type = ProjectileID.CultistBossLightningOrbArc; + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(source, velocity, type, damage, 0f, Main.myPlayer, vector94.ToRotation(), ai); + } } + + if (revenge) + npc.velocity = Vector2.Normalize(Main.player[npc.target].Center - npc.Center) * (num188 + Vector2.Distance(Main.player[npc.target].Center, npc.Center) * 0.01f * (0.7f - lifeRatio)) * 2f; + + float chargeDirection = 0; + if (npc.velocity.X < 0f) + chargeDirection = -1f; + else if (npc.velocity.X > 0f) + chargeDirection = 1f; + + npc.localAI[2] = chargeDirection; } - - if (revenge) - npc.velocity = Vector2.Normalize(Main.player[npc.target].Center - npc.Center) * (num188 + Vector2.Distance(Main.player[npc.target].Center, npc.Center) * 0.01f * (1f - (float)lifeRatio)) * 2f; - - float chargeDirection = 0; - if (npc.velocity.X < 0f) - chargeDirection = -1f; - else if (npc.velocity.X > 0f) - chargeDirection = 1f; - - npc.localAI[2] = chargeDirection; } num191 = (int)(num191 / 16f) * 16; @@ -419,6 +442,7 @@ namespace CalamityMod.NPCs.StormWeaver float num198 = num188 / num193; num191 *= num198; num192 *= num198; + if ((npc.velocity.X > 0f && num191 > 0f) || (npc.velocity.X < 0f && num191 < 0f) || (npc.velocity.Y > 0f && num192 > 0f) || (npc.velocity.Y < 0f && num192 < 0f)) { if (npc.velocity.X < num191) @@ -428,10 +452,9 @@ namespace CalamityMod.NPCs.StormWeaver else { if (npc.velocity.X > num191) - { npc.velocity.X = npc.velocity.X - num189; - } } + if (npc.velocity.Y < num192) { npc.velocity.Y = npc.velocity.Y + num189; @@ -439,31 +462,23 @@ namespace CalamityMod.NPCs.StormWeaver else { if (npc.velocity.Y > num192) - { npc.velocity.Y = npc.velocity.Y - num189; - } } + if (Math.Abs(num192) < num188 * 0.2 && ((npc.velocity.X > 0f && num191 < 0f) || (npc.velocity.X < 0f && num191 > 0f))) { if (npc.velocity.Y > 0f) - { npc.velocity.Y = npc.velocity.Y + num189 * 2f; - } else - { npc.velocity.Y = npc.velocity.Y - num189 * 2f; - } } + if (Math.Abs(num191) < num188 * 0.2 && ((npc.velocity.Y > 0f && num192 < 0f) || (npc.velocity.Y < 0f && num192 > 0f))) { if (npc.velocity.X > 0f) - { - npc.velocity.X = npc.velocity.X + num189 * 2f; //changed from 2 - } + npc.velocity.X = npc.velocity.X + num189 * 2f; else - { - npc.velocity.X = npc.velocity.X - num189 * 2f; //changed from 2 - } + npc.velocity.X = npc.velocity.X - num189 * 2f; } } else @@ -471,50 +486,69 @@ namespace CalamityMod.NPCs.StormWeaver if (num196 > num197) { if (npc.velocity.X < num191) - { - npc.velocity.X = npc.velocity.X + num189 * 1.1f; //changed from 1.1 - } + npc.velocity.X = npc.velocity.X + num189 * 1.1f; else if (npc.velocity.X > num191) - { - npc.velocity.X = npc.velocity.X - num189 * 1.1f; //changed from 1.1 - } + npc.velocity.X = npc.velocity.X - num189 * 1.1f; + if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < num188 * 0.5) { if (npc.velocity.Y > 0f) - { npc.velocity.Y = npc.velocity.Y + num189; - } else - { npc.velocity.Y = npc.velocity.Y - num189; - } } } else { if (npc.velocity.Y < num192) - { npc.velocity.Y = npc.velocity.Y + num189 * 1.1f; - } else if (npc.velocity.Y > num192) - { npc.velocity.Y = npc.velocity.Y - num189 * 1.1f; - } + if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < num188 * 0.5) { if (npc.velocity.X > 0f) - { npc.velocity.X = npc.velocity.X + num189; - } else - { npc.velocity.X = npc.velocity.X - num189; - } } } } - npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) + 1.57f; - } + + npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) + MathHelper.PiOver2; + + if (phase4) + { + // Become weak and stop the storm when in phase 4 + npc.localAI[1] = 0f; + calamityGlobalNPC.newAI[0] = 0f; + CalamityMod.StopRain(); + } + else if (phase3) + { + // Adjust lightning flash variables when in phase 3 + if (Main.netMode != NetmodeID.Server) + { + if (lightningSpeed > 0f) + { + lightning += lightningSpeed; + if (lightning >= 1f) + { + lightning = 1f; + lightningSpeed = 0f; + } + } + else if (lightning > 0f) + lightning -= lightningDecay; + } + + // Start a storm when in third phase + if (Main.netMode == NetmodeID.MultiplayerClient || (Main.netMode == NetmodeID.SinglePlayer && Main.gameMenu)) + return; + + CalamityUtils.StartRain(true, true); + } + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { @@ -580,19 +614,20 @@ namespace CalamityMod.NPCs.StormWeaver public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) - { Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, hitDirection, -1f, 0, default, 1f); - } + if (npc.life <= 0) { Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SWNudeHead1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SWNudeHead2"), 1f); + npc.position.X = npc.position.X + (npc.width / 2); npc.position.Y = npc.position.Y + (npc.height / 2); npc.width = 30; npc.height = 30; npc.position.X = npc.position.X - (npc.width / 2); npc.position.Y = npc.position.Y - (npc.height / 2); + for (int num621 = 0; num621 < 20; num621++) { int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); @@ -603,6 +638,7 @@ namespace CalamityMod.NPCs.StormWeaver Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } + for (int num623 = 0; num623 < 40; num623++) { int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 3f); @@ -616,13 +652,12 @@ namespace CalamityMod.NPCs.StormWeaver public override bool CheckDead() { - for (int num569 = 0; num569 < 200; num569++) + for (int num569 = 0; num569 < Main.maxNPCs; num569++) { if (Main.npc[num569].active && (Main.npc[num569].type == ModContent.NPCType() || Main.npc[num569].type == ModContent.NPCType())) - { Main.npc[num569].life = 0; - } } + return true; } diff --git a/NPCs/StormWeaver/StormWeaverTailNaked.cs b/NPCs/StormWeaver/StormWeaverTailNaked.cs index bd74e88cd1..6f674df02b 100644 --- a/NPCs/StormWeaver/StormWeaverTailNaked.cs +++ b/NPCs/StormWeaver/StormWeaverTailNaked.cs @@ -95,9 +95,7 @@ namespace CalamityMod.NPCs.StormWeaver Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); if (npc.ai[2] > 0f) - { npc.realLife = (int)npc.ai[2]; - } bool flag = false; if (npc.ai[1] <= 0f) @@ -126,11 +124,10 @@ namespace CalamityMod.NPCs.StormWeaver Main.dust[num935].noLight = true; } } + npc.alpha -= 42; if (npc.alpha < 0) - { npc.alpha = 0; - } } Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); @@ -142,6 +139,7 @@ namespace CalamityMod.NPCs.StormWeaver vector18.Y = (int)(vector18.Y / 16f) * 16; num191 -= vector18.X; num192 -= vector18.Y; + float num193 = (float)System.Math.Sqrt(num191 * num191 + num192 * num192); if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length) { @@ -153,7 +151,8 @@ namespace CalamityMod.NPCs.StormWeaver } catch { } - npc.rotation = (float)System.Math.Atan2(num192, num191) + 1.57f; + + npc.rotation = (float)System.Math.Atan2(num192, num191) + MathHelper.PiOver2; num193 = (float)System.Math.Sqrt(num191 * num191 + num192 * num192); int num194 = npc.width; num193 = (num193 - num194) / num193; @@ -162,14 +161,11 @@ namespace CalamityMod.NPCs.StormWeaver npc.velocity = Vector2.Zero; npc.position.X = npc.position.X + num191; npc.position.Y = npc.position.Y + num192; + if (num191 < 0f) - { npc.spriteDirection = -1; - } else if (num191 > 0f) - { npc.spriteDirection = 1; - } } } @@ -231,20 +227,21 @@ namespace CalamityMod.NPCs.StormWeaver public override void HitEffect(int hitDirection, double damage) { - for (int k = 0; k < 5; k++) - { + for (int k = 0; k < 3; k++) Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, hitDirection, -1f, 0, default, 1f); - } + if (npc.life <= 0) { Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SWNudeTail1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SWNudeTail2"), 1f); + npc.position.X = npc.position.X + (npc.width / 2); npc.position.Y = npc.position.Y + (npc.height / 2); npc.width = 30; npc.height = 30; npc.position.X = npc.position.X - (npc.width / 2); npc.position.Y = npc.position.Y - (npc.height / 2); + for (int num621 = 0; num621 < 20; num621++) { int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); @@ -255,6 +252,7 @@ namespace CalamityMod.NPCs.StormWeaver Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } + for (int num623 = 0; num623 < 40; num623++) { int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 3f); diff --git a/NPCs/SupremeCalamitas/SCalWormHeart.cs b/NPCs/SupremeCalamitas/SCalWormHeart.cs index fe9e7879ac..b3c5cd68d5 100644 --- a/NPCs/SupremeCalamitas/SCalWormHeart.cs +++ b/NPCs/SupremeCalamitas/SCalWormHeart.cs @@ -18,7 +18,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.width = 24; npc.height = 24; npc.defense = 0; - npc.LifeMaxNERB(48000, 55200); + npc.LifeMaxNERB(25600, 29440); npc.aiStyle = -1; aiType = -1; npc.knockBackResist = 0f; @@ -38,19 +38,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.netUpdate = true; return; } + npc.alpha -= 42; if (npc.alpha < 0) - { npc.alpha = 0; - } - } - - public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (projectile.type == ModContent.ProjectileType()) - { - damage = (int)(damage * 0.66); - } } public override bool CheckActive() diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index 7f5e822134..540c255fbf 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.damage = 0; npc.defense = 60; npc.DR_NERD(0.25f); - npc.LifeMaxNERB(Main.expertMode ? 45000 : 28125, 51750); + npc.LifeMaxNERB(Main.expertMode ? 24000 : 15000, 28000); npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; } diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 0ea6d95c53..af2aa073b9 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -91,7 +91,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas CalamityGlobalNPC global = npc.Calamity(); global.multDRReductions.Add(BuffID.CursedInferno, 0.9f); npc.value = Item.buyPrice(10, 0, 0, 0); - npc.LifeMaxNERB(1500000, 1725000); + npc.LifeMaxNERB(1000000, 1150000); double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; @@ -2146,14 +2146,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas CalamityUtils.DisplayLocalizedText(key, messageColor); } - public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (projectile.type == ModContent.ProjectileType()) - { - damage /= 2; - } - } - public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) { return !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index 52d8b2dde4..ca5c87efad 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.DR_NERD(0.25f, null, null, null, true); CalamityGlobalNPC global = npc.Calamity(); global.multDRReductions.Add(BuffID.CursedInferno, 0.9f); - npc.LifeMaxNERB(360000, 414000); + npc.LifeMaxNERB(240000, 276000); double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; @@ -203,14 +203,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (projectile.type == ModContent.ProjectileType()) - { - damage /= 2; - } - } - public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) { return !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index 2dc4c6ace0..a887f341e7 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.DR_NERD(0.25f, null, null, null, true); CalamityGlobalNPC global = npc.Calamity(); global.multDRReductions.Add(BuffID.CursedInferno, 0.9f); - npc.LifeMaxNERB(360000, 414000); + npc.LifeMaxNERB(240000, 276000); double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; @@ -203,14 +203,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (projectile.type == ModContent.ProjectileType()) - { - damage /= 2; - } - } - public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) { return !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index e97795ec8b..1aa0cd5d6b 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -2946,6 +2946,8 @@ namespace CalamityMod.NPCs.Yharon { if (projectile.type == ModContent.ProjectileType()) damage = (int)(damage * 0.85); + if (projectile.type == ModContent.ProjectileType()) + damage = (int)(damage * 0.9); if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) damage = (int)(damage * 0.95); } diff --git a/Projectiles/Boss/IchorBlob.png b/Projectiles/Boss/IchorBlob.png new file mode 100644 index 0000000000..d5292dbe27 Binary files /dev/null and b/Projectiles/Boss/IchorBlob.png differ diff --git a/Projectiles/Magic/ApothJaws.cs b/Projectiles/Magic/ApothJaws.cs index 7d7709240a..99eb5a36c4 100644 --- a/Projectiles/Magic/ApothJaws.cs +++ b/Projectiles/Magic/ApothJaws.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Magic target.AddBuff(ModContent.BuffType(), 600, true); target.AddBuff(ModContent.BuffType(), 600, true); target.AddBuff(ModContent.BuffType(), 600, true); - target.AddBuff(ModContent.BuffType(), 60, true); + target.AddBuff(ModContent.BuffType(), 30, true); } } } diff --git a/Projectiles/Magic/ApothMark.cs b/Projectiles/Magic/ApothMark.cs index 2129fcbc1e..f444c0fa88 100644 --- a/Projectiles/Magic/ApothMark.cs +++ b/Projectiles/Magic/ApothMark.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Magic target.AddBuff(ModContent.BuffType(), 600, true); target.AddBuff(ModContent.BuffType(), 600, true); target.AddBuff(ModContent.BuffType(), 600, true); - target.AddBuff(ModContent.BuffType(), 60, true); + target.AddBuff(ModContent.BuffType(), 30, true); } } } diff --git a/Projectiles/Magic/BeastScythe.cs b/Projectiles/Magic/BeastScythe.cs index 1fc04aa42d..7e41d059b2 100644 --- a/Projectiles/Magic/BeastScythe.cs +++ b/Projectiles/Magic/BeastScythe.cs @@ -148,7 +148,7 @@ namespace CalamityMod.Projectiles.Magic } else { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 300); } } diff --git a/Projectiles/Magic/CryoBlast.cs b/Projectiles/Magic/CryoBlast.cs index b6b686d280..e217cfe783 100644 --- a/Projectiles/Magic/CryoBlast.cs +++ b/Projectiles/Magic/CryoBlast.cs @@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 60); target.AddBuff(BuffID.Frostburn, 360); } } diff --git a/Projectiles/Magic/ElementTentacle.cs b/Projectiles/Magic/ElementTentacle.cs index bb39bbd20b..03745d0183 100644 --- a/Projectiles/Magic/ElementTentacle.cs +++ b/Projectiles/Magic/ElementTentacle.cs @@ -3,6 +3,7 @@ using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -96,7 +97,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Magic/ElementalRayBeam.cs b/Projectiles/Magic/ElementalRayBeam.cs index e63675a0ea..841862f3c8 100644 --- a/Projectiles/Magic/ElementalRayBeam.cs +++ b/Projectiles/Magic/ElementalRayBeam.cs @@ -2,6 +2,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -54,7 +55,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Magic/IceBarrageMain.cs b/Projectiles/Magic/IceBarrageMain.cs index b3d059ee00..19bf85a147 100644 --- a/Projectiles/Magic/IceBarrageMain.cs +++ b/Projectiles/Magic/IceBarrageMain.cs @@ -176,8 +176,8 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 90); - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 60); } } } diff --git a/Projectiles/Magic/IceCluster.cs b/Projectiles/Magic/IceCluster.cs index 1f79ca4adb..ca39a0af34 100644 --- a/Projectiles/Magic/IceCluster.cs +++ b/Projectiles/Magic/IceCluster.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Magic { target.immune[projectile.owner] = 5; - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 60); Vector2 vector80 = projectile.rotation.ToRotationVector2(); if (projectile.owner == Main.myPlayer) diff --git a/Projectiles/Magic/Snowball.cs b/Projectiles/Magic/Snowball.cs index 05998e9994..1a2df63425 100644 --- a/Projectiles/Magic/Snowball.cs +++ b/Projectiles/Magic/Snowball.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.Frostburn, 300); - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 60); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Magic/TridentIcicle.cs b/Projectiles/Magic/TridentIcicle.cs index 07105d3404..65db139c17 100644 --- a/Projectiles/Magic/TridentIcicle.cs +++ b/Projectiles/Magic/TridentIcicle.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.Frostburn, 480); - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 60); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Melee/BiomeOrb.cs b/Projectiles/Melee/BiomeOrb.cs index ad4d990282..1575ade4b2 100644 --- a/Projectiles/Melee/BiomeOrb.cs +++ b/Projectiles/Melee/BiomeOrb.cs @@ -176,7 +176,7 @@ namespace CalamityMod.Projectiles.Melee } else if (snow) { - target.AddBuff(ModContent.BuffType(), debuffTime / 2); + target.AddBuff(ModContent.BuffType(), debuffTime / 3); } else if (beach) { @@ -192,7 +192,7 @@ namespace CalamityMod.Projectiles.Melee } else if (glow) { - target.AddBuff(ModContent.BuffType(), debuffTime); + target.AddBuff(ModContent.BuffType(), debuffTime / 3); } else if (hell) { diff --git a/Projectiles/Melee/ClamCrusherFlail.cs b/Projectiles/Melee/ClamCrusherFlail.cs index 0e22fa0a11..102e48382b 100644 --- a/Projectiles/Melee/ClamCrusherFlail.cs +++ b/Projectiles/Melee/ClamCrusherFlail.cs @@ -176,15 +176,12 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.rarity < 2) - { + if (projectile.ai[1] >= 45f && (projectile.ai[0] != 1f || projectile.ai[0] != 2f)) target.AddBuff(ModContent.BuffType(), 120); - } - else if (projectile.ai[1] >= 45f && (projectile.ai[0] != 1f || projectile.ai[0] != 2f)) - { + else target.AddBuff(ModContent.BuffType(), 60); - } - projectile.ai[0] = 1f; + + projectile.ai[0] = 1f; projectile.netUpdate = true; Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/ClamImpact"), (int)projectile.position.X, (int)projectile.position.Y); } diff --git a/Projectiles/Melee/CosmicDischargeFlail.cs b/Projectiles/Melee/CosmicDischargeFlail.cs index 43fecf2668..91aac35c75 100644 --- a/Projectiles/Melee/CosmicDischargeFlail.cs +++ b/Projectiles/Melee/CosmicDischargeFlail.cs @@ -104,10 +104,7 @@ namespace CalamityMod.Projectiles.Melee Player player = Main.player[projectile.owner]; target.AddBuff(BuffID.Frostburn, 300); target.AddBuff(ModContent.BuffType(), 300); - if (Main.rand.NextBool(3)) - { - target.AddBuff(ModContent.BuffType(), 120); - } + target.AddBuff(ModContent.BuffType(), 120); if (projectile.localAI[1] <= 0f && projectile.owner == Main.myPlayer) { Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, 10f, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); diff --git a/Projectiles/Melee/CosmicShivBall.cs b/Projectiles/Melee/CosmicShivBall.cs index 4ccfc51f70..5c69f79a4d 100644 --- a/Projectiles/Melee/CosmicShivBall.cs +++ b/Projectiles/Melee/CosmicShivBall.cs @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.NewProjectile(toSpawn, toTarget, ModContent.ProjectileType(), projectile.damage / 2, projectile.knockBack * 0.5f, projectile.owner); } target.AddBuff(ModContent.BuffType(), 360); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 360); target.AddBuff(ModContent.BuffType(), 360); target.AddBuff(ModContent.BuffType(), 360); target.AddBuff(ModContent.BuffType(), 240); diff --git a/Projectiles/Melee/CosmicShivBlade.cs b/Projectiles/Melee/CosmicShivBlade.cs index 992a80b3d4..1be2131673 100644 --- a/Projectiles/Melee/CosmicShivBlade.cs +++ b/Projectiles/Melee/CosmicShivBlade.cs @@ -1,6 +1,7 @@ using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; @@ -73,7 +74,7 @@ namespace CalamityMod.Projectiles.Melee projectile.ai[1] = 5 + Main.rand.Next(-2, 3); target.immune[projectile.owner] = 0; //so that all blades can hit the enemy target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(BuffID.Frostburn, 180); target.AddBuff(ModContent.BuffType(), 180); target.AddBuff(ModContent.BuffType(), 180); target.AddBuff(ModContent.BuffType(), 180); diff --git a/Projectiles/Melee/DarkIceZero.cs b/Projectiles/Melee/DarkIceZero.cs index 4b458f3825..12f6d598ae 100644 --- a/Projectiles/Melee/DarkIceZero.cs +++ b/Projectiles/Melee/DarkIceZero.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.Frostburn, 480); - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 60); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Melee/DemonBlast.cs b/Projectiles/Melee/DemonBlast.cs index 752dac869f..e2288059e5 100644 --- a/Projectiles/Melee/DemonBlast.cs +++ b/Projectiles/Melee/DemonBlast.cs @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Melee { target.AddBuff(BuffID.ShadowFlame, 300); target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 300); } } } diff --git a/Projectiles/Melee/Earth2.cs b/Projectiles/Melee/Earth2.cs index 1f8900f386..5e4ec106df 100644 --- a/Projectiles/Melee/Earth2.cs +++ b/Projectiles/Melee/Earth2.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 360); } } } diff --git a/Projectiles/Melee/ElementBall.cs b/Projectiles/Melee/ElementBall.cs index 6670412612..b80d498d93 100644 --- a/Projectiles/Melee/ElementBall.cs +++ b/Projectiles/Melee/ElementBall.cs @@ -2,6 +2,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -38,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Melee/ElementBallShiv.cs b/Projectiles/Melee/ElementBallShiv.cs index cb90258df6..02413d534e 100644 --- a/Projectiles/Melee/ElementBallShiv.cs +++ b/Projectiles/Melee/ElementBallShiv.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee @@ -57,7 +58,7 @@ namespace CalamityMod.Projectiles.Melee { OnHitEffects(target.Center); target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } @@ -66,7 +67,7 @@ namespace CalamityMod.Projectiles.Melee { OnHitEffects(target.Center); target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Melee/EonBeam.cs b/Projectiles/Melee/EonBeam.cs index dcee4fa5a6..b08a44a6ac 100644 --- a/Projectiles/Melee/EonBeam.cs +++ b/Projectiles/Melee/EonBeam.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.ai[0] != 1f) //excludes (True) Ark of the Ancients { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Melee/EonBeamV2.cs b/Projectiles/Melee/EonBeamV2.cs index 6caf40d6d7..c947095945 100644 --- a/Projectiles/Melee/EonBeamV2.cs +++ b/Projectiles/Melee/EonBeamV2.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.ai[0] != 1f) //excludes True Ark of the Ancients { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Melee/EonBeamV3.cs b/Projectiles/Melee/EonBeamV3.cs index d8c0f9155f..547bab15ee 100644 --- a/Projectiles/Melee/EonBeamV3.cs +++ b/Projectiles/Melee/EonBeamV3.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Melee/EonBeamV4.cs b/Projectiles/Melee/EonBeamV4.cs index 6b4c00e9a4..80fbfb1412 100644 --- a/Projectiles/Melee/EonBeamV4.cs +++ b/Projectiles/Melee/EonBeamV4.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Melee/EutrophicScimitarProj.cs b/Projectiles/Melee/EutrophicScimitarProj.cs index 32cde836da..bef03ae0c6 100644 --- a/Projectiles/Melee/EutrophicScimitarProj.cs +++ b/Projectiles/Melee/EutrophicScimitarProj.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 60); } public override void AI() diff --git a/Projectiles/Melee/Galaxia.cs b/Projectiles/Melee/Galaxia.cs index 04d7f2715c..c07ae74a12 100644 --- a/Projectiles/Melee/Galaxia.cs +++ b/Projectiles/Melee/Galaxia.cs @@ -151,7 +151,7 @@ namespace CalamityMod.Projectiles.Melee } else if (snow) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 30); player.AddBuff(BuffID.Warmth, 600); Projectile.NewProjectile(projectile.Center, projectile.velocity, ProjectileID.IceBolt, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } @@ -204,7 +204,7 @@ namespace CalamityMod.Projectiles.Melee } else if (glow) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 30); player.AddBuff(BuffID.Spelunker, 600); int proj = Projectile.NewProjectile(projectile.Center, projectile.velocity, ProjectileID.Mushroom, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); if (proj.WithinBounds(Main.maxProjectiles)) diff --git a/Projectiles/Melee/Galaxia2.cs b/Projectiles/Melee/Galaxia2.cs index 347e187220..576111a1a9 100644 --- a/Projectiles/Melee/Galaxia2.cs +++ b/Projectiles/Melee/Galaxia2.cs @@ -152,7 +152,7 @@ namespace CalamityMod.Projectiles.Melee } else if (snow) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 30); player.AddBuff(BuffID.Warmth, 600); Projectile.NewProjectile(projectile.Center, projectile.velocity, ProjectileID.IceBolt, projectile.damage, projectile.knockBack, projectile.owner); } @@ -205,7 +205,7 @@ namespace CalamityMod.Projectiles.Melee } else if (glow) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 30); player.AddBuff(BuffID.Spelunker, 600); int proj = Projectile.NewProjectile(projectile.Center, projectile.velocity, ProjectileID.Mushroom, projectile.damage, projectile.knockBack, projectile.owner); if (proj.WithinBounds(Main.maxProjectiles)) diff --git a/Projectiles/Melee/Iceberg.cs b/Projectiles/Melee/Iceberg.cs index facf53e2fa..ba84846d62 100644 --- a/Projectiles/Melee/Iceberg.cs +++ b/Projectiles/Melee/Iceberg.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Melee { int debuffDuration = 300 - projectile.timeLeft; if (projectile.timeLeft < 270) - target.AddBuff(ModContent.BuffType(), debuffDuration); + target.AddBuff(ModContent.BuffType(), debuffDuration / 3); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Melee/OmegaBiomeOrb.cs b/Projectiles/Melee/OmegaBiomeOrb.cs index d41ae95281..eb38795df7 100644 --- a/Projectiles/Melee/OmegaBiomeOrb.cs +++ b/Projectiles/Melee/OmegaBiomeOrb.cs @@ -217,7 +217,7 @@ namespace CalamityMod.Projectiles.Melee } else if (snow) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 30); } else if (beach) { @@ -233,7 +233,7 @@ namespace CalamityMod.Projectiles.Melee } else if (glow) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 30); } else if (hell) { diff --git a/Projectiles/Melee/PrismaticBeam.cs b/Projectiles/Melee/PrismaticBeam.cs index 17ca42534e..eceb62eb13 100644 --- a/Projectiles/Melee/PrismaticBeam.cs +++ b/Projectiles/Melee/PrismaticBeam.cs @@ -297,7 +297,6 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(BuffID.CursedInferno, 120); @@ -309,7 +308,6 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitPvp(Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(BuffID.CursedInferno, 120); diff --git a/Projectiles/Melee/PrismaticWave.cs b/Projectiles/Melee/PrismaticWave.cs index c39ee1ab4a..3bb44818ff 100644 --- a/Projectiles/Melee/PrismaticWave.cs +++ b/Projectiles/Melee/PrismaticWave.cs @@ -131,7 +131,6 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(BuffID.CursedInferno, 120); @@ -144,7 +143,6 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitPvp(Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(BuffID.CursedInferno, 120); diff --git a/Projectiles/Melee/SHIV.cs b/Projectiles/Melee/SHIV.cs index b5cc8bc429..49f3ff6377 100644 --- a/Projectiles/Melee/SHIV.cs +++ b/Projectiles/Melee/SHIV.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Melee/SpatialSpear.cs b/Projectiles/Melee/SpatialSpear.cs index a07d9ddc1e..f7552ad38d 100644 --- a/Projectiles/Melee/SpatialSpear.cs +++ b/Projectiles/Melee/SpatialSpear.cs @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Melee/SpatialSpear2.cs b/Projectiles/Melee/SpatialSpear2.cs index 482296826c..2d47ae8263 100644 --- a/Projectiles/Melee/SpatialSpear2.cs +++ b/Projectiles/Melee/SpatialSpear2.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -85,7 +86,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Melee/SpatialSpear3.cs b/Projectiles/Melee/SpatialSpear3.cs index 3f0bd42707..66d03a51ff 100644 --- a/Projectiles/Melee/SpatialSpear3.cs +++ b/Projectiles/Melee/SpatialSpear3.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -83,7 +84,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Melee/SpatialSpear4.cs b/Projectiles/Melee/SpatialSpear4.cs index 58e0ebde41..184d9b717f 100644 --- a/Projectiles/Melee/SpatialSpear4.cs +++ b/Projectiles/Melee/SpatialSpear4.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -68,7 +69,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Melee/Spears/SpatialLanceProjectile.cs b/Projectiles/Melee/Spears/SpatialLanceProjectile.cs index 7d0f7317ca..bd0454caaa 100644 --- a/Projectiles/Melee/Spears/SpatialLanceProjectile.cs +++ b/Projectiles/Melee/Spears/SpatialLanceProjectile.cs @@ -3,6 +3,7 @@ using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Projectiles.BaseProjectiles; namespace CalamityMod.Projectiles.Melee.Spears @@ -52,7 +53,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Melee/SwordsplosionBlue.cs b/Projectiles/Melee/SwordsplosionBlue.cs index f78f4e2712..02c044addd 100644 --- a/Projectiles/Melee/SwordsplosionBlue.cs +++ b/Projectiles/Melee/SwordsplosionBlue.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Melee/SwordsplosionGreen.cs b/Projectiles/Melee/SwordsplosionGreen.cs index 92c6849d38..3c40836857 100644 --- a/Projectiles/Melee/SwordsplosionGreen.cs +++ b/Projectiles/Melee/SwordsplosionGreen.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Melee/SwordsplosionPurple.cs b/Projectiles/Melee/SwordsplosionPurple.cs index b55f40c58f..aa200e468a 100644 --- a/Projectiles/Melee/SwordsplosionPurple.cs +++ b/Projectiles/Melee/SwordsplosionPurple.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.3f / 255f, (255 - projectile.alpha) * 0.4f / 255f, (255 - projectile.alpha) * 1f / 255f); if (projectile.localAI[1] > 7f) { @@ -70,7 +69,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Melee/SwordsplosionRed.cs b/Projectiles/Melee/SwordsplosionRed.cs index 089781fcef..bf83555e19 100644 --- a/Projectiles/Melee/SwordsplosionRed.cs +++ b/Projectiles/Melee/SwordsplosionRed.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Melee/TemporalFloeNumberTwo.cs b/Projectiles/Melee/TemporalFloeNumberTwo.cs index a751649abd..93057dbad4 100644 --- a/Projectiles/Melee/TemporalFloeNumberTwo.cs +++ b/Projectiles/Melee/TemporalFloeNumberTwo.cs @@ -69,10 +69,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.NextBool(3)) - { - target.AddBuff(ModContent.BuffType(), 120); - } + target.AddBuff(ModContent.BuffType(), 60); target.AddBuff(BuffID.Frostburn, 240); } } diff --git a/Projectiles/Melee/TemporalFloeSwordProjectile.cs b/Projectiles/Melee/TemporalFloeSwordProjectile.cs index f3eea114c0..8ead3149d5 100644 --- a/Projectiles/Melee/TemporalFloeSwordProjectile.cs +++ b/Projectiles/Melee/TemporalFloeSwordProjectile.cs @@ -103,10 +103,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.NextBool(3)) - { - target.AddBuff(ModContent.BuffType(), 120); - } + target.AddBuff(ModContent.BuffType(), 60); target.AddBuff(BuffID.Frostburn, 240); } } diff --git a/Projectiles/Melee/TerratomereProjectile.cs b/Projectiles/Melee/TerratomereProjectile.cs index c8c2880e6d..f8588acad5 100644 --- a/Projectiles/Melee/TerratomereProjectile.cs +++ b/Projectiles/Melee/TerratomereProjectile.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(ModContent.BuffType(), 30); } public override void Kill(int timeLeft) diff --git a/Projectiles/Melee/TrueBiomeOrb.cs b/Projectiles/Melee/TrueBiomeOrb.cs index c08ffdd521..5c6135c40b 100644 --- a/Projectiles/Melee/TrueBiomeOrb.cs +++ b/Projectiles/Melee/TrueBiomeOrb.cs @@ -175,7 +175,7 @@ namespace CalamityMod.Projectiles.Melee } else if (snow) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 30); } else if (beach) { @@ -191,7 +191,7 @@ namespace CalamityMod.Projectiles.Melee } else if (glow) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 30); } else if (hell) { diff --git a/Projectiles/Ranged/ArcticArrowProj.cs b/Projectiles/Ranged/ArcticArrowProj.cs index fcafcb16ae..4b4258b268 100644 --- a/Projectiles/Ranged/ArcticArrowProj.cs +++ b/Projectiles/Ranged/ArcticArrowProj.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 60); } } } diff --git a/Projectiles/Ranged/ExoLightBomb.cs b/Projectiles/Ranged/ExoLightBomb.cs index ac6a9d4dbc..5e4ddb8036 100644 --- a/Projectiles/Ranged/ExoLightBomb.cs +++ b/Projectiles/Ranged/ExoLightBomb.cs @@ -174,7 +174,6 @@ namespace CalamityMod.Projectiles.Ranged { target.AddBuff(ModContent.BuffType(), 30); target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(ModContent.BuffType(), 90); target.AddBuff(ModContent.BuffType(), 180); target.AddBuff(ModContent.BuffType(), 180); target.AddBuff(BuffID.CursedInferno, 180); diff --git a/Projectiles/Ranged/ExoSpark.cs b/Projectiles/Ranged/ExoSpark.cs index c698b23d06..3e68966afb 100644 --- a/Projectiles/Ranged/ExoSpark.cs +++ b/Projectiles/Ranged/ExoSpark.cs @@ -71,7 +71,6 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 60); - target.AddBuff(ModContent.BuffType(), 60); target.AddBuff(ModContent.BuffType(), 60); target.AddBuff(ModContent.BuffType(), 60); target.AddBuff(BuffID.CursedInferno, 120); diff --git a/Projectiles/Ranged/FrostsparkBulletProj.cs b/Projectiles/Ranged/FrostsparkBulletProj.cs index 553da055da..e4d3ae7e9e 100644 --- a/Projectiles/Ranged/FrostsparkBulletProj.cs +++ b/Projectiles/Ranged/FrostsparkBulletProj.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Ranged { target.AddBuff(BuffID.OnFire, 240); target.AddBuff(BuffID.Frostburn, 240); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 60); } public override void Kill(int timeLeft) diff --git a/Projectiles/Ranged/IcyBulletProj.cs b/Projectiles/Ranged/IcyBulletProj.cs index 26ec484952..d13fe4ba97 100644 --- a/Projectiles/Ranged/IcyBulletProj.cs +++ b/Projectiles/Ranged/IcyBulletProj.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.Frostburn, 300); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 60); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Ranged/MistArrow.cs b/Projectiles/Ranged/MistArrow.cs index a4c846cd12..f61c8a76e9 100644 --- a/Projectiles/Ranged/MistArrow.cs +++ b/Projectiles/Ranged/MistArrow.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.Frostburn, 240); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 60); } } } diff --git a/Projectiles/Ranged/RainbowBlast.cs b/Projectiles/Ranged/RainbowBlast.cs index 630c2fb00b..a73b369265 100644 --- a/Projectiles/Ranged/RainbowBlast.cs +++ b/Projectiles/Ranged/RainbowBlast.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Ranged/SeasSearingSecondary.cs b/Projectiles/Ranged/SeasSearingSecondary.cs index 2fb727a23d..3a2c79fd6d 100644 --- a/Projectiles/Ranged/SeasSearingSecondary.cs +++ b/Projectiles/Ranged/SeasSearingSecondary.cs @@ -3,6 +3,7 @@ using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -62,7 +63,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 360); target.AddBuff(ModContent.BuffType(), 360); } } diff --git a/Projectiles/Ranged/TerraFireGreen2.cs b/Projectiles/Ranged/TerraFireGreen2.cs index 597569dff2..25d67e9217 100644 --- a/Projectiles/Ranged/TerraFireGreen2.cs +++ b/Projectiles/Ranged/TerraFireGreen2.cs @@ -87,7 +87,6 @@ namespace CalamityMod.Projectiles.Ranged target.AddBuff(BuffID.CursedInferno, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(BuffID.OnFire, 300); - target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(BuffID.Frostburn, 300); } } diff --git a/Projectiles/Rogue/AccretionDisk2.cs b/Projectiles/Rogue/AccretionDisk2.cs index 97f97be950..2df7ba00fa 100644 --- a/Projectiles/Rogue/AccretionDisk2.cs +++ b/Projectiles/Rogue/AccretionDisk2.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitPvp(Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Rogue/AccretionDiskProj.cs b/Projectiles/Rogue/AccretionDiskProj.cs index ffca27ed6f..2c796ac029 100644 --- a/Projectiles/Rogue/AccretionDiskProj.cs +++ b/Projectiles/Rogue/AccretionDiskProj.cs @@ -179,7 +179,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); if (!projectile.Calamity().stealthStrike) @@ -189,7 +189,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitPvp(Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); if (!projectile.Calamity().stealthStrike) diff --git a/Projectiles/Rogue/EradicatorProjectile.cs b/Projectiles/Rogue/EradicatorProjectile.cs index a7cc98c8c4..c42ddc9cd5 100644 --- a/Projectiles/Rogue/EradicatorProjectile.cs +++ b/Projectiles/Rogue/EradicatorProjectile.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.timeLeft = 180; aiType = ProjectileID.WoodenBoomerang; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; + projectile.localNPCHitCooldown = 18; projectile.Calamity().rogue = true; } @@ -57,14 +57,18 @@ namespace CalamityMod.Projectiles.Rogue { shootCounter = 0f; Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - Projectile laser = Projectile.NewProjectileDirect(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner); + + int laserDamage = (int)(projectile.damage * 0.5); + Projectile laser = Projectile.NewProjectileDirect(projectile.Center, velocity, ModContent.ProjectileType(), laserDamage, 0f, projectile.owner); if (laser.whoAmI.WithinBounds(Main.maxProjectiles)) { laser.Calamity().forceRogue = true; laser.aiStyle = Main.rand.NextBool() ? 1 : -1; laser.penetrate = -1; laser.usesLocalNPCImmunity = true; - laser.localNPCHitCooldown = 20; + + // This projectile has a hefty amount of extra updates, which will influence the hit cooldown. + laser.localNPCHitCooldown = 70; } } diff --git a/Projectiles/Rogue/FrostyFlareProj.cs b/Projectiles/Rogue/FrostyFlareProj.cs index 6fa06346ae..ed6ef31c27 100644 --- a/Projectiles/Rogue/FrostyFlareProj.cs +++ b/Projectiles/Rogue/FrostyFlareProj.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.Frostburn, 300); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 60); target.immune[projectile.owner] = 0; projectile.ai[0] = 1f; projectile.ai[1] = target.whoAmI; @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitPvp(Player target, int damage, bool crit) { target.AddBuff(BuffID.Frostburn, 300); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 60); } public override bool CanDamage() => projectile.ai[0] == 0f; diff --git a/Projectiles/Rogue/FrostyFlareStealth.cs b/Projectiles/Rogue/FrostyFlareStealth.cs index c0d7d932bf..d9b2bf1334 100644 --- a/Projectiles/Rogue/FrostyFlareStealth.cs +++ b/Projectiles/Rogue/FrostyFlareStealth.cs @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.Frostburn, 300); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 60); target.immune[projectile.owner] = 0; projectile.ai[0] = 1f; projectile.ai[1] = target.whoAmI; @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitPvp(Player target, int damage, bool crit) { target.AddBuff(BuffID.Frostburn, 300); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 60); } public override bool CanDamage() => projectile.ai[0] == 0f; diff --git a/Projectiles/Rogue/GodsParanoiaProj.cs b/Projectiles/Rogue/GodsParanoiaProj.cs index a4009f72d9..0de494c4ea 100644 --- a/Projectiles/Rogue/GodsParanoiaProj.cs +++ b/Projectiles/Rogue/GodsParanoiaProj.cs @@ -51,16 +51,9 @@ namespace CalamityMod.Projectiles.Rogue if (projectile.ai[0] == 1f) { - if (projectile.Calamity().stealthStrike) - { - kunaiStabbing += 2; - } - else - { - kunaiStabbing++; - } - if (kunaiStabbing >= 20) - { + kunaiStabbing++; + if (kunaiStabbing >= 20) + { kunaiStabbing = 0; float startOffsetX = Main.rand.NextFloat(100f, 200f) * (Main.rand.NextBool() ? -1f : 1f); float startOffsetY = Main.rand.NextFloat(100f, 200f) * (Main.rand.NextBool() ? -1f : 1f); diff --git a/Projectiles/Rogue/IcebreakerHammer.cs b/Projectiles/Rogue/IcebreakerHammer.cs index 54b35e3404..d9a2a00b04 100644 --- a/Projectiles/Rogue/IcebreakerHammer.cs +++ b/Projectiles/Rogue/IcebreakerHammer.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Rogue if (nPC.active && !nPC.dontTakeDamage && !nPC.buffImmune[buffType] && Vector2.Distance(projectile.Center, nPC.Center) <= radius) { if (nPC.FindBuffIndex(buffType) == -1) - nPC.AddBuff(buffType, 90, false); + nPC.AddBuff(buffType, 60, false); } } } @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Rogue if ((owner.team != player.team || player.team == 0) && player.hostile && owner.hostile && !player.dead && !player.buffImmune[buffType] && Vector2.Distance(projectile.Center, player.Center) <= radius) { if (player.FindBuffIndex(buffType) == -1) - player.AddBuff(buffType, 90, false); + player.AddBuff(buffType, 60, false); } } } diff --git a/Projectiles/Rogue/TimeBoltKnife.cs b/Projectiles/Rogue/TimeBoltKnife.cs index 721b8a0b55..0d9804ebc2 100644 --- a/Projectiles/Rogue/TimeBoltKnife.cs +++ b/Projectiles/Rogue/TimeBoltKnife.cs @@ -310,7 +310,7 @@ namespace CalamityMod.Projectiles.Rogue if (npc.active && !npc.dontTakeDamage && !npc.buffImmune[buffType] && Vector2.Distance(projectile.Center, npc.Center) <= radius) { if (npc.FindBuffIndex(buffType) == -1) - npc.AddBuff(buffType, 90, false); + npc.AddBuff(buffType, 60, false); } } } diff --git a/Projectiles/Rogue/ValariBoomerang.cs b/Projectiles/Rogue/ValariBoomerang.cs index 60d82eb027..b32e793ced 100644 --- a/Projectiles/Rogue/ValariBoomerang.cs +++ b/Projectiles/Rogue/ValariBoomerang.cs @@ -150,8 +150,7 @@ namespace CalamityMod.Projectiles.Rogue OnHitEffects(); target.AddBuff(BuffID.Frostburn, 240); target.AddBuff(ModContent.BuffType(), 240); - if (Main.rand.NextBool(5)) - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(ModContent.BuffType(), 60); } public override void OnHitPvp(Player target, int damage, bool crit) @@ -159,8 +158,7 @@ namespace CalamityMod.Projectiles.Rogue OnHitEffects(); target.AddBuff(BuffID.Frostburn, 240); target.AddBuff(ModContent.BuffType(), 240); - if (Main.rand.NextBool(5)) - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(ModContent.BuffType(), 60); } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Summon/ElementalAxeMinion.cs b/Projectiles/Summon/ElementalAxeMinion.cs index d9600a6b7d..cb5dd7e234 100644 --- a/Projectiles/Summon/ElementalAxeMinion.cs +++ b/Projectiles/Summon/ElementalAxeMinion.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Summon public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Summon/EndoCooperBody.cs b/Projectiles/Summon/EndoCooperBody.cs index 14a7a88eba..c9a37b48fc 100644 --- a/Projectiles/Summon/EndoCooperBody.cs +++ b/Projectiles/Summon/EndoCooperBody.cs @@ -352,8 +352,8 @@ namespace CalamityMod.Projectiles.Summon public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 90); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 60); target.AddBuff(BuffID.Frostburn, 180); } diff --git a/Projectiles/Summon/EndoCooperLimbs.cs b/Projectiles/Summon/EndoCooperLimbs.cs index d288f47dca..3e95b267c3 100644 --- a/Projectiles/Summon/EndoCooperLimbs.cs +++ b/Projectiles/Summon/EndoCooperLimbs.cs @@ -150,8 +150,8 @@ namespace CalamityMod.Projectiles.Summon public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 90); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 60); target.AddBuff(BuffID.Frostburn, 180); } diff --git a/Projectiles/Summon/EndoFire.cs b/Projectiles/Summon/EndoFire.cs index 9e6f9ecb9a..d88bab58f6 100644 --- a/Projectiles/Summon/EndoFire.cs +++ b/Projectiles/Summon/EndoFire.cs @@ -105,8 +105,8 @@ namespace CalamityMod.Projectiles.Summon public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 90); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 60); target.AddBuff(BuffID.Frostburn, 180); } } diff --git a/Projectiles/Summon/EndoIceShard.cs b/Projectiles/Summon/EndoIceShard.cs index 87327db404..023186e28b 100644 --- a/Projectiles/Summon/EndoIceShard.cs +++ b/Projectiles/Summon/EndoIceShard.cs @@ -130,8 +130,8 @@ namespace CalamityMod.Projectiles.Summon public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 90); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 60); target.AddBuff(BuffID.Frostburn, 180); } } diff --git a/Projectiles/Summon/MagicAxe.cs b/Projectiles/Summon/MagicAxe.cs index fe68c143f5..7ce569fd1b 100644 --- a/Projectiles/Summon/MagicAxe.cs +++ b/Projectiles/Summon/MagicAxe.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Summon public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Summon public override void OnHitPvp(Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Summon/SquirrelSquireAcorn.cs b/Projectiles/Summon/SquirrelSquireAcorn.cs index 8e312d4e7f..3b2f88f4d1 100644 --- a/Projectiles/Summon/SquirrelSquireAcorn.cs +++ b/Projectiles/Summon/SquirrelSquireAcorn.cs @@ -1,11 +1,12 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; + namespace CalamityMod.Projectiles.Summon { public class SquirrelSquireAcorn : ModProjectile { + public const float Gravity = 0.5f; public override void SetStaticDefaults() { DisplayName.SetDefault("Acorn"); @@ -20,22 +21,18 @@ namespace CalamityMod.Projectiles.Summon projectile.minion = true; projectile.penetrate = 2; projectile.timeLeft = 180; - projectile.aiStyle = 1; } public override void AI() { - projectile.velocity.X *= 0.9995f; - projectile.velocity.Y = projectile.velocity.Y + 0.01f; - projectile.rotation += MathHelper.ToRadians(180) * projectile.direction; + projectile.velocity.Y += Gravity; + projectile.rotation += (projectile.velocity.X > 0f).ToDirectionInt() * 0.3f; } public override void Kill(int timeLeft) { for (int k = 0; k < 5; k++) - { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 7, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); - } } } } diff --git a/Projectiles/Summon/SquirrelSquireMinion.cs b/Projectiles/Summon/SquirrelSquireMinion.cs index 5b141c3a20..221729e014 100644 --- a/Projectiles/Summon/SquirrelSquireMinion.cs +++ b/Projectiles/Summon/SquirrelSquireMinion.cs @@ -2,6 +2,7 @@ using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; +using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,7 +11,15 @@ namespace CalamityMod.Projectiles.Summon { public class SquirrelSquireMinion : ModProjectile { - public float dust = 0f; + public int StuckTimer; + public bool TryingToGetCloseToOwner + { + get => projectile.ai[0] == 1f; + set => projectile.ai[0] = value.ToInt(); + } + public ref float AttackTimer => ref projectile.ai[1]; + public bool OnSolidGround => projectile.velocity.Y == 0f && WorldGen.SolidTile((int) projectile.Center.X / 16, (int) projectile.Bottom.Y / 16 + 2); + public Player Owner => Main.player[projectile.owner]; public override void SetStaticDefaults() { @@ -22,7 +31,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { - projectile.width = 64; + projectile.width = 34; projectile.height = 64; projectile.netImportant = true; projectile.friendly = true; @@ -35,498 +44,178 @@ namespace CalamityMod.Projectiles.Summon projectile.minion = true; } + public override void SendExtraAI(BinaryWriter writer) => writer.Write(StuckTimer); + + public override void ReceiveExtraAI(BinaryReader reader) => StuckTimer = reader.ReadInt32(); + public override void AI() { - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - CalamityGlobalProjectile modProj = projectile.Calamity(); - if (dust == 0f) + if (projectile.localAI[0] == 0f) { - modProj.spawnedPlayerMinionDamageValue = player.MinionDamage(); - modProj.spawnedPlayerMinionProjectileDamageValue = projectile.damage; - int dustAmt = 36; - for (int d = 0; d < dustAmt; d++) - { - Vector2 source = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - source = source.RotatedBy((double)((float)(d - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + projectile.Center; - Vector2 dustVel = source - projectile.Center; - int dusty = Dust.NewDust(source + dustVel, 0, 0, 7, dustVel.X * 1.1f, dustVel.Y * 1.1f, 100, default, 1.4f); - Main.dust[dusty].noGravity = true; - Main.dust[dusty].noLight = true; - Main.dust[dusty].velocity = dustVel; - } - dust += 1f; + DoInitializationEffects(); + projectile.localAI[0] = 1f; } - if (player.MinionDamage() != modProj.spawnedPlayerMinionDamageValue) + + // Re-adjust damage as needed. + if (Owner.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { - int damage2 = (int)((float)modProj.spawnedPlayerMinionProjectileDamageValue / - modProj.spawnedPlayerMinionDamageValue * - player.MinionDamage()); - projectile.damage = damage2; + int trueDamage = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * Owner.MinionDamage()); + projectile.damage = trueDamage; } - bool projTypeCheck = projectile.type == ModContent.ProjectileType(); - player.AddBuff(ModContent.BuffType(), 3600); - if (projTypeCheck) + + projectile.frameCounter++; + + VerifyIdentity(); + if (!projectile.WithinRange(Owner.Center, 1000f) || TryingToGetCloseToOwner || Collision.SolidCollision(projectile.position + Vector2.One * 4f, projectile.width - 8, projectile.height - 8)) { - if (player.dead) + // Once far off, don't go back to normal until 350 pixels away from the owner or less. + TryingToGetCloseToOwner = !projectile.WithinRange(Owner.Center, 350f) && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height); + + ReturnToOwner(); + if (!projectile.WithinRange(Owner.Center, 2000f)) { - modPlayer.squirrel = false; + projectile.Center = Owner.Center; + projectile.netUpdate = true; } - if (modPlayer.squirrel) - { + projectile.tileCollide = false; + return; + } + + NPC potentialTarget = projectile.Center.MinionHoming(800f, Owner, false); + if (potentialTarget is null) + FollowOwner(); + else + AttackTarget(potentialTarget); + + projectile.rotation = 0f; + projectile.tileCollide = true; + } + + public void DoInitializationEffects() + { + projectile.Calamity().spawnedPlayerMinionDamageValue = Owner.MinionDamage(); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + + int dustQuantity = 36; + for (int d = 0; d < dustQuantity; d++) + { + Dust dust = Dust.NewDustPerfect(projectile.Center, 7); + dust.scale = 1.4f; + dust.velocity = (MathHelper.TwoPi * d / dustQuantity).ToRotationVector2() * 4f; + dust.noGravity = true; + dust.noLight = true; + } + } + + public void VerifyIdentity() + { + Owner.AddBuff(ModContent.BuffType(), 3600); + if (projectile.type == ModContent.ProjectileType()) + { + if (Owner.dead) + Owner.Calamity().squirrel = false; + if (Owner.Calamity().squirrel) projectile.timeLeft = 2; + } + } + + public void ReturnToOwner() + { + projectile.frame = 12 + projectile.frameCounter / 8 % 4; + projectile.velocity = projectile.velocity.MoveTowards(projectile.SafeDirectionTo(Owner.Top) * 8f, 0.8f); + projectile.spriteDirection = (projectile.velocity.X > 0f).ToDirectionInt(); + projectile.rotation = projectile.velocity.X * 0.025f; + } + + public void AttemptToJumpToDestination(Vector2 destination) + { + if (OnSolidGround) + { + float jumpSpeed = MathHelper.Lerp(6f, 13f, Utils.InverseLerp(100f, 250f, MathHelper.Distance(projectile.Center.X, destination.X), true)); + projectile.velocity = CalamityUtils.GetProjectilePhysicsFiringVelocity(projectile.Center, Owner.Center, 0.4f, jumpSpeed); + projectile.spriteDirection = (projectile.velocity.X > 0f).ToDirectionInt(); + projectile.netUpdate = true; + projectile.frame = 4; + } + else + { + if (projectile.frameCounter % 5 == 4 && projectile.frame < 7) + projectile.frame++; + } + } + + public void FollowOwner() + { + projectile.rotation = 0f; + + // Slow down and just idly vibe if close enough to the owner. + float horizontalDistanceFromOwner = MathHelper.Distance(projectile.Center.X, Owner.Center.X); + float verticalDistanceFromOwner = MathHelper.Distance(projectile.Center.Y, Owner.Center.Y); + if (horizontalDistanceFromOwner < 100f && verticalDistanceFromOwner < 450f) + { + projectile.velocity.X *= 0.94f; + if (OnSolidGround) + { + projectile.frame = projectile.frameCounter / 5 % 4; + projectile.velocity *= 0.9f; + } + StuckTimer = 0; + } + + // Otherwise try to catch up with them on foot. + else + { + AttemptToJumpToDestination(Owner.Center); + // Determine if there's something in the way of this minion and its owner. + if (!Collision.CanHit(projectile.position, projectile.width, projectile.height, Owner.Center, 2, 2) || MathHelper.Distance(projectile.position.X, projectile.oldPosition.X) < 1f) + { + StuckTimer++; + + // If stuck for a sufficiently long time fly to the owner again. + if (StuckTimer > 180) + { + TryingToGetCloseToOwner = true; + StuckTimer = 0; + projectile.netUpdate = true; + } + } + else if (StuckTimer > 0) + StuckTimer--; + } + + // Enforce gravity. + projectile.velocity.Y = MathHelper.Clamp(projectile.velocity.Y + 0.4f, -12f, 12f); + } + + public void AttackTarget(NPC target) + { + float horizontalDistanceFromTarget = MathHelper.Distance(projectile.Center.X, target.Center.X); + + if (horizontalDistanceFromTarget > 350f) + AttemptToJumpToDestination(target.Center); + else if (OnSolidGround) + { + projectile.velocity.X *= 0.94f; + if (OnSolidGround) + { + projectile.frame = projectile.frameCounter / 5 % 4; + projectile.velocity *= 0.9f; + } + AttackTimer++; + + // Pelt the target with acorns. + projectile.frame = 8 + (int)(AttackTimer / 6.4) % 4; + if (Main.myPlayer == projectile.owner && AttackTimer % 30f == 27f) + { + projectile.spriteDirection = (target.Center.X > projectile.Center.X).ToDirectionInt(); + Vector2 acornSpawnPosition = projectile.Center + new Vector2(projectile.spriteDirection * 6f, 10f); + float acornShootSpeed = 14f; + Vector2 acornShootVelocity = CalamityUtils.GetProjectilePhysicsFiringVelocity(acornSpawnPosition, target.Center + target.velocity * 25f, SquirrelSquireAcorn.Gravity, acornShootSpeed); + Projectile.NewProjectile(acornSpawnPosition, acornShootVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); } } - bool leftofPlayer = false; - bool rightofPlayer = false; - bool flag3 = false; - bool flag4 = false; - if (projectile.lavaWet) - { - projectile.ai[0] = 1f; - projectile.ai[1] = 0f; - } - float minionOffset = 40f * (projectile.minionPos + 1f) * player.direction; - if (player.Center.X < projectile.Center.X - 10f + minionOffset) - leftofPlayer = true; - else if (player.Center.X > projectile.Center.X + 10f + minionOffset) - rightofPlayer = true; - - if (projectile.ai[1] == 0f) - { - float playerDist = (player.Center - projectile.Center).Length(); - if (playerDist > 1000f) - { - projectile.ai[0] = 1f; - } - if (playerDist > 2000f) //teleport to player if too far - { - projectile.position = player.position; - projectile.netUpdate = true; - } - } - if (projectile.ai[0] != 0f) //flying back to the player - { - projectile.tileCollide = false; - float npcDetectRange = 800f; - bool npcFound = false; - int targetIndex = -1; - for (int index = 0; index < Main.maxNPCs; ++index) - { - NPC npc = Main.npc[index]; - if (npc.CanBeChasedBy(projectile, false)) - { - float npcDist = Vector2.Distance(npc.Center, player.Center); - if (npcDist < npcDetectRange) - { - if (Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) - targetIndex = index; - npcFound = true; - break; - } - } - } - - //return to normal if npc found - if (npcFound && targetIndex >= 0) - projectile.ai[0] = 0f; - - Vector2 homeBase = player.Center - projectile.Center; - homeBase.X -= 40f * player.direction; - if (!npcFound) - homeBase.X -= 40f * projectile.minionPos * player.direction; - homeBase.Y -= 60f; - float playerDist = homeBase.Length(); - float speed = playerDist; - float acceleration = 0.4f; - - //if close enough to the player and has tile to stand on, return to normal - if (playerDist < 100f && player.velocity.Y == 0f && projectile.Bottom.Y <= player.Bottom.Y && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - if (projectile.velocity.Y < -6f) - projectile.velocity.Y = -6f; - } - if (playerDist > 2000f) - { - projectile.position = player.position; - projectile.netUpdate = true; - } - if (playerDist < 50f) - { - if (Math.Abs(projectile.velocity.X) > 2f || Math.Abs(projectile.velocity.Y) > 2f) - { - projectile.velocity *= 0.99f; - } - acceleration = 0.01f; - } - else - { - if (playerDist < 100f) - { - acceleration = 0.1f; - } - if (playerDist > 300f) - { - acceleration = 1f; - } - playerDist = speed / playerDist; - homeBase *= playerDist; - } - if (projectile.velocity.X < homeBase.X) - { - projectile.velocity.X += acceleration; - if (acceleration > 0.05f && projectile.velocity.X < 0f) - { - projectile.velocity.X += acceleration; - } - } - if (projectile.velocity.X > homeBase.X) - { - projectile.velocity.X -= acceleration; - if (acceleration > 0.05f && projectile.velocity.X > 0f) - { - projectile.velocity.X -= acceleration; - } - } - if (projectile.velocity.Y < homeBase.Y) - { - projectile.velocity.Y += acceleration; - if (acceleration > 0.05f && projectile.velocity.Y < 0f) - { - projectile.velocity.Y += acceleration * 2f; - } - } - if (projectile.velocity.Y > homeBase.Y) - { - projectile.velocity.Y -= acceleration; - if (acceleration > 0.05f && projectile.velocity.Y > 0f) - { - projectile.velocity.Y -= acceleration * 2f; - } - } - if (projectile.frame < 12 || projectile.frame == 16) - { - projectile.frame = 12; - } - else - { - projectile.frameCounter++; - if (projectile.frameCounter > 3) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame >= 16) - { - projectile.frame = 13; - } - } - if (projectile.velocity.X > 0.5f) - projectile.spriteDirection = 1; - else if (projectile.velocity.X < -0.5f) - projectile.spriteDirection = -1; - } - else - { - float minionOffset2 = (float)(40 * projectile.minionPos); - float attackCooldown = 30f; - float directionCooldown = 60f; - --projectile.localAI[0]; - if (projectile.localAI[0] < 0f) - projectile.localAI[0] = 0f; - if (projectile.ai[1] > 0f) - { - --projectile.ai[1]; - } - else - { - Vector2 targetPos = projectile.position; - float range = 100000f; - float maxDist = range; - int targetIndex = -1; - NPC target = projectile.OwnerMinionAttackTargetNPC; - if (target != null && target.CanBeChasedBy(projectile, false)) - { - float npcDist = Vector2.Distance(target.Center, projectile.Center); - if (npcDist < range) - { - if (targetIndex == -1 && npcDist <= maxDist) - { - maxDist = npcDist; - targetPos = target.Center; - } - if (Collision.CanHit(projectile.Center, projectile.width, projectile.height, target.Center, target.width, target.height)) - { - range = npcDist; - targetPos = target.Center; - targetIndex = target.whoAmI; - } - } - } - if (targetIndex == -1) - { - for (int index = 0; index < Main.maxNPCs; ++index) - { - NPC npc = Main.npc[index]; - if (npc.CanBeChasedBy(projectile, false)) - { - float npcDist = Vector2.Distance(npc.Center, projectile.Center); - if (npcDist < range) - { - if (targetIndex == -1 && npcDist <= maxDist) - { - maxDist = npcDist; - targetPos = npc.Center; - } - if (Collision.CanHit(projectile.Center, projectile.width, projectile.height, npc.Center, npc.width, npc.height)) - { - range = npcDist; - targetPos = npc.Center; - targetIndex = index; - } - } - } - } - } - if (targetIndex == -1 && maxDist < range) - range = maxDist; - float num13 = 400f; - if ((double)projectile.position.Y > Main.worldSurface * 16D) - num13 = 200f; - if (range < num13 + minionOffset2 && targetIndex == -1) - { - float xDist = targetPos.X - projectile.Center.X; - if (xDist < -5f) - { - leftofPlayer = true; - rightofPlayer = false; - } - else if (xDist > 5f) - { - rightofPlayer = true; - leftofPlayer = false; - } - } - else if (targetIndex >= 0 && range < 800f + minionOffset2) - { - projectile.localAI[0] = directionCooldown; - float xDist = targetPos.X - projectile.Center.X; - if (Math.Abs(xDist) > 300f) - { - if (xDist < -50f) - { - leftofPlayer = true; - rightofPlayer = false; - } - else if (xDist > 50f) - { - rightofPlayer = true; - leftofPlayer = false; - } - } - else if (projectile.owner == Main.myPlayer) - { - projectile.ai[1] = attackCooldown; - float speed = 12f; - Vector2 source = projectile.Center - Vector2.UnitY * 8f; - Vector2 projVel = targetPos - source; - projVel.X += Main.rand.NextFloat(-10f, 10f); - projVel.Y += Main.rand.NextFloat(-10f, 10f) - Math.Abs(projVel.X) * Main.rand.NextFloat(0.0001f, 0.01f); - projVel.Normalize(); - projVel *= speed; - int damage = projectile.damage; - int projType = ModContent.ProjectileType(); - int index = Projectile.NewProjectile(source, projVel, projType, damage, projectile.knockBack, projectile.owner); - if (projVel.X < 0f) - projectile.direction = projectile.spriteDirection = -1; - else if (projVel.X > 0f) - projectile.direction = projectile.spriteDirection = 1; - projectile.netUpdate = true; - } - } - } - if (projectile.ai[1] != 0f) //If on attack cooldown - { - leftofPlayer = false; - rightofPlayer = false; - } - else if (projectile.localAI[0] == 0f) - projectile.direction = projectile.spriteDirection = player.direction; - projectile.tileCollide = true; - float num18 = 0.2f; - float num19 = 6f; - if (num19 < Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y)) - { - num19 = Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y); - num18 = 0.3f; - } - if (leftofPlayer) - { - if (projectile.velocity.X > -3.5f) - projectile.velocity.X -= num18; - else - projectile.velocity.X -= num18 * 0.25f; - } - else if (rightofPlayer) - { - if (projectile.velocity.X < 3.5f) - projectile.velocity.X += num18; - else - projectile.velocity.X += num18 * 0.25f; - } - else - { - projectile.velocity.X *= 0.9f; - if (projectile.velocity.X >= -num18 && projectile.velocity.X <= num18) - projectile.velocity.X = 0f; - } - if (leftofPlayer | rightofPlayer) - { - int i = (int)projectile.Center.X / 16; - int j = (int)projectile.Center.Y / 16; - if (leftofPlayer) - --i; - if (rightofPlayer) - ++i; - if (WorldGen.SolidTile(i + (int)projectile.velocity.X, j)) - flag4 = true; - } - if (player.position.Y + player.height - 8f > projectile.position.Y + projectile.height) - flag3 = true; - Collision.StepUp(ref projectile.position, ref projectile.velocity, projectile.width, projectile.height, ref projectile.stepSpeed, ref projectile.gfxOffY, 1, false, 0); - if (projectile.velocity.Y == 0f) - { - if (!flag3 && (projectile.velocity.X < 0f || projectile.velocity.X > 0f)) - { - int i = (int)projectile.Center.X / 16; - int j = (int)projectile.Center.Y / 16 + 1; - if (leftofPlayer) - --i; - if (rightofPlayer) - ++i; - WorldGen.SolidTile(i, j); - } - if (flag4) - { - int i = (int)projectile.Center.X / 16; - int j = (int)projectile.Center.Y / 16 + 1; - if (WorldGen.SolidTile(i, j) || Main.tile[i, j].halfBrick() || (int)Main.tile[i, j].slope() > 0) - { - try - { - int i2 = (int)projectile.Center.X / 16; - int j2 = (int)projectile.Center.Y / 16; - if (leftofPlayer) - --i2; - if (rightofPlayer) - ++i2; - i2 += (int)projectile.velocity.X; - if (!WorldGen.SolidTile(i2, j2 - 1) && !WorldGen.SolidTile(i2, j2 - 2)) - projectile.velocity.Y = -5.1f; - else if (!WorldGen.SolidTile(i2, j2 - 2)) - projectile.velocity.Y = -7.1f; - else if (WorldGen.SolidTile(i2, j2 - 5)) - projectile.velocity.Y = -11.1f; - else if (WorldGen.SolidTile(i2, j2 - 4)) - projectile.velocity.Y = -10.1f; - else - projectile.velocity.Y = -9.1f; - } - catch - { - projectile.velocity.Y = -9.1f; - } - } - } - } - if (projectile.velocity.X > num19) - projectile.velocity.X = num19; - if (projectile.velocity.X < -num19) - projectile.velocity.X = -num19; - if (projectile.velocity.X < -0.05f) - projectile.direction = projectile.spriteDirection = -1; - if (projectile.velocity.X > 0.05f) - projectile.direction = projectile.spriteDirection = 1; - if (projectile.ai[1] > 0f) - { - if (projectile.localAI[1] == 0f) - { - projectile.localAI[1] = 1f; - projectile.frame = 8; - } - if (projectile.frame >= 8 && projectile.frame <= 11) - { - projectile.frameCounter++; - if (projectile.frameCounter > 8) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame == 11) - projectile.frame = 8; - } - } - else if (projectile.velocity.Y == 0f) - { - projectile.localAI[1] = 0f; - if (projectile.velocity.X == 0f) - { - projectile.frameCounter++; - if (projectile.frameCounter > 4) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame >= 4) - { - projectile.frame = 0; - } - } - else if (Math.Abs(projectile.velocity.X) > 0.8f) - { - projectile.frameCounter += (int)Math.Abs(projectile.velocity.X); - projectile.frameCounter++; - if (projectile.frameCounter > 20) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame < 4) - projectile.frame = 4; - if (projectile.frame >= 8) - projectile.frame = 4; - } - else - { - projectile.frameCounter++; - if (projectile.frameCounter > 4) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame >= 4) - { - projectile.frame = 0; - } - } - } - else if (projectile.velocity.Y < 0f) - { - projectile.frameCounter = 0; - projectile.frame = 16; - } - else if (projectile.velocity.Y > 0f) - { - projectile.frameCounter = 0; - projectile.frame = 16; - } - projectile.velocity.Y += 0.4f; - if (projectile.velocity.Y > 10f) - projectile.velocity.Y = 10f; - Vector2 velocity = projectile.velocity; - } - } + projectile.velocity.Y = MathHelper.Clamp(projectile.velocity.Y + 0.4f, -12f, 12f); + } public override bool CanDamage() => false; diff --git a/Projectiles/Typeless/DarkIce.cs b/Projectiles/Typeless/DarkIce.cs index 8c278ec58d..beeadbbc90 100644 --- a/Projectiles/Typeless/DarkIce.cs +++ b/Projectiles/Typeless/DarkIce.cs @@ -51,13 +51,13 @@ namespace CalamityMod.Projectiles.Typeless public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.Frostburn, 480); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 60); } public override void OnHitPvp(Player target, int damage, bool crit) { target.AddBuff(BuffID.Frostburn, 480); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 60); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Typeless/TeslaAura.cs b/Projectiles/Typeless/TeslaAura.cs index 52dfd8e461..88df1972ad 100644 --- a/Projectiles/Typeless/TeslaAura.cs +++ b/Projectiles/Typeless/TeslaAura.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Typeless public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.Electrified, 180); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 60); if (target.knockBackResist <= 0f) return; @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Typeless public override void OnHitPvp(Player target, int damage, bool crit) { target.AddBuff(BuffID.Electrified, 180); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 60); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Skies/StormWeaverFlashSky.cs b/Skies/StormWeaverFlashSky.cs new file mode 100644 index 0000000000..6481e2987d --- /dev/null +++ b/Skies/StormWeaverFlashSky.cs @@ -0,0 +1,56 @@ +using CalamityMod.NPCs.StormWeaver; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Graphics.Effects; +using Terraria.ModLoader; + +namespace CalamityMod.Skies +{ + public class StormWeaverFlashSky : CustomSky + { + public int StormWeaverHeadIndex = -1; + + public override void Update(GameTime gameTime) + { + int weaverType = ModContent.NPCType(); + if (StormWeaverHeadIndex >= 0 && Main.npc[StormWeaverHeadIndex].active && Main.npc[StormWeaverHeadIndex].type == weaverType) + return; + + StormWeaverHeadIndex = -1; + for (int i = 0; i < Main.npc.Length; i++) + { + if (Main.npc[i].active && Main.npc[i].type == weaverType) + { + StormWeaverHeadIndex = i; + break; + } + } + } + + public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth) + { + if (maxDepth < float.MaxValue || !Main.npc.IndexInRange(StormWeaverHeadIndex)) + return; + + // Draw lightning in the background based on Main.magicPixel. + // It is a long, white vertical strip that exists for some reason. + // This lightning effect is achieved by expanding this to fit the entire background and then drawing it as a distinct element. + float lightningFlashPower = (Main.npc[StormWeaverHeadIndex].modNPC as StormWeaverHeadNaked).lightning; + Vector2 scale = new Vector2(Main.screenWidth * 1.1f / Main.magicPixel.Width, Main.screenHeight * 1.1f / Main.magicPixel.Height); + Vector2 screenCenter = new Vector2(Main.screenWidth, Main.screenHeight) * 0.5f; + Color drawColor = Color.White * MathHelper.Lerp(0f, 0.88f, lightningFlashPower); + + for (int i = 0; i < 2; i++) + spriteBatch.Draw(Main.magicPixel, screenCenter, null, drawColor, 0f, Main.magicPixel.Size() * 0.5f, scale, SpriteEffects.None, 0f); + } + + public override void Reset() { } + + public override void Activate(Vector2 position, params object[] args) { } + + public override void Deactivate(params object[] args) { } + + public override bool IsActive() => StormWeaverHeadIndex != -1 && !Main.gameMenu; + } +} diff --git a/Utilities/MathematicalUtils.cs b/Utilities/MathematicalUtils.cs index 05680c8b33..27508a4aa5 100644 --- a/Utilities/MathematicalUtils.cs +++ b/Utilities/MathematicalUtils.cs @@ -61,5 +61,16 @@ namespace CalamityMod int num4 = Math.Max(0, Math.Min(tileRectangle.Bottom, Main.maxTilesY)); return new Rectangle(num, num2, num3 - num, num4 - num2); } + + // REMOVE THIS IN CALAMITY 1.4, it's a 1.4 Utils.cs function. + // Due to its temporary state, this method will not receive an XML documentation comment. + public static Vector2 MoveTowards(this Vector2 currentPosition, Vector2 targetPosition, float maxAmountAllowedToMove) + { + Vector2 v = targetPosition - currentPosition; + if (v.Length() < maxAmountAllowedToMove) + return targetPosition; + + return currentPosition + v.SafeNormalize(Vector2.Zero) * maxAmountAllowedToMove; + } } } diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs index 4f8815c2a0..3bb3f425db 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -144,7 +144,7 @@ namespace CalamityMod (sfx.Volume, sfx.Pan) = CalculateSoundStats(soundPos, ambient); } - public static void StartRain(bool torrentialTear = false) + public static void StartRain(bool torrentialTear = false, bool maxSeverity = false) { int num = 86400; int num2 = num / 24; @@ -193,7 +193,7 @@ namespace CalamityMod Main.rainTime = (int)(Main.rainTime * num3); Main.raining = true; if (torrentialTear) - TorrentialTear.AdjustRainSeverity(false); + TorrentialTear.AdjustRainSeverity(maxSeverity); CalamityNetcode.SyncWorld(); } diff --git a/Utilities/NPCDebuffs.cs b/Utilities/NPCDebuffs.cs index 333865277b..e07527c38a 100644 --- a/Utilities/NPCDebuffs.cs +++ b/Utilities/NPCDebuffs.cs @@ -109,6 +109,9 @@ namespace CalamityMod { ModContent.NPCType(), new Tuple(false, CalamityMod.cragEnemyImmunities) }, { ModContent.NPCType(), new Tuple(false, CalamityMod.cragEnemyImmunities) }, + { NPCID.Plantera, new Tuple(false, new int[] { BuffID.Venom }) }, + { NPCID.PlanterasTentacle, new Tuple(false, new int[] { BuffID.Venom }) }, + // She resists the cold because of her ice-related abilities. { ModContent.NPCType(), new Tuple(false, CalamityMod.iceEnemyImmunities) }, { ModContent.NPCType(), new Tuple(false, CalamityMod.iceEnemyImmunities) }, @@ -130,6 +133,11 @@ namespace CalamityMod { ModContent.NPCType(), new Tuple(true, new int[] { }) }, { ModContent.NPCType(), new Tuple(true, new int[] { }) }, + { NPCID.MoonLordCore, new Tuple(false, new int[] { ModContent.BuffType() }) }, + { NPCID.MoonLordHand, new Tuple(false, new int[] { ModContent.BuffType() }) }, + { NPCID.MoonLordHead, new Tuple(false, new int[] { ModContent.BuffType() }) }, + { NPCID.MoonLordLeechBlob, new Tuple(false, new int[] { ModContent.BuffType() }) }, + { ModContent.NPCType(), new Tuple(false, CalamityMod.holyEnemyImmunities) }, { ModContent.NPCType(), new Tuple(false, CalamityMod.holyEnemyImmunities) }, { ModContent.NPCType(), new Tuple(false, CalamityMod.holyEnemyImmunities) }, diff --git a/Utilities/NPCUtils.cs b/Utilities/NPCUtils.cs index 2000f81f3e..2c1f909820 100644 --- a/Utilities/NPCUtils.cs +++ b/Utilities/NPCUtils.cs @@ -471,7 +471,6 @@ namespace CalamityMod target.AddBuff(BuffID.CursedInferno, (int)(120 * multiplier)); target.AddBuff(BuffType(), (int)(30 * multiplier)); target.AddBuff(BuffType(), (int)(120 * multiplier)); - target.AddBuff(BuffType(), (int)(60 * multiplier)); target.AddBuff(BuffType(), (int)(120 * multiplier)); target.AddBuff(BuffType(), (int)(120 * multiplier)); target.AddBuff(BuffID.Frostburn, (int)(120 * multiplier)); diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index 6daaa91ba2..42b6fcaac2 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -144,7 +144,6 @@ namespace CalamityMod { target.AddBuff(BuffType(), (int)(30 * multiplier)); target.AddBuff(BuffType(), (int)(120 * multiplier)); - target.AddBuff(BuffType(), (int)(60 * multiplier)); target.AddBuff(BuffType(), (int)(120 * multiplier)); target.AddBuff(BuffType(), (int)(120 * multiplier)); target.AddBuff(BuffID.CursedInferno, (int)(120 * multiplier));