[MIRROR] Improvement to monkey AI's weapon selection ability. Won't attack With zero force items. [MDB IGNORE] (#15914)

* 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.

* Improvement to monkey AI's weapon selection ability. Won't attack With zero force items.

Co-authored-by: itseasytosee <55666666+itseasytosee@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-09-04 13:44:22 +01:00
committed by GitHub
co-authored by itseasytosee
parent 98a27642f9
commit 9c2fa80c9f
@@ -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