(version 2)
(include "sci.sh")
(exports
    0 rm070
)
(use "Main")
(use "Class_255_0")
(use "Game")
(use "TheMenuBar")
(use "Feature")
(script 70)



(instance public rm070 of Rm
    (properties
        picture 70
        horizon 70
        north 67
        east 71
        west 69
    )

    (method (init)
        (var temp0[50])
        proc0_3()
        (self:setRegions(600))
        Load(128 98)
        (super:init())
        (if (not global253)
            (send global10:add(ship))
            (send global10:doit())
        )
        (switch (gNorth)
            (case 67
                (send gEgo:
                    posn(
                        (if (> (send gEgo:x) 115)
                            115
                        )(else
                            (send gEgo:x)
                        )
 + (send global2:horizon) 2)
                    init()
                )
            )
            (case 69
                (send gEgo:
                    init()
                    posn(2 
                        (if (< (send gEgo:y) 85)
                            72
                        )(else
                            (if (== (send gEgo:y) 86)
                                88
                            )(else
                                (if (> (send gEgo:y) 166)
                                    166
                                )(else
                                    (send gEgo:y)
                                )
                            )
                        )
)
                )
            )
            (case 71
                (send gEgo:
                    init()
                    posn(317 
                        (if (== (send gEgo:y) 84)
                            83
                        )(else
                            (if ((< (send gEgo:y) 127) and (> (send gEgo:y) 115))
                                114
                            )(else
                                (if (> (send gEgo:y) 142)
                                    142
                                )(else
                                    (send gEgo:y)
                                )
                            )
                        )
)
                )
            )
        )
        (TheMenuBar:draw())
        (SL:enable())
    )


    (method (doit)
        (var gEgoOnControl)
        (super:doit())
        (if (== (send global2:script) 0)
            = gEgoOnControl (send gEgo:onControl())
            (if ((== gEgoOnControl 3) or (== gEgoOnControl 7))
                (send gEgo:
                    setPri(8)
                    posn(+ (send gEgo:x) 2 (send gEgo:y))
                    illegalBits(0)
                )
                = global180 1
            )(else
                (if (== gEgoOnControl 17)
                    (send gEgo:
                        setPri(13)
                        posn(+ (send gEgo:x) 2 (send gEgo:y))
                        illegalBits(0)
                    )
                    = global180 1
                )(else
                    (if (== gEgoOnControl 9)
                        (send gEgo:
                            setPri(11)
                            posn(+ (send gEgo:x) 2 (send gEgo:y))
                            illegalBits(0)
                        )
                        = global180 1
                    )(else
                        (if (== gEgoOnControl 5)
                            (send gEgo:
                                setPri(14)
                                posn((send gEgo:x) + (send gEgo:y) 2)
                                illegalBits(0)
                            )
                            = global180 1
                        )
                    )
                )
            )
        )
    )


    (method (handleEvent pEvent)
        (super:handleEvent(pEvent))
        (if ((<> (send pEvent:type) 128) or (send pEvent:claimed))
            return 
        )
        (if (Said('look/rock,boulder'))
            proc255_0(70 0)
        )(else
            (if (Said('look/scout,craft,skull,bow'))
                (if (global253)
                    proc255_0(70 1)
                )(else
                    proc255_0(70 2)
                )
            )
        )
    )


    (method (newRoom newRoomNumber)
        (if (not script)
            (if (global256)
                ++global593
            )
            (super:newRoom(newRoomNumber))
        )
    )

)
(instance ship of PV
    (properties
        y 135
        x 66
        view 98
        priority 9
        signal 16384
    )
)
