DaBOSS54320

Bully LUA: STimeCycle

Aug 30th, 2015
599
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.75 KB | None | 0 0
  1. -- Main function:
  2. function main()
  3.     -- Load the game:
  4.     while not SystemIsReady() do
  5.         Wait(0)
  6.     end
  7.    
  8.     -- Main loop:
  9.     while true do
  10.        
  11.         Wait(0)
  12.     end
  13. end
  14.  
  15. -- STimeCycle functions:
  16. function F_StartClass()
  17.     if not IsMissionCompleated("3_08") or IsMissionCompleated("3_08_PostDummy") then
  18.         F_RingSchoolBell()
  19.     end
  20. end
  21. function F_EndClass()
  22.     if not IsMissionCompleated("3_08") or IsMissionCompleated("3_08_PostDummy") then
  23.         F_RingSchoolBell()
  24.     end
  25. end
  26. function F_AttendedClass()
  27.     if not IsMissionCompleated("3_08") or IsMissionCompleated("3_08_PostDummy") then
  28.         SetSkippedClass(false)
  29.         PlayerSetPunishmentPoints(0)
  30.     end
  31. end
  32. function F_MissedClass()
  33.     if not IsMissionCompleated("3_08") or IsMissionCompleated("3_08_PostDummy") then
  34.         SetSkippedClass(true)
  35.         StatAddToInt(166)
  36.     end
  37. end
  38. function F_UpdateTimeCycle()
  39.     if not IsMissionCompleated("1_B") then
  40.         local day = GetCurrentDay(false)
  41.         if day < 0 or day > 2 then
  42.             SetCurrentDay(0)
  43.         end
  44.     end
  45.     F_UpdateCurfew()
  46. end
  47. function F_UpdateCurfew()
  48.     (shared.gCurfewRules or F_CurfewDefaultRules)()
  49. end
  50. function F_CurfewDefaultRules()
  51.     local t = ClockGet()
  52.     shared.gCurfew = t >= 23 or t < 7
  53. end
  54. function F_Nothing()
  55.    
  56. end
  57. function F_ClassWarning()
  58.    
  59. end
  60. F_StartMorning = F_UpdateTimeCycle
  61. F_EndMorning = F_UpdateTimeCycle
  62. F_StartLunch = F_UpdateTimeCycle
  63. F_EndLunch = F_UpdateTimeCycle
  64. F_StartAfternoon = F_UpdateTimeCycle
  65. F_EndAfternoon = F_UpdateTimeCycle
  66. F_StartEvening = F_UpdateTimeCycle
  67. F_EndEvening = F_UpdateTimeCycle
  68. F_StartCurfew_SlightlyTired = F_UpdateTimeCycle
  69. F_StartCurfew_Tired = F_UpdateTimeCycle
  70. F_StartCurfew_MoreTired = F_UpdateTimeCycle
  71. F_StartCurfew_TooTired = F_UpdateTimeCycle
  72. F_EndCurfew_TooTired = F_UpdateTimeCycle
  73. F_EndTired = F_UpdateTimeCycle
Advertisement
Add Comment
Please, Sign In to add comment