tModLoader I need some help with a custom weapon

Stocking

Terrarian
the idea is a weapon where left clicking behaves like a normal spear, and right clicking holds the weapon down and lets you bounce on enemies. the whole thing is a shovel knight reference and i just can't get anything even remotely close to working and need some help from a more experienced programmer.

if you've played shovel knight imagine that, but terraria
1692272912401.png
 
What is your current code? What part are you having issues with?
 
none of it works lol. all i was able to do was give it a spear stab with left click, and the same spear stab but with higher damage on right click.
 
So for the right click attack, what you'd want to do is something along these lines.

Give the projectile 0 velocity, give it rotation so it's pointed straight down from the player.
If it hits an NPC, give the player a boost of -Y velocity for the bounce. If you want it continuous, you can either give it a very high timeLeft, and only despawn the projectile if you touch the ground, or give it extra timeLeft every time you hit an NPC.
 
Back
Top Bottom