Files
Bubberstation/code/datums/ai/basic_mobs/basic_subtrees/climb_tree.dm
SkyratBot f6577ec049 [MIRROR] Refactors Sloths into Basic Mobs [MDB IGNORE] (#24171)
* Refactors Sloths into Basic Mobs (#78752)

## About The Pull Request

Hey there,

This just refactors sloths to the basic mob framework. Nothing new
should be added beyond them seeming a bit more sluggish and being a bit
smarter about the fights they pick/running away.
## Why It's Good For The Game

Three more subtypes off the list, we are now sub-200 simple animals left
to refactor. If people want to play catch with their sloth it should be
much easier to fit that in now.
## Changelog
🆑
refactor: Sloths are now basic mobs, however their overall sluggish
behavior shouldn't have changed much- let us know if anything is broken.
/🆑

* Refactors Sloths into Basic Mobs

* Modular path

---------

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
2023-10-07 23:23:36 +00:00

16 lines
598 B
Plaintext

/datum/ai_planning_subtree/climb_trees
operational_datums = list(/datum/component/tree_climber)
///chance to climb a tree
var/climb_chance = 35
/datum/ai_planning_subtree/climb_trees/SelectBehaviors(datum/ai_controller/controller, seconds_per_tick)
if(!SPT_PROB(climb_chance, seconds_per_tick))
return
if(controller.blackboard_key_exists(BB_CLIMBED_TREE))
controller.queue_behavior(/datum/ai_behavior/climb_tree, BB_CLIMBED_TREE)
return SUBTREE_RETURN_FINISH_PLANNING
controller.queue_behavior(/datum/ai_behavior/find_and_set/valid_tree, BB_CLIMBED_TREE, /obj/structure/flora/tree)