(version 2)
(include "sci.sh")
(exports
    0 rm92
)
(use "Main")
(use "Class_255_0")
(use "TrashBasket")
(use "Timer")
(use "Sound")
(use "Cycle")
(use "Game")
(use "Feature")
(use "Obj")
(script 92)



(instance public rm92 of Rm
    (properties
        picture 92
        style 0
        east 91
        west 91
    )

    (method (init)
        (super:init())
        (self:setRegions(702))
        (trash1:init())
        (trash2:init())
        (trash3:init())
        (trash4:init())
        (trash5:init())
        (trash6:init())
        (trash7:init())
        (trash8:init())
        (nerd1:init())
        (nerd2:init())
        (nerd3:init())
        (nerd4:init())
        (nerd5:init())
        (nerd6:init())
        (nerd7:init())
        (nerd8:init())
        (if (proc0_13(14))
            Load(128 103)
            (photoBoss:init())
            (if (not global233)
                Load(132 49)
                (pictureSound:init())
                (fink1:init())
                (copyBeam:init())
            )
        )
        (send gEgo:init())
    )


    (method (doit)
        (super:doit())
        (if ((send gEgo:has(14)))
            (if (not 
            (if (<= 0 (finkScript:state))
                (<= (finkScript:state) 3)
            )
 and (> (send gEgo:x) 120))
                (fink1:setScript(finkScript))
            )
        )
    )


    (method (handleEvent pEvent)
        (var temp0)
        (if ((send pEvent:claimed))
            return 
        )
        (switch ((send pEvent:type))
            (case 128
                (if (global233)
                    proc255_0(92 0)
                    (send pEvent:claimed(1))
                    return 
                )
                = temp0 0
                (if (Said('look,explore>'))
                    (if (Said('/original'))
                        (if (proc0_13(14) and (send gEgo:inRect(0 180 200 190)))
                            = temp0 1
                            proc255_0(92 1 82 103 0 1 80 "the Boss")
                        )(else
                            (if ((send gEgo:has(14)))
                                = temp0 1
                                (send ((send global9:at(14))):showSelf())
                            )
                        )
                    )(else
                        (if (Said('/copier,device'))
                            (if ((send gEgo:inRect(0 147 90 190)))
                                = temp0 1
                                proc255_0(92 2)
                            )
                        )(else
                            (if (Said('[/area,partition]'))
                                (if ((send gEgo:inRect(0 180 200 190)) and not (send gEgo:has(14)))
                                    = temp0 1
                                    proc255_0(92 3)
                                )
                                (if ((send gEgo:inRect(0 147 90 190)))
                                    = temp0 1
                                    proc255_0(92 4)
                                )
                            )
                        )
                    )
                )(else
                    (if (Said('get,remove/original'))
                        = temp0 1
                        (if ((send gEgo:has(14)))
                            proc255_0(92 5)
                        )(else
                            (if ((send gEgo:inRect(83 180 111 183)))
                                (send gEgo:setScript(getPic))
                            )(else
                                proc255_0(92 6)
                            )
                        )
                    )(else
                        (if (Said('hang,drop,replace,replace/original'))
                            (if ((send gEgo:inRect(83 180 111 183)) and (send gEgo:has(14)))
                                = temp0 1
                                (send gEgo:setScript(putPic))
                            )
                        )(else
                            (if (Said('hang,drop,replace,replace/copy'))
                                (if ((send gEgo:inRect(83 180 111 183)) and (send gEgo:has(15)))
                                    = temp0 1
                                    proc255_0(92 7)
                                )
                            )(else
                                (if (Said('converse/man'))
                                    (if (< (send gEgo:distanceTo(fink1)) 40)
                                        = temp0 1
                                        proc255_0(92 8)
                                        proc255_0(92 9)
                                    )
                                )(else
                                    (if ((Said('use,jog,begin,turn/copier,device') or Said('copy[/original,elmo]')) or Said('make/copy[<original,elmo]'))
                                        (if ((send gEgo:inRect(22 154 43 157)))
                                            = temp0 1
                                            (if ((send gEgo:has(14)))
                                                (if ((send gEgo:has(15)))
                                                    proc255_0(92 10)
                                                )(else
                                                    (send gEgo:setScript(copyPic))
                                                )
                                            )(else
                                                proc255_0(92 11)
                                            )
                                        )
                                    )(else
                                        (if (Said('copy'))
                                            = temp0 1
                                            proc255_0(92 12)
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
                (if ((send pEvent:claimed) and not temp0)
                    (send pEvent:claimed(0))
                )
            )
        )
    )


    (method (newRoom newRoomNumber)
        (send global7:eachElementDo(91 84))
        (super:newRoom(newRoomNumber))
    )

)
(instance getPic of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (if ((send gEgo:has(15)))
                    proc255_0(92 13)
                )(else
                    proc255_0(92 14)
                )
                proc0_2()
                (photoBoss:hide())
                (pictureSound:play())
                (send gEgo:
                    x((photoBoss:x))
                    view(103)
                    setLoop(1)
                    setCel(0)
                    setCycle(End self)
                )
            )
            (case 1
                (send gEgo:
                    view(113)
                    setLoop(-1)
                    setDirection(1)
                    setCycle(Walk)
                    get(14)
                )
                proc0_3()
            )
            (default 
                (self:changeState(0))
            )
        )
    )

)
(instance putPic of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (if ((send gEgo:has(15)))
                    proc255_0(92 15)
                )(else
                    proc255_0(92 16)
                )
                proc0_2()
                (pictureSound:play())
                (send gEgo:
                    x((photoBoss:x))
                    view(103)
                    setLoop(1)
                    setCel((send gEgo:lastCel()))
                    setCycle(Beg self)
                )
            )
            (case 1
                (photoBoss:show())
                (send gEgo:
                    view(113)
                    setLoop(-1)
                    setDirection(1)
                    setCycle(Walk)
                    put(14 global11)
                )
                proc0_3()
            )
            (default 
                (self:changeState(0))
            )
        )
    )

)
(instance copyPic of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                proc255_0(92 17)
                (send gEgo:
                    view(103)
                    posn(32 155)
                    setLoop(1)
                    setCel((send gEgo:lastCel()))
                    setCycle(Beg self)
                )
            )
            (case 1
                (send gEgo:setPri(15))
                (copyBeam:
                    show()
                    setPri(14)
                    posn(41 135)
                    setMotion(MoveTo 29 135 self)
                )
            )
            (case 2
                (Timer:setReal(self 2))
            )
            (case 3
                (copyBeam:
                    posn(41 135)
                    setMotion(MoveTo 29 135 self)
                )
            )
            (case 4
                (copyBeam:dispose())
                (send gEgo:setPri(-1))
                proc255_0(92 18)
                (send gEgo:setCycle(End self))
            )
            (case 5
                proc255_0(92 19)
                (send gEgo:setCycle(End self))
            )
            (case 6
                (send gEgo:
                    view(113)
                    setDirection(1)
                    setLoop(3)
                    setCel(-1)
                    setCycle(Walk)
                    get(15)
                    forceUpd()
                )
                (send gEgo:setLoop(-1))
                (send global1:changeScore(5))
                proc0_3()
            )
            (default 
                (self:changeState(0))
            )
        )
    )

)
(instance finkScript of Script
    (properties)

    (method (changeState newState)
        (if (global233)
            return 
        )
        (switch (= state newState)
            (case 0
                = global243 1
                (fink1:
                    setLoop(7)
                    setCycle(Fwd)
                    setMotion(MoveTo 190 162 self)
                )
            )
            (case 1
                (fink1:setMotion(MoveTo 128 185 self))
            )
            (case 2
                (if ((send gEgo:has(14)))
                    (fink1:
                        setMotion(0)
                        setCycle(0)
                        seeProblem(1)
                    )
                )(else
                    = cycles 1
                )
            )
            (case 3
                (fink1:
                    setLoop(6)
                    setMotion(MoveTo 190 162 self)
                )
            )
            (case 4
                (if ((send gEgo:has(14)))
                    (self:init())
                )(else
                    (fink1:setMotion(MoveTo 340 155 self))
                )
            )
            (case 5
                = global243 0
                (fink1:stopUpd())
            )
            (default 
                (self:init())
            )
        )
    )

)
(instance fink1 of Fink
    (properties)

    (method (init)
        (super:init())
        (self:
            speakX(118)
            speakY(156)
            speakCel(1)
            posn(340 155)
            ignoreActors(0)
            ignoreControl(-1)
            stopUpd()
        )
    )


    (method (doit)
        (super:doit())
        (if (((< (self:distanceTo(gEgo)) 20) and (send gEgo:has(14))) and (== (send gEgo:view) 113))
            (self:
                setMotion(0)
                setCycle(0)
                speakX(- x 10)
                speakY(- y 30)
                seeProblem(1)
                stopUpd()
            )
        )
    )

)
(instance photoBoss of View
    (properties)

    (method (init)
        (super:init())
        (self:
            setPri(14)
            view(103)
            setLoop(0)
            setCel(0)
            posn(97 171)
            stopUpd()
        )
    )

)
(instance copyBeam of Act
    (properties)

    (method (init)
        (super:init())
        (self:
            view(115)
            setLoop(9)
            setCel(2)
            moveSpeed(2)
            hide()
        )
    )

)
(instance trash1 of TrashBasket
    (properties
        myID 13
        nearWest 85
        nearNorth 148
        nearEast 190
        nearSouth 179
    )

    (method (init)
        (super:init())
        (self:
            posn(120 150)
            myNerd(nerd1)
        )
    )

)
(instance trash2 of TrashBasket
    (properties
        myID 14
        nearWest 21
        nearNorth 115
        nearEast 122
        nearSouth 147
    )

    (method (init)
        (super:init())
        (self:
            posn(48 118)
            myNerd(nerd2)
        )
    )

)
(instance trash3 of TrashBasket
    (properties
        myID 15
        nearWest 122
        nearNorth 117
        nearEast 191
        nearSouth 147
    )

    (method (init)
        (super:init())
        (self:
            posn(153 118)
            myNerd(nerd3)
        )
    )

)
(instance trash4 of TrashBasket
    (properties
        myID 16
        nearWest 193
        nearNorth 116
        nearEast 253
        nearSouth 148
    )

    (method (init)
        (super:init())
        (self:
            posn(221 128)
            myNerd(nerd4)
        )
    )

)
(instance trash5 of TrashBasket
    (properties
        myID 17
        nearWest 123
        nearNorth 85
        nearEast 187
        nearSouth 115
    )

    (method (init)
        (super:init())
        (self:
            posn(158 87)
            myNerd(nerd5)
        )
    )

)
(instance trash6 of TrashBasket
    (properties
        myID 18
        nearWest 21
        nearNorth 53
        nearEast 66
        nearSouth 85
    )

    (method (init)
        (super:init())
        (self:
            posn(43 56)
            myNerd(nerd6)
        )
    )

)
(instance trash7 of TrashBasket
    (properties
        myID 19
        nearWest 76
        nearNorth 23
        nearEast 156
        nearSouth 83
    )

    (method (init)
        (super:init())
        (self:
            posn(106 54)
            myNerd(nerd7)
        )
    )

)
(instance trash8 of TrashBasket
    (properties
        myID 20
        nearWest 183
        nearNorth 54
        nearEast 246
        nearSouth 115
    )

    (method (init)
        (super:init())
        (self:
            posn(210 68)
            myNerd(nerd8)
        )
    )

)
(instance nerd1 of Nerd
    (properties)

    (method (init)
        (super:init())
        (self:
            setLoop(0)
            posn(101 153)
            speakX(110)
            speakY(137)
            speakCel(0)
        )
    )

)
(instance nerd2 of Nerd
    (properties)

    (method (init)
        (super:init())
        (self:
            setLoop(2)
            posn(66 116)
            speakX(92)
            speakY(105)
            speakCel(0)
        )
    )

)
(instance nerd3 of Nerd
    (properties)

    (method (init)
        (super:init())
        (self:
            setLoop(3)
            posn(182 118)
            setPri(11)
            speakX(160)
            speakY(102)
            speakCel(1)
        )
    )

)
(instance nerd4 of Nerd
    (properties)

    (method (init)
        (super:init())
        (self:
            setLoop(2)
            posn(201 112)
            setPri(8)
            speakX(228)
            speakY(93)
            speakCel(0)
        )
    )

)
(instance nerd5 of Nerd
    (properties)

    (method (init)
        (super:init())
        (self:
            setLoop(1)
            posn(170 89)
            speakX(159)
            speakY(68)
            speakCel(1)
        )
    )

)
(instance nerd6 of Nerd
    (properties)

    (method (init)
        (super:init())
        (self:
            setPri(3)
            setLoop(1)
            posn(55 59)
            speakX(69)
            speakY(38)
            speakCel(0)
        )
    )

)
(instance nerd7 of Nerd
    (properties)

    (method (init)
        (super:init())
        (self:
            setLoop(0)
            posn(91 58)
            speakX(99)
            speakY(38)
            speakCel(0)
        )
    )

)
(instance nerd8 of Nerd
    (properties)

    (method (init)
        (super:init())
        (self:
            setLoop(2)
            posn(196 55)
            speakX(184)
            speakY(42)
            speakCel(1)
        )
    )

)
(instance pictureSound of Sound
    (properties
        number 49
        priority 1
    )
)
