Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Jul 28, 2024
1 parent 723b042 commit 64cda24
Showing 1 changed file with 29 additions and 6 deletions.
35 changes: 29 additions & 6 deletions code/modules/borer/borer_egg.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,38 @@
layer = MOB_LAYER
black_market_value = 35

var/birth_generation = 1
var/can_reproduce = 1
var/target_flags = BORER_TARGET_HUMANS
var/list/ancestors = list()

/obj/item/borer_egg/attack_ghost(mob/dead/observer/user)
. = ..() //Do a view printout as needed just in case the observer doesn't want to join as a Borer but wants info
attempt_join_as_borer(user)


/obj/item/borer_egg/proc/attempt_join_as_borer(mob/dead/observer/user)
if(!istype(user))
return FALSE
if(jobban_isbanned(user, "Syndicate") || jobban_isbanned(user, "Emergency Response Team"))
to_chat(user, SPAN_DANGER("You are jobbanned from ERTs!"))
return FALSE

var/try_join = tgui_alert(user, "Do you want to hatch as a Cortical Borer?", "Join as Borer?", list("Yes", "No"))
if(try_join != "Yes")
return FALSE
if(hatched)
to_chat(user, SPAN_DANGER("This egg has already hatched!"))
return FALSE
join_as_borer(user)


/obj/item/borer_egg/proc/join_as_borer(mob/dead/observer/user)
var/mob/living/carbon/xenomorph/facehugger/hugger = new /mob/living/carbon/xenomorph/facehugger(loc, null, hivenumber)
user.mind.transfer_to(hugger, TRUE)
hugger.visible_message(SPAN_XENODANGER("A facehugger suddenly emerges out of \the [A]!"), SPAN_XENODANGER("You emerge out of \the [A] and awaken from your slumber. For the Hive!"))
playsound(hugger, 'sound/effects/xeno_newlarva.ogg', 25, TRUE)
hugger.generate_name()
hugger.timeofdeath = user.timeofdeath // Keep old death time
if(hatched)
return FALSE
hatched = TRUE
var/mob/living/carbon/cortical_borer/birthed = new /mob/living/carbon/cortical_borer(loc, birth_generation, TRUE, can_reproduce, target_flags, ancestors)

user.mind.transfer_to(birthed, TRUE)
birthed.visible_message(SPAN_XENODANGER("A facehugger suddenly emerges out of \the [A]!"), SPAN_XENODANGER("You emerge out of \the [A] and awaken from your slumber. For the Hive!"))
playsound(birthed, 'sound/effects/xeno_newlarva.ogg', 25, TRUE)

0 comments on commit 64cda24

Please sign in to comment.