Files
Paradise/code/__HELPERS/basic_ai.dm
PollardTheDragon a590870d00 Monke Business - Ports monkey AI from TG (#31067)
* Monke Mode

* Punch

* Some comment stuff

* Linters, excess

* Linters

* Emote stuff

* Pause monkey AI during do afters

* Small improvements

* Oops

* Fixes monkeys trying to drink forever from a glass

* Knockdowns and stamcrit fixes

* Removes eating/drinking from Pun Pun

* Monkey controller improvement, bug fix

* Fixes monkey item giving

* Fixes brain swaps

* Fixes

* Update code/datums/ai/monkey/monkey_controller.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>

* Addresses code review

* Oops

* Oops round 2

* Fixes monkeys staying in trip mode when evolved

---------

Signed-off-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
2025-12-26 22:44:52 +00:00

41 lines
1.4 KiB
Plaintext

/// returns if something can be consumed, drink or food
/proc/IsEdible(obj/item/thing)
if(!istype(thing))
return FALSE
if(istype(thing, /obj/item/food))
return TRUE
if(istype(thing, /obj/item/reagent_containers/drinks/drinkingglass))
var/obj/item/reagent_containers/drinks/drinkingglass/glass = thing
if(glass.reagents.total_volume) // The glass has something in it, time to drink the mystery liquid!
return TRUE
return FALSE
/// Returns either the best weapon from the given choices or null if held weapons are better
/proc/GetBestWeapon(datum/ai_controller/controller, list/choices, list/held_weapons)
var/gun_neurons_activated = controller.blackboard[BB_MONKEY_GUN_NEURONS_ACTIVATED]
var/top_force = 0
var/obj/item/top_force_item
for(var/obj/item/item in held_weapons)
if(controller.blackboard[BB_MONKEY_BLACKLISTITEMS][item])
continue
if(gun_neurons_activated && isgun(item))
// We have a gun, why bother looking for something inferior
// Also yes it is intentional that pawns dont know how to pick the best gun
return item
if(item.force > top_force)
top_force = item.force
top_force_item = item
for(var/obj/item/item in choices)
if(controller.blackboard[BB_MONKEY_BLACKLISTITEMS][item])
continue
if(gun_neurons_activated && isgun(item))
return item
if(item.force <= top_force)
continue
top_force_item = item
top_force = item.force
return top_force_item