• Switch 1.4: Journey's End on Switch released January 4, 2022! More details here. Report bugs here.

tModLoader Need help with modding - increasing damage on a type of ammo

GalaxiMadi

Terrarian
I was wondering how to increase the damage on a type of ammunition, but an ammo type that doesn't have accessories that benefit this - darts. How would I go about making armor and accessories that benefit ONLY darts/dart weapons? Thanks.
 

michaelsoftman

Terrarian
Are these the vanilla Terraria darts that are shot by the blowgun, dart rifle, etc?

You could edit the vanilla weapons, and I believe you can override the Shoot method to instead shoot a stronger type of dart (this would be custom ammo) if a certain accessory is equipped. The accessory would set a player variable then you'd check for it with the weapon inside of Shoot. Sort of like how the Molten bow will convert wooden arrows to flaming arrows.

The other method would be a custom damage class, here's an example - tModLoader/ExampleMod/Items/ExampleDamageClass at master · tModLoader/tModLoader

There are probably other ways to do this, but hopefully someone else can chime in too.
 

GalaxiMadi

Terrarian
Are these the vanilla Terraria darts that are shot by the blowgun, dart rifle, etc?

You could edit the vanilla weapons, and I believe you can override the Shoot method to instead shoot a stronger type of dart (this would be custom ammo) if a certain accessory is equipped. The accessory would set a player variable then you'd check for it with the weapon inside of Shoot. Sort of like how the Molten bow will convert wooden arrows to flaming arrows.

The other method would be a custom damage class, here's an example - tModLoader/ExampleMod/Items/ExampleDamageClass at master · tModLoader/tModLoader

There are probably other ways to do this, but hopefully someone else can chime in too.
I'm probably gonna use a custom damage class instead, thank you for answering!
 
Top Bottom