Jump to content

Recommended Posts

Like the title says, I'm looking for someone who can help me code a trait for a custom character.

A friend of mine asked me to make a character who deals more damage when said character has 40% or less HP.

I thought I could adapt Wolfgang's trait, but replace hunger with health, bto my surprise it's more complicated than that.

The trait is:
-Damage Multiplier = 1.5 when health is below or equal to 40%
-Damage Multiplier = 1 when health is above 40%.

Health is 200.

 

Any help is appreciated.

theoretically, it shouldn't be more complicated than just adapting Wolfgang's trait coding.

 

Change the onhungerchange function to listen for health change instead.

 

inst:ListenForEvent("hungerdelta", onhungerchange)  would become  inst:ListenForEvent("healthdelta", onhealthchange)  

(and you'd need to change all other instances of onhungerhange to onhealthchange as well)

 

All instances of   inst.components.hunger.current   would be changed to   inst.components.health.current   (I THINK)

 

 

TUNING.WOLFGANG_START_MIGHTY_THRESH is just a number declared in tuning.lua. you can just replace it with any number you want, like "55" and that would make his "mighty" level start when he has 55 hunger. (of course you'd change it to work with health instead and stuff)

 

 

You'd just have to cut out all the extra stuff like the animations and size stuff that changes when his mightyness levels change, since you don't have any of those extra animations and builds/banks and stuff.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...