diff --git a/CalPlayer/DrawLayers/AuricSetTrailLayer.cs b/CalPlayer/DrawLayers/AuricSetTrailLayer.cs index 5ba29d83b6..24c742e3de 100644 --- a/CalPlayer/DrawLayers/AuricSetTrailLayer.cs +++ b/CalPlayer/DrawLayers/AuricSetTrailLayer.cs @@ -9,7 +9,7 @@ namespace CalamityMod.CalPlayer.DrawLayers { public class AuricSetTrailLayer : PlayerDrawLayer { - public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.Head); + public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.LastVanillaLayer); public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) { diff --git a/CalPlayer/DrawLayers/CobaltSetTrailLayer.cs b/CalPlayer/DrawLayers/CobaltSetTrailLayer.cs index 75425a8ae5..0a8c3bfca5 100644 --- a/CalPlayer/DrawLayers/CobaltSetTrailLayer.cs +++ b/CalPlayer/DrawLayers/CobaltSetTrailLayer.cs @@ -9,7 +9,7 @@ namespace CalamityMod.CalPlayer.DrawLayers { public class CobaltSetTrailLayer : PlayerDrawLayer { - public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.Head); + public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.LastVanillaLayer); public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) { diff --git a/Items/Weapons/Magic/SHPC.cs b/Items/Weapons/Magic/SHPC.cs index 2285cc4aaf..0a159e0e32 100644 --- a/Items/Weapons/Magic/SHPC.cs +++ b/Items/Weapons/Magic/SHPC.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using System.Collections.Generic; using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.Magic @@ -92,6 +93,31 @@ namespace CalamityMod.Items.Weapons.Magic } } + public override void ModifyWeaponDamage(Player player, ref StatModifier damage) + { + // scaling legendary!!!! + if (Main.zenithWorld) + { + bool plantera = NPC.downedPlantBoss; + bool golem = NPC.downedGolemBoss; + bool cultist = NPC.downedAncientCultist; + bool moonLord = NPC.downedMoonlord; + bool providence = DownedBossSystem.downedProvidence; + bool devourerOfGods = DownedBossSystem.downedDoG; + bool yharon = DownedBossSystem.downedYharon; + float damageMult = 1f + + (plantera ? 0.1f : 0f) + //1.1 + (golem ? 0.15f : 0f) + //1.25 + (cultist ? 3.5f : 0f) + //4.75 + (moonLord ? 4.5f : 0f) + //9.25 + (providence ? 7.5f : 0f) + //16.75 + (devourerOfGods ? 2.5f : 0f) + //19.25 + (yharon ? 30f : 0f); //49.25 + damage *= damageMult; + } + } + public override void ModifyTooltips(List list) => list.FindAndReplace("[GFB]", this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal")); + public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Melee/Hellkite.cs b/Items/Weapons/Melee/Hellkite.cs index 6fcd9e41a9..ea16d36061 100644 --- a/Items/Weapons/Melee/Hellkite.cs +++ b/Items/Weapons/Melee/Hellkite.cs @@ -4,79 +4,131 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Tiles.Furniture.CraftingStations; +using System.Collections.Generic; +using CalamityMod.Rarities; namespace CalamityMod.Items.Weapons.Melee { public class Hellkite : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/WulfrumScrewdriverScrewHit") { Volume = 0.6f }; + public static float PitchSound = 1; public override void SetDefaults() { Item.width = 84; + Item.height = 84; + Item.scale = 1f; Item.damage = 180; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 30; - Item.useStyle = ItemUseStyleID.Swing; Item.useTime = 30; + Item.useStyle = ItemUseStyleID.Swing; Item.useTurn = true; Item.knockBack = 8f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; - Item.height = 84; Item.value = CalamityGlobalItem.Rarity7BuyPrice; Item.rare = ItemRarityID.Lime; } public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.NextBool(4)) + if (!Main.zenithWorld) + if (Main.rand.NextBool(4)) Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 174); } + public override bool CanUseItem(Player player) + { + if (Main.zenithWorld) + { + Item.width = 210; + Item.height = 210; + Item.scale = 2.5f; + Item.damage = 1369; + Item.DamageType = DamageClass.Melee; + Item.useTime = Item.useAnimation = 12; + Item.useStyle = ItemUseStyleID.Swing; + Item.useTurn = true; + Item.knockBack = 19f; + Item.UseSound = SoundID.Item1; + Item.autoReuse = true; + Item.rare = ModContent.RarityType(); + Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; + } + else + { + Item.width = 84; + Item.height = 84; + Item.scale = 1f; + Item.damage = 180; + Item.DamageType = DamageClass.Melee; + Item.useTime = Item.useAnimation = 30; + Item.useStyle = ItemUseStyleID.Swing; + Item.useTurn = true; + Item.knockBack = 8f; + Item.UseSound = SoundID.Item1; + Item.autoReuse = true; + Item.value = CalamityGlobalItem.Rarity7BuyPrice; + Item.rare = ItemRarityID.Lime; + } + return base.CanUseItem(player); + } + public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(BuffID.OnFire3, 300); - int onHitDamage = player.CalcIntDamage(Item.damage); - player.ApplyDamageToNPC(target, onHitDamage, 0f, 0, false); - float num50 = 1.7f; - float num51 = 0.8f; - float num52 = 2f; - Vector2 value3 = (target.rotation - 1.57079637f).ToRotationVector2(); - Vector2 value4 = value3 * target.velocity.Length(); - SoundEngine.PlaySound(SoundID.Item14, target.Center); - int num3; - for (int num53 = 0; num53 < 40; num53 = num3 + 1) + if (Main.zenithWorld) { - int num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 200, default, num50); - Dust dust = Main.dust[num54]; - dust.position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; - dust.noGravity = true; - dust.velocity.Y -= 6f; - dust.velocity *= 3f; - dust.velocity += value4 * Main.rand.NextFloat(); - num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 100, default, num51); - dust.position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; - dust.velocity.Y -= 6f; - dust.velocity *= 2f; - dust.noGravity = true; - dust.fadeIn = 1f; - dust.color = Color.Crimson * 0.5f; - dust.velocity += value4 * Main.rand.NextFloat(); - num3 = num53; + SoundEngine.PlaySound(UseSound with { Pitch = PitchSound * Main.rand.NextFloat(0.01f, 0.03f) }); } - for (int num55 = 0; num55 < 20; num55 = num3 + 1) + else { - int num56 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 0, default, num52); - Dust dust = Main.dust[num56]; - dust.position = target.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)target.velocity.ToRotation(), default) * (float)target.width / 3f; - dust.noGravity = true; - dust.velocity.Y -= 6f; - dust.velocity *= 0.5f; - dust.velocity += value4 * (0.6f + 0.6f * Main.rand.NextFloat()); - num3 = num55; + target.AddBuff(BuffID.OnFire3, 300); + int onHitDamage = player.CalcIntDamage(Item.damage); + player.ApplyDamageToNPC(target, onHitDamage, 0f, 0, false); + float num50 = 1.7f; + float num51 = 0.8f; + float num52 = 2f; + Vector2 value3 = (target.rotation - 1.57079637f).ToRotationVector2(); + Vector2 value4 = value3 * target.velocity.Length(); + SoundEngine.PlaySound(SoundID.Item14, target.Center); + int num3; + for (int num53 = 0; num53 < 40; num53 = num3 + 1) + { + int num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 200, default, num50); + Dust dust = Main.dust[num54]; + dust.position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; + dust.noGravity = true; + dust.velocity.Y -= 6f; + dust.velocity *= 3f; + dust.velocity += value4 * Main.rand.NextFloat(); + num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 100, default, num51); + dust.position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; + dust.velocity.Y -= 6f; + dust.velocity *= 2f; + dust.noGravity = true; + dust.fadeIn = 1f; + dust.color = Color.Crimson * 0.5f; + dust.velocity += value4 * Main.rand.NextFloat(); + num3 = num53; + } + for (int num55 = 0; num55 < 20; num55 = num3 + 1) + { + int num56 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 0, default, num52); + Dust dust = Main.dust[num56]; + dust.position = target.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)target.velocity.ToRotation(), default) * (float)target.width / 3f; + dust.noGravity = true; + dust.velocity.Y -= 6f; + dust.velocity *= 0.5f; + dust.velocity += value4 * (0.6f + 0.6f * Main.rand.NextFloat()); + num3 = num55; + } } } + public override void ModifyTooltips(List list) => list.FindAndReplace("[GFB]", this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal")); + public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) { target.AddBuff(BuffID.OnFire3, 300); @@ -85,7 +137,15 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { - CreateRecipe(). + CreateRecipe(). + AddCondition(new Condition("Get Fixed Boi", () => Main.zenithWorld)). + AddIngredient(ItemID.TitaniumSword). + AddIngredient(12). + AddTile(). + Register(); + + CreateRecipe(). + AddCondition(new Condition(" ", () => !Main.zenithWorld)). AddIngredient(ItemID.FieryGreatsword). AddIngredient(8). AddTile(TileID.MythrilAnvil). diff --git a/Items/Weapons/Summon/SpikecragStaff.cs b/Items/Weapons/Summon/SpikecragStaff.cs index 6beac6545a..a86ae07355 100644 --- a/Items/Weapons/Summon/SpikecragStaff.cs +++ b/Items/Weapons/Summon/SpikecragStaff.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using System.Collections.Generic; namespace CalamityMod.Items.Weapons.Summon { @@ -30,6 +31,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.shoot = ModContent.ProjectileType(); } + public override void ModifyTooltips(List list) => list.FindAndReplace("[GFB]", this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal")); + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { //CalamityUtils.OnlyOneSentry(player, type); @@ -39,5 +42,12 @@ namespace CalamityMod.Items.Weapons.Summon player.UpdateMaxTurrets(); return false; } + + public override void ModifyWeaponDamage(Player player, ref StatModifier damage) + { + bool superBuff = DownedBossSystem.downedProvidence && Main.zenithWorld; + float buffAMT = superBuff ? 3 : 1; + damage *= buffAMT; + } } } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index 5e818e2a75..ebec800b92 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -682,11 +682,13 @@ ShiftingSands: { SHPC: { DisplayName: SHPC - Tooltip: + Tooltip: "[GFB]" + TooltipNormal: ''' Fires plasma orbs that linger and emit massive explosions Press to fire powerful energy beams ''' + TooltipGFB: It scales again :) } SkyGlaze: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 8764d842dc..02ceea45ca 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -661,11 +661,13 @@ HellionFlowerSpear: { Hellkite: { DisplayName: Hellkite - Tooltip: + Tooltip: "[GFB]" + TooltipNormal: ''' Summons flame geyser explosions on enemy hits Contains the power of an ancient drake ''' + TooltipGFB: "'My Beloved <3'" } HolyCollider: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson index f822c9bc66..be40890024 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -603,7 +603,13 @@ SlimePuppetStaff: { SpikecragStaff: { DisplayName: Spikecrag Staff - Tooltip: Summons a spikecrag to protect you + Tooltip: "[GFB]" + TooltipNormal: Summons a spikecrag to protect you + TooltipGFB: + ''' + Summons a spikecrag to protect you" + Defeating the Profaned Goddess unlocks its true power + ''' } SquirrelSquireStaff: { diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index 5dc36b3ce2..650cef1892 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -358,4 +358,6 @@ PwnagehammerSmallExplosion.DisplayName: Pwnage Blast PwnagehammerExplosionSmall.DisplayName: Pwnage Blast PwnagehammerExplosionBig.DisplayName: Pwnage Blast GalaxySmasherMini.DisplayName: Galaxy Smasher -GalaxySmasherEcho.DisplayName: Galaxy Smasher Echo \ No newline at end of file +GalaxySmasherEcho.DisplayName: Galaxy Smasher Echo +StellarContemptBlast.DisplayName: Stellar Blast +GalaxySmasherBlast.DisplayName: Galactic Blast \ No newline at end of file diff --git a/NPCs/Other/THELORDE.cs b/NPCs/Other/THELORDE.cs index c29b5075f3..043e3bdc70 100644 --- a/NPCs/Other/THELORDE.cs +++ b/NPCs/Other/THELORDE.cs @@ -22,6 +22,9 @@ namespace CalamityMod.NPCs.Other public int aiSwitchCounter = 420; public int deathrayCounter = 0; public int invincibleCounter = 0; + public int squintTimer = 0; + public int cutsceneAnimation = -1; + public int frameToUse = 0; public bool ajitPaiDidNothingWrong = false; // christ this is old public bool canDespawn = false; @@ -29,6 +32,8 @@ namespace CalamityMod.NPCs.Other public bool hasBeenPlantera = false; public bool hasBeenGolem = false; + public bool Dying = false; + public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/Lordeath"); public override void SetStaticDefaults() @@ -38,6 +43,7 @@ namespace CalamityMod.NPCs.Other NPCID.Sets.DebuffImmunitySets.Add(Type, debuffData); NPCID.Sets.ShouldBeCountedAsBoss[Type] = true; this.HideFromBestiary(); + Main.npcFrameCount[NPC.type] = 7; } public override void SetDefaults() @@ -69,9 +75,13 @@ namespace CalamityMod.NPCs.Other writer.Write(urAMemeNow); writer.Write(hasBeenPlantera); writer.Write(hasBeenGolem); + writer.Write(Dying); writer.Write(invincibleCounter); writer.Write(aiSwitchCounter); writer.Write(deathrayCounter); + writer.Write(squintTimer); + writer.Write(cutsceneAnimation); + writer.Write(frameToUse); } public override void ReceiveExtraAI(BinaryReader reader) @@ -86,9 +96,13 @@ namespace CalamityMod.NPCs.Other urAMemeNow = reader.ReadBoolean(); hasBeenPlantera = reader.ReadBoolean(); hasBeenGolem = reader.ReadBoolean(); + Dying = reader.ReadBoolean(); invincibleCounter = reader.ReadInt32(); aiSwitchCounter = reader.ReadInt32(); deathrayCounter = reader.ReadInt32(); + squintTimer = reader.ReadInt32(); + cutsceneAnimation = reader.ReadInt32(); + frameToUse = reader.ReadInt32(); } public override void OnSpawn(IEntitySource source) @@ -115,6 +129,34 @@ namespace CalamityMod.NPCs.Other { NPC.alpha = 0; } + // Do the death animation once killed. + if (Dying) + { + NPC.velocity *= 0.9f; + NPC.rotation = MathHelper.Lerp(NPC.rotation, 0, 1f); + if (frameToUse >= 18) + { + NPC.active = false; + NPC.HitEffect(); + NPC.NPCLoot(); + SoundEngine.PlaySound(DeathSound with { Volume = 2 }, Main.LocalPlayer.Center); + NPC.netUpdate = true; + } + return; + } + // Trigger the death animation + else if (NPC.life <= 1 && invincibleCounter >= 6000) + { + NPC.life = 1; + if (!Dying) + { + frameToUse = 0; + Dying = true; + } + NPC.dontTakeDamage = true; + NPC.netUpdate = true; + return; + } if (Main.rand.NextBool(50)) { // old was zombie 1 - zombie 62 @@ -329,26 +371,108 @@ namespace CalamityMod.NPCs.Other } } + public override void FindFrame(int frameHeight) + { + if (Dying) + { + NPC.frameCounter++; + if (NPC.frameCounter > 4 && frameToUse < 18) + { + frameToUse++; + NPC.frameCounter = 0; + } + } + else + { + if (squintTimer > 0) + { + squintTimer--; + } + if (cutsceneAnimation > 0) + { + NPC.frameCounter++; + if (NPC.frameCounter > 6) + { + frameToUse++; + } + if (frameToUse > 13 || frameToUse < 6) + { + frameToUse = 6; + } + cutsceneAnimation--; + } + else + { + frameToUse = 0; + } + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { SpriteEffects spriteEffects = SpriteEffects.None; if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; Texture2D texture = ModContent.Request(Texture).Value; - Vector2 origin = new Vector2((float)(texture.Width / 2), (float)(texture.Height / 2)); + Rectangle frameUsed = texture.Frame(2, 7, 0, 1); // the idle frame by default + Rectangle squintFrame = texture.Frame(2, 7, 0, 0); + + int columnAmount = Dying ? 3 : 2; + Vector2 origin = new Vector2((float)(texture.Width / (2 * columnAmount)), (float)(texture.Height / 14)); Vector2 npcOffset = NPC.Center - screenPos; - npcOffset -= new Vector2((float)texture.Width, (float)texture.Height) * NPC.scale / 2f; + npcOffset -= new Vector2((float)texture.Width / columnAmount, (float)texture.Height / 7) * NPC.scale / 2f; npcOffset += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture, npcOffset, NPC.frame, drawColor, NPC.rotation, origin, NPC.scale, spriteEffects, 0f); + + if (Dying) + { + // death animation + texture = ModContent.Request("CalamityMod/NPCs/Other/THELORDEDEATH").Value; + int xFrame = 0; + int yFrame = frameToUse; + if (frameToUse > 13) + { + xFrame = 2; + yFrame = frameToUse - 12; + } + else if (frameToUse > 6) + { + xFrame = 1; + yFrame = frameToUse - 6; + } + frameUsed = texture.Frame(3, 7, xFrame, yFrame); + } + else + { + // use his glitching animation for 4 seconds upon reaching desperation + if (cutsceneAnimation > 0) + { + int xFrame = 0; + int yFrame = 6; + if (frameToUse > 6) + { + xFrame = 1; + yFrame = frameToUse - 6; + } + frameUsed = texture.Frame(2, 7, xFrame, yFrame); + } + // squiny if he should be squinting + else if (squintTimer > 0) + { + frameUsed = squintFrame; + } + } + spriteBatch.Draw(texture, npcOffset, frameUsed, drawColor, NPC.rotation, origin, NPC.scale, spriteEffects, 0f); return false; } public override void ModifyIncomingHit(ref NPC.HitModifiers modifiers) { + modifiers.SetMaxDamage(NPC.life - 1); // When struck below 1% HP, activates desperation and becomes essentially immune to damage. // The hit which causes this has its damage capped at 1, then THE LORDE heals for 1 so that it doesn't take any net damage. if ((double)NPC.life <= (double)NPC.lifeMax * 0.01f && invincibleCounter == 0 && !ajitPaiDidNothingWrong) { + cutsceneAnimation = 240; ajitPaiDidNothingWrong = true; modifiers.SetMaxDamage(1); NPC.life += 1; @@ -373,6 +497,7 @@ namespace CalamityMod.NPCs.Other // The hit which triggers antibutcher has its damage capped at 1, then THE LORDE heals for 1 so that it doesn't take any net damage. modifiers.SetMaxDamage(1); NPC.life += 1; + squintTimer = 120; } } @@ -392,6 +517,7 @@ namespace CalamityMod.NPCs.Other // The hit which triggers antibutcher has its damage capped at 1, then THE LORDE heals for 1 so that it doesn't take any net damage. modifiers.SetMaxDamage(1); NPC.life += 1; + squintTimer = 120; } } @@ -415,6 +541,20 @@ namespace CalamityMod.NPCs.Other return canDespawn; } + public override bool CheckDead() + { + NPC.life = 1; + if (!Dying && invincibleCounter >= 6000) + { + frameToUse = 0; + Dying = true; + } + NPC.active = true; + NPC.dontTakeDamage = true; + NPC.netUpdate = true; + return false; + } + public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float bossLifeScale, float anotherthing) { NPC.lifeMax = (int)(NPC.lifeMax * 0.5f * bossLifeScale); @@ -427,10 +567,5 @@ namespace CalamityMod.NPCs.Other npcLoot.AddIf(() => !(CalamityWorld.LegendaryMode && CalamityWorld.revenge), ModContent.ItemType(), 27); // otherwise 1 in 27 npcLoot.Add(ModContent.ItemType(), 1, 22, (int)(pisquaredover6 * 100)); } - - public override void OnKill() - { - SoundEngine.PlaySound(DeathSound with { Volume = 2 }, Main.LocalPlayer.Center); - } } } diff --git a/NPCs/Other/THELORDE.png b/NPCs/Other/THELORDE.png index c8730830b7..7ae02b14f1 100644 Binary files a/NPCs/Other/THELORDE.png and b/NPCs/Other/THELORDE.png differ diff --git a/NPCs/Other/THELORDEDEATH.png b/NPCs/Other/THELORDEDEATH.png new file mode 100644 index 0000000000..7e0e493904 Binary files /dev/null and b/NPCs/Other/THELORDEDEATH.png differ diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 0e391097b0..d3d6d376cb 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -2358,7 +2358,7 @@ namespace CalamityMod.Projectiles } } - if (player.meleeEnchant > 0 && !projectile.noEnchantments) + if (player.meleeEnchant > 0 && !projectile.noEnchantments && !projectile.noEnchantmentVisuals) { switch (player.meleeEnchant) { diff --git a/Projectiles/Melee/ArkOfTheAncients_ParryHoldout.cs b/Projectiles/Melee/ArkOfTheAncients_ParryHoldout.cs index 0c71f4b17a..f7ab888efa 100644 --- a/Projectiles/Melee/ArkOfTheAncients_ParryHoldout.cs +++ b/Projectiles/Melee/ArkOfTheAncients_ParryHoldout.cs @@ -34,6 +34,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.tileCollide = false; Projectile.friendly = true; Projectile.penetrate = -1; + Projectile.noEnchantmentVisuals = true; } public override bool? CanDamage() => Timer <= ParryTime && AlreadyParried == 0f; diff --git a/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs b/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs index ca7aac86d1..c210e44d3a 100644 --- a/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs +++ b/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs @@ -38,6 +38,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.tileCollide = false; Projectile.friendly = true; Projectile.penetrate = -1; + Projectile.noEnchantmentVisuals = true; } public override bool? CanDamage() => Timer <= ParryTime && AlreadyParried == 0f; diff --git a/Projectiles/Melee/ArkOfTheElements_ParryHoldout.cs b/Projectiles/Melee/ArkOfTheElements_ParryHoldout.cs index 09420a0796..016b0c85c2 100644 --- a/Projectiles/Melee/ArkOfTheElements_ParryHoldout.cs +++ b/Projectiles/Melee/ArkOfTheElements_ParryHoldout.cs @@ -37,6 +37,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.tileCollide = false; Projectile.friendly = true; Projectile.penetrate = -1; + Projectile.noEnchantmentVisuals = true; } public override bool? CanDamage() => Timer <= ParryTime && AlreadyParried == 0f; diff --git a/Projectiles/Melee/FallenBlast.cs b/Projectiles/Melee/FallenBlast.cs index 27e6972fec..079c70016e 100644 --- a/Projectiles/Melee/FallenBlast.cs +++ b/Projectiles/Melee/FallenBlast.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Projectiles.Melee { public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() => Main.projFrames[Type] = 8; - + private static float ExplosionRadius = 236f; + public override void SetDefaults() { Projectile.width = 472; @@ -38,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.Kill(); } - public override bool? CanDamage() => false; + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox); } } diff --git a/Projectiles/Melee/FallenPaladinsHammerEcho.cs b/Projectiles/Melee/FallenPaladinsHammerEcho.cs index 2feda808b7..4704e5ae1d 100644 --- a/Projectiles/Melee/FallenPaladinsHammerEcho.cs +++ b/Projectiles/Melee/FallenPaladinsHammerEcho.cs @@ -107,22 +107,9 @@ namespace CalamityMod.Projectiles.Melee else SoundEngine.PlaySound(SlamHamSound, Projectile.Center); Main.player[Projectile.owner].Calamity().GeneralScreenShakePower = 5; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); - float distance = 248f; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0f, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f); - for (int k = 0; k < Main.maxNPCs; k++) - { - NPC npc = Main.npc[k]; - Vector2 vec = npc.Center - Projectile.Center; - float distanceTo = (float)Math.Sqrt(vec.X * vec.X + vec.Y * vec.Y); - if (distanceTo < distance && npc.CanBeChasedBy(Projectile, false) && k != Projectile.localAI[0]) - { - float alldamage = Projectile.damage * 0.5f; - double damage = npc.StrikeNPC(npc.CalculateHitInfo((int)alldamage, Projectile.velocity.X > 0f ? 1 : -1, true, Projectile.knockBack)); - player.addDPS((int)damage); - } - } return false; } diff --git a/Projectiles/Melee/GalaxySmasherBlast.cs b/Projectiles/Melee/GalaxySmasherBlast.cs new file mode 100644 index 0000000000..6150711d81 --- /dev/null +++ b/Projectiles/Melee/GalaxySmasherBlast.cs @@ -0,0 +1,35 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class GalaxySmasherBlast : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public Player Owner => Main.player[Projectile.owner]; + private static float ExplosionRadius = 568f; + + public override void SetDefaults() + { + //These shouldn't matter because its circular + Projectile.width = 568; + Projectile.height = 568; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.MeleeNoSpeed; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.penetrate = -1; + Projectile.timeLeft = 2; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 10; + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox); + } +} diff --git a/Projectiles/Melee/GalaxySmasherEcho.cs b/Projectiles/Melee/GalaxySmasherEcho.cs index 20b87d8750..f3a680ecb4 100644 --- a/Projectiles/Melee/GalaxySmasherEcho.cs +++ b/Projectiles/Melee/GalaxySmasherEcho.cs @@ -133,20 +133,8 @@ namespace CalamityMod.Projectiles.Melee Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Aqua, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 1.5f, 11); GeneralParticleHandler.SpawnParticle(pulse2); - float distance = 568f; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0f, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f); - for (int k = 0; k < Main.maxNPCs; k++) - { - NPC npc = Main.npc[k]; - Vector2 vec = npc.Center - Projectile.Center; - float distanceTo = (float)Math.Sqrt(vec.X * vec.X + vec.Y * vec.Y); - if (distanceTo < distance && npc.CanBeChasedBy(Projectile, false) && k != Projectile.localAI[0]) - { - float alldamage = Projectile.damage * 0.5f; - double damage = npc.StrikeNPC(npc.CalculateHitInfo((int)alldamage, Projectile.velocity.X > 0f ? 1 : -1, true, Projectile.knockBack)); - player.addDPS((int)damage); - } - } return false; } diff --git a/Projectiles/Melee/PwnagehammerEcho.cs b/Projectiles/Melee/PwnagehammerEcho.cs index fb8483512b..d40065afb7 100644 --- a/Projectiles/Melee/PwnagehammerEcho.cs +++ b/Projectiles/Melee/PwnagehammerEcho.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Melee { public new string LocalizationCategory => "Projectiles.Melee"; public static readonly SoundStyle BigSound = new("CalamityMod/Sounds/Item/PwnagehammerBigImpact"); - public static readonly SoundStyle SlamHamSound = new("CalamityMod/Sounds/Item/TF2PanHit") { Volume = 1.1f }; + public static readonly SoundStyle Kunk = new("CalamityMod/Sounds/Item/TF2PanHit") { Volume = 1.1f }; public int Explodamage = 0; public override void SetStaticDefaults() { @@ -115,7 +115,11 @@ namespace CalamityMod.Projectiles.Melee Main.dust[dust].scale = 3f; } - SoundEngine.PlaySound(BigSound, Projectile.Center); + if (Main.zenithWorld) + SoundEngine.PlaySound(Kunk, Projectile.Center); + + else + SoundEngine.PlaySound(BigSound, Projectile.Center); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0f, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f); diff --git a/Projectiles/Melee/StellarContemptBlast.cs b/Projectiles/Melee/StellarContemptBlast.cs new file mode 100644 index 0000000000..819d4aaaf6 --- /dev/null +++ b/Projectiles/Melee/StellarContemptBlast.cs @@ -0,0 +1,35 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class StellarContemptBlast : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public Player Owner => Main.player[Projectile.owner]; + private static float ExplosionRadius = 336f; + + public override void SetDefaults() + { + //These shouldn't matter because its circular + Projectile.width = 336; + Projectile.height = 336; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.MeleeNoSpeed; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.penetrate = -1; + Projectile.timeLeft = 2; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 10; + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox); + } +} diff --git a/Projectiles/Melee/StellarContemptEcho.cs b/Projectiles/Melee/StellarContemptEcho.cs index 7e468ec4e1..2158bfc47b 100644 --- a/Projectiles/Melee/StellarContemptEcho.cs +++ b/Projectiles/Melee/StellarContemptEcho.cs @@ -128,54 +128,42 @@ namespace CalamityMod.Projectiles.Melee Main.dust[dust].velocity = velOffset; Main.dust[dust].scale = 3.8f; } - for (int i = 0; i < 88; ++i) - { - // Pick a random type of dust - int dustID; - switch (Main.rand.Next(6)) - { - case 0: - dustID = 229; - break; - case 1: - case 2: - dustID = 156; - break; - default: - dustID = 156; - break; - } - - // Choose a random speed and angle for the dust - float dustSpeed = Main.rand.NextFloat(6.0f, 29.0f); - float angleRandom = 0.09f; - Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); - dustVel = dustVel.RotatedBy(-angleRandom); - dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - - // Pick a size for the dust particle - float scale = Main.rand.NextFloat(2.2f, 4.8f); - - // Actually spawn the dust - int idx = Dust.NewDust(Projectile.Center, 1, 1, dustID, dustVel.X, dustVel.Y, 0, default, scale); - Main.dust[idx].noGravity = true; - Main.dust[idx].position = Projectile.Center; - } - - float distance = 336f; - - for (int k = 0; k < Main.maxNPCs; k++) - { - NPC npc = Main.npc[k]; - Vector2 vec = npc.Center - Projectile.Center; - float distanceTo = (float)Math.Sqrt(vec.X * vec.X + vec.Y * vec.Y); - if (distanceTo < distance && npc.CanBeChasedBy(Projectile, false) && k != Projectile.localAI[0]) + for (int i = 0; i < 88; ++i) { - float alldamage = Projectile.damage * 0.5f; - double damage = npc.StrikeNPC(npc.CalculateHitInfo((int)alldamage, Projectile.velocity.X > 0f ? 1 : -1, true, Projectile.knockBack)); - player.addDPS((int)damage); - } + // Pick a random type of dust + int dustID; + switch (Main.rand.Next(6)) + { + case 0: + dustID = 229; + break; + case 1: + case 2: + dustID = 156; + break; + default: + dustID = 156; + break; + } + + // Choose a random speed and angle for the dust + float dustSpeed = Main.rand.NextFloat(6.0f, 29.0f); + float angleRandom = 0.09f; + Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); + dustVel = dustVel.RotatedBy(-angleRandom); + dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); + + // Pick a size for the dust particle + float scale = Main.rand.NextFloat(2.2f, 4.8f); + + // Actually spawn the dust + int idx = Dust.NewDust(Projectile.Center, 1, 1, dustID, dustVel.X, dustVel.Y, 0, default, scale); + Main.dust[idx].noGravity = true; + Main.dust[idx].position = Projectile.Center; } + + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0f, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f); + return false; } diff --git a/Projectiles/Melee/TrueArkOfTheAncients_ParryHoldout.cs b/Projectiles/Melee/TrueArkOfTheAncients_ParryHoldout.cs index 7c908cca5c..4c8256f493 100644 --- a/Projectiles/Melee/TrueArkOfTheAncients_ParryHoldout.cs +++ b/Projectiles/Melee/TrueArkOfTheAncients_ParryHoldout.cs @@ -34,6 +34,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.tileCollide = false; Projectile.friendly = true; Projectile.penetrate = -1; + Projectile.noEnchantmentVisuals = true; } public override bool? CanDamage() => Timer <= ParryTime && AlreadyParried == 0f; diff --git a/Projectiles/Pets/LordePet.cs b/Projectiles/Pets/LordePet.cs index 5d2d6fbb25..047131313d 100644 --- a/Projectiles/Pets/LordePet.cs +++ b/Projectiles/Pets/LordePet.cs @@ -1,6 +1,8 @@ using CalamityMod.CalPlayer; using CalamityMod.NPCs.Other; using Terraria; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; @@ -52,7 +54,18 @@ namespace CalamityMod.Projectiles.Pets { SoundEngine.PlaySound(THELORDE.DeathSound with { PitchVariance = 2, MaxInstances = 5 }, Projectile.Center); } - //Projectile.rotation += (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y)) * 0.01f * (float)Projectile.direction; + } + + public override bool PreDraw(ref Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (Projectile.spriteDirection == 1) + spriteEffects = SpriteEffects.FlipHorizontally; + Texture2D texture = ModContent.Request(Texture).Value; + Rectangle frameUsed = texture.Frame(2, 7, 0, 1); + + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), frameUsed, drawColor, Projectile.rotation, new Vector2(texture.Width / 4f, texture.Height / 14f), Projectile.scale, spriteEffects, 0); + return false; } } } diff --git a/Projectiles/Summon/Spikecrag.cs b/Projectiles/Summon/Spikecrag.cs index f63b9fdba8..942026f0a2 100644 --- a/Projectiles/Summon/Spikecrag.cs +++ b/Projectiles/Summon/Spikecrag.cs @@ -78,6 +78,10 @@ namespace CalamityMod.Projectiles.Summon if ((Projectile.ai[1] % 10f) == 0f) { int amount = Main.rand.Next(2, 4); + if (DownedBossSystem.downedProvidence && Main.zenithWorld) // spikecrag gfb buff + { + amount += 6; + } for (int i = 0; i < amount; i++) { float velocityX = Main.rand.NextFloat(-10f, 10f); diff --git a/Projectiles/Summon/SpikecragSpike.cs b/Projectiles/Summon/SpikecragSpike.cs index da08e71006..fd46ee25c1 100644 --- a/Projectiles/Summon/SpikecragSpike.cs +++ b/Projectiles/Summon/SpikecragSpike.cs @@ -2,6 +2,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Summon { @@ -31,5 +32,13 @@ namespace CalamityMod.Projectiles.Summon Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; Projectile.velocity.Y += 0.1f; } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (Main.zenithWorld) + { + target.AddBuff(ModContent.BuffType(), 180); + } + } } }