Files
Bubberstation/code/game/objects/items/body_egg.dm
XDTM 5a08a3aad0 Extends the disability refactor to include more traits, removing some snowflake code (#34664)
This way you can add/remove traits without fear of other sources overriding them. Now you can add TRAIT_STUNIMMUNE to somebody without what if hulk

Notable changes:

    Fakedeath now updates instantly, instead of waiting for the next life tick.
    Fakedeath now sets time of death when acquired.
    Removed extremely snowflake code in reagents that checked if you had morphine to remove slow immunity and so on.
    Hulk no longer overrides status_flag changes, in case there are any.
2018-01-25 09:12:44 +13:00

52 lines
1.3 KiB
Plaintext

/obj/item/organ/body_egg
name = "body egg"
desc = "All slimy and yuck."
icon_state = "innards"
zone = "chest"
slot = "parasite_egg"
/obj/item/organ/body_egg/on_find(mob/living/finder)
..()
to_chat(finder, "<span class='warning'>You found an unknown alien organism in [owner]'s [zone]!</span>")
/obj/item/organ/body_egg/New(loc)
if(iscarbon(loc))
src.Insert(loc)
return ..()
/obj/item/organ/body_egg/Insert(var/mob/living/carbon/M, special = 0)
..()
owner.add_trait(TRAIT_XENO_HOST, TRAIT_GENERIC)
START_PROCESSING(SSobj, src)
owner.med_hud_set_status()
INVOKE_ASYNC(src, .proc/AddInfectionImages, owner)
/obj/item/organ/body_egg/Remove(var/mob/living/carbon/M, special = 0)
STOP_PROCESSING(SSobj, src)
if(owner)
owner.remove_trait(TRAIT_XENO_HOST, TRAIT_GENERIC)
owner.med_hud_set_status()
INVOKE_ASYNC(src, .proc/RemoveInfectionImages, owner)
..()
/obj/item/organ/body_egg/process()
if(!owner)
return
if(!(src in owner.internal_organs))
Remove(owner)
return
egg_process()
/obj/item/organ/body_egg/proc/egg_process()
return
/obj/item/organ/body_egg/proc/RefreshInfectionImage()
RemoveInfectionImages()
AddInfectionImages()
/obj/item/organ/body_egg/proc/AddInfectionImages()
return
/obj/item/organ/body_egg/proc/RemoveInfectionImages()
return