(version 2)
(include "sci.sh")
(exports
    0 rm028
)
(use "Main")
(use "Class_255_0")
(use "Cycle")
(use "Game")
(use "User")
(use "TheMenuBar")
(use "Feature")
(use "Obj")
(script 28)


(local
    local0
    local1
    local2
    local3
    local4
    local5
    local6
    local7

)
(instance public rm028 of Rm
    (properties
        picture 28
        west 29
    )

    (method (init)
        (var temp0[50])
        Load(128 43)
        Load(128 44)
        Load(128 53)
        Load(128 64)
        Load(128 137)
        Load(128 213)
        Load(132 16)
        (super:init())
        (send global10:add(al2 al3 al5 al4 slop sa3))
        (send global10:doit())
        (ship:init())
        (collar:
            init()
            stopUpd()
        )
        (door:
            init()
            stopUpd()
        )
        (if (> global124 0)
            (al1:
                init()
                setScript(AlienScript)
            )
            (arm:
                init()
                stopUpd()
            )
            (tail:
                init()
                stopUpd()
            )
            (sa2:
                init()
                stopUpd()
            )
            (sa3Mouth:
                init()
                stopUpd()
            )
            (sa1:
                init()
                stopUpd()
                setScript(sa1Script)
            )
        )(else
            (al1:
                init()
                addToPic()
            )
            (arm:
                init()
                addToPic()
            )
            (tail:
                init()
                addToPic()
            )
            (sa1:
                init()
                addToPic()
            )
            (sa2:
                init()
                addToPic()
            )
            (sa3Mouth:
                init()
                addToPic()
            )
        )
        = local1 2
        = local4 1
        = local5 1
        = global244 0
        = global247 1
        (send gLongSong:number(16))
        (if ((<> global12 29) and (<> global12 27))
            (send gLongSong:play())
        )
        (switch (global12)
            (case 17
                (collar:setCel(7))
                (ship:
                    x(335)
                    y(174)
                )
                (chairMan:setCel(0))
                proc0_2()
                = global206 1
                = local0 4
                (self:setScript(dockScript))
            )
            (case 19
                (ship:
                    x(335)
                    y(174)
                )
                (collar:setCel(7))
                (chairMan:setCel(0))
                proc0_2()
                = global206 1
                = local0 4
                (self:setScript(dockScript))
            )
            (case 27
                (collar:setCel(7))
                (ship:
                    x(335)
                    y(174)
                )
                (chairMan:setCel(0))
                proc0_2()
                = global206 1
                = local0 4
                (self:setScript(dockScript))
            )
            (case 29
                proc0_3()
                (collar:setCel(0))
                (ship:
                    x(286)
                    y(115)
                )
                (chairMan:
                    setCel(7)
                    init()
                )
                (ship:stopUpd())
                = global206 0
                = local0 1
                (send gEgo:init())
                (if (< (send gEgo:y) 110)
                    (send gEgo:posn(120 100))
                )
            )
            (case 280
                (collar:setCel(0))
                (ship:
                    x(286)
                    y(115)
                    stopUpd()
                )
                (chairMan:
                    setCel(7)
                    init()
                )
                proc0_3()
                (send gEgo:
                    init()
                    posn(gGEgoX_3 gGEgoY_2)
                )
                (ship:stopUpd())
                = global206 0
                = local0 1
            )
        )
        (TheMenuBar:draw())
        (SL:enable())
    )


    (method (doit)
        (super:doit())
        (if ((== (send gEgo:onControl(0)) 4) or (== (send gEgo:onControl(0)) 5))
            (send global2:newRoom(29))
        )
        (if (((== (send gEgo:onControl(0)) 16) or (== (send gEgo:onControl(0)) 17)) and not script)
            (send global2:setScript(SitDown))
        )
        (if ((== script 0) and (send gEgo:inRect(0 125 68 138)))
            (rm028:setScript(CrowdScript))
        )
    )


    (method (handleEvent pEvent)
        (var temp0[50])
        (if ((send pEvent:claimed))
            return 
        )
        (switch ((send pEvent:type))
            (case 128
                (if (Said('look>'))
                    (if (Said('/pane') or Said('<out'))
                        proc255_0(28 0)
                    )(else
                        (if (Said('/deck,ceiling') or Said('<up,down'))
                            proc255_0(28 1)
                        )(else
                            (if (Said('/partition'))
                                proc255_0(28 2)
                            )(else
                                (if (Said('/clerk'))
                                    proc255_0(28 3)
                                )(else
                                    (if (Said('/alien,being,man,bystander,folk,animal'))
                                        proc255_0(28 4)
                                    )(else
                                        (if (Said('/craft'))
                                            proc255_0(28 5)
                                        )(else
                                            (if (Said('/door'))
                                                proc255_0(28 6)
                                            )(else
                                                (if (Said('/dinner,bag,drink'))
                                                    (if ((send gEgo:has(17)))
                                                        (send pEvent:claimed(0))
                                                    )(else
                                                        (if (== local5 0)
                                                            proc255_0(28 7)
                                                        )(else
                                                            proc255_0(28 8)
                                                        )
                                                    )
                                                )(else
                                                    (if (Said('/table,chair,booth'))
                                                        proc255_0(28 9)
                                                    )(else
                                                        (if (Said('/counter'))
                                                            proc255_0(28 10)
                                                        )(else
                                                            (if (Said('/menu'))
                                                                (if (== local4 0)
                                                                    proc255_0(28 11)
                                                                )(else
                                                                    = gGEgoX_3 (send gEgo:x)
                                                                    = gGEgoY_2 (send gEgo:y)
                                                                    (send global2:newRoom(280))
                                                                )
                                                            )(else
                                                                (if (Said('[<around,at,in][/area,cafe]'))
                                                                    proc255_0(28 12)
                                                                )
                                                            )
                                                        )
                                                    )
                                                )
                                            )
                                        )
                                    )
                                )
                            )
                        )
                    )
                )(else
                    (if (Said('down,sit[<down]'))
                        (if (== local4 0)
                            proc255_0(28 13)
                        )(else
                            (if ((send gEgo:inRect(136 115 178 140)))
                                (send global2:setScript(SitDown))
                            )(else
                                (if ((send gEgo:inRect(0 145 37 171)))
                                    proc255_0(28 14)
                                )(else
                                    proc255_0(28 15)
                                )
                            )
                        )
                    )(else
                        (if (Said('up,(get<up),stand[/up]'))
                            (if (== local4 1)
                                proc255_0(28 16)
                            )(else
                                (send global2:setScript(StandUp))
                            )
                        )(else
                            (if (Said('consume[<dinner]'))
                                (if (<> local4 0)
                                    proc255_0(28 17)
                                )(else
                                    (if ((send gEgo:has(17)))
                                        (send global2:setScript(EgoEating))
                                    )(else
                                        proc255_0(28 18)
                                    )
                                )
                            )(else
                                (if (Said('get[<up]/bag'))
                                    (if ((send gEgo:has(17)))
                                        proc255_0(28 19)
                                    )(else
                                        (if (== local5 0)
                                            proc255_0(28 20)
                                        )(else
                                            proc255_0(28 21)
                                        )
                                    )
                                )(else
                                    (if (Said('cast,get[<up,away]/garbage') or Said('clean/table'))
                                        (if ((send gEgo:has(17)))
                                            proc255_0(28 22)
                                        )(else
                                            (if ((== local5 0) or (send gEgo:inRect(0 145 37 171)))
                                                proc255_0(28 20)
                                            )(else
                                                proc255_0(28 23)
                                            )
                                        )
                                    )(else
                                        (if (Said('open,close/door'))
                                            proc255_0(28 24)
                                        )(else
                                            (if (Said('order,buy,get,ask[/dinner,dinner,burger]') or Said('converse/clerk'))
                                                proc255_0(28 25)
                                            )(else
                                                (if (Said('ask,converse/alien,being,man,bystander,folk,animal,customer'))
                                                    proc255_0(28 26)
                                                )(else
                                                    (if (Said('converse'))
                                                        proc255_0(28 27)
                                                    )(else
                                                        (if (Said('kiss/alien,being,man,bystander,folk,animal,customer'))
                                                            proc255_0(28 28)
                                                        )(else
                                                            (if (Said('smell[/man,being,alien,him,bystander,animal,customer]'))
                                                                proc255_0(28 29)
                                                            )(else
                                                                (if (Said('beat[/man,being,alien,him,bystander,animal,customer]'))
                                                                    proc255_0(28 30)
                                                                )(else
                                                                    (if (Said('read/menu'))
                                                                        (if (== local4 0)
                                                                            proc255_0(28 11)
                                                                        )(else
                                                                            = gGEgoX_3 (send gEgo:x)
                                                                            = gGEgoY_2 (send gEgo:y)
                                                                            (send global2:newRoom(280))
                                                                        )
                                                                    )(else
                                                                        (if (Said('open,enter,board,climb,(get<in)[/door,door,craft]') or Said('disembark'))
                                                                            (if (not (send gEgo:inRect(179 72 251 95)))
                                                                                proc255_0(28 31)
                                                                            )(else
                                                                                (if ((send gEgo:has(17)))
                                                                                    proc255_0(28 32)
                                                                                )(else
                                                                                    (if (global101)
                                                                                        (self:setScript(VomitScript))
                                                                                    )(else
                                                                                        (self:setScript(OutScript))
                                                                                    )
                                                                                )
                                                                            )
                                                                        )
                                                                    )
                                                                )
                                                            )
                                                        )
                                                    )
                                                )
                                            )
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
            )
            (case 64
                (if (== local4 0)
                    (switch ((send pEvent:message))
                        (case 1
                            (send global2:setScript(StandUp))
                            (send pEvent:claimed(1))
                        )
                        (case 3
                            (send pEvent:claimed(1))
                            return 
                        )
                        (case 5
                            (send pEvent:claimed(1))
                            return 
                        )
                        (case 8
                            (send global2:setScript(StandUp))
                            (send pEvent:claimed(1))
                        )
                        (case 2
                            (send pEvent:claimed(1))
                            return 
                        )
                        (case 4
                            (send pEvent:claimed(1))
                            return 
                        )
                        (case 6
                            (send pEvent:claimed(1))
                            return 
                        )
                        (case 7
                            (send global2:setScript(StandUp))
                            (send pEvent:claimed(1))
                        )
                        (case 0
                            (send pEvent:claimed(1))
                            return 
                        )
                    )
                )
            )
            (case 1
                (if ((== local4 0) and not (send pEvent:claimed))
                    (send global2:setScript(StandUp))
                    (send pEvent:claimed(1))
                )
            )
        )
    )


    (method (newRoom newRoomNumber)
        (if (<> newRoomNumber 29)
            (send gLongSong:fade())
        )
        (super:newRoom(newRoomNumber))
    )

)
(instance SitDown of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gEgo:
                    view(213)
                    illegalBits(0)
                    posn(168 127)
                    setLoop(7)
                    setPri(14)
                    setCel(0)
                )
                (if ((send gEgo:has(17)))
                    (send gEgo:setCycle(End self))
                )(else
                    (send gEgo:setCycle(CT 4 1 self))
                )
            )
            (case 1
                proc0_3()
                = local4 0
                (send global2:setScript(0))
            )
        )
    )

)
(instance StandUp of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (if (== local5 0)
                    (bag2:
                        init()
                        stopUpd()
                    )
                    (send gEgo:put(17))
                )
                (send gEgo:
                    setLoop(7)
                    setCel(4)
                    setCycle(Beg self)
                )
            )
            (case 1
                proc0_10()
                proc0_1(2 0)
                (send gEgo:posn(166 125))
                = local4 1
                proc0_3()
                (send global2:setScript(0))
            )
        )
    )

)
(instance EgoEating of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                = global159 1
                = local6 7
                (send gEgo:
                    setLoop(0)
                    setCel(0)
                    setCycle(End self)
                )
            )
            (case 1
                (if (<> --local6 0)
                    (switch (Random(1 2))
                        (case 1
                            (self:changeState(10))
                        )
                        (case 2
                            (self:changeState(20))
                        )
                    )
                )(else
                    (if (global249)
                        (self:changeState(30))
                    )(else
                        (self:changeState(40))
                    )
                )
            )
            (case 10
                (send gEgo:
                    setLoop(1)
                    setCel(0)
                    setCycle(End self)
                )
            )
            (case 11
                (send gEgo:setCycle(Beg self))
            )
            (case 12
                (send gEgo:
                    setLoop(2)
                    setCycle(Fwd)
                )
                = seconds 2
            )
            (case 13
                (send gEgo:
                    setLoop(3)
                    setCycle(End self)
                )
            )
            (case 14
                (send gEgo:
                    setLoop(2)
                    setCel(0)
                )
                = cycles 10
            )
            (case 15
                (self:changeState(1))
            )
            (case 20
                (send gEgo:
                    setLoop(4)
                    setCel(0)
                    setCycle(End self)
                )
            )
            (case 21
                (send gEgo:
                    setLoop(5)
                    setCycle(Fwd)
                )
                = seconds 3
            )
            (case 22
                (send gEgo:
                    setLoop(4)
                    setCel(2)
                    setCycle(Beg self)
                )
            )
            (case 23
                (send gEgo:
                    setLoop(2)
                    setCel(0)
                )
                = cycles 10
            )
            (case 24
                (self:changeState(1))
            )
            (case 30
                (send gEgo:
                    setLoop(1)
                    setCel(0)
                    setCycle(End self)
                )
            )
            (case 31
                (send gEgo:setCycle(Beg self))
            )
            (case 32
                (send gEgo:
                    setLoop(2)
                    setCycle(Fwd)
                )
                = seconds 4
            )
            (case 33
                proc255_0(28 33)
                (send gEgo:get(7))
                (send global1:changeScore(10))
                = seconds 3
            )
            (case 34
                (self:changeState(40))
            )
            (case 40
                proc255_0(28 34)
                (send gEgo:setCycle(0))
                (User:canInput(1))
                = global159 0
                = global249 0
                = global244 0
                (send gEgo:put(17))
                = local5 0
                = local4 0
                (send global2:setScript(0))
            )
        )
    )

)
(instance dockScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (ship:setMotion(MoveTo 286 125 self))
            )
            (case 1
                (ship:setMotion(MoveTo 286 115 self))
            )
            (case 2
                (collar:
                    setCycle(Beg self)
                    startUpd()
                )
                (ship:stopUpd())
            )
            (case 3
                (collar:stopUpd())
                = global206 0
                = seconds 2
            )
            (case 4
                proc255_0(28 35 67 -1 130 70 280)
                proc0_3()
                = cycles 2
            )
            (case 5
                (chairMan:
                    init()
                    setCycle(End self)
                )
            )
            (case 6
                (chairMan:stopUpd())
                = seconds 2
            )
            (case 7
                proc255_0(28 36)
                (send gEgo:
                    view(0)
                    setLoop(-1)
                    loop(1)
                    posn(173 93)
                    setStep(3 2)
                    setCycle(Walk)
                    illegalBits(-32768)
                    setPri(-1)
                    init()
                )
                (if ((send global5:contains(gEgo)))
                    (send gEgo:show())
                )(else
                    (send gEgo:init())
                )
                proc0_3()
                = local0 1
                (send global2:setScript(0))
            )
        )
    )

)
(instance OutScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gEgo:setMotion(MoveTo 202 82 self))
            )
            (case 1
                = global159 1
                (chairMan:setCycle(Beg self))
                (send gEgo:hide())
            )
            (case 2
                = local0 4
                (chairMan:dispose())
                proc0_10()
                proc255_0(28 37 67 -1 130 70 280)
                (ship:setMotion(MoveTo 286 125 self))
            )
            (case 3
                (ship:setMotion(MoveTo 335 174 self))
            )
            (case 4
                = global206 3
                = global159 0
                (send global2:newRoom(14))
            )
        )
    )

)
(instance VomitScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gEgo:
                    view(137)
                    setLoop(0)
                    illegalBits(0)
                    setMotion(MoveTo 168 93 self)
                )
            )
            (case 1
                (send gEgo:setMotion(MoveTo 134 105 self))
            )
            (case 2
                (send gEgo:
                    setCel(0)
                    setLoop(1)
                    setCycle(End self)
                )
            )
            (case 3
                = cycles 10
            )
            (case 4
                (send gEgo:setCycle(End self))
            )
            (case 5
                = cycles 10
            )
            (case 6
                (send gEgo:setCycle(End self))
            )
            (case 7
                (send gEgo:
                    view(0)
                    loop(1)
                    setLoop(-1)
                    illegalBits(-32768)
                    setCycle(Walk)
                )
                = seconds 2
            )
            (case 8
                proc255_0(28 38)
                = global101 0
                proc0_3()
                (send client:setScript(0))
            )
        )
    )

)
(instance CrowdScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (pow:
                    init()
                    setPri(14)
                    posn((send gEgo:x) - (send gEgo:y) 40)
                    setCycle(End self)
                )
                (send gEgo:
                    view(64)
                    setLoop(2)
                    setCel(0)
                    setCycle(End self)
                    xStep(6)
                    setMotion(MoveTo + (send gEgo:x) 30 (send gEgo:y))
                )
            )
            (case 1
                (pow:dispose())
                (balloon:
                    init()
                    setPri(14)
                    posn((send gEgo:x) - (send gEgo:y) 40)
                )
                = seconds 2
            )
            (case 2
                (send gEgo:
                    setLoop(3)
                    setCel(0)
                    setCycle(End self)
                )
            )
            (case 3
                (balloon:dispose())
                (send gEgo:
                    view(0)
                    setLoop(-1)
                    loop(1)
                    setCycle(Walk)
                    cycleSpeed(0)
                    xStep(3)
                    setDirection(0)
                )
                proc0_3()
                (send client:setScript(0))
            )
        )
    )

)
(instance AlienScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                = seconds Random(3 10)
            )
            (case 1
                (if ((local2 or (<> (send gEgo:mover) 0)) or (<> (rm028:script) 0))
                    (self:changeState(4))
                )(else
                    = cycles 2
                )
            )
            (case 2
                = local2 1
                (switch (= local7 Random(0 4))
                    (case 0
                        (al1:setCycle(Fwd))
                    )
                    (case 1
                        (arm:setCycle(Fwd))
                    )
                    (case 2
                        (tail:setCycle(Fwd))
                    )
                    (case 3
                        (sa2:setCycle(Fwd))
                    )
                    (case 4
                        (sa3Mouth:setCycle(Fwd))
                    )
                )
                = seconds 3
            )
            (case 3
                (switch (local7)
                    (case 0
                        (al1:
                            setCycle(0)
                            stopUpd()
                        )
                    )
                    (case 1
                        (arm:
                            setCycle(0)
                            stopUpd()
                        )
                    )
                    (case 2
                        (tail:
                            setCycle(0)
                            stopUpd()
                        )
                    )
                    (case 3
                        (sa2:
                            setCycle(0)
                            stopUpd()
                        )
                    )
                    (case 4
                        (sa3Mouth:
                            setCycle(0)
                            stopUpd()
                        )
                    )
                )
                = local2 0
                = cycles 2
            )
            (case 4
                = cycles 2
            )
            (case 5
                (self:changeState(1))
            )
        )
    )

)
(instance sa1Script of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                = seconds Random(1 5)
            )
            (case 1
                (if ((local2 or (<> (send gEgo:mover) 0)) or (<> (rm028:script) 0))
                    (self:changeState(13))
                )(else
                    = cycles 2
                )
            )
            (case 2
                = local2 1
                (switch (Random(1 3))
                    (case 1
                        (self:changeState(3))
                    )
                    (case 2
                        (self:changeState(6))
                    )
                    (case 3
                        (self:changeState(9))
                    )
                )
            )
            (case 3
                (sa1:
                    setLoop(0)
                    setCycle(End)
                )
                = seconds 3
            )
            (case 4
                (sa1:setCycle(Beg self))
            )
            (case 5
                (self:changeState(12))
            )
            (case 6
                (sa1:
                    setLoop(1)
                    setCycle(End self)
                )
            )
            (case 7
                (sa1:
                    setLoop(2)
                    setCycle(Fwd)
                )
                = seconds 3
            )
            (case 8
                (sa1:setLoop(0))
                (self:changeState(12))
            )
            (case 9
                (sa1:
                    setLoop(3)
                    setCycle(End self)
                )
            )
            (case 10
                (sa1:
                    setLoop(4)
                    setCycle(Fwd)
                )
                = seconds 3
            )
            (case 11
                (sa1:setLoop(0))
                (self:changeState(12))
            )
            (case 12
                (sa1:
                    setLoop(0)
                    setCycle(0)
                    stopUpd()
                )
                = local2 0
                = seconds Random(10 20)
            )
            (case 13
                = cycles 2
            )
            (case 14
                (self:changeState(1))
            )
        )
    )

)
(instance bag2 of View
    (properties)

    (method (init)
        (super:init())
        (self:
            view(213)
            setLoop(6)
            setCel(0)
            posn(176 140)
            setPri(15)
            ignoreActors(1)
        )
    )

)
(instance collar of Prop
    (properties)

    (method (init)
        (super:init())
        (self:
            view(44)
            setLoop(0)
            posn(286 90)
            setPri(6)
            ignoreActors(1)
        )
    )

)
(instance ship of Act
    (properties)

    (method (init)
        (super:init())
        (self:
            view(44)
            setLoop(1)
            setPri(5)
            setStep(1 1)
            illegalBits(0)
            ignoreActors(1)
        )
    )

)
(instance al1 of Prop
    (properties)

    (method (init)
        (super:init())
        (self:
            x(30)
            y(128)
            view(43)
            setLoop(1)
            setCel(0)
            setPri(8)
        )
    )

)
(instance al2 of PV
    (properties
        y 137
        x 42
        view 43
        loop 2
        priority 10
    )
)
(instance al3 of PV
    (properties
        y 137
        x 11
        view 43
        loop 3
        priority 10
    )
)
(instance al4 of PV
    (properties
        y 137
        x 69
        view 43
        loop 4
    )
)
(instance al5 of PV
    (properties
        y 121
        x 95
        view 43
        loop 4
        cel 1
    )
)
(instance slop of PV
    (properties
        y 171
        x 22
        view 43
        loop 7
        priority 15
        signal 16384
    )
)
(instance sa3 of PV
    (properties
        y 145
        x 145
        view 53
        loop 6
        priority 14
    )
)
(instance arm of Prop
    (properties)

    (method (init)
        (super:init())
        (self:
            view(43)
            setLoop(5)
            setCel(0)
            x(70)
            y(128)
            setPri(10)
        )
    )

)
(instance tail of Prop
    (properties)

    (method (init)
        (super:init())
        (self:
            view(43)
            setLoop(6)
            setCel(0)
            x(123)
            y(125)
            setPri(8)
        )
    )

)
(instance sa1 of Prop
    (properties)

    (method (init)
        (super:init())
        (self:
            view(53)
            setLoop(0)
            setCel(0)
            x(88)
            y(160)
            setPri(14)
        )
    )

)
(instance sa2 of Prop
    (properties)

    (method (init)
        (super:init())
        (self:
            view(53)
            setLoop(5)
            setCel(0)
            x(118)
            y(151)
            setPri(14)
        )
    )

)
(instance sa3Mouth of Prop
    (properties)

    (method (init)
        (super:init())
        (self:
            view(53)
            setLoop(7)
            setCel(0)
            x(141)
            y(142)
            setPri(15)
        )
    )

)
(instance chairMan of Prop
    (properties)

    (method (init)
        (super:init())
        (self:
            view(44)
            setLoop(2)
            posn(263 109)
            setPri(6)
            ignoreActors(1)
        )
    )

)
(instance pow of Prop
    (properties)

    (method (init)
        (super:init())
        (self:
            view(64)
            setLoop(0)
            setCel(0)
            ignoreActors(1)
        )
    )

)
(instance balloon of Prop
    (properties)

    (method (init)
        (super:init())
        (self:
            view(64)
            setLoop(1)
            setCel(0)
            ignoreActors(1)
        )
    )

)
(instance door of Prop
    (properties)

    (method (init)
        (super:init())
        (self:
            view(43)
            setLoop(0)
            setCel(0)
            posn(164 95)
            setPri(6)
            ignoreActors(1)
        )
    )


    (method (doit)
        (super:doit())
        (if ((== (send gEgo:onControl(0)) 2) or (== (send gEgo:onControl(0)) 3))
            (if (> local1 1)
                = local1 1
                (self:setCycle(End self))
            )
        )(else
            (if (< local1 2)
                = local1 3
                (self:setCycle(Beg self))
            )
        )
    )


    (method (cue)
        (door:stopUpd())
        = local1 
            (if (== local1 1)
                0
            )(else
                2
            )
    )

)
