mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 19:44:09 +01:00
Facehugger overhaul
They now function like landmines. They don't move, but you can pick them up and throw them at people. Eggs now grow gradually and you can harvest a hugger from a grown egg. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2438 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -2,17 +2,7 @@
|
||||
name = "alien thing"
|
||||
desc = "theres something alien about this"
|
||||
icon = 'alien.dmi'
|
||||
unacidable = 1 //Aliens won't ment their own.
|
||||
|
||||
/obj/effect/alien/egg
|
||||
desc = "It looks like a weird egg"
|
||||
name = "egg"
|
||||
icon_state = "egg"
|
||||
density = 0
|
||||
anchored = 0
|
||||
|
||||
var/health = 100
|
||||
|
||||
// unacidable = 1 //Aliens won't ment their own.
|
||||
|
||||
/obj/effect/alien/head
|
||||
name = "severed head"
|
||||
|
||||
@@ -1,16 +1,69 @@
|
||||
/obj/effect/alien/egg/New()
|
||||
if(aliens_allowed)
|
||||
src.density = 0 // Aliens use resin walls to block paths now. I am lazy and didn't feel like going to the define. -- TLE
|
||||
spawn(1800)
|
||||
src.open()
|
||||
else
|
||||
del(src)
|
||||
/var/const //for the status var
|
||||
BURST = 0
|
||||
GROWING = 1
|
||||
GROWN = 2
|
||||
|
||||
/obj/effect/alien/egg/proc/open()
|
||||
spawn(10)
|
||||
src.density = 0
|
||||
src.icon_state = "egg_hatched"
|
||||
new /obj/effect/alien/facehugger(src.loc)
|
||||
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"
|
||||
density = 0
|
||||
anchored = 1
|
||||
|
||||
var/health = 100
|
||||
var/status = GROWING //can be GROWING, GROWN or BURST; all mutually exclusive
|
||||
|
||||
New()
|
||||
if(aliens_allowed)
|
||||
..()
|
||||
spawn(rand(MIN_GROWTH_TIME,MAX_GROWTH_TIME))
|
||||
Grow()
|
||||
else
|
||||
del(src)
|
||||
|
||||
attack_paw(user as mob)
|
||||
if(isalien(user))
|
||||
switch(status)
|
||||
if(BURST)
|
||||
user << "\red The child is already gone."
|
||||
return
|
||||
if(GROWING)
|
||||
user << "\red The child is not developed yet."
|
||||
return
|
||||
if(GROWN)
|
||||
user << "\red You retrieve the child."
|
||||
loc.contents += GetFacehugger()//need to write the code for giving it to the alien later
|
||||
Burst()
|
||||
return
|
||||
else
|
||||
return attack_hand(user)
|
||||
|
||||
attack_hand(user as mob)
|
||||
user << "It feels slimy."
|
||||
return
|
||||
|
||||
proc/GetFacehugger()
|
||||
return locate(/obj/item/clothing/mask/facehugger) in contents
|
||||
|
||||
proc/Grow()
|
||||
icon_state = "egg"
|
||||
status = GROWN
|
||||
new /obj/item/clothing/mask/facehugger(src)
|
||||
return
|
||||
|
||||
proc/Burst() //drops and kills the hugger if any is remaining
|
||||
var/obj/item/clothing/mask/facehugger/child = GetFacehugger()
|
||||
|
||||
if(child)
|
||||
loc.contents += child
|
||||
child.Die()
|
||||
|
||||
icon_state = "egg_hatched"
|
||||
status = BURST
|
||||
return
|
||||
|
||||
/obj/effect/alien/egg/bullet_act(var/obj/item/projectile/Proj)
|
||||
health -= Proj.damage
|
||||
@@ -18,6 +71,8 @@
|
||||
healthcheck()
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/effect/alien/egg/attackby(var/obj/item/weapon/W, var/mob/user)
|
||||
if(health <= 0)
|
||||
return
|
||||
@@ -37,11 +92,7 @@
|
||||
|
||||
/obj/effect/alien/egg/proc/healthcheck()
|
||||
if(health <= 0)
|
||||
if(prob(15))
|
||||
open()
|
||||
else
|
||||
src.icon_state = "egg_hatched"
|
||||
|
||||
Burst()
|
||||
|
||||
/obj/effect/alien/egg/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(exposed_temperature > 500)
|
||||
|
||||
@@ -1,8 +1,196 @@
|
||||
#define cycle_pause 5 //min 1
|
||||
#define viewrange 7 //min 2
|
||||
var/const
|
||||
MIN_IMPREGNATION_TIME = 100 //time it takes to impregnate someone
|
||||
MAX_IMPREGNATION_TIME = 150
|
||||
|
||||
MIN_ACTIVE_TIME = 30 //time between being dropped and going idle
|
||||
MAX_ACTIVE_TIME = 50
|
||||
|
||||
/obj/item/clothing/mask/facehugger
|
||||
name = "alien"
|
||||
desc = "It has some sort of a tube at the end of its tail."
|
||||
icon_state = "facehugger"
|
||||
item_state = "facehugger"
|
||||
w_class = 1 //note: can be picked up by aliens unlike most other items of w_class below 4
|
||||
flags = FPRINT|TABLEPASS|MASKCOVERSMOUTH|MASKCOVERSEYES
|
||||
|
||||
var/stat = CONSCIOUS //UNCONSCIOUS is the idle state in this case
|
||||
|
||||
var/sterile = 0
|
||||
|
||||
var/strength = 5
|
||||
|
||||
attack_paw(user as mob) //can be picked up by aliens
|
||||
if(isalien(user))
|
||||
attack_hand(user)
|
||||
return
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
attack_hand(user as mob)
|
||||
if(stat == CONSCIOUS && !isalien(user))
|
||||
Attach(user)
|
||||
return
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
attack(mob/living/M as mob, mob/user as mob)
|
||||
..()
|
||||
Attach(M)
|
||||
|
||||
New()
|
||||
if(aliens_allowed)
|
||||
..()
|
||||
else
|
||||
del(src)
|
||||
|
||||
examine()
|
||||
..()
|
||||
switch(stat)
|
||||
if(DEAD,UNCONSCIOUS)
|
||||
usr << "\red \b [src] is not moving."
|
||||
if(CONSCIOUS)
|
||||
usr << "\red \b [src] seems to be active."
|
||||
if (sterile)
|
||||
usr << "\red \b It looks like the proboscis has been removed."
|
||||
return
|
||||
|
||||
attackby()
|
||||
Die()
|
||||
return
|
||||
|
||||
bullet_act()
|
||||
Die()
|
||||
return
|
||||
|
||||
HasEntered(atom/target)
|
||||
Attach(target)
|
||||
return
|
||||
|
||||
dropped()
|
||||
..()
|
||||
GoActive()
|
||||
return
|
||||
|
||||
throw_impact(atom/hit_atom)
|
||||
Attach(hit_atom)
|
||||
return
|
||||
|
||||
proc/Attach(M as mob)
|
||||
if(!isliving(M) || isalien(M))
|
||||
return
|
||||
|
||||
var/mob/living/L = M //just so I don't need to use :
|
||||
|
||||
if(stat != CONSCIOUS)
|
||||
return
|
||||
|
||||
L.take_organ_damage(strength,0) //done here so that even borgs and humans take damage
|
||||
|
||||
if(issilicon(L))
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("\red \b [src] smashes against [L]'s frame!", 1)
|
||||
Die()
|
||||
return
|
||||
|
||||
var/mob/living/carbon/target = L
|
||||
|
||||
for(var/mob/O in viewers(target, null))
|
||||
O.show_message("\red \b [src] leaps at [target]'s face!", 1)
|
||||
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
if(H.head && H.head.flags & HEADCOVERSMOUTH)
|
||||
for(var/mob/O in viewers(H, null))
|
||||
O.show_message("\red \b [src] smashes against [H]'s [H.head]!", 1)
|
||||
Die()
|
||||
return
|
||||
|
||||
if(target.wear_mask)
|
||||
var/obj/item/clothing/W = target.wear_mask
|
||||
|
||||
if(W.canremove)
|
||||
target.u_equip(W)
|
||||
if (target.client)
|
||||
target.client.screen -= W
|
||||
W.loc = target.loc
|
||||
W.dropped(target)
|
||||
W.layer = initial(W.layer)
|
||||
for(var/mob/O in viewers(target, null))
|
||||
O.show_message("\red \b [src] tears [W] off of [target]'s face!", 1)
|
||||
|
||||
if(istype(loc,/mob/living/carbon/alien)) //just taking it off from the alien's UI
|
||||
var/mob/living/carbon/alien/host = loc
|
||||
host.u_equip(src)
|
||||
if (host.client)
|
||||
host.client.screen -= src
|
||||
add_fingerprint(host)
|
||||
|
||||
loc = target
|
||||
layer = 20
|
||||
target.wear_mask = src
|
||||
|
||||
target.update_clothing()
|
||||
|
||||
GoIdle() //so it doesn't jump the people that tear it off
|
||||
|
||||
target.paralysis = max(target.paralysis,MAX_IMPREGNATION_TIME/6) //something like 25 ticks = 20 seconds with the default settings
|
||||
|
||||
spawn(rand(MIN_IMPREGNATION_TIME,MAX_IMPREGNATION_TIME))
|
||||
Impregnate(target)
|
||||
|
||||
return
|
||||
|
||||
proc/Impregnate(mob/living/carbon/target as mob)
|
||||
if(target.wear_mask != src) //was taken off or something
|
||||
return
|
||||
|
||||
target.contract_disease(new /datum/disease/alien_embryo(0)) //so infection chance is same as virus infection chance
|
||||
for(var/datum/disease/alien_embryo/A in target.viruses)
|
||||
target.alien_egg_flag = max(1,target.alien_egg_flag)
|
||||
|
||||
for(var/mob/O in viewers(target,null))
|
||||
O.show_message("\red \b [src] falls limp after violating [target]'s face!", 1)
|
||||
|
||||
Die()
|
||||
|
||||
return
|
||||
|
||||
proc/GoActive()
|
||||
if(stat == DEAD || stat == CONSCIOUS)
|
||||
return
|
||||
|
||||
stat = CONSCIOUS
|
||||
|
||||
spawn(rand(MIN_ACTIVE_TIME,MAX_ACTIVE_TIME))
|
||||
GoIdle()
|
||||
|
||||
return
|
||||
|
||||
proc/GoIdle()
|
||||
if(stat == DEAD || stat == UNCONSCIOUS)
|
||||
return
|
||||
|
||||
stat = UNCONSCIOUS
|
||||
|
||||
return
|
||||
|
||||
proc/Die()
|
||||
if(stat == DEAD)
|
||||
return
|
||||
|
||||
icon_state = "facehugger_dead"
|
||||
stat = DEAD
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("\red \b[src] curls up into a ball!", 1)
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
||||
/* NOPE.png -- Urist
|
||||
|
||||
// Returns the surrounding cardinal turfs with open links
|
||||
// Including through doors openable with the ID
|
||||
@@ -400,3 +588,4 @@
|
||||
if (health <= 0)
|
||||
death()
|
||||
|
||||
*/
|
||||
@@ -140,7 +140,9 @@
|
||||
/obj/item/attack_paw(mob/user as mob)
|
||||
|
||||
if(isalien(user)) // -- TLE
|
||||
if(!user:has_fine_manipulation) // -- defaults to 0, only changes due to badminnery -- Urist
|
||||
var/mob/living/carbon/alien/A = user
|
||||
|
||||
if(!A.has_fine_manipulation || w_class >= 4)
|
||||
user << "Your claws aren't capable of such fine manipulation."
|
||||
return
|
||||
|
||||
|
||||
+14
-19
@@ -14,11 +14,7 @@
|
||||
switch(severity)
|
||||
if (1)
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
if (occupied)
|
||||
var/obj/effect/alien/facehugger/A = new /obj/effect/alien/facehugger( src.loc )
|
||||
A.lamarr = 1
|
||||
A.name = "Lamarr"
|
||||
occupied = 0
|
||||
Break()
|
||||
del(src)
|
||||
if (2)
|
||||
if (prob(50))
|
||||
@@ -40,19 +36,13 @@
|
||||
/obj/structure/lamarr/blob_act()
|
||||
if (prob(75))
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
if (occupied)
|
||||
var/obj/effect/alien/facehugger/A = new /obj/effect/alien/facehugger( src.loc )
|
||||
A.lamarr = 1
|
||||
A.name = "Lamarr"
|
||||
occupied = 0
|
||||
Break()
|
||||
del(src)
|
||||
|
||||
|
||||
/obj/structure/lamarr/meteorhit(obj/O as obj)
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
var/obj/effect/alien/facehugger/A = new /obj/effect/alien/facehugger( src.loc )
|
||||
A.lamarr = 1
|
||||
A.name = "Lamarr"
|
||||
Break()
|
||||
del(src)
|
||||
|
||||
|
||||
@@ -63,11 +53,7 @@
|
||||
src.destroyed = 1
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
playsound(src, "shatter", 70, 1)
|
||||
var/obj/effect/alien/facehugger/A = new /obj/effect/alien/facehugger( src.loc )
|
||||
A.lamarr = 1
|
||||
A.name = "Lamarr"
|
||||
occupied = 0
|
||||
update_icon()
|
||||
Break()
|
||||
else
|
||||
playsound(src.loc, 'Glasshit.ogg', 75, 1)
|
||||
return
|
||||
@@ -99,4 +85,13 @@
|
||||
O << text("\red [] kicks the lab cage.", usr)
|
||||
src.health -= 2
|
||||
healthcheck()
|
||||
return
|
||||
return
|
||||
|
||||
/obj/structure/lamarr/proc/Break()
|
||||
if(occupied)
|
||||
var/obj/item/clothing/mask/facehugger/A = new /obj/item/clothing/mask/facehugger( src.loc )
|
||||
A.sterile = 1
|
||||
A.name = "Lamarr"
|
||||
occupied = 0
|
||||
update_icon()
|
||||
return
|
||||
Reference in New Issue
Block a user