Improvement to monkey AI's weapon selection ability. Won't attack With zero force items. (#69490)

Monkeys will now drop the item in their hand when selecting a weapon to attack with if it is worse than their basic bite attack, and will avoid picking up a weapon if they can't find one that's better than their basic bite attack.
Because of this, you can no longer completely disable monkeys by filling their hands with zero force items. This also means you can no longer trick monkeys into using sutures and other medical items on you.
This commit is contained in:
itseasytosee
2022-08-29 13:35:45 -05:00
committed by GitHub
parent 428fade61c
commit 784ce3f568
@@ -128,6 +128,10 @@ have ways of interacting with a specific mob and control it.
for(var/obj/item/item in oview(2, living_pawn))
nearby_items += item
for(var/obj/item/item in living_pawn.held_items) // If we've got some garbage in out hands thats going to stop us from effectivly attacking, we should get rid of it.
if(item.force < 2)
living_pawn.dropItemToGround(item)
weapon = GetBestWeapon(src, nearby_items, living_pawn.held_items)
var/pickpocket = FALSE
@@ -138,6 +142,9 @@ have ways of interacting with a specific mob and control it.
pickpocket = TRUE
weapon = held_weapon
if(weapon.force < 2) // our bite does 2 damage on avarage, no point in settling for anything less
return FALSE
if(!weapon || (weapon in living_pawn.held_items))
return FALSE