Xenomorph Port Gurglestation

Ports Gurglestation Xenomorphs to Virgo.
This commit is contained in:
Sym
2021-07-16 18:07:25 -04:00
parent 035a67b3d1
commit 13950cdd38
22 changed files with 212 additions and 624 deletions
@@ -0,0 +1,96 @@
#define MAX_PROGRESS 100
/obj/structure/alien/egg //Gurg Addition, working alien egg structure.
desc = "It looks like a weird egg."
name = "egg"
icon_state = "egg_growing"
density = 0
anchored = 1
var/progress = 0
/obj/structure/alien/egg/Initialize()
. = ..()
START_PROCESSING(SSobj, src)
/obj/structure/alien/egg/Destroy()
STOP_PROCESSING(SSobj, src)
. = ..()
/obj/structure/alien/egg/CanUseTopic(var/mob/user)
return isobserver(user) ? STATUS_INTERACTIVE : STATUS_CLOSE
/obj/structure/alien/egg/Topic(href, href_list)
if(..())
return 1
if(href_list["spawn"])
attack_ghost(usr)
/obj/structure/alien/egg/process()
progress++
if(progress >= MAX_PROGRESS)
for(var/mob/observer/dead/O in observer_mob_list)
if(O.client)
to_chat(O, "<span class='notice'>An alien is ready to hatch at [get_area(src.loc)]! (<a href='byond://?src=\ref[src];spawn=1'>spawn</a>)</span>")
STOP_PROCESSING(SSobj, src)
update_icon()
/obj/structure/alien/egg/update_icon()
if(progress == -1)
icon_state = "egg_hatched"
else if(progress < MAX_PROGRESS)
icon_state = "egg_growing"
else
icon_state = "egg"
/obj/structure/alien/egg/attack_ghost(var/mob/observer/ghost/user)
if(progress == -1) //Egg has been hatched.
return
if(progress < MAX_PROGRESS)
to_chat(user, "\The [src] has not yet matured.")
return
if(!user.MayRespawn(1))
return
// Check for bans properly.
if(jobban_isbanned(user, "Xenomorph"))
to_chat(user, "<span class='danger'>You are banned from playing a Xenomorph.</span>")
return
var/confirm = alert(user, "Are you sure you want to join as a Xenomorph larva?", "Become Larva", "No", "Yes")
if(!src || confirm != "Yes")
return
if(!user || !user.ckey)
return
if(progress == -1) //Egg has been hatched.
to_chat(user, "Too slow...")
return
flick("egg_opening",src)
progress = -1 // No harvesting pls.
sleep(5)
if(!src || !user)
visible_message("<span class='alium'>\The [src] writhes with internal motion, but nothing comes out.</span>")
progress = MAX_PROGRESS // Someone else can have a go.
return // What a pain.
// Create the mob, transfer over key.
var/mob/living/carbon/alien/larva/larva = new(get_turf(src))
larva.ckey = user.ckey
spawn(-1)
if(user) qdel(user) // Remove the keyless ghost if it exists.
visible_message("<span class='alium'>\The [src] splits open with a wet slithering noise, and \the [larva] writhes free!</span>")
// Turn us into a hatched egg.
name = "hatched alien egg"
desc += " This one has hatched."
update_icon()
#undef MAX_PROGRESS
@@ -0,0 +1,62 @@
/obj/structure/alien //Gurg Addition, framework for alien eggs.
name = "alien thing"
desc = "There's something alien about this."
icon = 'icons/mob/alien.dmi'
layer = ABOVE_JUNK_LAYER
var/health = 50
/obj/structure/alien/proc/healthcheck()
if(health <=0)
set_density(0)
qdel(src)
return
/obj/structure/alien/bullet_act(var/obj/item/projectile/Proj)
health -= Proj.damage
..()
healthcheck()
return
/obj/structure/alien/ex_act(severity)
switch(severity)
if(1.0)
health-=50
if(2.0)
health-=50
if(3.0)
if (prob(50))
health-=50
else
health-=25
healthcheck()
return
/obj/structure/alien/hitby(AM as mob|obj)
..()
visible_message("<span class='danger'>\The [src] was hit by \the [AM].</span>")
var/tforce = 0
if(ismob(AM))
tforce = 10
else
tforce = AM:throwforce
playsound(loc, 'sound/effects/attackblob.ogg', 100, 1)
health = max(0, health - tforce)
healthcheck()
..()
return
/obj/structure/alien/attack_generic()
attack_hand(usr)
/obj/structure/alien/attackby(var/obj/item/weapon/W, var/mob/user)
health = max(0, health - W.force)
playsound(loc, 'sound/effects/attackblob.ogg', 100, 1)
healthcheck()
..()
return
/obj/structure/alien/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group) return 0
if(istype(mover) && mover.checkpass(PASSGLASS))
return !opacity
return !density