nichUtil.qsrc 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. # nichUtil
  2. !! Used variables-
  3. !! Prefix- nich
  4. !! nichWork- 0= does not work for nicholas and never has, 1= currently works for nicholas, 2= quit job in good faith and could get hired again, 3= quit job in bad faith or got thrown out and nicholas is blocked
  5. !! nichPerformance- ranging from 0 (fired) to 100 (best)
  6. !! nichHired- the day Sveta was hired
  7. !! nichVacationFrom- the first free day if Sveta gets some time off
  8. !! nichVactionTil- the last free day if Sveta gets some time off (=nichVacationFrom if she has one free day)
  9. !! nichLastWorkDay- the last day Sveta was in the appartment... needed because otherwise the player could avoid work performance checks by just not showing up here
  10. !! nichMissedWorkdays- the number of days Sveta has missed work... hopefully she has a good excuse
  11. !! nichEvaluationLast- the day Sveta had her last evaluation (may be today)
  12. !! nichEvaluationLastReq- the last day Sveta was required to get an evaluation (may be today)
  13. !! nichLastInspepection- the day Sveta last inspected the appartment (if it is today she has a list of chores she still has to do)
  14. !! nichMaidLaundry-
  15. !! nichMaidDishes-
  16. !! nichMaidGroceries-
  17. !! nichMaidHallway-
  18. !! nichMaidLivingDust
  19. !! nichMaidLivingFloor
  20. !! nichMaidLivingItems
  21. !! nichMaidLivingWindows
  22. !! nichOutfitState- 0=not wearing an appropriate outfit, 1=wearing an appropriate outfit
  23. if $ARGS[0] = '' or $ARGS[0] = 'start':
  24. 'This page should never appear. Please report this bug including a description of how you got here.'
  25. end
  26. if $ARGS[0] = 'startWorkday':
  27. nichMissedWorkdays = daystart - nichLastWorkDay - 1
  28. if nickHired + 1 = daystart:
  29. !! this is the first workday ever
  30. nichMissedWorkdays = 0
  31. elseif nichVactionTil + 1 = daystart:
  32. !! this is the first day Sveta has to work after a vacation... maybe work piled up?
  33. nichMissedWorkdays = nichMissedWorkdays - nichVactionTil + nichVacationFrom -1
  34. elseif nichVactionTil >= daystart and nichVacationFrom <= daystart:
  35. !! Sveta does not have to work today
  36. nichMissedWorkdays = nichVacationFrom - nichLastWorkDay - 1
  37. end
  38. if nichMissedWorkdays > 0:
  39. !!Sveta has missed a workday... very bad
  40. nichPerformance -= 40 * nichMissedWorkdays
  41. if nichPerformance <= 0:
  42. 'You see a note hanging at the door to your room.'
  43. '"<<$pcs_nichname>>, you missed work. This is unacceptable. Take your stuff and leave. You are fired. -Nicholas"'
  44. 'You see all your belongings standing in front of the door prepared for your departure.'
  45. gt 'nichUtil', 'fired'
  46. else
  47. 'You see a note hanging at the door to your room.'
  48. '"<<$pcs_nichname>>, you missed work. This is unacceptable. I expect this not to happen again. -Nicholas"'
  49. end
  50. elseif daystart > nichEvaluationLastReq and nichEvaluationLast < nichEvaluationLastReq:
  51. !! Sveta has missed her last evaluation
  52. nichPerformance -= 20
  53. if nichPerformance <= 0:
  54. 'You see a note hanging at the door to your room.'
  55. '"<<$pcs_nichname>>, you missed your last evaluation. This is unacceptable. Take your stuff and leave. You are fired. -Nicholas"'
  56. 'You see all your belongings standing in front of the door prepared for your departure.'
  57. gt 'nichUtil', 'fired'
  58. else
  59. 'You see a note hanging at the door to your room.'
  60. '"<<$pcs_nichname>>, you missed your last evaluation. This is unacceptable. I expect this not to happen again. -Nicholas"'
  61. end
  62. end
  63. nichLastWorkDay = daystart
  64. nichEvaluationLastReq = daystart
  65. !! update the vars for all the chores
  66. nichMaidHallway += 1
  67. end
  68. !! get rid of all variables concerning Nicholas except for nichWork
  69. if $ARGS[0] = 'clearVars':
  70. killvar 'nichPerformance'
  71. killvar 'nickHired'
  72. killvar 'nichVacationFrom'
  73. killvar 'nichVactionTil'
  74. killvar 'nichLastWorkDay'
  75. killvar 'nichMissedWorkdays'
  76. killvar 'nichEvaluationLast'
  77. killvar 'nichEvaluationLastReq'
  78. killvar 'nichMaidLaundry'
  79. killvar 'nichMaidDishes'
  80. killvar 'nichMaidGroceries'
  81. killvar 'nichMaidHallway'
  82. killvar 'nichMaidLivingDust'
  83. killvar 'nichMaidLivingFloor'
  84. killvar 'nichMaidLivingItems'
  85. killvar 'nichMaidLivingWindows'
  86. killvar 'nichLastInspepection'
  87. killvar 'nichOutfitState'
  88. end
  89. if $ARGS[0] = 'fired':
  90. 'It takes you a few moments to process what just happened:'
  91. 'You have just been fired. And kind of lost your home, too.'
  92. nichWork = 2
  93. gs 'nichUtil', 'clearVars'
  94. act 'Take your belongings and leave':gt 'down'
  95. end
  96. !! initializes variables when hired, might mess everything up if called at any other time
  97. if $ARGS[0] = 'hired':
  98. nichWork = 1
  99. nichPerformance = 20
  100. nickHired = daystart
  101. nichVacationFrom = daystart
  102. nichVactionTil = daystart
  103. nichLastWorkDay = daystart
  104. nichEvaluationLast = daystart
  105. nichEvaluationLastReq = daystart
  106. nichMaidLaundry = 0
  107. nichMaidDishes = 0
  108. nichMaidGroceries = 0
  109. nichMaidHallway = 0
  110. nichMaidLivingDust = 0
  111. nichMaidLivingFloor = 0
  112. nichMaidLivingItems = 0
  113. nichMaidLivingWindows = 0
  114. nichLastInspepection = -1
  115. end
  116. !! convert the old vars to the new system
  117. if $ARGS[0] = 'convert':
  118. if tanwork = 1:
  119. gs 'nichUtil', 'hired'
  120. nichPerformance = tan_work_rep * 5
  121. end
  122. killvar 'MaidWorkDay'
  123. killvar 'MaidWork'
  124. killvar 'TanHallClean'
  125. killvar 'TanRoomClean'
  126. killvar 'TanBathClean'
  127. killvar 'TanMasterClean'
  128. killvar 'TanLivingClean'
  129. killvar 'TanMaidRoomClean'
  130. killvar 'TanKitchenClean'
  131. killvar 'TanMadeBreakfast'
  132. killvar 'tanwork'
  133. killvar 'tan_work_rep'
  134. killvar 'tan_work_evaluation'
  135. end
  136. if $ARGS[0] = 'checkOutfit':
  137. if $clothingworntype = 'uniform':
  138. nichOutfitState = 1
  139. else
  140. nichOutfitState = 0
  141. end
  142. end
  143. --- nichUtil ---------------------------------