PKP Mind Virus: Glorfing Cigs edition (#69904)

* PKP Mind Virus: Glorfing Cigs edition

If you glorf while smoking you'll get the cig stuck in your throat, leaving you unable to breath, speak, or eat. Based off the sort of cig you have a random delay before you vomit up the cig. (Pipes last forever don't philoso-larp kids). Other players can help you by using the help action on you while you're hurt, which leads to something imitating the himelich manuver, a broken chest, and a vomited up blockage. Other forms of vomiting will work too, if that's even applicable.

Oh I fixed a bug in vomit code. Because paralyzing you forces you to the ground, thus changing your dir, paralyzing vomits always went down. This is cringe, easy fix tho.

Ah and I added some extra functionality to sound loops too. You can set them to pick and take from the provided list, then refilling it once it's empty. This keeps some variety while preventing the risk of repeat sounds

Oh and I added some new signals. Some misc ones, for force say and a different kind of help then the existing one, which I renamed. One for breathing, which I used to clean up leroxin. I was planning to hook this but didn't need to in the end.

One for vomiting too. and eating. Also added a way to update looping timer delays. Forgot about that, I also added variable delay for sound loops, because I thought it sounded better here.

Features audio courtesy of our very own san7890, and the quake jump sound.
This commit is contained in:
LemonInTheDark
2022-10-19 03:34:45 -07:00
committed by GitHub
parent 56a8387b96
commit cd3a778915
27 changed files with 485 additions and 25 deletions

View File

@@ -662,6 +662,32 @@ SUBSYSTEM_DEF(timer)
return null
return timer.timeToRun - (timer.flags & TIMER_CLIENT_TIME ? REALTIMEOFDAY : world.time)
/**
* Update the delay on an existing LOOPING timer
* Will come into effect on the next process
*
* Arguments:
* * id a timerid or a /datum/timedevent
* * new_wait the new wait to give this looping timer
*/
/proc/updatetimedelay(id, new_wait, datum/controller/subsystem/timer/timer_subsystem)
if (!id)
return
if (id == TIMER_ID_NULL)
CRASH("Tried to update the wait of null timerid. Use TIMER_STOPPABLE flag")
if (istype(id, /datum/timedevent))
var/datum/timedevent/timer = id
timer.wait = new_wait
return
timer_subsystem = timer_subsystem || SStimer
//id is string
var/datum/timedevent/timer = timer_subsystem.timer_id_dict[id]
if(!timer || timer.spent)
return
if(!(timer.flags & TIMER_LOOP))
CRASH("Tried to update the wait of a non looping timer. This is not supported")
timer.wait = new_wait
#undef BUCKET_LEN
#undef BUCKET_POS
#undef TIMER_MAX