Skip to content

Commit

Permalink
Acid Runner Respawn
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostsheet committed Jul 29, 2023
1 parent 4daeb3f commit eaef5f7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,12 @@
new /obj/effect/particle_effect/smoke/acid_runner_harmless(T)
playsound(bound_xeno, 'sound/effects/blobattack.ogg', 75)
if(bound_xeno.client && bound_xeno.hive)
addtimer(CALLBACK(bound_xeno.hive, TYPE_PROC_REF(/datum/hive_status, free_respawn), bound_xeno.client), 5 SECONDS)
var/datum/hive_status/hive_status = bound_xeno.hive
var/turf/spawning_turf = get_turf(bound_xeno)
if(!hive_status.hive_location)
addtimer(CALLBACK(bound_xeno.hive, TYPE_PROC_REF(/datum/hive_status, respawn_on_turf), bound_xeno.client, spawning_turf), 0.5 SECONDS)
else
addtimer(CALLBACK(bound_xeno.hive, TYPE_PROC_REF(/datum/hive_status, free_respawn), bound_xeno.client, spawning_turf), 5 SECONDS)
bound_xeno.gib()

/mob/living/carbon/xenomorph/runner/ventcrawl_carry()
Expand Down
23 changes: 22 additions & 1 deletion code/modules/mob/living/carbon/xenomorph/xeno_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -927,13 +927,34 @@
hivecore_cooldown = FALSE
xeno_message(SPAN_XENOBOLDNOTICE("The weeds have recovered! A new hive core can be built!"),3,hivenumber)

/datum/hive_status/proc/free_respawn(client/C)
/datum/hive_status/proc/free_respawn(client/C, turf/spawning_turf)
stored_larva++
if(!hive_location || !hive_location.spawn_burrowed_larva(C.mob))
stored_larva--
respawn_on_turf(C, spawning_turf)
else
hive_ui.update_burrowed_larva()

/datum/hive_status/proc/respawn_on_turf(client/C, turf/spawning_turf)
var/mob/living/carbon/xenomorph/larva/new_xeno = spawn_hivenumber_larva(spawning_turf, hivenumber)
if(isnull(new_xeno))
return FALSE

if(!SSticker.mode.transfer_xeno(C.mob, new_xeno))
qdel(new_xeno)
return FALSE

new_xeno.visible_message(SPAN_XENODANGER("A larva suddenly burrows out of \the [spawning_turf]!"),
SPAN_XENODANGER("You burrow out of \the [spawning_turf] and awaken from your slumber. For the Hive!"))
msg_admin_niche("[key_name(new_xeno)] burrowed out from \a [spawning_turf]. [ADMIN_JMP(spawning_turf)]")
playsound(new_xeno, 'sound/effects/xeno_newlarva.ogg', 50, 1)
to_chat(new_xeno, SPAN_XENOANNOUNCE("You are a xenomorph larva awakened from slumber!"))
if(new_xeno.client)
if(new_xeno.client?.prefs?.toggles_flashing & FLASH_POOLSPAWN)
window_flash(new_xeno.client)

hive_ui.update_burrowed_larva()

/datum/hive_status/proc/do_buried_larva_spawn(mob/xeno_candidate)
var/spawning_area
if(hive_location)
Expand Down

0 comments on commit eaef5f7

Please sign in to comment.