(version 2)
(include "sci.sh")
(exports
    0 rm720
    1 droppedThemTimer
)
(use "Main")
(use "FPRoom")
(use "Scaler")
(use "CueObj")
(use "n958")
(use "StopWalk")
(use "Timer")
(use "Cycle")
(use "View")
(use "Obj")
(script 720)



(instance public rm720 of FPRoom
    (properties
        noun 23
        picture 720
        horizon 0
        north 730
        south 260
    )

    (method (init)
        (send gEgo:
            init()
            x(340)
            y(150)
            normalize()
            setHeading(0)
            setSpeed(7)
            scaleSignal(1)
            scaleX(98)
            scaleY(98)
        )
        (send gGameMusic1:
            number(721)
            flags(1)
            loop(-1)
            play()
        )
        (super:init())
        (send gGame:handsOff())
        (penelope:
            init()
            setScale(Scaler 97 75 172 143)
        )
        (bigMap:init())
        (bookshelf:init())
        (bucket:init())
        (closedWindow:init())
        (kidPix:init())
        (openWindow:init())
        (smallMap:init())
        (washington:init())
        (sword1:
            init()
            stopUpd()
        )
        (sword2:
            init()
            stopUpd()
        )
        (schoolbook:
            init()
            stopUpd()
        )
        (schoolbook2:
            init()
            stopUpd()
        )
        (box:
            init()
            stopUpd()
        )
        (slate:
            init()
            stopUpd()
        )
        (basementDoor:
            init()
            stopUpd()
        )
        (bench:
            init()
            setOnMeCheck(1 2)
        )
        (bigDesk:
            init()
            setOnMeCheck(1 4)
        )
        (blackBoard:
            init()
            setOnMeCheck(1 8)
        )
        (book1:
            init()
            setOnMeCheck(1 16)
        )
        (book2:
            init()
            setOnMeCheck(1 32)
        )
        (book3:
            init()
            setOnMeCheck(1 64)
        )
        (broom:
            init()
            setOnMeCheck(1 128)
        )
        (coatrack:
            init()
            setOnMeCheck(1 256)
        )
        (desks:
            init()
            setOnMeCheck(1 512)
        )
        (flag:
            init()
            setOnMeCheck(1 1024)
        )
        (globe:
            init()
            setOnMeCheck(1 2048)
        )
        (lamp:
            init()
            setOnMeCheck(1 4096)
        )
        (paintbrushes:
            init()
            setOnMeCheck(1 8192)
        )
        (stove:
            init()
            setOnMeCheck(1 16384)
        )
        (smallPix:
            init()
            setOnMeCheck(1 2)
        )
        (smallPix2:
            init()
            setOnMeCheck(1 2)
        )
        (smallPix3:
            init()
            setOnMeCheck(1 2)
        )
        (woodCarrier:
            init()
            setOnMeCheck(1 4)
        )
        (self:setScript(sEndGame))
    )


    (method (notify)
        (send global2:setScript(sFreddyDropsGuns))
    )

)
(instance sFreddyDropsGuns of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                = ticks 30
            )
            (case 1
                (send gGame:handsOff())
                (send gTimers:delete(droppedThemTimer))
                proc958_0(132 2748)
                = cycles 1
            )
            (case 2
                (send gFpMessager:say(20 4 5 0 self))
            )
            (case 3
                (send gEgo:
                    view(724)
                    setLoop(0)
                    setCel(0)
                    setScale(0)
                    put(44)
                    setCycle(End self)
                )
            )
            (case 4
                (localSound:
                    number(2748)
                    play()
                )
                = cycles 5
            )
            (case 5
                (send gGame:handsOn())
                (getSlateTimer:setReal(getSlateTimer 10))
                (send gUser:canControl(0))
                (send gIconBar:disable(0))
                (self:dispose())
            )
        )
    )

)
(instance sEndGame of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc958_0(132 741 2101)
                (penelope:
                    view(726)
                    loop(0)
                    cel(0)
                    setSpeed(10)
                    setCycle(Fwd)
                )
                (send gEgo:setMotion(MoveTo 270 167 self))
            )
            (case 1
                UnLoad(128 842)
                (send gEgo:
                    view(728)
                    loop(1)
                    cel(0)
                    scaleSignal(0)
                    stopUpd()
                )
                = cycles 3
            )
            (case 2
                (send (ScriptID(1814 57)):
                    x(190)
                    y(5)
                    textX(-165)
                    textY(120)
                    talkWidth(265)
                    modeless(1)
                )
                (send gFpMessager:say(17 0 0 1 3 self))
            )
            (case 3
                (penelope:
                    view(802)
                    setCycle(StopWalk -1)
                    setSpeed(7)
                    setHeading(135)
                )
                UnLoad(128 726)
                = cycles 50
            )
            (case 4
                (send gFpMessager:say(17 0 0 4 10 self))
            )
            (case 5
                (penelope:setMotion(MoveTo 66 112 self))
            )
            (case 6
                (penelope:setMotion(MoveTo 132 120 self))
            )
            (case 7
                (send (ScriptID(1814 57)):textY(140))
                (send gFpMessager:say(17 0 0 11 14 self))
                (penelope:
                    view(721)
                    loop(0)
                    cel(0)
                    setCycle(End self)
                )
                UnLoad(128 802)
            )
            (case 8
            )
            (case 9
                (send gFpMessager:say(17 0 0 15 19 self))
                (penelope:
                    view(721)
                    loop(1)
                    cel(0)
                    setSpeed(10)
                    setCycle(CT 2 1 self)
                )
                UnLoad(128 802)
            )
            (case 10
            )
            (case 11
                (send gFpMessager:say(17 0 0 20 22 self))
                (pennySound:
                    number(741)
                    play()
                )
                (penelope:
                    view(721)
                    loop(1)
                    cel(3)
                    setCycle(End self)
                )
            )
            (case 12
            )
            (case 13
                (droppedThemTimer:setReal(droppedThemTimer 10))
                (send (ScriptID(1814 57)):modeless(0))
                (send gUser:canControl(0))
                (penelope:stopUpd())
                (send gGame:handsOn())
                (send gIconBar:disable(0))
                (self:dispose())
            )
        )
    )

)
(instance sFreddyAndSlate of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                proc958_0(132 2101 2760 2743)
                (send gFpMessager:say(18 0 0 1 self))
            )
            (case 1
                (send gGame:points(10))
                (send gEgo:
                    view(725)
                    setLoop(0)
                    setCel(0)
                    setScale(0)
                    setCycle(CT 2 1 self)
                )
            )
            (case 2
                (slate:dispose())
                (send gEgo:setCycle(End self))
            )
            (case 3
                (send gEgo:
                    view(725)
                    setLoop(1)
                    setCel(0)
                )
                = cycles 30
            )
            (case 4
                (pennySound:
                    number(2101)
                    play()
                )
                (penelope:
                    view(722)
                    setLoop(0)
                    setCel(0)
                    setCycle(End self)
                )
            )
            (case 5
                (freddySound:
                    number(2760)
                    play()
                )
                (send gEgo:
                    view(725)
                    setLoop(1)
                    setCel(0)
                    setCycle(End self)
                )
            )
            (case 6
                = ticks 30
            )
            (case 7
                (send gFpMessager:say(18 0 0 2 self))
                proc958_0(132 2101)
            )
            (case 8
                (penelope:
                    view(722)
                    loop(1)
                    cel(0)
                    setCycle(End self)
                )
                (send gEgo:
                    view(728)
                    setLoop(0)
                    setCel(0)
                    setCycle(End)
                )
            )
            (case 9
                (pistol:
                    init()
                    setScale(Scaler 97 75 172 143)
                    setLoop(6)
                    setStep(25 10)
                    setCycle(Fwd)
                    setMotion(MoveTo 256 133 self)
                )
            )
            (case 10
                (pistol:dispose())
                (send gOldCast:eachElementDo(#dispose))
                (send global2:drawPic(780))
                (send gGameMusic1:stop())
                (freddySound:
                    number(2761)
                    play(self)
                )
            )
            (case 11
                ++global119
                (send gUser:canControl(0))
                (send gGame:handsOn())
                (send global2:newRoom(730))
                (self:dispose())
            )
        )
    )

)
(instance sFreddyDies of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc958_0(132 2101 2761)
                (send gGame:handsOff())
                (if (register)
                    (send gEgo:
                        view(723)
                        setLoop(0)
                        setCel(0)
                        setScale(0)
                        setCycle(End self)
                    )
                )(else
                    = cycles 1
                )
            )
            (case 1
                (penelope:
                    view(722)
                    setLoop(0)
                    setCel(0)
                    setCycle(End self)
                )
            )
            (case 2
                (pennySound:
                    number(2101)
                    play()
                )
                (penelope:setCycle(Beg))
                (send gEgo:
                    view(724)
                    setLoop(1)
                    setCel(0)
                    setScale(0)
                    setCycle(End self)
                )
            )
            (case 3
                = global122 6
                (send global2:newRoom(99))
                (self:dispose())
            )
        )
    )

)
(instance pistol of Actor
    (properties
        x 180
        y 71
        view 720
        loop 5
    )
)
(instance penelope of Actor
    (properties
        x 29
        y 122
        noun 14
        view 726
        cel 1
    )

    (method (doVerb theVerb param2)
        (switch (theVerb)
            (case 47
                (send global2:setScript(sFreddyDies 1))
            )
            (default 
                (super:doVerb(theVerb rest param2))
            )
        )
    )

)
(instance basementDoor of View
    (properties
        x 107
        y 100
        view 720
        loop 3
        signal $4000
    )
)
(instance sword1 of Prop
    (properties
        x 42
        y 64
        noun 21
        view 720
        priority 7
        signal $4010
        scaleSignal $0001
    )

    (method (init param1)
        (super:init(rest param1))
        (self:setScale(Scaler 97 75 172 143))
    )

)
(instance sword2 of Prop
    (properties
        x 50
        y 64
        noun 21
        view 720
        cel 1
        priority 7
        signal $4010
        scaleSignal $0001
    )

    (method (init param1)
        (super:init(rest param1))
        (self:setScale(Scaler 97 75 172 143))
    )

)
(instance box of View
    (properties
        x 40
        y 100
        view 720
        loop 4
        priority 10
        signal $4010
    )
)
(instance schoolbook of View
    (properties
        x 168
        y 172
        noun 22
        view 720
        loop 4
        cel 3
        priority 10
        signal $4010
    )
)
(instance schoolbook2 of View
    (properties
        x 23
        y 104
        noun 22
        view 720
        loop 4
        cel 5
        priority 10
        signal $4010
    )
)
(instance pistols of View
    (properties
        x 221
        y 137
        view 720
        loop 5
    )
)
(instance slate of View
    (properties
        x 249
        y 150
        noun 15
        view 720
        loop 2
        priority 13
        signal $0010
    )

    (method (doVerb theVerb param2)
        (switch (theVerb)
            (case 4
                (if (== (send global2:timer) getSlateTimer)
                    (send global2:timer(0))
                    (send gTimers:delete(getSlateTimer))
                    (send global2:setScript(sFreddyAndSlate))
                )(else
                    (send gFpMessager:say(noun theVerb 1))
                    (send global2:setScript(sFreddyDies))
                )
            )
            (default 
                (super:doVerb(theVerb rest param2))
            )
        )
    )

)
(instance bench of Feature
    (properties
        x 296
        y 124
        noun 42
        nsTop 114
        nsLeft 274
        nsBottom 134
        nsRight 319
    )
)
(instance bigDesk of Feature
    (properties
        x 45
        y 111
        noun 45
    )
)
(instance blackBoard of Feature
    (properties
        x 46
        y 81
        noun 29
    )
)
(instance book1 of Feature
    (properties
        x 49
        y 172
        noun 24
    )
)
(instance book2 of Feature
    (properties
        x 154
        y 180
        noun 25
    )
)
(instance book3 of Feature
    (properties
        x 176
        y 187
        noun 47
    )
)
(instance broom of Feature
    (properties
        x 197
        y 98
        noun 41
    )
)
(instance coatrack of Feature
    (properties
        x 310
        y 85
        noun 43
    )
)
(instance desks of Feature
    (properties
        x 223
        y 149
        noun 32
    )
)
(instance flag of Feature
    (properties
        x 8
        y 70
        noun 28
    )
)
(instance globe of Feature
    (properties
        x 99
        y 171
        noun 46
    )
)
(instance lamp of Feature
    (properties
        x 80
        y 26
        noun 31
    )
)
(instance paintbrushes of Feature
    (properties
        x 16
        y 162
        noun 27
    )
)
(instance stove of Feature
    (properties
        x 235
        y 84
        noun 35
    )
)
(instance bigMap of Feature
    (properties
        x 151
        y 77
        noun 38
        nsTop 60
        nsLeft 141
        nsBottom 94
        nsRight 161
    )
)
(instance bookshelf of Feature
    (properties
        x 171
        y 50
        noun 48
        nsTop 45
        nsLeft 132
        nsBottom 55
        nsRight 211
    )
)
(instance bucket of Feature
    (properties
        x 212
        y 111
        noun 37
        nsTop 103
        nsLeft 207
        nsBottom 119
        nsRight 217
    )
)
(instance closedWindow of Feature
    (properties
        x 182
        y 77
        noun 33
        nsTop 56
        nsLeft 171
        nsBottom 98
        nsRight 194
    )
)
(instance kidPix of Feature
    (properties
        x 208
        y 80
        noun 40
        nsTop 63
        nsLeft 200
        nsBottom 97
        nsRight 216
    )
)
(instance openWindow of Feature
    (properties
        x 284
        y 80
        noun 34
        nsTop 54
        nsLeft 269
        nsBottom 106
        nsRight 299
    )
)
(instance smallMap of Feature
    (properties
        x 130
        y 76
        noun 39
        nsTop 64
        nsLeft 123
        nsBottom 88
        nsRight 138
    )
)
(instance washington of Feature
    (properties
        x 33
        y 44
        noun 30
        nsTop 33
        nsLeft 37
        nsBottom 55
        nsRight 55
    )
)
(instance woodCarrier of Feature
    (properties
        x 251
        y 123
        noun 36
        nsTop 116
        nsLeft 245
        nsBottom 130
        nsRight 257
    )
)
(instance smallPix of Feature
    (properties
        x 99
        y 48
        noun 44
    )
)
(instance smallPix2 of Feature
    (properties
        x 257
        y 80
        noun 44
    )
)
(instance smallPix3 of Feature
    (properties
        x 250
        y 68
        noun 44
    )
)
(instance derringerTimer of Timer
    (properties)

    (method (setReal param1)
        (send global2:timer(self))
        (super:setReal(rest param1))
    )


    (method (cue)
        (send global2:setScript(sFreddyDies 1))
    )

)
(instance public droppedThemTimer of Timer
    (properties)

    (method (setReal param1)
        (derringerTimer:
            dispose()
            delete()
        )
        (send global2:timer(self))
        (super:setReal(rest param1))
    )


    (method (cue)
        (send gFpMessager:say(50 0 0))
        (send global2:setScript(sFreddyDies))
    )

)
(instance getSlateTimer of Timer
    (properties)

    (method (setReal param1)
        (derringerTimer:
            dispose()
            delete()
        )
        (send global2:timer(self))
        (super:setReal(rest param1))
    )


    (method (cue)
        (send gFpMessager:say(49 0 0))
        (send global2:setScript(sFreddyDies))
    )

)
(instance freddySound of FPSound
    (properties
        flags $0001
    )
)
(instance pennySound of FPSound
    (properties
        flags $0001
    )
)
(instance localSound of FPSound
    (properties
        flags $0001
    )
)
