Quantcast
Channel: ZDoom
Viewing all articles
Browse latest Browse all 3391

Scripting • Re: Can falling damage scale with jump height?

$
0
0
Woo! I got it to work!

Code:

Override void Tick(){pvel=vel.z;Super.Tick();FallDamage();}void FallDamage(){double cvel = vel.z;double jumpvel = pvel+JumpZ;int damage;If(pvel<cvel){If(jumpvel<=-11){damage=(int)((0-jumpvel)*2);}If (damage>0) {DamageMobj(null,null,damage,"Falling");}}}
I'll probably have to tweak the falling damage formula to get it to a good balance, but I did away with the instakill. You can still die from falling too much but if you get your jump stat really high (and I mean ridiculously high) you can fall almost any height without taking damage.

Statistics: Posted by Heisanevilgenius — Sun Aug 25, 2024 10:43 pm



Viewing all articles
Browse latest Browse all 3391

Trending Articles