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

add critical hits #257

Open
andrewgazelka opened this issue Apr 12, 2024 · 4 comments
Open

add critical hits #257

andrewgazelka opened this issue Apr 12, 2024 · 4 comments
Labels
good first issue 🌱 Good for newcomers help wanted 🫂 Extra attention is needed prio 🚨

Comments

@andrewgazelka
Copy link
Collaborator

andrewgazelka commented Apr 12, 2024

add critical hits

image

related #538

@andrewgazelka
Copy link
Collaborator Author

we want PvP to feel like normal mc :)

@andrewgazelka andrewgazelka added help wanted 🫂 Extra attention is needed good first issue 🌱 Good for newcomers labels Nov 3, 2024
@andrewgazelka andrewgazelka changed the title add crit calc add critical calc Dec 6, 2024
@andrewgazelka andrewgazelka changed the title add critical calc add critical hits Dec 6, 2024
@maxomatic458
Copy link

maxomatic458 commented Dec 20, 2024

you can probably use some parts of this here as reference:
https://github.com/maxomatic458/valence-extra/blob/master/crates/combat/src/lib.rs

^ that includes logic for the old and new combat system as well as support for combat relevant enchantments

EDIT:
for critical hits you would need to check if the player is falling, i solved that by just checking if the player is on a block every tick.
If the player is not, and the last grounded y level is higher then the player is falling

@Tebarem
Copy link
Collaborator

Tebarem commented Dec 20, 2024

Great! Thank you. We already track the previous tick position so I was going to just check if the y delta is negative. Gut stuck on arrows tho :)

@maxomatic458
Copy link

Great! Thank you. We already track the previous tick position so I was going to just check if the y delta is negative. Gut stuck on arrows tho :)

If you want to implement fall damage as well you would also need to keep track of some more information
https://github.com/maxomatic458/valence-extra/blob/7eba80fe928ba04114c36bdde567bdcaa6b846ea/crates/fall_damage/src/lib.rs#L4-L11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue 🌱 Good for newcomers help wanted 🫂 Extra attention is needed prio 🚨
Projects
None yet
Development

No branches or pull requests

3 participants