Skip to content

Commit

Permalink
capybaby
Browse files Browse the repository at this point in the history
  • Loading branch information
amylizzle committed Oct 18, 2023
1 parent 10230ee commit e831563
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
4 changes: 3 additions & 1 deletion code/area.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2570,7 +2570,9 @@ ABSTRACT_TYPE(/area/station/crew_quarters/radio)
if(!length(capyturfs))
capyturfs = get_area_turfs(/area/station/crew_quarters, floors_only=TRUE)
if(length(capyturfs))
new /mob/living/critter/small_animal/capybara(pick(capyturfs))
var/turf/spawnloc = pick(capyturfs)
new /mob/living/critter/small_animal/capybara(spawnloc)
new /mob/living/critter/small_animal/capybara/baby(spawnloc)

/area/station/crew_quarters/observatory
name = "Observatory"
Expand Down
31 changes: 29 additions & 2 deletions code/mob/living/critter/ai/capybara.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,23 @@
..()
default_task = get_instance(/datum/aiTask/prioritizer/critter/capybara, list(src))

/datum/aiHolder/capybaby
New()
..()
default_task = get_instance(/datum/aiTask/prioritizer/critter/capybara/baby, list(src))


/datum/aiTask/prioritizer/critter/capybara/New()
..()
transition_tasks += holder.get_instance(/datum/aiTask/timed/sitting, list(holder, src))
transition_tasks += holder.get_instance(/datum/aiTask/timed/wander, list(holder, src))


/datum/aiTask/prioritizer/critter/capybara/baby/New()
..()
transition_tasks += holder.get_instance(/datum/aiTask/sequence/goalbased/to_capy_adult, list(holder, src))
//--------------------------------------------------------------------------------------------------------------------------------------------------//
// have a little sit down


/datum/aiTask/timed/sitting
name = "sitting"
minimum_task_ticks = 5
Expand All @@ -31,3 +39,22 @@
. = ..()
if(.)
holder.owner.icon_state = "capybara"

//--------------------------------------------------------------------------------------------------------------------------------------------------//
// keep close to an adult capy
/datum/aiTask/sequence/goalbased/to_capy_adult
weight = -10 //high value so it always keeps close

/datum/aiTask/sequence/goalbased/to_capy_adult/precondition()
. = TRUE
for(var/mob/living/critter/small_animal/capybara/adult in range(src.holder.owner, 3))
if(!istype(adult, /mob/living/critter/small_animal/capybara/baby))
return FALSE

/datum/aiTask/sequence/goalbased/to_capy_adult/get_targets()
. = ..()
for(var/mob/living/critter/small_animal/capybara/adult in range(src.holder.owner, 8))
if(!istype(adult, /mob/living/critter/small_animal/capybara/baby))
. += adult


6 changes: 6 additions & 0 deletions code/mob/living/critter/capybara.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@
is_npc = TRUE
ai_type = /datum/aiHolder/capybara
butcherable = BUTCHER_YOU_MONSTER //2 makes butchering this creature an abominable act. Which it is. You monsters.

/mob/living/critter/small_animal/capybara/baby
name = "capybaby"
desc = "Baby coconut doggo!"
ai_type = /datum/aiHolder/capybaby
transform = matrix(0.5, 0, 0, 0, 0.5, 0)

0 comments on commit e831563

Please sign in to comment.