Ranger and Knight Combat Preparedness
Electrocutor opened this issue ยท 1 comments
[Enhancement Request]
Minecolonies version
version 0.8.3210v2
Expected behavior
- Rangers and Knights will be prepared for combat before setting out and before initiating combat
Actual behaviour
- Rangers and Knights will initiate combat even if they are carrying only a single weapon and it only has 1 durability left on it
Steps to reproduce the problem
- Build Guardtower and assign worker
- Supply Guardtower with a stack of correct-level weapons
- Spawn monsters
Addendum
My observations have shown that 9/10 times a guard's death is caused by them fleeing in the middle of battle because their weapon broke shortly after starting a fight.
In my opinion, Rangers and Knights should choose to replace their weapon between fights. So immediately after a fight concludes, they asses if they have 0.5 of the currently equipped weapon durability available. If not, they return to attempt to get additional weapons until they have a total of 1.5 times the of max durability.
- Special logic may be needed for certain enchantments if a weapon in unbreakable; though I am not sure if the current code allows guards to make use of Tinker's unbreakable weapons (I think they just use the durability of it normally, even though its marked unbreakable)
- 0 durability or no weapon: return to tower immediately to re-equip
- < 0.5 total durability: if in combat, finish fight; if not, return to guard-tower to get more weapons; stay at guard tower hut-block even if set to custom guard spot, follow, or patrol until enough weapons are supplied to reach 1.5 * max durability.
- 0.5 - 1.5 total durability: if > 10 blocks from tower, on follow, or patrol remain doing so; if < 10 blocks, return for additional weapons to meet or exceed 1.5
- If tower hut contains less than 2.0 times current weapon in durability, request additional weapons
Code must count durability instead of weapon count due to the fact that 5 weapons with 1 durability is only equivalent to 1 weapon with 5 durability.
I also feel that the Rangers and Knights should request a set of armor once per night when they reach certain levels:
- level 5 Knight: Leather
- level 9 Ranger: Leather
- level 9 Knight: Iron
- level 17 Ranger: Iron
- level 17 Knight: Diamond