diff --git a/Buffs/Pets/DaawnlightSpiritOriginBuff.cs b/Buffs/Pets/DaawnlightSpiritOriginBuff.cs index a50f62b09b..fe321f59de 100644 --- a/Buffs/Pets/DaawnlightSpiritOriginBuff.cs +++ b/Buffs/Pets/DaawnlightSpiritOriginBuff.cs @@ -12,7 +12,6 @@ namespace CalamityMod.Buffs.Pets DisplayName.SetDefault("Archer of Lunamoon"); Description.SetDefault("You have a personal spotter"); Main.buffNoTimeDisplay[Type] = true; - Main.lightPet[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 3117f7649d..48e356982f 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -4958,6 +4958,9 @@ namespace CalamityMod.CalPlayer if (witheringWeaponEnchant) witheringDamageDone += (int)(damage * (crit ? 2D : 1D)); + if (flamingItemEnchant) + target.AddBuff(ModContent.BuffType(), 120); + switch (item.type) { case ItemID.CobaltSword: @@ -7537,7 +7540,14 @@ namespace CalamityMod.CalPlayer // Summon a portal if needed. if (player.Calamity().persecutedEnchant && NPC.CountNPCS(ModContent.NPCType()) < 2) { - Vector2 spawnPosition = player.Center + Main.rand.NextVector2Unit() * Main.rand.NextFloat(270f, 420f); + int tries = 0; + Vector2 spawnPosition; + do + { + spawnPosition = player.Center + Main.rand.NextVector2Unit() * Main.rand.NextFloat(270f, 420f); + tries++; + } + while (Collision.SolidCollision(spawnPosition - Vector2.One * 24f, 48, 24) && tries < 100); CalamityNetcode.NewNPC_ClientSide(spawnPosition, ModContent.NPCType(), player); } diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index 5dedb23914..f863735c15 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -427,6 +427,7 @@ namespace CalamityMod.CalPlayer Texture2D extraPieceTexture = ModContent.GetTexture("CalamityMod/Items/Armor/Vanity/ApolloMask_Extra"); DrawData pieceDrawData = new DrawData(extraPieceTexture, headDrawPosition, drawPlayer.bodyFrame, drawInfo.eyeColor, 0f, origin, 1f, drawInfo.spriteEffects, 0); + pieceDrawData.shader = dyeShader; Main.playerDrawData.Add(pieceDrawData); } }); @@ -456,6 +457,7 @@ namespace CalamityMod.CalPlayer Rectangle headFrame = extraPieceTexture.Frame(1, 20, 0, headVerticalFrame); DrawData pieceDrawData = new DrawData(extraPieceTexture, headDrawPosition, headFrame, drawInfo.eyeColor, drawPlayer.fullRotation, origin, 1f, drawInfo.spriteEffects, 0); + pieceDrawData.shader = dyeShader; Main.playerDrawData.Add(pieceDrawData); } }); diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 2d68f6c4cd..13a65a2b90 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -101,7 +101,7 @@ namespace CalamityMod.CalPlayer player.lifeRegen = 0; player.lifeRegenTime = 0; - lifeRegenLost += 5; + lifeRegenLost += 7; } if (modPlayer.bFlames) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index c64ba34145..f15d53a867 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1279,7 +1279,14 @@ namespace CalamityMod.CalPlayer modPlayer.persecutedEnchantSummonTimer = 0; if (Main.myPlayer == player.whoAmI && player.Calamity().persecutedEnchant && NPC.CountNPCS(ModContent.NPCType()) < 2) { - Vector2 spawnPosition = player.Center + Main.rand.NextVector2Unit() * Main.rand.NextFloat(270f, 420f); + int tries = 0; + Vector2 spawnPosition; + do + { + spawnPosition = player.Center + Main.rand.NextVector2Unit() * Main.rand.NextFloat(270f, 420f); + tries++; + } + while (Collision.SolidCollision(spawnPosition - Vector2.One * 24f, 48, 24) && tries < 100); CalamityNetcode.NewNPC_ClientSide(spawnPosition, ModContent.NPCType(), player); } } @@ -3421,7 +3428,7 @@ namespace CalamityMod.CalPlayer if (modPlayer.gArtifact) { - player.maxMinions += 8; + player.maxMinions += 10; if (player.whoAmI == Main.myPlayer) { if (player.FindBuffIndex(ModContent.BuffType()) == -1) diff --git a/CalamityMod.cs b/CalamityMod.cs index 3085466fa5..de032a2486 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -85,7 +85,7 @@ namespace CalamityMod public static ModHotKey SpectralVeilHotKey; public static ModHotKey PlaguePackHotKey; public static ModHotKey AngelicAllianceHotKey; - public static ModHotKey GodSlayerDashHotKey; + public static ModHotKey GodSlayerDashHotKey; public static ModHotKey ExoChairSpeedupHotkey; // Boss Spawners @@ -113,21 +113,21 @@ namespace CalamityMod public const float velocityScaleMin = 0.5f; public const float bitingEnemeyVelocityScale = 0.8f; - // Life steal cap - public const int lifeStealCap = 10; + // Life steal cap + public const int lifeStealCap = 10; - // Debuff immunities, these are used in the NPCDebuffs file - public static int[] slimeEnemyImmunities = new int[1] { BuffID.Poisoned }; - public static int[] iceEnemyImmunities = new int[3] { BuffID.Frostburn, ModContent.BuffType(), ModContent.BuffType() }; - public static int[] sulphurEnemyImmunities = new int[4] { BuffID.Poisoned, BuffID.Venom, ModContent.BuffType(), ModContent.BuffType() }; - public static int[] sunkenSeaEnemyImmunities = new int[2] { ModContent.BuffType(), ModContent.BuffType() }; - public static int[] abyssEnemyImmunities = new int[1] { ModContent.BuffType() }; - public static int[] cragEnemyImmunities = new int[3] { BuffID.OnFire, ModContent.BuffType(), ModContent.BuffType() }; - public static int[] astralEnemyImmunities = new int[2] { BuffID.Poisoned, ModContent.BuffType() }; - public static int[] plagueEnemyImmunities = new int[3] { BuffID.Poisoned, BuffID.Venom, ModContent.BuffType() }; - public static int[] holyEnemyImmunities = new int[3] { BuffID.OnFire, ModContent.BuffType(), ModContent.BuffType() }; + // Debuff immunities, these are used in the NPCDebuffs file + public static int[] slimeEnemyImmunities = new int[1] { BuffID.Poisoned }; + public static int[] iceEnemyImmunities = new int[3] { BuffID.Frostburn, ModContent.BuffType(), ModContent.BuffType() }; + public static int[] sulphurEnemyImmunities = new int[4] { BuffID.Poisoned, BuffID.Venom, ModContent.BuffType(), ModContent.BuffType() }; + public static int[] sunkenSeaEnemyImmunities = new int[2] { ModContent.BuffType(), ModContent.BuffType() }; + public static int[] abyssEnemyImmunities = new int[1] { ModContent.BuffType() }; + public static int[] cragEnemyImmunities = new int[3] { BuffID.OnFire, ModContent.BuffType(), ModContent.BuffType() }; + public static int[] astralEnemyImmunities = new int[2] { BuffID.Poisoned, ModContent.BuffType() }; + public static int[] plagueEnemyImmunities = new int[3] { BuffID.Poisoned, BuffID.Venom, ModContent.BuffType() }; + public static int[] holyEnemyImmunities = new int[3] { BuffID.OnFire, ModContent.BuffType(), ModContent.BuffType() }; - internal static CalamityMod Instance; + internal static CalamityMod Instance; internal Mod musicMod = null; // This is Calamity's official music mod, CalamityModMusic internal bool MusicAvailable => !(musicMod is null); internal Mod ancientsAwakened = null; @@ -169,10 +169,10 @@ namespace CalamityMod carpetOriginal = Main.flyingCarpetTexture; Mount.mounts[Mount.Unicorn].dashSpeed *= CalamityPlayer.UnicornSpeedNerfPower; Mount.mounts[Mount.Unicorn].runSpeed *= CalamityPlayer.UnicornSpeedNerfPower; - Mount.mounts[Mount.MinecartMech].dashSpeed *= CalamityPlayer.MechanicalCartSpeedNerfPower; - Mount.mounts[Mount.MinecartMech].runSpeed *= CalamityPlayer.MechanicalCartSpeedNerfPower; + Mount.mounts[Mount.MinecartMech].dashSpeed *= CalamityPlayer.MechanicalCartSpeedNerfPower; + Mount.mounts[Mount.MinecartMech].runSpeed *= CalamityPlayer.MechanicalCartSpeedNerfPower; - NormalityRelocatorHotKey = RegisterHotKey("Normality Relocator", "Z"); + NormalityRelocatorHotKey = RegisterHotKey("Normality Relocator", "Z"); RageHotKey = RegisterHotKey("Rage Mode", "V"); AdrenalineHotKey = RegisterHotKey("Adrenaline Mode", "B"); AegisHotKey = RegisterHotKey("Elysian Guard", "N"); @@ -184,7 +184,7 @@ namespace CalamityMod SpectralVeilHotKey = RegisterHotKey("Spectral Veil Teleport", "Z"); PlaguePackHotKey = RegisterHotKey("Booster Dash", "Q"); AngelicAllianceHotKey = RegisterHotKey("Angelic Alliance Blessing", "G"); - GodSlayerDashHotKey = RegisterHotKey("God Slayer Dash", "H"); + GodSlayerDashHotKey = RegisterHotKey("God Slayer Dash", "H"); ExoChairSpeedupHotkey = RegisterHotKey("Exo Chair Speed Up", "LeftShift"); if (!Main.dedServ) @@ -262,10 +262,10 @@ namespace CalamityMod Filters.Scene["CalamityMod:SupremeCalamitas"] = new Filter(new SCalScreenShaderData("FilterMiniTower").UseColor(1.1f, 0.3f, 0.3f).UseOpacity(0.65f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:SupremeCalamitas"] = new SCalSky(); - Filters.Scene["CalamityMod:AdultEidolonWyrm"] = new Filter(new AEWScreenShaderData("FilterMiniTower").UseColor(0f, 0f, 0.25f).UseOpacity(0.35f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:AdultEidolonWyrm"] = new AEWSky(); + Filters.Scene["CalamityMod:AdultEidolonWyrm"] = new Filter(new AEWScreenShaderData("FilterMiniTower").UseColor(0f, 0f, 0.25f).UseOpacity(0.35f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:AdultEidolonWyrm"] = new AEWSky(); - Filters.Scene["CalamityMod:Signus"] = new Filter(new SignusScreenShaderData("FilterMiniTower").UseColor(0.35f, 0.1f, 0.55f).UseOpacity(0.35f), EffectPriority.VeryHigh); + Filters.Scene["CalamityMod:Signus"] = new Filter(new SignusScreenShaderData("FilterMiniTower").UseColor(0.35f, 0.1f, 0.55f).UseOpacity(0.35f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:Signus"] = new SignusSky(); Filters.Scene["CalamityMod:BossRush"] = new Filter(new BossRushScreenShader("FilterMiniTower").UseColor(BossRushSky.GeneralColor).UseOpacity(0.75f), EffectPriority.VeryHigh); @@ -287,13 +287,13 @@ namespace CalamityMod Apollo.LoadHeadIcons(); Artemis.LoadHeadIcons(); - DevourerofGodsHead.LoadHeadIcons(); - DevourerofGodsBody.LoadHeadIcons(); - DevourerofGodsTail.LoadHeadIcons(); - HiveMind.LoadHeadIcons(); + DevourerofGodsHead.LoadHeadIcons(); + DevourerofGodsBody.LoadHeadIcons(); + DevourerofGodsTail.LoadHeadIcons(); + HiveMind.LoadHeadIcons(); Polterghast.LoadHeadIcons(); - StormWeaverHead.LoadHeadIcons(); - SupremeCalamitas.LoadHeadIcons(); + StormWeaverHead.LoadHeadIcons(); + SupremeCalamitas.LoadHeadIcons(); ThanatosHead.LoadHeadIcons(); ThanatosBody1.LoadHeadIcons(); ThanatosBody2.LoadHeadIcons(); @@ -335,8 +335,8 @@ namespace CalamityMod SandCloakHotkey = null; SpectralVeilHotKey = null; PlaguePackHotKey = null; - AngelicAllianceHotKey = null; - GodSlayerDashHotKey = null; + AngelicAllianceHotKey = null; + GodSlayerDashHotKey = null; AstralCactusTexture = null; AstralCactusGlowTexture = null; @@ -379,10 +379,10 @@ namespace CalamityMod } Mount.mounts[Mount.Unicorn].dashSpeed /= CalamityPlayer.UnicornSpeedNerfPower; Mount.mounts[Mount.Unicorn].runSpeed /= CalamityPlayer.UnicornSpeedNerfPower; - Mount.mounts[Mount.MinecartMech].dashSpeed /= CalamityPlayer.MechanicalCartSpeedNerfPower; - Mount.mounts[Mount.MinecartMech].runSpeed /= CalamityPlayer.MechanicalCartSpeedNerfPower; + Mount.mounts[Mount.MinecartMech].dashSpeed /= CalamityPlayer.MechanicalCartSpeedNerfPower; + Mount.mounts[Mount.MinecartMech].runSpeed /= CalamityPlayer.MechanicalCartSpeedNerfPower; - heartOriginal2 = null; + heartOriginal2 = null; heartOriginal = null; rainOriginal = null; manaOriginal = null; @@ -604,8 +604,8 @@ namespace CalamityMod { ModContent.NPCType(), 5400 }, { ModContent.NPCType(), 7200 }, { ModContent.NPCType(), 14400 }, - { ModContent.NPCType(), 10800 }, - { ModContent.NPCType(), 1200 }, + { ModContent.NPCType(), 10800 }, + { ModContent.NPCType(), 1200 }, { ModContent.NPCType(), 8100 }, { ModContent.NPCType(), 8100 }, { ModContent.NPCType(), 8100 }, @@ -617,19 +617,19 @@ namespace CalamityMod { ModContent.NPCType(), 14400 }, { ModContent.NPCType(), 15300 }, { ModContent.NPCType(), 18000 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 18000 } - }; + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 18000 } + }; } #endregion @@ -745,14 +745,14 @@ namespace CalamityMod { ModContent.NPCType(), velocityScaleMin }, { ModContent.NPCType(), velocityScaleMin }, { ModContent.NPCType(), velocityScaleMin }, - { ModContent.NPCType(), velocityScaleMin }, // Increases in phase 2 + { ModContent.NPCType(), velocityScaleMin }, // Increases in phase 2 { ModContent.NPCType(), velocityScaleMin }, - { ModContent.NPCType(), bitingEnemeyVelocityScale }, - { ModContent.NPCType(), velocityScaleMin }, - { ModContent.NPCType(), velocityScaleMin }, - { ModContent.NPCType(), velocityScaleMin }, - { ModContent.NPCType(), bitingEnemeyVelocityScale } - }; + { ModContent.NPCType(), bitingEnemeyVelocityScale }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), bitingEnemeyVelocityScale } + }; } #endregion @@ -760,7 +760,7 @@ namespace CalamityMod // This function returns an available Calamity Music Mod track, or null if the Calamity Music Mod is not available. public int? GetMusicFromMusicMod(string songFilename) => MusicAvailable ? (int?)musicMod.GetSoundSlot(SoundType.Music, "Sounds/Music/" + songFilename) : null; - + public override void UpdateMusic(ref int music, ref MusicPriority priority) { if (Main.musicVolume != 0) @@ -855,11 +855,11 @@ namespace CalamityMod } } } - #endregion + #endregion - #region Lighting Effects - public override void ModifySunLightColor(ref Color tileColor, ref Color backgroundColor) - { + #region Lighting Effects + public override void ModifySunLightColor(ref Color tileColor, ref Color backgroundColor) + { if (Main.gameMenu) BossRushEvent.StartTimer = 0; @@ -877,10 +877,10 @@ namespace CalamityMod tileColor = Color.Lerp(tileColor, Color.Black, intensity * 0.3f); } } - #endregion + #endregion - #region Mod Support - public override void PostSetupContent() => WeakReferenceSupport.Setup(); + #region Mod Support + public override void PostSetupContent() => WeakReferenceSupport.Setup(); public override object Call(params object[] args) => ModCalls.Call(args); #endregion @@ -973,7 +973,7 @@ namespace CalamityMod CalamitasEnchantUI.Draw(Main.spriteBatch); return true; }, InterfaceScaleType.None)); - + // Codebreaker UI. layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Codebreaker Decryption GUI", () => { @@ -1550,7 +1550,12 @@ namespace CalamityMod #endregion #region Tile Entity Time Handler - public override void MidUpdateTimeWorld() => TileEntityTimeHandler.Update(); + public override void MidUpdateTimeWorld() => TileEntityTimeHandler.Update(); + #endregion + + #region Post NPC Updating + // TODO - Apply caching to this process. For now most of the looping issues should be eradicated but it can be reduced further. + public override void MidUpdateNPCGore() => CalamityGlobalTownNPC.ResetTownNPCNameBools(); #endregion } } diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index 0144599507..87f39b619a 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -61,8 +61,6 @@ namespace CalamityMod.Effects Filters.Scene["CalamityMod:LightBurst"] = new Filter(new ScreenShaderData(new Ref(LightShader), "BurstPass"), EffectPriority.VeryHigh); Filters.Scene["CalamityMod:LightBurst"].Load(); - Filters.Scene["CalamityMod:DoGPortal"] = new Filter(new ScreenShaderData(new Ref(DoGPortalShader), "ScreenPass"), EffectPriority.VeryHigh); - Filters.Scene["CalamityMod:DoGPortal"].Load(); GameShaders.Misc["CalamityMod:FireMouse"] = new MiscShaderData(new Ref(SCalMouseShader), "DyePass"); GameShaders.Misc["CalamityMod:SubsumingTentacle"] = new MiscShaderData(new Ref(TentacleShader), "BurstPass"); @@ -81,6 +79,8 @@ namespace CalamityMod.Effects GameShaders.Misc["CalamityMod:BaseFusableParticleEdge"] = new MiscShaderData(new Ref(BaseFusableParticleEdgeShader), "ParticlePass"); GameShaders.Misc["CalamityMod:AdditiveFusableParticleEdge"] = new MiscShaderData(new Ref(AdditiveFusableParticleEdgeShader), "ParticlePass"); + + GameShaders.Misc["CalamityMod:DoGPortal"] = new MiscShaderData(new Ref(DoGPortalShader), "ScreenPass"); } } } diff --git a/Effects/ScreenShaders/DoGPortalShader.fx b/Effects/ScreenShaders/DoGPortalShader.fx index 3769fa5e08..412a346aa0 100644 --- a/Effects/ScreenShaders/DoGPortalShader.fx +++ b/Effects/ScreenShaders/DoGPortalShader.fx @@ -1,47 +1,36 @@ sampler uImage0 : register(s0); sampler uImage1 : register(s1); -sampler uImage2 : register(s2); -sampler uImage3 : register(s3); float3 uColor; float3 uSecondaryColor; -float2 uScreenResolution; -float2 uScreenPosition; -float2 uTargetPosition; -float2 uDirection; -float uOpacity; -float uTime; -float uIntensity; -float uProgress; -float2 uImageSize1; -float2 uImageSize2; -float2 uImageSize3; -float2 uImageOffset; +float uOpacity : register(C0); float uSaturation; +float uRotation; +float uTime; float4 uSourceRect; -float2 uZoom; +float2 uWorldPosition; +float uDirection; +float3 uLightSource; +float2 uImageSize0; +float2 uImageSize1; float4 PixelShaderFunction(float4 position : SV_POSITION, float2 coords : TEXCOORD0) : COLOR0 { - // Calculate relative screen values. - float2 targetUVCoords = (uTargetPosition - uScreenPosition) / uScreenResolution; - float2 centerOffset = (coords - targetUVCoords) * (uScreenResolution / uScreenResolution.y); - float distanceFromTargetPosition = distance(coords, targetUVCoords) / uZoom; + float distanceFromTargetPosition = distance(coords, 0.5); // Calculate the swirl coordinates. - float2 centeredCoords = (targetUVCoords - coords) * (uScreenResolution / uScreenResolution.y); - float swirlRotation = length(centeredCoords) * 21.2 - uTime * 6; + float2 centeredCoords = coords - 0.5; + float swirlRotation = length(centeredCoords) * 41.2 - uTime * 6; float swirlSine = sin(swirlRotation); float swirlCosine = cos(swirlRotation); float2x2 swirlRotationMatrix = float2x2(swirlCosine, -swirlSine, swirlSine, swirlCosine); float2 swirlCoordinates = mul(centeredCoords, swirlRotationMatrix) + 0.5; // Calculate fade, swirl arm colors, and draw the portal to the screen. - float4 color = tex2D(uImage0, coords); - float swirlColorFade = saturate(distanceFromTargetPosition * 3) / (uProgress + 0.0001); + float swirlColorFade = saturate(distanceFromTargetPosition * 3) / (uOpacity + 0.0001); float3 swirlBaseColor = lerp(uColor, uSecondaryColor, pow(swirlColorFade, 0.33)); - float4 swirlNoiseColor = tex2D(uImage1, swirlCoordinates) * (1 - swirlColorFade); - float4 endColor = lerp(float4(swirlBaseColor, 0.1), color, swirlColorFade); - return lerp(color, endColor * (1 + (1 - swirlColorFade) * 2), saturate(swirlNoiseColor.r)); + float4 swirlNoiseColor = tex2D(uImage0, swirlCoordinates) * (1 - swirlColorFade); + float4 endColor = lerp(float4(swirlBaseColor, 0.1), 0, swirlColorFade); + return lerp(0, endColor * (1 + (1 - swirlColorFade) * 2), saturate(swirlNoiseColor.r)); } technique Technique1 diff --git a/Effects/ScreenShaders/DoGPortalShader.xnb b/Effects/ScreenShaders/DoGPortalShader.xnb index 1341782d57..3b21a28dc0 100644 Binary files a/Effects/ScreenShaders/DoGPortalShader.xnb and b/Effects/ScreenShaders/DoGPortalShader.xnb differ diff --git a/Events/BossRushEvent.cs b/Events/BossRushEvent.cs index 256147d88a..64bdddc0b0 100644 --- a/Events/BossRushEvent.cs +++ b/Events/BossRushEvent.cs @@ -97,6 +97,7 @@ namespace CalamityMod.Events #region Loading and Unloading public static void Load() { + BossIDsAfterDeath = new Dictionary(); Bosses = new List() { new Boss(NPCID.QueenBee), diff --git a/ExtraTextures/TaintedArm.png b/ExtraTextures/TaintedArm.png index f8796f05e7..7c9f360390 100644 Binary files a/ExtraTextures/TaintedArm.png and b/ExtraTextures/TaintedArm.png differ diff --git a/ILEditing/ILChanges.cs b/ILEditing/ILChanges.cs index 49d924651b..2d1d0a7246 100644 --- a/ILEditing/ILChanges.cs +++ b/ILEditing/ILChanges.cs @@ -137,6 +137,7 @@ namespace CalamityMod.ILEditing IL.Terraria.Main.DoDraw += DrawFusableParticles; IL.Terraria.Main.DrawTiles += DrawCustomLava; IL.Terraria.GameContent.Liquid.LiquidRenderer.InternalDraw += DrawCustomLava2; + IL.Terraria.Main.oldDrawWater += DrawCustomLava3; IL.Terraria.WaterfallManager.DrawWaterfall += DrawCustomLavafalls; // Ravager platform fall fix @@ -203,6 +204,7 @@ namespace CalamityMod.ILEditing IL.Terraria.Main.DoDraw -= DrawFusableParticles; IL.Terraria.Main.DrawTiles -= DrawCustomLava; IL.Terraria.GameContent.Liquid.LiquidRenderer.InternalDraw -= DrawCustomLava2; + IL.Terraria.Main.oldDrawWater -= DrawCustomLava3; IL.Terraria.WaterfallManager.DrawWaterfall -= DrawCustomLavafalls; // Ravager platform fall fix @@ -708,6 +710,37 @@ namespace CalamityMod.ILEditing }); } + private static void DrawCustomLava3(ILContext il) + { + ILCursor cursor = new ILCursor(il); + + // Select the lava color. + if (!cursor.TryGotoNext(MoveType.After, c => c.MatchCallOrCallvirt("get_NotRetro"))) + { + LogFailure("Custom Lava Drawing", "Could not locate the retro style check."); + return; + } + + // Pass the texture in so that the method can ensure it is not messing around with non-lava textures. + cursor.Emit(OpCodes.Ldloc, 13); + cursor.Emit(OpCodes.Ldsfld, typeof(Main).GetField("liquidTexture")); + cursor.Emit(OpCodes.Ldloc, 15); + cursor.Emit(OpCodes.Ldelem_Ref); + cursor.EmitDelegate>((initialColor, initialTexture) => SelectLavaColor(initialTexture, initialColor)); + cursor.Emit(OpCodes.Stloc, 13); + + // Go back to the start and change textures as necessary. + cursor.Index = 0; + + while (cursor.TryGotoNext(c => c.MatchLdsfld
("liquidTexture"))) + { + // While this may seem crazy, under no circumstances should there not be a load after exactly 3 instructions. + // The order is load is texture array field -> load index -> load the reference to the texture at that index. + cursor.Index += 3; + cursor.EmitDelegate>(initialTexture => SelectLavaTexture(initialTexture, true)); + } + } + private static void DrawCustomLavafalls(ILContext il) { ILCursor cursor = new ILCursor(il); diff --git a/Items/Accessories/TheCommunity.cs b/Items/Accessories/TheCommunity.cs index a8f7186d5d..cc0af1c17a 100644 --- a/Items/Accessories/TheCommunity.cs +++ b/Items/Accessories/TheCommunity.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Accessories public override void SetDefaults() { - item.width = 20; - item.height = 20; + item.width = 34; + item.height = 64; item.value = CalamityGlobalItem.Rarity7BuyPrice; item.rare = ItemRarityID.Lime; item.accessory = true; diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 6d5cefd71b..95f7dcbfd1 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -2370,13 +2370,9 @@ namespace CalamityMod.Items public override bool PreDrawInInventory(Item item, SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) { - void drawItemManually(Color color, float generalScale) - { - Texture2D itemTexture = Main.itemTexture[item.type]; - Rectangle itemFrame = (Main.itemAnimations[item.type] == null) ? itemTexture.Frame() : Main.itemAnimations[item.type].GetFrame(itemTexture); - Vector2 itemOrigin = frame.Size() * 0.5f; - spriteBatch.Draw(itemTexture, position, itemFrame, color, 0f, itemOrigin, scale * generalScale, SpriteEffects.None, 0f); - } + // I want to strangle somebody. + Texture2D itemTexture = Main.itemTexture[item.type]; + Rectangle itemFrame = (Main.itemAnimations[item.type] == null) ? itemTexture.Frame() : Main.itemAnimations[item.type].GetFrame(itemTexture); if (!EnchantmentManager.ItemUpgradeRelationship.ContainsKey(item.type) || !Main.LocalPlayer.InventoryHas(ModContent.ItemType())) return true; @@ -2387,19 +2383,11 @@ namespace CalamityMod.Items if (calamitasNPCIndex != -1) currentPower = Utils.InverseLerp(11750f, 1000f, Main.LocalPlayer.Distance(Main.npc[calamitasNPCIndex].Center), true); - // Adjust the offset of the position. This vector does not have any specific static member that can be referenced and it is not - // as simply computable as a texture.Size() * 0.5f. - position += new Vector2(14f, 16f) * Main.inventoryScale; + Vector2 particleDrawCenter = position + new Vector2(12f, 16f) * Main.inventoryScale; EnchantmentEnergyParticles.InterpolationSpeed = MathHelper.Lerp(0.035f, 0.1f, currentPower); - EnchantmentEnergyParticles.DrawSet(position + Main.screenPosition); - - float pulse = Main.GlobalTime * 0.79f % 1f; - float pulseFade = Utils.InverseLerp(0.87f, 0.27f, pulse, true); - float pulseScale = scale * MathHelper.Lerp(1.6f, 1f, pulseFade) / scale; - Color pulseColor = Color.Lerp(drawColor, Color.BlueViolet, pulseFade) * pulseFade; - drawItemManually(pulseColor, pulseScale); - drawItemManually(drawColor, 1f); + EnchantmentEnergyParticles.DrawSet(particleDrawCenter + Main.screenPosition); + spriteBatch.Draw(itemTexture, position, itemFrame, drawColor, 0f, origin, scale, SpriteEffects.None, 0f); return false; } diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 484b1701c9..6102c4b541 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -125,8 +125,6 @@ namespace CalamityMod.Items nameLine.overrideColor = CalamityUtils.ColorSwap(new Color(191, 45, 71), new Color(185, 187, 253), 4f); if (item.type == ModContent.ItemType()) nameLine.overrideColor = CalamityUtils.ColorSwap(new Color(204, 86, 80), new Color(237, 69, 141), 4f); - if (item.type == ModContent.ItemType()) - nameLine.overrideColor = new Color(146, 0, 0); if (item.type == ModContent.ItemType()) nameLine.overrideColor = new Color(129, 29, 149); if (item.type == ModContent.ItemType()) @@ -233,6 +231,8 @@ namespace CalamityMod.Items legendaryColor = CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 3f); if (item.type == ModContent.ItemType()) legendaryColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); + if (item.type == ModContent.ItemType()) + legendaryColor = new Color(146, 0, 0); Color lineColor = legendaryColor.GetValueOrDefault(CalamityUtils.ChallengeDropColor); string text = legendaryColor.HasValue ? "- Legendary Challenge Drop -" : "- Challenge Drop -"; diff --git a/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs b/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs index 703bc5730c..80221e0500 100644 --- a/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs +++ b/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs @@ -56,6 +56,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 * 0.9f); + 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/Rancor.cs b/Items/Weapons/Magic/Rancor.cs index cbec0ae36f..8b618d1f30 100644 --- a/Items/Weapons/Magic/Rancor.cs +++ b/Items/Weapons/Magic/Rancor.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 2222; + item.damage = 444; item.magic = true; item.noUseGraphic = true; item.channel = true; diff --git a/Items/Weapons/Magic/VoidVortex.cs b/Items/Weapons/Magic/VoidVortex.cs index 9b3873fc9a..2f52d5a79e 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 = 82; + item.damage = 88; item.magic = true; item.mana = 60; item.width = 130; diff --git a/Items/Weapons/Magic/YharimsCrystal.cs b/Items/Weapons/Magic/YharimsCrystal.cs index e69c022965..220cde3e0e 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 = 125; + item.damage = 88; item.magic = true; item.mana = 15; item.width = 16; diff --git a/Items/Weapons/Melee/GaelsGreatsword.cs b/Items/Weapons/Melee/GaelsGreatsword.cs index c769e77aac..965e83b622 100644 --- a/Items/Weapons/Melee/GaelsGreatsword.cs +++ b/Items/Weapons/Melee/GaelsGreatsword.cs @@ -56,6 +56,7 @@ namespace CalamityMod.Items.Weapons.Melee item.value = CalamityGlobalItem.Rarity15BuyPrice; item.Calamity().customRarity = CalamityRarity.Violet; item.Calamity().devItem = true; + item.Calamity().challengeDrop = true; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 15f; diff --git a/Items/Weapons/Ranged/Drataliornus.cs b/Items/Weapons/Ranged/Drataliornus.cs index 43d9633703..d9854cea93 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 = 80; + item.damage = 124; item.knockBack = 1f; item.shootSpeed = 18f; item.useStyle = ItemUseStyleID.HoldingOut; diff --git a/Items/Weapons/Rogue/Apoctolith.cs b/Items/Weapons/Rogue/Apoctolith.cs index edfd680d6f..bd64dda5fe 100644 --- a/Items/Weapons/Rogue/Apoctolith.cs +++ b/Items/Weapons/Rogue/Apoctolith.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Rogue //Check if stealth is full if (player.Calamity().StealthStrikeAvailable()) { - int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI); + int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * 1.25f), knockBack, player.whoAmI); if (p.WithinBounds(Main.maxProjectiles)) Main.projectile[p].Calamity().stealthStrike = true; return false; diff --git a/Items/Weapons/Rogue/AuroradicalThrow.cs b/Items/Weapons/Rogue/AuroradicalThrow.cs index 10c429bc35..f3a1b695be 100644 --- a/Items/Weapons/Rogue/AuroradicalThrow.cs +++ b/Items/Weapons/Rogue/AuroradicalThrow.cs @@ -39,6 +39,9 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { + if (player.Calamity().StealthStrikeAvailable()) + damage = (int)(damage * 1.2f); + int star = Projectile.NewProjectile(player.Center, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); if (star.WithinBounds(Main.maxProjectiles)) Main.projectile[star].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); diff --git a/Items/Weapons/Rogue/BlastBarrel.cs b/Items/Weapons/Rogue/BlastBarrel.cs index 22e0d7b90f..e4162e3b86 100644 --- a/Items/Weapons/Rogue/BlastBarrel.cs +++ b/Items/Weapons/Rogue/BlastBarrel.cs @@ -38,10 +38,10 @@ 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) { - speedY *= 0.7f; //since the barrel is heavy + speedY *= 0.85f; Vector2 initialVelocity = new Vector2(speedX, speedY); - //unitY additive is do it doesn't exploe initially + // A vertical offset is added to ensure that the barrel does not immediately collide with tiles and explode. int p = Projectile.NewProjectile(position - Vector2.UnitY * 12f, initialVelocity, type, damage, knockBack, player.whoAmI); if (player.Calamity().StealthStrikeAvailable() && p.WithinBounds(Main.maxProjectiles)) Main.projectile[p].Calamity().stealthStrike = true; diff --git a/Items/Weapons/Rogue/BlazingStar.cs b/Items/Weapons/Rogue/BlazingStar.cs index f25b3fe360..c7abf343cb 100644 --- a/Items/Weapons/Rogue/BlazingStar.cs +++ b/Items/Weapons/Rogue/BlazingStar.cs @@ -47,6 +47,8 @@ namespace CalamityMod.Items.Weapons.Rogue { if (item.stack != 1) { + damage = (int)(damage * 1.55f); + for (int i = 0; i < item.stack; i++) { Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.Lerp(-MathHelper.ToRadians(8f), MathHelper.ToRadians(8f), i / (float)(item.stack - 1))); diff --git a/Items/Weapons/Rogue/BrackishFlask.cs b/Items/Weapons/Rogue/BrackishFlask.cs index cce83ac787..e34a9a68e2 100644 --- a/Items/Weapons/Rogue/BrackishFlask.cs +++ b/Items/Weapons/Rogue/BrackishFlask.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 0.85f), knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; return false; diff --git a/Items/Weapons/Rogue/BurningStrife.cs b/Items/Weapons/Rogue/BurningStrife.cs index 950405d6a8..1c72194fb9 100644 --- a/Items/Weapons/Rogue/BurningStrife.cs +++ b/Items/Weapons/Rogue/BurningStrife.cs @@ -46,7 +46,8 @@ namespace CalamityMod.Items.Weapons.Rogue if (player.Calamity().StealthStrikeAvailable()) { speedMult = 1.25f; - } + damage = (int)(damage * 1.3f); + } int proj = Projectile.NewProjectile(position, new Vector2(speedX * speedMult, speedY * speedMult), type, damage, knockBack, player.whoAmI); if (player.Calamity().StealthStrikeAvailable() && proj.WithinBounds(Main.maxProjectiles)) { diff --git a/Items/Weapons/Rogue/CobaltKunai.cs b/Items/Weapons/Rogue/CobaltKunai.cs index bcd696302c..f532b471c0 100644 --- a/Items/Weapons/Rogue/CobaltKunai.cs +++ b/Items/Weapons/Rogue/CobaltKunai.cs @@ -38,17 +38,19 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { if (player.Calamity().StealthStrikeAvailable()) - { - for (int i = -6; i <= 6; i += 6) - { - Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(i)); - int stealth = Projectile.NewProjectile(position, perturbedSpeed, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); - if (stealth.WithinBounds(Main.maxProjectiles)) - Main.projectile[stealth].Calamity().stealthStrike = true; - } - return false; - } - return true; + { + damage = (int)(damage * 1.4f); + + for (int i = -6; i <= 6; i += 6) + { + Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(i)); + int stealth = Projectile.NewProjectile(position, perturbedSpeed, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); + if (stealth.WithinBounds(Main.maxProjectiles)) + Main.projectile[stealth].Calamity().stealthStrike = true; + } + return false; + } + return true; } public override void AddRecipes() diff --git a/Items/Weapons/Rogue/CorpusAvertor.cs b/Items/Weapons/Rogue/CorpusAvertor.cs index ff44328602..ba5ee592f6 100644 --- a/Items/Weapons/Rogue/CorpusAvertor.cs +++ b/Items/Weapons/Rogue/CorpusAvertor.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.rare = ItemRarityID.Yellow; item.Calamity().donorItem = true; item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 5f; + item.shootSpeed = 8.5f; item.Calamity().rogue = true; } @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - int dagger = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage * 2, knockBack * 2f, player.whoAmI); + int dagger = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), (int)(damage * 3.5f), knockBack * 2f, player.whoAmI); if (dagger.WithinBounds(Main.maxProjectiles)) Main.projectile[dagger].Calamity().stealthStrike = true; return false; diff --git a/Items/Weapons/Rogue/CosmicKunai.cs b/Items/Weapons/Rogue/CosmicKunai.cs index 712da3373d..b2de0e331e 100644 --- a/Items/Weapons/Rogue/CosmicKunai.cs +++ b/Items/Weapons/Rogue/CosmicKunai.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 26; - item.damage = 114; + item.damage = 92; item.noMelee = true; item.noUseGraphic = true; item.useTime = 2; diff --git a/Items/Weapons/Rogue/CraniumSmasher.cs b/Items/Weapons/Rogue/CraniumSmasher.cs index d6c294e09f..e6b20c1e8a 100644 --- a/Items/Weapons/Rogue/CraniumSmasher.cs +++ b/Items/Weapons/Rogue/CraniumSmasher.cs @@ -39,6 +39,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { + damage = (int)(damage * 1.75f); type = ModContent.ProjectileType(); } else if (Main.rand.NextBool(5)) diff --git a/Items/Weapons/Rogue/DefectiveSphere.cs b/Items/Weapons/Rogue/DefectiveSphere.cs index b85c1dfc67..9f19678db6 100644 --- a/Items/Weapons/Rogue/DefectiveSphere.cs +++ b/Items/Weapons/Rogue/DefectiveSphere.cs @@ -71,30 +71,25 @@ Stealth strikes launch all 4 sphere types at once"); ProjectileType() }); - //Kinda ugly but idk how to make it cleaner - float SpeedX = speedX + Main.rand.NextFloat(-30, 30) * 0.05f; - float SpeedY = speedY + Main.rand.NextFloat(-30, 30) * 0.05f; - float SpeedX2 = speedX + Main.rand.NextFloat(-30, 30) * 0.05f; - float SpeedY2 = speedY + Main.rand.NextFloat(-30, 30) * 0.05f; - float SpeedX3 = speedX + Main.rand.NextFloat(-30, 30) * 0.05f; - float SpeedY3 = speedY + Main.rand.NextFloat(-30, 30) * 0.05f; - float SpeedX4 = speedX + Main.rand.NextFloat(-30, 30) * 0.05f; - float SpeedY4 = speedY + Main.rand.NextFloat(-30, 30) * 0.05f; - if (player.Calamity().StealthStrikeAvailable()) { - int stealth = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage / 2, knockBack, player.whoAmI); - int stealth2 = Projectile.NewProjectile(position.X, position.Y, SpeedX2, SpeedY2, ProjectileType(), damage / 2, knockBack, player.whoAmI); - int stealth3 = Projectile.NewProjectile(position.X, position.Y, SpeedX3, SpeedY3, ProjectileType(), damage / 2, knockBack, player.whoAmI); - int stealth4 = Projectile.NewProjectile(position.X, position.Y, SpeedX4, SpeedY4, ProjectileType(), damage / 2, knockBack, player.whoAmI); - if (stealth.WithinBounds(Main.maxProjectiles)) - Main.projectile[stealth].Calamity().stealthStrike = true; - if (stealth2.WithinBounds(Main.maxProjectiles)) - Main.projectile[stealth2].Calamity().stealthStrike = true; - if (stealth3.WithinBounds(Main.maxProjectiles)) - Main.projectile[stealth3].Calamity().stealthStrike = true; - if (stealth4.WithinBounds(Main.maxProjectiles)) - Main.projectile[stealth4].Calamity().stealthStrike = true; + // This is done to allow looping when creating projectiles, instead of having to create many projectile/velocity variables all at once, + // which this shoot code used to do. + int[] projectilesToShoot = new int[] + { + type, + ProjectileType(), + ProjectileType(), + ProjectileType() + }; + + foreach (int projectileType in projectilesToShoot) + { + Vector2 shootVelocity = new Vector2(speedX, speedY) + Main.rand.NextVector2Square(-1.5f, 1.5f); + int stealth = Projectile.NewProjectile(position, shootVelocity, projectileType, (int)(damage * 0.625f), knockBack, player.whoAmI); + if (stealth.WithinBounds(Main.maxProjectiles)) + Main.projectile[stealth].Calamity().stealthStrike = true; + } } else { diff --git a/Items/Weapons/Rogue/DeificThunderbolt.cs b/Items/Weapons/Rogue/DeificThunderbolt.cs index 3f97e89f68..02867ed53b 100644 --- a/Items/Weapons/Rogue/DeificThunderbolt.cs +++ b/Items/Weapons/Rogue/DeificThunderbolt.cs @@ -20,7 +20,7 @@ Stealth strikes summon more lightning and travel faster"); public override void SafeSetDefaults() { - item.damage = 457; + item.damage = 466; item.knockBack = 10f; item.width = 56; diff --git a/Items/Weapons/Rogue/DukesDecapitator.cs b/Items/Weapons/Rogue/DukesDecapitator.cs index 632515a33c..67ca6cbe35 100644 --- a/Items/Weapons/Rogue/DukesDecapitator.cs +++ b/Items/Weapons/Rogue/DukesDecapitator.cs @@ -38,6 +38,9 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { + if (player.Calamity().StealthStrikeAvailable()) + damage = (int)(damage * 1.2f); + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); if (Main.projectile.IndexInRange(proj)) Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); diff --git a/Items/Weapons/Rogue/EpidemicShredder.cs b/Items/Weapons/Rogue/EpidemicShredder.cs index 04a7efacc8..b29f3fe296 100644 --- a/Items/Weapons/Rogue/EpidemicShredder.cs +++ b/Items/Weapons/Rogue/EpidemicShredder.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Rogue { item.width = 34; item.height = 34; - item.damage = 52; + item.damage = 80; item.noMelee = true; item.noUseGraphic = true; item.autoReuse = true; diff --git a/Items/Weapons/Rogue/Exorcism.cs b/Items/Weapons/Rogue/Exorcism.cs index 641dd164e2..f913a33b83 100644 --- a/Items/Weapons/Rogue/Exorcism.cs +++ b/Items/Weapons/Rogue/Exorcism.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 2f, damage); + int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * 1.15f), knockBack, player.whoAmI, 2f, damage); if (p.WithinBounds(Main.maxProjectiles)) Main.projectile[p].Calamity().stealthStrike = true; } diff --git a/Items/Weapons/Rogue/FantasyTalisman.cs b/Items/Weapons/Rogue/FantasyTalisman.cs index 50296d545c..aad0095869 100644 --- a/Items/Weapons/Rogue/FantasyTalisman.cs +++ b/Items/Weapons/Rogue/FantasyTalisman.cs @@ -43,7 +43,7 @@ Stealth strikes release more souls and leave behind souls as they travel"); { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI); + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), (int)(damage * 0.8f), knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; return false; diff --git a/Items/Weapons/Rogue/FrostcrushValari.cs b/Items/Weapons/Rogue/FrostcrushValari.cs index 0df481b21d..7b1a4edaea 100644 --- a/Items/Weapons/Rogue/FrostcrushValari.cs +++ b/Items/Weapons/Rogue/FrostcrushValari.cs @@ -54,7 +54,7 @@ Stealth strikes throw three short ranged boomerangs along with a spread of icicl for (int i = 0; i < 3; i++) { Vector2 perturbedspeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(spread)); - int proj = Projectile.NewProjectile(position, perturbedspeed, type, Math.Max(damage / 3, 1), knockBack / 3f, player.whoAmI, 0f, 1f); + int proj = Projectile.NewProjectile(position, perturbedspeed, type, Math.Max((int)(damage / 2.7272f), 1), knockBack / 3f, player.whoAmI, 0f, 1f); if (proj.WithinBounds(Main.maxProjectiles)) Main.projectile[proj].Calamity().stealthStrike = true; spread -= 10; @@ -64,7 +64,7 @@ Stealth strikes throw three short ranged boomerangs along with a spread of icicl for (int i = 0; i < icicleAmt; i++) { Vector2 perturbedspeed = new Vector2(speedX + Main.rand.Next(-3,4), speedY + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread2)); - Projectile.NewProjectile(position, perturbedspeed, (Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType()), Math.Max(damage / 3, 1), 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position, perturbedspeed, (Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType()), Math.Max((int)(damage / 2.7272f), 1), 0f, player.whoAmI, 0f, 0f); spread2 -= Main.rand.Next(1,4); } return false; diff --git a/Items/Weapons/Rogue/FrostyFlare.cs b/Items/Weapons/Rogue/FrostyFlare.cs index dcfd43e0c2..d48f0bc7d1 100644 --- a/Items/Weapons/Rogue/FrostyFlare.cs +++ b/Items/Weapons/Rogue/FrostyFlare.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - int flare = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI); + int flare = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), (int)(damage * 0.9f), knockBack, player.whoAmI); if (flare.WithinBounds(Main.maxProjectiles)) Main.projectile[flare].Calamity().stealthStrike = true; return false; diff --git a/Items/Weapons/Rogue/HeavenfallenStardisk.cs b/Items/Weapons/Rogue/HeavenfallenStardisk.cs index ba2147b567..02786065be 100644 --- a/Items/Weapons/Rogue/HeavenfallenStardisk.cs +++ b/Items/Weapons/Rogue/HeavenfallenStardisk.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - int proj = Projectile.NewProjectile(position.X, position.Y, 0f, -10f, type, damage, knockBack, player.whoAmI); + int proj = Projectile.NewProjectile(position.X, position.Y, 0f, -10f, type, (int)(damage * 1.25f), knockBack, player.whoAmI); if (proj.WithinBounds(Main.maxProjectiles)) Main.projectile[proj].Calamity().stealthStrike = true; } diff --git a/Items/Weapons/Rogue/IchorSpear.cs b/Items/Weapons/Rogue/IchorSpear.cs index 6ac896daf4..77da55eeb0 100644 --- a/Items/Weapons/Rogue/IchorSpear.cs +++ b/Items/Weapons/Rogue/IchorSpear.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.6), knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) { Main.projectile[stealth].Calamity().stealthStrike = true; diff --git a/Items/Weapons/Rogue/LeonidProgenitor.cs b/Items/Weapons/Rogue/LeonidProgenitor.cs index f9c4b2476c..7f1ed8ac65 100644 --- a/Items/Weapons/Rogue/LeonidProgenitor.cs +++ b/Items/Weapons/Rogue/LeonidProgenitor.cs @@ -68,9 +68,11 @@ 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) { + float stealthDamageFactor = player.Calamity().StealthStrikeAvailable() ? 1.25f : 1f; + if (player.Calamity().StealthStrikeAvailable() || player.altFunctionUse != 2) { - int bomb = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + int bomb = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * stealthDamageFactor), knockBack, player.whoAmI); if (bomb.WithinBounds(Main.maxProjectiles)) Main.projectile[bomb].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; @@ -81,7 +83,7 @@ namespace CalamityMod.Items.Weapons.Rogue for (float i = -2.5f; i < 3f; ++i) { Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(i)); - Projectile.NewProjectile(position, perturbedSpeed, type, (int)(damage * dmgMult), knockBack, player.whoAmI); + Projectile.NewProjectile(position, perturbedSpeed, type, (int)(damage * dmgMult * stealthDamageFactor), knockBack, player.whoAmI); } } return false; diff --git a/Items/Weapons/Rogue/LeviathanTeeth.cs b/Items/Weapons/Rogue/LeviathanTeeth.cs index e4fcf30d0a..c3bc789cdd 100644 --- a/Items/Weapons/Rogue/LeviathanTeeth.cs +++ b/Items/Weapons/Rogue/LeviathanTeeth.cs @@ -44,6 +44,7 @@ namespace CalamityMod.Items.Weapons.Rogue { teethCount = 3; stealthStrike = true; + damage = (int)(damage * 1.3f); } else { diff --git a/Items/Weapons/Rogue/LuminousStriker.cs b/Items/Weapons/Rogue/LuminousStriker.cs index c4e48f7c47..bc8cfc463c 100644 --- a/Items/Weapons/Rogue/LuminousStriker.cs +++ b/Items/Weapons/Rogue/LuminousStriker.cs @@ -40,7 +40,7 @@ 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 proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.25f), knockBack, player.whoAmI); if (Main.projectile.IndexInRange(proj)) Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; diff --git a/Items/Weapons/Rogue/Malachite.cs b/Items/Weapons/Rogue/Malachite.cs index b82323811f..a45d0f2d37 100644 --- a/Items/Weapons/Rogue/Malachite.cs +++ b/Items/Weapons/Rogue/Malachite.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Items.Weapons.Rogue for (float i = -6.5f; i <= 6.5f; i += 6.5f) { Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(i)); - int stealth = Projectile.NewProjectile(position, perturbedSpeed, type, damage, knockBack, player.whoAmI); + int stealth = Projectile.NewProjectile(position, perturbedSpeed, type, damage * 2, knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; } diff --git a/Items/Weapons/Rogue/MangroveChakram.cs b/Items/Weapons/Rogue/MangroveChakram.cs index f97f8811a0..e3790b1745 100644 --- a/Items/Weapons/Rogue/MangroveChakram.cs +++ b/Items/Weapons/Rogue/MangroveChakram.cs @@ -37,6 +37,9 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { + if (player.Calamity().StealthStrikeAvailable()) + damage = (int)(damage * 1.25f); + 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/Rogue/Nychthemeron.cs b/Items/Weapons/Rogue/Nychthemeron.cs index 63a17cf9d2..6ecca8420f 100644 --- a/Items/Weapons/Rogue/Nychthemeron.cs +++ b/Items/Weapons/Rogue/Nychthemeron.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Items.Weapons.Rogue p.Calamity().stealthStrike = true; int pID = p.identity; - CreateOrbs(position, (int)(orbDamage * 0.75f), knockBack, pID, player, true); + CreateOrbs(position, (int)(orbDamage * 0.675f), knockBack, pID, player, true); } } else diff --git a/Items/Weapons/Rogue/PalladiumJavelin.cs b/Items/Weapons/Rogue/PalladiumJavelin.cs index 13a6ecd2cb..fd4e8e5326 100644 --- a/Items/Weapons/Rogue/PalladiumJavelin.cs +++ b/Items/Weapons/Rogue/PalladiumJavelin.cs @@ -38,7 +38,10 @@ 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 javelin = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + if (player.Calamity().StealthStrikeAvailable()) + damage = (int)(damage * 1.425f); + + int javelin = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); if (javelin.WithinBounds(Main.maxProjectiles)) { Main.projectile[javelin].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); diff --git a/Items/Weapons/Rogue/PhantomLance.cs b/Items/Weapons/Rogue/PhantomLance.cs index f9a67c76b0..390129866a 100644 --- a/Items/Weapons/Rogue/PhantomLance.cs +++ b/Items/Weapons/Rogue/PhantomLance.cs @@ -47,7 +47,7 @@ Stealth strikes don't slow down and souls always deal full damage"); { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.75f), knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; return false; diff --git a/Items/Weapons/Rogue/Prismalline.cs b/Items/Weapons/Rogue/Prismalline.cs index af6fb5a4b7..923092e91f 100644 --- a/Items/Weapons/Rogue/Prismalline.cs +++ b/Items/Weapons/Rogue/Prismalline.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.15f), knockBack, player.whoAmI); if (proj.WithinBounds(Main.maxProjectiles)) Main.projectile[proj].Calamity().stealthStrike = true; return false; diff --git a/Items/Weapons/Rogue/RegulusRiot.cs b/Items/Weapons/Rogue/RegulusRiot.cs index 0f1218dee1..550b3013a4 100644 --- a/Items/Weapons/Rogue/RegulusRiot.cs +++ b/Items/Weapons/Rogue/RegulusRiot.cs @@ -42,7 +42,7 @@ Stealth strikes explode into energy stars"); { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.2f), knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; return false; diff --git a/Items/Weapons/Rogue/SealedSingularity.cs b/Items/Weapons/Rogue/SealedSingularity.cs index 1f7f5c83d6..29ecb86a76 100644 --- a/Items/Weapons/Rogue/SealedSingularity.cs +++ b/Items/Weapons/Rogue/SealedSingularity.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { - item.damage = 150; + item.damage = 260; item.knockBack = 5f; item.useAnimation = item.useTime = 25; item.useStyle = ItemUseStyleID.SwingThrow; @@ -40,8 +40,8 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - // Directly nerf stealth strikes by 20%, but only stealth strikes. - int stealthDamage = (int)(damage * 0.8f); + // Directly nerf stealth strikes by 32%, but only stealth strikes. + int stealthDamage = (int)(damage * 0.72f); int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, stealthDamage, knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; diff --git a/Items/Weapons/Rogue/ShockGrenade.cs b/Items/Weapons/Rogue/ShockGrenade.cs index 2a40f95ca2..4be340d1d9 100644 --- a/Items/Weapons/Rogue/ShockGrenade.cs +++ b/Items/Weapons/Rogue/ShockGrenade.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.value = Item.buyPrice(0, 1, 0, 0); item.rare = ItemRarityID.Yellow; item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 7.5f; + item.shootSpeed = 12.5f; item.Calamity().rogue = true; } diff --git a/Items/Weapons/Rogue/StarofDestruction.cs b/Items/Weapons/Rogue/StarofDestruction.cs index 7a71be96c9..06ed8ee1ef 100644 --- a/Items/Weapons/Rogue/StarofDestruction.cs +++ b/Items/Weapons/Rogue/StarofDestruction.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 1f); + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 0.8f), knockBack, player.whoAmI, 0f, 1f); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; return false; diff --git a/Items/Weapons/Rogue/StellarKnife.cs b/Items/Weapons/Rogue/StellarKnife.cs index 5c7c901bf0..0f6b0f662c 100644 --- a/Items/Weapons/Rogue/StellarKnife.cs +++ b/Items/Weapons/Rogue/StellarKnife.cs @@ -45,15 +45,17 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable() && player.ownedProjectileCounts[item.shoot] < knifeLimit) { - int knifeAmt = knifeCount; - if ((player.ownedProjectileCounts[item.shoot] + knifeCount) >= knifeLimit) - knifeAmt = knifeLimit - player.ownedProjectileCounts[item.shoot]; - if (knifeAmt <= 0) - { + damage = (int)(damage * 1.1f); + + int knifeAmt = knifeCount; + if ((player.ownedProjectileCounts[item.shoot] + knifeCount) >= knifeLimit) + knifeAmt = knifeLimit - player.ownedProjectileCounts[item.shoot]; + if (knifeAmt <= 0) + { int knife = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - if (knife.WithinBounds(Main.maxProjectiles)) - Main.projectile[knife].Calamity().stealthStrike = true; - } + if (knife.WithinBounds(Main.maxProjectiles)) + Main.projectile[knife].Calamity().stealthStrike = true; + } int spread = 20; for (int i = 0; i < knifeCount; i++) @@ -61,9 +63,9 @@ namespace CalamityMod.Items.Weapons.Rogue speedX *= 0.9f; Vector2 perturbedspeed = new Vector2(speedX, speedY + Main.rand.Next(-3, 4)).RotatedBy(MathHelper.ToRadians(spread)); int knife2 = Projectile.NewProjectile(position, perturbedspeed, type, damage, knockBack, player.whoAmI, 1f, i % 5 == 0 ? 1f : 0f); - if (knife2.WithinBounds(Main.maxProjectiles)) - Main.projectile[knife2].Calamity().stealthStrike = true; - spread -= Main.rand.Next(1, 3); + if (knife2.WithinBounds(Main.maxProjectiles)) + Main.projectile[knife2].Calamity().stealthStrike = true; + spread -= Main.rand.Next(1, 3); } return false; } diff --git a/Items/Weapons/Rogue/StormfrontRazor.cs b/Items/Weapons/Rogue/StormfrontRazor.cs index 1bc0993b65..227cf0c359 100644 --- a/Items/Weapons/Rogue/StormfrontRazor.cs +++ b/Items/Weapons/Rogue/StormfrontRazor.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - int p = Projectile.NewProjectile(position, new Vector2(speedX * 1.6f, speedY * 1.6f), ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0, 40f); + int p = Projectile.NewProjectile(position, new Vector2(speedX, speedY) * 1.6f, ModContent.ProjectileType(), (int)(damage * 1.1f), knockBack, player.whoAmI, 0, 40f); if (p.WithinBounds(Main.maxProjectiles)) Main.projectile[p].Calamity().stealthStrike = true; return false; diff --git a/Items/Weapons/Rogue/TerraDisk.cs b/Items/Weapons/Rogue/TerraDisk.cs index 4bdb033c8b..333446397c 100644 --- a/Items/Weapons/Rogue/TerraDisk.cs +++ b/Items/Weapons/Rogue/TerraDisk.cs @@ -64,11 +64,12 @@ Stealth strikes travel slower and are rapidly orbited by the smaller disks"); 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()) - { - speedX *= 0.75f; - speedY *= 0.75f; - } + if (player.Calamity().StealthStrikeAvailable()) + { + speedX *= 0.75f; + speedY *= 0.75f; + damage = (int)(damage * 0.9f); + } int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); if (player.Calamity().StealthStrikeAvailable() && proj.WithinBounds(Main.maxProjectiles)) { diff --git a/Items/Weapons/Rogue/TerrorTalons.cs b/Items/Weapons/Rogue/TerrorTalons.cs index 27eed3b4d3..121506e8b8 100644 --- a/Items/Weapons/Rogue/TerrorTalons.cs +++ b/Items/Weapons/Rogue/TerrorTalons.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - float stealthDamageMult = 3.25f; + float stealthDamageMult = 4.875f; int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), (int)(damage * stealthDamageMult), knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; diff --git a/Items/Weapons/Rogue/TheSyringe.cs b/Items/Weapons/Rogue/TheSyringe.cs index 03f23ab638..0beac46880 100644 --- a/Items/Weapons/Rogue/TheSyringe.cs +++ b/Items/Weapons/Rogue/TheSyringe.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 1f); + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.2f), knockBack, player.whoAmI, 0f, 1f); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; return false; diff --git a/Items/Weapons/Rogue/TotalityBreakers.cs b/Items/Weapons/Rogue/TotalityBreakers.cs index 61a77c1623..f28e76971c 100644 --- a/Items/Weapons/Rogue/TotalityBreakers.cs +++ b/Items/Weapons/Rogue/TotalityBreakers.cs @@ -41,7 +41,7 @@ Stealth strikes leak tar as they fly"); { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.15f), knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; return false; diff --git a/Items/Weapons/Rogue/XerocPitchfork.cs b/Items/Weapons/Rogue/XerocPitchfork.cs index cb7e081ce6..416e77f6a5 100644 --- a/Items/Weapons/Rogue/XerocPitchfork.cs +++ b/Items/Weapons/Rogue/XerocPitchfork.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.value = 10000; item.rare = ItemRarityID.Cyan; item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 16f; + item.shootSpeed = 24f; item.Calamity().rogue = true; } @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.5f), knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; } diff --git a/Items/Weapons/Summon/AngryChickenStaff.cs b/Items/Weapons/Summon/AngryChickenStaff.cs index c8194c0193..01509f8bab 100644 --- a/Items/Weapons/Summon/AngryChickenStaff.cs +++ b/Items/Weapons/Summon/AngryChickenStaff.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Summon { DisplayName.SetDefault("Yharon's Kindle Staff"); Tooltip.SetDefault("Summons the Son of Yharon to fight for you\n" + - "Requires 4 minion slots to use"); + "Requires 5 minion slots to use"); } public override void SetDefaults() diff --git a/Items/Weapons/Summon/BlightedEyeStaff.cs b/Items/Weapons/Summon/BlightedEyeStaff.cs index 7a59a8a330..9a8c4511f9 100644 --- a/Items/Weapons/Summon/BlightedEyeStaff.cs +++ b/Items/Weapons/Summon/BlightedEyeStaff.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Items.Weapons.Summon { item.damage = 40; item.mana = 10; - item.width = 62; - item.height = 62; + item.width = 52; + item.height = 52; item.useTime = item.useAnimation = 25; item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; diff --git a/Items/Weapons/Summon/StaffoftheMechworm.cs b/Items/Weapons/Summon/StaffoftheMechworm.cs index 5c7d172699..addae8e27e 100644 --- a/Items/Weapons/Summon/StaffoftheMechworm.cs +++ b/Items/Weapons/Summon/StaffoftheMechworm.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items.Weapons.Summon { item.damage = BaseDamage; item.mana = 10; - item.width = 58; - item.height = 58; + item.width = 68; + item.height = 68; item.useTime = item.useAnimation = 10; // 9 because of useStyle 1 item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; diff --git a/Items/Weapons/Summon/Vigilance.cs b/Items/Weapons/Summon/Vigilance.cs index 250df5d6c7..32b29fbe31 100644 --- a/Items/Weapons/Summon/Vigilance.cs +++ b/Items/Weapons/Summon/Vigilance.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 333; + item.damage = 150; item.mana = 10; item.width = item.height = 32; item.useTime = item.useAnimation = 10; diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 8b195dc7ab..f0be6537aa 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -494,8 +494,8 @@ namespace CalamityMod BossDifficulty.TryGetValue("CeaselessVoid", out float order); List bosses = new List() { NPCType(), NPCType() }; int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - List collection = new List() { ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}] in the Dungeon"; string despawn = CalamityUtils.ColorMessage("The rift in time and space has moved away from your reach.", new Color(0x4B, 0x00, 0x82)); AddBoss(bossChecklist, calamity, "Ceaseless Void", order, bosses, DownedCeaselessVoid, summon, loot, collection, instructions, despawn); @@ -506,8 +506,8 @@ namespace CalamityMod BossDifficulty.TryGetValue("StormWeaver", out float order); List segments = new List() { NPCType(), NPCType(), NPCType() }; int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; - List collection = new List() { ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}] in Space"; string despawn = CalamityUtils.ColorMessage("Storm Weaver hid itself once again within the stormfront.", new Color(0xEE, 0x82, 0xEE)); string bossLogTex = "CalamityMod/NPCs/StormWeaver/StormWeaver_BossChecklist"; @@ -519,8 +519,8 @@ namespace CalamityMod BossDifficulty.TryGetValue("Signus", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - List collection = new List() { ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}] in the Underworld"; string despawn = CalamityUtils.ColorMessage("The Devourer's assassin has finished its easy task.", new Color(0xBA, 0x55, 0xD3)); AddBoss(bossChecklist, calamity, "Signus", order, type, DownedSignus, summon, loot, collection, instructions, despawn); @@ -556,7 +556,7 @@ namespace CalamityMod int type = NPCType(); int summon = ItemType(); List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - List collection = new List() { ItemType(), ItemType(), ItemType() }; + List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}]"; string despawn = CalamityUtils.ColorMessage("The Devourer of Gods has slain everyone and feasted on their essence.", new Color(0x00, 0xFF, 0xFF)); string bossLogTex = "CalamityMod/NPCs/DevourerofGods/DevourerofGods_BossChecklist"; @@ -597,8 +597,8 @@ namespace CalamityMod BossDifficulty.TryGetValue("SupremeCalamitas", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}]"; string despawn = CalamityUtils.ColorMessage("Please don't waste my time.", new Color(0xFF, 0xA5, 0x00)); AddBoss(bossChecklist, calamity, "Supreme Calamitas", order, type, DownedSCal, summon, loot, collection, instructions, despawn); diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index af1a53d1e9..a46b9c0f82 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -759,8 +759,6 @@ namespace CalamityMod.NPCs ResetSavedIndex(ref adultEidolonWyrmHead, NPCType()); - CalamityGlobalTownNPC.ResetTownNPCNameBools(npc, mod); - // Reset the enraged state every frame. The expectation is that bosses will continuously set it back to true if necessary. CurrentlyEnraged = false; CanHaveBossHealthBar = false; diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 08162d1ccc..719a9a0067 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -170,7 +170,7 @@ namespace CalamityMod.NPCs #endregion #region Town NPC Names - public static void ResetTownNPCNameBools(NPC npc, Mod mod) + public static void ResetTownNPCNameBools() { void ResetName(int npcID, ref bool nameBool) { diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index a149cb51aa..9f2e068018 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -186,7 +186,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (Main.npc[(int)npc.ai[2]].ModNPC()?.AttemptingToEnterPortal ?? false) { Projectile portal = Main.projectile[Main.npc[(int)npc.ai[2]].ModNPC().PortalIndex]; - float newOpacity = 1f - Utils.InverseLerp(150f, 70f, npc.Distance(portal.Center), true); + float newOpacity = 1f - Utils.InverseLerp(130f, 80f, npc.Distance(portal.Center), true); if (Main.netMode != NetmodeID.MultiplayerClient && newOpacity > 0f && npc.Opacity > newOpacity) { npc.Opacity = newOpacity; diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index d779ed9998..36267101fe 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -365,10 +365,11 @@ namespace CalamityMod.NPCs.ExoMechs.Ares // Rotation npc.rotation = npc.velocity.X * 0.003f; - // Light + // Light and enrage check if (EnragedState == (float)Enraged.Yes) { Lighting.AddLight(npc.Center, 0.5f * npc.Opacity, 0f, 0f); + npc.Calamity().CurrentlyEnraged = true; } else { diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 9cc4ad27ee..5c5785dcb1 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -1033,7 +1033,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // A general factor for the aura. // Used to cause fade-ins/outs as the attack starts/stops. float auraGeneralPower = Utils.InverseLerp(0f, deathrayTelegraphDuration * 0.333f, npc.Calamity().newAI[2], true); - auraGeneralPower *= Utils.InverseLerp(deathrayTelegraphDuration + deathrayDuration, deathrayTelegraphDuration + deathrayDuration - 40f, npc.Calamity().newAI[2], true); + auraGeneralPower *= Utils.InverseLerp(deathrayTelegraphDuration + deathrayDuration, deathrayTelegraphDuration + deathrayDuration, npc.Calamity().newAI[2], true); // Determine the characteristics of the aura. This requires intermediate computations to determine if Thanatos is in its final phase as well as for pulsing. bool berserk = lifeRatio < 0.4f || (otherExoMechsAlive == 0 && lifeRatio < 0.7f); diff --git a/Projectiles/Boss/ArtemisLaserBeamStart.cs b/Projectiles/Boss/ArtemisLaserBeamStart.cs index 74d081c072..327808bbfa 100644 --- a/Projectiles/Boss/ArtemisLaserBeamStart.cs +++ b/Projectiles/Boss/ArtemisLaserBeamStart.cs @@ -1,33 +1,36 @@ using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using CalamityMod.Events; -using CalamityMod.World; +using CalamityMod.NPCs.ExoMechs.Artemis; +using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using System.IO; +using System.Linq; using Terraria; -using Terraria.Enums; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { - public class ArtemisLaserBeamStart : ModProjectile + public class ArtemisLaserBeamStart : BaseLaserbeamProjectile { + public int OwnerIndex + { + get => (int)projectile.ai[0]; + set => projectile.ai[0] = value; + } + public override float MaxScale => 1f; + public override float MaxLaserLength => 4800f; + public override float Lifetime => 600; + public override Color LaserOverlayColor => new Color(250, 180, 100, 100); + public override Color LightCastColor => Color.White; + public override Texture2D LaserBeginTexture => Main.projectileTexture[projectile.type]; + public override Texture2D LaserMiddleTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/AresLaserBeamMiddle"); + public override Texture2D LaserEndTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/AresLaserBeamEnd"); public override string Texture => "CalamityMod/Projectiles/Boss/AresLaserBeamStart"; - public NPC ThingToAttachTo => Main.npc.IndexInRange((int)projectile.ai[0]) ? Main.npc[(int)projectile.ai[0]] : null; - public ref float RotationDirection => ref projectile.ai[1]; - public ref float Time => ref projectile.localAI[0]; - public ref float LengthOfLaser => ref projectile.localAI[1]; - public const int Lifetime = 180; - public const float BeamPosOffset = 16f; - private const int maxFrames = 5; - private int frameDrawn = 0; - public override void SetStaticDefaults() { DisplayName.SetDefault("Ohio Beam"); + Main.projFrames[projectile.type] = 5; // This is its serious name // DisplayName.SetDefault("Exothermal Artemis Beam"); } @@ -47,179 +50,128 @@ namespace CalamityMod.Projectiles.Boss public override void SendExtraAI(BinaryWriter writer) { - writer.Write(frameDrawn); - writer.Write(Time); - writer.Write(LengthOfLaser); + writer.Write(projectile.localAI[0]); + writer.Write(projectile.localAI[1]); } public override void ReceiveExtraAI(BinaryReader reader) { - frameDrawn = reader.ReadInt32(); - Time = reader.ReadSingle(); - LengthOfLaser = reader.ReadSingle(); + projectile.localAI[0] = reader.ReadSingle(); + projectile.localAI[1] = reader.ReadSingle(); } - public override void AI() + public override void AttachToSomething() { - // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || malice; - bool revenge = CalamityWorld.revenge || malice; - bool expertMode = Main.expertMode || malice; + if (Main.npc[OwnerIndex].active && Main.npc[OwnerIndex].type == ModContent.NPCType()) + { + Vector2 fireFrom = Main.npc[OwnerIndex].Center + Vector2.UnitY * Main.npc[OwnerIndex].gfxOffY; + fireFrom += projectile.velocity.SafeNormalize(Vector2.UnitY) * 78f; + projectile.Center = fireFrom; + } - // Die if the thing to attach to disappears. - if (ThingToAttachTo is null || !ThingToAttachTo.active || ThingToAttachTo.Calamity().newAI[0] != 3f) + // Die of the owner is invalid in some way. + else { projectile.Kill(); return; } - projectile.rotation = ThingToAttachTo.rotation; + // Die if the owner is not performing Artemis' deathray attack. + if (Main.npc[OwnerIndex].Calamity().newAI[0] != (float)Artemis.Phase.Deathray) + { + projectile.Kill(); + return; + } + } + + public override float DetermineLaserLength() + { + float[] sampledLengths = new float[10]; + Collision.LaserScan(projectile.Center, projectile.velocity, projectile.width * projectile.scale, MaxLaserLength, sampledLengths); + + float newLaserLength = sampledLengths.Average(); + + // Fire laser through walls at max length if target is behind tiles. + if (!Collision.CanHitLine(Main.npc[OwnerIndex].Center, 1, 1, Main.player[Main.npc[OwnerIndex].target].Center, 1, 1)) + newLaserLength = MaxLaserLength; + + return newLaserLength; + } + + public override void UpdateLaserMotion() + { + projectile.rotation = Main.npc[OwnerIndex].rotation; projectile.velocity = (projectile.rotation - MathHelper.PiOver2).ToRotationVector2(); + } - // Offset to move the beam forward so that it starts in Artemis' focus jewel thing. - float beamStartForwardsOffset = 80f; - - // Set the starting location of the beam to the center of the NPC. - projectile.Center = ThingToAttachTo.Center; - // Add a fixed offset to align with the NPC's spritesheet (?) - projectile.position += projectile.velocity * BeamPosOffset + new Vector2(0f, -ThingToAttachTo.gfxOffY); - // Add the forwards offset, measured in pixels. - projectile.position += projectile.velocity * beamStartForwardsOffset; - - Time++; - if (Time >= Lifetime) - { - projectile.Kill(); - return; - } - - float scale = 1f; - projectile.scale = (float)Math.Sin(Time * MathHelper.Pi / Lifetime) * 10f * scale; - if (projectile.scale > scale) - projectile.scale = scale; - - float arraySize = 3f; - Vector2 samplingPoint = projectile.Center; - float[] samples = new float[(int)arraySize]; - Collision.LaserScan(samplingPoint, projectile.velocity, projectile.width * projectile.scale, 4800f, samples); - float laserLength = 0f; - for (int i = 0; i < samples.Length; i++) - { - laserLength += samples[i]; - } - laserLength /= arraySize; - - // Fire laser through walls at max length if target cannot be seen - if (!Collision.CanHitLine(ThingToAttachTo.Center, 1, 1, Main.player[ThingToAttachTo.target].Center, 1, 1)) - laserLength = 4800f; - - float amount = 0.5f; - LengthOfLaser = MathHelper.Lerp(LengthOfLaser, laserLength, amount); - - // Spawn dust at the end of the beam - int dustType = (int)CalamityDusts.Brimstone; - Vector2 dustPos = projectile.Center + projectile.velocity * (LengthOfLaser - 14f); - for (int i = 0; i < 2; i++) - { - float dustRot = projectile.velocity.ToRotation() + ((Main.rand.Next(2) == 1) ? -1f : 1f) * MathHelper.PiOver2; - float dustVelMult = (float)Main.rand.NextDouble() * 2f + 2f; - Vector2 dustVel = new Vector2((float)Math.Cos(dustRot) * dustVelMult, (float)Math.Sin(dustRot) * dustVelMult); - int dust = Dust.NewDust(dustPos, 0, 0, dustType, dustVel.X, dustVel.Y, 0, default, 1f); - Main.dust[dust].noGravity = true; - Main.dust[dust].scale = 1.7f; - } - - if (Main.rand.NextBool(5)) - { - Vector2 dustRot = projectile.velocity.RotatedBy(MathHelper.PiOver2, default) * ((float)Main.rand.NextDouble() - 0.5f) * projectile.width; - int dust = Dust.NewDust(dustPos + dustRot - Vector2.One * 4f, 8, 8, dustType, 0f, 0f, 100, default, 1.5f); - Main.dust[dust].velocity *= 0.5f; - Main.dust[dust].velocity.Y = -Math.Abs(Main.dust[dust].velocity.Y); - } - - DelegateMethods.v3_1 = new Vector3(0.3f, 0.65f, 0.7f); - Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * LengthOfLaser, projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CastLight)); + public override void PostAI() + { + // Determine frames. + projectile.frameCounter++; + if (projectile.frameCounter % 5f == 0f) + projectile.frame = (projectile.frame + 1) % Main.projFrames[projectile.type]; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { + // This should never happen, but just in case. if (projectile.velocity == Vector2.Zero) return false; - Texture2D beamStart = Main.projectileTexture[projectile.type]; - Texture2D beamMiddle = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/AresLaserBeamMiddle"); - Texture2D beamEnd = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/AresLaserBeamEnd"); + Color beamColor = LaserOverlayColor; + Rectangle startFrameArea = LaserBeginTexture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); + Rectangle middleFrameArea = LaserMiddleTexture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); + Rectangle endFrameArea = LaserEndTexture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); - float drawLength = LengthOfLaser; - Color color = new Color(250, 180, 100, 100); + // Start texture drawing. + spriteBatch.Draw(LaserBeginTexture, + projectile.Center - Main.screenPosition, + startFrameArea, + beamColor, + projectile.rotation, + LaserBeginTexture.Size() / 2f, + projectile.scale, + SpriteEffects.FlipVertically, + 0f); - if (Time % 5 == 0) + // Prepare things for body drawing. + float laserBodyLength = LaserLength + middleFrameArea.Height; + Vector2 centerOnLaser = projectile.Center + projectile.velocity * projectile.scale * 5f; + + // Body drawing. + if (laserBodyLength > 0f) { - frameDrawn++; - if (frameDrawn >= maxFrames) - frameDrawn = 0; - } - - // Draw start of beam - Vector2 vector = projectile.Center - Main.screenPosition; - Rectangle? sourceRectangle = new Rectangle(0, beamStart.Height / maxFrames * frameDrawn, beamStart.Width, beamStart.Height / maxFrames); - spriteBatch.Draw(beamStart, vector, sourceRectangle, color, projectile.rotation, new Vector2(beamStart.Width, beamStart.Height / maxFrames) / 2f, projectile.scale, SpriteEffects.None, 0f); - - // Draw middle of beam - drawLength -= (beamStart.Height / maxFrames / 2 + beamEnd.Height / maxFrames) * projectile.scale; - Vector2 center = projectile.Center; - center += projectile.velocity * projectile.scale * beamStart.Height / maxFrames / 2f; - if (drawLength > 0f) - { - float i = 0f; - int middleFrameDrawn = frameDrawn; - while (i + 1f < drawLength) + float laserOffset = middleFrameArea.Height * projectile.scale; + float incrementalBodyLength = 0f; + while (incrementalBodyLength + 1f < laserBodyLength) { - Rectangle rectangle = new Rectangle(0, beamMiddle.Height / maxFrames * middleFrameDrawn, beamMiddle.Width, beamMiddle.Height / maxFrames); - - if (drawLength - i < rectangle.Height) - rectangle.Height = (int)(drawLength - i); - - spriteBatch.Draw(beamMiddle, center - Main.screenPosition, rectangle, color, projectile.rotation, new Vector2(rectangle.Width / 2f, 0f), projectile.scale, SpriteEffects.None, 0f); - - middleFrameDrawn++; - if (middleFrameDrawn >= maxFrames) - middleFrameDrawn = 0; - - i += rectangle.Height * projectile.scale; - center += projectile.velocity * rectangle.Height * projectile.scale; - - rectangle.Y += beamMiddle.Height / maxFrames; - if (rectangle.Y + rectangle.Height > beamMiddle.Height / maxFrames) - rectangle.Y = 0; + spriteBatch.Draw(LaserMiddleTexture, + centerOnLaser - Main.screenPosition, + middleFrameArea, + beamColor, + projectile.rotation, + LaserMiddleTexture.Size() * 0.5f, + projectile.scale, + SpriteEffects.None, + 0f); + incrementalBodyLength += laserOffset; + centerOnLaser += projectile.velocity * laserOffset; + middleFrameArea.Y += LaserMiddleTexture.Height / Main.projFrames[projectile.type]; + if (middleFrameArea.Y + middleFrameArea.Height > LaserMiddleTexture.Height) + middleFrameArea.Y = 0; } } - // Draw end of beam - Vector2 vector2 = center - Main.screenPosition; - sourceRectangle = new Rectangle(0, beamEnd.Height / maxFrames * frameDrawn, beamEnd.Width, beamEnd.Height / maxFrames); - spriteBatch.Draw(beamEnd, vector2, sourceRectangle, color, projectile.rotation, new Vector2(beamEnd.Width, beamEnd.Height / maxFrames) / 2f, projectile.scale, SpriteEffects.None, 0f); - - return false; - } - - public override void CutTiles() - { - DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; - Vector2 unit = projectile.velocity; - Utils.PlotTileLine(projectile.Center, projectile.Center + unit * LengthOfLaser, projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); - } - - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) - { - if (projHitbox.Intersects(targetHitbox)) - return true; - - float collisionPoint = 0f; - if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center, projectile.Center + projectile.velocity * LengthOfLaser, 30f * projectile.scale, ref collisionPoint)) - return true; - + Vector2 laserEndCenter = centerOnLaser - Main.screenPosition; + spriteBatch.Draw(LaserEndTexture, + laserEndCenter, + endFrameArea, + beamColor, + projectile.rotation, + LaserEndTexture.Size() * 0.5f, + projectile.scale, + SpriteEffects.FlipVertically, + 0f); return false; } diff --git a/Projectiles/Boss/DoGP1EndPortal.cs b/Projectiles/Boss/DoGP1EndPortal.cs index 0ac8788825..23cf4ea922 100644 --- a/Projectiles/Boss/DoGP1EndPortal.cs +++ b/Projectiles/Boss/DoGP1EndPortal.cs @@ -1,9 +1,9 @@ using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System.Collections.Generic; using Terraria; -using Terraria.Graphics.Effects; -using Terraria.ID; +using Terraria.Graphics.Shaders; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss @@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Boss projectile.tileCollide = false; projectile.ignoreWater = true; projectile.timeLeft = 60000; + projectile.hide = true; } public override void AI() @@ -44,24 +45,25 @@ namespace CalamityMod.Projectiles.Boss projectile.Kill(); } - public override void Kill(int timeLeft) + public override void DrawBehind(int index, List drawCacheProjsBehindNPCsAndTiles, List drawCacheProjsBehindNPCs, List drawCacheProjsBehindProjectiles, List drawCacheProjsOverWiresUI) { - if (Main.netMode != NetmodeID.Server && Filters.Scene["CalamityMod:DoGPortal"].IsActive()) - Filters.Scene["CalamityMod:DoGPortal"].Deactivate(); + drawCacheProjsOverWiresUI.Add(index); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - // Manage a screen shader that acts as the projectile. - if (Filters.Scene["CalamityMod:DoGPortal"].IsActive()) - Filters.Scene["CalamityMod:DoGPortal"].Deactivate(); + spriteBatch.EnterShaderRegion(); - Filters.Scene.Activate("CalamityMod:DoGPortal", projectile.Center).GetShader().UseTargetPosition(projectile.Center); - Filters.Scene["CalamityMod:DoGPortal"].GetShader().UseImage("Images/Misc/Perlin"); - Filters.Scene["CalamityMod:DoGPortal"].GetShader().UseColor(Color.Cyan); - Filters.Scene["CalamityMod:DoGPortal"].GetShader().UseSecondaryColor(Color.Fuchsia); - Filters.Scene["CalamityMod:DoGPortal"].GetShader().UseImage(ModContent.GetTexture("CalamityMod/ExtraTextures/VoronoiShapes")); - Filters.Scene["CalamityMod:DoGPortal"].GetShader().UseProgress(projectile.scale); + Texture2D noiseTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/VoronoiShapes"); + Vector2 drawPosition = projectile.Center - Main.screenPosition; + Vector2 origin = noiseTexture.Size() * 0.5f; + GameShaders.Misc["CalamityMod:DoGPortal"].UseOpacity(projectile.scale); + GameShaders.Misc["CalamityMod:DoGPortal"].UseColor(Color.Cyan); + GameShaders.Misc["CalamityMod:DoGPortal"].UseSecondaryColor(Color.Fuchsia); + GameShaders.Misc["CalamityMod:DoGPortal"].Apply(); + + spriteBatch.Draw(noiseTexture, drawPosition, null, Color.White, 0f, origin, 3.5f, SpriteEffects.None, 0f); + spriteBatch.ExitShaderRegion(); return false; } diff --git a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs index ad16e2d76b..d5b0f4e29a 100644 --- a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs +++ b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs @@ -172,7 +172,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal player.ChangeDir(projectile.direction); player.itemTime = 2; player.itemAnimation = 2; - player.itemRotation = projectile.rotation * projectile.direction; + player.itemRotation = CalamityUtils.WrapAngle90Degrees(projectile.rotation); } private void OnShrinkEffects() diff --git a/Projectiles/DraedonsArsenal/SystemBaneProjectile.cs b/Projectiles/DraedonsArsenal/SystemBaneProjectile.cs index 5379190720..437c7a12aa 100644 --- a/Projectiles/DraedonsArsenal/SystemBaneProjectile.cs +++ b/Projectiles/DraedonsArsenal/SystemBaneProjectile.cs @@ -60,9 +60,15 @@ namespace CalamityMod.Projectiles.DraedonsArsenal // Every so often, generate some lightning at a nearby enemy, if one exists. if (Time % LightningFireRate == 0f && Main.myPlayer == projectile.owner) { + int lightningDamage = projectile.damage; + int totalSystemBanes = Main.player[projectile.owner].ownedProjectileCounts[projectile.type]; + + // Make the damage of the lightning have diminishing returns depending on how many systems are present. + lightningDamage = (int)Math.Ceiling(lightningDamage / Math.Pow(totalSystemBanes, 1D / 3D)); + NPC potentialTarget = projectile.Center.ClosestNPCAt(900f); if (potentialTarget != null) - Projectile.NewProjectile(projectile.Center, projectile.SafeDirectionTo(potentialTarget.Center) * 15f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); + Projectile.NewProjectile(projectile.Center, projectile.SafeDirectionTo(potentialTarget.Center) * 15f, ModContent.ProjectileType(), lightningDamage, projectile.knockBack, projectile.owner); } // Sometimes generate lightning from the outside of the energy field if the projectile was spawned by a stealth strike. diff --git a/Projectiles/Magic/FabBolt.cs b/Projectiles/Magic/FabBolt.cs index 99420e8491..f36a057da4 100644 --- a/Projectiles/Magic/FabBolt.cs +++ b/Projectiles/Magic/FabBolt.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Magic TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, PrimitiveTrail.RigidPointRetreivalFunction, GameShaders.Misc["CalamityMod:TrailStreak"]); GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/FabstaffStreak")); - TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 120, projectile.oldRot); + TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 80, projectile.oldRot); return false; } diff --git a/Projectiles/Magic/FabRay.cs b/Projectiles/Magic/FabRay.cs index 137015fad6..02ca07f9ee 100644 --- a/Projectiles/Magic/FabRay.cs +++ b/Projectiles/Magic/FabRay.cs @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Magic TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/ScarletDevilStreak")); - TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 76); + TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 32); return false; } diff --git a/Projectiles/Magic/RancorHoldout.cs b/Projectiles/Magic/RancorHoldout.cs index 38cb815bb4..26059112dd 100644 --- a/Projectiles/Magic/RancorHoldout.cs +++ b/Projectiles/Magic/RancorHoldout.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Projectiles.Magic projectile.magic = true; projectile.ignoreWater = true; projectile.hide = true; + projectile.timeLeft = 90000; } public override void AI() diff --git a/Projectiles/Magic/RancorMagicCircle.cs b/Projectiles/Magic/RancorMagicCircle.cs index 52e4af83a2..284c344de7 100644 --- a/Projectiles/Magic/RancorMagicCircle.cs +++ b/Projectiles/Magic/RancorMagicCircle.cs @@ -29,6 +29,7 @@ namespace CalamityMod.Projectiles.Magic projectile.tileCollide = false; projectile.magic = true; projectile.ignoreWater = true; + projectile.timeLeft = 90000; } public override void AI() diff --git a/Projectiles/Magic/SpiritCongregation.cs b/Projectiles/Magic/SpiritCongregation.cs index 14dd4dd41e..b8e04f6890 100644 --- a/Projectiles/Magic/SpiritCongregation.cs +++ b/Projectiles/Magic/SpiritCongregation.cs @@ -331,7 +331,7 @@ namespace CalamityMod.Projectiles.Magic { for (int i = 0; i < projectile.oldPos.Length; i++) { - float hitboxRadius = CongregationDiameter * MathHelper.Lerp(0.45f, 0.17f, i / (float)projectile.oldPos.Length); + float hitboxRadius = CongregationDiameter * MathHelper.Lerp(0.45f, 0.17f, i / (float)projectile.oldPos.Length) * 1.4f; Vector2 hitboxCircle = Vector2.One * hitboxRadius; if (CalamityUtils.CircularHitboxCollision(projectile.oldPos[i] + hitboxCircle * 0.5f, hitboxRadius, targetHitbox)) return true; diff --git a/Projectiles/Magic/T1000Proj.cs b/Projectiles/Magic/T1000Proj.cs index ba4cb99c21..9b0e6ede7b 100644 --- a/Projectiles/Magic/T1000Proj.cs +++ b/Projectiles/Magic/T1000Proj.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetDefaults() { - projectile.width = 80; - projectile.height = 34; + projectile.width = 58; + projectile.height = 94; projectile.friendly = true; projectile.penetrate = -1; projectile.tileCollide = false; @@ -113,7 +113,8 @@ namespace CalamityMod.Projectiles.Magic } } projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; - projectile.Center = player.RotatedRelativePoint(player.MountedCenter, true) + projectile.velocity.SafeNormalize(Vector2.UnitX * player.direction) * 6f; + projectile.Center = player.RotatedRelativePoint(player.MountedCenter, true) + projectile.velocity.SafeNormalize(Vector2.UnitX * player.direction) * 8f; + projectile.position.Y -= 8f; projectile.spriteDirection = projectile.direction; projectile.timeLeft = 2; player.ChangeDir(projectile.direction); diff --git a/Projectiles/Melee/AtaraxiaHoming.cs b/Projectiles/Melee/AtaraxiaHoming.cs index fc6928c060..3395c4efe4 100644 --- a/Projectiles/Melee/AtaraxiaHoming.cs +++ b/Projectiles/Melee/AtaraxiaHoming.cs @@ -1,8 +1,11 @@ +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Melee { + // TODO - Abstract away most of the direct vector math away in here into things like SafeDirectionTo calls. public class AtaraxiaHoming : ModProjectile { private static int NumAnimationFrames = 5; @@ -106,11 +109,14 @@ namespace CalamityMod.Projectiles.Melee dx *= homingFactor; dy *= homingFactor; - // The projectile loses 1/6th of its current velocity and replaces it with homing power. - float homingStrength = 6f; + // The projectile loses 1/5th of its current velocity and replaces it with homing power. + float homingStrength = 5f; projectile.velocity.X = (projectile.velocity.X * (homingStrength - 1f) + dx) / homingStrength; projectile.velocity.Y = (projectile.velocity.Y * (homingStrength - 1f) + dy) / homingStrength; + // And then approaches the homing velocity by an increment of 0.3. + projectile.velocity = projectile.velocity.MoveTowards(new Vector2(dx, dy), 0.3f); + // Re-scale resulting velocity to the projectile's set maximum speed projectile.velocity.Normalize(); projectile.velocity *= speed; diff --git a/Projectiles/Pets/DaawnlightSpiritOriginMinion.cs b/Projectiles/Pets/DaawnlightSpiritOriginMinion.cs index 695d6ce68b..612c42e69e 100644 --- a/Projectiles/Pets/DaawnlightSpiritOriginMinion.cs +++ b/Projectiles/Pets/DaawnlightSpiritOriginMinion.cs @@ -12,7 +12,6 @@ namespace CalamityMod.Projectiles.Pets { DisplayName.SetDefault("Daawnlight"); Main.projFrames[projectile.type] = 12; - Main.projPet[projectile.type] = true; } public override void SetDefaults() diff --git a/Projectiles/Ranged/DrataliornusBow.cs b/Projectiles/Ranged/DrataliornusBow.cs index 17987e2d85..4204c9b125 100644 --- a/Projectiles/Ranged/DrataliornusBow.cs +++ b/Projectiles/Ranged/DrataliornusBow.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Ranged } } - int baseUseTime = 35; + int baseUseTime = 38; int modifier = 3; bool timeToFire = false; if (projectile.ai[1] <= 0f) diff --git a/Projectiles/Ranged/DrataliornusFlame.cs b/Projectiles/Ranged/DrataliornusFlame.cs index 2b3f442c45..19ceee081d 100644 --- a/Projectiles/Ranged/DrataliornusFlame.cs +++ b/Projectiles/Ranged/DrataliornusFlame.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Ranged } projectile.localAI[0]++; - if (projectile.localAI[0] > 30f) //dragon dust trail counter, but only empowered proj spawns it + if (projectile.localAI[0] > 60f) //dragon dust trail counter, but only empowered proj spawns it { projectile.localAI[0] = 0f; @@ -231,7 +231,7 @@ namespace CalamityMod.Projectiles.Ranged vel.X += Main.rand.Next(-100, 101); vel.Normalize(); vel *= 30f; - Projectile.NewProjectile(pos, vel + target.velocity, ModContent.ProjectileType(), projectile.damage * 3, projectile.knockBack * 5f, projectile.owner); + Projectile.NewProjectile(pos, vel + target.velocity, ModContent.ProjectileType(), (int)(projectile.damage * 1.5f), projectile.knockBack * 5f, projectile.owner); } } } diff --git a/Projectiles/Rogue/BlastBarrelProjectile.cs b/Projectiles/Rogue/BlastBarrelProjectile.cs index 2aaa0865be..6d635d9efd 100644 --- a/Projectiles/Rogue/BlastBarrelProjectile.cs +++ b/Projectiles/Rogue/BlastBarrelProjectile.cs @@ -46,8 +46,8 @@ namespace CalamityMod.Projectiles.Rogue projectile.localAI[0] = 1f; } projectile.rotation += Math.Sign(projectile.velocity.X) * MathHelper.ToRadians(8f); - if (projectile.velocity.Y < 15f) - projectile.velocity.Y += 0.3f; + if (projectile.velocity.Y < 10f) + projectile.velocity.Y += 0.2f; if (CollideX && BounceEffectCooldown == 0) { diff --git a/Projectiles/Rogue/BurningStrifeProj.cs b/Projectiles/Rogue/BurningStrifeProj.cs index ab9272292e..a827763f13 100644 --- a/Projectiles/Rogue/BurningStrifeProj.cs +++ b/Projectiles/Rogue/BurningStrifeProj.cs @@ -60,6 +60,7 @@ namespace CalamityMod.Projectiles.Rogue { Main.PlaySound(SoundID.Item, projectile.Center, 103); int proj = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.33), projectile.knockBack, projectile.owner); + Main.projectile[proj].timeLeft += 20; Main.projectile[proj].Center = projectile.Center; Main.projectile[proj].Calamity().rogue = true; } @@ -72,6 +73,7 @@ namespace CalamityMod.Projectiles.Rogue { Main.PlaySound(SoundID.Item, projectile.Center, 103); int proj = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.33), projectile.knockBack, projectile.owner); + Main.projectile[proj].timeLeft += 20; Main.projectile[proj].Center = projectile.Center; Main.projectile[proj].Calamity().rogue = true; } diff --git a/Projectiles/Rogue/Crushax.cs b/Projectiles/Rogue/Crushax.cs index 26c1194e50..59fae30002 100644 --- a/Projectiles/Rogue/Crushax.cs +++ b/Projectiles/Rogue/Crushax.cs @@ -22,6 +22,8 @@ namespace CalamityMod.Projectiles.Rogue projectile.penetrate = 2; projectile.aiStyle = 2; projectile.timeLeft = 300; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 14; aiType = ProjectileID.ThrowingKnife; projectile.Calamity().rogue = true; } diff --git a/Projectiles/Rogue/FlameScytheProjectile.cs b/Projectiles/Rogue/FlameScytheProjectile.cs index be8a2ab3ab..bc8bb1fd7e 100644 --- a/Projectiles/Rogue/FlameScytheProjectile.cs +++ b/Projectiles/Rogue/FlameScytheProjectile.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Rogue Point result; if (WorldUtils.Find(projectile.Top.ToTileCoordinates(), Searches.Chain((GenSearch)new Searches.Down(80), (GenCondition)new Conditions.IsSolid()), out result)) { - Projectile.NewProjectile(result.ToVector2() * 16f, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, 2f, projectile.owner, 1f); + Projectile.NewProjectile(result.ToVector2() * 16f, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 1.5f), 2f, projectile.owner, 1f); projectile.localAI[0] = 30f; } } diff --git a/Projectiles/Rogue/LuminousStrikerProj.cs b/Projectiles/Rogue/LuminousStrikerProj.cs index 424654f468..a61564046a 100644 --- a/Projectiles/Rogue/LuminousStrikerProj.cs +++ b/Projectiles/Rogue/LuminousStrikerProj.cs @@ -19,15 +19,17 @@ namespace CalamityMod.Projectiles.Rogue ProjectileID.Sets.TrailingMode[projectile.type] = 0; } - public override void SetDefaults() - { - projectile.width = 30; - projectile.height = 30; - projectile.friendly = true; + public override void SetDefaults() + { + projectile.width = 30; + projectile.height = 30; + projectile.friendly = true; projectile.ignoreWater = true; - projectile.penetrate = 1; - projectile.timeLeft = 120; - projectile.Calamity().rogue = true; + projectile.penetrate = 4; + projectile.localNPCHitCooldown = 13; + projectile.usesLocalNPCImmunity = true; + projectile.timeLeft = 120; + projectile.Calamity().rogue = true; } public override void AI() diff --git a/Projectiles/Rogue/MangroveChakramProjectile.cs b/Projectiles/Rogue/MangroveChakramProjectile.cs index db5b73d2c1..a7d3ca2287 100644 --- a/Projectiles/Rogue/MangroveChakramProjectile.cs +++ b/Projectiles/Rogue/MangroveChakramProjectile.cs @@ -35,14 +35,18 @@ namespace CalamityMod.Projectiles.Rogue Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 44, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); if (projectile.Calamity().stealthStrike) { + // Die early. + if (projectile.timeLeft < 240) + projectile.Kill(); + projectile.localAI[0] += Main.rand.Next(0,3); - if (projectile.localAI[0] >= 10f) - { + if (projectile.localAI[0] >= 10f) + { projectile.localAI[0] = 0f; - Projectile.NewProjectile(projectile.Center + new Vector2(Main.rand.NextFloat(-10f,10f), Main.rand.NextFloat(-10f,10f)), - (projectile.velocity).RotatedByRandom(0.1f) * 0.25f, - ModContent.ProjectileType(), projectile.damage / 4, 0f, projectile.owner); - } + Vector2 flowerSpawnPosition = projectile.Center + Main.rand.NextVector2Square(-10f, 10f); + Vector2 flowerShootVelocity = projectile.velocity.RotatedByRandom(0.1f) * 0.25f; + Projectile.NewProjectile(flowerSpawnPosition, flowerShootVelocity, ModContent.ProjectileType(), projectile.damage / 4, 0f, projectile.owner); + } } } diff --git a/Projectiles/Summon/PerditionBeacon.cs b/Projectiles/Summon/PerditionBeacon.cs index c216d38ac1..1b0756a967 100644 --- a/Projectiles/Summon/PerditionBeacon.cs +++ b/Projectiles/Summon/PerditionBeacon.cs @@ -135,7 +135,7 @@ namespace CalamityMod.Projectiles.Summon cinder.scale = 1f + cinder.velocity.Length() * 0.17f; cinder.noGravity = true; - int shootRate = (int)MathHelper.Lerp(24f, 3f, Utils.InverseLerp(0f, 300f, AttackTime, true)); + int shootRate = (int)MathHelper.Lerp(24f, 6f, Utils.InverseLerp(0f, 300f, AttackTime, true)); AttackTimer++; if (AttackTimer < shootRate || Main.myPlayer != projectile.owner) diff --git a/Projectiles/Summon/SonOfYharon.cs b/Projectiles/Summon/SonOfYharon.cs index db813805f7..88c37a128f 100644 --- a/Projectiles/Summon/SonOfYharon.cs +++ b/Projectiles/Summon/SonOfYharon.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Summon projectile.ignoreWater = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = projectile.MaxUpdates * 9; - projectile.minionSlots = 4f; + projectile.minionSlots = 5f; projectile.timeLeft = 90000; projectile.penetrate = -1; projectile.tileCollide = false; diff --git a/Tiles/Astral/AstralNormalSmallPiles.png b/Tiles/Astral/AstralNormalSmallPiles.png index c87da05a9c..381ab3ac5b 100644 Binary files a/Tiles/Astral/AstralNormalSmallPiles.png and b/Tiles/Astral/AstralNormalSmallPiles.png differ diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index 9f5abbd653..467e88821f 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -589,7 +589,8 @@ namespace CalamityMod.Tiles { ModContent.TileType(), ModContent.TileType(), - ModContent.TileType() + ModContent.TileType(), + ModContent.TileType() }; Tile checkTile = CalamityUtils.ParanoidTileRetrieval(x, y); diff --git a/Tiles/Furniture/CraftingStations/VoidCondenser.cs b/Tiles/Furniture/CraftingStations/VoidCondenser.cs index eb66374f5f..8be86fd500 100644 --- a/Tiles/Furniture/CraftingStations/VoidCondenser.cs +++ b/Tiles/Furniture/CraftingStations/VoidCondenser.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Condenser"); AddMapEntry(new Color(191, 142, 111), name); - animationFrameHeight = 54; + animationFrameHeight = 46; } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/Furniture/CraftingStations/VoidCondenser.png b/Tiles/Furniture/CraftingStations/VoidCondenser.png index d3c0bf9005..96dcece835 100644 Binary files a/Tiles/Furniture/CraftingStations/VoidCondenser.png and b/Tiles/Furniture/CraftingStations/VoidCondenser.png differ diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index 7c3007e6af..ca8effd9c9 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -254,7 +254,7 @@ namespace CalamityMod.UI.CalamitasEnchants player => player.Calamity().witheringWeaponEnchant = true, item => item.IsEnchantable() && item.damage > 0 && !item.summon), - new Enchantment("Persecuted", "When attacked, or over time, demon portals appear near you. If sufficiently damaged they are friendly; otherwise they attack you.", + new Enchantment("Persecuted", "When attacked, or over time, demon portals appear near you. If sufficiently damaged they are friendly; otherwise they attack you. They become angered if a portal is damaged.", 1100, "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Persecuted", null, diff --git a/Waters/CustomLavaManagement.cs b/Waters/CustomLavaManagement.cs index 27559c1a17..4ca4c1929c 100644 --- a/Waters/CustomLavaManagement.cs +++ b/Waters/CustomLavaManagement.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Waters internal static void Unload() { foreach (CustomLavaStyle lavaStyle in CustomLavaStyles) - lavaStyle.Unload(); + lavaStyle?.Unload(); CustomLavaStyles = null; LavaBlockTexture = null;