Skip to content

Commit

Permalink
makes the pinguin a basic animal (tgstation#76790)
Browse files Browse the repository at this point in the history
## 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
Ben10Omintrix authored Jul 18, 2023
1 parent 12102ae commit b06e940
Show file tree
Hide file tree
Showing 20 changed files with 310 additions and 78 deletions.
4 changes: 2 additions & 2 deletions _maps/RandomZLevels/SnowCabin.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -2548,7 +2548,7 @@
/turf/open/misc/asteroid/snow/snow_cabin,
/area/awaymission/cabin/caves)
"jp" = (
/mob/living/simple_animal/pet/penguin/baby,
/mob/living/basic/pet/penguin/baby/permanent,
/turf/open/misc/ice/smooth,
/area/awaymission/cabin/snowforest)
"jq" = (
Expand Down Expand Up @@ -3561,7 +3561,7 @@
/turf/open/misc/asteroid/snow/snow_cabin,
/area/awaymission/cabin/caves)
"rH" = (
/mob/living/simple_animal/pet/penguin/emperor,
/mob/living/basic/pet/penguin/emperor,
/turf/open/misc/ice/smooth,
/area/awaymission/cabin/snowforest)
"so" = (
Expand Down
4 changes: 2 additions & 2 deletions _maps/map_files/IceBoxStation/IceBoxStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -23541,7 +23541,7 @@
pixel_x = -6;
pixel_y = -3
},
/mob/living/simple_animal/pet/penguin/baby,
/mob/living/basic/pet/penguin/baby/permanent,
/turf/open/misc/asteroid/snow/standard_air,
/area/station/science/research)
"hyY" = (
Expand Down Expand Up @@ -35315,7 +35315,7 @@
/area/station/command/bridge)
"lkP" = (
/obj/structure/flora/grass/green/style_random,
/mob/living/simple_animal/pet/penguin/emperor{
/mob/living/basic/pet/penguin/emperor{
name = "Club"
},
/turf/open/misc/asteroid/snow/standard_air,
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/MetaStation/MetaStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -60289,7 +60289,7 @@
/turf/open/floor/iron,
/area/station/hallway/secondary/exit/departure_lounge)
"vHl" = (
/mob/living/simple_animal/pet/penguin/baby{
/mob/living/basic/pet/penguin/baby/permanent{
dir = 8
},
/turf/open/floor/grass,
Expand Down
4 changes: 2 additions & 2 deletions _maps/map_files/NorthStar/north_star.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -23567,7 +23567,7 @@
/turf/open/floor/iron/white/herringbone,
/area/station/medical/patients_rooms)
"gdd" = (
/mob/living/simple_animal/pet/penguin/emperor{
/mob/living/basic/pet/penguin/emperor{
desc = "Spaghetti.";
name = "Spaghetti"
},
Expand Down Expand Up @@ -55498,7 +55498,7 @@
/turf/open/floor/iron/white,
/area/station/science/lobby)
"onY" = (
/mob/living/simple_animal/pet/penguin/baby{
/mob/living/basic/pet/penguin/baby/permanent{
dir = 8
},
/turf/open/floor/fake_snow{
Expand Down
2 changes: 1 addition & 1 deletion _maps/shuttles/emergency_hugcage.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
/turf/open/floor/mineral/titanium/blue,
/area/shuttle/escape)
"hH" = (
/mob/living/simple_animal/pet/penguin/baby,
/mob/living/basic/pet/penguin/baby/permanent,
/turf/open/floor/mineral/titanium/blue,
/area/shuttle/escape)
"iI" = (
Expand Down
8 changes: 8 additions & 0 deletions code/__DEFINES/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,14 @@
///Current partner target
#define BB_BABIES_TARGET "BB_babies_target"

///Finding adult mob
///key holds the adult we found
#define BB_FOUND_MOM "BB_found_mom"
///list of types of mobs we will look for
#define BB_FIND_MOM_TYPES "BB_find_mom_types"
///list of types of mobs we must ignore
#define BB_IGNORE_MOM_TYPES "BB_ignore_mom_types"

// Bileworm AI keys

#define BB_BILEWORM_SPEW_BILE "BB_bileworm_spew_bile"
Expand Down
4 changes: 2 additions & 2 deletions code/_globalvars/phobias.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ GLOBAL_LIST_INIT(phobia_mobs, list(
"birds" = typecacheof(list(
/mob/living/basic/chick,
/mob/living/basic/chicken,
/mob/living/basic/pet/penguin,
/mob/living/simple_animal/parrot,
/mob/living/simple_animal/pet/penguin,
)),
"conspiracies" = typecacheof(list(
/mob/living/simple_animal/bot/secbot,
/mob/living/simple_animal/drone,
/mob/living/simple_animal/pet/penguin,
/mob/living/basic/pet/penguin,
)),
"doctors" = typecacheof(list(/mob/living/simple_animal/bot/medbot)),
"insects" = typecacheof(list(
Expand Down
28 changes: 28 additions & 0 deletions code/datums/ai/basic_mobs/basic_ai_behaviors/find_parent.dm
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)
25 changes: 25 additions & 0 deletions code/datums/ai/basic_mobs/basic_subtrees/find_parent.dm
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
5 changes: 5 additions & 0 deletions code/datums/ai/basic_mobs/basic_subtrees/speech_subtree.dm
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,8 @@
emote_hear = list("howls.", "barks.", "screams.")
emote_see = list("shakes their head.", "shivers.")
speak = list("Ack-Ack", "Ack-Ack-Ack-Ackawoooo", "Geckers", "Awoo", "Tchoff")

/datum/ai_planning_subtree/random_speech/penguin
speech_chance = 5
speak = list("Gah Gah!", "NOOT NOOT!", "NOOT!", "Noot", "noot", "Prah!", "Grah!")
emote_hear = list("squawks", "gakkers")
4 changes: 4 additions & 0 deletions code/game/objects/items/food/egg.dm
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ GLOBAL_VAR_INIT(chicks_from_eggs, 0)
icon_state = "egg-yellow"
inhand_icon_state = "egg-yellow"

/obj/item/food/egg/penguin_egg
icon = 'icons/mob/simple/penguins.dmi'
icon_state = "penguin_egg"

/obj/item/food/egg/fertile
name = "fertile-looking egg"
desc = "An egg! It looks fertilized.\nQuite how you can tell this just by looking at it is a mystery."
Expand Down
7 changes: 6 additions & 1 deletion code/modules/explorer_drone/loot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ GLOBAL_LIST_INIT(adventure_loot_generator_index,generate_generator_index())
/datum/adventure_loot_generator/pet
id = "pets"
var/carrier_type = /obj/item/pet_carrier/biopod
var/list/possible_pets = list(/mob/living/simple_animal/pet/cat/space,/mob/living/basic/pet/dog/corgi,/mob/living/simple_animal/pet/penguin/baby,/mob/living/basic/pet/dog/pug)
var/list/possible_pets = list(
/mob/living/basic/pet/dog/corgi,
/mob/living/basic/pet/dog/pug,
/mob/living/basic/pet/penguin/baby,
/mob/living/simple_animal/pet/cat/space,
)

/datum/adventure_loot_generator/pet/generate()
var/obj/item/pet_carrier/carrier = new carrier_type()
Expand Down
6 changes: 3 additions & 3 deletions code/modules/holodeck/holo_effect.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@
mobtype = /mob/living/simple_animal/holodeck_monkey

/obj/effect/holodeck_effect/mobspawner/penguin
mobtype = /mob/living/simple_animal/pet/penguin/emperor
mobtype = /mob/living/basic/pet/penguin/emperor/neuter

/obj/effect/holodeck_effect/mobspawner/penguin/Initialize(mapload)
if(prob(1))
mobtype = /mob/living/simple_animal/pet/penguin/emperor/shamebrero
mobtype = /mob/living/basic/pet/penguin/emperor/shamebrero/neuter
return ..()

/obj/effect/holodeck_effect/mobspawner/penguin_baby
mobtype = /mob/living/simple_animal/pet/penguin/baby
mobtype = /mob/living/basic/pet/penguin/baby/permanent

/obj/effect/holodeck_effect/mobspawner/crab/jon
mobtype = /mob/living/simple_animal/crab/jon
15 changes: 15 additions & 0 deletions code/modules/mob/living/basic/farm_animals/chicken/chick.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
pass_flags = PASSTABLE | PASSGRILLE | PASSMOB
mob_size = MOB_SIZE_TINY
gold_core_spawnable = FRIENDLY_SPAWN
ai_controller = /datum/ai_controller/basic_controller/chick

/// What we grow into.
var/grow_as = /mob/living/basic/chicken
Expand Down Expand Up @@ -62,3 +63,17 @@
/// Variant of chick that just spawns in the holodeck so you can pet it. Doesn't grow up.
/mob/living/basic/chick/permanent
grow_as = null

/datum/ai_controller/basic_controller/chick
blackboard = list(
BB_TARGETTING_DATUM = new /datum/targetting_datum/basic,
BB_FIND_MOM_TYPES = list(/mob/living/basic/chicken),
)

ai_traits = STOP_MOVING_WHEN_PULLED
ai_movement = /datum/ai_movement/basic_avoidance
idle_behavior = /datum/idle_behavior/idle_random_walk

planning_subtrees = list(
/datum/ai_planning_subtree/look_for_adult,
)
Loading

0 comments on commit b06e940

Please sign in to comment.