home *** CD-ROM | disk | FTP | other *** search
- property bolChanList, bolAvailList, bolActiveList, bolDelList, bubAvailList, bubActiveList, bubDelList, numBols, totNumBols, chansLeft, wilbur, crystal, layout, lastX, lastY, beenHelped, inHelp, autTimeOut, bathTimeOut, dontHumWinnie, cursorHidden, atmosDelay, frameAt
-
- on birth me
- global firstTime, visitList
- set beenHelped to 0
- set dontHumWinnie to 1
- set autTimeOut to 40
- set inHelp to 0
- set bolChanList to [14, 15, 16, 17, 18]
- sort(bolChanList)
- set chansLeft to count(bolChanList)
- if voidp(visitList) then
- set visitList to []
- set layout to [#kitchen: [237, 182], #bedroom: [98, 26], #crystalroom: [353, 55], #lounge: [412, 296], #bathroom: [98, 182], #projectorroom: [438, 182]]
- else
- set layout to switchRooms()
- end if
- set bolActiveList to []
- set numBols to count(bolActiveList)
- set sparkles to birth(script "sparkles", 14, 15, 16, 17, 18, layout, visitList)
- append(bolActiveList, sparkles)
- set wilbur to birth(script "wilbur", 34, 38, 39)
- set crystal to birth(script "crystal", 21)
- set loc to getProp(layout, #projectorroom)
- set x to getAt(loc, 1)
- set y to getAt(loc, 2)
- append(bolActiveList, birth(script "projector", 19, 20, x, y))
- append(bolActiveList, birth(script "chimney", 35, 36))
- append(bolActiveList, birth(script "plant", 30, 31))
- set bolAvailList to []
- append(bolAvailList, birth(script "washing", 23))
- append(bolAvailList, birth(script "winnie", 24, 25, 40))
- append(bolAvailList, birth(script "bird1", 26))
- append(bolAvailList, birth(script "bird2", 27, 28))
- append(bolAvailList, birth(script "bird3", 29))
- append(bolAvailList, birth(script "smoke", 37))
- set totNumBols to count(bolAvailList)
- set bolDelList to []
- set lastX to the mouseH
- set lastY to the mouseV
- set atmosDelay to 0
- return me
- end
-
- on Animate me
- global startTime, beenHelped, firstTime
- Animate(wilbur)
- Animate(crystal)
- if not cursorHidden then
- if rollOver(32) then
- set the castNum of sprite 32 to 570
- else
- set the castNum of sprite 32 to 569
- end if
- end if
- repeat with obj in bolActiveList
- Animate(obj)
- end repeat
- repeat with obj in bolDelList
- set tempPos to getPos(bolActiveList, obj)
- if tempPos <> 0 then
- deleteAt(bolActiveList, tempPos)
- append(bolAvailList, obj)
- set numBols to numBols - 1
- end if
- end repeat
- set bolDelList to []
- set helpTime to (the ticks / 60) - startTime
- if not inHelp and firstTime then
- if helpTime >= autTimeOut then
- if 1 = 0 then
- set frameAt to the frame
- if (frameAt >= 47) and (frameAt <= 59) then
- set the locH of sprite 42 to 505
- set the locV of sprite 42 to 44
- set the castNum of sprite 42 to 603
- set the visible of sprite 42 to 1
- end if
- sound playFile 3, "HMahelp.aif"
- set inHelp to 1
- go("help")
- end if
- else
- end if
- else
- if soundBusy(3) = 0 then
- set inHelp to 0
- set beenHelped to 1
- set the mouseDownScript to EMPTY
- set startTime to the ticks / 60
- end if
- end if
- set t to the ticks
- if (t - atmosDelay) > 120 then
- if soundBusy(4) = 0 then
- sound playFile 4, "HMatmos.aif"
- set atmosDelay to the ticks
- end if
- end if
- end
-
- on activateBol me
- if numBols < totNumBols then
- if chansLeft > 0 then
- set rand to random(totNumBols - numBols)
- set bolObj to getAt(bolAvailList, rand)
- deleteAt(bolAvailList, rand)
- set numBols to numBols + 1
- startAnimation(bolObj)
- append(bolActiveList, bolObj)
- end if
- end if
- end
-
- on RemoveBOL me, bolObj
- append(bolDelList, bolObj)
- end
-
- on assignChan me
- if chansLeft = 0 then
- set ch to 0
- else
- set ch to getAt(bolChanList, 1)
- set chansLeft to chansLeft - 1
- deleteAt(bolChanList, 1)
- end if
- return ch
- end
-
- on returnChan me, chan
- add(bolChanList, chan)
- set chansLeft to chansLeft + 1
- end
-
- on notAvail me
- sound playFile 3, "na.aif"
- end
-
- on doQuit me
- global gPath
- sound stop 1
- sound stop 2
- sound stop 3
- sound stop 4
- repeat with i = 4 to 40
- puppetSprite(i, 0)
- end repeat
- repeat with i = 1 to 47
- set the visible of sprite i to 0
- end repeat
- go("toQuit")
- end
-
- on doCreditsQuit
- sound stop 1
- sound stop 2
- sound stop 3
- sound stop 4
- repeat with i = 4 to 40
- puppetSprite(i, 0)
- end repeat
- go("cQuit")
- end
-
- on switchRooms me
- set A to [98, 26]
- set A2 to [98, 104]
- set B to [98, 182]
- set C to [98, 260]
- set D to [237, 182]
- set D2 to [298, 182]
- set E to [237, 260]
- set F to [353, 55]
- set G to [372, 182]
- set i to [438, 182]
- set J to [412, 296]
- set J2 to [473, 296]
- set K to [412, 374]
- set K2 to [473, 374]
- set L to [547, 296]
- set M to [547, 374]
- set variations to []
- append(variations, [#kitchen: D, #bedroom: A, #crystalroom: F, #lounge: J, #spare: [B, C, i]])
- append(variations, [#kitchen: D, #bedroom: A2, #crystalroom: F, #lounge: J, #spare: [A, C, i]])
- append(variations, [#kitchen: D, #bedroom: B, #crystalroom: F, #lounge: J, #spare: [A, A2, i]])
- append(variations, [#kitchen: E, #bedroom: A, #crystalroom: D, #lounge: J, #spare: [B, C, D2, i]])
- append(variations, [#kitchen: E, #bedroom: A, #crystalroom: G, #lounge: J, #spare: [B, C, D, i]])
- append(variations, [#kitchen: E, #bedroom: A2, #crystalroom: D, #lounge: J, #spare: [A, C, D2, i]])
- append(variations, [#kitchen: E, #bedroom: A2, #crystalroom: G, #lounge: J, #spare: [A, C, D, i]])
- append(variations, [#kitchen: E, #bedroom: B, #crystalroom: D, #lounge: J, #spare: [A, A2, D2, i]])
- append(variations, [#kitchen: E, #bedroom: B, #crystalroom: G, #lounge: J, #spare: [A, A2, D, i]])
- append(variations, [#lounge: D, #bedroom: A, #crystalroom: K, #kitchen: J, #spare: [B, C, i, K2]])
- append(variations, [#lounge: D, #bedroom: A, #crystalroom: M, #kitchen: J, #spare: [B, C, i, K]])
- append(variations, [#lounge: D, #bedroom: A2, #crystalroom: K, #kitchen: J, #spare: [A, C, i, K2]])
- append(variations, [#lounge: D, #bedroom: A2, #crystalroom: M, #kitchen: J, #spare: [A, C, i, K]])
- append(variations, [#lounge: D, #bedroom: B, #crystalroom: K, #kitchen: J, #spare: [A, A2, i, K2]])
- append(variations, [#lounge: D, #bedroom: B, #crystalroom: M, #kitchen: J, #spare: [A, A2, i, K]])
- append(variations, [#lounge: D, #bedroom: A, #crystalroom: J, #kitchen: K, #spare: [B, C, i, J2]])
- append(variations, [#lounge: D, #bedroom: A, #crystalroom: L, #kitchen: K, #spare: [B, C, i, J]])
- append(variations, [#lounge: D, #bedroom: A2, #crystalroom: J, #kitchen: K, #spare: [A, C, i, J2]])
- append(variations, [#lounge: D, #bedroom: A2, #crystalroom: L, #kitchen: K, #spare: [A, C, i, J]])
- append(variations, [#lounge: D, #bedroom: B, #crystalroom: J, #kitchen: K, #spare: [A, A2, i, J2]])
- append(variations, [#lounge: D, #bedroom: B, #crystalroom: L, #kitchen: K, #spare: [A, A2, i, J]])
- set var to getAt(variations, random(21))
- repeat with i = 1 to 4
- set theCast to EMPTY & getPropAt(var, i)
- set theLoc to getAt(var, i)
- set the locH of sprite (3 + i) to getAt(theLoc, 1)
- set the locV of sprite (3 + i) to getAt(theLoc, 2)
- set the castNum of sprite (3 + i) to cast theCast
- end repeat
- set spareSlots to getProp(var, #spare)
- deleteProp(var, #spare)
- set num to count(spareSlots)
- if num = 4 then
- set rnd to random(4)
- set theLoc to getAt(spareSlots, rnd)
- set the locH of sprite 11 to getAt(theLoc, 1)
- set the locV of sprite 11 to getAt(theLoc, 2)
- set the castNum of sprite 11 to cast "spare2"
- else
- set the castNum of sprite 11 to 0
- end if
- if num = 4 then
- set rnd to (rnd mod 4) + 1
- else
- set rnd to random(3)
- end if
- set theLoc to getAt(spareSlots, rnd)
- set the locH of sprite 10 to getAt(theLoc, 1)
- set the locV of sprite 10 to getAt(theLoc, 2)
- set the castNum of sprite 10 to cast "spare1"
- set rnd to (rnd mod num) + 1
- set theLoc to getAt(spareSlots, rnd)
- addProp(var, #bathroom, theLoc)
- set the locH of sprite 9 to getAt(theLoc, 1)
- set the locV of sprite 9 to getAt(theLoc, 2)
- set the castNum of sprite 9 to cast "bathroom"
- set rnd to (rnd mod num) + 1
- set theLoc to getAt(spareSlots, rnd)
- addProp(var, #projectorroom, theLoc)
- set the locH of sprite 8 to getAt(theLoc, 1)
- set the locV of sprite 8 to getAt(theLoc, 2)
- set the castNum of sprite 8 to cast "projectorroom"
- return var
- end
-