yogstation13 / yogstation-classic

Yogstation13's classic code source.
http://www.yogstation.net
GNU Affero General Public License v3.0
10 stars 37 forks source link

Hyperglycemic shock never ends #1273

Closed Yackitori closed 8 years ago

Yackitori commented 8 years ago

Expected Behaviour

Go into hyperglycemic shock, wake up after a bit.

Actual Behaviour

Never get out of it

Steps to reproduce the problem

  1. Go to chemistry
  2. Dispense tons of sugar
  3. Eat it and go into shock
  4. Never wake up

During my time in shock, I was talking to johncena about it, and he said that my shock timer was actually going up, not down. I will test this again next time I'm online if this needs reproducing.

MacHac commented 8 years ago

Hyperglycemic shock is quite powerful, and lasts a long time right now. Here's why:

So, say you reach 200u sugar. You immediately pass out. sleep = 30 Next tick, you have 199.2 sugar. Sleep goes up by 3, but down by 2 because ticks are 2 seconds long. sleep = 31 You will take 250 ticks, or 500 seconds, or 8 minutes 20 seconds to remove all sugar. sleep = 279 At this point, the sleep timer begins to tick down. This takes 4 minutes and 39 seconds. This means that the minimum amount of time that a hyperglycemic shock can last is 12 minutes 59 seconds, which is quite a bit.

However, not all sugar from a food is added immediately. If someone drinks sugar continuously until they metabolize 200u, that duration could look more like 20 minutes.

In the absolute worst case scenario, a traitor with 20 50u sugar patches could put 1000u of sugar into your bloodstream. This would leave you unconscious for over an hour.