CleverRaven/Cataclysm-DDA

Specific mutations can override displayed sprite overlays

Open

#51,293 opened on Sep 1, 2021

View on GitHub
 (2 comments) (0 reactions) (0 assignees)C++ (3,991 forks)batch import
(P3 - Medium)<Enhancement / Feature>Good First IssueMutations / Traits / Professions/ HobbiesSDL: Tiles / Sound[C++]

Repository metrics

Stars
 (9,264 stars)
PR merge metrics
 (Avg merge 6d 5h) (292 merged PRs in 30d)

Description

Is your feature request related to a problem? Please describe.

In order to make some NPCs appear to be big stompy robots, I need to be able to hide any other sprites associated with them, so they don't wind up with clothing floating awkwardly in front of their bodies.

Describe the solution you'd like

EASY:

  • Create a new mutation attribute that disables all character overlays and hides the default player sprite, except for the sprite for the mutation itself. For example, if the mutation EXODII_BODY_1a has the line: "sprite_override": true then a character with EXODII_BODY_1a will see only the sprite for overlay_mutation_EXODII_BODY_1a, and no worn/wielded/mutation overlays nor the base player sprite.

This can be done without any further work and with just this feature I can get rolling. However, if you want to go the extra mile...

MEDIUM: For sprites with sprite_override: true, allow an set of strings like: "overlay_prefix": { "worn": "exodii", "wield": "large", "mutation": false }

in this example, if there was a worn overlay sprite for a given item, like overlay_worn_exodii_jeans, then we'd use that overlay in this sprite. If the overlay didn't exist we wouldn't show anything. Wielded sprites would use the large prefix, presumably the same kind large and huge mutants use to fit their giant hands. Other mutation sprites would remain invisible.

Describe alternatives you've considered

There are other ways we could structure this and I am open to ideas.

Other stuff

In the longer run I need some better ways to ensure the exodii can't wear certain clothes. For now I am limiting them to XXL clothes, which honestly will work fine if I can render those correctly as above.

Contributor guide