mirror of
https://github.com/goonstation/goonstation-2020.git
synced 2026-07-11 15:12:22 +01:00
38 lines
763 B
Plaintext
38 lines
763 B
Plaintext
/obj/alien/egg
|
|
desc = "It looks like a weird egg"
|
|
name = "egg"
|
|
icon_state = "egg"
|
|
layer = MOB_LAYER
|
|
density = 1
|
|
anchored = 1
|
|
|
|
var/health = 25
|
|
|
|
New()
|
|
SPAWN_DBG(90 SECONDS)
|
|
if(src.health > 0)
|
|
src.open()
|
|
|
|
proc/open()
|
|
SPAWN_DBG(1 SECOND)
|
|
src.set_density(0)
|
|
src.icon_state = "egg_hatched"
|
|
new /obj/alien/facehugger(src.loc)
|
|
|
|
attackby(obj/item/W as obj, mob/user as mob)
|
|
if (src.health <= 0)
|
|
src.visible_message("<span style=\"color:red\"><B>[user] has destroyed the egg!</B></span>")
|
|
src.death()
|
|
return
|
|
|
|
switch(W.damtype)
|
|
if("fire")
|
|
src.health -= W.force * 0.75
|
|
if("brute")
|
|
src.health -= W.force * 0.1
|
|
else
|
|
..()
|
|
|
|
proc/death()
|
|
src.icon_state = "egg_destroyed" //need an icon for this
|
|
src.set_density(0) |