wakeup_events.qsrc 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. # wakeup_events
  2. $sleep_loc = 'wakeup_events'
  3. menu_off = 1
  4. !! wakeup events trigger during when waking up
  5. !!
  6. !! Moved here from wakeup
  7. !! When done: Move to bed2
  8. !!=====================================!!
  9. !! !!
  10. !! Event handlers !!
  11. !! !!
  12. !!=====================================!!
  13. if $ARGS[0] = 'start' or $ARGS[0] = '':
  14. menu_off = 1
  15. killvar '$sleep_events'
  16. killvar '$sleep_events_priority'
  17. if sleepVars['events_active'] = 1:
  18. sleepVars['events_done'] = 0
  19. if mid($start_type, 1, 2) = 'sg' and locat['Fam_inGad'] = 0 and motherQW['bathroom_dildos'] > 0 and MarishaQW["marisha_sleepover"] = 0:
  20. $sleep_events[] = 'gs ''wakeup_events'', ''mother_sextalk'' '
  21. end
  22. if vomit['hangover'] = 1 or vomit['unlucky'] = 1 or vomit['morning_sick'] = 1:
  23. $sleep_events[] = 'gs ''wakeup_events'', ''vomiting_check'' '
  24. end
  25. if MarishaQW['marisha_sleepover'] = 1: $sleep_events[] = 'gs ''wakeup_events'', ''marisha_ev_morning'' '
  26. if $start_type[1] = 'tg' and daystart < 10:
  27. $sleep_events_priority[] = 'gs ''wakeup_events'', ''trans_early_shocked'' '
  28. elseif $start_type[1] = 'tg' and daystart < 30:
  29. $sleep_events_priority[] = 'gs ''wakeup_events'', ''trans_little_shocked'' '
  30. end
  31. if mid($start_type, 1, 2) = 'sg' and slept_in = 1 and kanikuli = 0 and SchoolAtestat = 0 and SchoolBlock = 0 and week < 6 and suspended['on'] ! 1:
  32. if (hour = 7 or hour = 8):
  33. $sleep_events_priority[] = 'gs ''wakeup_events'', ''sg_go_school'' '
  34. elseif hour >= 9 and hour < 14:
  35. $sleep_events_priority[] = 'gs ''wakeup_events'', ''sg_slept_in'' '
  36. end
  37. end
  38. xgt 'wakeup_events', 'mod_events'
  39. end
  40. xgt 'wakeup_events', 'continue'
  41. end
  42. if $ARGS[0] = 'mod_events':
  43. !! This location is here to allow mods to hook into the system.
  44. !! Either check for: if $sleep_loc = 'wakeup_events' and $ARGS[0] = 'mod_events'
  45. !!
  46. !! You can add events as: $sleep_events[] = 'gs ''mod_loc'' ''mod_args0'' '
  47. !! A random event will be chosen from amongst the added ones.
  48. !! If an event MUST trigger (due to quest timing), add it tp $sleep_events_priority[] = 'gs ''mod_loc'' ''mod_args0'' '
  49. !!
  50. !! If the event does not break the sleep cycle (merely interupts it) it needs to end with gs 'wakeup_events', 'event_end'
  51. !! If the event removed Sveta from her location (aka her sleep is cut short and/or she leaves her bed), you must call gs 'wakeup_events', 'exit'
  52. !!
  53. !! This is to cleanup all necessary variables.
  54. !!
  55. !! DO NOT DIRECTLY GOTO/GOSUB OUTOF THIS LOCATION. ALWAYS ADD IT TO THE QUEUEs!!!!
  56. !! IT WILL ALMOST CERTIANLY END BADLY WHEN MORE THAN 1 MOD IS INVOLVED.
  57. xgt 'wakeup_events', 'event_handler'
  58. end
  59. if $ARGS[0] = 'event_handler':
  60. if sleepVars['events_done'] < 10:
  61. if arrsize('$sleep_events_priority') > 0:
  62. xgt 'wakeup_events', 'event_handler2', 'priority'
  63. elseif arrsize('$sleep_events') > 0:
  64. xgt 'wakeup_events', 'event_handler2'
  65. end
  66. end
  67. gs 'wakeup_events', 'continue'
  68. end
  69. if $ARGS[0] = 'event_handler2':
  70. sleepVars['events_done'] += 1
  71. if $ARGS[1] = 'priority':
  72. temp_slev_id = rand(0, arrsize('$sleep_events_priority')-1)
  73. $temp_sleep_event_chosen = $sleep_events_priority[temp_slev_id]
  74. killvar '$sleep_events_priority', temp_slev_id
  75. else
  76. temp_slev_id = rand(0, arrsize('$sleep_events')-1)
  77. $temp_sleep_event_chosen = $sleep_events[temp_slev_id]
  78. killvar '$sleep_events', temp_slev_id
  79. end
  80. killvar 'temp_slev_id'
  81. dynamic $temp_sleep_event_chosen
  82. end
  83. if $ARGS[0] = 'event_end':
  84. killvar '$temp_sleep_event_chosen'
  85. if arrsize('$sleep_events_priority') > 0:
  86. gt 'wakeup_events', 'event_handler2', 'priority'
  87. end
  88. xgt 'wakeup_events', 'event_handler'
  89. end
  90. if $ARGS[0] = 'exit':
  91. sleepVars['events_done'] = 0
  92. killvar '$sleep_loc'
  93. killvar '$sleep_events'
  94. killvar '$sleep_events_priority'
  95. killvar 'temp_slev_id'
  96. killvar '$temp_sleep_event_chosen'
  97. end
  98. if $ARGS[0] = 'continue':
  99. sleepVars['events_done'] = 0
  100. killvar '$sleep_loc'
  101. killvar '$sleep_events'
  102. killvar '$sleep_events_priority'
  103. killvar 'temp_slev_id'
  104. killvar '$temp_sleep_event_chosen'
  105. xgt 'wakeup', 'get_out'
  106. end
  107. !!=====================================!!
  108. !! !!
  109. !! Events !!
  110. !! !!
  111. !!=====================================!!
  112. if $ARGS[0] = 'mother_sextalk':
  113. gt 'mother_sextalk', 'dildo_wakeup1'
  114. end
  115. if $ARGS[0] = 'vomiting_check':
  116. !! if not one of these locations, event will not fire
  117. if at_home = 1 or at_home = 2 or at_home = 3 or at_home = 4 or $loc = 'bedrPar' or at_home = 6 or at_home = 13 or at_home = 15 or $loc = 'mey_home':
  118. gs 'wakeup_event', 'exit'
  119. gs 'home_activity', 'vomiting_images'
  120. gt 'home_activity', 'morning_vomit'
  121. else
  122. vomit['morning_sick'] = 0
  123. vomit['hangover'] = 0
  124. vomit['unlucky'] = 0
  125. end
  126. end
  127. if $ARGS[0] = 'marisha_ev_morning':
  128. '<center><img src="images/characters/pavlovsk/resident/marisha/marisha.jpg"></center>'
  129. 'You wake up feeling relaxed then look over to see Marisha already up. She gives you a smile and says, "Thanks for everything <<$pcs_firstname>>. See you later." She then leaves as you continue getting up.'
  130. MarishaQW['marisha_sleepover'] = 0
  131. gs 'wakeup_events', 'event_end'
  132. end
  133. if $ARGS[0] = 'trans_early_shocked':
  134. 'The first thing you think as you wake up is, "Damn! It''s is not a dream, I really am a woman now."'
  135. gs 'wakeup_events', 'event_end'
  136. end
  137. if $ARGS[0] = 'trans_little_shocked':
  138. 'Looking at your female body, you are still a little surprised it''s actually you.'
  139. gs 'wakeup_events', 'event_end'
  140. end
  141. if $ARGS[0] = 'sg_slept_in':
  142. if schoolprogul > 2 and schoolPredupr = 2:
  143. pcs_mood -= 35
  144. gs 'stat'
  145. msg '<center>Damn it''s <<func(''alarmclock'', ''alarm_display'', hour, minut)>>. It''s too late to go to school now!<br><<$npc_nickname[''A29'']>> will be furious. I don''t know what she might do...</center>'
  146. elseif schoolprogul > 2 and schoolPredupr = 1:
  147. pcs_mood -= 30
  148. gs 'stat'
  149. msg '<center>Damn it''s <<func(''alarmclock'', ''alarm_display'', hour, minut)>>. It''s too late to go to school now!<br><<$npc_nickname[''A29'']>> will be very angry if I miss another day of school.</center>'
  150. elseif schoolprogul > 2 and schoolPredupr = 0:
  151. pcs_mood -= 25
  152. gs 'stat'
  153. msg '<center>Damn it''s <<func(''alarmclock'', ''alarm_display'', hour, minut)>>. It''s too late to go to school now!<br><<$npc_nickname[''A29'']>> will be angry to find out I missed a day of school.</center>'
  154. else
  155. pcs_mood -= 20
  156. gs 'stat'
  157. msg '<center>Damn it''s <<func(''alarmclock'', ''alarm_display'', hour, minut)>>. It''s too late to go to school now!<br><<$npc_nickname[''A29'']>> will be very upset if I''m not at school every day.</center>'
  158. end
  159. gs 'wakeup_events', 'event_end'
  160. end
  161. if $ARGS[0] = 'sg_go_school':
  162. pcs_mood -= 10
  163. gs 'stat'
  164. msg '<center>Damn it''s <<func(''alarmclock'', ''alarm_display'', hour, minut)>>, you''ve slept too long! You need to hurry or you''re going to be late for school!</center>'
  165. gs 'wakeup_events', 'event_end'
  166. end
  167. --- wakeup_events ---------------------------------