(version 2)
(include "sci.sh")
(exports
    0 rm115
)
(use "Main")
(use "Timer")
(use "Game")
(use "Feature")
(use "Obj")
(script 115)


(local
    local0
    local1
    local2
    local3
    local4

)
(instance public rm115 of Rm
    (properties
        picture 115
        style 0
    )

    (method (init)
        proc0_2()
        Load(128 801)
        Load(132 93)
        (super:init())
        (self:setScript(startShip))
    )

)
(instance startShip of Script
    (properties)

    (method (doit)
        (if ((== (self:state) 1) and (== (send gLongSong:prevSignal) 20))
            (self:cue())
        )
        (super:doit())
    )


    (method (changeState newState)
        (switch (= state newState)
            (case 0
                = local0 Display("You cut the engines to sub-lightspeed as\nyou near a seemingly habitable planet." 106 250 100 35 140 101 1 105 300 102 14 107)
                (Timer:setReal(self 7))
            )
            (case 1
            )
            (case 2
                Display(115 0 108 local0)
                (Timer:setReal(self 2))
            )
            (case 3
                (spaceShip:init())
            )
            (case 4
                (Timer:setReal(self 2))
            )
            (case 5
                (send global2:newRoom(116))
            )
        )
    )

)
(instance spaceShip of Prop
    (properties
        view 52
        priority 13
    )

    (method (init)
        (super:init())
        = local1 120
        = local2 6
        = local3 90
        = local4 5
    )


    (method (doit)
        (super:doit())
        (if (< local1 local2)
            (self:dispose())
            (startShip:cue())
        )(else
            = local1 (- local1 local2)
            = local3 (% (+ (+ local3 local4) 360) 360)
            (self:posn((+ 190 CosMult(local3 local1)) (+ 50 SinMult(local3 local1))))
            (if ((< local1 100) and (< cel (self:lastCel())))
                ++cel
            )
            (self:stopUpd())
        )
    )

)
