wakeup_events.qsrc 7.2 KB

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