diff --git a/CalamityMod.cs b/CalamityMod.cs index b347326b8e..2d8a2cf38f 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -303,7 +303,14 @@ namespace CalamityMod // Centralizing hair dye shaders like this seems absurdly stiff GameShaders.Hair.BindShader(ModContent.ItemType(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => Color.Lerp(player.hairColor, new Color(0, 255, 171), ((float)player.Calamity().adrenaline / (float)player.Calamity().adrenalineMax)))); GameShaders.Hair.BindShader(ModContent.ItemType(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => Color.Lerp(player.hairColor, new Color(255, 83, 48), ((float)player.Calamity().rage / (float)player.Calamity().rageMax)))); - GameShaders.Hair.BindShader(ModContent.ItemType(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => Color.Lerp(player.hairColor, new Color(139, 205, 255), ((float)player.wingTime / (float)player.wingTimeMax)))); + GameShaders.Hair.BindShader(ModContent.ItemType(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => + { + float flightTimeInterpolant = player.wingTime / player.wingTimeMax; + if (player.mount.Active) + flightTimeInterpolant = 1f; + + return Color.Lerp(player.hairColor, new Color(139, 205, 255), flightTimeInterpolant); + })); GameShaders.Hair.BindShader(ModContent.ItemType(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => Color.Lerp(player.hairColor, new Color(186, 85, 211), (player.Calamity().rogueStealth / player.Calamity().rogueStealthMax)))); PopupGUIManager.LoadGUIs(); diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index 5ad4d373db..9a0dc2ad48 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -116,6 +116,11 @@ namespace CalamityMod.Effects GameShaders.Misc["CalamityMod:AdditiveFusableParticleEdge"] = new MiscShaderData(new Ref(AdditiveFusableParticleEdgeShader), "ParticlePass"); GameShaders.Misc["CalamityMod:DoGPortal"] = new MiscShaderData(new Ref(DoGPortalShader), "ScreenPass"); + + //A little experimenting courtesy of looking at how slr does it. + var screenRef = new Ref(CalamityMod.Instance.Assets.Request("Effects/SpreadTelegraph", AssetRequestMode.ImmediateLoad).Value); + Filters.Scene["SpreadTelegraph"] = new Filter(new ScreenShaderData(screenRef, "TelegraphPass"), EffectPriority.High); + Filters.Scene["SpreadTelegraph"].Load(); } } } diff --git a/Effects/Compiler/EasyXnb.exe b/Effects/Compiler/EasyXnb.exe new file mode 100644 index 0000000000..3a5af70705 Binary files /dev/null and b/Effects/Compiler/EasyXnb.exe differ diff --git a/Effects/Compiler/EasyXnb.exe.config b/Effects/Compiler/EasyXnb.exe.config new file mode 100644 index 0000000000..9527be5fdc --- /dev/null +++ b/Effects/Compiler/EasyXnb.exe.config @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Effects/Compiler/Microsoft.Xna.Framework.Content.Pipeline.EffectImporter.dll b/Effects/Compiler/Microsoft.Xna.Framework.Content.Pipeline.EffectImporter.dll new file mode 100644 index 0000000000..61f52fa6c5 Binary files /dev/null and b/Effects/Compiler/Microsoft.Xna.Framework.Content.Pipeline.EffectImporter.dll differ diff --git a/Effects/Compiler/Microsoft.Xna.Framework.Content.Pipeline.FBXImporter.dll b/Effects/Compiler/Microsoft.Xna.Framework.Content.Pipeline.FBXImporter.dll new file mode 100644 index 0000000000..bf8aeb3c6a Binary files /dev/null and b/Effects/Compiler/Microsoft.Xna.Framework.Content.Pipeline.FBXImporter.dll differ diff --git a/Effects/Compiler/Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.dll b/Effects/Compiler/Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.dll new file mode 100644 index 0000000000..396392c053 Binary files /dev/null and b/Effects/Compiler/Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.dll differ diff --git a/Effects/Compiler/Microsoft.Xna.Framework.Content.Pipeline.dll b/Effects/Compiler/Microsoft.Xna.Framework.Content.Pipeline.dll new file mode 100644 index 0000000000..a70e4120a2 Binary files /dev/null and b/Effects/Compiler/Microsoft.Xna.Framework.Content.Pipeline.dll differ diff --git a/Effects/Compiler/Microsoft.Xna.Framework.Game.dll b/Effects/Compiler/Microsoft.Xna.Framework.Game.dll new file mode 100644 index 0000000000..9ba4aa23b3 Binary files /dev/null and b/Effects/Compiler/Microsoft.Xna.Framework.Game.dll differ diff --git a/Effects/Compiler/Microsoft.Xna.Framework.Graphics.dll b/Effects/Compiler/Microsoft.Xna.Framework.Graphics.dll new file mode 100644 index 0000000000..2c00c4ccbe Binary files /dev/null and b/Effects/Compiler/Microsoft.Xna.Framework.Graphics.dll differ diff --git a/Effects/Compiler/Microsoft.Xna.Framework.dll b/Effects/Compiler/Microsoft.Xna.Framework.dll new file mode 100644 index 0000000000..a0caf6af26 Binary files /dev/null and b/Effects/Compiler/Microsoft.Xna.Framework.dll differ diff --git a/Effects/SpreadTelegraph.fx b/Effects/SpreadTelegraph.fx new file mode 100644 index 0000000000..eea200f02a --- /dev/null +++ b/Effects/SpreadTelegraph.fx @@ -0,0 +1,91 @@ +float3 edgeColor; +float3 centerColor; + +float edgeBlendLenght; +float edgeBlendStrength; + +float mainOpacity; +float centerOpacity; +float halfSpreadAngle; + +texture sampleTexture; +sampler2D Texture1Sampler = sampler_state { texture = ; magfilter = LINEAR; minfilter = LINEAR; mipfilter = LINEAR; AddressU = wrap; AddressV = wrap; }; + + +//I can't believe it has gotten down to this. +float realCos(float value) +{ + return sin(value + 1.57079); +} + +//Gets the distance of a plot from a line with a specified origin and angle +float distanceFromLine(float2 origin, float angle, float2 plot) +{ + return abs(realCos(angle) * (origin.y - plot.y) - sin(angle) * (origin.x - plot.x)); +} + +//Gets the distance of a plot from a line with a specified origin and angle, but crops the line so it only expands towards the angle +float distanceFromLineCropped(float2 origin, float angle, float2 plot, float plotAngle) +{ + //If the angle between the line's angle and the plot's angle is less than 90° (aka , not BEHIND the half-line), return the distance from the line + if (abs(angle - plotAngle) < 1.5707) + return distanceFromLine(origin, angle, plot); + + //If we are behind the line, just give the distance between the start point and the plot + else + return length(origin - plot); + +} + + +float4 main(float2 uv : TEXCOORD) : COLOR +{ + //Set the uv's Y position to be only contained within the upper half of the texture, to mirror it around a horizontal axis + if (uv.y > 0.5) + uv.y = 1 - uv.y; + + float2 mappedUv = float2(uv.x - 0.5, abs(uv.y - 0.5)); + + //get the length of the doubled distance, so that 0 = at the center of the sprite and 1 = at the very edge of the circle + float distanceFromCenter = length(mappedUv) * 2; + + //Crop the sprite into a circle + if (distanceFromCenter > 1) + return float4(0, 0, 0, 0); + + //Grabs the angle (only as a positive angle, since it's a mirror image udnerneath. + float angle = atan2(mappedUv.y, mappedUv.x); + //Grabs the distance of the point from the edge line. + float distanceFromLine = distanceFromLineCropped(float2(0, 0), halfSpreadAngle, mappedUv, angle); + + //Grab the colors to blend the edge lines with. + float3 colour = float3(0, 0, 0); + float opacity = 0; + //If we are inside the spread's radius. + if (angle <= halfSpreadAngle) + { + colour = lerp(centerColor, edgeColor, pow(angle / halfSpreadAngle, 9)); + opacity = centerOpacity * pow(1 - distanceFromCenter, 2); + } + + //If we are further from the line than the edge's blending lenght, just don't even do the blending. + if (distanceFromLine > edgeBlendLenght) + return float4(colour * opacity * mainOpacity, opacity * mainOpacity); + + //The higher this value is, the more we blend with the edge's opacity & color. + float edgeBlendFactor = pow(1 - distanceFromLine / edgeBlendLenght, edgeBlendStrength); + + colour = lerp(colour, edgeColor, edgeBlendFactor); + opacity = lerp(opacity, 1 * pow(1 - distanceFromCenter, 3), edgeBlendFactor) * mainOpacity; + + colour = colour * opacity; + return float4(colour, opacity); +} + +technique Technique1 +{ + pass TelegraphPass + { + PixelShader = compile ps_3_0 main(); + } +} \ No newline at end of file diff --git a/Effects/SpreadTelegraph.xnb b/Effects/SpreadTelegraph.xnb new file mode 100644 index 0000000000..e752b000ce Binary files /dev/null and b/Effects/SpreadTelegraph.xnb differ diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 5d43a38f81..2725a4e04e 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -111,6 +111,7 @@ namespace CalamityMod.ILEditing IL.Terraria.WorldGen.AttemptFossilShattering += PreventFossilShattering; IL.Terraria.Projectile.Damage += MakeTagDamageMultiplicative; On.Terraria.Player.GetPickaxeDamage += RemoveHellforgePickaxeRequirement; + On.Terraria.GameContent.ItemDropRules.CommonCode.ModifyItemDropFromNPC += ColorBlightedGel; // Fix vanilla bugs exposed by Calamity mechanics IL.Terraria.NPC.NPCLoot += FixSplittingWormBannerDrops; @@ -202,6 +203,7 @@ namespace CalamityMod.ILEditing IL.Terraria.WorldGen.AttemptFossilShattering -= PreventFossilShattering; IL.Terraria.Projectile.Damage -= MakeTagDamageMultiplicative; On.Terraria.Player.GetPickaxeDamage -= RemoveHellforgePickaxeRequirement; + On.Terraria.GameContent.ItemDropRules.CommonCode.ModifyItemDropFromNPC -= ColorBlightedGel; // Fix vanilla bugs exposed by Calamity mechanics IL.Terraria.NPC.NPCLoot -= FixSplittingWormBannerDrops; diff --git a/ILEditing/VanillaStupidityFixingILChanges.cs b/ILEditing/VanillaStupidityFixingILChanges.cs index 135f82f430..b4bd611526 100644 --- a/ILEditing/VanillaStupidityFixingILChanges.cs +++ b/ILEditing/VanillaStupidityFixingILChanges.cs @@ -1,4 +1,8 @@ using CalamityMod.Balancing; +using CalamityMod.Items.Materials; +using CalamityMod.NPCs.AcidRain; +using CalamityMod.NPCs.NormalNPCs; +using Microsoft.Xna.Framework; using Mono.Cecil.Cil; using MonoMod.Cil; using System; @@ -367,7 +371,33 @@ namespace CalamityMod.ILEditing #endregion #region Fix Chlorophyte Crystal Attacking Where it Shouldn't - + // TODO -- Finish this #endregion Fix Chlorophyte Crystal Attacking Where it Shouldn't + + #region Color Blighted Gel + private static void ColorBlightedGel(On.Terraria.GameContent.ItemDropRules.CommonCode.orig_ModifyItemDropFromNPC orig, NPC npc, int itemIndex) + { + orig(npc, itemIndex); + + Item item = Main.item[itemIndex]; + int itemID = item.type; + bool colorWasChanged = false; + + if (itemID == ModContent.ItemType() && npc.type == ModContent.NPCType()) + { + item.color = new Color(1f, 0f, 0.16f, 0.6f); + colorWasChanged = true; + } + if (itemID == ItemID.SharkFin && npc.type == ModContent.NPCType()) + { + item.color = new Color(151, 115, 57, 255); + colorWasChanged = true; + } + + // Sync the color changes. + if (colorWasChanged) + NetMessage.SendData(MessageID.ItemTweaker, -1, -1, null, itemID, 1f); + } + #endregion Color Blighted Gel } } diff --git a/Items/Accessories/AeroStone.cs b/Items/Accessories/AeroStone.cs index 39a5d9a282..a29b22e500 100644 --- a/Items/Accessories/AeroStone.cs +++ b/Items/Accessories/AeroStone.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.Accessories Tooltip.SetDefault("One of the ancient relics\n" + "Increases flight time, movement speed and jump speed by 10%"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(4, 8)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/BlazingCore.cs b/Items/Accessories/BlazingCore.cs index e04be81920..c9bb6c10c7 100644 --- a/Items/Accessories/BlazingCore.cs +++ b/Items/Accessories/BlazingCore.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items.Accessories "Only one sun can be active at once\n" + "Provides a moderate amount of light in the Abyss"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 6)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/Calamity.cs b/Items/Accessories/Calamity.cs index b17ecab8f6..63147f3973 100644 --- a/Items/Accessories/Calamity.cs +++ b/Items/Accessories/Calamity.cs @@ -23,6 +23,7 @@ namespace CalamityMod.Items.Accessories "Equip in a vanity slot to change the cursor without dealing damage\n" + "These changes work in conjunction with the Rainbow Cursor"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/ChaosStone.cs b/Items/Accessories/ChaosStone.cs index ec3d1ab7f5..52acfefdf5 100644 --- a/Items/Accessories/ChaosStone.cs +++ b/Items/Accessories/ChaosStone.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Accessories "Mana Burn deals damage over time relative to the intensity of the debuff\n" + "This debuff does not reduce your magic damage"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 7)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/CoreOfTheBloodGod.cs b/Items/Accessories/CoreOfTheBloodGod.cs index 04ca42addb..0a88dccd7e 100644 --- a/Items/Accessories/CoreOfTheBloodGod.cs +++ b/Items/Accessories/CoreOfTheBloodGod.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Accessories "Halves enemy contact damage\n" + "When you take contact damage this effect has a 20 second cooldown"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 4)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/CryoStone.cs b/Items/Accessories/CryoStone.cs index e5aff8c37f..8d92cd49f6 100644 --- a/Items/Accessories/CryoStone.cs +++ b/Items/Accessories/CryoStone.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.Accessories Tooltip.SetDefault("One of the ancient relics\n" + "Creates a rotating ice shield around you that damages and slows down enemies on contact"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(4, 4)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/DarkSunRing.cs b/Items/Accessories/DarkSunRing.cs index 7099325cbf..7d9fa3451f 100644 --- a/Items/Accessories/DarkSunRing.cs +++ b/Items/Accessories/DarkSunRing.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Items.Accessories "During the night the player has +15 defense\n" + "Both of these bonuses are granted during an eclipse"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 7)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/DraedonsHeart.cs b/Items/Accessories/DraedonsHeart.cs index ebb7b07cb8..c27d0088c6 100644 --- a/Items/Accessories/DraedonsHeart.cs +++ b/Items/Accessories/DraedonsHeart.cs @@ -33,6 +33,7 @@ namespace CalamityMod.Items.Accessories "While healing, you take &% less damage\n" + "'Nanomachines, son.'"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 11)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/DynamoStemCells.cs b/Items/Accessories/DynamoStemCells.cs index cd5a9784eb..be8c800f39 100644 --- a/Items/Accessories/DynamoStemCells.cs +++ b/Items/Accessories/DynamoStemCells.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Accessories Ranged weapons have a chance to fire mini swarmers Grants immunity to Dragon Fire and Electrified"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 5)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/FrostFlare.cs b/Items/Accessories/FrostFlare.cs index 00ce73faa4..b5e548b201 100644 --- a/Items/Accessories/FrostFlare.cs +++ b/Items/Accessories/FrostFlare.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items.Accessories "Being below 25% life grants 20 defense and 15% increased max movement speed and acceleration\n" + "Grants resistance against cold attacks"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 4)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/HeartofDarkness.cs b/Items/Accessories/HeartofDarkness.cs index 0726ff4500..6c4a715b2c 100644 --- a/Items/Accessories/HeartofDarkness.cs +++ b/Items/Accessories/HeartofDarkness.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Accessories "Rage does not fade away when out of combat\n" + "Revengeance drop"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 4)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/HeartoftheElements.cs b/Items/Accessories/HeartoftheElements.cs index 047d8a1910..9b8a227e25 100644 --- a/Items/Accessories/HeartoftheElements.cs +++ b/Items/Accessories/HeartoftheElements.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Accessories Tooltip.SetDefault("The heart of the world\n" + "Summons all elementals to protect you"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 8)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/HowlsHeart.cs b/Items/Accessories/HowlsHeart.cs index e20c93e9b2..75929e51b0 100644 --- a/Items/Accessories/HowlsHeart.cs +++ b/Items/Accessories/HowlsHeart.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Items.Accessories Tooltip.SetDefault("Summons Howl to fight for you, Calcifer to light your way, and Turnip-Head to follow you around\n" + "Placing this accessory in vanity slots will summon the trio without the combat or exploration utilities"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 4)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/PhantomicArtifact.cs b/Items/Accessories/PhantomicArtifact.cs index dd413f5fe0..a0c4a7f2f9 100644 --- a/Items/Accessories/PhantomicArtifact.cs +++ b/Items/Accessories/PhantomicArtifact.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Accessories "If you have the regenerative boost, a phantomic heart will occasionally materialise granting massive health regen\n" + "If you have the defensive boost, a phantomic bulwark will absorb 20% of the next projectile's damage that hits the bulwark, shattering it"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 7)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/ProfanedSoulArtifact.cs b/Items/Accessories/ProfanedSoulArtifact.cs index a5b92053bd..32ede2d1d7 100644 --- a/Items/Accessories/ProfanedSoulArtifact.cs +++ b/Items/Accessories/ProfanedSoulArtifact.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Items.Accessories "Summons an offensive guardian if you are wearing the tarragon summon set (or stronger), which boosts your summon damage and your minion slots\n" + "If you get hit, most of their effects will disappear for 5 seconds"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/ProfanedSoulCrystal.cs b/Items/Accessories/ProfanedSoulCrystal.cs index bd17c8a8c9..3c8f97d2de 100644 --- a/Items/Accessories/ProfanedSoulCrystal.cs +++ b/Items/Accessories/ProfanedSoulCrystal.cs @@ -46,6 +46,7 @@ namespace CalamityMod.Items.Accessories Tooltip.SetDefault("Transforms you into an emissary of the profaned goddess\n" + "This tooltip gets modified"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 4)); + ItemID.Sets.AnimatesAsSoul[Type] = true; if (Main.netMode == NetmodeID.Server) return; diff --git a/Items/Accessories/ShatteredCommunity.cs b/Items/Accessories/ShatteredCommunity.cs index c1bbda5f7e..8951a81d65 100644 --- a/Items/Accessories/ShatteredCommunity.cs +++ b/Items/Accessories/ShatteredCommunity.cs @@ -44,6 +44,7 @@ namespace CalamityMod.Items.Accessories "While Rage Mode is active, taking damage gives only half as much rage\n" + "Deal damage with Rage Mode to further empower your wrath\n"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(7, 5)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/SigilofCalamitas.cs b/Items/Accessories/SigilofCalamitas.cs index 79d1cd1a46..72c4b93e10 100644 --- a/Items/Accessories/SigilofCalamitas.cs +++ b/Items/Accessories/SigilofCalamitas.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Accessories "+100 max mana\n" + "Increases pickup range for mana stars"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 8)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/StatisCurse.cs b/Items/Accessories/StatisCurse.cs index 310d88355c..648947b53d 100644 --- a/Items/Accessories/StatisCurse.cs +++ b/Items/Accessories/StatisCurse.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Accessories "Minions inflict holy flames and shadowflames on hit\n" + "Grants immunity to Shadowflame"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 4)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/StatisVoidSash.cs b/Items/Accessories/StatisVoidSash.cs index 3254f647ba..b54a0e4ccf 100644 --- a/Items/Accessories/StatisVoidSash.cs +++ b/Items/Accessories/StatisVoidSash.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; using CalamityMod.CalPlayer.Dashes; +using Terraria.ID; namespace CalamityMod.Items.Accessories { @@ -22,6 +23,7 @@ namespace CalamityMod.Items.Accessories "This cooldown is shared with all other dodges and reflects\n" + "Dashes leave homing scythes in your wake"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 3)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index 12296233a1..6e7b33f299 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -23,6 +23,7 @@ namespace CalamityMod.Items.Accessories "Shade rains down when you are hit\n" + "Nearby enemies receive a variety of debuffs when you are hit"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(9, 6)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/TheCommunity.cs b/Items/Accessories/TheCommunity.cs index 62f939017a..c6a730614f 100644 --- a/Items/Accessories/TheCommunity.cs +++ b/Items/Accessories/TheCommunity.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items.Accessories "Reduces the DoT effects of harmful debuffs inflicted on you\n" + "Thank you to all of my supporters who made this mod a reality"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 10)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/TheEvolution.cs b/Items/Accessories/TheEvolution.cs index 557a961656..92ca601188 100644 --- a/Items/Accessories/TheEvolution.cs +++ b/Items/Accessories/TheEvolution.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items.Accessories "If this effect triggers you get a health regeneration boost for 5 seconds\n" + "If the same enemy projectile type hits you again you will resist its damage by 15%"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 10)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/TheFirstShadowflame.cs b/Items/Accessories/TheFirstShadowflame.cs index fc6890190d..eaacc4b18f 100644 --- a/Items/Accessories/TheFirstShadowflame.cs +++ b/Items/Accessories/TheFirstShadowflame.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items.Accessories "Increases max minions by 1 and minions inflict the Shadowflame debuff on enemies\n" + "Grants immunity to Shadowflame"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/TheSponge.cs b/Items/Accessories/TheSponge.cs index 9f5953d439..15b1f2c1aa 100644 --- a/Items/Accessories/TheSponge.cs +++ b/Items/Accessories/TheSponge.cs @@ -7,6 +7,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -29,6 +30,7 @@ namespace CalamityMod.Items.Accessories "6.25% of the damage from enemy attacks is absorbed and converted into healing\n" + "Grants immunity to Armor Crunch"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 30)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/TheTransformer.cs b/Items/Accessories/TheTransformer.cs index b694e1f006..a9d18edddf 100644 --- a/Items/Accessories/TheTransformer.cs +++ b/Items/Accessories/TheTransformer.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Accessories "Immunity to Electrified and you resist all electrical projectile and enemy damage\n" + "Enemy bullets do half damage to you and are reflected back at the enemy for 800% their original damage"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 16)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/UnstableGraniteCore.cs b/Items/Accessories/UnstableGraniteCore.cs index a378f243a4..5dfd4f7a0f 100644 --- a/Items/Accessories/UnstableGraniteCore.cs +++ b/Items/Accessories/UnstableGraniteCore.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.Accessories DisplayName.SetDefault("Unstable Granite Core"); Tooltip.SetDefault("Three sparks are released on critical hits"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(7, 5)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/WarbanneroftheSun.cs b/Items/Accessories/WarbanneroftheSun.cs index 643d30801b..02c368c466 100644 --- a/Items/Accessories/WarbanneroftheSun.cs +++ b/Items/Accessories/WarbanneroftheSun.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Items.Accessories Tooltip.SetDefault("Increases melee damage, true melee damage and melee speed the closer you are to enemies\n" + "Max boost is 20% increased melee damage, true melee damage and melee speed"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 5)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Accessories/Wings/SoulofCryogen.cs b/Items/Accessories/Wings/SoulofCryogen.cs index 87ecd341f1..473d4a3030 100644 --- a/Items/Accessories/Wings/SoulofCryogen.cs +++ b/Items/Accessories/Wings/SoulofCryogen.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Items.Accessories.Wings "All melee attacks and projectiles inflict frostburn\n" + "Icicles rain down as you fly"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 3)); + ItemID.Sets.AnimatesAsSoul[Type] = true; ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(120, 6.25f, 1f); } diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index c629e83f09..0e819dd6ab 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1785,10 +1785,10 @@ namespace CalamityMod.Items _ => prefix, }; } - else if (item.CountsAsClass()) + else if (item.CountsAsClass() || item.IsWhip()) { // Yoyos, Flails, Spears, etc. - if (item.channel || item.noMelee) + if ((item.channel || item.noMelee) && !item.IsWhip()) { prefix = reforgeTier switch { diff --git a/Items/Materials/AscendantSpiritEssence.cs b/Items/Materials/AscendantSpiritEssence.cs index 2caea64a92..7567a79666 100644 --- a/Items/Materials/AscendantSpiritEssence.cs +++ b/Items/Materials/AscendantSpiritEssence.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items.Materials DisplayName.SetDefault("Ascendant Spirit Essence"); Tooltip.SetDefault("A catalyst of the highest caliber formed by fusing powerful souls"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Materials/AshesofAnnihilation.cs b/Items/Materials/AshesofAnnihilation.cs index ca2f5eb03a..7bd7fbf51f 100644 --- a/Items/Materials/AshesofAnnihilation.cs +++ b/Items/Materials/AshesofAnnihilation.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items.Materials DisplayName.SetDefault("Ashes of Annihilation"); Tooltip.SetDefault("The smoldering essence of the Witch's wrath"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(7, 6)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Materials/AshesofCalamity.cs b/Items/Materials/AshesofCalamity.cs index f795c28d42..1bfddbaa0e 100644 --- a/Items/Materials/AshesofCalamity.cs +++ b/Items/Materials/AshesofCalamity.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.Materials SacrificeTotal = 25; DisplayName.SetDefault("Ashes of Calamity"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 5)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Materials/DarkPlasma.cs b/Items/Materials/DarkPlasma.cs index 4acb427082..39190090c7 100644 --- a/Items/Materials/DarkPlasma.cs +++ b/Items/Materials/DarkPlasma.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Items.Materials SacrificeTotal = 25; DisplayName.SetDefault("Dark Plasma"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(7, 4)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Materials/DarksunFragment.cs b/Items/Materials/DarksunFragment.cs index 602015a216..aec057fa24 100644 --- a/Items/Materials/DarksunFragment.cs +++ b/Items/Materials/DarksunFragment.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items.Materials DisplayName.SetDefault("Darksun Fragment"); Tooltip.SetDefault("An impacted crystal suffused with opposing celestial energies"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 8)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Materials/EffulgentFeather.cs b/Items/Materials/EffulgentFeather.cs index 78d4df4103..a6e101b2bb 100644 --- a/Items/Materials/EffulgentFeather.cs +++ b/Items/Materials/EffulgentFeather.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.Materials DisplayName.SetDefault("Effulgent Feather"); Tooltip.SetDefault("It vibrates with fluffy golden energy"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(3, 11)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() @@ -22,5 +23,6 @@ namespace CalamityMod.Items.Materials Item.maxStack = 999; Item.value = Item.buyPrice(0, 6, 50, 0); Item.rare = ItemRarityID.Purple; - } } + } + } } diff --git a/Items/Materials/EndothermicEnergy.cs b/Items/Materials/EndothermicEnergy.cs index e0a17ee4f3..3d324c11d5 100644 --- a/Items/Materials/EndothermicEnergy.cs +++ b/Items/Materials/EndothermicEnergy.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items.Materials DisplayName.SetDefault("Endothermic Energy"); Tooltip.SetDefault("Its deathly chill sucks the life from its surroundings"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Materials/GalacticaSingularity.cs b/Items/Materials/GalacticaSingularity.cs index 9939dde714..6f41687769 100644 --- a/Items/Materials/GalacticaSingularity.cs +++ b/Items/Materials/GalacticaSingularity.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.Materials DisplayName.SetDefault("Galactica Singularity"); Tooltip.SetDefault("A shard of the cosmos"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(4, 24)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Materials/NightmareFuel.cs b/Items/Materials/NightmareFuel.cs index b119177395..e9f055cd0f 100644 --- a/Items/Materials/NightmareFuel.cs +++ b/Items/Materials/NightmareFuel.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items.Materials DisplayName.SetDefault("Nightmare Fuel"); Tooltip.SetDefault("May drain your sanity"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Materials/Phantoplasm.cs b/Items/Materials/Phantoplasm.cs index 1d003ff329..d1031bdfb9 100644 --- a/Items/Materials/Phantoplasm.cs +++ b/Items/Materials/Phantoplasm.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.Materials DisplayName.SetDefault("Phantoplasm"); Tooltip.SetDefault("It churns and seethes with ghastly malice"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 5)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Materials/RuinousSoul.cs b/Items/Materials/RuinousSoul.cs index a97da29d81..ae3a712f41 100644 --- a/Items/Materials/RuinousSoul.cs +++ b/Items/Materials/RuinousSoul.cs @@ -1,5 +1,6 @@ using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Materials @@ -12,6 +13,7 @@ namespace CalamityMod.Items.Materials DisplayName.SetDefault("Ruinous Soul"); Tooltip.SetDefault("A shard of the distant past"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() @@ -21,5 +23,6 @@ namespace CalamityMod.Items.Materials Item.maxStack = 999; Item.value = Item.buyPrice(0, 7, 0, 0); Item.Calamity().customRarity = CalamityRarity.PureGreen; - } } + } + } } diff --git a/Items/Materials/StormlionMandible.cs b/Items/Materials/StormlionMandible.cs index 196a82ca85..d68b0d5ab1 100644 --- a/Items/Materials/StormlionMandible.cs +++ b/Items/Materials/StormlionMandible.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Items.Materials SacrificeTotal = 5; DisplayName.SetDefault("Stormlion Mandible"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 8)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/Materials/UnholyEssence.cs b/Items/Materials/UnholyEssence.cs index 6ab517664f..e8bb53b035 100644 --- a/Items/Materials/UnholyEssence.cs +++ b/Items/Materials/UnholyEssence.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.Materials DisplayName.SetDefault("Unholy Essence"); Tooltip.SetDefault("The essence of profaned creatures"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 5)); + ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() diff --git a/Items/NormalityRelocator.cs b/Items/NormalityRelocator.cs index d1d3464447..baa2a02192 100644 --- a/Items/NormalityRelocator.cs +++ b/Items/NormalityRelocator.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Items "Teleportation is disabled while Chaos State is active\n" + "Works while in the inventory"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 7)); + ItemID.Sets.AnimatesAsSoul[Type] = true; SacrificeTotal = 1; } diff --git a/Items/Weapons/Magic/DarkSpark.cs b/Items/Weapons/Magic/DarkSpark.cs index 129d39479e..b8b84093aa 100644 --- a/Items/Weapons/Magic/DarkSpark.cs +++ b/Items/Weapons/Magic/DarkSpark.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Weapons.Magic Tooltip.SetDefault("And everything under the sun is in tune,\n" + "But the sun is eclipsed by the moon."); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 4)); + ItemID.Sets.AnimatesAsSoul[Type] = true; SacrificeTotal = 1; } diff --git a/Items/Weapons/Magic/Heresy.cs b/Items/Weapons/Magic/Heresy.cs index ce575ca397..2c7fbf807b 100644 --- a/Items/Weapons/Magic/Heresy.cs +++ b/Items/Weapons/Magic/Heresy.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.Weapons.Magic Tooltip.SetDefault("Releases fire and souls upward from a held book\n" + "As the book is held the power of both increases"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); + ItemID.Sets.AnimatesAsSoul[Type] = true; SacrificeTotal = 1; } diff --git a/Items/Weapons/Melee/Murasama.cs b/Items/Weapons/Melee/Murasama.cs index 14dddb39d2..de4fb60d6f 100644 --- a/Items/Weapons/Melee/Murasama.cs +++ b/Items/Weapons/Melee/Murasama.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee "ID and power-level locked\n" + "Prove your strength or have the correct user ID to wield this sword"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 13)); + ItemID.Sets.AnimatesAsSoul[Type] = true; SacrificeTotal = 1; } diff --git a/Items/Weapons/Rogue/StormfrontRazor.cs b/Items/Weapons/Rogue/StormfrontRazor.cs index 2face4c0c9..c0c6217f8a 100644 --- a/Items/Weapons/Rogue/StormfrontRazor.cs +++ b/Items/Weapons/Rogue/StormfrontRazor.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Rogue Tooltip.SetDefault("Throws a throwing knife that leaves sparks as it travels.\n" + "Stealth strikes cause the knife to be faster and leave a huge shower of sparks as it travels"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 4)); + ItemID.Sets.AnimatesAsSoul[Type] = true; SacrificeTotal = 1; } diff --git a/Items/Weapons/Summon/UniverseSplitter.cs b/Items/Weapons/Summon/UniverseSplitter.cs index 30dfcb1ba4..d6dcb55f9b 100644 --- a/Items/Weapons/Summon/UniverseSplitter.cs +++ b/Items/Weapons/Summon/UniverseSplitter.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon "An ancient artifact from a previous age, it waits for your command...\n" + "This is a terrible idea, but it isn't yours anyways... right?"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 14)); + ItemID.Sets.AnimatesAsSoul[Type] = true; SacrificeTotal = 1; } diff --git a/NPCs/NormalNPCs/Cnidrion.cs b/NPCs/NormalNPCs/Cnidrion.cs index 1eb7f18a0f..d2cf69bc39 100644 --- a/NPCs/NormalNPCs/Cnidrion.cs +++ b/NPCs/NormalNPCs/Cnidrion.cs @@ -55,8 +55,8 @@ namespace CalamityMod.NPCs.NormalNPCs bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] { BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert, - // Will move to localization whenever that is cleaned up. - new FlavorTextBestiaryInfoElement("A confusing beast. They share qualities with many of the other desert creatures, yet seem to be able to store vast amounts of water in their bodies.") + // Will move to localization whenever that is cleaned up. + new FlavorTextBestiaryInfoElement("A confusing beast. They share qualities with many of the other desert creatures, yet seem to be able to store vast amounts of water in their bodies.") }); } @@ -74,6 +74,7 @@ namespace CalamityMod.NPCs.NormalNPCs Main.eclipse || Main.snowMoon || Main.pumpkinMoon || + Main.invasionType != InvasionID.None || NPC.AnyNPCs(ModContent.NPCType())) { return 0f; diff --git a/Projectiles/Magic/CoralSpoutHoldout.cs b/Projectiles/Magic/CoralSpoutHoldout.cs index 30c538fd6a..f8d2a01ed2 100644 --- a/Projectiles/Magic/CoralSpoutHoldout.cs +++ b/Projectiles/Magic/CoralSpoutHoldout.cs @@ -7,6 +7,8 @@ using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Graphics.Effects; +using Terraria.Graphics.Shaders; namespace CalamityMod.Projectiles.Magic @@ -82,17 +84,23 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { + + var effect = Filters.Scene["SpreadTelegraph"].GetShader().Shader; + effect.Parameters["centerOpacity"].SetValue(0.7f); + effect.Parameters["mainOpacity"].SetValue((float)Math.Sqrt(ChargeProgress)); + effect.Parameters["halfSpreadAngle"].SetValue(Spread / 2f); + effect.Parameters["edgeColor"].SetValue(Color.DeepSkyBlue.ToVector3()); + effect.Parameters["centerColor"].SetValue(Color.DodgerBlue.ToVector3()); + effect.Parameters["edgeBlendLenght"].SetValue(0.07f); + effect.Parameters["edgeBlendStrength"].SetValue(8f); + Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, effect, Main.GameViewMatrix.TransformationMatrix); + + Texture2D texture = ModContent.Request("CalamityMod/Projectiles/InvisibleProj").Value; - Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Summon/DeathstareBeam").Value; - - for (int i = -1; i <= 1; i += 2) - { - float angle = (Owner.MountedCenter - Owner.Calamity().mouseWorld).ToRotation() + (Spread / 2f) * i - MathHelper.PiOver2; - Vector2 scale = new Vector2(0.2f, 1f) * 3f; - Main.EntitySpriteDraw(texture, Owner.MountedCenter - Main.screenPosition, null, Color.DodgerBlue * 0.5f * (float)Math.Sqrt(ChargeProgress), angle, new Vector2(texture.Width / 2f, texture.Height), scale, 0, 0); - } + float angle = (Owner.Calamity().mouseWorld - Owner.MountedCenter).ToRotation(); + Main.EntitySpriteDraw(texture, Owner.MountedCenter - Main.screenPosition, null, Color.White, angle, new Vector2(texture.Width / 2f, texture.Height/2f), 700f, 0, 0); Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); @@ -111,7 +119,7 @@ namespace CalamityMod.Projectiles.Magic for (int i = 0; i < ShotProjectiles; i++) { - float angleOffset = MathHelper.Lerp(Spread * -0.5f, Spread * 0.5f, i / (float)ShotProjectiles); + float angleOffset = MathHelper.Lerp(Spread * -0.5f, Spread * 0.5f, i / ((float)ShotProjectiles - 1)); Vector2 direction = (mainAngle + angleOffset).ToRotationVector2(); if (Owner.whoAmI == Main.myPlayer) diff --git a/Projectiles/Melee/DragonPowFlail.cs b/Projectiles/Melee/DragonPowFlail.cs index bd1f5a35be..d001b2eb66 100644 --- a/Projectiles/Melee/DragonPowFlail.cs +++ b/Projectiles/Melee/DragonPowFlail.cs @@ -139,8 +139,8 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - // Only perform hit effects after reaching approximately 55% of the way out. - if (Main.player[Projectile.owner].WithinRange(target.Center, 475f)) + // Only perform hit effects after reaching approximately 40% of the way out. + if (Main.player[Projectile.owner].WithinRange(target.Center, 345f)) return; // Inflicts Daybroken, Abyssal Flames and Holy Flames for 3 seconds on-hit @@ -157,7 +157,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitPvp(Player target, int damage, bool crit) { // Only perform hit effects after reaching approximately 55% of the way out. - if (Projectile.WithinRange(Main.player[Projectile.owner].Center, 475f)) + if (Projectile.WithinRange(Main.player[Projectile.owner].Center, 345f)) return; // Inflicts Abyssal Flames and Holy Flames for 8 seconds on-hit diff --git a/Projectiles/Rogue/LeonidStar.cs b/Projectiles/Rogue/LeonidStar.cs index 771a01ccd1..1f2999b2bb 100644 --- a/Projectiles/Rogue/LeonidStar.cs +++ b/Projectiles/Rogue/LeonidStar.cs @@ -28,7 +28,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.DamageType = RogueDamageClass.Instance; Projectile.tileCollide = false; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -2; + Projectile.localNPCHitCooldown = -1; + Projectile.MaxUpdates = 3; } public override void AI()