mirror of
https://github.com/goonstation/goonstation-2016.git
synced 2026-05-18 06:29:01 +01:00
38 lines
773 B
Plaintext
38 lines
773 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(900)
|
|
if(src.health > 0)
|
|
src.open()
|
|
|
|
proc/open()
|
|
spawn(10)
|
|
src.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.density = 0 |