Merge pull request #11112 from MisterGrimm/XenomorphOverhaul

Xenomorph Overhaul and fixes from Gurgstation
This commit is contained in:
Aronai Sieyes
2021-07-19 21:06:21 -04:00
committed by GitHub
27 changed files with 217 additions and 631 deletions
+2 -127
View File
@@ -4,7 +4,6 @@
* Resin
* Weeds
* Acid
* Egg
*/
/*
@@ -204,6 +203,7 @@
layer = ABOVE_TURF_LAYER+0.01
light_range = NODERANGE
light_on = TRUE
light_color = "#673972"
var/node_range = NODERANGE
var/set_color = "#321D37"
@@ -422,129 +422,4 @@
visible_message("<span class='alium'>[src.target] begins to crumble under the acid!</span>")
spawn(rand(150, 200)) tick()
/*
* Egg
*/
/var/const //for the status var
BURST = 0
BURSTING = 1
GROWING = 2
GROWN = 3
MIN_GROWTH_TIME = 1800 //time it takes to grow a hugger
MAX_GROWTH_TIME = 3000
/obj/effect/alien/egg
desc = "It looks like a weird egg"
name = "egg"
// icon_state = "egg_growing" // So the egg looks 'grown', even though it's not.
icon_state = "egg"
density = FALSE
anchored = TRUE
var/health = 100
var/status = BURST //can be GROWING, GROWN or BURST; all mutually exclusive
/obj/effect/alien/egg/New()
/*
if(config.aliens_allowed)
..()
spawn(rand(MIN_GROWTH_TIME,MAX_GROWTH_TIME))
Grow()
else
qdel(src)
*/
/obj/effect/alien/egg/attack_hand(user as mob)
var/mob/living/carbon/M = user
if(!istype(M) || !(locate(/obj/item/organ/internal/xenos/hivenode) in M.internal_organs))
return attack_hand(user)
switch(status)
if(BURST)
to_chat(user, "<span class='warning'>You clear the hatched egg.</span>")
qdel(src)
return
/* if(GROWING)
to_chat(user, "<span class='warning'>The child is not developed yet.</span>")
return
if(GROWN)
to_chat(user, "<span class='warning'>You retrieve the child.</span>")
Burst(0)
return
/obj/effect/alien/egg/proc/GetFacehugger() // Commented out for future edit.
return locate(/obj/item/clothing/mask/facehugger) in contents
/obj/effect/alien/egg/proc/Grow()
icon_state = "egg"
// status = GROWN
status = BURST
// new /obj/item/clothing/mask/facehugger(src)
return
*/
/obj/effect/alien/egg/proc/Burst(var/kill = 1) //drops and kills the hugger if any is remaining
if(status == GROWN || status == GROWING)
// var/obj/item/clothing/mask/facehugger/child = GetFacehugger()
icon_state = "egg_hatched"
/* flick("egg_opening", src)
status = BURSTING
spawn(15)
status = BURST
child.loc = get_turf(src)
if(kill && istype(child))
child.Die()
else
for(var/mob/M in range(1,src))
if(CanHug(M))
child.Attach(M)
break
*/
/obj/effect/alien/egg/bullet_act(var/obj/item/projectile/Proj)
health -= Proj.damage
..()
healthcheck()
return
/obj/effect/alien/egg/attack_generic(var/mob/user, var/damage, var/attack_verb)
visible_message("<span class='danger'>[user] [attack_verb] the [src]!</span>")
user.do_attack_animation(src)
health -= damage
healthcheck()
return
/obj/effect/alien/egg/take_damage(var/damage)
health -= damage
healthcheck()
return
/obj/effect/alien/egg/attackby(var/obj/item/weapon/W, var/mob/user)
if(health <= 0)
return
if(LAZYLEN(W.attack_verb))
src.visible_message("<span class='danger'>\The [src] has been [pick(W.attack_verb)] with \the [W][(user ? " by [user]." : ".")]</span>")
else
src.visible_message("<span class='danger'>\The [src] has been attacked with \the [W][(user ? " by [user]." : ".")]</span>")
var/damage = W.force / 4.0
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(WT.remove_fuel(0, user))
damage = 15
playsound(src, 'sound/items/Welder.ogg', 100, 1)
src.health -= damage
src.healthcheck()
/obj/effect/alien/egg/proc/healthcheck()
if(health <= 0)
Burst()
/obj/effect/alien/egg/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > 500 + T0C)
health -= 5
healthcheck()
//Xenomorph Effect egg removed, replaced with Structure Egg.
@@ -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