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 monster/character differentiation to monster hostility #59795

Merged
merged 4 commits into from
Aug 10, 2022

Conversation

Venera3
Copy link
Member

@Venera3 Venera3 commented Jul 31, 2022

Summary

Features "Add monster/character differentiation to monster hostility"

Purpose of change

Add a (rudimentary) selection to monster hostility, optionally filtering out characters until a character actually trips an anger trigger.
First pass at #59565

Describe the solution

  • Add aggro_character (default true) to monster and mtype. false means the monster will be passive towards characters.
  • Add some logic to anger triggers to allow flipping aggro_character when a character trips the trigger: attacking/killing a friendly critter, hurting the monster and threatening offspring will always do so, the other triggers will have a random chance for each time they trigger
  • Add a lot of debugmode messages to aggro changes
  • Add a chance to reset the aggro_character when the monster reached its baseline anger level

TODO:

  • Actually add the filter to monsters where it makes sense (or hook up some smartypants auto-definition for it)

Describe alternatives you've considered

Autodefine it if the monster's aggression is 100, but that was going to exclude some smart-but-hateful mobs like ferals.
Use a flag, but those can't be readily removed/reactivated.

Testing

Set a monster to aggro_character: false before allowing the bool to flip at all, the mob ignored me but attacked other creatures as expected.
After doing the triggers they each are able to flip the aggro filter, debugmode messages trigger.
Aggroed monsters lose aggro both in-bubble and on load after a long time.
NPCs aggro monsters with the same condition as player, an aggroed monster attacks both.

Additional context

Includes the changes from #59766 for sanity's sake until that merges.
The list of monsters with the filter is TBD, but will probably include wasps and other problem kids

@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 astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Jul 31, 2022
@NetSysFire NetSysFire added the Monsters Monsters both friendly and unfriendly. label Jul 31, 2022
@github-actions github-actions bot added the [JSON] Changes (can be) made in JSON label Aug 1, 2022
@Venera3
Copy link
Member Author

Venera3 commented Aug 1, 2022

First pass on JSON - ground rules for inclusion: an aggression below auto-aggro level, anger triggers that are hooked up to the aggro system and general flavor (properly dumb critters don't care either way). I also did some buggy bugfixes around armored centipedes and ladybugs/striders that came up.
If any mod maintainer wants me to include the mods in this PR I can do that, but I'll need a pointer what should be smart in them.

@Venera3 Venera3 marked this pull request as ready for review August 1, 2022 11:43
@Maleclypse
Copy link
Member

Maleclypse commented Aug 1, 2022

The prep-net cyber dogs and tripods from Aftershock

@github-actions github-actions bot added Mods Issues related to mods or modding Mods: Aftershock Anything to do with the Aftershock mod Mods: Magiclysm Anything to do with the Magiclysm mod labels Aug 2, 2022
@Venera3
Copy link
Member Author

Venera3 commented Aug 2, 2022

Explicitly tested the forge of wonders as a sticking point for this by spawning a 9*9 grid of zombies in the middle of the garden. Forgeborn and workers got nice and agitated and beat their teeth in (getting hit, killed and all the rest in the process), they still didn't think to punch their Valued Customer. They still did decide to murder all the fish in their own pond, but that's harder to solve.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Aug 7, 2022
Copy link
Member

@Maleclypse Maleclypse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aftershock and Magiclysm look good

@Maleclypse
Copy link
Member

Should be linked with #54752

@dseguin dseguin merged commit 72d443b into CleverRaven:master Aug 10, 2022
@Venera3 Venera3 deleted the aggro_character branch August 14, 2022 18:41
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] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs Mods: Aftershock Anything to do with the Aftershock mod Mods: Magiclysm Anything to do with the Magiclysm mod Mods Issues related to mods or modding Monsters Monsters both friendly and unfriendly.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants