(include "sci.sh")
(use "Main")
(use "Class_255_0")
(use "brain")
(use "SQRoom")
(use "Class_950_0")
(use "Cycle")
(use "User")
(use "PicView")
(use "Obj")
(script 544)


(local
    theProp
    local1
    local2

)
(instance public rm544 of SQRoom
    (properties
        lookStr "The programming screen's format looks familiar..."
        picture 544
        style 100
    )

    (method (init)
        (var temp0[20])
        (self:setRegions(704))
        (super:init())
        (send gEgo:setCycle(0))
        proc0_3()
        = local2 global3
        = global3 0
        (if (not Btest(27))
            (KQ43Icon:init())
        )
        (if (not Btest(28))
            (LLIcon:init())
        )
        (if (not Btest(38))
            (droidIcon:init())
        )
        (SQ4Icon:init())
        (if (not (brain:formatting))
            (brainIcon:init())
        )
        (toiletIcon:init())
        (exitBar:init())
        (if (Btest(27))
            StrCpy(@temp0 "Memory Free: 841,912,226 GBytes")
        )(else
            StrCpy(@temp0 "Memory Free: 2,451 KBytes")
        )
        = local1 proc0_12(@temp0 67 40 171 28 global137 29 gColor)
        = global34 0
        (send gLongSong:fade(30 10 10 0))
        (send gLongSong2:
            number(842)
            vol(127)
            loop(1)
            play()
        )
    )


    (method (doit)
        (var userCurEvent, userCurEventX, userCurEventY)
        (super:doit())
        = userCurEvent (User:curEvent)
        (if (proc999_5((send userCurEvent:type) 1 2 4))
        )(else
            (if (not theProp)
            )(else
                (if ((send theProp:cycler))
                )(else
                    = userCurEventX (send userCurEvent:x)
                    = userCurEventY (send userCurEvent:y)
                    (if (proc999_4(47 52 270 149 userCurEventX userCurEventY))
                        (send theProp:
                            x(userCurEventX)
                            y(userCurEventY)
                        )
                    )
                )
            )
        )
    )


    (method (dispose)
        = global3 local2
        = global34 1
        (send gLongSong:fade(127 10 10 0))
        (super:dispose())
    )


    (method (doVerb param1 param2)
        (switch (param1)
            (case 4
                Print("Apparently, the programming screen is not equipped with a voice recognition system.")
            )
            (default 
                (super:doVerb(param1 rest param2))
            )
        )
    )

)
(instance KQ43Icon of Prop
    (properties
        x 60
        y 60
        description "KQ43Icon"
        lookStr "Probably represents some tertiary function of the super computer brain.  Certainly nothing important."
        view 544
        priority 14
        signal 16
    )

    (method (doVerb param1 param2)
        (if (== param1 2)
            (if ((toiletIcon:onMe(self)))
                (toiletIcon:setScript(flushFlash self))
            )(else
                (if (== theProp self)
                    = theProp 0
                    = cel 0
                )(else
                    (if (theProp)
                    )(else
                        = theProp self
                        = cel 1
                    )
                )
            )
        )(else
            (super:doVerb(param1 rest param2))
        )
    )


    (method (cue)
        proc0_12(local1)
        = local1 proc0_12("Memory Free: 841,912,226 GBytes" 67 40 171 28 global137 29 gColor)
        = theProp 0
        Bset(27)
        (self:dispose())
    )

)
(instance SQ4Icon of Prop
    (properties
        x 100
        y 60
        description "SQ4Icon"
        lookStr "You've seen this mystic rune somewhere else..."
        view 544
        loop 1
        priority 14
        signal 16
    )

    (method (doVerb param1 param2)
        (if (== param1 2)
            (if ((toiletIcon:onMe(self)))
                (toiletIcon:setScript(flushFlash self))
            )(else
                (if (== theProp self)
                    = theProp 0
                    = cel 0
                )(else
                    (if (theProp)
                    )(else
                        = theProp self
                        = cel 1
                    )
                )
            )
        )(else
            (super:doVerb(param1 rest param2))
        )
    )


    (method (cue)
        = global4 1
        (self:dispose())
    )

)
(instance LLIcon of Prop
    (properties
        x 150
        y 60
        description "LLIcon"
        lookStr "Yeah, this looks like toilet material."
        view 544
        loop 2
        priority 14
        signal 16
    )

    (method (doVerb param1 param2)
        (if (== param1 2)
            (if ((toiletIcon:onMe(self)))
                (toiletIcon:setScript(flushFlash self))
            )(else
                (if (== theProp self)
                    = theProp 0
                    = cel 0
                )(else
                    (if (theProp)
                    )(else
                        = theProp self
                        = cel 1
                    )
                )
            )
        )(else
            (super:doVerb(param1 rest param2))
        )
    )


    (method (cue)
        = theProp 0
        Bset(28)
        (self:dispose())
    )

)
(instance droidIcon of Prop
    (properties
        x 60
        y 95
        description "droidIcon"
        lookStr "Looks rather like a security droid of some sort."
        view 544
        loop 3
        priority 14
        signal 16
    )

    (method (doVerb param1 param2)
        (if (== param1 2)
            (if ((toiletIcon:onMe(self)))
                (toiletIcon:setScript(flushFlash self))
            )(else
                (if (== theProp self)
                    = theProp 0
                    = cel 0
                )(else
                    (if (theProp)
                    )(else
                        = theProp self
                        = cel 1
                    )
                )
            )
        )(else
            (super:doVerb(param1 rest param2))
        )
    )


    (method (cue)
        = theProp 0
        Bset(38)
        proc0_11(61 5)
        (self:dispose())
    )

)
(instance brainIcon of Prop
    (properties
        x 100
        y 95
        description "brainIcon"
        lookStr "This is your brain.  This is only your brain.  Had this been a real brain, you would have known how to use it."
        view 544
        loop 4
        priority 14
        signal 16
    )

    (method (doVerb param1 param2)
        (if (== param1 2)
            (if ((toiletIcon:onMe(self)))
                (toiletIcon:setScript(flushFlash self))
            )(else
                (if (== theProp self)
                    = theProp 0
                    = cel 0
                )(else
                    (if (theProp)
                    )(else
                        = theProp self
                        = cel 1
                    )
                )
            )
        )(else
            (super:doVerb(param1 rest param2))
        )
    )


    (method (cue)
        = theProp 0
        proc0_12(local1)
        = local1 proc0_12("Initiating Formatting Sequence Value to 5000" 67 40 171 28 global137 29 gColor)
        (brain:formatting(5000))
        (send gLongSong:
            number(869)
            vol(30)
            loop(-1)
            play()
        )
        proc0_11(62 15)
        (self:dispose())
    )

)
(instance toiletIcon of Prop
    (properties
        x 270
        y 155
        description "toiletIcon"
        lookStr "The Andromedan symbol for \"Life\"."
        view 544
        loop 5
        priority 13
        signal 16
    )
)
(instance exitBar of Feature
    (properties
        x 36
        y 37
        nsTop 32
        nsLeft 31
        nsBottom 43
        nsRight 42
        description "exit button"
        sightAngle 90
        lookStr "The exit bar."
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 2
                (send global2:newRoom(514))
            )
            (default 
                (super:doVerb(param1 rest param2))
            )
        )
    )

)
(instance flushFlash of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gLongSong2:
                    number(839)
                    loop(1)
                    play(self)
                )
                (send client:setCel(1))
                = cycles 2
            )
            (case 1
                (send theProp:setCycle(Fwd))
            )
            (case 2
                (send theProp:cue())
                = cycles 2
            )
            (case 3
                (send client:setCel(0))
                proc0_3()
                (self:dispose())
            )
        )
    )

)
