(include "sci.sh")
(use "Main")
(use "Class_255_0")
(use "brain")
(use "SQRoom")
(use "Cycle")
(use "Obj")
(script 520)



(instance public rm520 of SQRoom
    (properties
        lookStr "This maze of cables, ducts, pipes, and glowing panels give the super brain computer a sense of being alive..."
        picture 520
        style 30
        north 505
        east 525
        west 515
    )

    (method (init)
        (if (== global12 505)
            (self:setScript(fromNorthScript 0 
                (if (< (send gEgo:x) 90)
                    0
                )(else
                    1
                )
))
        )(else
            proc0_3()
        )
        (send gEgo:init())
        (self:setRegions(704))
        (super:init())
        (switch ((brain:level))
            (case 1
                (brain:makePolygon(0 159 60 159 95 180 208 180 246 162 246 105 210 121 210 156 96 156 96 118 63 106 63 134 0 134 0 0 319 0 319 189 0 189))
            )
            (case 2
                (brain:makePolygon(0 130 59 130 96 149 207 149 244 132 319 132 319 189 0 189))
                (brain:makePolygon(0 0 319 0 319 112 250 112 207 128 104 128 58 110 0 110))
            )
            (case 3
                (brain:makePolygon(0 97 61 97 93 109 206 109 246 97 319 97 319 189 0 189))
                (brain:makePolygon(0 37 78 37 68 75 0 75))
                (brain:makePolygon(0 0 319 0 319 24 241 24 206 7 108 7 81 24 0 24))
                (brain:makePolygon(319 76 253 76 244 35 319 35))
                (brain:makePolygon(94 81 94 61 90 52 119 40 204 40 226 51 226 65 230 81 214 87 108 87))
            )
        )
    )


    (method (doit)
        (super:doit())
        (if (script)
        )(else
            (if ((== (brain:level) 1) and proc0_5(gEgo 32))
                (brain:level(2))
                (self:newRoom(north))
            )
        )
    )


    (method (doVerb param1 param2)
        (switch (param1)
            (case 4
                Print("You'd better not.  Something might answer.")
            )
            (default 
                (super:doVerb(param1 rest param2))
            )
        )
    )

)
(instance fromNorthScript of Script
    (properties)

    (method (changeState newState)
        (var temp0, temp1, temp2, temp3)
        (switch (= state newState)
            (case 0
                proc0_2()
                (if (register)
                    = temp0 235
                    = temp1 141
                    = temp2 235
                    = temp3 167
                )(else
                    = temp0 91
                    = temp1 144
                    = temp2 91
                    = temp3 172
                )
                (send gEgo:
                    posn(temp0 temp1)
                    setMotion(MoveTo temp2 temp3 self)
                )
            )
            (case 1
                proc0_3()
                (self:dispose())
            )
        )
    )

)
