Skip to content

(Comments Requested) Monster Invulnerability JSON field#82286

Closed
Maleclypse wants to merge 4 commits intoCleverRaven:masterfrom
Maleclypse:Monster-field-Invulnerability
Closed

(Comments Requested) Monster Invulnerability JSON field#82286
Maleclypse wants to merge 4 commits intoCleverRaven:masterfrom
Maleclypse:Monster-field-Invulnerability

Conversation

@Maleclypse
Copy link
Member

Summary

Features "Monster Invulnerability"

Purpose of change

Storm and I have been talking about some potential ways to make monsters have some unique ways of handling damage types. I've tried to get this far enough that maybe someone with better skills than me can take it the rest of the way.

Describe the solution

I've kinda written up some potential structure for the json but I don't think I can take this across the finish line.

Describe alternatives you've considered

Testing

Additional context

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` Monsters Monsters both friendly and unfriendly. <Enhancement / Feature> New features, or enhancements on existing json-styled JSON lint passed, label assigned by github actions labels Aug 7, 2025
Use deserialize functions for cleaner reading, and to enable using
optional/mandatory, which have better error reporting and support for
extended features.
@PatrikLundell
Copy link
Contributor

Defaulting invulnerability to everything doesn't make sense, as it would default to a monster that cannot be harmed. If it isn't actually invulnerability, but rather resistance, it might make marginally more sense (in which case I suggest changing the name to resistance). However, I would suggest resistances should be listed explicitly, and omission should be erroneous. You could allow for an "all" entry, but then it should be stated explicitly, otherwise we'll likely end up with monsters that are resistant to everything just because the creator forgot to fill in the entry for what it's actually resistant against.

The various gas/liquid filled monsters might be given negative resistance to piercing damage, i.e. vulnerability (which is another way to spin it, with negative values being resistances)...

@Maleclypse
Copy link
Member Author

Defaulting invulnerability to everything doesn't make sense, as it would default to a monster that cannot be harmed. If it isn't actually invulnerability, but rather resistance, it might make marginally more sense (in which case I suggest changing the name to resistance). However, I would suggest resistances should be listed explicitly, and omission should be erroneous. You could allow for an "all" entry, but then it should be stated explicitly, otherwise we'll likely end up with monsters that are resistant to everything just because the creator forgot to fill in the entry for what it's actually resistant against.

The various gas/liquid filled monsters might be given negative resistance to piercing damage, i.e. vulnerability (which is another way to spin it, with negative values being resistances)...

Resistance is a better name for it and I wasn't actually intending it to default to all I was more trying to create enough framework to show someone who can potentially take it further than me.

@ehughsbaird
Copy link
Contributor

Maleclypse#47 fyi

Clean up JSON loading & use std::optional
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Aug 9, 2025
@Maleclypse Maleclypse closed this Feb 8, 2026
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 [C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing json-styled JSON lint passed, label assigned by github actions Monsters Monsters both friendly and unfriendly.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants