mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
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:
@@ -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)
|
||||
@@ -0,0 +1,17 @@
|
||||
/datum/ai_planning_subtree/climb_trees
|
||||
///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
|
||||
|
||||
var/obj/structure/flora/tree/target = controller.blackboard[BB_CLIMBED_TREE]
|
||||
|
||||
if(QDELETED(target))
|
||||
controller.queue_behavior(/datum/ai_behavior/find_and_set/valid_tree, BB_CLIMBED_TREE, /obj/structure/flora/tree)
|
||||
return
|
||||
|
||||
controller.queue_behavior(/datum/ai_behavior/climb_tree, BB_CLIMBED_TREE)
|
||||
return SUBTREE_RETURN_FINISH_PLANNING
|
||||
@@ -194,3 +194,8 @@
|
||||
speech_chance = 5
|
||||
speak = list("Gah Gah!", "NOOT NOOT!", "NOOT!", "Noot", "noot", "Prah!", "Grah!")
|
||||
emote_hear = list("squawks", "gakkers")
|
||||
|
||||
/datum/ai_planning_subtree/random_speech/bear
|
||||
speech_chance = 5
|
||||
emote_hear = list("rawrs.","grumbles.","grawls.", "stomps!")
|
||||
emote_see = list("stares ferociously.")
|
||||
|
||||
Reference in New Issue
Block a user