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 support for running and smashing animations #65622

Merged
merged 11 commits into from
May 15, 2023

Conversation

Rewryte
Copy link
Contributor

@Rewryte Rewryte commented May 13, 2023

Summary

Features "Add support for running and smashing animations"

Purpose of change

Certain actions could benefit from some extra animations for improved reactivity. Sprinting and smashing are some of those.

Describe the solution

Adds new sprite IDs which allow tilesets to assign sprites for a motion trail when a character is running, as well as for various smashing animations. Sprinting animations are available in 8 directions, while smashing animations come in ineffective smashing, effective smashing, and complete smashing (destruction).

Tileset makers have full control on how these are used. For example, you could reuse 3 sprites between the 8 sprinting directions, show cracks for effective smashing, and no sprite at all for ineffective smashing.

This modifies the function cata_tiles::draw_custom_explosion_frame, which normally falls back to 3 explosion sprites determined by nc_color if the target sprite is missing. It now supports nc_black which will result in no fallback image. This adds some flexibility for more custom animations in the future.

Describe alternatives you've considered

Testing

The video below shows these animations at work using ChibiUltica as the tileset. "fd_smoke" is used for both sprinting and smashing destruction, while "crack_glass_center_tall" is used for effective smashing.

test.mp4

Additional context

The new sprite IDs can be found in TILESET.md under Hardcoded IDs.

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [C++] Changes (can be) made in C++. Previously named `Code` [Markdown] Markdown issues and PRs <Enhancement / Feature> New features, or enhancements on existing json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels May 13, 2023
@Rewryte
Copy link
Contributor Author

Rewryte commented May 13, 2023

1 failing test about grab break probability in a rather specific scenario. Similar tests pass. Unlikely to be related.

@Rewryte Rewryte marked this pull request as ready for review May 13, 2023 15:54
Rewryte added a commit to Rewryte/Cataclysm-DDA that referenced this pull request May 13, 2023
Changing to c_black will prevent explosion sprites used as a fallback, assuming CleverRaven#65622 gets merged.
@dseguin dseguin merged commit 01ecf00 into CleverRaven:master May 15, 2023
dseguin pushed a commit that referenced this pull request May 19, 2023
* added mechanic

* astyle

* fixed text and move calculation

* scent movement changes

* add last known position

* astyle

* separate function

* enforce z-level

* astyle

* remove unused

* redundant param

* refine scent code

* smell_threshold wander

* add field processor

* increase effect duration

* function refresh duration

* attack air mechanic

* hit calls function

* change declaration type

* move reapply code to on_hit

* npc support

moved stumble_invis and attack_air functions from the monster class to the creature class

* rename param

* missing checks for attacking air

* astyle

* attack air for npc

* clang-tidy

* fix npc ignore invis

* astyle

* unused decs

* clean up attack_air

* animate attack_air

* prevent fallback

Changing to c_black will prevent explosion sprites used as a fallback, assuming #65622 gets merged.

* check anim setting

* missing include
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` <Documentation> Design documents, internal info, guides and help. <Enhancement / Feature> New features, or enhancements on existing json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants