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)
This commit is contained in:
CongratsIsTrash committed 2026-07-05 00:30:38 -04:00
1 parent e3fb3f1940
commit f0d0bbec81
18 files changed
+160 -200

No files matched your search

+5 -2
View File
@@ -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<WalkingCane>())
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);
+2 -2
View File
@@ -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;
}
Binary file not shown.
+2 -1
View File
@@ -76,7 +76,8 @@ namespace CalamityMod.Items
ItemID.LucyTheAxe,
ItemID.PewMaticHorn,
ItemID.WeatherPain,
ItemID.HoundiusShootius
ItemID.HoundiusShootius,
ModContent.ItemType<WalkingCane>()
};
loot.Add(DropHelper.CalamityStyle(DropHelper.BagWeaponDropRateFraction, deerclopsWeapons));
loot.AddRevBagAccessories();
@@ -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<SlickCaneProjectile>();
Item.shoot = ModContent.ProjectileType<WalkingCaneProjectile>();
Item.shootSpeed = 16f;
Item.DamageType = RogueDamageClass.Instance;
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 789 B

After

Width:  |  Height:  |  Size: 789 B

@@ -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:
@@ -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!
}
+27
View File
@@ -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]))
+2 -1
View File
@@ -1196,7 +1196,8 @@ namespace CalamityMod.NPCs
ItemID.LucyTheAxe,
ItemID.PewMaticHorn,
ItemID.WeatherPain,
ItemID.HoundiusShootius
ItemID.HoundiusShootius,
ModContent.ItemType<WalkingCane>()
};
LCR_NotExpert.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, deerWeapons));
}
+2 -10
View File
@@ -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<SlickCane>()))
chat = CalamityUtils.GetTextValue("Vanilla.TaxCollectorChat.HasSlickCane");
else if (Main.rand.NextBool(10) && CalamityUtils.InventoryHas(Main.LocalPlayer, ItemType<WalkingCane>()))
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<SlickCaneProjectile>())
return true;
return base.CanBeHitByProjectile(npc, projectile);
}
#endregion
#region Shop Stuff
-1
View File
@@ -307,7 +307,6 @@ namespace CalamityMod.NPCs.TownNPCs
NPCShop shop = new(Type);
shop.Add<Cinquedea>()
.Add<Glaive>()
.Add<SlickCane>()
.Add<OldDie>()
.Add(ItemID.TigerClimbingGear)
.Add<ThiefsDime>(Condition.DownedPirates)
-167
View File
@@ -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<SlickCane>();
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<Texture2D>("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;
}
}
}
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 793 B

@@ -0,0 +1,99 @@
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 ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Rogue
{
public class WalkingCaneProjectile : BaseSpearProjectile
{
public override LocalizedText DisplayName => CalamityUtils.GetItemName<WalkingCane>();
public static Asset<Texture2D> AltTexture;
private bool initialized = false;
public override void SetStaticDefaults()
{
if (!Main.dedServ)
AltTexture = ModContent.Request<Texture2D>("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);
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

+1 -1
View File
@@ -60,7 +60,7 @@ namespace CalamityMod.Systems.Collections
/// </summary>
public static bool[] DisablesVeneratedLocketEffect = Factory.CreateNamedSet("DisablesVeneratedLocketEffect")
.Description("Prevents this item from triggering Venerated Locket's clone projectiles.")
.RegisterBoolSet(ItemType<SlickCane>(), ItemType<Mycoroot>(), ItemType<CosmicKunai>());
.RegisterBoolSet(ItemType<WalkingCane>(), ItemType<Mycoroot>(), ItemType<CosmicKunai>());
/// <summary>
/// If <see langword="true"/> for an item type, this item is considered to be a magic gun.<br/>