mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-30 11:32:20 +00:00
Replaced the obj variable var/see_face. It was used to determine whether something (namely masks/hats) hid your identity. Replaced with the HIDEFACE bitflag for var/flags_inv variable. Moved the var/flags_inv variable from atom/ to obj/item/ as only /obj/item/ can be in your inventory in the first place. Fixed get_visible_name() so it takes into account any item on the var/head when deciding if your face is obscured. (While I'm at it, just dump a comment here if there's anything that should hide your face which doesn't and I'll add the flag.) Removed the var/alien_egg_flag variable from mob/living/carbon/ and replaced it with the XENO_HOST bitflag for var/status_flags variable. You can now suicide whilst impregnated with a xeno (since you will chestburst even after death, that restriction is no longer necessary). Any mob/living descendent can ghost even when not dead. However, ghosting whilst not dead results in the ghost eing unable to return to it's body for the remainder of the round. (It has a warning popup) The suicide verb can only be used by humans when they can move and are not cuffed. These verbs will be totally replaced very soon with the 'fun' IC suicides I'm working on. Suicide is largely redundant given that anybody can ghost now, just didn't want to jump the gun in removing it. Known Issues: We've got var/flags_inv, var/slot_flags which could possibly be merged as they both deal with obj/items, although I'm not sure if we can fit oth into the 16-bit limit. Just something to look into. There are bitflags GLASSESCOVERSEYES, MASKCOVERSEYES, HEADCOVERSEYES, MASKCOVERSMOUTH, HEADCOVERSMOUTH in the var/flags variable which should really be merged with or moved alongside the very similar flags in var/flags_inv. Comments next to the defines suggest as much. You can borg dead/clientless brains but can't remove the brain fromt he borg once you realise it's a dud. >.< git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4072 316c924e-a436-60f5-8080-3fe189b3f50e
257 lines
5.9 KiB
Plaintext
257 lines
5.9 KiB
Plaintext
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
|
|
|
|
var/const/MIN_IMPREGNATION_TIME = 100 //time it takes to impregnate someone
|
|
var/const/MAX_IMPREGNATION_TIME = 150
|
|
|
|
var/const/MIN_ACTIVE_TIME = 300 //time between being dropped and going idle
|
|
var/const/MAX_ACTIVE_TIME = 600
|
|
|
|
/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 = UNCONSCIOUS //UNCONSCIOUS is the idle state in this case
|
|
|
|
var/sterile = 0
|
|
|
|
var/strength = 5
|
|
|
|
var/attached = 0
|
|
|
|
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)
|
|
..()
|
|
user.drop_from_inventory(src)
|
|
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
|
|
|
|
temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
|
if(exposed_temperature > 300)
|
|
Die()
|
|
return
|
|
|
|
equipped(mob/M)
|
|
Attach(M)
|
|
|
|
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
|
|
if(attached)
|
|
return
|
|
else
|
|
attached++
|
|
spawn(MAX_IMPREGNATION_TIME)
|
|
attached = 0
|
|
|
|
var/mob/living/L = M //just so I don't need to use :
|
|
|
|
if(stat != CONSCIOUS) return
|
|
if(!sterile) L.take_organ_damage(strength,0) //done here so that even borgs and humans in helmets 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)
|
|
if(prob(20)) return
|
|
var/obj/item/clothing/W = target.wear_mask
|
|
if(!W.canremove) return
|
|
target.drop_from_inventory(W)
|
|
|
|
for(var/mob/O in viewers(target, null))
|
|
O.show_message("\red \b [src] tears [W] off of [target]'s face!", 1)
|
|
|
|
loc = target
|
|
layer = 20
|
|
target.wear_mask = src
|
|
target.update_inv_wear_mask()
|
|
|
|
GoIdle() //so it doesn't jump the people that tear it off
|
|
|
|
if(!sterile) target.Paralyse(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 || target.wear_mask != src || target.stat == DEAD) //was taken off or something
|
|
return
|
|
|
|
if(!sterile)
|
|
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.status_flags |= XENO_HOST
|
|
break
|
|
|
|
for(var/mob/O in viewers(target,null))
|
|
O.show_message("\red \b [src] falls limp after violating [target]'s face!", 1)
|
|
|
|
Die()
|
|
else
|
|
for(var/mob/O in viewers(target,null))
|
|
O.show_message("\red \b [src] violates [target]'s face!", 1)
|
|
target.update_inv_wear_mask()
|
|
return
|
|
|
|
proc/GoActive()
|
|
if(stat == DEAD || stat == CONSCIOUS)
|
|
return
|
|
|
|
stat = CONSCIOUS
|
|
|
|
/* for(var/mob/living/carbon/alien/alien in world)
|
|
var/image/activeIndicator = image('alien.dmi', loc = src, icon_state = "facehugger_active")
|
|
activeIndicator.override = 1
|
|
if(alien && alien.client)
|
|
alien.client.images += activeIndicator */
|
|
|
|
spawn(rand(MIN_ACTIVE_TIME,MAX_ACTIVE_TIME))
|
|
GoIdle()
|
|
|
|
return
|
|
|
|
proc/GoIdle()
|
|
if(stat == DEAD || stat == UNCONSCIOUS)
|
|
return
|
|
|
|
/* RemoveActiveIndicators() */
|
|
|
|
stat = UNCONSCIOUS
|
|
|
|
return
|
|
|
|
proc/Die()
|
|
if(stat == DEAD)
|
|
return
|
|
|
|
/* RemoveActiveIndicators() */
|
|
|
|
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
|
|
|
|
/* proc/RemoveActiveIndicators() //removes the "active" facehugger indicator from all aliens in the world for this hugger
|
|
for(var/mob/living/carbon/alien/alien in world)
|
|
if(alien.client)
|
|
for(var/image/image in alien.client.images)
|
|
if(image.icon_state == "facehugger_active" && image.loc == src)
|
|
del(image)
|
|
|
|
return */
|
|
|
|
/obj/item/clothing/mask/facehugger/angry
|
|
stat = CONSCIOUS
|
|
|
|
/obj/item/clothing/mask/facehugger/angry/HasProximity(atom/movable/AM as mob|obj)
|
|
if(istype(AM , /mob/living/))
|
|
Attach(AM)
|
|
|
|
|
|
/*
|
|
/obj/item/clothing/mask/facehugger/angry/New()
|
|
processing_objects.Add(src)
|
|
|
|
/obj/item/clothing/mask/facehugger/angry/process()
|
|
if(!src || src.stat == (DEAD))
|
|
return
|
|
|
|
for(var/mob/living/carbon/C in range(1,src))
|
|
Attach(C)
|
|
return
|
|
|
|
for(var/mob/living/carbon/C in range(5,src))
|
|
if(isInSight(C,src))
|
|
step_to(src,C,0)
|
|
spawn(5)
|
|
if(C in range(1,src))
|
|
Attach(C)
|
|
return
|
|
|
|
step_rand(src)
|
|
|
|
return
|
|
|
|
/obj/item/clothing/mask/facehugger/angry/Attach(var/mob/M as mob)
|
|
|
|
..(M)
|
|
processing_objects.Remove(src)
|
|
|
|
*/
|