Files
Yogstation/code/game/objects/items/body_egg.dm
Cyberboss f7c9749ca0 Fixes some bad addtimer calls. Adds INVOKE_ASYNC. Replaces addtimer(..., 0) (#23424)
* Fixes some bad addtimers

* Adds INVOKE

* Warning for addtimer

* Working syntax

* Another bad call

* Fixes the addtimer warning

* Add suppress_zero_warning to addtimer

Useful for addtimer that uses vars

* Add INVOKE_AGAIN for when the var is already defined

* Replace addtimer(...,0) with INVOKE((...))

* Much more sensible syntax

* Less overhead, less copypaste

* Rename INVOKE_ASYNC

* Use a macro

* Allman style

* Wait, why make it a datum in the first place?

* Revert the rename

* Rename again, keep line endings

* typo

* More typos

* Untouches Addtimer

* Update callbacks.dm

* Update timer.dm

* Revert allman style

* Revert "Revert allman style"

This reverts commit 47361da15bd04eca138be5f13acdc9dd5ba89331.

* Trying to match that whitespace diff

* Why is this missing?

* I'm not fucking dealing with this!
2017-01-31 09:20:54 +13:00

53 lines
1.2 KiB
Plaintext

/obj/item/organ/body_egg
name = "body egg"
desc = "All slimy and yuck."
icon_state = "innards"
origin_tech = "biotech=5"
zone = "chest"
slot = "parasite_egg"
/obj/item/organ/body_egg/on_find(mob/living/finder)
..()
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.status_flags |= XENO_HOST
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.status_flags &= ~(XENO_HOST)
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