START ** Initialisation (0:100) When 1 seconds have passed, offset by 0, (1:202) and variable %restartNotNeeded is less than 1. (5:300) set variable %motion to the value 0. ** Not moving (5:300) set variable %ncard to the value 0. ** ncard is zero (5:300) set variable %newDeck to the value 1. ** Current Deck is 1 (5:300) set variable %nowDeck to the value 1. ** Current Deck is 1 (5:300) set variable %speed to the value 5. ** Default Speed (5:300) set variable %lda to the value 0. ** do not lockdown (5:300) set variable %breakChance to the value 4. ** breakdown chance (5:104) activate text filter number 1. (5:300) set variable %restartNotNeeded to the value 1. ** Duplicate this chunk for each deck people can enter at. (0:7) When somebody moves into position (44,25), ** Enter from Deck 1 (3:2) at position (10,57) on the map, ** Unblockable Doorway (5:17) move any furre present to (12,54), or to someplace nearby if it's occupied. (5:14) move the triggering furre to (10,57) if there's nobody already there. (0:31) When a furre says {Turbolift Emergency Stop}, ** Allows Exit at Current Floor (1:201) and variable %ncard is greater than 0. (5:50) set countdown timer 14 to go off in 0 seconds. (5:50) set countdown timer 8 to go off in 0 seconds. (5:41) place object type 344 at (10,52). (5:300) set variable %motion to the value 0. (5:41) place object type 2403 at (8,58). (0:31) When a furre says {Turbolift Emergency Stop}, (1:201) and variable %ncard is greater than 0. (1:200) and variable %nowDeck is equal to 1. (5:41) place object type 2403 at (42,26). (0:31) When a furre says {Turbolift Emergency Stop}, (1:201) and variable %ncard is greater than 0. (1:200) and variable %nowDeck is equal to 2. (5:41) place object type 2403 at (26,70). (0:31) When a furre says {Turbolift Emergency Stop}, (1:201) and variable %ncard is greater than 0. (1:200) and variable %nowDeck is equal to 3. (5:41) place object type 2403 at (98,27). (0:31) When a furre says {Turbolift Emergency Stop}, (1:201) and variable %ncard is greater than 0. (1:200) and variable %nowDeck is equal to 4. (5:41) place object type 2403 at (100,85). (0:31) When a furre says {Turbolift Reset}, ** Allows repair of a broken turbolift and takes it down to deck one. (1:201) and variable %ncard is greater than 0. (5:300) set variable %motion to the value 1. ** We are in motion. (5:300) set variable %newDeck to the value 1. ** New deck is Deck 1. (5:41) place object type 2402 at (8,58). ** Close Interior doors * Microsoft: Closing Doors Everwhere. Close all exterior doors. (5:41) place object type 2402 at (26,70). (5:41) place object type 2402 at (42,26). (5:41) place object type 2402 at (98,27). (5:41) place object type 2402 at (100,85). (5:300) set variable %speed to the value 5. ** One floor every 5 seconds. (5:300) set variable %itemFrom to the value 339. ** Base item number for deck meter (5:303) take variable %itemFrom and add variable %nowDeck to it. ** Then add current deck number to it to get appropriate reading (5:300) set variable %itemTo to the value 339. ** Base item number for deck meter (5:303) take variable %itemTo and add variable %newDeck to it. ** Add destination deck number to it to get reading to use when at appropriate deck. (3:2) at position (10,52) on the map, (5:4) place object type %itemFrom. ** Place current meter. (5:11) play sound 20 to every furre who can see the triggering furre. ** Small sound to indicate start of turbolift. (5:301) copy the value of variable %itemFrom into variable %itemCurrent. ** What we started at is the item for the meter we're using now. (5:50) set countdown timer 14 to go off in %speed seconds. ** This starts the turbolift going. ** The following allows the turbolift to activate. (0:32) When a furre says something with {Deck} in it, ** These two blocks check we're not already on the destination deck. (1:8) and they can see position (12,55), ** Is Inside Turbolift (1:200) and variable %motion is equal to 0. ** Not Already In Motion (1:1014) and position (10,52) is not object type 344, ** Lift Not Broken-Down ** (coordinates for deck indicator, object number is broken meter) (5:314) set variable %newDeck to the number the triggering furre just said. (5:300) set variable %sameDeck to the value 0. (0:32) When a furre says something with {Deck} in it, (1:8) and they can see position (12,55), (1:200) and variable %motion is equal to 0. (1:203) and variable %nowDeck is equal to variable %newDeck. (1:1014) and position (10,52) is not object type 344, (5:300) set variable %sameDeck to the value 1. (0:32) When a furre says something with {Deck} in it, **** Main function to start turbolift (1:8) and they can see position (12,55), (1:200) and variable %motion is equal to 0. (1:201) and variable %newDeck is greater than 0. (1:202) and variable %newDeck is less than 5. (1:200) and variable %sameDeck is equal to 0. (1:1014) and position (10,52) is not object type 344, (5:300) set variable %motion to the value 1. (5:41) place object type 2402 at (8,58). * Microsoft: Closing Doors Everwhere. (5:41) place object type 2402 at (26,70). (5:41) place object type 2402 at (42,26). (5:41) place object type 2402 at (98,27). (5:41) place object type 2402 at (100,85). (5:300) set variable %itemFrom to the value 339. (5:303) take variable %itemFrom and add variable %nowDeck to it. (5:300) set variable %itemTo to the value 339. (5:303) take variable %itemTo and add variable %newDeck to it. (3:2) at position (10,52) on the map, (5:4) place object type %itemFrom. (5:11) play sound 20 to every furre who can see the triggering furre. (5:301) copy the value of variable %itemFrom into variable %itemCurrent. (5:50) set countdown timer 14 to go off in %speed seconds. ** Main loop. Called again and again and again every %speed seconds til we're at destination. (0:50) When countdown timer 14 goes off, (5:300) set variable %tlSF to the value 0. ** This is slightly confusing. ** It essentially says 'we've done our work for ** now.' It stops things like the elevator going ** up one deck, then the DS to take it down ** activating and working against it. (0:50) When countdown timer 14 goes off, (1:204) and variable %itemCurrent is greater than variable %itemTo. ** We're going down. (1:200) and variable %tlSF is equal to 0. (5:304) take variable %itemCurrent and subtract 1 from it. ** Go down. (3:2) at position (10,52) on the map, (5:4) place object type %itemCurrent. (5:300) set variable %tlSF to the value 1. (0:50) When countdown timer 14 goes off, (1:205) and variable %itemCurrent is less than variable %itemTo. ** We're going up. (1:200) and variable %tlSF is equal to 0. (5:302) take variable %itemCurrent and add 1 to it. ** Go down. (3:2) at position (10,52) on the map, (5:4) place object type %itemCurrent. (5:300) set variable %tlSF to the value 1. (0:50) When countdown timer 14 goes off, (5:300) set variable %there to the value 0. ** Are we there yet? (0:31) When a furre says {TURBOLIFT DEBUG}, (5:200) emit message {motion: %motion , nowDeck: %nowDeck , newDeck: %newDeck , itemFrom: %itemFrom , itemTo: %itemTo , itemCurrent: %itemCurrent } to whoever set off the trigger. (5:200) emit message {speed: %speed , there: %there , tlSF: %tlSF } to whoever set off the trigger. (0:50) When countdown timer 14 goes off, (1:203) and variable %itemCurrent is equal to variable %itemTo. (5:300) set variable %there to the value 1. ** We're at destination. (0:50) When countdown timer 14 goes off, (1:200) and variable %there is equal to 1. (5:50) set countdown timer 8 to go off in 1 seconds. ** Opens the doors and lets people out. (0:50) When countdown timer 14 goes off, (1:200) and variable %there is equal to 0. (5:50) set countdown timer 14 to go off in %speed seconds. ** If we're not there run this timer again. ** Stop lift (0:50) When countdown timer 8 goes off, (5:300) set variable %motion to the value 0. ** Stopped (5:301) copy the value of variable %newDeck into variable %nowDeck. ** Update current floor variable (3:2) at position (10,52) on the map, (5:4) place object type %itemTo. ** Update meter (3:1) everywhere on the whole map, (5:41) place object type 2403 at (8,58). ** Open interior door * ** What door do we open to allow entry when there? (Open exterior door) (0:50) When countdown timer 8 goes off, (1:200) and variable %nowDeck is equal to 1. (5:41) place object type 2403 at (42,26). (0:50) When countdown timer 8 goes off, (1:200) and variable %nowDeck is equal to 2. (5:41) place object type 2403 at (26,70). (0:50) When countdown timer 8 goes off, (1:200) and variable %nowDeck is equal to 3. (5:41) place object type 2403 at (98,27). (0:50) When countdown timer 8 goes off, (1:200) and variable %nowDeck is equal to 4. (5:41) place object type 2403 at (100,85). (0:50) When countdown timer 8 goes off, (1:200) and variable %lda is equal to 1. ** LDA says "lockdown/break lift on next stop?" (5:41) place object type 344 at (10,52). ** Breakdowns (0:50) When countdown timer 14 goes off, (1:1000) and a random dice roll comes up (%breakChance percent of the time), (5:202) emit message { Turbolift Error. Sending automatic distress signal in 10 seconds. } to every furre who can see (12,55). (5:50) set countdown timer 18 to go off in 10 seconds. ** Distress signal timer (5:50) set countdown timer 8 to go off in 0 seconds. ** Cancel all operation (5:50) set countdown timer 14 to go off in 0 seconds. ** Cancel all operation (5:41) place object type 344 at (10,52). ** Make meter "broken/locked down" (0:50) When countdown timer 18 goes off, (5:204) emitloud message { Turbolift Error, please send assistance } to everyone on the map. (5:300) set variable %alarm to the value 1. **** You want to duplicate this code for each floor, changing only the Cause coordinates **** and the "newDeck" setting line to the appropriate floor. (0:7) When somebody moves into position (26,70), ** Bump into exterior turbolift door to call lift (1:3) and they move into object type 2402, ** and the door is closed (1:200) and variable %motion is equal to 0. ** and the lift is not busy (1:1014) and position (10,52) is not object type 344, ** and the lift is not brokendown/lockdown (5:300) set variable %motion to the value 1. ** Move the lift.. (5:300) set variable %newDeck to the value 2. ** to the appropriate deck... (5:41) place object type 2402 at (8,58). ** Close the interior door... * Microsoft: Closing Doors Everwhere. (5:41) place object type 2402 at (26,70). ** Close the exterior door... (5:41) place object type 2402 at (42,26). (5:41) place object type 2402 at (98,27). (5:300) set variable %itemFrom to the value 339. ** Setup the meter (5:303) take variable %itemFrom and add variable %nowDeck to it. (5:300) set variable %itemTo to the value 339. (5:303) take variable %itemTo and add variable %newDeck to it. (3:2) at position (10,52) on the map, (5:4) place object type %itemFrom. ** Update the meter (5:11) play sound 20 to every furre who can see the triggering furre. ** Notification sound (5:301) copy the value of variable %itemFrom into variable %itemCurrent. ** Where we started from is where we are now (5:50) set countdown timer 14 to go off in %speed seconds. ** Start the loop of movement (5:200) emit message {Turbolift called.} to whoever set off the trigger. ** Allow people to leave the lift (0:7) When somebody moves into position (8,58), ** Move into interior doorway (1:200) and variable %motion is equal to 0. ** and we're stopped (1:200) and variable %nowDeck is equal to 1. ** and on deck one (3:2) at position (42,26) on the map, ** Unblockable doorwat (5:17) move any furre present to (40,29), or to someplace nearby if it's occupied. (3:5) where the triggering furre (moved from/is standing at), (5:14) move the triggering furre to (42,26) if there's nobody already there. ** put us at Deck 1 exterior doorway (0:7) When somebody moves into position (8,58), (1:200) and variable %motion is equal to 0. (1:200) and variable %nowDeck is equal to 2. (3:2) at position (26,70) on the map, (5:17) move any furre present to (24,69), or to someplace nearby if it's occupied. (3:5) where the triggering furre (moved from/is standing at), (5:14) move the triggering furre to (26,70) if there's nobody already there. (0:7) When somebody moves into position (8,58), (1:200) and variable %motion is equal to 0. (1:200) and variable %nowDeck is equal to 3. (3:2) at position (98,27) on the map, (5:17) move any furre present to (98,30), or to someplace nearby if it's occupied. (3:5) where the triggering furre (moved from/is standing at), (5:14) move the triggering furre to (98,27) if there's nobody already there. (0:7) When somebody moves into position (8,58), (1:200) and variable %motion is equal to 0. (1:200) and variable %nowDeck is equal to 4. (3:2) at position (100,85) on the map, (5:17) move any furre present to (96,86), or to someplace nearby if it's occupied. (3:5) where the triggering furre (moved from/is standing at), (5:14) move the triggering furre to (100,85) if there's nobody already there. END