Skip to content

Commit

Permalink
Improvement to monkey AI's weapon selection ability. Won't attack Wit…
Browse files Browse the repository at this point in the history
…h zero force items. (tgstation#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.
  • Loading branch information
itseasytosee authored Aug 29, 2022
1 parent 428fade commit 784ce3f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions code/datums/ai/monkey/monkey_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 784ce3f

Please sign in to comment.