[TG Mirror] Goats will randomly attack you [MDB IGNORE] #32
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.
Mirrored on Skyrat: ${this.url}
Original PR: (original url)
About The Pull Request
We accidentally lost this behaviour when we converted goats to basic mobs.
Formerly (and now again) goats had a 0.5% chance per second to simply decide to attack you for no reason at all.
While attacking you they also have a 10% chance per second to get bored of doing that and stop.
Additionally, we were outputting a fluff message every time you attacked a goat which would spam chat if you were trying to fist fight each other. I added a 20 second cooldown onto it.
As is often the case, implementing this led me down a bit of a rabbit hole.
We were previously bypassing faction checks via a mixture of flags on AI behaviours and blackboard keys.
I have moved this entirely to the blackboard now, rather than making targetting subtypes just to skip faction checks.
This entails having one blackboard key which is "by default do we care about factions?" and another which is "are we currently ignoring factions for some other reason?"
Retaliatory AI will generally enable the second flag, so you can get pissed off at someone you would usually not mind hanging out with if they start something with you. Certain mobs which want to hunt other mobs but not be hunted in return just ignore factions entirely all the time and use the former.
The upshot of this is that the default behaviour for expected default retaliatory AI shouldn't require you to set any specific kind of targetting datum and will Just Work.
In a similar vein because I was touching largely the same mobs I made the "flee when injured" component apply its "don't flee because not injured" flag instantly upon application rather than needing to manually set it in the blackboard definition, so that also Just Works.
Changelog
🆑 Jacquerel
fix: Pete's anger management training has worn off, and he will once again sometimes pick a fight with you for absolutely no reason.
qol: Attacking a goat will not spam messages so frequently.
/:cl: