(include "sci.sh")
(use "Main")
(use "Class_255_0")
(use "Class_950_0")
(use "Cycle")
(use "Game")
(use "Obj")
(script 709)


(local
    local0
    local1
    local2
    local3

)
(instance public rgLanding of Rgn
    (properties)

    (method (init)
        (super:init())
        Load(rsVIEW 120)
        Load(rsPIC 120)
        (send global32:
            add(theCityView turbines theRoom)
            eachElementDo(102)
            doit()
        )
    )


    (method (doit)
        (super:doit())
        (if ((send global2:script))
            (send ((send global2:script)):doit())
        )(else
            (if (proc0_5(gEgo 4))
                (send global2:setScript(fallScript))
            )
        )
    )


    (method (newRoom param1)
        = keep proc999_5(param1 530 535 540)
        = initialized 0
        (super:newRoom(param1))
    )

)
(instance public fallScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (switch (global11)
                    (case 530
                        = local0 236
                        = local1 26
                        = local2 56
                        = local3 43
                    )
                    (case 535
                        = local0 304
                        = local1 10
                        = local2 84
                        = local3 114
                    )
                    (case 540
                        = local0 242
                        = local1 55
                        = local2 58
                        = local3 213
                    )
                )
                = cycles 1
            )
            (case 1
                Print("Watch out for that first step...")
                proc0_2()
                (send gLongSong2:
                    number(131)
                    vol(127)
                    loop(1)
                    play()
                )
                (send gEgo:
                    view(300)
                    setLoop()
                    setCycle(0)
                    setStep(3 20)
                    illegalBits(0)
                    setMotion(MoveTo (send gEgo:x) 250 self)
                )
            )
            (case 2
                (send global5:eachElementDo(156))
                (send global2:drawPic(120 100))
                (send gEgo:
                    show()
                    view(120)
                    x(+ (/ (* (/ (* (- (send gEgo:x) local1) 100) local0) local2) 100) local3)
                    y(90)
                    setLoop(3)
                    setCycle(Fwd)
                    setPri(15)
                    cel(0)
                    setStep(2 6)
                    heading(180)
                )
                = cycles 1
            )
            (case 3
                (send gEgo:setMotion(MoveTo (send gEgo:x) 210 self))
            )
            (case 4
                (send gLongSong2:fade())
                = seconds 1
            )
            (case 5
                proc0_10(0 22)
            )
        )
    )

)
(instance theCityView of Feature
    (properties
        x 153
        y 89
        heading 179
        nsTop 166
        nsBottom 189
        nsRight 319
        description "city view"
        sightAngle 90
        lookStr "From this vantage point high above Xenon you can truly appreciate the scope of the destruction. What a mess!"
    )

    (method (doVerb param1)
        (asm
            lsp     param1
            pushi   #doVerb
            pushi   1
            lsp     param1
            super   Feature, 6
            toss    
            ret     
        )
    )

)
(instance theRoom of Feature
    (properties
        x 160
        nsBottom 200
        nsRight 320
        description "landing bay"
    )

    (method (doVerb param1)
        (switch (param1)
            (case 1
                (switch (global11)
                    (case 530
                        Print("You are in the Super Computer's landing bay. Here you see the Sequel police dispatch terminal.")
                    )
                    (case 535
                        Print("This is the middle section of the Super Computer's Landing Bay. The ship you hitched a ride on rests here.")
                    )
                    (case 540
                        Print("There's a tunnel leading into the middle of the structure.")
                    )
                )
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
(instance turbines of Feature
    (properties
        nsBottom 200
        nsRight 320
        description "turbine"
        sightAngle 180
        onMeCheck 128
        lookStr "You can't actually see those. You just think you can."
    )
)
