1
0

wakeup_events.qsrc 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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 $experimentQW['trial_active'] ! '' and experimentQW['trial_duration'] > 0 and daystart > experimentQW['event_day']:
  23. $sleep_events_priority[] = 'gs ''wakeup_events'', ''experimental_trials'' '
  24. end
  25. if vomit['hangover'] = 1 or vomit['unlucky'] = 1 or vomit['morning_sick'] = 1:
  26. $sleep_events[] = 'gs ''wakeup_events'', ''vomiting_check'' '
  27. end
  28. if MarishaQW['marisha_sleepover'] = 1: $sleep_events_priority[] = 'gs ''wakeup_events'', ''marisha_ev_morning'' '
  29. if $start_type[1] = 'tg' and daystart - daystart_start < 9:
  30. $sleep_events_priority[] = 'gs ''wakeup_events'', ''trans_early_shocked'' '
  31. elseif $start_type[1] = 'tg' and daystart - daystart_start < 29:
  32. $sleep_events_priority[] = 'gs ''wakeup_events'', ''trans_little_shocked'' '
  33. end
  34. if therapistQW['hotel_sleep_flag'] = 1:
  35. therapistQW['hotel_sleep_flag'] = 0
  36. $sleep_events_priority[] = 'gs ''therapist_home'', ''wakeup'' '
  37. end
  38. if mid($start_type, 1, 2) = 'sg' and sleepVars['slept_in'] = 1 and kanikuli = 0 and SchoolAtestat = 0 and SchoolBlock = 0 and week < 6 and suspended['on'] ! 1:
  39. if (hour = 7 or hour = 8):
  40. $sleep_events_priority[] = 'gs ''wakeup_events'', ''sg_go_school'' '
  41. elseif hour >= 9 and hour < 14:
  42. $sleep_events_priority[] = 'gs ''wakeup_events'', ''sg_slept_in'' '
  43. end
  44. end
  45. xgt 'wakeup_events', 'mod_sleepevents'
  46. end
  47. xgt 'wakeup_events', 'continue'
  48. end
  49. if $ARGS[0] = 'mod_sleepevents':
  50. !! This location is here to allow mods to hook into the system.
  51. !! Either check for: if $sleep_loc = 'wakeup_events' and $ARGS[0] = 'mod_sleepevents'
  52. !!
  53. !! You can add events as: $sleep_events[] = 'gs ''mod_loc'' ''mod_args0'' '
  54. !! A random event will be chosen from amongst the added ones.
  55. !! If an event MUST trigger (due to quest timing), add it tp $sleep_events_priority[] = 'gs ''mod_loc'' ''mod_args0'' '
  56. !!
  57. !! If the event does not break the sleep cycle (merely interupts it) it needs to end with gs 'wakeup_events', 'event_end'
  58. !! 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'
  59. !!
  60. !! This is to cleanup all necessary variables.
  61. !!
  62. !! DO NOT DIRECTLY GOTO/GOSUB OUTOF THIS LOCATION. ALWAYS ADD IT TO THE QUEUEs!!!!
  63. !! IT WILL ALMOST CERTIANLY END BADLY WHEN MORE THAN 1 MOD IS INVOLVED.
  64. xgt 'wakeup_events', 'event_handler'
  65. end
  66. if $ARGS[0] = 'event_handler':
  67. if sleepVars['events_done'] < 10:
  68. if arrsize('$sleep_events_priority') > 0:
  69. xgt 'wakeup_events', 'event_handler2', 'priority'
  70. elseif arrsize('$sleep_events') > 0:
  71. xgt 'wakeup_events', 'event_handler2'
  72. end
  73. end
  74. xgt 'wakeup_events', 'continue'
  75. end
  76. if $ARGS[0] = 'event_handler2':
  77. sleepVars['events_done'] += 1
  78. if $ARGS[1] = 'priority':
  79. temp_slev_id = rand(0, arrsize('$sleep_events_priority')-1)
  80. $temp_sleep_event_chosen = $sleep_events_priority[temp_slev_id]
  81. killvar '$sleep_events_priority', temp_slev_id
  82. else
  83. temp_slev_id = rand(0, arrsize('$sleep_events')-1)
  84. $temp_sleep_event_chosen = $sleep_events[temp_slev_id]
  85. killvar '$sleep_events', temp_slev_id
  86. end
  87. killvar 'temp_slev_id'
  88. dynamic $temp_sleep_event_chosen
  89. xgt 'wakeup_events', 'event_end'
  90. end
  91. if $ARGS[0] = 'event_end':
  92. killvar '$temp_sleep_event_chosen'
  93. if arrsize('$sleep_events_priority') > 0:
  94. xgt 'wakeup_events', 'event_handler2', 'priority'
  95. end
  96. xgt 'wakeup_events', 'event_handler'
  97. end
  98. if $ARGS[0] = 'exit':
  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. InSleep = 0
  106. end
  107. if $ARGS[0] = 'continue':
  108. sleepVars['events_done'] = 0
  109. killvar '$sleep_loc'
  110. killvar '$sleep_events'
  111. killvar '$sleep_events_priority'
  112. killvar 'temp_slev_id'
  113. killvar '$temp_sleep_event_chosen'
  114. xgt 'wakeup', 'get_out'
  115. end
  116. !!=====================================!!
  117. !! !!
  118. !! Events !!
  119. !! !!
  120. !!=====================================!!
  121. if $ARGS[0] = 'mother_sextalk':
  122. gt 'mother_sextalk', 'dildo_wakeup1'
  123. end
  124. if $ARGS[0] = 'experimental_trials':
  125. xgt 'city_experimental_trials_events'
  126. end
  127. if $ARGS[0] = 'vomiting_check':
  128. !! if not one of these locations, event will not fire
  129. if $loc = func('homes_properties_attr', 'get_property_attribute', '$bedroom') and (func('homes_properties', 'is_at_a_home')):
  130. gs 'wakeup_events', 'exit'
  131. gs 'home_activity', 'vomiting_images'
  132. gt 'home_activity', 'morning_vomit'
  133. else
  134. vomit['morning_sick'] = 0
  135. vomit['hangover'] = 0
  136. vomit['unlucky'] = 0
  137. end
  138. gs 'wakeup_events', 'event_end'
  139. end
  140. if $ARGS[0] = 'marisha_ev_morning':
  141. *clr
  142. '<center><img src="images/characters/pavlovsk/resident/marisha/marisha.jpg"></center>'
  143. '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.'
  144. MarishaQW['marisha_sleepover'] = 0
  145. gs 'wakeup_events', 'event_end'
  146. end
  147. if $ARGS[0] = 'trans_early_shocked':
  148. 'The first thing you think as you wake up is, "Damn! It''s is not a dream, I really am a woman now."'
  149. gs 'wakeup_events', 'event_end'
  150. end
  151. if $ARGS[0] = 'trans_little_shocked':
  152. 'Looking at your female body, you are still a little surprised it''s actually you.'
  153. gs 'wakeup_events', 'event_end'
  154. end
  155. if $ARGS[0] = 'sg_go_school':
  156. pcs_mood -= 10
  157. gs 'stat'
  158. msg '<center>Damn it''s <b><<func(''time'', ''get_time_string'', hour, minut)>></b>, you''ve slept too long! You need to hurry or you''re going to be late for school!</center>'
  159. gs 'wakeup_events', 'event_end'
  160. end
  161. if $ARGS[0] = 'sg_slept_in':
  162. if schoolprogul > 2 and schoolPredupr = 2:
  163. pcs_mood -= 35
  164. gs 'stat'
  165. msg '<center>Damn it''s <b><<func(''time'', ''get_time_string'', hour, minut)>></b>. 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>'
  166. elseif schoolprogul > 2 and schoolPredupr = 1:
  167. pcs_mood -= 30
  168. gs 'stat'
  169. msg '<center>Damn it''s <b><<func(''time'', ''get_time_string'', hour, minut)>></b>. 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>'
  170. elseif schoolprogul > 2 and schoolPredupr = 0:
  171. pcs_mood -= 25
  172. gs 'stat'
  173. msg '<center>Damn it''s <b><<func(''time'', ''get_time_string'', hour, minut)>></b>. 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>'
  174. else
  175. pcs_mood -= 20
  176. gs 'stat'
  177. msg '<center>Damn it''s <b><<func(''time'', ''get_time_string'', hour, minut)>></b>. 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>'
  178. end
  179. gs 'wakeup_events', 'event_end'
  180. end
  181. --- wakeup_events ---------------------------------