From f0d0bbec81584af83ba58b2c9712dcf571ddacae Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sun, 5 Jul 2026 00:30:38 -0400 Subject: [PATCH] Rebranded Slick Cane as Walking Cane * Intended to be themed after Walking Cane from DST; now a Deerclops drop instead of being sold by the Bandit * Still has its current swiping motion on normal use, stealth strikes apply an "insanity" effect that summons shadow hands on cane hits, increases movement speed by 15% while held * No longer makes enemies drop money or makes stealth strikes scale in damage based on stored money I'm probably going to change the insanity draw effect later because it doesn't work perfectly on some NPCs due to hardcoded drawpoint bullshit (notably Eye of Cthulhu) --- CalPlayer/CalamityPlayerMiscEffects.cs | 7 +- Effects/BasicTint.fx | 4 +- Effects/BasicTint.xnb | Bin 1720 -> 1768 bytes Items/CalamityGlobalItemLoot.cs | 3 +- .../Rogue/{SlickCane.cs => WalkingCane.cs} | 11 +- .../Rogue/{SlickCane.png => WalkingCane.png} | Bin ...Mods.CalamityMod.Items.Weapons.Rogue.hjson | 22 +-- .../en-US/Mods.CalamityMod.Vanilla.hjson | 2 +- NPCs/CalamityGlobalNPC.cs | 27 +++ NPCs/CalamityGlobalNPCLoot.cs | 3 +- NPCs/CalamityGlobalTownNPC.cs | 12 +- NPCs/TownNPCs/Bandit.cs | 1 - Projectiles/Rogue/SlickCaneProjectile.cs | 167 ------------------ Projectiles/Rogue/SlickCaneProjectileAlt.png | Bin 793 -> 0 bytes Projectiles/Rogue/WalkingCaneProjectile.cs | 99 +++++++++++ Projectiles/Rogue/WalkingCaneProjectile.png | Bin 0 -> 626 bytes .../Rogue/WalkingCaneProjectileAlt.png | Bin 0 -> 611 bytes Systems/Collections/CalamityItemSets.cs | 2 +- 18 files changed, 160 insertions(+), 200 deletions(-) rename Items/Weapons/Rogue/{SlickCane.cs => WalkingCane.cs} (80%) rename Items/Weapons/Rogue/{SlickCane.png => WalkingCane.png} (100%) delete mode 100644 Projectiles/Rogue/SlickCaneProjectile.cs delete mode 100644 Projectiles/Rogue/SlickCaneProjectileAlt.png create mode 100644 Projectiles/Rogue/WalkingCaneProjectile.cs create mode 100644 Projectiles/Rogue/WalkingCaneProjectile.png create mode 100644 Projectiles/Rogue/WalkingCaneProjectileAlt.png diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 02a207d308..9c9ddb8fa3 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2828,6 +2828,10 @@ namespace CalamityMod.CalPlayer if (Player.ichor) Player.statDefense += 5; + // Holding Walking Cane increases movement speed + if (Player.HeldItem.type == ModContent.ItemType()) + Player.moveSpeed += WalkingCane.MoveSpeedBoost; + // Fairy Boots bonus if (fairyBoots) { @@ -3633,8 +3637,7 @@ namespace CalamityMod.CalPlayer --bloodflareCoreRemainingHealOverTime; } - - // Reduce how slow Chilled makes the player, because it's cancerous right now + // Reduce how slow Chilled makes the player // The moveSpeed multiplier for Chilled in vanilla is 0.75, so we just multiply by 1.166667 here to make it 0.875, effectively cutting the reduction in half if (Player.chilled) Player.moveSpeed *= 1f + (1f / 6f); diff --git a/Effects/BasicTint.fx b/Effects/BasicTint.fx index 8b3b2268c2..ca360c3e68 100644 --- a/Effects/BasicTint.fx +++ b/Effects/BasicTint.fx @@ -3,7 +3,7 @@ sampler uImage1 : register(s1); float3 uColor; float3 uSecondaryColor; float uOpacity; -float uSaturation; +float uSaturation; // Saturation gets used as a "true" opacity float uRotation; float uTime; float4 uSourceRect; @@ -20,7 +20,7 @@ float4 Recolor(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 float4 color = tex2D(uImage0, coords); float originalAlpha = color.a; color.rbg = lerp(color.rbg, uColor, uOpacity); - return color * originalAlpha; + return color * originalAlpha * uSaturation; } diff --git a/Effects/BasicTint.xnb b/Effects/BasicTint.xnb index 4b02bc2bdc04cb4f5c4e17f97471eb0b596ef0aa..3fe896465320df2b1628d9b2c0972ea31ecd744e 100644 GIT binary patch delta 218 zcmdnN`+}D}!q2IkmGQ+y_PLA>8<$RGWMW{LY{7JwnSp^}vjnpSQ~eS~Ad~6;|9}5o z7@R{Kon(OA+dvEwV*yeiJ`gBe0TMYt3^afNq@@IiTYz{95Q9u(1j@_-(jc$~h?#&Q zAay%{7^Ln5SPUeJ5G!@gpS+qilDjlGv81#pu_QA;Z!$C6QUzA9k^Bt|3{M(>_ALPF OVPfEb@c;j3U;qFIwJMhY delta 164 zcmaFCyMvcK!q2Ikm2t;J_PLA#8<$RGWYTAwY{7JwxlEsJvjnpSQ)&q#0|Nuo|NsB~ z+b}qXI6BDyxx0ZFB*qM+Kztxj*a9RXfS3u0L0S@kxB!S7fEc8X5h&9Eq(NW?5HkTq jK(YMVJ^k_!}4)o;3Xb&%gixjQ}5! diff --git a/Items/CalamityGlobalItemLoot.cs b/Items/CalamityGlobalItemLoot.cs index a3bf25dbd3..3d3ed8176e 100644 --- a/Items/CalamityGlobalItemLoot.cs +++ b/Items/CalamityGlobalItemLoot.cs @@ -76,7 +76,8 @@ namespace CalamityMod.Items ItemID.LucyTheAxe, ItemID.PewMaticHorn, ItemID.WeatherPain, - ItemID.HoundiusShootius + ItemID.HoundiusShootius, + ModContent.ItemType() }; loot.Add(DropHelper.CalamityStyle(DropHelper.BagWeaponDropRateFraction, deerclopsWeapons)); loot.AddRevBagAccessories(); diff --git a/Items/Weapons/Rogue/SlickCane.cs b/Items/Weapons/Rogue/WalkingCane.cs similarity index 80% rename from Items/Weapons/Rogue/SlickCane.cs rename to Items/Weapons/Rogue/WalkingCane.cs index 0331d03098..e7856d099c 100644 --- a/Items/Weapons/Rogue/SlickCane.cs +++ b/Items/Weapons/Rogue/WalkingCane.cs @@ -3,12 +3,17 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class SlickCane : RogueWeapon + [LegacyName("SlickCane")] + public class WalkingCane : RogueWeapon { + public static float MoveSpeedBoost = 0.15f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 42; @@ -22,9 +27,9 @@ namespace CalamityMod.Items.Weapons.Rogue Item.knockBack = 6f; Item.UseSound = SoundID.DD2_GhastlyGlaivePierce; Item.autoReuse = true; - Item.value = Item.buyPrice(gold: 35); // Sold by Bandit + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 16f; Item.DamageType = RogueDamageClass.Instance; } diff --git a/Items/Weapons/Rogue/SlickCane.png b/Items/Weapons/Rogue/WalkingCane.png similarity index 100% rename from Items/Weapons/Rogue/SlickCane.png rename to Items/Weapons/Rogue/WalkingCane.png diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 51e11a5e97..419a2e7967 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -1069,17 +1069,6 @@ SkyfinBombers: { ''' } -SlickCane: { - DisplayName: Slick Cane - Tooltip: - ''' - Swipes a cane that steals money from enemies - Stealth strikes give a 1 in 20 chance for enemies to drop 1-2 gold coins when hit - Stealth strikes boost damage in proportion to money in the inventory, up to 1 Platinum - 'Economy at its finest' - ''' -} - SludgeSplotch: { DisplayName: Sludge Splotch Tooltip: Stealth strikes cause the main ball of sludge to split on hit, inflicting more damage @@ -1359,6 +1348,17 @@ Vega: { ''' } +WalkingCane: { + DisplayName: Walking Cane + Tooltip: + ''' + Swipes a pointed walking cane + Stealth strikes drain the sanity of foes, causing shadow hands to be summoned when attacked + While held, increases movement speed by {0}% + 'Is it walking me, or am I walking it?' + ''' +} + WaveSkipper: { DisplayName: Wave Skipper Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index 4ce439ea10..74d6beff22 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -400,7 +400,7 @@ TavernkeepChat.FullMoon: Care for a little Moonshine? TaxCollectorChat: { DoGDefeated: Devourer of what, you said? Devourer of Funds, if its payroll is anything to go by! PreBrimmy: So those punks on Azafure think they can live for free on my lands? Tell you what, do my job there and I might give you a bonus. - HasSlickCane: Goodness! That cane has swagger! + HasWalkingCane: Goodness! That cane has swagger! Has100Plat: BAH! Doesn't seem like I'll ever be able to quarrel with the debts of the town again! Has500Plat: Where and how are you getting all of this money?! Scram, you have no need for me! } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index bfd43316ca..b5827985bb 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -288,6 +288,7 @@ namespace CalamityMod.NPCs public bool crumble = false; public int antlionCloudDebuffTimer = 0; + public int caneInsanityTimer = 0; public bool scionsCurioEffected = false; public bool abaddonEffected = false; public bool apollyonEffected = false; @@ -569,6 +570,7 @@ namespace CalamityMod.NPCs myClone.crumble = crumble; myClone.antlionCloudDebuffTimer = antlionCloudDebuffTimer; + myClone.caneInsanityTimer = caneInsanityTimer; myClone.scionsCurioEffected = scionsCurioEffected; myClone.abaddonEffected = abaddonEffected; myClone.apollyonEffected = apollyonEffected; @@ -799,6 +801,8 @@ namespace CalamityMod.NPCs if (antlionCloudDebuffTimer > 0) antlionCloudDebuffTimer--; + if (caneInsanityTimer > 0) + caneInsanityTimer--; if (cursorFocus > 0 && cursorFocus < cursorFocusMax) cursorFocus--; relicOfResilienceWeakness = false; @@ -4865,6 +4869,29 @@ namespace CalamityMod.NPCs return DrawVanillaBestiaryWorms(spriteBatch, npc, drawColor); } } + + if (caneInsanityTimer > 0) + { + Texture2D tex = TextureAssets.Npc[npc.type].Value; + Rectangle frame = npc.frame; + float fadeInAmt = caneInsanityTimer > 570 ? Utils.GetLerpValue(600, 570, caneInsanityTimer) : caneInsanityTimer < 30 ? Utils.GetLerpValue(0, 30, caneInsanityTimer) : 1f; + Vector2 origin = new Vector2(tex.Width / 2, tex.Height / Main.npcFrameCount[npc.type] / 2); + SpriteEffects sp = npc.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Vector3 colorHSL = Main.rgbToHsl(Color.Violet); + + CalamityUtils.EnterShaderRegion(spriteBatch); + GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(1f); + GameShaders.Misc["CalamityMod:BasicTint"].UseSaturation(fadeInAmt * 0.35f); + GameShaders.Misc["CalamityMod:BasicTint"].UseColor(Main.hslToRgb(1f - colorHSL.X, colorHSL.Y, colorHSL.Z)); + GameShaders.Misc["CalamityMod:BasicTint"].Apply(); + for (int i = 0; i < 4; i++) + { + Vector2 offset = Vector2.UnitX.RotatedBy(Main.GlobalTimeWrappedHourly * MathHelper.TwoPi * 2f + (MathHelper.TwoPi * i / 4f)) * 0f * fadeInAmt; + Main.EntitySpriteDraw(tex, npc.Center - screenPos - Vector2.UnitY * (npc.gfxOffY) + offset, frame, Color.Violet, npc.rotation, origin, npc.scale, sp); + } + CalamityUtils.ExitShaderRegion(spriteBatch); + } + if (npc.type != NPCID.BrainofCthulhu && (npc.type != NPCID.DukeFishron || npc.ai[0] <= 9f) && npc.active) { if (CalamityClientConfig.Instance.DebuffDisplay && (npc.boss || BossHealthBarManager.MinibossHPBarList.Contains(npc.type) || BossHealthBarManager.OneToMany.ContainsKey(npc.type) || CalamityNPCSets.ForceDrawDebuffDisplay[npc.type])) diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index fc2a6c5711..aea2e19677 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -1196,7 +1196,8 @@ namespace CalamityMod.NPCs ItemID.LucyTheAxe, ItemID.PewMaticHorn, ItemID.WeatherPain, - ItemID.HoundiusShootius + ItemID.HoundiusShootius, + ModContent.ItemType() }; LCR_NotExpert.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, deerWeapons)); } diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index f02551ccd6..9911710c7f 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -1234,8 +1234,8 @@ namespace CalamityMod.NPCs chat = CalamityUtils.GetTextValue("Vanilla.TaxCollectorChat.DoGDefeated"); else if (Main.rand.NextBool(5) && !DownedBossSystem.downedBrimstoneElemental) chat = CalamityUtils.GetTextValue("Vanilla.TaxCollectorChat.PreBrimmy"); - else if (Main.rand.NextBool(10) && CalamityUtils.InventoryHas(Main.LocalPlayer, ItemType())) - chat = CalamityUtils.GetTextValue("Vanilla.TaxCollectorChat.HasSlickCane"); + else if (Main.rand.NextBool(10) && CalamityUtils.InventoryHas(Main.LocalPlayer, ItemType())) + chat = CalamityUtils.GetTextValue("Vanilla.TaxCollectorChat.HasWalkingCane"); else if (Main.rand.NextBool(5) && platinumCoins >= 500) chat = CalamityUtils.GetTextValue("Vanilla.TaxCollectorChat.Has500Plat"); else if (Main.rand.NextBool(5) && platinumCoins >= 100) @@ -1315,14 +1315,6 @@ namespace CalamityMod.NPCs defense += 20; } } - - public override bool? CanBeHitByProjectile(NPC npc, Projectile projectile) - { - // Not an axe but close enough - if (npc.type == NPCID.TaxCollector && projectile.type == ProjectileType()) - return true; - return base.CanBeHitByProjectile(npc, projectile); - } #endregion #region Shop Stuff diff --git a/NPCs/TownNPCs/Bandit.cs b/NPCs/TownNPCs/Bandit.cs index 0398c06522..001595d331 100644 --- a/NPCs/TownNPCs/Bandit.cs +++ b/NPCs/TownNPCs/Bandit.cs @@ -307,7 +307,6 @@ namespace CalamityMod.NPCs.TownNPCs NPCShop shop = new(Type); shop.Add() .Add() - .Add() .Add() .Add(ItemID.TigerClimbingGear) .Add(Condition.DownedPirates) diff --git a/Projectiles/Rogue/SlickCaneProjectile.cs b/Projectiles/Rogue/SlickCaneProjectile.cs deleted file mode 100644 index a9584f036a..0000000000 --- a/Projectiles/Rogue/SlickCaneProjectile.cs +++ /dev/null @@ -1,167 +0,0 @@ -using System; -using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.Projectiles.BaseProjectiles; -using CalamityMod.Systems.Collections; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.Localization; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Rogue -{ - public class SlickCaneProjectile : BaseSpearProjectile - { - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - public override string Texture => "CalamityMod/Items/Weapons/Rogue/SlickCane"; - - private bool initialized = false; - public override void SetDefaults() - { - Projectile.width = 40; - Projectile.height = 36; - Projectile.DamageType = RogueDamageClass.Instance; - Projectile.timeLeft = 120; - Projectile.friendly = true; - Projectile.hostile = false; - Projectile.tileCollide = false; - Projectile.ignoreWater = true; - Projectile.penetrate = -1; - Projectile.ownerHitCheck = true; - Projectile.hide = true; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; - Projectile.alpha = 180; - Projectile.scale = 1.25f; - } - public override SpearType SpearAiType => SpearType.GhastlyGlaiveSpear; - public override float TravelSpeed => 8f; - - public override bool PreAI() - { - // Initialization. Using the AI hook would override the base spear's code, and we don't want that. - if (!initialized) - { - Main.player[Projectile.owner].Calamity().ConsumeStealthByAttacking(); - initialized = true; - } - return true; - } - - public override bool PreDraw(ref Color lightColor) - { - Vector2 drawPosition = Projectile.position + new Vector2(Projectile.width, Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; - Texture2D alternateHookTexture = Projectile.spriteDirection == -1 ? ModContent.Request("CalamityMod/Projectiles/Rogue/SlickCaneProjectileAlt").Value : Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Vector2 origin = new Vector2(Projectile.spriteDirection == 1 ? alternateHookTexture.Width + 8f : -8f, -8f); - Main.EntitySpriteDraw(alternateHookTexture, drawPosition, null, - lightColor, Projectile.rotation, - origin, Projectile.scale, SpriteEffects.None, 0); - return false; - } - - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) - { - float spearLengthMult = 2.5f; - float velocityMagnitude = 0f; - if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), - Main.player[Projectile.owner].Center, Main.player[Projectile.owner].Center + Projectile.velocity * spearLengthMult, - (TravelSpeed + 1f) * Projectile.scale, ref velocityMagnitude)) - { - return true; - } - return false; - } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - Player player = Main.player[Projectile.owner]; - //Dont drop money from Dummies, WoF eyes and worm segments to make grinding money a bit harder and not give money from Dummies since that was apparently happening - if (Projectile.owner == Main.myPlayer && target.IsAnEnemy(false) && !target.dontCountMe && !CalamityNPCSets.ForceDrawDebuffDisplay[target.type]) - { - float moneyValueToDrop = target.value / Main.rand.NextFloat(15f, 35f); - // Maximum of 50 silver, not counting steath strikes - moneyValueToDrop = (int)MathHelper.Clamp(moneyValueToDrop, 0, 5000f); - if (Projectile.Calamity().stealthStrike && Main.rand.NextBool(20)) - { - moneyValueToDrop += Item.buyPrice(0, Main.rand.Next(1, 3), Main.rand.Next(0, 100), Main.rand.Next(0, 100)); - SoundEngine.PlaySound(TheSevensStriker.TriplesSound, Projectile.Center); - } - else if (moneyValueToDrop > 0f) - SoundEngine.PlaySound(TheSevensStriker.DoublesSound, Projectile.Center); - while (moneyValueToDrop > 10000f) - { - int modifiedMoneyValue = (int)(moneyValueToDrop / 10000f); - if (modifiedMoneyValue > 50 && Main.rand.NextBool(5)) - { - modifiedMoneyValue /= Main.rand.Next(3) + 1; - } - if (Main.rand.NextBool(5)) - { - modifiedMoneyValue /= Main.rand.Next(3) + 1; - } - moneyValueToDrop -= 10000 * modifiedMoneyValue; - Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.GoldCoin, modifiedMoneyValue); - } - while (moneyValueToDrop > 100f) - { - int modifiedMoneyValue = (int)(moneyValueToDrop / 100f); - if (modifiedMoneyValue > 50 && Main.rand.NextBool(5)) - { - modifiedMoneyValue /= Main.rand.Next(3) + 1; - } - if (Main.rand.NextBool(5)) - { - modifiedMoneyValue /= Main.rand.Next(3) + 1; - } - moneyValueToDrop -= 100 * modifiedMoneyValue; - Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.SilverCoin, modifiedMoneyValue); - } - while (moneyValueToDrop > 0f) - { - int modifiedMoneyValue = (int)moneyValueToDrop; - if (modifiedMoneyValue > 50 && Main.rand.NextBool(5)) - { - modifiedMoneyValue /= Main.rand.Next(3) + 1; - } - if (Main.rand.NextBool(5)) - { - modifiedMoneyValue /= Main.rand.Next(4) + 1; - } - if (modifiedMoneyValue < 1) - { - modifiedMoneyValue = 1; - } - moneyValueToDrop -= modifiedMoneyValue; - Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.CopperCoin, modifiedMoneyValue); - } - } - } - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - // Boost dmg in proportion to money, caps at 1 plat. - if (Projectile.Calamity().stealthStrike) - { - Player player = Main.player[Projectile.owner]; - double money = Utils.CoinsCount(out bool overflow, player.inventory); - double cap = 1000000; - if (money >= cap) - money = cap; - if (money != 0) - { - modifiers.SourceDamage *= (float)(money / 1000000 + 1); - SoundEngine.PlaySound(TheSevensStriker.JackpotSound, Projectile.Center); - for (int j = 0; j < 8; j++) - { - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.GoldCoin, 0f, 0f, 100, default, 3f); - Main.dust[dust2].noGravity = true; - Main.dust[dust2].velocity *= 5f; - dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.GoldCoin, 0f, 0f, 100, default, 2f); - Main.dust[dust2].velocity *= 2f; - } - } - } - } - } -} diff --git a/Projectiles/Rogue/SlickCaneProjectileAlt.png b/Projectiles/Rogue/SlickCaneProjectileAlt.png deleted file mode 100644 index 1453d665101816f7685ebe688fb328aa1ecf9a68..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 793 zcmV+!1LpjRP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!T7Z~8pS=lwm;^S;|-GojJrL3Xw{ zk{pe!}VRr;A{jrIX#0E>~f>*&88!Vkn5QrP&RVK zD7~_?6*+Ke8c9aqe??YS?8AUBiEpTPpHZ4T+E|BtyAXj%u4eXLw|fye6-*(|_+3cS zHxWhdb(h2FYVtd3vQxAA7*$s}O{$EJ$(}rAHyRyJHXupPswaPC_3LA_=WIJJRzGK8 z^!D8gsL9jEud-K?H}kSr-$i9l)_c9k<|b+O#_2GUCs(z@4x{nR2I@aGtJSK9$%l`w zlhzfj-$5PtNIx=d#)5`KTOPrKcJ=wo@hj@ZlqY0m z&F0s~==qK|T&Pb?gsWZv1BLb!4U3*cik>vg&pXBwPVn3Lwdzq^sL!K$uw;~Qe)Y|v zw@1Ef@s8DbYcPK#x{O-=JNg*S=9YcY468 CalamityUtils.GetItemName(); + public static Asset AltTexture; + + private bool initialized = false; + + public override void SetStaticDefaults() + { + if (!Main.dedServ) + AltTexture = ModContent.Request("CalamityMod/Projectiles/Rogue/WalkingCaneProjectileAlt"); + } + public override void SetDefaults() + { + Projectile.width = 40; + Projectile.height = 36; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.timeLeft = 120; + Projectile.friendly = true; + Projectile.hostile = false; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.penetrate = -1; + Projectile.ownerHitCheck = true; + Projectile.hide = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + Projectile.alpha = 180; + Projectile.scale = 1.25f; + } + public override SpearType SpearAiType => SpearType.GhastlyGlaiveSpear; + public override float TravelSpeed => 12f; + + public override bool PreAI() + { + // Initialization. Using the AI hook would override the base spear's code, and we don't want that. + if (!initialized) + { + Main.player[Projectile.owner].Calamity().ConsumeStealthByAttacking(); + initialized = true; + } + return true; + } + + public override bool PreDraw(ref Color lightColor) + { + Vector2 drawPosition = Projectile.position + new Vector2(Projectile.width, Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; + Texture2D alternateHookTexture = Projectile.spriteDirection == -1 ? AltTexture.Value : Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Vector2 origin = new Vector2(Projectile.spriteDirection == 1 ? alternateHookTexture.Width + 8f : -8f, -8f); + + Main.EntitySpriteDraw(alternateHookTexture, drawPosition, null, lightColor, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + return false; + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + float spearLengthMult = 2.5f; + float velocityMagnitude = 0f; + if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), + Main.player[Projectile.owner].Center, Main.player[Projectile.owner].Center + Projectile.velocity * spearLengthMult, + (TravelSpeed + 1f) * Projectile.scale, ref velocityMagnitude)) + { + return true; + } + return false; + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (Projectile.Calamity().stealthStrike) + { + target.Calamity().caneInsanityTimer = 600; + } + else if (target.Calamity().caneInsanityTimer > 0) + { + Vector2 position = target.Center + Main.rand.NextVector2CircularEdge(100f, 100f); + Vector2 velocity = (target.Center - position).SafeNormalize(Vector2.Zero) * 6f; + float ai0 = Main.rand.NextBool() ? 300f : 0f; + float ai1 = Main.rand.NextBool() ? velocity.ToRotation() : 0f; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), position, velocity, ProjectileID.InsanityShadowFriendly, Projectile.damage / 2, Projectile.knockBack, Projectile.owner, ai0, ai1); + } + } + } +} diff --git a/Projectiles/Rogue/WalkingCaneProjectile.png b/Projectiles/Rogue/WalkingCaneProjectile.png new file mode 100644 index 0000000000000000000000000000000000000000..f3c41400f5a4c78ca7188a7733b21e18724e4b26 GIT binary patch literal 626 zcmV-&0*(ENP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0tZP%K~!i%?U_GF z96=O^zq3>-0q8v0 z1)!(b{l%jnF4Z)yWX>Cl8=0HzXbHsMz8?bM-2yzc52# zRCd;H)G=s9Z7)|Vwkity``%c!*cHuxa%UG|Z@M?d zb|S()3Eo&GtSLS7!meoCcw=G2wNKp^Z_ILEO$l#I+;>yL8%v5QQNPBLW=hnbv80+3 z^Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0r*KoK~!i%?U_#~ zL_rw9e=8^DKu%UkLM|xbWFzI^rYHv&|IQr!DF?)rl#`S=>_L=+gVNSsMbJW z5Z85>KK4z!Ec@QR*W3A>c4p_zVSe*{^SyZivZSuEGMU=GO(X*8`UUylEsFFGzwqm- zijnAim8Czl@C?AriPGYCO^bUZN*arYT%_ZLt z0TYLDFvgtcYjt%~I^jJPQys-tV+U`wmT{651-A_P-3wOZ)0Z#o9w$ z#Z*l&2tZ@KGB@3M4=I(2F=jIXiLK48DFB*6>YO@QKY}zBg`ijWdM&xJ{SGdkZ-rw_ zxQo32u(GxbKdiX^J~mWc1}Rx{`Aqd6pPr_D-YNWV%&zw;nNQD_`L6m4$Cx0MMy|0T z^Y?X!Adlw!YfOG*GWT0n%ocrq*%4B~kyLN<5;TUro zeMd;l*=^1ka|)-^5hN20kV_riy xr+)=9#=MH$q0F|bwtNdW#=MGtha&ja*e9NO{ZTJjK8FAR002ovPDHLkV1n0~5vl+H literal 0 HcmV?d00001 diff --git a/Systems/Collections/CalamityItemSets.cs b/Systems/Collections/CalamityItemSets.cs index 6098ba21ff..480042173a 100644 --- a/Systems/Collections/CalamityItemSets.cs +++ b/Systems/Collections/CalamityItemSets.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Systems.Collections /// public static bool[] DisablesVeneratedLocketEffect = Factory.CreateNamedSet("DisablesVeneratedLocketEffect") .Description("Prevents this item from triggering Venerated Locket's clone projectiles.") - .RegisterBoolSet(ItemType(), ItemType(), ItemType()); + .RegisterBoolSet(ItemType(), ItemType(), ItemType()); /// /// If for an item type, this item is considered to be a magic gun.