(include "sci.sh")
(use "Main")
(use "Class_255_0")
(use "mall")
(use "rmnScript")
(use "SQRoom")
(use "n940")
(use "Polygon")
(use "Class_950_0")
(use "ForwardCounter")
(use "SysWindow")
(use "User")
(use "PicView")
(use "Obj")
(script 386)


(local
    local0
    theGSq4Win
    local2[22] = (268 99 246 130 86 129 61 105 61 90 110 61 118 32 127 16 162 5 206 27 214 66 )

)
(instance public rm386 of SQRoom
    (properties
        picture 386
        style 30
    )

    (method (init)
        Load(rsVIEW 386)
        Load(rsSOUND 4)
        = theGSq4Win gSq4Win
        proc0_2()
        (bottomCigar:init())
        (redStuff:init())
        (yellowStuff:init())
        (microwave:init())
        (mouth:init())
        (arm:init())
        (send gLongSong:
            number(0)
            stop()
        )
        (send gLongSong2:
            vol(127)
            changeState()
        )
        (thePig:init())
        (pigPoly:
            points(@local2)
            size(11)
        )
        (theRoom:init())
        (self:setScript(talkScript 0 0))
        (super:init())
        (self:setRegions(700))
    )


    (method (newRoom param1)
        (if (== param1 387)
            (send gLongSong2:fade())
        )
        (super:newRoom(param1))
    )

)
(instance theRoom of Feature
    (properties
        x 160
        y 100
        nsBottom 200
        nsRight 320
        description "Monolith Burger interior"
        lookStr "This is just one of over 2.5 million Monolith Burger franchises scattered around the known universes."
    )

    (method (doVerb param1)
        (switch (param1)
            (case 0
                (send global2:newRoom(385))
            )
            (case 11
                Print("You smell that famous but unidentifiable Monolith Burger Secret Smell(tm).")
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
(instance thePig of Feature
    (properties
        x 160
        y 100
        description "pig"
        sightAngle 180
        lookStr "It's the gruff, unpersonable manager of this particular Monolith Burger franchise."
    )

    (method (init)
        (super:init())
        (self:onMeCheck(pigPoly))
    )


    (method (doVerb param1 param2)
        (switch (param1)
            (case 4
                (if (not (send global2:script))
                    proc0_2()
                    (talkScript:register((+ (talkScript:register) 1)))
                    (send global2:setScript(talkScript))
                )
            )
            (case 3
                (switch (param2)
                    (case 0
                        Print("No, Roger, the idea is to earn money, not give it away!")
                    )
                    (default 
                        (super:doVerb(param1 param2))
                    )
                )
            )
            (case 10
                Print("Maybe it's not wise to order a bacon burger...")
            )
            (case 11
                Print("Woof! This dude smells like a pig sty.")
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
(instance pigPoly of Polygon
    (properties)
)
(instance arm of Prop
    (properties
        x 94
        y 134
        description "pig"
        sightAngle 180
        lookStr "It's the gruff, unpersonable manager of this particular Monolith Burger franchise."
        view 386
        loop 2
        cel 1
        priority 2
        signal 2064
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 4
                (if (not (send global2:script))
                    proc0_2()
                    (talkScript:register((+ (talkScript:register) 1)))
                    (send global2:setScript(talkScript))
                )
            )
            (case 3
                (switch (param2)
                    (case 0
                        Print("No, Roger, the idea is to earn money, not give it away!")
                    )
                    (default 
                        (super:doVerb(param1 param2))
                    )
                )
            )
            (case 10
                Print("Maybe it's not wise to order a bacon burger...")
            )
            (case 11
                Print("Woof! This dude smells like a pig sty.")
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
(instance mouth of Prop
    (properties
        x 158
        y 63
        view 386
        loop 1
        priority 1
        signal 2064
    )
)
(instance talkScript of rmnScript
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gEgo:setCycle(0))
                (if (register)
                    = cycles 1
                )(else
                    = seconds 1
                )
            )
            (case 1
                (switch (register)
                    (case 0
                        = cycles 1
                    )
                    (case 1
                        (self:save1(proc0_12(
                                (if (== (send gEgo:view) 373)
                                    "I would like to buy a Mommy burger, please."
                                )(else
                                    "\"I'd like a...\""
                                )
 67 5 150 70 310 30 1 28 global140 29 global129)))
                        = seconds 5
                    )
                    (case 2
                        (switch (proc940_0("Would you like to apply for a job?" 67 100 60 101 81 "Here!? I'd rather not." 0 101 81 "Yes! I'm hard up for cash!" 1))
                            (case 0
                                (send global2:newRoom(385))
                            )
                            (case 1
                                (self:save1(proc0_12(
                                        (if (== (send gEgo:view) 373)
                                            "I can cook."
                                        )(else
                                            "I want a job."
                                        )
 67 5 150 70 310 30 1 28 global140 29 global129)))
                                = seconds 5
                            )
                        )
                    )
                )
            )
            (case 2
                (self:restore())
                (arm:setCel(0))
                (mouth:
                    setLoop(0)
                    posn(155 39)
                )
                = cycles 5
            )
            (case 3
                (switch (register)
                    (case 0
                        (self:save1(proc0_12(
                                (if (== (send gEgo:view) 373)
                                    "\"What can I do for ya, doll?\""
                                )(else
                                    "\"Yeah?\""
                                )
 67 5 150 70 310 30 1)))
                        (arm:setCel(2))
                        (mouth:
                            init()
                            setCycle(ForwardCounter 8 self)
                        )
                    )
                    (case 1
                        (self:save1(proc0_12(
                                (if (proc0_6(70) and not proc999_5((send gEgo:view) 373 374))
                                    "\"Oh, you again, whatdaya want?\""
                                )(else
                                    "\"We're out of it. We're outta everything, including employees.\""
                                )
 67 5 150 70 310 30 1)))
                        (arm:setCel(2))
                        (mouth:
                            init()
                            setCycle(ForwardCounter 8 self)
                        )
                    )
                    (case 2
                        (if ((>= global172 34) and (<> (send gEgo:view) 373))
                            (self:save1(proc0_12("\"I'm tired of firing ya, now scram!\"" 67 5 150 70 310 30 1)))
                            = seconds 3
                        )(else
                            (self:save1(proc0_12(
                                    (if (== (send gEgo:view) 373)
                                        "No can do, what with you bein' female and all."
                                    )(else
                                        (if (proc0_6(70))
                                            "\"You would, huh? Well, this is the greatest oppor... aah, ya heard the pitch before, just don't screw up or I'll land ya on yer ear again, GOT IT?\""
                                        )(else
                                            "\"You would, huh? Well, this is the greatest opportunity you've ever had, kid. Benefits up the wazoo, and if ya stick wit' me a half an hour or so, I'll make ya my Assistant Manager. How wouldja like that?\""
                                        )
                                    )
 67 5 150 70 310 30 1)))
                        )
                        (arm:setCel(2))
                        (mouth:
                            init()
                            setCycle(ForwardCounter 25 self)
                        )
                    )
                )
            )
            (case 4
                (if ((>= register 2) and (>= global172 34))
                    (send global2:newRoom(385))
                )(else
                    = cycles 1
                )
            )
            (case 5
                (self:restore())
                (mouth:setCycle(0))
                (arm:setCel(0))
                (mouth:
                    setLoop(1)
                    cel(0)
                    posn(158 63)
                )
                (if (== register 2)
                    (self:save1(proc0_12(
                            (if (== (send gEgo:view) 373)
                                "You male sexist pig!!"
                            )(else
                                (if (proc0_6(70))
                                    "\"Gee, thanks, what a swell boss!\""
                                )(else
                                    "\"Gee, thanks.\""
                                )
                            )
 67 5 150 70 310 30 1 28 global140 29 global129)))
                )
                = seconds 2
            )
            (case 6
                (arm:setCel(1))
                (mouth:
                    setLoop(1)
                    cel(0)
                    posn(158 63)
                )
                proc0_3()
                (User:canControl(0))
                (send gIconBar:disable(0 2))
                (if (== register 2)
                    = seconds 3
                )(else
                    (self:dispose())
                )
            )
            (case 7
                (self:restore())
                (if (== (send gEgo:view) 373)
                    (send global2:newRoom(385))
                )(else
                    (send global2:setScript(warningScript))
                )
            )
        )
    )

)
(instance warningScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send global5:eachElementDo(156))
                (send global2:drawPic(803))
                = seconds 2
            )
            (case 1
                (send gIconBar:curIcon((send gIconBar:at(2))))
                (send global1:setCursor((send ((send gIconBar:curIcon)):cursor)))
                (send gIconBar:disable())
                = gSq4Win BlackWindow
                (BlackWindow:
                    color(global131)
                    back(global129)
                )
                (switch (proc940_0("WARNING:\nTHE FOLLOWING SEQUENCE CONTAINS EXPLICIT ARCADE ACTION AND IS NOT RECOMMENDED FOR DIE-HARD ADVENTURE PLAYERS, THE ARCADE-SQUEAMISH, OR THOSE WITH POOR TO NON-EXISTENT MOTOR SKILLS." 101 " " 101 67 60 36 101 81 "Let me at it! I love a challenge!" 1 101 81 "Please let me WIMP OUT.\n(But can I have the cash?)" 0))
                    (case 0
                        (if (((< global172 34) and not proc700_3(ScriptID(700 0) 511 4)) and not proc0_6(29))
                            (send gEgo:get(0))
                            = global159 (+ global159 (- 34 global172))
                            = global172 34
                            (mall:rFlag4((| (mall:rFlag4) $0001)))
                            proc0_11(52 65533)
                            Print("Oh, by the way, you are about to be fired.")
                        )(else
                            Print("Decided to WIMP out eh? Well, we decided not to give you the cash.")
                        )
                        = cycles 1
                    )
                    (case 1
                        = local0 1
                        proc0_11(51 3)
                        = cycles 1
                    )
                )
            )
            (case 2
                = gSq4Win theGSq4Win
                (send gIconBar:enable())
                = cycles 2
            )
            (case 3
                (if (local0)
                    (send global2:newRoom(387))
                )(else
                    (send global2:newRoom(385))
                )
            )
        )
    )

)
(instance BlackWindow of SysWindow
    (properties)
)
(instance redStuff of Feature
    (properties
        x 306
        y 105
        nsTop 75
        nsLeft 294
        nsBottom 135
        nsRight 318
        description "ketchup"
        sightAngle 180
        lookStr "Mmmm! Famous Mono sauce!"
    )

    (method (doVerb param1)
        (switch (param1)
            (case 10
                Print("Sucking on a bottle of ketchup doesn't seem to satisfy your hunger no matter what the government thinks.")
            )
            (case 11
                Print("Smells like a synthesized version of an ancient vegetable sauce.")
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
(instance yellowStuff of Feature
    (properties
        x 282
        y 104
        nsTop 75
        nsLeft 272
        nsBottom 134
        nsRight 293
        description "mustard"
        sightAngle 180
        lookStr "Mmmm! Famous Mono sauce No. 2!"
    )

    (method (doVerb param1)
        (switch (param1)
            (case 10
                Print("Sucking on a bottle of mustard doesn't seem to satisfy your hunger.")
            )
            (case 11
                Print("Smells like a synthesized version of an ancient sauce.")
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
(instance microwave of Feature
    (properties
        x 24
        y 106
        nsTop 84
        nsBottom 128
        nsRight 49
        description "microwave"
        sightAngle 180
        lookStr "It's a microwave."
    )

    (method (doVerb param1)
        (switch (param1)
            (case 2
                Print("The microwave quit a long time ago.")
            )
            (case 11
                Print("It smells dusty.")
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
(instance bottomCigar of Feature
    (properties
        x 93
        y 150
        nsTop 93
        nsLeft 79
        nsBottom 110
        nsRight 108
        description "stogie"
        sightAngle 180
        lookStr "It's a cigar"
    )

    (method (doVerb param1)
        (switch (param1)
            (case 2
                Print("Whatever would you want tho use that for?")
            )
            (case 11
                Print("Sniffing the cigar makes you lose what little appetite you had after smelling the air in this place.")
            )
            (case 10
                Print("Yuck! You rapidly remove the ashes from your tongue.")
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
