convert the bear to a basic mobster (#77143)

## About The Pull Request
the bear now a basic and he have a new behaviers. the bear now can go to
climbed the trees! he will looked for a tree to climbing and if he
founded a tree he will go climb him. also the bear now love honey he
will look for a bee hives to stole the honey from it so botanists must
be care. the bear will drag the honey behind him so u must chased him to
get the honey back again

## Why It's Good For The Game
the bear is a basic now so he and have more behavier for more depth
mechanis

## Changelog
🆑
refactor: the bear is a basic now. please report any bugs
add: the bear will climb trees and search honey
/🆑
This commit is contained in:
Ben10Omintrix
2023-07-28 19:34:39 -06:00
committed by GitHub
parent fc6dfb21d1
commit cc64ed0ca4
27 changed files with 339 additions and 111 deletions
@@ -0,0 +1,34 @@
/datum/ai_behavior/find_and_set/valid_tree
/datum/ai_behavior/find_and_set/valid_tree/search_tactic(datum/ai_controller/controller, locate_path, search_range)
var/list/valid_trees = list()
for (var/obj/structure/flora/tree/tree_target in oview(search_range, controller.pawn))
if(istype(tree_target, /obj/structure/flora/tree/dead)) //no died trees
continue
valid_trees += tree_target
if(valid_trees.len)
return pick(valid_trees)
/datum/ai_behavior/climb_tree
behavior_flags = AI_BEHAVIOR_REQUIRE_MOVEMENT | AI_BEHAVIOR_REQUIRE_REACH
/datum/ai_behavior/climb_tree/setup(datum/ai_controller/controller, target_key)
. = ..()
var/atom/target = controller.blackboard[target_key]
if(QDELETED(target))
return FALSE
set_movement_target(controller, target)
/datum/ai_behavior/climb_tree/perform(seconds_per_tick, datum/ai_controller/controller, target_key)
. = ..()
var/obj/structure/flora/target_tree = controller.blackboard[target_key]
var/mob/living/basic/living_pawn = controller.pawn
SEND_SIGNAL(living_pawn, COMSIG_LIVING_CLIMB_TREE, target_tree)
finish_action(controller, TRUE, target_key)
/datum/ai_behavior/climb_tree/finish_action(datum/ai_controller/controller, succeeded, target_key)
. = ..()
if(succeeded)
controller.clear_blackboard_key(target_key)