feat(content,port): AGGRO_CHARACTER
flag for enemies
#5846
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
Required
main
so it won't cause conflict when updatingmain
branch later.Optional
please remove sections irrelevant to this PR.
Co-Authored-By
in the commit message.doc/
folder.Purpose of change
ports change
CleverRaven/Cataclysm-DDA#59795
Additionally, to allow for the creation of enemies with high aggression that wont attack player until triggered by a flag, which otherwise always would. Enemies which do not have
AGGRO_CHARACTER
set to false should behave the same as they did before. Monsters that have this tag, when fighting, should now focus on whatever enemy they were already fighting and redirect their anger to the player less often.Describe the solution
Describe alternatives you've considered
Testing
Spawned a 5x5 grid of moose to fight a 5x5 grid of zombie dogs. They fought and the moose eventually started fleeing once enough friends died. They seem to behave exactly the same as they did before the change.
Spawned bee, beaver, and giant jumping spider. All seem to behave the same as before.
Created a civilian monster that has high aggression and a high melee attack. Spawned it in a city, and it fought zombies until dying but did not target the player. The civilian will not be included in the PR.
Changed "mongrel" to have 99 aggression. Mongrel instantly attacks player. When
aggro_character
is set to false, mongrel no longer attacks player, however follows the player around very closely for a long time. I don't think this following behavior is a result of this change, but rather how aggression already worked.I spawned a group of civilians with 100 aggression in a city. They fought the zombies around until the zombies died. The civilians then attacked me. A group of civilians with 50 aggression do not attack. This is odd, as the DDA equivalent does not seem to have this issue. This should be fixed.
I spawned a group of civilians with 100 aggression in a field. Saved and reloaded. Civilians are now aggressive, and won't give up on killing the player. A group spawned with 50 aggression quickly loses interest and goes back to neutral and the expected behavior. This is probably related to the issue above.
As you can see, there is still some unexpected behavior that needs to be sorted out before being merged. These issues most likely wont affect the current player experience as (i think) there are no monsters that would get aggro_character = false and need 100 aggression for some reason, but would prevent a 1:1 port of certain monsters from DDA (namely the civilians) and should be fixed anyways.
Additional context
We probably need to apply this to more monsters as well, as I only ported what DDA animals had aggro_character set to false.
CleverRaven/Cataclysm-DDA#59565 is also relevant to DDA's version of this change
if implemented #1879 would be fixed