Files
Bubberstation/code/datums/ai/basic_mobs/basic_subtrees/find_parent.dm
SkyratBot 49f61b14a9 [MIRROR] make the pinguen a basic animal [MDB IGNORE] (#22568)
* makes the pinguin a basic animal (#76790)

## About The Pull Request
the penguin now is a basic animal and also now he can go and layed
penguin eggs to make penguin babys also the baby have a new behavier he
will now go and looked for his mom and when he found his mom he will
went to her and be happy when he close to his mom or if he mom is died
he will went to her body and he will be sad and also i putted this
behavier in the baby chicken. also now the pinguen mom will go and
looked for her eggs and when she find a egg she will putted it in the
middile of her legs and walked with it
![penguin with a
eggs](https://github.com/tgstation/tgstation/assets/138636438/e5f3d741-edc0-438f-b1b3-9e4ed2280532)

## Why It's Good For The Game
the pinguen now is a advance ai
## Changelog
the pinguen now have a more advance

🆑
refactor: the penguin is a basic animal
add: the penguin now layed eggs
add: the penguin and the chicken babys will go look for adult penguin or
chicken and be happy when he is near the adult
/🆑

* make the pinguen a basic animal

---------

Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
2023-07-18 17:00:04 -04:00

26 lines
908 B
Plaintext

/datum/ai_planning_subtree/look_for_adult
///how far we must be from the mom
var/minimum_distance = 1
/datum/ai_planning_subtree/look_for_adult/SelectBehaviors(datum/ai_controller/controller, seconds_per_tick)
var/mob/target = controller.blackboard[BB_FOUND_MOM]
var/mob/baby = controller.pawn
if(QDELETED(target))
controller.queue_behavior(/datum/ai_behavior/find_mom, BB_FIND_MOM_TYPES, BB_IGNORE_MOM_TYPES, BB_FOUND_MOM)
return
if(get_dist(target, baby) > minimum_distance)
controller.queue_behavior(/datum/ai_behavior/travel_towards, BB_FOUND_MOM)
return SUBTREE_RETURN_FINISH_PLANNING
if(!SPT_PROB(15, seconds_per_tick))
return
if(target.stat == DEAD)
controller.queue_behavior(/datum/ai_behavior/perform_emote, "cries for their parent!")
else
controller.queue_behavior(/datum/ai_behavior/perform_emote, "dances around their parent!")
return SUBTREE_RETURN_FINISH_PLANNING