Make mobs alert other mobs when target found #150
Labels
code
Requires code (logic/configuration) to be created or modified.
good first issue
Good for newcomers
Task description
It is currently too easy to pick off single mobs that are in a group and lure them away.
It would be better if when a mob notices a target (another character type of an opposing faction) then it would broadcast that information to any other mobs of the same faction within a certain range, so they too would be alerted of the target being found.
For example:
There is a group of knights near each other facing in different directions.
A bandit moves into the view range of a knight, so the knight notices it.
The knight would check for all nearby knights (and any other characters that have a friendly faction relationship to the knight) and tell each one of them to focus on the bandit (if they don't already have a target).
References/notes
Character factions: https://github.com/Arcanorum/dungeonz/blob/master/server/src/gameplay/Factions.js
Mob logic: https://github.com/Arcanorum/dungeonz/blob/master/server/src/entities/classes/destroyables/movables/characters/mobs/Mob.js
onDamage
for what the mob should do when it is damaged.getNearestHostileInLOS
for when a hostile character is found by this mob.Try with a range of 4 (in all directions) to check for other friendly mobs, though this may change depending on testing/feedback, as long as it is configurable.
Acceptance criteria
alertRange
.The text was updated successfully, but these errors were encountered: