(version 2)
(include "sci.sh")
(exports
    0 rm43
)
(use "Main")
(use "Class_255_0")
(use "Chase")
(use "Avoid")
(use "Sound")
(use "Cycle")
(use "Game")
(use "User")
(use "Feature")
(use "Obj")
(script 43)


(local
    local0
    newProp
    newProp_2
    newProp_3
    local4
    newAct
    newSound

)
(class BView of View
    (properties
        y 0
        x 0
        z 0
        heading 0
        yStep 2
        view 0
        loop 0
        cel 0
        priority 0
        underBits 0
        signal 257
        nsTop 0
        nsLeft 0
        nsBottom 0
        nsRight 0
        lsTop 0
        lsLeft 0
        lsBottom 0
        lsRight 0
        brTop 0
        brLeft 0
        brBottom 0
        brRight 0
    )

    (method (delete)
        = signal (& signal $ffdf)
        (super:delete())
    )

)
(instance footPrint of BView
    (properties)
)
(instance public rm43 of Rm
    (properties
        picture 43
        style 7
        east 44
        south 47
        west 42
    )

    (method (init)
        (User:
            canInput(1)
            canControl(0)
        )
        proc0_1()
        (if (not global152)
            Load(128 66)
            Load(128 67)
        )
        Load(128 70)
        Load(128 121)
        Load(132 13)
        (super:init())
        (w:init())
        (orld:
            init()
            addToPic()
        )
        (o:
            init()
            addToPic()
        )
        (wonder:
            init()
            addToPic()
        )
        (if ((== global110 1) or (== global110 2))
            (send gEgo:observeControl(16384))
            (door:
                view(121)
                loop(0)
                cel(0)
                posn(157 118)
                init()
                stopUpd()
            )
        )
        (switch (global110)
            (case 1
                (if (== Random(1 3) 2)
                    = gNewAct (Act:new())
                    (send gNewAct:
                        posn(1000 1000)
                        init()
                    )
                    = gSeconds Random(2 10)
                )
            )
            (case 2
                = gNewAct (Act:new())
                (send gNewAct:
                    posn(1000 1000)
                    init()
                )
                = gSeconds 3
            )
        )
        (if ((send global5:contains(gNewAct)))
            (send gNewAct:
                view(106)
                setCycle(Walk)
                observeControl(2)
                posn(1000 1000)
                hide()
                init()
            )
            (switch (global12)
                (case east
                    (send gNewAct:posn(359 140))
                )
                (case west
                    (send gNewAct:posn(-40 140))
                )
                (case south
                    (send gNewAct:posn(160 249))
                )
            )
            = global110 1
            (self:setScript(tActions))
        )
        (if (not global152)
            (car:init())
            (shadow:init())
            proc0_2()
            (self:setScript(kid1Script))
        )(else
            (if (<> (send gLongSong:number) 22)
                (send gLongSong:
                    number(22)
                    priority(1)
                    loop(-1)
                    play()
                )
            )
            (send gEgo:
                view(0)
                setStep(3 2)
                illegalBits(-32768)
                init()
            )
            (switch (global12)
                (case 42
                    (send gEgo:posn(2 (send gEgo:y)))
                )
                (case 44
                    (if (< (send gEgo:y) 110)
                        (send gEgo:posn(317 110))
                    )(else
                        (send gEgo:posn(317 (send gEgo:y)))
                    )
                )
                (case 47
                    (send gEgo:posn((send gEgo:x) 187))
                )
                (case 470
                    (send gEgo:
                        view(
                            (if (global130)
                                138
                            )(else
                                0
                            )
)
                        posn(158 125)
                        loop(2)
                        cel(0)
                    )
                    (if (global130)
                        Load(128 755)
                    )
                    (if (== global110 0)
                        proc0_2()
                        = global110 1
                        (self:setScript(terminatorGrabs))
                        Load(129 430)
                        Load(128 107)
                        Load(128 121)
                    )(else
                        (if (global130)
                            (self:setScript(hatTrick))
                        )
                    )
                )
                (default 
                    (send gEgo:posn(160 187))
                )
            )
            (if (<> (send global2:script) terminatorGrabs)
                proc0_3()
            )
        )
        = local0 1
    )


    (method (doit)
        (var temp0[30])
        (super:doit())
        (if (<> global11 global13)
            return 
        )
        (if ((== (send gEgo:onControl(0)) 4) or (== (send gEgo:onControl(0)) 5))
            (self:newRoom(470))
        )
        (if (== --local0 0)
            (if (== (w:cel) 0)
                (w:cel(1))
            )(else
                (w:cel(0))
            )
            = local0 Random(1 4)
        )
    )


    (method (handleEvent pEvent)
        (if ((send pEvent:claimed))
            return 
        )
        (switch ((send pEvent:type))
            (case 128
                (if (Said('look/leg'))
                    proc255_0(43 0)
                )(else
                    (if (Said('look/feet,s'))
                        proc255_0(43 1)
                    )(else
                        (if ((Said('devil,s') or Said('/devil,s')) or Said('//devil,s'))
                            proc255_0(43 2)
                        )(else
                            (if (Said('look/door,entrance,door'))
                                (if ((send global5:contains(door)))
                                    proc255_0(43 3)
                                )(else
                                    proc255_0(43 4)
                                )
                            )(else
                                (if (Said('knock/door'))
                                    (if ((send global5:contains(door)))
                                        (if (< (send gEgo:distanceTo(door)) 10)
                                            proc255_0(43 5)
                                        )(else
                                            proc0_5()
                                        )
                                    )(else
                                        proc255_0(43 6)
                                    )
                                )(else
                                    (if (Said('open/door'))
                                        (if ((send global5:contains(door)))
                                            (if (< (send gEgo:distanceTo(door)) 10)
                                                proc255_0(43 7)
                                            )(else
                                                proc0_5()
                                            )
                                        )(else
                                            proc255_0(43 6)
                                        )
                                    )(else
                                        (if (Said('get/cap') or Said('get<up/cap'))
                                            (if ((send gEgo:has(6)))
                                                proc255_0(43 8)
                                            )(else
                                                proc255_0(43 9)
                                            )
                                        )(else
                                            (if (Said('look/box,table,glass,animal,animal,lawn,slime,display'))
                                                (if ((send gEgo:inRect(189 110 246 130)))
                                                    proc255_0(43 10)
                                                )(else
                                                    proc255_0(43 11)
                                                )
                                            )(else
                                                (if (Said('break/box,glass'))
                                                    (if ((send gEgo:inRect(189 110 246 130)))
                                                        proc255_0(43 12)
                                                    )(else
                                                        proc0_5()
                                                    )
                                                )(else
                                                    (if (Said('open/box'))
                                                        (if (== (send global2:script) tActions)
                                                            proc255_0(43 13)
                                                        )(else
                                                            (if ((send gEgo:inRect(189 110 246 130)))
                                                                (send global2:setScript(AlienDeath))
                                                            )(else
                                                                proc255_0(43 14)
                                                            )
                                                        )
                                                    )(else
                                                        (if (Said('read,look/menace[<neon,flashing]'))
                                                            (if ((send global5:contains(door)) and (send gEgo:inRect(102 90 246 143)))
                                                                proc255_0(43 15)
                                                            )(else
                                                                proc255_0(43 16)
                                                                (if ((send global5:contains(door)))
                                                                    proc255_0(43 17)
                                                                )
                                                            )
                                                        )(else
                                                            (if ((Said('look/area') or Said('look/building,hill,animal')) or Said('look[<around][/!*]'))
                                                                proc255_0(43 18)
                                                            )
                                                        )
                                                    )
                                                )
                                            )
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
            )
            (case 4
                (if (((((== (send pEvent:type) 4) and (== (send pEvent:message) 13)) and (== (send global2:script) terminatorGrabs)) and (<= 5 (terminatorGrabs:state))) and (<= (terminatorGrabs:state) 8))
                    proc0_12()
                    (send pEvent:claimed(1))
                    (terminatorGrabs:seconds(0))
                    (terminatorGrabs:cue())
                )
            )
        )
    )


    (method (newRoom newRoomNumber)
        (if (not script or (== script tActions))
            (send gEgo:illegalBits(-32768))
            (if (<> newRoomNumber 470)
                (send gLongSong:
                    owner(-1)
                    number(22)
                    priority(0)
                    loop(-1)
                    play()
                )
            )(else
                (if (== (send gLongSong:number) 22)
                    (send gLongSong:fade())
                )
            )
            (if ((send global5:contains(gNewAct)) and (< (send gEgo:distanceTo(gNewAct)) 120))
                = global110 2
            )
            DisposeScript(988)
            (if (not global155)
                (super:newRoom(newRoomNumber))
            )
        )
    )

)
(instance kid1Script of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gLongSong:
                    number(13)
                    priority(3)
                    loop(-1)
                    play()
                )
                (kid1:
                    init()
                    setMotion(MoveTo 188 137 self)
                )
            )
            (case 1
                (car:setScript(kid2Script))
                (kid1:setMotion(MoveTo 246 160 self))
            )
            (case 2
                (kid1:dispose())
            )
        )
    )

)
(instance kid2Script of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (kid2:
                    init()
                    setMotion(MoveTo 188 137 self)
                )
            )
            (case 1
                (send global2:setScript(momScript))
                (kid2:setMotion(MoveTo 246 160 self))
            )
            (case 2
                (kid2:dispose())
            )
        )
    )

)
(instance momScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (mom:
                    init()
                    setMotion(MoveTo 197 142 self)
                )
            )
            (case 1
                (mom:setMotion(MoveTo 284 149 self))
            )
            (case 2
                (car:setScript(popScript))
                (mom:setMotion(MoveTo 284 160 self))
            )
            (case 3
                (mom:dispose())
            )
        )
    )

)
(instance popScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (pop:
                    init()
                    setMotion(MoveTo 152 120 self)
                )
            )
            (case 1
                (pop:setMotion(MoveTo 196 146 self))
            )
            (case 2
                (pop:
                    loop(4)
                    cel(0)
                    setCycle(Walk)
                )
                = cycles 2
            )
            (case 3
                (pballoon:init())
                (pop:
                    cycleSpeed(1)
                    setCycle(End self)
                )
            )
            (case 4
                (pballoon:dispose())
                (pop:
                    loop(3)
                    cycleSpeed(0)
                    setCycle(Fwd)
                    setMotion(MoveTo 284 160 self)
                )
                (send global2:setScript(festerScript))
            )
            (case 5
                (pop:dispose())
            )
        )
    )

)
(instance festerScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (fester:
                    init()
                    setMotion(MoveTo 185 137 self)
                )
            )
            (case 1
                (fester:
                    loop(1)
                    setCycle(End self)
                )
            )
            (case 2
                (fester:
                    loop(4)
                    setCycle(Fwd)
                )
                (fballoon:init())
                (send gEgo:setScript(carScript))
                = seconds 4
            )
            (case 3
                (fballoon:cel(1))
                = seconds 4
            )
            (case 4
                (fballoon:dispose())
                (fester:
                    loop(1)
                    cel(2)
                    setCycle(Beg self)
                )
            )
            (case 5
                (fester:
                    loop(2)
                    setCycle(Walk)
                    setMotion(MoveTo 141 108 self)
                )
            )
            (case 6
                (fester:dispose())
                (send gEgo:
                    init()
                    view(0)
                    setStep(3 2)
                )
                (switch (global12)
                    (case 42
                        (send gEgo:
                            posn(-5 (send gEgo:y))
                            setMotion(MoveTo 5 (send gEgo:y) self)
                        )
                    )
                    (case 44
                        (if (< (send gEgo:y) 110)
                            (send gEgo:posn(324 110))
                        )(else
                            (send gEgo:posn(324 (send gEgo:y)))
                        )
                        (send gEgo:setMotion(MoveTo 314 (send gEgo:y) self))
                    )
                    (case 47
                        (send gEgo:
                            posn((send gEgo:x) 222)
                            setMotion(MoveTo (send gEgo:x) 186 self)
                        )
                    )
                    (default 
                        (send gEgo:
                            posn(160 222)
                            setMotion(MoveTo 166 186 self)
                        )
                    )
                )
            )
            (case 7
                proc0_3()
                (send client:setScript(0))
                = global152 1
            )
        )
    )

)
(instance carScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (car:setMotion(MoveTo 278 160 self))
                (shadow:setMotion(MoveTo 287 191))
            )
            (case 1
                (car:
                    xStep(10)
                    setMotion(MoveTo 368 160 self)
                )
                (shadow:
                    xStep(10)
                    setMotion(MoveTo 368 191)
                )
            )
            (case 2
                (car:dispose())
                (shadow:dispose())
                (dust:
                    init()
                    setCycle(End self)
                )
            )
            (case 3
                (dust:dispose())
                (self:dispose())
            )
        )
    )

)
(instance AlienDeath of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (if (< (send gEgo:y) 126)
                    (send gEgo:setMotion(MoveTo (send gEgo:x) 126 self))
                )(else
                    = cycles 2
                )
            )
            (case 1
                (send gEgo:setMotion(MoveTo 228 126 self))
            )
            (case 2
                (send gEgo:
                    view(84)
                    setLoop(0)
                    setCel(255)
                    posn(228 126)
                    ignoreControl()
                    setMotion(0)
                    setCycle(End self)
                )
            )
            (case 3
                = seconds 2
            )
            (case 4
                (send gEgo:
                    setLoop(1)
                    setCel(255)
                    setCycle(End self)
                )
            )
            (case 5
                (send gEgo:
                    setLoop(2)
                    setCel(0)
                    setCycle(Fwd)
                    setMotion(MoveTo 218 133 self)
                )
            )
            (case 6
                (send gEgo:setMotion(MoveTo 177 133 self))
            )
            (case 7
                (send gEgo:setMotion(MoveTo 173 151 self))
            )
            (case 8
                (send gEgo:setMotion(MoveTo 197 135 self))
            )
            (case 9
                (send gEgo:setMotion(MoveTo 175 150 self))
            )
            (case 10
                (send gEgo:
                    setLoop(3)
                    setCel(255)
                    setCycle(End self)
                )
            )
            (case 11
                (send gEgo:
                    setLoop(4)
                    setCel(255)
                    setCycle(End self)
                )
            )
            (case 12
                proc255_0(43 19)
                = global197 1
            )
        )
    )

)
(instance car of Act
    (properties)

    (method (init)
        (super:init())
        (self:
            view(66)
            setLoop(0)
            setCel(0)
            setPri(15)
            posn(278 175)
            xStep(1)
            ignoreActors()
        )
    )


    (method (handleEvent pEvent)
        (if ((send pEvent:claimed))
            return 
        )
        (switch ((send pEvent:type))
            (case 128
                (if (Said('look/car'))
                    proc255_0(43 20)
                )
            )
        )
    )

)
(instance shadow of Act
    (properties)

    (method (init)
        (super:init())
        (self:
            view(66)
            setLoop(0)
            setCel(1)
            setPri(14)
            posn(280 176)
            xStep(1)
            ignoreActors()
        )
    )

)
(instance kid1 of Act
    (properties)

    (method (init)
        (super:init())
        (self:
            view(66)
            setLoop(2)
            setCel(0)
            posn(139 109)
            xStep(6)
            yStep(3)
            setCycle(Fwd)
            ignoreActors()
        )
    )


    (method (handleEvent pEvent)
        (if ((send pEvent:claimed))
            return 
        )
        (switch ((send pEvent:type))
            (case 128
                (if (Said('look/boy'))
                    proc255_0(43 21)
                )
            )
        )
    )

)
(instance kid2 of Act
    (properties)

    (method (init)
        (super:init())
        (self:
            view(66)
            setLoop(2)
            setCel(0)
            posn(139 109)
            xStep(6)
            yStep(3)
            setCycle(Fwd)
            ignoreActors()
        )
    )


    (method (handleEvent pEvent)
        (if ((send pEvent:claimed))
            return 
        )
        (switch ((send pEvent:type))
            (case 128
                (if (Said('look/boy'))
                    proc255_0(43 21)
                )
            )
        )
    )

)
(instance mom of Act
    (properties)

    (method (init)
        (super:init())
        (self:
            view(66)
            setLoop(5)
            setCel(0)
            posn(144 109)
            setCycle(Fwd)
            xStep(5)
            yStep(3)
            ignoreActors()
        )
    )


    (method (handleEvent pEvent)
        (if ((send pEvent:claimed))
            return 
        )
        (switch ((send pEvent:type))
            (case 128
                (if (Said('look/mom'))
                    proc255_0(43 22)
                )
            )
        )
    )

)
(instance pop of Act
    (properties)

    (method (init)
        (super:init())
        (self:
            view(66)
            setLoop(3)
            setCel(0)
            posn(142 111)
            setCycle(Fwd)
            xStep(5)
            yStep(3)
            ignoreActors()
        )
    )


    (method (handleEvent pEvent)
        (if ((send pEvent:claimed))
            return 
        )
        (switch ((send pEvent:type))
            (case 128
                (if (Said('look/dad,man,alien'))
                    proc255_0(43 23)
                )
            )
        )
    )

)
(instance fester of Act
    (properties)

    (method (init)
        (super:init())
        (self:
            view(67)
            setLoop(0)
            setCel(0)
            posn(141 108)
            xStep(3)
            yStep(2)
            setCycle(Fwd)
            ignoreActors()
        )
    )


    (method (handleEvent pEvent)
        (if ((send pEvent:claimed))
            return 
        )
        (switch ((send pEvent:type))
            (case 128
                (if (Said('look/man,blatz'))
                    proc255_0(43 24)
                )
            )
        )
    )

)
(instance fballoon of Prop
    (properties)

    (method (init)
        (super:init())
        (self:
            view(67)
            setLoop(3)
            setCel(0)
            setPri(15)
            posn(217 103)
            ignoreActors()
        )
    )

)
(instance pballoon of Prop
    (properties)

    (method (init)
        (super:init())
        (self:
            view(66)
            setLoop(6)
            setCel(0)
            setPri(15)
            posn(168 123)
            stopUpd()
            ignoreActors()
        )
    )

)
(instance dust of Prop
    (properties)

    (method (init)
        (super:init())
        (self:
            view(66)
            setLoop(1)
            setCel(0)
            setPri(15)
            posn(287 166)
            ignoreActors()
        )
    )

)
(instance w of Prop
    (properties)

    (method (init)
        (super:init())
        (self:
            view(70)
            setLoop(1)
            setCel(0)
            setPri(15)
            posn(95 34)
            ignoreActors()
        )
    )

)
(instance orld of View
    (properties)

    (method (init)
        (super:init())
        (self:
            view(70)
            setLoop(0)
            setCel(0)
            posn(116 35)
            setPri(14)
            stopUpd()
        )
    )

)
(instance o of View
    (properties)

    (method (init)
        (super:init())
        (self:
            view(70)
            setLoop(0)
            setCel(1)
            posn(155 36)
            setPri(14)
            stopUpd()
        )
    )

)
(instance wonder of View
    (properties)

    (method (init)
        (super:init())
        (self:
            view(70)
            setLoop(0)
            setCel(2)
            posn(178 61)
            setPri(14)
            stopUpd()
        )
    )

)
(instance door of View
    (properties)
)
(instance terminatorGrabs of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                Load(128 106)
                (send gEgo:setMotion(MoveTo 181 157 self))
            )
            (case 1
                proc0_2()
                = gNewAct (Act:new())
                (send gNewAct:
                    ignoreActors()
                    illegalBits(0)
                    posn((send gEgo:x) (send gEgo:y))
                )
                (if (global130)
                    = global130 0
                    proc0_14(6 -1)
                    = newAct (Act:new())
                    (send newAct:
                        view(755)
                        posn((send gEgo:x) - (send gEgo:y) 10)
                        setAvoider(Avoid)
                        setStep(5 5)
                        setCycle(Fwd)
                        setMotion(MoveTo -10 170)
                        init()
                    )
                )
                (send gEgo:
                    view(106)
                    setLoop(4)
                    cel(255)
                    ignoreHorizon()
                    illegalBits(0)
                    setCycle(End)
                    setPri((send gEgo:priority))
                    setStep(4 4)
                    setMotion(MoveTo + (send gEgo:x) 11 - (send gEgo:y) 15 self)
                )
                proc0_10()
            )
            (case 2
                (send gEgo:
                    setLoop(5)
                    setCycle(Fwd)
                )
                (send gNewAct:
                    view(106)
                    setLoop(6)
                    illegalBits(0)
                    setPri((send gEgo:priority))
                    setCycle(Fwd)
                    init()
                )
                = seconds 2
            )
            (case 3
                (send gNewAct:
                    view(106)
                    setLoop(7)
                    setPri((send gEgo:priority))
                    setCycle(Fwd)
                )
                = seconds 4
            )
            (case 4
                (send gNewAct:setCel(1))
                proc0_10()
                (send global2:drawPic(430))
                (send global5:eachElementDo(140))
                = newProp (Prop:new())
                (send newProp:
                    view(107)
                    setLoop(0)
                    cel(6)
                    posn(61 189)
                    setPri(14)
                    cycleSpeed(0)
                    setScript(mouthActions)
                    init()
                )
                = newProp_2 (Prop:new())
                (send newProp_2:
                    view(107)
                    setLoop(2)
                    posn(149 86)
                    setPri(14)
                    setCycle(Fwd)
                    init()
                )
                = newProp_3 (Prop:new())
                (send newProp_3:
                    view(107)
                    setLoop(1)
                    cel(0)
                    posn(160 52)
                    setPri(14)
                    setScript(eyeActions)
                    init()
                )
                = seconds 3
            )
            (case 5
                (send newProp:
                    cycleSpeed(1)
                    setCycle(Fwd)
                )
                proc255_0(43 25 33 600 67 -1 10 70 300 91)
                = seconds 15
            )
            (case 6
                proc0_12()
                proc255_0(43 26 33 600 67 -1 10 70 300 91)
                = seconds 15
            )
            (case 7
                proc0_12()
                proc255_0(43 27 33 600 67 -1 10 70 300 91)
                = seconds 10
            )
            (case 8
                proc0_12()
                proc255_0(43 28 33 600 67 -1 10 70 300 91)
                = seconds 15
            )
            (case 9
                proc0_12()
                (send global5:eachElementDo(206))
                (send newProp:dispose())
                (send newProp_2:dispose())
                (send newProp_3:dispose())
                (door:
                    view(121)
                    loop(0)
                    cel(0)
                    posn(157 118)
                    init()
                    stopUpd()
                )
                (orld:
                    init()
                    addToPic()
                )
                (o:
                    init()
                    addToPic()
                )
                (wonder:
                    init()
                    addToPic()
                )
                (send global2:drawPic(43))
                = cycles 1
            )
            (case 10
                (send gNewAct:
                    setLoop(7)
                    setCycle(Fwd)
                )
                = seconds 2
            )
            (case 11
                = seconds 2
            )
            (case 12
                (send gNewAct:setLoop(6))
                = seconds 3
            )
            (case 13
                (send gNewAct:hide())
                (send gEgo:
                    cycleSpeed(2)
                    setCycle(Beg)
                    setMotion(MoveTo - (send gEgo:x) 11 + (send gEgo:y) 15 self)
                )
            )
            (case 14
                (send gEgo:
                    view(0)
                    illegalBits(-32768)
                    observeControl(16384)
                    cycleSpeed(0)
                    setCycle(Walk)
                    setLoop(-1)
                    setStep(3 2)
                    setPri(-1)
                    loop(2)
                )
                proc0_3()
                = gSeconds 10
                (send global2:setScript(tActions))
            )
        )
    )

)
(instance tActions of Script
    (properties)

    (method (doit)
        (asm
            lsg     global11
            lag     global13
            ne?     
            bnt     code_1e9f
            ret     
code_1e9f:  lsl     local4
            ldi     1
            eq?     
            bt      code_1eaf
            lsl     local4
            ldi     7
            eq?     
            bnt     code_1f24
code_1eaf:  pushi   #cel
            pushi   0
            lag     gNewAct
            send    4
            push    
            ldi     0
            eq?     
            bt      code_1ee7
            pushi   #loop
            pushi   0
            lag     gNewAct
            send    4
            push    
            ldi     2
            lt?     
            bnt     code_1ed9
            pushi   #cel
            pushi   0
            lag     gNewAct
            send    4
            push    
            ldi     4
            eq?     
            jmp     code_1ee4
code_1ed9:  pushi   #cel
            pushi   0
            lag     gNewAct
            send    4
            push    
            ldi     3
            eq?     
code_1ee4:  bnt     code_1f24
code_1ee7:  pushi   #view
            pushi   1
            pushi   106
            pushi   6
            pushi   1
            pushi   #loop
            pushi   0
            lag     gNewAct
            send    4
            push    
            pushi   7
            pushi   1
            pushi   #cel
            pushi   0
            lag     gNewAct
            send    4
            push    
            pushi   199
            pushi   2
            pushi   #x
            pushi   0
            lag     gNewAct
            send    4
            push    
            pushi   #y
            pushi   0
            lag     gNewAct
            send    4
            push    
            pushi   205
            pushi   1
            pushi   1
            pushi   207
            pushi   0
            lofsa   footPrint
            send    36
code_1f24:  pushi   #doit
            pushi   0
            super   Script, 4
            ret     
        )
    )


    (method (changeState newState)
        (switch (= state newState)
            (case 0
                Load(128 106)
                = seconds gSeconds
            )
            (case 1
                (send gNewAct:
                    view(106)
                    setLoop(-1)
                    setCycle(Walk)
                    illegalBits(-32768)
                    observeControl(16384)
                    show()
                    setMotion(Chase gEgo 10 self)
                    setAvoider(Avoid)
                )
                = local4 1
            )
            (case 2
                proc0_2()
                = local4 10
                (send gNewAct:posn((send gEgo:x) (send gEgo:y)))
                (send gEgo:
                    view(106)
                    setLoop(4)
                    cel(255)
                    ignoreHorizon()
                    illegalBits(0)
                    setCycle(End)
                    setPri((send gEgo:priority))
                    setStep(4 4)
                    setMotion(MoveTo + (send gEgo:x) 11 - (send gEgo:y) 15 self)
                )
            )
            (case 3
                (send gEgo:
                    setLoop(5)
                    setCycle(Fwd)
                )
                (send gNewAct:
                    view(106)
                    setLoop(6)
                    illegalBits(0)
                    setPri((send gEgo:priority))
                    setCycle(Fwd)
                    show()
                )
                = seconds 4
            )
            (case 4
                (send gNewAct:
                    view(106)
                    setLoop(7)
                    setPri((send gEgo:priority))
                    setCycle(Fwd)
                )
                = seconds 5
            )
            (case 5
                (send gEgo:hide())
                = newSound (Sound:new())
                (send newSound:
                    number(97)
                    loop(-1)
                    priority(3)
                    play()
                )
                (send gNewAct:
                    setLoop(8)
                    setCycle(Fwd)
                )
                = seconds 6
            )
            (case 6
                (send newSound:stop())
                (send gNewAct:
                    setLoop(8)
                    setCel(0)
                )
                proc0_17(901 0 14 16)
            )
        )
    )

)
(instance eyeActions of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send newProp_3:cel(1))
                = cycles Random(4 10)
            )
            (case 1
                (send newProp_3:cel(0))
                = state -1
                = cycles Random(10 60)
            )
        )
    )

)
(instance mouthActions of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send newProp:setCycle(Fwd))
                = seconds Random(4 12)
            )
            (case 1
                (send newProp:
                    setCycle(0)
                    cel(1)
                )
                = state -1
                = cycles Random(7 15)
            )
        )
    )

)
(instance hatTrick of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gEgo:setMotion(MoveTo 181 157 self))
            )
            (case 1
                proc255_0(43 29)
                (send gEgo:view(0))
                = global130 0
                proc0_3()
                (send global2:setScript(0))
            )
        )
    )

)
