diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index ec89f724c1..ad69307241 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -252,8 +252,7 @@ namespace CalamityMod.Balancing NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), Do(new ProjectileResistBalancingRule(0.85f, ProjectileType())))); // 5% resist to Old Reaper. - NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), Do(new ProjectileResistBalancingRule(0.95f, ProjectileType())))); - + //NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), Do(new ProjectileResistBalancingRule(0.95f, ProjectileType())))); #endregion #region Exo Mechs: Ares diff --git a/CalPlayer/DrawLayers/AscendedTrailLayer.cs b/CalPlayer/DrawLayers/AscendedTrailLayer.cs index fcc533e52a..3ec0408121 100644 --- a/CalPlayer/DrawLayers/AscendedTrailLayer.cs +++ b/CalPlayer/DrawLayers/AscendedTrailLayer.cs @@ -35,7 +35,7 @@ namespace CalamityMod.CalPlayer.DrawLayers { var drawData = existingDrawData[j]; drawData.position = existingDrawData[j].position - drawPlayer.position + drawPlayer.oldPosition; - drawData.color = new Color(155, 228, 232) * opacity; + drawData.color = Color.Khaki * opacity; drawData.scale = new Vector2(scale); afterimages.Add(drawData); } diff --git a/Cooldowns/AscendEffect.cs b/Cooldowns/AscendEffect.cs index 6645662af5..99a510e208 100644 --- a/Cooldowns/AscendEffect.cs +++ b/Cooldowns/AscendEffect.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Cooldowns public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}"); public override string Texture => "CalamityMod/Cooldowns/AscendEffect"; public override Color OutlineColor => new Color(50, 50, 50); - public override Color CooldownStartColor => new Color(37, 116, 166); - public override Color CooldownEndColor => new Color(155, 228, 232); + public override Color CooldownStartColor => Color.LightGreen; + public override Color CooldownEndColor => Color.Khaki; public override SoundStyle? EndSound => new("CalamityMod/Sounds/Item/AscendantOff"); } diff --git a/Cooldowns/AscendEffect.png b/Cooldowns/AscendEffect.png index 80b1ff5f3e..a0ec3de756 100644 Binary files a/Cooldowns/AscendEffect.png and b/Cooldowns/AscendEffect.png differ diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index f7419c2e90..4af5ea84f2 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -186,6 +186,7 @@ namespace CalamityMod.Effects #region Amber's Shaders internal static Effect PrimitiveClearShader; internal static Effect HolyInfernoShader; + internal static Effect DeerclopsShadowShader; #endregion // Shorthand to register a loaded shader in Terraria's graphics engine @@ -392,9 +393,12 @@ namespace CalamityMod.Effects PrimitiveClearShader = LoadShader("PrimitiveClearShader"); RegisterScreenShader(PrimitiveClearShader, "AutoloadPass", "PrimitiveClearShader"); - HolyInfernoShader = LoadShader("HolyInfernoShader"); + HolyInfernoShader = LoadShader("ScreenShaders/HolyInfernoShader"); RegisterMiscShader(HolyInfernoShader, "InfernoPass", "HolyInfernoShader"); + DeerclopsShadowShader = LoadShader("ScreenShaders/DeerclopsShadowShader"); + RegisterMiscShader(DeerclopsShadowShader, "ShadowPass", "DeerclopsShadowShader"); + #endregion } } diff --git a/Effects/ScreenShaders/DeerclopsShadowShader.fx b/Effects/ScreenShaders/DeerclopsShadowShader.fx new file mode 100644 index 0000000000..47273956fe --- /dev/null +++ b/Effects/ScreenShaders/DeerclopsShadowShader.fx @@ -0,0 +1,52 @@ +float minRadius; +float maxRadius; +float maxOpacity; + +float2 screenPosition; +float2 screenSize; +float2 anchorPoint; + +float InverseLerp(float a, float b, float t) +{ + return saturate((t - a) / (b - a)); +} + +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 uv : TEXCOORD0) : COLOR0 +{ + float2 worldUV = screenPosition + screenSize * uv; + float2 deerclopsUV = anchorPoint / screenSize; + float worldDistance = distance(worldUV, anchorPoint); + + // Get the distance to the pixel from Deerclops + float distToDeerclops = distance(anchorPoint, worldUV); + // And get the correct opacity based on it. + float opacity = InverseLerp(0, maxRadius, distToDeerclops); + + // Define the border and mix the shadow and light for a smoother transition + bool border = worldDistance < minRadius && opacity > 0; + float colorMult = 1; + + if (worldDistance > minRadius && worldDistance < maxRadius) + opacity = lerp(opacity, maxOpacity, InverseLerp(minRadius, maxRadius, distToDeerclops)); + + opacity = clamp(opacity, 0, maxOpacity); + + if (border) + { + colorMult = InverseLerp(minRadius * 0.94, minRadius, worldDistance); + } + + // If the color multi has not been changed (not border pixel) and opacity is 0 OR it's within + if (colorMult == 1 && (opacity == 0 || worldDistance < minRadius)) + return sampleColor; + + return float4(0, 0, 0, 1) * colorMult * opacity; +} + +technique Technique1 +{ + pass ShadowPass + { + PixelShader = compile ps_2_0 PixelShaderFunction(); + } +} \ No newline at end of file diff --git a/Effects/ScreenShaders/DeerclopsShadowShader.xnb b/Effects/ScreenShaders/DeerclopsShadowShader.xnb new file mode 100644 index 0000000000..8703cff449 Binary files /dev/null and b/Effects/ScreenShaders/DeerclopsShadowShader.xnb differ diff --git a/Effects/HolyInfernoShader.fx b/Effects/ScreenShaders/HolyInfernoShader.fx similarity index 100% rename from Effects/HolyInfernoShader.fx rename to Effects/ScreenShaders/HolyInfernoShader.fx diff --git a/Effects/HolyInfernoShader.xnb b/Effects/ScreenShaders/HolyInfernoShader.xnb similarity index 100% rename from Effects/HolyInfernoShader.xnb rename to Effects/ScreenShaders/HolyInfernoShader.xnb diff --git a/Graphics/Drawers/DeerclopsShadowDrawer.cs b/Graphics/Drawers/DeerclopsShadowDrawer.cs new file mode 100644 index 0000000000..afe1284ed0 --- /dev/null +++ b/Graphics/Drawers/DeerclopsShadowDrawer.cs @@ -0,0 +1,69 @@ +using CalamityMod.NPCs.VanillaNPCOverrides.Bosses; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; +using Rectangle = Microsoft.Xna.Framework.Rectangle; + +namespace CalamityMod.Graphics.Drawers +{ + public class DeerclopsShadowDrawer : BaseDrawer + { + #region Fields/Properties + + public override DrawerLayer Layer => DrawerLayer.AfterEverything; + + public NPC deerclops => Main.npc[NPC.deerclopsBoss]; + + //Should only draw if not in the main menu, deerclops is active or the border is fading post-death, + //it's rev+ and the boolean for drawing the border is true. + public override bool ShouldDraw => !Main.gameMenu && DeerclopsAI.borderScalar > 0f && DeerclopsAI.shouldDrawEnrageBorder; + #endregion + + #region Methods + public override void DrawToTarget(SpriteBatch spriteBatch) + { + bool shouldDraw; + bool deerclopsInactive = false; + if (NPC.deerclopsBoss >= 0 && NPC.deerclopsBoss.WithinBounds(Main.npc.Length)) + shouldDraw = deerclops.HasValidTarget; + else + { + shouldDraw = DeerclopsAI.borderScalar > 0f; + deerclopsInactive = true; + } + if (shouldDraw) + { + var minRadius = DeerclopsAI.innerBorder; + var maxRadius = DeerclopsAI.outerBorder; + + //Begin drawing the shadow + var blackTile = TextureAssets.MagicPixel; + + var shader = GameShaders.Misc["CalamityMod:DeerclopsShadowShader"].Shader; + shader.Parameters["minRadius"].SetValue(minRadius); + shader.Parameters["maxRadius"].SetValue(maxRadius); + shader.Parameters["anchorPoint"].SetValue(DeerclopsAI.lastDeerclopsPosition); + shader.Parameters["screenPosition"].SetValue(Main.screenPosition); + shader.Parameters["screenSize"].SetValue(Main.ScreenSize.ToVector2()); + shader.Parameters["maxOpacity"].SetValue(DeerclopsAI.borderScalar); + + + spriteBatch.EnterShaderRegion(BlendState.NonPremultiplied, shader); + Rectangle rekt = new(Main.screenWidth / 2, Main.screenHeight / 2, Main.screenWidth, Main.screenHeight); + spriteBatch.Draw(blackTile.Value, rekt, null, default, 0f, blackTile.Value.Size() * 0.5f, 0, 0f); + //Shadow drawing complete + spriteBatch.ExitShaderRegion(); + } + if (deerclopsInactive) + { + //Push the border away and fade out when deerclops is deadge + DeerclopsAI.borderScalar = MathHelper.Clamp(DeerclopsAI.borderScalar - 0.015f, 0f, 1f); + DeerclopsAI.innerBorder += 30f; + DeerclopsAI.outerBorder += 30f; + } + } + #endregion + } +} diff --git a/Graphics/Drawers/HolyInfernoDrawer.cs b/Graphics/Drawers/HolyInfernoDrawer.cs index b4b863bd81..485db764bf 100644 --- a/Graphics/Drawers/HolyInfernoDrawer.cs +++ b/Graphics/Drawers/HolyInfernoDrawer.cs @@ -1,5 +1,6 @@ using CalamityMod.NPCs; using CalamityMod.NPCs.Providence; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.GameContent; @@ -31,6 +32,7 @@ namespace CalamityMod.Graphics.Drawers { var target = Main.player[Main.myPlayer]; var holyInfernoIntensity = target.Calamity().holyInfernoFadeIntensity; + var prov = Provi; //Begin drawing the inferno var blackTile = TextureAssets.MagicPixel; @@ -38,6 +40,13 @@ namespace CalamityMod.Graphics.Drawers var upwardPerlinNoise = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/Perlin"); var upwardNoise = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/MeltyNoise"); + var maxOpacity = 1f; + if (prov.Dying) + { + //Death animation timer ends at 345f. + maxOpacity = MathHelper.Lerp(1f, 0f, Utils.GetLerpValue(0f, 344f, prov.DeathAnimationTimer)); + } + var shader = GameShaders.Misc["CalamityMod:HolyInfernoShader"].Shader; shader.Parameters["colorMult"].SetValue(Main.dayTime ? 7.35f : 7.65f); //I want you to know it took considerable restraint to deliberately misspell colour. shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly); @@ -47,7 +56,7 @@ namespace CalamityMod.Graphics.Drawers shader.Parameters["screenSize"].SetValue(Main.ScreenSize.ToVector2()); shader.Parameters["burnIntensity"].SetValue(holyInfernoIntensity); shader.Parameters["playerPosition"].SetValue(target.Center); - shader.Parameters["maxOpacity"].SetValue(1f); + shader.Parameters["maxOpacity"].SetValue(maxOpacity); shader.Parameters["day"].SetValue(Main.dayTime); spriteBatch.GraphicsDevice.Textures[1] = diagonalNoise.Value; diff --git a/Items/Accessories/AscendantInsignia.cs b/Items/Accessories/AscendantInsignia.cs index 8c9183a3ac..1f721dc2a5 100644 --- a/Items/Accessories/AscendantInsignia.cs +++ b/Items/Accessories/AscendantInsignia.cs @@ -7,6 +7,7 @@ using Terraria.ModLoader; using System; using System.Collections.Generic; using CalamityMod.Items.Placeables.Ores; +using CalamityMod.Items.Placeables; namespace CalamityMod.Items.Accessories { @@ -35,8 +36,8 @@ namespace CalamityMod.Items.Accessories { CreateRecipe(). AddIngredient(ItemID.EmpressFlightBooster). - AddIngredient(5). - AddIngredient(12). + AddIngredient(5). + AddIngredient(ItemID.SoulofFlight, 10). AddIngredient(5). AddTile(TileID.LunarCraftingStation). Register(); diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 9ace010759..7e40374264 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -699,10 +699,8 @@ namespace CalamityMod.Items if (item.type == ItemID.TerrasparkBoots) EditTooltipByNum(3, (line) => line.Text += "\nImmunity to the On Fire! debuff"); - // IT'S HELLFIRE!!! - if (item.type == ItemID.MagmaStone || item.type == ItemID.LavaSkull || item.type == ItemID.MoltenSkullRose) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("fire damage", "Hellfire")); - + // Ozzatron 23NOV2023: Removed tooltip edits for Magma Skull and Molten Skull Rose, as they were invalid after vanilla tooltip changes. + // Yoyo Glove/Bag apply a 0.5x damage multiplier on the second yoyo if (item.type == ItemID.YoyoBag || item.type == ItemID.YoYoGlove) EditTooltipByNum(0, (line) => line.Text += "\nSecondary yoyos will do 50% less damage"); diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 14a2f957ce..9bde51a84f 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -108,8 +108,8 @@ namespace CalamityMod.Items { ItemID.Flamarang, Do(DamageExact(43)) }, { ItemID.Flamelash, Do(DamageRatio(1.25f)) }, { ItemID.Flamethrower, Do(DamageExact(24), ShootSpeedDelta(+3f)) }, - { ItemID.FlowerofFire, Do(AutoReuse, ManaExact(7), UseRatio(0.88f)) }, // Uses ratios due to remix seed - { ItemID.FlowerofFrost, Do(AutoReuse, ManaExact(7), UseExact(30), DamageExact(70), ShootSpeedExact(14)) }, + { ItemID.FlowerofFire, Do(AutoReuse, ManaExact(7), UseRatio(0.88f), DamageRatio(0.65f)) }, // Uses ratios due to remix seed + { ItemID.FlowerofFrost, Do(AutoReuse, ManaExact(7), UseExact(22), DamageExact(70), ShootSpeedExact(14)) }, { ItemID.FlyingKnife, Do(DamageExact(53)) }, { ItemID.Frostbrand, Do(UseMeleeSpeed, DamageExact(88)) }, { ItemID.FrostStaff, Do(DamageExact(160), UseExact(37), ShootSpeedExact(20f)) }, // has 1 extra update @@ -190,6 +190,7 @@ namespace CalamityMod.Items { ItemID.Rally, Do(AutoReuse, DamageExact(18)) }, { ItemID.RainbowGun, Do(DamageExact(60), ManaExact(40)) }, { ItemID.RavenStaff, Do(AutoReuse, UseExact(20), DamageExact(36)) }, + { ItemID.RazorbladeTyphoon, Do(DamageExact(103)) }, { ItemID.Razorpine, Do(DamageExact(40)) }, { ItemID.RedPhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) }, { ItemID.RedPhasesaber, Do(ScaleRatio(1.5f), DamageExact(60)) }, @@ -199,6 +200,7 @@ namespace CalamityMod.Items { ItemID.RocketIV, Do(DamageRatio(0.75f)) }, { ItemID.Sandgun, Do(PointBlank, DamageExact(22), UseExact(20)) }, { ItemID.SapphireStaff, Do(DamageExact(25)) }, + { ItemID.SDMG, Do(PointBlank, DamageExact(80)) }, { ItemID.Seedler, Do(UseMeleeSpeed, DamageRatio(1.5f)) }, { ItemID.ShadowbeamStaff, Do(DamageExact(100)) }, { ItemID.ShadowFlameBow, Do(PointBlank, DamageExact(55)) }, @@ -444,7 +446,6 @@ namespace CalamityMod.Items { ItemID.QuadBarrelShotgun, pointBlank }, { ItemID.Revolver, Do(PointBlank, AutoReuse) }, { ItemID.RichMahoganyBow, pointBlank }, - { ItemID.SDMG, pointBlank }, { ItemID.ShadewoodBow, pointBlank }, { ItemID.SilverBow, pointBlank }, { ItemID.SniperRifle, pointBlank }, diff --git a/Items/Weapons/Magic/ShadowboltStaff.cs b/Items/Weapons/Magic/ShadowboltStaff.cs index 954d1feef3..755f497ea1 100644 --- a/Items/Weapons/Magic/ShadowboltStaff.cs +++ b/Items/Weapons/Magic/ShadowboltStaff.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - Item.damage = 300; + Item.damage = 280; Item.DamageType = DamageClass.Magic; Item.mana = 20; Item.width = 58; diff --git a/Items/Weapons/Melee/BladecrestOathsword.cs b/Items/Weapons/Melee/BladecrestOathsword.cs index 12f066d502..931e3562c0 100644 --- a/Items/Weapons/Melee/BladecrestOathsword.cs +++ b/Items/Weapons/Melee/BladecrestOathsword.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 56; Item.height = 56; - Item.damage = 25; + Item.damage = 26; Item.DamageType = DamageClass.Melee; Item.useAnimation = 21; Item.useTime = 21; diff --git a/Items/Weapons/Ranged/Disseminator.cs b/Items/Weapons/Ranged/Disseminator.cs index 9cf80321e1..d96ddb02bd 100644 --- a/Items/Weapons/Ranged/Disseminator.cs +++ b/Items/Weapons/Ranged/Disseminator.cs @@ -12,12 +12,12 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 52; + Item.damage = 48; Item.DamageType = DamageClass.Ranged; Item.width = 66; Item.height = 24; - Item.useTime = 30; - Item.useAnimation = 30; + Item.useTime = 35; + Item.useAnimation = 35; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 4.5f; diff --git a/Items/Weapons/Ranged/PridefulHuntersPlanarRipper.cs b/Items/Weapons/Ranged/PridefulHuntersPlanarRipper.cs index ce3f872c99..80c4521c87 100644 --- a/Items/Weapons/Ranged/PridefulHuntersPlanarRipper.cs +++ b/Items/Weapons/Ranged/PridefulHuntersPlanarRipper.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 86; + Item.damage = 74; Item.DamageType = DamageClass.Ranged; Item.width = 68; Item.height = 32; diff --git a/Items/Weapons/Ranged/Shredder.cs b/Items/Weapons/Ranged/Shredder.cs index 5ce8c27cb6..b39984c764 100644 --- a/Items/Weapons/Ranged/Shredder.cs +++ b/Items/Weapons/Ranged/Shredder.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 27; + Item.damage = 24; Item.DamageType = DamageClass.Ranged; Item.width = 56; Item.height = 24; diff --git a/Items/Weapons/Ranged/SpeedBlaster.cs b/Items/Weapons/Ranged/SpeedBlaster.cs index 793fc210c8..59c4a6efcd 100644 --- a/Items/Weapons/Ranged/SpeedBlaster.cs +++ b/Items/Weapons/Ranged/SpeedBlaster.cs @@ -34,8 +34,8 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.damage = 40; Item.DamageType = DamageClass.Ranged; - Item.width = 54; - Item.height = 26; + Item.width = 52; + Item.height = 30; Item.useTime = Item.useAnimation = 10; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; diff --git a/Items/Weapons/Ranged/SpeedBlaster.png b/Items/Weapons/Ranged/SpeedBlaster.png index df74da69d0..173acf24b5 100644 Binary files a/Items/Weapons/Ranged/SpeedBlaster.png and b/Items/Weapons/Ranged/SpeedBlaster.png differ diff --git a/Items/Weapons/Ranged/Starfleet.cs b/Items/Weapons/Ranged/Starfleet.cs index 16d43056eb..28f752ecb9 100644 --- a/Items/Weapons/Ranged/Starfleet.cs +++ b/Items/Weapons/Ranged/Starfleet.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 68; + Item.damage = 56; Item.DamageType = DamageClass.Ranged; Item.width = 76; Item.height = 36; diff --git a/Items/Weapons/Rogue/Exorcism.png b/Items/Weapons/Rogue/Exorcism.png index b2cd5cf9a8..0011f65c8d 100644 Binary files a/Items/Weapons/Rogue/Exorcism.png and b/Items/Weapons/Rogue/Exorcism.png differ diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index d848ddaca9..9a9262749c 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -5235,6 +5235,15 @@ namespace CalamityMod.NPCs #region On Spawn public override void OnSpawn(NPC npc, IEntitySource source) { + if (npc.type == NPCID.Deerclops) + { + DeerclopsAI.hasTargetBeenInRange = false; + DeerclopsAI.borderDelay = 7f * 60f; + DeerclopsAI.borderScalar = 0f; + DeerclopsAI.innerBorder = DeerclopsAI.maxDRIncreaseDistance * 5f; + DeerclopsAI.outerBorder = DeerclopsAI.maxDRIncreaseDistance * 5f; + } + if (npc.type != NPCID.VoodooDemon) return; diff --git a/NPCs/VanillaNPCOverrides/Bosses/DeerclopsAI.cs b/NPCs/VanillaNPCOverrides/Bosses/DeerclopsAI.cs index 68384698a0..0060be5143 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/DeerclopsAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/DeerclopsAI.cs @@ -1,8 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Events; -using CalamityMod.World; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.DataStructures; @@ -11,13 +7,23 @@ using Terraria.Graphics.CameraModifiers; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; -using CalamityMod.Projectiles.Boss; -using CalamityMod.NPCs.TownNPCs; +using CalamityMod.World; namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { public static class DeerclopsAI { + public static bool shouldDrawEnrageBorder = true; + public static bool hasTargetBeenInRange = true; + public const float increaseDRTriggerDistance = 450f; + public const float maxDRIncreaseDistance = 900f; + public static float borderDelay = 10f * 60f; + public static float innerBorder = 450f; + public static float outerBorder = 900f; + public static float borderScalar = 0f; + public static Vector2 lastDeerclopsPosition; + + public static bool BuffedDeerclopsAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -46,14 +52,16 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses bool goHome = false; // Damage resistance based on distance from target - float increaseDRTriggerDistance = 450f; - float maxDRIncreaseDistance = 900f; float distanceFromTarget = npc.Distance(targetData.Center); bool triggerDRIncrease = distanceFromTarget >= increaseDRTriggerDistance; float resistDamageAmount = MathHelper.Clamp((distanceFromTarget - increaseDRTriggerDistance) / (maxDRIncreaseDistance - increaseDRTriggerDistance), 0f, 1f); npc.localAI[3] = MathHelper.Lerp(0f, 30f, resistDamageAmount); float dustAndDRScalar = Utils.Remap(npc.localAI[3], 0f, 30f, 0f, 1f); calamityGlobalNPC.DR = MathHelper.Lerp(0.05f, 0.9f, dustAndDRScalar); + + if (borderDelay > 0f) + borderDelay -= 1f; + if (dustAndDRScalar > 0f) { float invincibleDustAmount = Main.rand.NextFloat() * dustAndDRScalar * 3f; @@ -63,6 +71,33 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Dust.NewDustDirect(npc.position, npc.width, npc.height, 109, 0f, -3f, 0, default(Color), 1.4f).noGravity = true; } } + else if (!hasTargetBeenInRange) + { + //Target entered the border for the first time + hasTargetBeenInRange = true; + if (borderDelay > 120f) + borderDelay = 120f; + } + if (innerBorder != increaseDRTriggerDistance || maxDRIncreaseDistance != outerBorder) + { + //Adjust the border IF the new value is lower (helps prevent jumping if you enter the border early while it's on screen but not finished zooming in) + var LerpValue = Utils.GetLerpValue(hasTargetBeenInRange ? 120f : 180f, 0f, borderDelay, true); + var newInner = MathHelper.Lerp(maxDRIncreaseDistance * 5f, increaseDRTriggerDistance, LerpValue); + if (newInner < innerBorder) + innerBorder = newInner; + var newOuter = MathHelper.Lerp(maxDRIncreaseDistance * 5f, maxDRIncreaseDistance, LerpValue); + if (newOuter < outerBorder) + outerBorder = newOuter; + } + if ((hasTargetBeenInRange && borderScalar < 1f) || borderDelay > 0f) + { + //fade in, with full opacity only available after being inside the border for the first time + borderScalar = MathHelper.Clamp(borderScalar + 0.015f, 0f, hasTargetBeenInRange ? 1f : 0.9f); + } + shouldDrawEnrageBorder = CalamityWorld.revenge || CalamityWorld.death; + + //Set the last deerclops position (used only for post-death border shenanigans) + lastDeerclopsPosition = npc.Center; // Spawn settings if (npc.homeTileX == -1 && npc.homeTileY == -1) diff --git a/Projectiles/Melee/BladecrestOathswordProj.cs b/Projectiles/Melee/BladecrestOathswordProj.cs index 95a066dcd5..110a0ce3bd 100644 --- a/Projectiles/Melee/BladecrestOathswordProj.cs +++ b/Projectiles/Melee/BladecrestOathswordProj.cs @@ -153,7 +153,7 @@ namespace CalamityMod.Projectiles.Melee shadowflame.noGravity = true; } - if (Main.myPlayer == Projectile.owner && Owner.itemAnimation % 4 == 3 && Owner.itemAnimation < Owner.itemAnimationMax - 3) + if (Main.myPlayer == Projectile.owner && Owner.itemAnimation % 5 == 3 && Owner.itemAnimation < Owner.itemAnimationMax - 3) { Vector2 bloodScytheShootVelocity = (Projectile.rotation - MathHelper.PiOver4).ToRotationVector2(); bloodScytheShootVelocity.Y *= 0.04f; diff --git a/Projectiles/Melee/BloodScythe.cs b/Projectiles/Melee/BloodScythe.cs index 80313228dd..5a760e6f83 100644 --- a/Projectiles/Melee/BloodScythe.cs +++ b/Projectiles/Melee/BloodScythe.cs @@ -37,8 +37,8 @@ namespace CalamityMod.Projectiles.Melee if (potentialTarget != null && Projectile.timeLeft >= 480) { float flySpeed = Projectile.velocity.Length(); - if (flySpeed < 8f) - flySpeed = 8f; + if (flySpeed < 10f) + flySpeed = 10f; Projectile.Center = Projectile.Center.MoveTowards(potentialTarget.Center, 1.75f); Projectile.velocity = (Projectile.velocity * 14f + Projectile.SafeDirectionTo(potentialTarget.Center) * flySpeed) / 15f; diff --git a/Projectiles/Rogue/ExorcismStar.png b/Projectiles/Rogue/ExorcismStar.png index 732c6787ba..e31c55bba6 100644 Binary files a/Projectiles/Rogue/ExorcismStar.png and b/Projectiles/Rogue/ExorcismStar.png differ diff --git a/Projectiles/Typeless/AscendantAura.cs b/Projectiles/Typeless/AscendantAura.cs index 4ed4cf0aa7..6e5b32dcc9 100644 --- a/Projectiles/Typeless/AscendantAura.cs +++ b/Projectiles/Typeless/AscendantAura.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Projectiles.Typeless { public new string LocalizationCategory => "Projectiles.Typeless"; public Player Owner => Main.player[Projectile.owner]; - + public float beamWidth = 1.04f; + public bool beamsize = false; public CalamityPlayer moddedOwner => Owner.Calamity(); public override void SetStaticDefaults() @@ -35,6 +36,18 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { + if (beamWidth <= 0.96f) + { + beamsize = true; + } + if (beamWidth >= 1.04f) + { + beamsize = false; + } + beamWidth += (beamsize ? 0.015f : -0.015f); + + Projectile.scale = beamWidth; + if (Projectile.timeLeft >= 240) { int dustAmount = 200; @@ -43,19 +56,19 @@ namespace CalamityMod.Projectiles.Typeless float angle = MathHelper.TwoPi / dustAmount * d; Vector2 velocity = angle.ToRotationVector2() * Main.rand.NextFloat(5f, 40f); - Dust spawnDust = Dust.NewDustPerfect(Owner.Center, 206, velocity); + Dust spawnDust = Dust.NewDustPerfect(Projectile.Center, 204, velocity); spawnDust.noGravity = true; - spawnDust.scale = velocity.Length() * 0.15f; + spawnDust.scale = velocity.Length() * 0.05f; spawnDust.velocity *= 0.4f; } } // Stay on the player's head - Projectile.Center = Owner.Center - Vector2.UnitY * 45f - Owner.velocity * 0.7f; + Projectile.Center = (Owner.MountedCenter + new Vector2(0, -45)); Vector2 spawnPos = Projectile.Center + Main.rand.NextVector2Circular(5, 5); int lifetime = Main.rand.Next(3, 6); float scale = Main.rand.NextFloat(0.5f, 0.9f); - Color color = Main.rand.NextBool(3) ? Color.DeepSkyBlue : Color.LightSkyBlue; + Color color = Main.rand.NextBool(3) ? Color.LightGreen : Color.Khaki; SparkParticle spark1 = new SparkParticle(spawnPos, new Vector2(Main.rand.NextFloat(7, 12), Main.rand.NextFloat(7, 12)), false, lifetime, scale, color); GeneralParticleHandler.SpawnParticle(spark1); SparkParticle spark2 = new SparkParticle(spawnPos, new Vector2(Main.rand.NextFloat(-7, -12), Main.rand.NextFloat(7, 12)), false, lifetime, scale, color); @@ -70,7 +83,7 @@ namespace CalamityMod.Projectiles.Typeless GeneralParticleHandler.SpawnParticle(spark6); // Emit some light - Vector3 Light = new Vector3(0.015f, 0.157f, 0.247f); + Vector3 Light = new Vector3(0.251f, 0.255f, 0.219f); Lighting.AddLight(Projectile.Center, Light * 5); } public override void OnKill(int timeLeft) @@ -81,10 +94,10 @@ namespace CalamityMod.Projectiles.Typeless { float rot = MathHelper.ToRadians(i * rotFactor); Vector2 offset = new Vector2(8f, 0).RotatedBy(rot); - Vector2 velOffset = new Vector2(4f, 0).RotatedBy(rot); - Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, 206, new Vector2(velOffset.X, velOffset.Y)); + Vector2 velOffset = new Vector2(2.5f, 0).RotatedBy(rot); + Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, 204, new Vector2(velOffset.X, velOffset.Y)); dust.noGravity = true; - dust.velocity = velOffset; + dust.velocity = velOffset * Main.rand.NextFloat(0.9f, 1.1f); dust.scale = 2.5f; } } diff --git a/Projectiles/Typeless/AscendantAura.png b/Projectiles/Typeless/AscendantAura.png index f7e13fb7ab..fb2bd6cc34 100644 Binary files a/Projectiles/Typeless/AscendantAura.png and b/Projectiles/Typeless/AscendantAura.png differ