Skip to content

Commit

Permalink
Acid Runner Respawn (#4037)
Browse files Browse the repository at this point in the history
# About the pull request

Acid Runner will now respawn on its turf when there's no hivecore to
respawn at. instead of not spawning at all.

# Explain why it's good for the game

If acid runner exploded without a hivecore it wouldn't respawn at all.
Now if it would respawn as a larva where it blew up, cool niche feature.

# Testing Photographs and Procedure
<details>
<summary> Acid Runner Respawn</summary>


https://github.com/cmss13-devs/cmss13/assets/43085828/97e3720d-3f6e-49f1-8258-a7e7c9c17837

</details>


# Changelog

:cl: ghostsheet
add: Acid Runners will now respawn where it blew up, if there is no
hivecore to spawn at.
/:cl:

---------

Co-authored-by: Drathek <[email protected]>
  • Loading branch information
ghostsheet and Drulikar committed Aug 4, 2023
1 parent 4f9b17b commit aa1cf87
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
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), 5 SECONDS)
bound_xeno.gib()

/mob/living/carbon/xenomorph/runner/ventcrawl_carry()
Expand Down
18 changes: 18 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/xeno_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,24 @@
else
hive_ui.update_burrowed_larva()

/datum/hive_status/proc/respawn_on_turf(client/xeno_client, 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(xeno_client.mob, new_xeno))
qdel(new_xeno)
return FALSE

new_xeno.visible_message(SPAN_XENODANGER("A larva suddenly emerges from a dead husk!"),
SPAN_XENOANNOUNCE("The hive has no core! You manage to emerge from your old husk as a larva!"))
msg_admin_niche("[key_name(new_xeno)] respawned at \a [spawning_turf]. [ADMIN_JMP(spawning_turf)]")
playsound(new_xeno, 'sound/effects/xeno_newlarva.ogg', 50, 1)
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 aa1cf87

Please sign in to comment.