forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
makes the pinguin a basic animal (tgstation#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 :cl: 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 /:cl:
- Loading branch information
1 parent
12102ae
commit b06e940
Showing
20 changed files
with
310 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
code/datums/ai/basic_mobs/basic_ai_behaviors/find_parent.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/datum/ai_behavior/find_mom | ||
///range to look for the mom | ||
var/look_range = 7 | ||
|
||
/datum/ai_behavior/find_mom/perform(seconds_per_tick, datum/ai_controller/controller, mom_key, ignore_mom_key, found_mom) | ||
. = ..() | ||
|
||
var/mob/living_pawn = controller.pawn | ||
var/list/mom_types = controller.blackboard[mom_key] | ||
var/list/all_moms = list() | ||
var/list/ignore_types = controller.blackboard[ignore_mom_key] | ||
|
||
if(!length(mom_types)) | ||
finish_action(controller, FALSE) | ||
return | ||
|
||
for(var/mob/mother in oview(look_range, living_pawn)) | ||
if(!is_type_in_list(mother, mom_types)) | ||
continue | ||
if(is_type_in_list(mother, ignore_types)) //so the not permanent baby and the permanent baby subtype dont followed each other | ||
continue | ||
all_moms += mother | ||
|
||
if(length(all_moms)) | ||
controller.set_blackboard_key(found_mom, pick(all_moms)) | ||
finish_action(controller, TRUE) | ||
return | ||
finish_action(controller, FALSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.