sleep.qsrc 897 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # sleep
  2. if $ARGS[0] = 'simple':
  3. InSleep = 1
  4. :loopson
  5. minut += 1
  6. stime += 1
  7. if recuperation = 0:pcs_health += 5
  8. if stime >= 60:
  9. stime = 0
  10. pcs_sleep += 15
  11. gs 'stat'
  12. end
  13. alarm_now = hour * 60 + minut
  14. if alarm_holiday = 1 and (kanikuli > 0 or week > 5):
  15. alarm_time = timerEnd * 60 + timerEndM
  16. elseif week > 5:
  17. alarm_time = timerEnd * 60 + timerEndM
  18. else
  19. alarm_time = timer * 60 + timerM
  20. end
  21. alarm_set = alarm_time - rand(1,5)
  22. if alarm_set <0:
  23. alarm_set += 1440
  24. elseif alarm_set >= 1440:
  25. alarm_set -= 1440
  26. end
  27. if slept_in = 1:
  28. gs 'stat'
  29. elseif pcs_sleep >= 100 and budilnikOn = 0:
  30. gs 'stat'
  31. elseif pcs_sleep >= 100 and budilnikOn = 1 and alarm_now >= alarm_set:
  32. gs 'stat'
  33. elseif budilnikOn = 1 and alarm_now = alarm_time:
  34. pcs_mood -= 10
  35. gs 'stat'
  36. else
  37. jump 'loopson'
  38. end
  39. InSleep = 0
  40. gs'stat'
  41. end
  42. --- sleep ---------------------------------