MineColonies

MineColonies

57M Downloads

Ranger - change fighting style to be more at a distance

bob0bob opened this issue ยท 0 comments

commented

Need to change how the Ranger fights during battles. At this moment it will try to run on top of the mob's position. Even though it is a ranger.

Ranger should keep a distance since they are using a bow.

1st. Change to check distance to target and stop moving forward once the distance is so close. This value is hard coded plus the level of the guard. A higher level guards has the ability to shoot at a greater distance.
2nd. Instead of just standing there the ranger will try and strafe around to make the target miss them. This ability and how much strafing is also based on guard level.
3rd. If the target continues to move forward on the guard and gets to close the guard will try to try to strafe by moving backwards. If after a period of time that doesn't work then the guard will try to move away at a faster speed to get some distance between the target.
Strafing can be a combination of clockwise vs. counter clockwise movement to see if they can see or get away from the target. This is not very complicated and should be expanded on much more to make them more intelligent.
4th. If the target is close enough to attack but can't see the target then the guard will try to strafe to see if they can get to a point to be able to see the target and shoot.
5th. Guard will only shoot at the target if they can see the target.
6th. If the guards bow breaks during battle, there was missing code to break of the battle and return to guard building to get a new bow. Before they would stand there and die being hit because they can't attack back.
7th. After a ranger kills a target there was possible code issue where the target variable was not cleared and they would get stuck for a bit until it was clear. Now it clears the target instantly.
8th. If the ranger gets stuck and they are not in range then ranger will try to strafe and get unstuck to be able to move.

Follow:
If you set the guard to "FOLLOW", this has changed to have a new options that appears as a button. You have two options "Tight Grouping" and "Lose Grouping". What this means is that if you do tight grouping then the player will try to stay with in 1 - 2 blocks of you when you stop. If you do "Lose" then the guard will stay within attack distance. So for rangers, based on their level they can have some distance from the player. This way everyone is not bunched up in 1 - 2 blocks and possible accidential hits.
Guard will still have the attack delay based on the old code between shoots.