(version 2)
(include "sci.sh")
(exports
    0 rm600
)
(use "Main")
(use "FPRoom")
(use "PAvoider")
(use "Scaler")
(use "Osc")
(use "PolyPath")
(use "Polygon")
(use "CueObj")
(use "StopWalk")
(use "Cycle")
(use "View")
(use "Obj")
(script 600)


(local
    local0
    local1
    local2
    local3
    local4
    local5
    local6
    gEgoMoveSpeed
    local8 =     600
    local9
    local10
    local11
    local12
    local13

)
(instance public rm600 of FPRoom
    (properties
        noun 1
        picture 600
        style $000a
    )

    (method (init)
        (send gEgo:
            init()
            setScale(Scaler 150 70 189 128)
            normalize()
        )
        (switch (gGNumber)
            (case 250
                (send global2:setScript(sEnterFrom250))
            )
            (case 610
                (send gEgo:
                    x(141)
                    y(126)
                )
                (send global2:setScript(sEnterFrom610))
            )
            (case 680
                (if (< (send gEgo:y) 133)
                    = local9 1
                    = gGNumber 610
                    (backDoor:
                        approachX(127)
                        approachY(127)
                    )
                )
                (send gGame:handsOn())
            )
            (default 
                (send gEgo:
                    x(160)
                    y(180)
                    setHeading(0)
                )
                (send gGame:handsOn())
            )
        )
        (super:init())
        (if (== global119 13)
            (srini:
                view(607)
                x(292)
                y(98)
                setSpeed(11)
                setCycle(Fwd)
                approachVerbs(2 4 9)
                init()
            )
            = local13 1
            (stackCans:addToPic())
        )(else
            (if ((>= global119 14) and (<> global119 17))
                (switch (Random(0 1))
                    (case 0
                        = local12 1
                        (srini:
                            view(609)
                            x(152)
                            y(157)
                            approachX(90)
                            approachY(163)
                            setSpeed(11)
                            setPri(11)
                            setCycle(Fwd)
                            approachVerbs(2 4 9)
                            init()
                        )
                    )
                    (case 1
                        (srini:
                            view(608)
                            x(234)
                            y(127)
                            approachX(200)
                            approachY(130)
                            setPri(8)
                            setSpeed(11)
                            setCycle(Fwd)
                            approachVerbs(2 4 9)
                            init()
                        )
                    )
                )
                (stackCans:addToPic())
            )
        )
        (if (== gGNumber 610)
            = local1 (send ((Polygon:new())):
                    type(3)
                    init(104 127 104 130 261 130 261 127)
                    yourself()
                )
            (send global2:addObstacle(local1))
        )(else
            (send global2:addObstacle(
                (if ((>= global119 2) and (<= global119 7))
(                    = local0 (send ((Polygon:new())):
                            type(2)
                            init(260 189 275 144 306 144 306 134 258 134 258 139 217 139 217 134 95 134 36 143 35 170 14 182 0 189 0 0 319 0 319 189)
                            yourself()
                        )
)                )(else
(                    = local0 (send ((Polygon:new())):
                            type(2)
                            init(260 189 275 144 306 144 306 134 95 134 36 143 35 170 14 182 0 189 0 0 319 0 319 189)
                            yourself()
                        )
)                )
 
                (if (local12)
(                    = local3 (send ((Polygon:new())):
                            type(2)
                            init(65 159 60 153 112 141 235 141 188 166)
                            yourself()
                        )
)                )(else
(                    = local3 (send ((Polygon:new())):
                            type(2)
                            init(168 142 237 142 195 166 132 166 123 160)
                            yourself()
                        )
)                )
 
                (if (local12)
(                    = local2 (send ((Polygon:new())):
                            type(2)
                            init(0 1 319 1 319 26 0 25)
                            yourself()
                        )
)                )(else
(                    = local2 (send ((Polygon:new())):
                            type(2)
                            init(105 163 65 161 65 151 104 142 162 142)
                            yourself()
                        )
)                )
))
        )
        (backDoor:
            init()
            approachVerbs(4)
            stopUpd()
        )
        (gate:
            init()
            approachVerbs(4)
            stopUpd()
        )
        (desk:
            init()
            setOnMeCheck(1 64)
        )
        (rFrontShelf1:
            init()
            setOnMeCheck(1 4)
        )
        (rFrontShelf2:
            init()
            setOnMeCheck(1 8)
        )
        (lFrontShelf1:
            init()
            setOnMeCheck(1 32)
        )
        (lFrontShelf2:
            init()
            setOnMeCheck(1 16)
        )
        (leftShelf1:
            init()
            setOnMeCheck(1 2)
        )
        (leftShelf2:
            init()
            setOnMeCheck(1 4)
        )
        (leftShelf3:
            init()
            setOnMeCheck(1 8)
        )
        (leftShelf4:
            init()
            setOnMeCheck(1 16)
        )
        (handSign:
            init()
            setOnMeCheck(1 32)
        )
        (lamp:
            init()
            setOnMeCheck(1 64)
        )
        (cabinet:
            init()
            setOnMeCheck(1 128)
        )
        (bottles1:
            init()
            setOnMeCheck(1 256)
        )
        (bottles2:
            init()
            setOnMeCheck(1 512)
        )
        (lFrontShelf:
            init()
            setOnMeCheck(1 1024)
        )
        (rFrontShelf:
            init()
            setOnMeCheck(1 2048)
        )
        (photo:
            init()
            setOnMeCheck(1 4096)
        )
        (statue:
            init()
            setOnMeCheck(1 8192)
        )
        (jar:
            init()
            setOnMeCheck(1 16384)
        )
        (column:
            init()
            setOnMeCheck(1 -32768)
        )
        (exitLine:
            init()
            setOnMeCheck(1 8192)
        )
        (backCounter:
            init()
            setOnMeCheck(26505)
        )
        (iceCream:
            init()
            setOnMeCheck(26505)
        )
        (iceCream:
            init()
            setOnMeCheck(26505)
        )
        (diploma:
            init()
            setOnMeCheck(26505)
        )
        (backShelf1:
            init()
            setOnMeCheck(26505)
        )
        (backShelf2:
            init()
            setOnMeCheck(26505)
        )
        (bigPicture:
            init()
            setOnMeCheck(26505)
        )
        (rearShelf1:
            init()
            setOnMeCheck(26505)
        )
        (rearShelf2:
            init()
            setOnMeCheck(26505)
        )
        (rearShelf3:
            init()
            setOnMeCheck(26505)
        )
        (if (not (send gEgo:has(46)) and (< global119 7))
            (preparationG:
                init()
                approachVerbs(4)
            )
        )
        (if ((not (send gEgo:has(33)) and not proc0_2(63)) and (>= global119 19))
            (medallion:
                init()
                approachVerbs(4)
            )
        )
        (switch (global119)
            (case 2
                (penelope:
                    x(242)
                    y(136)
                    setScale(Scaler 150 70 189 128)
                    approachVerbs(4 2)
                    stopUpd()
                    init()
                )
                = local8 260
                = local10 802
                = local11 601
            )
            (case 3
                (helen:
                    x(242)
                    y(136)
                    setScale(Scaler 150 70 189 128)
                    approachVerbs(4 2)
                    stopUpd()
                    init()
                )
                = local10 812
                = local8 660
                = local11 602
            )
            (case 4
                (madame:
                    x(242)
                    y(136)
                    setScale(Scaler 150 70 189 128)
                    approachVerbs(4 2)
                    stopUpd()
                    init()
                )
                = local8 410
                = local10 803
                = local11 603
            )
            (case 5
                (madame:
                    x(242)
                    y(136)
                    setScale(Scaler 150 70 189 128)
                    approachVerbs(4 2)
                    stopUpd()
                    init()
                )
                = local8 410
                = local10 803
                = local11 603
            )
            (case 6
                (smithie:
                    x(242)
                    y(136)
                    setScale(Scaler 150 70 189 128)
                    approachVerbs(4 2)
                    stopUpd()
                    init()
                )
                = local8 223
                = local10 805
                = local11 604
            )
            (case 7
                (send gEgo:
                    x(123)
                    y(128)
                    stopUpd()
                )
                = local8 710
                (sheriff:setScript(sSheriffShutdown))
            )
        )
        (if ((>= global119 2) and (<= global119 6))
            (send gGameMusic2:
                number(local8)
                flags(1)
                loop(-1)
                play()
            )
        )(else
            (if (== global119 14)
                0
            )(else
                (if (== gGNumber 250)
                    0
                )(else
                    (send gGameMusic2:
                        number(local8)
                        flags(1)
                        loop(-1)
                        play()
                    )
                )
            )
        )
        (if ((send gEgo:has(51)))
            (swallow:init())
        )
    )


    (method (doit)
        (super:doit())
        (if (local5 and (== PalVary(pvGET_CURRENT_STEP) 64))
            (sEndAct:cue())
            = local5 0
        )(else
            (if (script)
            )(else
                (if (proc0_1(gEgo 8192))
                    (send global2:setScript(sExitTo250))
                )
            )
        )
    )


    (method (dispose)
        (super:dispose())
        (if (== global119 14)
            0
        )(else
            (if (== gNewRoomNumber 250)
                (send gGameMusic2:fade(80 10 16 0))
            )(else
                (send gGameMusic2:fade())
            )
        )
    )

)
(instance sEnterFrom250 of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gEgo:
                    x(160)
                    y(280)
                    setMotion(PolyPath 160 180 self)
                )
                (localSound:
                    number(2606)
                    play()
                )
            )
            (case 1
                = cycles 10
            )
            (case 2
                (if ((send gOldCast:contains(srini)))
                    (send gFpMessager:say(46 0 32))
                    (if (local13)
                        (srini:
                            approachX(253)
                            approachY(176)
                            approachVerbs(2 4 9)
                        )
                    )(else
                        (if (local12)
                            (srini:
                                approachX(90)
                                approachY(163)
                                approachVerbs(2 4 9)
                            )
                        )(else
                            (srini:approachVerbs(0))
                        )
                    )
                )(else
                    (if (== global119 2)
                        (send gFpMessager:say(46 0 11))
                    )(else
                        (if (== global119 3)
                            (send gFpMessager:say(46 0 12))
                        )(else
                            (if (== global119 4)
                                (send gFpMessager:say(46 0 1))
                            )(else
                                (if (== global119 5)
                                    (send gFpMessager:say(46 0 1))
                                )(else
                                    (if (== global119 6)
                                        (send gFpMessager:say(46 0 13))
                                    )
                                )
                            )
                        )
                    )
                )
                = cycles 1
            )
            (case 3
                (send gGame:handsOn())
                (self:dispose())
            )
        )
    )

)
(instance sEnterFrom610 of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                = cycles 1
            )
            (case 1
                (backDoor:
                    approachX(127)
                    approachY(127)
                )
                = local9 1
                (localSound:
                    number(2146)
                    play()
                )
                (backDoor:
                    cycleSpeed(10)
                    setCycle(End self)
                )
            )
            (case 2
                (send gEgo:setMotion(MoveTo 125 126 self))
            )
            (case 3
                (send gEgo:setMotion(MoveTo 125 127 self))
            )
            (case 4
                (send gEgo:setMotion(MoveTo 135 127 self))
            )
            (case 5
                (localSound:
                    number(2147)
                    play()
                )
                (send gEgo:setHeading(180))
                (backDoor:
                    cycleSpeed(10)
                    setCycle(Beg self)
                )
            )
            (case 6
                (backDoor:stopUpd())
                (medallion:approachVerbs(0))
                (preparationG:approachVerbs(0))
                (if ((send gOldCast:contains(srini)))
                    (if (local12 or local13)
                        (srini:approachVerbs(0))
                    )(else
                        (srini:
                            approachX(200)
                            approachY(130)
                            approachVerbs(2 4 9)
                        )
                    )
                )
                (if (proc0_2(105))
                    (send gFpMessager:say(44))
                    proc0_4(105)
                )
                (send gGame:handsOn())
                (self:dispose())
            )
        )
    )

)
(instance sExitTo250 of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                (send gIconBar:disable())
                (if ((send gOldCast:contains(srini)))
                    proc0_5(gEgo srini)
                )(else
                    (if (> global120 1)
                        0
                    )(else
                        (if ((send gOldCast:contains(penelope)))
                            (penelope:
                                startUpd()
                                setHeading(180)
                            )
                            proc0_5(gEgo diploma)
                            proc0_5(penelope gEgo)
                        )(else
                            (if ((send gOldCast:contains(helen)))
                                (helen:
                                    startUpd()
                                    setHeading(180)
                                )
                                proc0_5(gEgo diploma)
                                proc0_5(helen gEgo)
                            )(else
                                (if ((send gOldCast:contains(madame)))
                                    (madame:
                                        startUpd()
                                        setHeading(180)
                                    )
                                    proc0_5(gEgo diploma)
                                    proc0_5(madame gEgo)
                                )(else
                                    (if ((send gOldCast:contains(smithie)))
                                        (smithie:
                                            startUpd()
                                            setHeading(180)
                                        )
                                        proc0_5(gEgo diploma)
                                        proc0_5(smithie gEgo)
                                    )
                                )
                            )
                        )
                    )
                )
                = cycles 10
            )
            (case 1
                (if (> global120 1)
                    0
                )(else
                    (if ((send gOldCast:contains(penelope)))
                        (penelope:stopUpd())
                    )(else
                        (if ((send gOldCast:contains(helen)))
                            (helen:stopUpd())
                        )(else
                            (if ((send gOldCast:contains(madame)))
                                (madame:stopUpd())
                            )(else
                                (if ((send gOldCast:contains(smithie)))
                                    (smithie:stopUpd())
                                )
                            )
                        )
                    )
                )
                = cycles 3
            )
            (case 2
                (if ((send gOldCast:contains(srini)))
                    (send gFpMessager:say(42 0 32))
                )(else
                    (if (== global119 2)
                        (send gFpMessager:say(42 0 11))
                    )(else
                        (if (== global119 3)
                            (send gFpMessager:say(42 0 12))
                        )(else
                            (if (== global119 4)
                                (send gFpMessager:say(42 0 1))
                            )(else
                                (if (== global119 5)
                                    (send gFpMessager:say(42 0 1))
                                )(else
                                    (if (== global119 6)
                                        (send gFpMessager:say(42 0 13))
                                    )(else
                                        0
                                    )
                                )
                            )
                        )
                    )
                )
                = cycles 1
            )
            (case 3
                (send gEgo:setMotion(MoveTo (send gEgo:x) 320 self))
            )
            (case 4
                (localSound:
                    number(2606)
                    play(self)
                )
            )
            (case 5
                (send global2:newRoom(250))
                (self:dispose())
            )
        )
    )

)
(instance sExitTo610 of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                (send gIconBar:disable())
                (localSound:
                    number(2146)
                    play()
                )
                (backDoor:
                    cycleSpeed(10)
                    setCycle(End self)
                )
            )
            (case 1
                (send gEgo:setMotion(MoveTo 141 126 self))
            )
            (case 2
                (localSound:
                    number(2147)
                    play()
                )
                (backDoor:
                    cycleSpeed(10)
                    setCycle(Beg self)
                )
            )
            (case 3
                (send global2:newRoom(610))
                (self:dispose())
            )
        )
    )

)
(instance sEnterCustomer of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                (localSound:
                    number(2606)
                    play()
                )
                = gEgoMoveSpeed (send gEgo:moveSpeed)
                (send gGameMusic2:
                    number(local8)
                    play()
                )
                (send client:
                    view(local10)
                    setSpeed(4)
                    setCycle(StopWalk -1)
                    setScale(Scaler 150 70 189 128)
                    setMotion(PolyPath 241 136 self)
                    approachVerbs(4 2)
                    init()
                )
            )
            (case 1
                UnLoad(128 local10)
                (send client:
                    view(local11)
                    setLoop(
                        (if (local9)
                            0
                        )(else
                            1
                        )
)
                    cel(0)
                    setSpeed(7)
                    setCycle(0)
                    setMotion(0)
                    stopUpd()
                )
                = cycles 3
            )
            (case 2
                (send gFpMessager:say((send client:noun) 0 2 0 self))
            )
            (case 3
                (if (local9)
                    (send gEgo:setMotion(PolyPath 228 127 self))
                )(else
                    (send gEgo:setMotion(PolyPath 210 134 self))
                )
            )
            (case 4
                (send gEgo:
                    view(606)
                    setLoop(
                        (if (local9)
                            0
                        )(else
                            1
                        )
)
                    cel(0)
                    setSpeed(7)
                    setCycle(0)
                    setMotion(0)
                    stopUpd()
                )
                = cycles 3
            )
            (case 5
                (send gFpMessager:say((send client:noun) 0 9 0 self))
            )
            (case 6
                (if (== client smithie)
                    (self:changeState(8))
                )(else
                    (send gEgo:setCycle(Osc 1 self))
                    (send client:setCycle(Osc 1 self))
                )
            )
            (case 7
            )
            (case 8
                UnLoad(128 606)
                (send gEgo:
                    normalize()
                    setCel(
                        (if (< (send gEgo:y) 133)
                            2
                        )(else
                            0
                        )
)
                    setCycle(StopWalk -1)
                    setSpeed(gEgoMoveSpeed)
                    stopUpd()
                )
                = cycles 3
            )
            (case 9
                (switch (client)
                    (case penelope
                        (send gEgo:get(-1 42))
                    )
                    (case helen
                        (send gEgo:get(-1 22))
                    )
                    (case madame
                        (send gEgo:get(-1 32))
                    )
                )
                (send gGame:handsOn())
                (self:dispose())
            )
        )
    )

)
(instance sExitCustomer of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                = gEgoMoveSpeed (send gEgo:moveSpeed)
                (if (< (send gEgo:y) 133)
                    (send gEgo:setMotion(PolyPath 228 127 self))
                )(else
                    (send gEgo:setMotion(PolyPath 210 134 self))
                )
            )
            (case 1
                (send client:
                    view(local11)
                    setLoop(
                        (if (local9)
                            0
                        )(else
                            1
                        )
)
                    cel(0)
                    setSpeed(7)
                    setCycle(Osc 1 self)
                )
                (send gEgo:
                    view(606)
                    setLoop(
                        (if (local9)
                            0
                        )(else
                            1
                        )
)
                    cel(0)
                    setSpeed(7)
                    setCycle(Osc 1 self)
                )
            )
            (case 2
            )
            (case 3
                UnLoad(128 local11)
                (send client:
                    setLoop(-1)
                    view(local10)
                    loop(
                        (if (local9)
                            3
                        )(else
                            1
                        )
)
                    setCycle(StopWalk -1)
                    stopUpd()
                )
                (send gEgo:
                    normalize()
                    setCel(
                        (if (local9)
                            2
                        )(else
                            0
                        )
)
                    setCycle(StopWalk -1)
                    stopUpd()
                )
                = cycles 3
            )
            (case 4
                (if (== client smithie)
                    (send gFpMessager:say(38 0 0 0 self))
                )(else
                    (send gFpMessager:say((send client:noun) 0 3 0 self))
                )
                (switch (client)
                    (case penelope
                        (send gEgo:
                            put(42)
                            put(34)
                        )
                        (send gGame:points(10))
                    )
                    (case helen
                        (send gEgo:
                            put(22)
                            put(35)
                        )
                        (send gGame:points(10))
                    )
                    (case madame
                        (send gEgo:
                            put(32)
                            put(12)
                            put(58)
                            put(36)
                        )
                        (send gGame:points(10))
                    )
                    (case smithie
                        (send gEgo:
                            put(46)
                            get(-1 37)
                        )
                        (send gGame:points(3))
                    )
                )
            )
            (case 5
                (send gEgo:setHeading(180))
                (send client:
                    cycleSpeed(4)
                    moveSpeed(4)
                    setMotion(PolyPath 160 300 self)
                )
            )
            (case 6
                (send gEgo:
                    setSpeed(gEgoMoveSpeed)
                    stopUpd()
                )
                = cycles 3
            )
            (case 7
                (localSound:
                    number(2606)
                    play()
                )
                (if (== client penelope)
                    (send gFpMessager:say((send client:noun) 0 30 0 self))
                )(else
                    = cycles 1
                )
            )
            (case 8
                (send gGame:handsOn())
                (switch (client)
                    (case penelope
                        = global119 3
                        (penelope:dispose())
                        = local8 660
                        = local10 812
                        = local11 602
                        (helen:setScript(sEnterCustomer))
                    )
                    (case helen
                        = global119 4
                        (helen:dispose())
                        = local8 410
                        = local10 803
                        = local11 603
                        (madame:setScript(sEnterCustomer))
                    )
                    (case madame
                        = global119 6
                        (madame:dispose())
                        = local8 223
                        = local10 805
                        = local11 604
                        (smithie:setScript(sEnterCustomer))
                    )
                    (case smithie
                        = global119 7
                        (smithie:dispose())
                        (sheriff:setScript(sSheriffShutdown))
                    )
                )
                UnLoad(128 local11)
                (self:dispose())
            )
        )
    )

)
(instance sWrongPrescription of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                = gEgoMoveSpeed (send gEgo:moveSpeed)
                = local6 1
                (if (< (send gEgo:y) 133)
                    (send gEgo:setMotion(PolyPath 228 127 self))
                )(else
                    (send gEgo:setMotion(PolyPath 210 134 self))
                )
            )
            (case 1
                (send client:
                    view(local11)
                    setLoop(
                        (if (local9)
                            0
                        )(else
                            1
                        )
)
                    cel(0)
                    setSpeed(7)
                    setCycle(Osc 1 self)
                )
                (send gEgo:
                    view(606)
                    setLoop(
                        (if (local9)
                            0
                        )(else
                            1
                        )
)
                    cel(0)
                    setSpeed(7)
                    setCycle(Osc 1 self)
                )
            )
            (case 2
            )
            (case 3
                UnLoad(128 local11)
                (send client:
                    setLoop(-1)
                    view(local10)
                    loop(
                        (if (local9)
                            3
                        )(else
                            1
                        )
)
                    setCycle(StopWalk -1)
                    stopUpd()
                )
                (send gEgo:
                    normalize()
                    setCel(
                        (if (local9)
                            2
                        )(else
                            0
                        )
)
                    setCycle(StopWalk -1)
                    stopUpd()
                )
                = cycles 3
            )
            (case 4
                (send gFpMessager:say((send client:noun) 0 3 0 self))
            )
            (case 5
                (send gEgo:setHeading(180))
                (send client:
                    cycleSpeed(4)
                    moveSpeed(4)
                    setMotion(PolyPath 160 300 self)
                )
            )
            (case 6
                (send gEgo:
                    setSpeed(gEgoMoveSpeed)
                    stopUpd()
                )
                (localSound:
                    number(2606)
                    play()
                )
                = cycles 3
            )
            (case 7
                (localSound:
                    number(2606)
                    play()
                )
                (send gOldCast:eachElementDo(#hide))
                (send global2:drawPic(780))
                = cycles 10
            )
            (case 8
                (send gFpMessager:say(43 0 0 0 self))
            )
            (case 9
                (send gOldCast:eachElementDo(#show))
                (send global2:drawPic(600))
                = cycles 10
            )
            (case 10
                (send client:setMotion(PolyPath 241 136 self))
                (localSound:
                    number(2606)
                    play()
                )
            )
            (case 11
                (send client:
                    setHeading(
                        (if (local9)
                            0
                        )(else
                            270
                        )
)
                    stopUpd()
                )
                (send gEgo:
                    setHeading(
                        (if (local9)
                            180
                        )(else
                            90
                        )
)
                    stopUpd()
                )
                = cycles 10
            )
            (case 12
                (send client:stopUpd())
                (send gEgo:stopUpd())
                = cycles 3
            )
            (case 13
                (if ((== client penelope) and proc0_2(104))
                    (send gFpMessager:say((send client:noun) 0 33 0 self))
                )(else
                    (if ((== client helen) and proc0_2(104))
                        (send gFpMessager:say((send client:noun) 0 33 0 self))
                    )(else
                        (if ((== client madame) and proc0_2(95))
                            (send gFpMessager:say((send client:noun) 0 31 0 self))
                        )(else
                            (send gFpMessager:say((send client:noun) 0 14 0 self))
                        )
                    )
                )
            )
            (case 14
                (send gGame:handsOn())
                (self:dispose())
            )
        )
    )

)
(instance sOpenGateFront of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                (send ((send global2:obstacles)):delete(local0))
                (send ((send global2:obstacles)):delete(local3))
                (send ((send global2:obstacles)):delete(local2))
                (send local0:dispose())
                (send local3:dispose())
                (send local2:dispose())
                (gate:setCycle(End self))
                (localSound:
                    number(2700)
                    play()
                )
            )
            (case 1
                (send gEgo:setMotion(PolyPath 104 127 self))
            )
            (case 2
                = local1 (send ((Polygon:new())):
                        type(3)
                        init(104 127 104 130 261 130 261 127)
                        yourself()
                    )
                (send global2:addObstacle(local1))
                (send gEgo:setHeading(180))
                = cycles 3
            )
            (case 3
                (gate:setCycle(Beg self))
                (localSound:
                    number(2700)
                    play()
                )
            )
            (case 4
                (gate:stopUpd())
                = local9 1
                (if ((== local4 1) and not (== global119 1))
                    (send gEgo:setMotion(PolyPath 123 128 self))
                )(else
                    = cycles 1
                )
            )
            (case 5
                (if ((== local4 1) and not (== global119 1))
                    (send gEgo:setHeading(0))
                )
                = cycles 3
            )
            (case 6
                (backDoor:
                    approachX(127)
                    approachY(127)
                )
                (gate:
                    approachX(100)
                    approachY(126)
                )
                (if (> global120 1)
                    0
                )(else
                    (if ((send gOldCast:contains(penelope)))
                        (penelope:
                            approachX(228)
                            approachY(127)
                        )
                    )(else
                        (if ((send gOldCast:contains(helen)))
                            (helen:
                                approachX(228)
                                approachY(127)
                            )
                        )(else
                            (if ((send gOldCast:contains(madame)))
                                (madame:
                                    approachX(228)
                                    approachY(127)
                                )
                            )(else
                                (if ((send gOldCast:contains(smithie)))
                                    (smithie:
                                        approachX(228)
                                        approachY(127)
                                    )
                                )
                            )
                        )
                    )
                )
                (if ((send gOldCast:contains(medallion)))
                    (medallion:approachVerbs(0))
                )
                (if ((send gOldCast:contains(preparationG)))
                    (preparationG:approachVerbs(0))
                )
                (if ((send gOldCast:contains(srini)))
                    (if (local12 or local13)
                        (srini:approachVerbs(0))
                    )(else
                        (srini:
                            approachX(200)
                            approachY(130)
                            approachVerbs(2 4 9)
                        )
                    )
                )
                = cycles 3
            )
            (case 7
                (send gGame:handsOn())
                (if (== global119 1)
                    = global119 2
                    = local8 260
                    = local10 802
                    = local11 601
                    (penelope:setScript(sEnterCustomer))
                )(else
                    (if (== local4 1)
                        = local4 0
                        (send global2:setScript(sExitTo610))
                    )
                )
                (self:dispose())
            )
        )
    )

)
(instance sOpenGateBack of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                (send ((send global2:obstacles)):delete(local1))
                (send local1:dispose())
                (gate:setCycle(End self))
                (localSound:
                    number(2700)
                    play()
                )
            )
            (case 1
                (send gEgo:setMotion(MoveTo 100 134 self))
            )
            (case 2
                (send global2:addObstacle(
                    (if ((>= global119 2) and (<= global119 7))
(                        = local0 (send ((Polygon:new())):
                                type(2)
                                init(260 189 275 144 306 144 306 134 258 134 258 139 217 139 217 134 95 134 36 143 35 170 14 182 0 189 0 0 319 0 319 189)
                                yourself()
                            )
)                    )(else
(                        = local0 (send ((Polygon:new())):
                                type(2)
                                init(260 189 275 144 306 144 306 134 95 134 36 143 35 170 14 182 0 189 0 0 319 0 319 189)
                                yourself()
                            )
)                    )
 
                    (if (local12)
(                        = local3 (send ((Polygon:new())):
                                type(2)
                                init(65 159 60 153 112 141 235 141 188 166)
                                yourself()
                            )
)(                        = local3 local3
)                    )(else
(                        = local3 (send ((Polygon:new())):
                                type(2)
                                init(118 160 50 160 110 142 161 142)
                                yourself()
                            )
)                    )
 
                    (if (local12)
(                        = local2 (send ((Polygon:new())):
                                type(2)
                                init(0 1 319 1 319 26 0 25)
                                yourself()
                            )
)                    )(else
(                        = local2 (send ((Polygon:new())):
                                type(2)
                                init(168 142 237 142 195 166 109 166)
                                yourself()
                            )
)                    )
))
                (send gEgo:setHeading(0 self))
            )
            (case 3
                (gate:setCycle(Beg self))
                (localSound:
                    number(2700)
                    play()
                )
            )
            (case 4
                (gate:stopUpd())
                = local9 0
                (if ((send gOldCast:contains(srini)))
                    (if (local13)
                        (srini:
                            approachX(253)
                            approachY(176)
                            approachVerbs(2 4 9)
                        )
                    )(else
                        (if (local12)
                            (srini:
                                approachX(90)
                                approachY(163)
                                approachVerbs(2 4 9)
                            )
                        )(else
                            (srini:approachVerbs(0))
                        )
                    )
                )
                (if ((send gOldCast:contains(medallion)))
                    (medallion:approachVerbs(4))
                )
                (if ((send gOldCast:contains(preparationG)))
                    (preparationG:approachVerbs(4))
                )
                (backDoor:
                    approachX(100)
                    approachY(134)
                )
                (gate:
                    approachX(100)
                    approachY(134)
                )
                (if (> global120 1)
                    0
                )(else
                    (if ((send gOldCast:contains(penelope)))
                        (penelope:
                            approachX(210)
                            approachY(134)
                        )
                    )(else
                        (if ((send gOldCast:contains(helen)))
                            (helen:
                                approachX(210)
                                approachY(134)
                            )
                        )(else
                            (if ((send gOldCast:contains(madame)))
                                (madame:
                                    approachX(210)
                                    approachY(134)
                                )
                            )(else
                                (if ((send gOldCast:contains(smithie)))
                                    (smithie:
                                        approachX(210)
                                        approachY(134)
                                    )
                                )
                            )
                        )
                    )
                )
                (send gGame:handsOn())
                (self:dispose())
            )
        )
    )

)
(instance sEndAct of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:
                    handsOff()
                    setCursor(996)
                )
                (send gIconBar:disable())
                = local5 1
                (send gEgo:stopUpd())
                = seconds 1
            )
            (case 1
                PalVary(pvINIT 250 5)
            )
            (case 2
                proc0_15(1 3 self)
            )
            (case 3
                PalVary(pvUNINIT)
                (send gOldCast:eachElementDo(#dispose))
                Palette(palSET_INTENSITY 0 256 0)
                (send global2:drawPic(780))
                = cycles 1
            )
            (case 4
                (send global2:newRoom(26))
                (self:dispose())
            )
        )
    )

)
(instance sSheriffShutdown of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                UnLoad(128 805)
                (send gGameMusic2:
                    number(710)
                    flags(1)
                    loop(-1)
                    play()
                )
                (sheriff:
                    init()
                    setAvoider(PAvoider)
                    setCycle(StopWalk -1)
                    setScale(Scaler 150 70 189 128)
                    setMotion(PolyPath 242 134 self)
                )
                = global120 2
                (localSound:
                    number(2606)
                    play()
                )
                proc0_9(26)
            )
            (case 1
                (if (local9)
                    (send gEgo:setMotion(PolyPath 228 127 self))
                )(else
                    (send gEgo:setMotion(PolyPath 210 134 self))
                )
            )
            (case 2
                (send gEgo:
                    setHeading(
                        (if (local9)
                            180
                        )(else
                            90
                        )
)
                    stopUpd()
                )
                (send client:
                    setHeading(
                        (if (local9)
                            0
                        )(else
                            270
                        )
)
                    stopUpd()
                )
                = cycles 3
            )
            (case 3
                = global120 1
                (send gFpMessager:say(39 0 0))
                = cycles 1
            )
            (case 4
                = global120 2
                (send gEgo:setHeading(180))
                (sheriff:setMotion(PolyPath 160 300 self))
            )
            (case 5
                (localSound:
                    number(2606)
                    play()
                )
                (send global2:setScript(sEndAct))
                (self:dispose())
            )
        )
    )

)
(instance srini of Actor
    (properties
        x 162
        y 163
        noun 37
        approachX 185
        approachY 175
        priority 12
        signal $5010
        cycleSpeed 12
    )

    (method (doVerb theVerb param2)
        (switch (theVerb)
            (case 2
                (if (((local9 and local13) or (local9 and local12)) or ((not local12 and not local9) and not local13))
                    (send gFpMessager:say(37 2 29))
                )(else
                    (if (== global119 13)
                        (send gFpMessager:say(37 2 15))
                    )(else
                        (if (== global119 14)
                            (send gFpMessager:say(37 2 16))
                        )(else
                            (if (== global119 15)
                                (send gFpMessager:say(37 2 17))
                            )(else
                                (if ((== global119 16) or (== global119 17))
                                    (if (proc0_2(54))
                                        (send gFpMessager:say(noun 2 5))
                                    )(else
                                        (if ((send gEgo:has(44)) and (send gEgo:has(3)))
                                            (send gFpMessager:say(noun 2 5))
                                        )(else
                                            (if (not (send gEgo:has(44)))
                                                (send gFpMessager:say(noun 2 27))
                                            )(else
                                                (if (not (send gEgo:has(3)))
                                                    (send gFpMessager:say(noun 2 28))
                                                )
                                            )
                                        )
                                    )
                                )(else
                                    (if (== global119 19)
                                        (if (not (send gEgo:has(2)))
                                            (send gFpMessager:say(37 2 19))
                                        )(else
                                            (if (not (send gEgo:has(44)))
                                                (send gFpMessager:say(37 2 20))
                                            )(else
                                                (if (not (send gEgo:has(10)))
                                                    (send gFpMessager:say(37 2 23))
                                                )(else
                                                    (if (not (send gEgo:has(52)))
                                                        (send gFpMessager:say(37 2 22))
                                                    )(else
                                                        (if (not (send gEgo:has(38)))
                                                            (send gFpMessager:say(37 2 24))
                                                        )(else
                                                            (send gFpMessager:say(37 2 18))
                                                        )
                                                    )
                                                )
                                            )
                                        )
                                    )(else
                                        (if (== global119 20)
                                            (send gFpMessager:say(37 2 25))
                                        )(else
                                            (if (== global119 22)
                                                (send gFpMessager:say(37 2 26))
                                            )
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
            )
            (default 
                (if (((local13 and local9) or (local9 and local12)) or ((not local12 and not local9) and not local13))
                    (send gFpMessager:say(37 0 29))
                )(else
                    (super:doVerb(theVerb rest param2))
                )
            )
        )
    )

)
(instance penelope of Actor
    (properties
        x 160
        y 300
        noun 34
        approachX 228
        approachY 127
        view 601
        signal $5000
    )

    (method (doVerb theVerb param2)
        (switch (theVerb)
            (case 11
                (self:setScript(sExitCustomer))
            )
            (case 71
                (if (local6)
                    (send gFpMessager:say(45 0 0))
                )(else
                    (self:setScript(sWrongPrescription))
                )
            )
            (case 2
                (if (not proc0_2(67))
                    proc0_3(67)
                    (send gFpMessager:say(noun theVerb 6))
                )(else
                    (if (not proc0_2(68))
                        proc0_3(68)
                        (send gFpMessager:say(noun theVerb 7))
                    )(else
                        (if (not proc0_2(109))
                            proc0_3(109)
                            (send gFpMessager:say(noun theVerb 8))
                        )(else
                            (send gFpMessager:say(noun theVerb 34))
                        )
                    )
                )
            )
            (default 
                (super:doVerb(theVerb rest param2))
            )
        )
    )


    (method (cue)
        (helen:setScript(sEnterCustomer))
    )

)
(instance helen of Actor
    (properties
        x 160
        y 300
        noun 35
        approachX 228
        approachY 127
        view 602
        signal $5000
    )

    (method (doVerb theVerb param2)
        (switch (theVerb)
            (case 13
                (self:setScript(sExitCustomer))
            )
            (case 71
                (if (local6)
                    (send gFpMessager:say(45 0 0))
                )(else
                    (self:setScript(sWrongPrescription))
                )
            )
            (default 
                (super:doVerb(theVerb rest param2))
            )
        )
    )


    (method (cue)
        (madame:setScript(sEnterCustomer))
    )

)
(instance madame of Actor
    (properties
        x 160
        y 300
        noun 36
        approachX 228
        approachY 127
        view 603
        signal $5000
    )

    (method (doVerb theVerb param2)
        (switch (theVerb)
            (case 18
                (self:setScript(sExitCustomer))
            )
            (case 71
                (if (local6)
                    (send gFpMessager:say(45 0 0))
                )(else
                    (self:setScript(sWrongPrescription))
                )
            )
            (default 
                (super:doVerb(theVerb rest param2))
            )
        )
    )

)
(instance smithie of Actor
    (properties
        x 160
        y 300
        noun 33
        approachX 228
        approachY 127
        view 604
        signal $5000
    )

    (method (doVerb theVerb param2)
        (switch (theVerb)
            (case 20
                (self:setScript(sExitCustomer))
            )
            (default 
                (super:doVerb(theVerb rest param2))
            )
        )
    )

)
(instance sheriff of Actor
    (properties
        x 160
        y 300
        view 806
        signal $4000
    )
)
(instance backDoor of Prop
    (properties
        x 119
        y 80
        noun 2
        approachX 100
        approachY 134
        view 600
        loop 2
        priority 9
        signal $5010
    )

    (method (doVerb theVerb param2)
        (switch (theVerb)
            (case 4
                (if (local9)
                    (send global2:setScript(sExitTo610))
                )(else
                    = local4 1
                    (send global2:setScript(sOpenGateFront))
                )
            )
            (default 
                (super:doVerb(theVerb rest param2))
            )
        )
    )

)
(instance gate of Prop
    (properties
        x 100
        y 132
        z 29
        noun 16
        approachX 100
        approachY 136
        view 600
        loop 3
        priority 10
        signal $5011
    )

    (method (initialize)
    )


    (method (doVerb theVerb param2)
        (switch (theVerb)
            (case 4
                (if (local9)
                    (send global2:setScript(sOpenGateBack))
                )(else
                    (send global2:setScript(sOpenGateFront))
                )
            )
            (default 
                (super:doVerb(theVerb rest param2))
            )
        )
    )

)
(instance medallion of Prop
    (properties
        x 286
        y 86
        noun 40
        approachX 295
        approachY 141
        view 600
        signal $5001
    )

    (method (doVerb theVerb param2)
        (switch (theVerb)
            (case 4
                (if (local9)
                    (send gFpMessager:say(noun theVerb 4))
                )(else
                    proc0_3(63)
                    (send gGame:points(1))
                    (send gEgo:get(33 medallion))
                    (self:dispose())
                )
            )
            (default 
                (super:doVerb(theVerb rest param2))
            )
        )
    )

)
(instance preparationG of View
    (properties
        x 103
        y 158
        z 40
        noun 41
        approachX 101
        approachY 160
        view 600
        loop 1
        priority 12
        signal $5011
    )

    (method (doVerb theVerb param2)
        (switch (theVerb)
            (case 4
                (if (local9)
                    (send gFpMessager:say(noun theVerb 4))
                )(else
                    (send gEgo:get(46 preparationG))
                    (self:dispose())
                    (send gGame:points(1))
                )
            )
            (default 
                (super:doVerb(theVerb rest param2))
            )
        )
    )

)
(instance stackCans of View
    (properties
        x 299
        y 100
        noun 47
        view 600
        loop 4
        priority 12
        signal $5010
    )
)
(instance backCounter of Feature
    (properties
        x 187
        y 133
        noun 12
        nsTop 104
        nsLeft 110
        nsBottom 131
        nsRight 265
    )
)
(instance iceCream of Feature
    (properties
        x 48
        y 88
        noun 3
        nsTop 38
        nsBottom 138
        nsRight 97
    )
)
(instance diploma of Feature
    (properties
        x 298
        y 73
        noun 4
        nsTop 68
        nsLeft 291
        nsBottom 79
        nsRight 306
    )
)
(instance backShelf1 of Feature
    (properties
        x 238
        y 88
        noun 5
        nsTop 84
        nsLeft 215
        nsBottom 92
        nsRight 261
    )
)
(instance backShelf2 of Feature
    (properties
        x 237
        y 98
        noun 6
        nsTop 94
        nsLeft 215
        nsBottom 102
        nsRight 260
    )
)
(instance bigPicture of Feature
    (properties
        x 215
        y 16
        noun 11
        nsLeft 166
        nsBottom 32
        nsRight 265
    )
)
(instance rearShelf1 of Feature
    (properties
        x 159
        y 80
        noun 10
        nsTop 77
        nsLeft 143
        nsBottom 83
        nsRight 175
    )
)
(instance rearShelf2 of Feature
    (properties
        x 159
        y 89
        noun 9
        nsTop 85
        nsLeft 143
        nsBottom 93
        nsRight 175
    )
)
(instance rearShelf3 of Feature
    (properties
        x 148
        y 99
        noun 8
        nsTop 95
        nsLeft 143
        nsBottom 103
        nsRight 154
    )
)
(instance desk of Feature
    (properties
        x 305
        y 189
        noun 18
        nsTop 135
        nsLeft 267
        nsBottom 189
        nsRight 311
    )
)
(instance rFrontShelf1 of Feature
    (properties
        x 201
        y 146
        noun 31
        nsTop 115
        nsLeft 183
        nsBottom 134
        nsRight 220
    )
)
(instance rFrontShelf2 of Feature
    (properties
        x 200
        y 146
        noun 32
        nsTop 131
        nsLeft 183
        nsBottom 156
        nsRight 218
    )
)
(instance lFrontShelf1 of Feature
    (properties
        x 126
        y 146
        noun 22
        nsTop 121
        nsLeft 109
        nsBottom 136
        nsRight 144
    )
)
(instance lFrontShelf2 of Feature
    (properties
        x 126
        y 146
        noun 23
        nsTop 133
        nsLeft 108
        nsBottom 154
        nsRight 144
    )
)
(instance exitLine of Feature
    (properties
        x 159
        y 187
        noun 1
        nsTop 183
        nsBottom 189
        nsRight 319
    )
)
(instance swallow of Feature
    (properties
        x 41
        y 169
        noun 1
        nsTop 160
        nsLeft 31
        nsBottom 179
        nsRight 51
    )

    (method (doVerb theVerb param2)
        (switch (theVerb)
            (case 63
                (send global2:setScript(sMovieGag))
            )
            (default 
                (super:doVerb(theVerb rest param2))
            )
        )
    )

)
(instance leftShelf1 of Feature
    (properties
        x 80
        y 89
        noun 7
    )
)
(instance leftShelf2 of Feature
    (properties
        x 92
        y 89
        noun 13
    )
)
(instance leftShelf3 of Feature
    (properties
        x 103
        y 89
        noun 14
    )
)
(instance leftShelf4 of Feature
    (properties
        x 112
        y 89
        noun 15
    )
)
(instance handSign of Feature
    (properties
        x 55
        y 39
        noun 28
    )
)
(instance lamp of Feature
    (properties
        x 91
        y 24
        noun 17
    )
)
(instance cabinet of Feature
    (properties
        x 29
        y 189
        noun 19
    )
)
(instance bottles1 of Feature
    (properties
        x 118
        y 146
        noun 20
    )
)
(instance bottles2 of Feature
    (properties
        x 189
        y 146
        noun 21
    )
)
(instance lFrontShelf of Feature
    (properties
        x 95
        y 117
        noun 30
    )
)
(instance rFrontShelf of Feature
    (properties
        x 157
        y 146
        noun 29
    )
)
(instance photo of Feature
    (properties
        x 165
        y 146
        noun 24
    )
)
(instance statue of Feature
    (properties
        x 179
        y 133
        noun 25
    )
)
(instance jar of Feature
    (properties
        x 293
        y 189
        noun 26
    )
)
(instance column of Feature
    (properties
        x 315
        y 189
        noun 27
    )
)
(instance sMovieGag of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                = cycles 1
            )
            (case 1
                (ghoul:
                    loop(0)
                    cel(0)
                    cycleSpeed(9)
                    setCycle(End self)
                    init()
                )
                (if (DoSound(sndGET_AUDIO_CAPABILITY))
                    (localSound:
                        number(2948)
                        play()
                    )
                )(else
                    (send gNarrator:modeless(1))
                    (send gFpMessager:say(48 2 0))
                )
            )
            (case 2
                (if (DoSound(sndGET_AUDIO_CAPABILITY))
                    UnLoad(132 2948)
                )(else
                    (send gNarrator:
                        modeless(0)
                        dispose()
                    )
                )
                (ghoul:dispose())
                = cycles 5
            )
            (case 3
                (send gFpMessager:say(48 0 0 0 self))
            )
            (case 4
                (send gGame:handsOn())
                (self:dispose())
            )
        )
    )

)
(instance ghoul of Prop
    (properties
        x 28
        y 162
        view 612
    )
)
(instance localSound of FPSound
    (properties
        flags $0001
    )
)
