school_schedule.tw 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. :: school_schedule[include]
  2. <<set _schoolDay = $time.weekday - 1>>
  3. <<if _schoolDay > 4>>
  4. <!-- It's Saturday or Sunday. Most likely because you are debugging. Let's just pretend as if it's Tuesday then. -->
  5. <<set _schoolDay = 1>>
  6. <</if>>
  7. <<set _schoolTimetable = $q.school.get('timetable')>>
  8. <<set _schoolPeriodStartTimes = $q.school.get('startTimes')>>
  9. /*<<set _schoolClasses = {
  10. computer: {
  11. label:'Computer',
  12. varname:'sci',
  13. teacherId:'A138',
  14. endPassage:'gschool_lessons',
  15. endArgument: 'short_break',
  16. flags: {
  17. skills:{
  18. intelligence: 0.5
  19. }
  20. }
  21. },
  22. music: {
  23. label:'Music',
  24. varname:'sci',
  25. teacherId:'A138',
  26. endPassage:'gschool_lessons',
  27. endArgument: 'short_break',
  28. flags: {
  29. skills:{
  30. intelligence: 0.5
  31. }
  32. }
  33. },
  34. }>>*/
  35. <<run $time.advanceTo(...(_schoolPeriodStartTimes[$q.school.period]))>>
  36. <<if _schoolTimetable[_schoolDay].length > $q.school.period>>
  37. <<set _curClassId = _schoolTimetable[_schoolDay][$q.school.period]>>
  38. <<else>>
  39. <<set _curClassId = 'END'>>
  40. <</if>>
  41. <<switch _curClassId>>
  42. <<case 'END'>>
  43. <<gt 'school_schedule_end'>>
  44. <<case 'break'>>
  45. <<set $q.school.period += 1>>
  46. <<gt 'school_break' 'break'>>
  47. <<case 'breakLunch'>>
  48. <<set $q.school.period += 1>>
  49. <<gt 'school_break_lunch'>>
  50. <<default>>
  51. <<if $q.school.period == 0>>
  52. <<gs 'school_schedule_before_class' _curClassId>><!-- Avoid doubled gt... which is annoying -->
  53. <<else>>
  54. <<gt 'school_schedule_before_class' _curClassId>>
  55. <</if>>
  56. <</switch>>
  57. :: school_schedule_end[quest]
  58. <<image 'locations/pavlovsk/school/building/gschool_hall0#.jpg' 0 2>>
  59. <p>School is over for today.</p>
  60. <<actCLA 'Leave the building'>>
  61. <<gt 'school_grounds'>>
  62. <</actCLA>>
  63. :: school_schedule_before_class[event]
  64. <!-- For stupid reasons, this is included in the first period instead of gone to... this means you can't interrupt it in the first period -->
  65. <<set _curClassId = $location_var[$here][0]>>
  66. <h2>School Hallway</h2>
  67. <<if $q.school.period == 0>>
  68. <<gs 'gschool_gossip' 'morning'>>
  69. <<else>>
  70. <<image 'locations/pavlovsk/school/building/gschool_hall0#.jpg' 0 2>>
  71. <<gs 'gschool_gossip' 'gossip'>>
  72. <</if>>
  73. <<if Story.has('school_lesson_'+_curClassId)>>
  74. <<set _curClass = func('school_lesson_'+_curClassId,'getData')>>
  75. <<act `'Go to next class ('+_curClass.label+')'`>>
  76. <<gt 'school_lesson' _curClassId>>
  77. <<set $q.school.period += 1>>
  78. <</act>>
  79. <<act 'Skip next class'>>
  80. <<set $q.school.period += 1>>
  81. <<run $q.school.inc('missedClasses',1)>>
  82. <<gs 'school_schedule'>>
  83. <</act>>
  84. <<act 'Leave school'>>
  85. <<set _schoolDay = $time.weekday - 1>>
  86. <<for _key, _classId range $q.school.get('timetable')[_schoolDay]>>
  87. <<if _classId != 'break' and _classId != 'breakLunch' and _key >= $q.school.period>>
  88. <<run $q.school.inc('missedClasses',1)>>
  89. <</if>>
  90. <</for>>
  91. <<gt 'school_grounds'>>
  92. <</act>>
  93. <<else>>
  94. <<notice>>The next class (_curClassId) currently does not exist. You can directly skip to the next one.<</notice>>
  95. <<act 'Skip next class'>>
  96. <<set $q.school.period += 1>>
  97. <<gs 'school_schedule'>>
  98. <</act>>
  99. <</if>>