Diona detaching limbs (#6496)

Adds ability for Gestalt to detach their limb nymphs and use them for scouting or whatever.

    Detached Nymph can switch back and forth between controlling Gestalt or nymph

    Detached nymph can merge back into Gestalt, restoring lost limb instantly.

    Makes initialization of Diona nymphs based on external organs it has, not a hardcoded number

    No longer Nymphs spawn on turf and move into Gestalt during initial setup.

    No longer removing internal limbs would cause spawn of nymph. Only external organs do that now.

Timers:

    Adds new proc in timers that calls the callback and deletes timer afterwards. Used when you need to make active timer execute now.
This commit is contained in:
Mykhailo Bykhovtsev
2019-07-13 11:18:26 +03:00
committed by Erki
parent 79ed6ea531
commit 3691d5ddda
6 changed files with 217 additions and 37 deletions
+27
View File
@@ -409,18 +409,45 @@ var/datum/controller/subsystem/timer/SStimer
/proc/deltimer(id)
if (!id)
return FALSE
if (id == TIMER_ID_NULL)
CRASH("Tried to delete a null timerid. Use the TIMER_STOPPABLE flag.")
if (!istext(id))
if (istype(id, /datum/timedevent))
qdel(id)
return TRUE
var/datum/timedevent/timer = SStimer.timer_id_dict["timerid[id]"]
if (timer && !timer.spent)
qdel(timer)
return TRUE
return FALSE
/proc/execute_and_deltimer(id)
if (!id)
return FALSE
if (id == TIMER_ID_NULL)
CRASH("Tried to delete a null timerid. Use the TIMER_STOPPABLE flag.")
var/datum/timedevent/timer = null
if (!istext(id) && istype(id, /datum/timedevent))
timer = id
else
timer = SStimer.timer_id_dict["timerid[id]"]
if(!timer)
return FALSE
var/datum/callback/callBack = timer.callBack
if (timer && !timer.spent)
callBack.Invoke()
timer.spent = TRUE
qdel(timer)
return TRUE
return FALSE
#undef BUCKET_LEN
#undef BUCKET_POS