(include "sci.sh")
(use "Main")
(use "Scaler")
(use "CueObj")
(use "Cycle")
(use "View")
(use "Obj")
(script 501)


(local
    local0
    local1
    local2
    local3

)
(instance public sVictimExit of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (= seconds 1  )
            )
            (case 1
                ((send (ScriptID(500 1)):setCycle(End self))  )
            )
            (case 2
                ((send (ScriptID(500 1)):
                    view(508)
                    setLoop(0)
                    cel(0)
                    setScale(Scaler 80 80 157 109)
                    x(182)
                    y(136)
                    setPri(13)
                )
 = cycles 1  )
            )
            (case 3
                ((send (ScriptID(500 1)):
                    setCycle(Fwd)
                    cycleSpeed(6)
                    setPri(11)
                    setMotion(MoveTo 214 129 self)
                )
  )
            )
            (case 4
                ((send (ScriptID(500 1)):
                    setStep(6 6)
                    setMotion(MoveTo 237 118 self)
                )
  )
            )
            (case 5
                ((send (ScriptID(500 1)):
                    setLoop(1)
                    cel(15)
                    setCycle(0)
                )
 = cycles 1  )
            )
            (case 6
                ((self:dispose()) )
            )
        )
    )

)
(instance public sVictimGuardExit of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send (ScriptID(500 2)):
                    view(507)
                    setLoop(11)
                    cel(0)
                    x(139)
                    y(131)
                    setScale(Scaler 103 85 146 131)
                )
 = seconds 1  )
            )
            (case 1
                ((send (ScriptID(500 2)):
                    view(511)
                    setLoop(3)
                    cel(0)
                    x(139)
                    y(131)
                    setPri(13)
                    setCycle(Fwd)
                    setMotion(MoveTo 167 147 self)
                )
  )
            )
            (case 2
                ((send (ScriptID(500 2)):
                    view(511)
                    setLoop(0)
                    cel(0)
                    setPri(13)
                    setMotion(MoveTo 340 147 self)
                )
  )
            )
            (case 3
                ((send (ScriptID(500 2)):dispose()) (self:dispose()) )
            )
        )
    )

)
(instance public sGlob1 of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (
                (if (< (send gSQ5:detailLevel()) (send (ScriptID(500 3)):detailLevel()))
                    (send (ScriptID(500 3)):stopUpd())
                    --state
                )
 = seconds Random(1 4)  )
            )
            (case 1
                ((send (ScriptID(500 3)):setMotion(MoveTo 188 2 self))  )
            )
            (case 2
                ((send (ScriptID(500 3)):setMotion(MoveTo 212 3 self))  )
            )
            (case 3
                ((send (ScriptID(500 3)):setMotion(MoveTo 188 83 self))  )
            )
            (case 4
                (= state -1 = cycles 2 )
            )
        )
    )

)
(instance public sGlob2 of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (
                (if (< (send gSQ5:detailLevel()) (send (ScriptID(500 4)):detailLevel()))
                    (send (ScriptID(500 4)):stopUpd())
                    --state
                )
 = seconds 1  )
            )
            (case 1
                ((send (ScriptID(500 4)):setMotion(MoveTo 200 86 self))  )
            )
            (case 2
                (= seconds Random(1 4)  )
            )
            (case 3
                ((send (ScriptID(500 4)):setMotion(MoveTo 178 1 self))  )
            )
            (case 4
                ((send (ScriptID(500 4)):setMotion(MoveTo 210 1 self))  )
            )
            (case 5
                (= state -1 = cycles 2 )
            )
        )
    )

)
(instance public sGuys of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (
                (if (< (send gSQ5:detailLevel()) (guy1Mouth:detailLevel()))
                    (guy1Mouth:stopUpd())
                    --state
                )(else
                    (guy1Mouth:
                        setCycle(Fwd)
                        init()
                    )
                )
 = cycles 1  )
            )
            (case 1
                (= seconds Random(1 6)  )
            )
            (case 2
                ((guy1Mouth:setCycle(End self))  )
            )
            (case 3
                (= seconds Random(1 6)  )
            )
            (case 4
                (= state -1 = cycles 1 )
            )
        )
    )

)
(instance public sDroidExit of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((droid:setMotion(MoveTo 122 88 self))  )
            )
            (case 1
                ((droid:
                    setPri(3)
                    setMotion(MoveTo 74 80 self)
                )
  )
            )
            (case 2
                ((droid:dispose()) (self:dispose()) )
            )
        )
    )

)
(instance public droid of Actor
    (properties
        x 106
        y 96
        view 501
        loop 8
        priority 10
    )

    (method (init param1)
        (super:init(rest param1))
        (self:
            setLoop(8)
            setCycle(Fwd)
            cycleSpeed(10)
            setStep(6 6)
            setScale(Scaler 100 80 96 80)
        )
    )

)
(instance public guy1 of View
    (properties
        x 208
        y 140
        noun 1
        view 515
        loop 11
        priority 14
        signal 16
    )
)
(instance public guy1Mouth of Prop
    (properties
        x 216
        y 161
        noun 1
        view 515
        loop sVictimExit
        cel 2
        priority 14
        signal 16400
        detailLevel 2
    )

    (method (init param1)
        (super:init(rest param1))
        (self:setLoop(12))
    )

)
(instance public smallmonk of Actor
    (properties
        x 107
        y 78
        view 504
        loop sVictimExit
        priority 15
        signal 16400
    )

    (method (init param1)
        (super:init(rest param1))
    )

)
(instance public tinymonk1 of Actor
    (properties
        x 65526
        view 504
        loop sVictimExit
        priority sVictimExit
        signal 16400
        illegalBits 0
    )

    (method (init param1)
        (switch (Random(0 1))
            (case 0
                ((super:init(rest param1)) (self:
                    setLoop(12)
                    x(65526)
                    y(Random(10 180))
                    setMotion(MoveTo 330 Random(10 180) self)
                )
  )
            )
            (case 1
                ((super:init(rest param1)) (self:
                    setLoop(12)
                    x(330)
                    y(Random(10 180))
                    setMotion(MoveTo 65526 Random(10 180) self)
                )
 )
            )
        )
    )


    (method (cue)
        (self:init())
    )

)
(instance public tinymonk2 of Actor
    (properties
        x 107
        y 78
        view 504
        loop 13
        priority sVictimExit
        signal 16400
        illegalBits 0
    )

    (method (init param1)
        (switch (Random(0 1))
            (case 0
                ((super:init(rest param1)) (self:
                    setLoop(12)
                    x(65526)
                    y(Random(0 180))
                    setMotion(MoveTo 330 Random(10 200) self)
                )
  )
            )
            (case 1
                ((super:init(rest param1)) (self:
                    setLoop(12)
                    x(330)
                    y(Random(0 200))
                    setMotion(MoveTo 65526 Random(0 200) self)
                )
 )
            )
        )
    )


    (method (cue)
        (self:init())
    )

)
(instance public tinymonk3 of Actor
    (properties
        x 107
        y 78
        view 504
        loop 13
        priority sVictimExit
        signal 16400
        illegalBits 0
    )

    (method (init param1)
        (switch (Random(0 1))
            (case 0
                ((super:init(rest param1)) (self:
                    setLoop(12)
                    x(65526)
                    y(Random(0 180))
                    setMotion(MoveTo 330 Random(10 200) self)
                )
  )
            )
            (case 1
                ((super:init(rest param1)) (self:
                    setLoop(12)
                    x(330)
                    y(Random(0 200))
                    setMotion(MoveTo 65526 Random(0 200) self)
                )
 )
            )
        )
    )


    (method (cue)
        (self:init())
    )

)
(instance public tinymonk4 of Actor
    (properties
        x 107
        y 78
        view 504
        loop 13
        priority sVictimExit
        signal 16400
        illegalBits 0
    )

    (method (init param1)
        (switch (Random(0 1))
            (case 0
                ((super:init(rest param1)) (self:
                    setLoop(12)
                    x(65526)
                    y(Random(0 180))
                    setMotion(MoveTo 330 Random(10 200) self)
                )
  )
            )
            (case 1
                ((super:init(rest param1)) (self:
                    setLoop(12)
                    x(330)
                    y(Random(0 200))
                    setMotion(MoveTo 65526 Random(0 200) self)
                )
 )
            )
        )
    )


    (method (cue)
        (self:init())
    )

)
(instance public monkswim of Actor
    (properties
        noun 19
        view 505
        cel 4
        priority 13
        signal 18448
        illegalBits 0
    )

    (method (init param1)
        (switch (Random(0 3))
            (case 0
                (= local1 200 = local0 Random(0 100) = local3 0 = local2 Random(200 320) (self:
                    setLoop(0)
                    x(local0)
                    y(local1)
                    setPri(13)
                    setMotion(MoveTo local2 local3 self)
                )
  )
            )
            (case 1
                (= local1 200 = local0 Random(220 320) = local3 0 = local2 Random(0 100) (self:
                    setLoop(1)
                    x(local0)
                    y(local1)
                    setPri(13)
                    setMotion(MoveTo local2 local3 self)
                )
  )
            )
            (case 2
                (= local1 0 = local0 Random(0 100) = local3 200 = local2 Random(200 320) (self:
                    setLoop(2)
                    x(local0)
                    y(local1)
                    setPri(13)
                    setMotion(MoveTo local2 local3 self)
                )
  )
            )
            (case 3
                (= local1 0 = local0 Random(220 320) = local3 200 = local2 Random(0 100) (self:
                    setLoop(3)
                    x(local0)
                    y(local1)
                    setPri(13)
                    setMotion(MoveTo local2 local3 self)
                )
 )
            )
        )
        (super:init(rest param1))
    )


    (method (cue)
        (self:init())
    )

)
(instance public monkswim2 of Actor
    (properties
        noun 19
        view 505
        cel 4
        priority 13
        signal 18448
        illegalBits 0
    )

    (method (init param1)
        (switch (Random(0 3))
            (case 0
                (= local1 200 = local0 Random(0 100) = local3 0 = local2 Random(200 320) (self:
                    setLoop(0)
                    x(local0)
                    y(local1)
                    setPri(13)
                    setMotion(MoveTo local2 local3 self)
                )
  )
            )
            (case 1
                (= local1 200 = local0 Random(220 320) = local3 0 = local2 Random(0 100) (self:
                    setLoop(1)
                    x(local0)
                    y(local1)
                    setPri(13)
                    setMotion(MoveTo local2 local3 self)
                )
  )
            )
            (case 2
                (= local1 0 = local0 Random(0 100) = local3 200 = local2 Random(200 320) (self:
                    setLoop(2)
                    x(local0)
                    y(local1)
                    setPri(13)
                    setMotion(MoveTo local2 local3 self)
                )
  )
            )
            (case 3
                (= local1 0 = local0 Random(220 320) = local3 200 = local2 Random(0 100) (self:
                    setLoop(3)
                    x(local0)
                    y(local1)
                    setPri(13)
                    setMotion(MoveTo local2 local3 self)
                )
 )
            )
        )
        (super:init(rest param1))
    )


    (method (cue)
        (self:init())
    )

)
(instance public theNukem of Feature
    (properties
        x 70
        y sVictimExit
        noun 10
        modNum 500
        onMeCheck 32
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 1
                ((send gTestMessager:say(10 param1 0 0))  )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance public theStairs of Feature
    (properties
        x 10
        y 128
        noun 22
        modNum 500
        onMeCheck 16
        approachX 40
        approachY 150
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 3
                (
                (switch (global167)
                    (case 0
                        ((send gRoom:setScript(ScriptID(500 5)))  )
                    )
                    (case 1
                        ((send gRoom:setScript(ScriptID(500 5)))  )
                    )
                    (case 2
                        ((send gRoom:setScript(ScriptID(500 11))) )
                    )
                )
  )
            )
            (case 4
                (
                (switch (global167)
                    (case 0
                        ((send gRoom:setScript(ScriptID(500 5)))  )
                    )
                    (case 1
                        ((send gRoom:setScript(ScriptID(500 5)))  )
                    )
                    (case 2
                        ((send gRoom:setScript(ScriptID(500 11))) )
                    )
                )
  )
            )
            (case 1
                ((send gTestMessager:say(22 param1 0 0 500))  )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance public theQuirk of Feature
    (properties
        x 245
        y 10
        noun 15
        nsTop 2
        nsLeft 245
        nsBottom 15
        nsRight 261
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 1
                (
                (if (proc0_1(53))
                    (send gTestMessager:say(15 param1 0 0 500))
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance public theAlien of Feature
    (properties
        x 245
        y 190
        noun 2
        modNum 500
        nsTop 2
        nsLeft 265
        nsBottom 15
        nsRight 291
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 1
                (
                (if (proc0_1(53))
                    (send gTestMessager:say(2 param1 0 0 500))
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance public thePatrons1 of Feature
    (properties
        x 10
        y sVictimExit
        noun 11
        modNum 500
        onMeCheck 512
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 1
                (
                (if (not proc0_1(54))
                    (send gTestMessager:say(11 param1 0 0 500))
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance public thePatrons2 of Feature
    (properties
        x 150
        y 50
        noun sVictimExit
        modNum 500
        onMeCheck 1024
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 1
                (
                (if (not proc0_1(54))
                    (send gTestMessager:say(12 param1 0 0 500))
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance public thePlants of Feature
    (properties
        x 180
        y sVictimExit
        noun 13
        onMeCheck 256
    )
)
(instance public theLamp of Feature
    (properties
        x 76
        y 108
        noun 8
        modNum 500
        nsTop 22
        nsLeft 168
        nsBottom 89
        nsRight 219
    )
)
(instance public theBar of Feature
    (properties
        x 160
        y 90
        noun 4
        modNum 500
        nsTop 95
        nsLeft 157
        nsBottom 110
        nsRight 240
    )
)
(instance public theTeleporter of Feature
    (properties
        x 260
        y 95
        noun 24
        modNum 500
        onMeCheck 64
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 3
                (
                (if (proc0_1(62))
                    (send gRoom:setScript(ScriptID(500 8)))
                )(else
                    (send gRoom:setScript(ScriptID(500 7)))
                )
 )
            )
            (case 4
                (
                (if (proc0_1(62))
                    (send gRoom:setScript(ScriptID(500 8)))
                )(else
                    (send gRoom:setScript(ScriptID(500 7)))
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance public theTable of Feature
    (properties
        x 76
        y 108
        noun 23
        modNum 500
        nsTop 85
        nsLeft 52
        nsBottom 124
        nsRight 102
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 3
                (
                (if (not proc0_1(62) and not proc0_1(54))
                    (send gRoom:setScript(ScriptID(500 9)))
                )
 
                (if (proc0_1(62) and not proc0_1(54))
                    (send gRoom:newRoom(520))
                )
 )
            )
            (case 4
                (
                (if (not proc0_1(62) and not proc0_1(54))
                    (send gRoom:setScript(ScriptID(500 9)))
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance public theDetention of Feature
    (properties
        x 310
        y 180
        nsTop 55
        nsLeft 305
        nsBottom 162
        nsRight 320
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 3
                (
                (switch (global167)
                    (case 1
                        ((send gRoom:setScript(ScriptID(500 12)))  )
                    )
                    (case 2
                        ((send gRoom:setScript(ScriptID(500 12)))  )
                    )
                    (case 0
                        ((send gRoom:setScript(ScriptID(500 12))) )
                    )
                )
  )
            )
            (case 4
                (
                (switch (global167)
                    (case 1
                        ((send gRoom:setScript(ScriptID(500 12)))  )
                    )
                    (case 2
                        ((send gRoom:setScript(ScriptID(500 12)))  )
                    )
                    (case 0
                        ((send gRoom:setScript(ScriptID(500 12))) )
                    )
                )
  )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance public theSprint of Feature
    (properties
        x 310
        y sGlob1
        noun 21
        modNum 500
        nsTop 70
        nsLeft 274
        nsBottom 120
        nsRight 319
    )
)
