(version 2)
(include "sci.sh")
(exports
    0 rm320
)
(use "Main")
(use "FPRoom")
(use "Print")
(use "Inset")
(use "Scaler")
(use "ROsc")
(use "PolyPath")
(use "Polygon")
(use "CueObj")
(use "StopWalk")
(use "Cycle")
(use "User")
(use "View")
(use "Obj")
(script 320)


(local
    local0
    local1
    local2
    local3
    local4
    local5
    local6
    local7
    gEgoMoveSpeed
    local9
    local10 =     1
    local11
    local12[40]

)
(instance public rm320 of FPRoom
    (properties
        noun 11
        picture 320
        style $0064
        south 260
        west 310
    )

    (method (init)
        (if (proc0_2(1))
            = south 265
        )(else
            = south 260
        )
        (send gEgo:
            init()
            setScale(Scaler 75 48 182 41)
            normalize()
        )
        (switch (gGNumber)
            (case west
                = style 12
                (send gGame:handsOn())
            )
            (case south
                (send gEgo:x(278))
                (if ((== gGNumber 265) and ((== global119 14) or (== global119 15)))
                    (send global2:setScript(sEnterFromFire))
                )(else
                    (send gGame:handsOn())
                )
            )
            (case 640
                (send global2:setScript(sEnterFrom640))
            )
            (case 680
                (send gGame:handsOn())
            )
            (default 
                (send gEgo:
                    x(278)
                    y(175)
                )
                (send gGame:handsOn())
            )
        )
        (super:init())
        = local3 (send ((Polygon:new())):
                type(2)
                init(172 189 0 189 0 142 118 141 173 161)
                yourself()
            )
        = local2 (send ((Polygon:new())):
                type(2)
                init(180 189 180 159 243 159 279 189)
                yourself()
            )
        (send global2:addObstacle(
            (if (== global119 13)
(                = local1 (send ((Polygon:new())):
                        type(2)
                        init(319 189 307 189 307 175 260 148 305 133 266 116 259 118 261 130 232 138 153 119 91 113 88 103 92 98 129 98 128 90 101 93 89 93 67 108 0 109 0 0 319 0)
                        yourself()
                    )
)            )(else
(                = local1 (send ((Polygon:new())):
                        type(2)
                        init(319 189 309 189 309 174 263 151 305 133 266 116 259 118 261 130 232 138 141 111 176 92 140 84 112 94 73 109 0 109 0 0 319 0)
                        yourself()
                    )
)            )
 local2 local2))
        (if (proc0_2(16))
            (lowerLadder:
                init()
                approachVerbs(4 3)
            )
        )
        (if (proc0_2(22))
            (rope:
                init()
                stopUpd()
            )
        )
        (outhouseDoor:
            init()
            approachVerbs(4)
        )
        (if (proc0_2(31))
            (shingle:
                setCel((shingle:lastCel()))
                init()
                stopUpd()
            )
        )(else
            (shingle:
                init()
                stopUpd()
            )
        )
        (waterTower:
            init()
            approachVerbs(36)
            setOnMeCheck(1 8)
        )
        (waterTowerTop:
            approachVerbs(36)
            init()
            setOnMeCheck(1 4)
        )
        (outhouse:
            init()
            setOnMeCheck(1 16)
        )
        (topBuilding:
            init()
            setOnMeCheck(1 32)
        )
        (bottomBuilding:
            init()
            setOnMeCheck(1 64)
        )
        (eastBuilding:
            init()
            setOnMeCheck(1 128)
        )
        (wagon:
            init()
            setOnMeCheck(1 256)
        )
        (windMill:
            init()
            setOnMeCheck(1 512)
        )
        (waterTowerRoof:
            init()
            setOnMeCheck(1 16384)
        )
        (house1:
            init()
            setOnMeCheck(1 -32768)
        )
        (mine:
            init()
            setOnMeCheck(1 8192)
        )
        (machines:
            init()
            setOnMeCheck(1 4096)
        )
        (house2:
            init()
            setOnMeCheck(1 1024)
        )
        (pulley:
            init()
            setOnMeCheck(1 256)
        )
        (towerTop:
            init()
            setOnMeCheck(26505)
        )
        (shingle1:
            init()
            setOnMeCheck(26505)
        )
        (spigot:
            setOnMeCheck(26505)
            approachVerbs(4 34)
            init()
        )
        (waterDrop:
            hide()
            setScript(sWaterDripping)
            init()
        )
        (windMillBlades:
            cel(gWindMillBladesCel)
            setCycle(Fwd)
            init()
        )
        (send gGameMusic2:
            number(2325)
            flags(1)
            loop(-1)
            play()
        )
        (if (== global119 13)
            (send gGameMusic1:
                number(324)
                loop(-1)
                play()
            )
            (peopleInLine:
                stopUpd()
                init()
            )
            (person1:
                stopUpd()
                init()
            )
            (person2:
                stopUpd()
                init()
            )
            (person3:
                stopUpd()
                init()
            )
            (if (not proc0_2(86))
                (shingle:setScript(sFirstTimeComtaminated))
            )
        )(else
            (if (proc0_2(1))
                = local7 1
            )(else
                = local7 Random(0 2)
            )
        )
        (send gOldWH:add(self))
        (if (proc0_2(52))
            (dummyCredits:
                init()
                setScript(ScriptID(32 0))
            )
        )
        (if (proc0_2(74))
            (send global2:setScript(sWaterSampleJoke))
        )
        proc0_4(94)
    )


    (method (doit)
        (super:doit())
        (if (script)
        )(else
            (if (proc0_1(gEgo 2))
                (send global2:setScript(sExitTo640))
            )
        )
    )


    (method (dispose)
        (if (<> global119 14)
            (send gGameMusic1:fade(0 30 12 1))
        )
        (if ((<> gNewRoomNumber 310) and (<> global119 14))
            (send gGameMusic2:fade())
        )
        = gWindMillBladesCel (windMillBlades:cel)
        (send gOldWH:delete(lowerLadder))
        (send gOldWH:delete(highLadder))
        (send gOldWH:delete(self))
        DisposeScript(32)
        (super:dispose())
    )


    (method (handleEvent pEvent)
        (var temp0[20])
        return 
            (if (& (send pEvent:type) $1000)
                (if (proc0_2(45))
                    (send gFpMessager:say(26 0 0))
                    (send pEvent:claimed(1))
                )(else
                    return 0
                )
            )(else
                (super:handleEvent(pEvent))
            )
    )


    (method (notify)
        = local11 1
        (send global2:setScript(sWaterSampleJoke))
    )

)
(instance sEnterFromFire of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                = cycles 3
                (send gEgo:posn(278 240))
            )
            (case 1
                proc0_15(0 16)
                (send gEgo:setMotion(MoveTo 278 181 self))
            )
            (case 2
                (send gGame:handsOn())
                (self:dispose())
            )
        )
    )

)
(instance sEnterFrom640 of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gEgo:
                    x(173)
                    y(200)
                    setMotion(MoveTo 173 155 self)
                )
            )
            (case 1
                = cycles 3
            )
            (case 2
                (if (proc0_2(1))
                    (send gFpMessager:say(25 0 10))
                )
                = cycles 1
            )
            (case 3
                (send gGame:handsOn())
                (self:dispose())
            )
        )
    )

)
(instance sExitTo640 of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                (send gEgo:setMotion(MoveTo 191 225 self))
            )
            (case 1
                (if (proc0_2(1))
                    (send global2:setScript(sEnterFrom640))
                )(else
                    (send global2:newRoom(640))
                )
            )
        )
    )

)
(instance sWaterDripping of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send client:setCel(0))
                = seconds Random(3 10)
            )
            (case 1
                (send client:show())
                (send client:
                    setCycle(End self)
                    cycleSpeed(1)
                )
                (if (== local10 1)
                    (dripSound:
                        number(2321)
                        loop(1)
                        play()
                    )
                )
            )
            (case 2
                (send client:hide())
                (self:changeState(0))
            )
        )
    )

)
(instance sLafferReading of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                = seconds 2
            )
            (case 1
                (send client:setCycle(End self))
            )
            (case 2
                = cycles 30
            )
            (case 3
                (send client:setCycle(Beg self))
            )
            (case 4
                (send client:
                    setLoop(0)
                    setCel(0)
                    setCycle(End self)
                )
            )
            (case 5
                (send (ScriptID(1816 52)):
                    y(85)
                    textY(50)
                )
                (send gFpMessager:say(18 0 1 0 self))
            )
            (case 6
                (send client:setCycle(Beg self))
            )
            (case 7
                (inLafferFrame:dispose())
                (send gGame:handsOn())
                (self:dispose())
            )
        )
    )

)
(instance sJudgeCrapping of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (windMillBlades:stopUpd())
                = cycles 10
            )
            (case 1
                (switch (local9)
                    (case 0
                        (send gFpMessager:say(44 0 19 0 self))
                        ++local9
                    )
                    (case 1
                        (send gFpMessager:say(44 0 21 0 self))
                        ++local9
                    )
                    (case 2
                        (send gFpMessager:say(44 0 22 0 self))
                    )
                )
            )
            (case 2
                (windMillBlades:startUpd())
                (outhouseDoor:doVerb(4))
                (self:dispose())
            )
        )
    )

)
(instance sEnterOuthouse of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                (send gEgo:setMotion(MoveTo 117 84 self))
                = local10 0
            )
            (case 1
                (localSound:
                    number(2147)
                    loop(1)
                    play()
                )
                (outhouseDoor:setCycle(Beg self))
            )
            (case 2
                (localSound:
                    number(2946)
                    loop(1)
                    play(self)
                )
            )
            (case 3
                (send gFpMessager:say(19 0 1 0 self))
            )
            (case 4
                (localSound:
                    number(2146)
                    loop(1)
                    play()
                )
                (outhouseDoor:setCycle(End self))
            )
            (case 5
                (send gEgo:setMotion(MoveTo 125 90 self))
            )
            (case 6
                (localSound:
                    number(2147)
                    loop(1)
                    play()
                )
                (outhouseDoor:setCycle(Beg self))
            )
            (case 7
                = local10 1
                (send gGame:handsOn())
                (self:dispose())
            )
        )
    )

)
(instance sPourSolution of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                = gEgoMoveSpeed (send gEgo:moveSpeed)
                (send gEgo:setMotion(PolyPath 221 16 self))
            )
            (case 1
                = local10 0
                (send gEgo:
                    view(322)
                    loop(3)
                    cel(0)
                    cycleSpeed(10)
                    setCycle(End self)
                )
                (localSound:
                    number(2813)
                    loop(-1)
                    play()
                )
            )
            (case 2
                (send gEgo:setCycle(ROsc 3 2 6 self))
            )
            (case 3
                (localSound:stop())
                (send gEgo:put(47))
                (send gOldCast:eachElementDo(#dispose))
                (send global2:
                    style(10)
                    drawPic(780)
                )
                = seconds 2
            )
            (case 4
                (send gGame:points(10))
                (send gFpMessager:say(5 39 5 0 self))
            )
            (case 5
                (send gEgo:
                    cycleSpeed(gEgoMoveSpeed)
                    moveSpeed(gEgoMoveSpeed)
                )
                = global119 14
                proc0_4(20)
                proc0_4(21)
                proc0_4(45)
                (send gTimers:delete(ScriptID(0 13)))
                (send global2:newRoom(630))
                (self:dispose())
            )
        )
    )

)
(instance sOpenHatch of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                = gEgoMoveSpeed (send gEgo:moveSpeed)
                (if (proc0_2(31))
                    (send gEgo:
                        view(322)
                        loop(2)
                        cel(6)
                        cycleSpeed(10)
                        setCycle(CT (send gEgo:lastCel()) 1 self)
                    )
                )(else
                    (send gEgo:
                        view(322)
                        loop(2)
                        cel(0)
                        cycleSpeed(10)
                        setCycle(CT 5 1 self)
                    )
                )
            )
            (case 1
                (if (proc0_2(31))
                    (shingle:setCycle(Beg))
                    (send gEgo:setCycle(Beg self))
                    proc0_4(31)
                )(else
                    (shingle:setCycle(End))
                    (send gEgo:setCycle(End self))
                    proc0_3(31)
                )
                (localSound:
                    number(2700)
                    loop(1)
                    play()
                )
            )
            (case 2
                (shingle:stopUpd())
                (send gEgo:
                    view(322)
                    loop(0)
                    cel(0)
                    cycleSpeed(gEgoMoveSpeed)
                    moveSpeed(gEgoMoveSpeed)
                    setCycle(Walk)
                    setMotion(MoveTo - (send gEgo:x) 10 (send gEgo:y) self)
                )
            )
            (case 3
                (self:dispose())
            )
        )
    )

)
(instance sGottaGoPee of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                = seconds Random(4 7)
            )
            (case 1
                (send client:setCycle(Fwd))
                = cycles 1
            )
            (case 2
                = seconds Random(2 5)
            )
            (case 3
                (send client:setCycle(Beg self))
            )
            (case 4
                (send client:stopUpd())
                (self:changeState(0))
            )
        )
    )

)
(instance sWaterSampleJoke of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                (if (local11)
                    0
                )(else
                    (if (proc999_5(gGNumber 310 300))
                        (send gEgo:
                            x(5)
                            y(131)
                        )
                    )(else
                        (if (proc0_2(74))
                            (send gEgo:
                                x(300)
                                y(235)
                            )
                        )
                    )
                )
                = cycles 1
            )
            (case 1
                (if (proc0_2(74))
                    proc0_15(0 5 self)
                )(else
                    = cycles 1
                )
            )
            (case 2
                (if (proc999_5(gGNumber 310 300))
                    = cycles 1
                )(else
                    (if (proc0_2(74))
                        (send gEgo:setMotion(MoveTo 300 185 self))
                    )(else
                        proc0_4(74)
                        = cycles 1
                    )
                )
            )
            (case 3
                (send gEgo:setMotion(PolyPath 125 100 self))
            )
            (case 4
                (send gEgo:setHeading(315))
                (windMillBlades:stopUpd())
                = cycles 10
            )
            (case 5
                (if (== global119 13)
                    (send gFpMessager:say(28 0 0 0 self))
                )(else
                    = cycles 1
                )
            )
            (case 6
                (localSound:
                    number(2146)
                    loop(1)
                    play()
                )
                (outhouseDoor:setCycle(End self))
            )
            (case 7
                (send gEgo:setMotion(MoveTo 117 84 self))
            )
            (case 8
                (send gEgo:setHeading(135))
                = cycles 10
            )
            (case 9
                (localSound:
                    number(2147)
                    loop(1)
                    play()
                )
                (outhouseDoor:setCycle(Beg self))
            )
            (case 10
                (if (== global119 13)
                    (send gFpMessager:say(27 0 0 0 self))
                )(else
                    (send gFpMessager:say(43 0 0 0 self))
                )
            )
            (case 11
                (localSound:
                    number(2146)
                    loop(1)
                    play()
                )
                (outhouseDoor:setCycle(End self))
            )
            (case 12
                (send gEgo:setMotion(MoveTo 125 100 self))
            )
            (case 13
                (send gEgo:setHeading(315))
                = cycles 10
            )
            (case 14
                (localSound:
                    number(2147)
                    loop(1)
                    play()
                )
                (outhouseDoor:setCycle(Beg self))
            )
            (case 15
                (send gFpMessager:say(29 0 0 0 self))
            )
            (case 16
                (send gGame:handsOn())
                (windMillBlades:startUpd())
                proc0_4(74)
                (self:dispose())
            )
        )
    )

)
(instance sFirstTimeComtaminated of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                = cycles 1
            )
            (case 1
                = seconds 5
            )
            (case 2
                proc0_3(86)
                (send gFpMessager:say(38 0 0))
                (self:dispose())
            )
        )
    )

)
(instance sRopeMiss of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                = gEgoMoveSpeed (send gEgo:moveSpeed)
                = cycles 1
            )
            (case 1
                (send gEgo:
                    view(321)
                    setHeading(45)
                    loop(0)
                    cel(3)
                    scaleSignal(0)
                    cycleSpeed(9)
                    moveSpeed(9)
                    setCycle(Fwd)
                )
                (localSound:
                    number(2148)
                    loop(-1)
                    play()
                )
                = cycles 40
            )
            (case 2
                (send gEgo:setCycle(End self))
            )
            (case 3
                (localSound:
                    number(2149)
                    loop(1)
                    play()
                )
                (send gEgo:
                    setLoop(2)
                    setCycle(End self)
                )
            )
            (case 4
                (send gEgo:
                    view(800)
                    loop(3)
                    scaleSignal(1)
                    cycleSpeed(gEgoMoveSpeed)
                    moveSpeed(gEgoMoveSpeed)
                    setMotion(0)
                    setCycle(StopWalk -1)
                    setPri(
                        (if ((proc0_2(21) or proc0_2(20)) or proc0_2(45))
                            9
                        )(else
                            -1
                        )
)
                )
                = cycles 1
            )
            (case 5
                (send gGame:handsOn())
                (self:dispose())
            )
        )
    )

)
(instance sRopeTowerTop of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                (send gEgo:put(29))
                = gEgoMoveSpeed (send gEgo:moveSpeed)
                = cycles 1
            )
            (case 1
                (send gEgo:
                    view(321)
                    setHeading(45)
                    setLoop(0)
                    setCel(3)
                    scaleSignal(0)
                    cycleSpeed(9)
                    moveSpeed(9)
                    setCycle(Fwd)
                )
                (localSound:
                    number(2148)
                    loop(-1)
                    play()
                )
                = cycles 40
            )
            (case 2
                (send gEgo:setCycle(End self))
            )
            (case 3
                (localSound:
                    number(2149)
                    loop(1)
                    play()
                )
                (send gEgo:
                    setLoop(1)
                    setCycle(End self)
                )
            )
            (case 4
                (rope:
                    init()
                    stopUpd()
                )
                proc0_3(22)
                (send gEgo:
                    view(800)
                    loop(3)
                    scaleSignal(1)
                    cycleSpeed(gEgoMoveSpeed)
                    moveSpeed(gEgoMoveSpeed)
                    setMotion(0)
                    setCycle(StopWalk -1)
                    setPri(9)
                    put(29)
                )
                = cycles 5
            )
            (case 5
                (send gGame:points(5 138))
                (if (== global119 13)
                    (send gFpMessager:say(40 0 0))
                )(else
                    (send gFpMessager:say(40 0 17))
                )
                = cycles 1
            )
            (case 6
                (send gGame:handsOn())
                (self:dispose())
            )
        )
    )

)
(instance sRopeClimbUp of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                = gEgoMoveSpeed (send gEgo:moveSpeed)
                (send gEgo:
                    view(321)
                    loop(5)
                    cel(0)
                    x(201)
                    y(59)
                    scaleSignal(0)
                    cycleSpeed(12)
                    setCycle(End self)
                )
            )
            (case 1
                (send gEgo:
                    view(322)
                    x(214)
                    y(24)
                    cycleSpeed(gEgoMoveSpeed)
                    moveSpeed(gEgoMoveSpeed)
                    setCycle(Walk)
                )
                = cycles 3
            )
            (case 2
                (send gEgo:stopUpd())
                = cycles 3
            )
            (case 3
                proc0_4(45)
                proc0_3(21)
                (shingle:approachVerbs(4 39))
                (shingle1:approachVerbs(4 39))
                (if (not proc0_2(96) and (== global119 13))
                    (send gFpMessager:say(39 0 0))
                )(else
                    (if (not proc0_2(96))
                        (send gFpMessager:say(39 0 17))
                    )
                )
                = cycles 1
            )
            (case 4
                (if (not proc0_2(96) and (== global119 13))
                    Message(msgGET 320 42 0 18 1 @local12)
                    (send gNarrator:
                        name(@local12)
                        showTitle(1)
                    )
                    (send gFpMessager:say(42 0 0))
                )
                = cycles 1
            )
            (case 5
                (if (not proc0_2(96) and (== global119 13))
                    proc0_3(96)
                    (send gNarrator:showTitle(0))
                )
                = cycles 1
            )
            (case 6
                (send gGame:handsOn())
                (self:dispose())
            )
        )
    )

)
(instance sRopeClimbDown of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                = gEgoMoveSpeed (send gEgo:moveSpeed)
                (send gEgo:setMotion(MoveTo 214 24 self))
            )
            (case 1
                (send gEgo:
                    view(321)
                    loop(5)
                    cel((send gEgo:lastCel()))
                    x(201)
                    y(59)
                    cycleSpeed(12)
                    setCycle(Beg self)
                )
            )
            (case 2
                (send gEgo:
                    view(800)
                    loop(3)
                    x(201)
                    y(59)
                    cycleSpeed(gEgoMoveSpeed)
                    moveSpeed(gEgoMoveSpeed)
                    scaleSignal(1)
                    setCycle(StopWalk -1)
                )
                = cycles 1
            )
            (case 3
                proc0_4(21)
                proc0_3(45)
                (shingle:approachVerbs(0))
                (shingle1:approachVerbs(0))
                (send gGame:handsOn())
                (self:dispose())
            )
        )
    )

)
(instance sUpLowerLadder of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                = gEgoMoveSpeed (send gEgo:moveSpeed)
                (send gEgo:setMotion(PolyPath 271 113 self))
            )
            (case 1
                (send gEgo:
                    view(321)
                    loop(4)
                    cel(0)
                    x(271)
                    y(113)
                    setScale(0)
                    scaleSignal(0)
                    setPri(9)
                    cycleSpeed(12)
                    setCycle(End self)
                )
            )
            (case 2
                (send gEgo:
                    view(800)
                    loop(7)
                    x(235)
                    y(72)
                    scaleSignal(1)
                    scaleX(80)
                    scaleY(80)
                    cycleSpeed(gEgoMoveSpeed)
                    moveSpeed(gEgoMoveSpeed)
                    setPri(9)
                    setCycle(StopWalk -1)
                )
                = cycles 1
            )
            (case 3
                proc0_3(20)
                (waterTower:
                    approachX(240)
                    approachY(70)
                )
                (lowerLadder:
                    approachX(240)
                    approachY(70)
                )
                (spigot:approachVerbs(0))
                (runningH2O:approachVerbs(0))
                (outhouseDoor:approachVerbs(0))
                (send ((send global2:obstacles)):delete(local1))
                (send ((send global2:obstacles)):delete(local2))
                (send ((send global2:obstacles)):delete(local3))
                (send local1:dispose())
                (send local2:dispose())
                (send local3:dispose())
                = cycles 1
            )
            (case 4
                (send gEgo:setMotion(MoveTo 226 74 self))
            )
            (case 5
                (send gEgo:setHeading(180 self))
            )
            (case 6
                = local4 (send ((Polygon:new())):
                        type(3)
                        init(271 65 257 63 241 70 230 72 201 72 165 62 148 64 214 80)
                        yourself()
                    )
                (send global2:addObstacle(local4))
                (send gGame:handsOn())
                (self:dispose())
            )
        )
    )

)
(instance sDownLowerLadder of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                (send gEgo:setMotion(PolyPath 241 71 self))
            )
            (case 1
                (send gEgo:
                    view(321)
                    loop(4)
                    cel((send gEgo:lastCel()))
                    x(271)
                    y(113)
                    scaleSignal(0)
                    setPri(9)
                    cycleSpeed(12)
                    setCycle(Beg self)
                )
            )
            (case 2
                (send gEgo:
                    view(800)
                    x(270)
                    y(118)
                    cycleSpeed(gEgoMoveSpeed)
                    moveSpeed(gEgoMoveSpeed)
                    scaleSignal(1)
                    setScale(Scaler 75 48 182 41)
                    setPri(-1)
                    setCycle(StopWalk -1)
                    setHeading(180)
                )
                = cycles 2
            )
            (case 3
                (send ((send global2:obstacles)):delete(local4))
                (send local4:dispose())
                = local3 (send ((Polygon:new())):
                        type(2)
                        init(172 189 0 189 0 142 118 141 173 161)
                        yourself()
                    )
                = local2 (send ((Polygon:new())):
                        type(2)
                        init(180 189 180 159 243 159 279 189)
                        yourself()
                    )
                (send global2:addObstacle(
                    (if (== global119 13)
(                        = local1 (send ((Polygon:new())):
                                type(2)
                                init(319 189 307 189 307 175 260 148 305 133 266 116 259 118 261 130 232 138 153 119 91 113 88 103 92 98 129 98 128 90 101 93 89 93 67 108 0 109 0 0 319 0)
                                yourself()
                            )
)                    )(else
(                        = local1 (send ((Polygon:new())):
                                type(2)
                                init(319 189 309 189 309 174 263 151 305 133 266 116 259 118 261 130 232 138 141 111 176 92 140 84 112 94 73 109 0 109 0 0 319 0)
                                yourself()
                            )
)                    )
 local2 local2))
                proc0_4(20)
                (waterTower:
                    approachX(270)
                    approachY(118)
                )
                (lowerLadder:
                    approachX(270)
                    approachY(118)
                )
                (outhouseDoor:approachVerbs(4))
                (spigot:approachVerbs(4 34))
                (runningH2O:approachVerbs(4 34))
                (send gGame:handsOn())
                (self:dispose())
            )
        )
    )

)
(instance sGetLowerLadder of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                = gEgoMoveSpeed (send gEgo:moveSpeed)
                (send gEgo:
                    view(321)
                    loop(3)
                    cel(0)
                    scaleSignal(0)
                    cycleSpeed(8)
                    setCycle(CT 4 1 self)
                )
            )
            (case 1
                (lowerLadder:dispose())
                = cycles 1
            )
            (case 2
                (send gEgo:setCycle(CT (send gEgo:lastCel()) 1 self))
            )
            (case 3
                (send gEgo:
                    view(800)
                    loop(2)
                    scaleSignal(1)
                    scaleX(80)
                    scaleY(80)
                    cycleSpeed(gEgoMoveSpeed)
                    setCycle(StopWalk -1)
                    setPri(9)
                )
                = cycles 2
            )
            (case 4
                (send gEgo:
                    get(28 lowerLadder)
                    setMotion(PolyPath 226 74 self)
                )
            )
            (case 5
                (send gEgo:setHeading(180 self))
            )
            (case 6
                (send gGame:handsOn())
                (self:dispose())
            )
        )
    )

)
(instance sPutLowerLadder of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                = gEgoMoveSpeed (send gEgo:moveSpeed)
                (send gEgo:
                    view(321)
                    loop(3)
                    cel(9)
                    setScale(0)
                    cycleSpeed(8)
                    setCycle(CT 4 -1 self)
                )
            )
            (case 1
                (lowerLadder:
                    approachVerbs(4 3)
                    init()
                )
                = cycles 1
            )
            (case 2
                (send gEgo:setCycle(CT 0 -1 self))
            )
            (case 3
                proc0_3(16)
                (send gEgo:
                    view(800)
                    loop(2)
                    put(28)
                    scaleSignal(1)
                    scaleX(80)
                    scaleY(80)
                    cycleSpeed(gEgoMoveSpeed)
                    setPri(9)
                    setCycle(StopWalk -1)
                    setMotion(PolyPath 226 74 self)
                )
            )
            (case 4
                (send gEgo:setHeading(180 self))
            )
            (case 5
                (send gGame:handsOn())
                (send gIconBar:disable(5))
                (self:dispose())
            )
        )
    )

)
(instance sUpHighLadder of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                (send gEgo:setMotion(PolyPath 197 73 self))
            )
            (case 1
                (send gEgo:setMotion(MoveTo 201 59 self))
            )
            (case 2
                proc0_3(45)
                proc0_4(20)
                (highLadder:approachVerbs(0))
                (waterTower:approachVerbs(0))
                (waterTowerTop:approachVerbs(0))
                (send ((send global2:obstacles)):delete(local4))
                (send local4:dispose())
                = local5 (send ((Polygon:new())):
                        type(3)
                        init(172 19 190 24 219 24 229 24 249 20 245 18 231 21 221 17 222 11 201 11)
                        yourself()
                    )
                = local6 (send ((Polygon:new())):
                        type(3)
                        init(196 62 205 62 205 55 196 55)
                        yourself()
                    )
                (send global2:addObstacle(local6 local6))
                = cycles 3
            )
            (case 3
                (if (not proc0_2(100))
                    (send gFpMessager:say(14 0 20))
                    proc0_3(100)
                )
                (User:controls(0))
                (send gEgo:setMotion(0))
                (send gGame:handsOn())
                (self:dispose())
            )
        )
    )

)
(instance sDownHighLadder of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                (send ((send global2:obstacles)):delete(local6))
                (send local6:dispose())
                = cycles 1
            )
            (case 1
                (send gEgo:setMotion(MoveTo 201 59 self))
            )
            (case 2
                (send gEgo:setMotion(PolyPath 197 73 self))
            )
            (case 3
                (send ((send global2:obstacles)):delete(local5))
                (send local5:dispose())
                = local4 (send ((Polygon:new())):
                        type(3)
                        init(271 65 257 63 241 70 230 72 201 72 165 62 148 64 214 80)
                        yourself()
                    )
                (send global2:addObstacle(local4))
                proc0_4(45)
                proc0_3(20)
                (highLadder:approachVerbs(4))
                (waterTower:approachVerbs(36))
                (waterTowerTop:approachVerbs(36))
                (send gGame:handsOn())
                (self:dispose())
            )
        )
    )

)
(instance outhouseDoor of Prop
    (properties
        x 115
        y 86
        noun 4
        approachX 125
        approachY 100
        view 320
        priority 5
        signal $4011
    )

    (method (doVerb theVerb param2)
        (switch (theVerb)
            (case 4
                (if ((proc0_2(45) or proc0_2(20)) or proc0_2(21))
                    (send gFpMessager:say(noun 4 2))
                )(else
                    (if (== global119 13)
                        (switch (Random(0 1))
                            (case 0
                                (send gFpMessager:say(4 0 3 1))
                            )
                            (case 1
                                (send gFpMessager:say(4 0 3 2))
                            )
                        )
                    )(else
                        (if (== cel 0)
                            (localSound:
                                number(2146)
                                loop(1)
                                play()
                            )
                            (self:setCycle(End self))
                            proc0_3(24)
                        )(else
                            (localSound:
                                number(2147)
                                loop(1)
                                play()
                            )
                            (self:setCycle(Beg self))
                            proc0_4(24)
                        )
                    )
                )
            )
            (default 
                (super:doVerb(theVerb rest param2))
            )
        )
    )


    (method (cue)
        (super:cue())
        (self:stopUpd())
        (if (proc0_3(24))
            (switch (local7)
                (case 0
                    (localSound:
                        number(323)
                        loop(-1)
                        play()
                    )
                    (send global2:setInset(inLafferFrame))
                )
                (case 1
                    (send gEgo:setScript(sEnterOuthouse))
                )
                (case 2
                    (send gEgo:setScript(sJudgeCrapping))
                )
            )
        )
    )

)
(instance shingle1 of Feature
    (properties
        x 229
        y 17
        noun 5
        nsTop 9
        nsLeft 225
        nsBottom 20
        nsRight 240
        approachX 215
        approachY 19
    )

    (method (doVerb theVerb)
        (shingle:doVerb(theVerb))
    )

)
(instance shingle of Prop
    (properties
        x 229
        y 17
        noun 5
        approachX 215
        approachY 19
        view 320
        loop 4
        priority 8
        signal $4011
        cycleSpeed 12
    )

    (method (doVerb theVerb param2)
        (switch (theVerb)
            (case 4
                (if (proc0_2(21))
                    (send gEgo:setScript(sOpenHatch))
                )(else
                    (send gFpMessager:say(noun 4 2))
                )
            )
            (case 39
                (if (proc0_2(21))
                    (if (== (shingle:cel) 0)
                        (send gFpMessager:say(noun 39 6))
                    )(else
                        (send global2:setScript(sPourSolution))
                    )
                )(else
                    (send gFpMessager:say(noun 39 2))
                )
            )
            (case 38
                (send gEgo:setScript(sRopeMiss))
            )
            (default 
                (super:doVerb(theVerb rest param2))
            )
        )
    )

)
(instance jimLaffer of Prop
    (properties
        x 139
        y 71
        view 323
        loop 1
        priority 14
        signal $0010
    )

    (method (init)
        (super:init())
        (self:setScript(sLafferReading))
    )

)
(instance person1 of Prop
    (properties
        x 143
        y 93
        noun 21
        view 324
        loop 1
        signal $4000
        detailLevel 2
    )

    (method (init)
        (super:init())
        (if (> (send gGame:detailLevel()) 2)
            (self:setScript((sGottaGoPee:new())))
        )
    )

)
(instance person2 of Prop
    (properties
        x 129
        y 108
        noun 22
        view 324
        loop 2
        signal $4000
        detailLevel 2
    )

    (method (init)
        (super:init())
        (if (> (send gGame:detailLevel()) 2)
            (self:setScript((sGottaGoPee:new())))
        )
    )

)
(instance person3 of Prop
    (properties
        x 110
        y 109
        noun 23
        view 324
        loop 3
        signal $4000
        detailLevel 2
    )

    (method (init)
        (super:init())
        (if (> (send gGame:detailLevel()) 2)
            (self:setScript((sGottaGoPee:new())))
        )
    )

)
(instance windMillBlades of Prop
    (properties
        x 2
        y 107
        z 100
        noun 12
        view 320
        loop 2
        priority 15
        signal $0010
        detailLevel 2
    )
)
(instance waterDrop of Prop
    (properties
        x 172
        y 119
        view 320
        loop 1
        priority 8
        signal $0010
    )
)
(instance runningH2O of Prop
    (properties
        x 172
        y 116
        z -10
        noun 37
        approachX 162
        approachY 118
        view 320
        loop 5
        priority 7
        signal $4010
    )

    (method (doVerb theVerb param2)
        (switch (theVerb)
            (case 34
                (if ((proc0_2(45) or proc0_2(20)) or proc0_2(21))
                    (send gFpMessager:say(34 0 13))
                )(else
                    (if (< global119 13)
                        (send gFpMessager:say(noun 34 12))
                    )(else
                        (if (proc0_2(94) and (== global119 13))
                            (send gEgo:put(18))
                            (send gEgo:get(-1 57 1))
                            (send gGame:points(1 135))
                            (send gFpMessager:say(noun 34 0))
                        )(else
                            (if (== global119 13)
                                (send gFpMessager:say(noun 34 16))
                            )(else
                                (send gFpMessager:say(noun 34 11))
                            )
                        )
                    )
                )
            )
            (case 4
                (if ((proc0_2(45) or proc0_2(20)) or proc0_2(21))
                    (send gFpMessager:say(34 0 13))
                )(else
                    (super:doVerb(theVerb rest param2))
                )
            )
            (default 
                (super:doVerb(theVerb rest param2))
            )
        )
    )


    (method (cue)
        (if (proc0_2(94))
            (waterDrop:dispose())
            (dripSound:
                number(2947)
                loop(-1)
                play()
            )
            (runningH2O:
                init()
                approachVerbs(4 9)
                setCycle(Fwd)
            )
        )(else
            (waterDrop:
                init()
                hide()
                setScript(sWaterDripping)
            )
            (dripSound:stop())
            proc0_4(94)
            (self:
                setScript(0)
                dispose()
            )
        )
    )

)
(instance dummyCredits of Prop
    (properties
        x -10
        y -10
        view 996
    )
)
(instance lowerLadder of View
    (properties
        x 258
        y 97
        noun 15
        approachX 270
        approachY 118
        view 320
        loop 3
        cel 1
        priority 8
        signal $4011
    )

    (method (init)
        (super:init())
        (send gOldWH:add(lowerLadder))
    )


    (method (doit)
        (var temp0, temp1[21])
        = temp0 (send ((send gUser:curEvent)):new())
        (send temp0:localize())
        (if ((send gEgo:script) or (send global2:script))
        )(else
            (if (((send gEgo:inRect(237 55 257 80)) and (== (send temp0:type) 4)) and proc999_5((send temp0:message) 20736 19712))
                (send gEgo:setScript(sDownLowerLadder))
            )(else
                (if ((((send gEgo:inRect(256 112 277 119)) and (== (send temp0:type) 4)) and not proc0_2(20)) and proc999_5((send temp0:message) 18176 18432))
                    (send gEgo:setScript(sUpLowerLadder))
                )
            )
        )
        (send temp0:dispose())
        (super:doit())
    )


    (method (doVerb theVerb)
        (switch (theVerb)
            (case 3
                (if (proc0_2(20))
                    (send gEgo:setScript(sDownLowerLadder))
                )(else
                    (send gEgo:setScript(sUpLowerLadder))
                )
            )
            (case 4
                (if (proc0_2(20))
                    (send gEgo:setScript(sGetLowerLadder))
                )(else
                    (send gEgo:get(28 lowerLadder 2 self))
                    proc0_4(16)
                )
            )
            (default 
                (super:doVerb(theVerb))
            )
        )
    )

)
(instance highLadder of View
    (properties
        x 201
        y 57
        noun 14
        approachX 197
        approachY 73
        view 320
        loop 3
        priority 8
        signal $4011
    )

    (method (init)
        (send gOldWH:addToFront(highLadder))
        (super:init())
    )


    (method (doit)
        (var temp0, temp1[21])
        = temp0 (send ((send gUser:curEvent)):new())
        (send temp0:localize())
        (if ((send gEgo:script) or (send global2:script))
        )(else
            (if ((((send gEgo:inRect(192 67 210 79)) and not proc0_2(45)) and (== (send temp0:type) 4)) and proc999_5((send temp0:message) 18432 18688))
                proc921_1("sUpHighLadder in highLadder doit:")
                (send gEgo:setScript(sUpHighLadder))
            )(else
                (if ((proc0_2(45) and (== (send temp0:type) 4)) and proc999_5((send temp0:message) 20480 20224))
                    proc921_1("sDownHighLadder in doit:")
                    (send gEgo:setScript(sDownHighLadder))
                )
            )
        )
        (send temp0:dispose())
        (super:doit())
    )


    (method (doVerb theVerb)
        (switch (theVerb)
            (case 3
                (if (not proc0_2(21))
                    (if (proc0_2(45))
                        proc0_4(45)
                        (send gEgo:setScript(sDownHighLadder))
                    )(else
                        (send gEgo:setScript(sUpHighLadder))
                    )
                )(else
                    (send gFpMessager:say(noun theVerb 0))
                )
            )
            (case 4
                (if (not proc0_2(21))
                    (if (proc0_2(45))
                        (send gFpMessager:say(noun theVerb 9))
                    )(else
                        (send gEgo:get(28 lowerLadder))
                        (highLadder:dispose())
                    )
                )(else
                    (super:doVerb(theVerb))
                )
            )
            (default 
                (super:doVerb(theVerb))
            )
        )
    )

)
(instance rope of View
    (properties
        x 209
        y 4
        noun 24
        view 321
        loop 6
        priority 8
        signal $4010
    )

    (method (doVerb theVerb param2)
        (switch (theVerb)
            (case 4
                (if (proc0_2(21))
                    (send gEgo:setScript(sRopeClimbDown))
                )(else
                    (if (proc0_2(45))
                        (send gEgo:setScript(sRopeClimbUp))
                    )(else
                        (send gFpMessager:say(noun theVerb 2))
                    )
                )
            )
            (default 
                (super:doVerb(theVerb rest param2))
            )
        )
    )

)
(instance peopleInLine of View
    (properties
        x 132
        y 59
        noun 17
        view 324
        signal $4000
    )
)
(instance waterTower of Feature
    (properties
        x 222
        y 89
        noun 2
        approachX 270
        approachY 118
    )

    (method (doVerb theVerb)
        (switch (theVerb)
            (case 36
                (if (proc0_2(20))
                    (send gEgo:setScript(sPutLowerLadder))
                )(else
                    (lowerLadder:
                        approachVerbs(4 3)
                        init()
                    )
                    (send gEgo:put(28))
                    (send gGame:points(2 136))
                    proc0_3(16)
                )
            )
            (case 38
                (if (proc0_2(45))
                    (send gFpMessager:say(noun theVerb 9))
                )(else
                    (send gEgo:setScript(sRopeMiss))
                )
            )
            (case 4
                (if (proc0_2(20) and (send gOldCast:contains(lowerLadder)))
                    (send gEgo:setScript(sDownLowerLadder))
                )(else
                    (if (not proc0_2(20) and (send gOldCast:contains(lowerLadder)))
                        (send gEgo:setScript(sUpLowerLadder))
                    )(else
                        (super:doVerb(theVerb))
                    )
                )
            )
            (default 
                (super:doVerb(theVerb))
            )
        )
    )

)
(instance waterTowerTop of Feature
    (properties
        x 229
        y 41
        noun 1
        approachX 197
        approachY 73
    )

    (method (doVerb theVerb)
        (switch (theVerb)
            (case 36
                (if (proc0_2(20))
                    (highLadder:
                        approachVerbs(4)
                        init()
                    )
                    (send gGame:points(4 137))
                    (send gEgo:put(28))
                    (send gIconBar:disable(5))
                )(else
                    (send gFpMessager:say(noun theVerb 2))
                )
            )
            (case 38
                (send gEgo:setScript(sRopeMiss))
            )
            (case 4
                (if (proc0_2(45) and (send gOldCast:contains(highLadder)))
                    (send gEgo:setScript(sDownHighLadder))
                )(else
                    (if (proc0_2(20) and (send gOldCast:contains(highLadder)))
                        (send gEgo:setScript(sUpHighLadder))
                    )(else
                        (if (proc0_2(20) and (send gOldCast:contains(lowerLadder)))
                            (send gEgo:setScript(sDownLowerLadder))
                        )(else
                            (if (not proc0_2(20) and (send gOldCast:contains(lowerLadder)))
                                (send gEgo:setScript(sUpLowerLadder))
                            )(else
                                (super:doVerb(theVerb))
                            )
                        )
                    )
                )
            )
            (default 
                (super:doVerb(theVerb))
            )
        )
    )

)
(instance towerTop of Feature
    (properties
        x 210
        y 43
        noun 20
        nsLeft 205
        nsBottom 7
        nsRight 215
    )

    (method (doVerb theVerb param2)
        (switch (theVerb)
            (case 38
                (if (proc0_2(45))
                    (send gEgo:setScript(sRopeTowerTop))
                )(else
                    (send gEgo:setScript(sRopeMiss))
                )
            )
            (default 
                (super:doVerb(theVerb rest param2))
            )
        )
    )

)
(instance waterTowerRoof of Feature
    (properties
        x 229
        y 3
        noun 13
    )

    (method (doVerb theVerb param2)
        (switch (theVerb)
            (case 4
                (if (proc0_2(45) or proc0_2(21))
                    (super:doVerb(4 rest param2))
                )(else
                    (send gFpMessager:say(noun 4 2))
                )
            )
            (case 38
                (send gEgo:setScript(sRopeMiss))
            )
            (default 
                (super:doVerb(theVerb rest param2))
            )
        )
    )

)
(instance spigot of Feature
    (properties
        x 174
        y 115
        noun 16
        nsTop 105
        nsLeft 170
        nsBottom 115
        nsRight 181
        approachX 162
        approachY 118
    )

    (method (doVerb theVerb param2)
        (switch (theVerb)
            (case 23
                (if ((proc0_2(45) or proc0_2(20)) or proc0_2(21))
                    (send gFpMessager:say(34 0 13))
                )(else
                    (send gFpMessager:say(noun 34 7))
                )
            )
            (case 4
                (if ((proc0_2(45) or proc0_2(20)) or proc0_2(21))
                    (send gFpMessager:say(34 0 13))
                )(else
                    (if (proc0_2(94))
                        proc0_4(94)
                        (send gFpMessager:say(noun theVerb 15 0 runningH2O))
                    )(else
                        (if (not proc0_2(94))
                            proc0_3(94)
                            (send gFpMessager:say(noun theVerb 14 0 runningH2O))
                        )
                    )
                )
            )
            (default 
                (super:doVerb(theVerb rest param2))
            )
        )
    )

)
(instance pulley of Feature
    (properties
        x 278
        y 177
        noun 35
        nsTop 166
        nsLeft 262
        nsBottom 189
        nsRight 295
    )
)
(instance outhouse of Feature
    (properties
        x 120
        y 86
        noun 3
    )
)
(instance topBuilding of Feature
    (properties
        x 108
        y 150
        noun 8
    )
)
(instance bottomBuilding of Feature
    (properties
        x 135
        y 174
        noun 7
    )
)
(instance eastBuilding of Feature
    (properties
        x 309
        y 120
        noun 9
    )
)
(instance wagon of Feature
    (properties
        x 74
        y 60
        noun 6
    )
)
(instance windMill of Feature
    (properties
        x 38
        y 102
        noun 10
    )
)
(instance house1 of Feature
    (properties
        x 300
        y 1
        noun 30
    )
)
(instance mine of Feature
    (properties
        x 160
        y 1
        noun 33
    )
)
(instance machines of Feature
    (properties
        x 160
        y 1
        noun 32
    )
)
(instance house2 of Feature
    (properties
        x 160
        y 1
        noun 31
    )
)
(instance inLafferFrame of Inset
    (properties
        view 323
        loop 2
        x 96
        y 7
        priority 13
        disposeNotOnMe 1
    )

    (method (init param1)
        (super:init(rest param1))
        (send gEgo:stopUpd())
        (jimLaffer:
            setLoop(1)
            init()
        )
    )


    (method (dispose)
        (super:dispose())
        (jimLaffer:dispose())
        (localSound:fade())
        (send gEgo:show())
        (outhouseDoor:doVerb(4))
    )

)
(instance dripSound of FPSound
    (properties
        flags $0001
    )
)
(instance localSound of FPSound
    (properties
        flags $0001
    )
)
