Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set_hp(0) and fall damage runs into armor healing #68

Open
Bastrabun opened this issue Jan 6, 2022 · 3 comments
Open

set_hp(0) and fall damage runs into armor healing #68

Bastrabun opened this issue Jan 6, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@Bastrabun
Copy link

Bastrabun commented Jan 6, 2022

Sometimes, we want to kill people.

Then we do player:set_hp(0), but if the armor the player wears has some healing properties, we can't kill them.

Repro:

  • use latest MTG, 3d_armor and 5.4.1
  • wear diamond armor
  • do /killme
    => In some cases, you are still alive. Other mods may also have this issue

IMO set_hp(0) should do exactly that: kill the player.

Also, fall damage seems to count against the heal property.

Could you please make it that high fall damage and set_hp(0) does not let anyone live?

Or could you make it that armors can register against what type of damage they help?

For my reference 998

@BuckarooBanzay
Copy link
Member

Sometimes, we want to kill people.

That's a good way to start a conversation 😆

Could you please make it that high fall damage and set_hp(0) does not let anyone live?

Do you have an idea how to achieve this?

@BuckarooBanzay BuckarooBanzay added the bug Something isn't working label Jan 7, 2022
@Bastrabun
Copy link
Author

In the register_on_player_hpchange you decide when to apply damage and when heal catches it.

  1. You could make it a public function, so that we can override it.
  2. You could make the globalstep function public as well, so we can add custom aoe
  3. You could iterate through a table of damage sources, which bring damage functions with them

This way, a game could select to apply the heal (rather a "deflect") value to falling damage or to ignore it. Imagine falling off a cliff in full plate mail. Sure, the plate would prevent bruises, but the person would die regardless of sudden deceleration.

Also, set_hp allows to provide custom reasons. In a game where laser damage is a thing and a coat of mirrors deflects lazer pew pew, but not missiles, they could specify set_hp(1000,"pewpew") on hit. My game will introduce blunt, slash and stab damage, also magic and others, even combinations of those.

@fluxionary
Copy link

IMO, as a start, the kill command that's part of builtin should provide a reason to the player:set_hp call...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants