Attack that leaves enemy at 1hp?

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
guo
Metal Slime
Posts: 743
Joined: Fri Dec 04, 2009 9:12 pm

Attack that leaves enemy at 1hp?

Post by guo »

Hiya,

What's the best way to make an attack that does regular damage but if that amount of damage is enough to kill the enemy they are left alive with 1 HP?

Is this possible?

Regards
vvight.wordpress.com
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7495
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Re: Attack that leaves enemy at 1hp?

Post by Bob the Hamster »

Hmm... I think doing this with chains of attacks is probably going to be fairly difficult...

The idea is to have something like D&D nonlethal damage, right?
User avatar
kylekrack
Liquid Metal Slime
Posts: 1207
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Re: Attack that leaves enemy at 1hp?

Post by kylekrack »

That's a pretty common RPG move. Could you do it by chaining to an attack that does 99% of target's current hp if the damage > current hp?
My pronouns are they/them
Ps. I love my wife
User avatar
guo
Metal Slime
Posts: 743
Joined: Fri Dec 04, 2009 9:12 pm

Re: Attack that leaves enemy at 1hp?

Post by guo »

Yea, that's the way KK! The problem is figuring out if the damage is going to be high enough to kill or not!
vvight.wordpress.com
User avatar
kylekrack
Liquid Metal Slime
Posts: 1207
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Re: Attack that leaves enemy at 1hp?

Post by kylekrack »

This set of conditionals should do it, no?
Attachments
vikings0000.png
vikings0000.png (3.31 KiB) Viewed 114 times
My pronouns are they/them
Ps. I love my wife
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7495
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Re: Attack that leaves enemy at 1hp?

Post by Bob the Hamster »

That conditional compares the attacker's attack stat, so if you have any extra damage, elemental damage modification, or damage randomization it won't work as expected

We should add a new built-in feature for this. As an attack bitset it would not be that hard to implement
User avatar
kylekrack
Liquid Metal Slime
Posts: 1207
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Re: Attack that leaves enemy at 1hp?

Post by kylekrack »

Whoops. I have not used the battle system much
My pronouns are they/them
Ps. I love my wife
User avatar
guo
Metal Slime
Posts: 743
Joined: Fri Dec 04, 2009 9:12 pm

Re: Attack that leaves enemy at 1hp?

Post by guo »

I appreciate the effort! Yea that could be a cool bitset , "leave target at x hp instead of killing" or something.
vvight.wordpress.com
Post Reply