(version 2)
(include "sci.sh")
(exports
    0 proc625_0
    1 proc625_1
)
(use "Main")
(use "TimedCue")
(use "Cycle")
(use "View")
(use "Obj")
(script 625)


(local
    local0 =     100
    local1 =     220
    local2 =     120
    local3 =     176
    local4
    local5
    local6
    local7
    local8

)
(procedure public (proc625_0 param1)
    (var temp0[80], temp80[4])
    StrCpy(@temp0 (send param1:name))
    (if ((((<> (send param1:amount) 0) and (<> (send param1:objName) 34)) or (== (send param1:form) 29)) and proc999_5((send param1:objType) 2 3 4 5))
        (if ((== (send param1:objName) 41) and (== (send param1:form) 29))
            Format(@temp0 "%s (3 %s)" (send param1:name) "pills")
        )(else
            (if (== (send param1:form) 29)
                Format(@temp0 "%s (%d %s)" (send param1:name) (send param1:amount) "pills")
            )(else
                (if (== (send param1:form) 31)
                    (if (> (send param1:amount) 1)
                        Format(@temp0 "%s (%d %s)" (send param1:name) (send param1:amount) "powders")
                    )(else
                        Format(@temp0 "%s (%d %s)" (send param1:name) (send param1:amount) "powder")
                    )
                )(else
                    (if (== (send param1:contents) 25)
                        (if (== (send param1:contentState) 51)
                            Format(@temp0 "%s (%s)" (send param1:name) "molten silver")
                        )(else
                            Format(@temp0 "%s (%s)" (send param1:name) "w/ medallion")
                        )
                    )(else
                        (if ((== (send param1:form) 27) or (== (send param1:form) 28))
                            Format(@temp0 "%s (%d %s)" (send param1:name) (send param1:amount) "ml")
                        )(else
                            Format(@temp0 "%s (%d %s)" (send param1:name) (send param1:amount) "gm")
                        )
                    )
                )
            )
        )
    )
    TextSize(@temp80 @temp0 2107 0)
    Display(LOOKUP_ERROR 108 global145)
    = global145 Display(@temp0 102 gBack 105 2107 100 (+ local0 (/ (- local2 (- temp80[3] temp80[1])) 2)) local3 107)
)


(procedure public (proc625_1)
    = gCursorNumber (send ((send gIconBar:at(2))):cursor)
    (send gCursorNumber:
        view(2)
        loop(0)
        cel(0)
        init()
    )
)


(class ChemicalObj of Obj
    (properties
        chemicalName 0
        chemicalAmount 0
    )
)
(class LabItem of Actor
    (properties
        x 0
        y 0
        z 0
        heading 0
        noun 0
        modNum -1
        nsTop 0
        nsLeft 0
        nsBottom 0
        nsRight 0
        sightAngle 26505
        actions 0
        onMeCheck $6789
        state $0000
        approachX 0
        approachY 0
        approachDist 0
        _approachVerbs 0
        yStep 3
        view -1
        loop 0
        cel 0
        priority 0
        underBits 0
        signal $5001
        lsTop 0
        lsLeft 0
        lsBottom 0
        lsRight 0
        brTop 0
        brLeft 0
        brBottom 0
        brRight 0
        scaleSignal $0000
        scaleX 128
        scaleY 128
        maxScale 128
        cycleSpeed 6
        script 0
        cycler 0
        timer 0
        detailLevel 0
        scaler 0
        illegalBits $8000
        xLast 0
        yLast 0
        xStep 3
        origStep 770
        moveSpeed 1
        blocks 0
        baseSetter 0
        mover 0
        looper 0
        viewer 0
        avoider 0
        code 0
        objType 1
        objName 0
        contents 0
        amount 0
        form 27
        contentState 49
        moveable 0
        startX 0
        startY 0
    )

    (method (init)
        = name Memory(1 Message(msgSIZE 620 noun 0 0 1))
        Message(msgGET 620 noun 0 0 1 name)
        (super:init())
    )


    (method (dispose)
        (super:dispose())
        Memory(3 name)
    )


    (method (doVerb theVerb)
        (switch (theVerb)
            (case 4
                (if (((not mover and (== (send gIconBar:curIcon) (send gIconBar:at(2)))) and gMedicineBottle) and (< gPEventY 130))
                    (self:exchangeItem())
                )(else
                    (if ((not mover and (== (send gIconBar:curIcon) (send gIconBar:at(2)))) and gMedicineBottle)
                        (self:useItem())
                    )(else
                        (if (not mover and (== (send gIconBar:curIcon) (send gIconBar:at(2))))
                            (self:touchItem())
                        )
                    )
                )
            )
            (case 8
                (send global2:doVerb(8))
            )
            (default 
                (super:doVerb(theVerb))
            )
        )
    )


    (method (cue)
        (if (global143)
            (send global2:doVerb(8))
        )(else
            (self:
                setPri(-1)
                ignoreActors(1)
                stopUpd()
            )
        )
    )


    (method (touchItem)
        = gCursorNumber (send ((send gIconBar:curIcon)):cursor)
        (send gCursorNumber:
            view(view)
            setLoop(loop)
            setCel(cel)
            init()
        )
        (self:hide())
        = gMedicineBottle self
    )


    (method (exchangeItem)
        = gCursorNumber (send ((send gIconBar:curIcon)):cursor)
        (send gCursorNumber:
            view(view)
            setLoop(loop)
            setCel(cel)
            init()
        )
        (self:hide())
        (send gMedicineBottle:
            posn(gOrigX gPEventY)
            show()
            setPri(15)
            setLoop((send gMedicineBottle:loop))
            setMotion(MoveTo (send gMedicineBottle:startX) (send gMedicineBottle:startY) gMedicineBottle)
        )
        = gMedicineBottle self
    )


    (method (useItem)
        (if (== (send gMedicineBottle:objType) 1)
            (switch (objType)
                (case 2
                    (switch (objName)
                        (case 32
                            (if (== (send gMedicineBottle:objName) 14)
                                (send gGameMusic2:
                                    number(2926)
                                    loop(1)
                                    flags(1)
                                    play()
                                )
                                (send gFpMessager:say(35 73 13))
                            )(else
                                (if (== (send gMedicineBottle:form) 26)
                                    (send gGameMusic2:
                                        number(2926)
                                        loop(1)
                                        flags(1)
                                        play()
                                    )
                                    (send gFpMessager:say(35 73 1))
                                )(else
                                    (if (== amount -1)
                                        (send gGameMusic2:
                                            number(2926)
                                            loop(1)
                                            flags(1)
                                            play()
                                        )
                                        (send gFpMessager:say(35 72 2))
                                    )(else
                                        (if ((<> amount 0) and (<> contents (send gMedicineBottle:objName)))
                                            (send gGameMusic2:
                                                number(2926)
                                                loop(1)
                                                flags(1)
                                                play()
                                            )
                                            (send gFpMessager:say(35 72 3))
                                        )(else
                                            (if (== amount 0)
                                                = amount 5
                                                = contents (send gMedicineBottle:objName)
                                                = form (send gMedicineBottle:form)
                                            )(else
                                                = amount (+ amount 5)
                                            )
                                            proc625_0(self)
                                        )
                                    )
                                )
                            )
                        )
                        (case 35
                            (if (== (send gMedicineBottle:form) 27)
                                (send gGameMusic2:
                                    number(2926)
                                    loop(1)
                                    flags(1)
                                    play()
                                )
                                (send gFpMessager:say(53 73 1))
                            )(else
                                (if (== amount 5)
                                    (send gGameMusic2:
                                        number(2926)
                                        loop(1)
                                        flags(1)
                                        play()
                                    )
                                    (send gFpMessager:say(53 72 2))
                                )(else
                                    = amount 5
                                    (send (= contents (List:new())):addToEnd((send ((ChemicalObj:new())):
                                            chemicalName((send gMedicineBottle:objName))
                                            chemicalAmount(5)
                                        )
))
                                    = form (send gMedicineBottle:form)
                                    = contentState 49
                                    proc625_0(self)
                                )
                            )
                        )
                    )
                )
                (case 3
                    (send gGameMusic2:
                        number(2926)
                        loop(1)
                        flags(1)
                        play()
                    )
                    (send gFpMessager:say(49 72))
                )
                (case 4
                    (send gGameMusic2:
                        number(2926)
                        loop(1)
                        flags(1)
                        play()
                    )
                    (send gFpMessager:say(50 72))
                )
                (default 
                    (send gGameMusic2:
                        number(2926)
                        loop(1)
                        flags(1)
                        play()
                    )
                )
            )
        )(else
            (if (== (send gMedicineBottle:objType) 2)
                (switch (objType)
                    (case 1
                        (switch ((send gMedicineBottle:objName))
                            (case 32
                                (if (== objName 14)
                                    (send gGameMusic2:
                                        number(2926)
                                        loop(1)
                                        flags(1)
                                        play()
                                    )
                                    (send gFpMessager:say(35 73 13))
                                )(else
                                    (if (== form 26)
                                        (send gGameMusic2:
                                            number(2926)
                                            loop(1)
                                            flags(1)
                                            play()
                                        )
                                        (send gFpMessager:say(35 73 1))
                                    )(else
                                        (if (== (send gMedicineBottle:amount) -1)
                                            (send gGameMusic2:
                                                number(2926)
                                                loop(1)
                                                flags(1)
                                                play()
                                            )
                                            (send gFpMessager:say(35 72 2))
                                        )(else
                                            (if ((<> (send gMedicineBottle:amount) 0) and (<> (send gMedicineBottle:contents) objName))
                                                (send gGameMusic2:
                                                    number(2926)
                                                    loop(1)
                                                    flags(1)
                                                    play()
                                                )
                                                (send gFpMessager:say(35 72 3))
                                            )(else
                                                (if (== (send gMedicineBottle:amount) 0)
                                                    (send gMedicineBottle:amount(5))
                                                    (send gMedicineBottle:contents(objName))
                                                    (send gMedicineBottle:form(form))
                                                )(else
                                                    (send gMedicineBottle:amount((+ (send gMedicineBottle:amount) 5)))
                                                )
                                            )
                                        )
                                    )
                                )
                            )
                            (case 35
                                (if (== form 27)
                                    (send gGameMusic2:
                                        number(2926)
                                        loop(1)
                                        flags(1)
                                        play()
                                    )
                                    (send gFpMessager:say(53 73 1))
                                )(else
                                    (if (== (send gMedicineBottle:amount) 5)
                                        (send gGameMusic2:
                                            number(2926)
                                            loop(1)
                                            flags(1)
                                            play()
                                        )
                                        (send gFpMessager:say(53 72 2))
                                    )(else
                                        (send gMedicineBottle:
                                            amount(5)
                                            contents((List:new()))
                                            form(form)
                                            contentState(49)
                                        )
                                        (send ((send gMedicineBottle:contents)):addToEnd((send ((ChemicalObj:new())):
                                                chemicalName(objName)
                                                chemicalAmount(5)
                                            )
))
                                    )
                                )
                            )
                        )
                    )
                    (case 3
                        (if (((== objName 37) and (<> (send gMedicineBottle:amount) 0)) and (== (send gMedicineBottle:form) 27))
                            (send gGameMusic2:
                                number(2926)
                                loop(1)
                                flags(1)
                                play()
                            )
                            (send gFpMessager:say(49 73 10))
                        )(else
                            (if (((== (send gMedicineBottle:objName) 35) and (== (send gMedicineBottle:amount) 0)) and (== form 27))
                                (send gFpMessager:say(53 73 1))
                            )(else
                                (if (((== (send gMedicineBottle:objName) 35) and (== (send gMedicineBottle:amount) 0)) and amount)
                                    (send gMedicineBottle:
                                        contents((List:new()))
                                        amount(5)
                                        form(form)
                                        contentState(contentState)
                                    )
                                    = local4 0
                                    (while (< local4 (send contents:size))
                                        (send ((send gMedicineBottle:contents)):addToEnd((send ((ChemicalObj:new())):
                                                chemicalName((send ((send contents:at(local4))):chemicalName))
                                                chemicalAmount((send ((send contents:at(local4))):chemicalAmount))
                                            )
))
                                        ++local4
                                    )
                                    = amount (- amount 5)
                                    (if (== amount 0)
                                        (send contents:dispose())
                                        = form (= contents 0)
                                        = contentState 49
                                    )
                                    proc625_0(self)
                                )(else
                                    (if (((== (send gMedicineBottle:objName) 35) and (> (send gMedicineBottle:amount) 0)) and (> (send ((send gMedicineBottle:contents)):size) 1))
                                        (send gFpMessager:say(49 81 25))
                                    )(else
                                        (if (((== (send gMedicineBottle:objName) 35) and (> (send gMedicineBottle:amount) 0)) and (== (send ((send gMedicineBottle:contents)):size) 1))
                                            (if (amount)
                                                = local4 0
                                                (while ((< local4 (send contents:size)) and (<> (send ((send contents:at(local4))):chemicalName) (send ((send ((send gMedicineBottle:contents)):at(0))):chemicalName)))
                                                    ++local4
                                                )
                                                (if (< local4 (send contents:size))
                                                    (send ((send contents:at(local4))):chemicalAmount((+ (send ((send contents:at(local4))):chemicalAmount) (send gMedicineBottle:amount))))
                                                )(else
                                                    (send contents:addToEnd((send ((ChemicalObj:new())):
                                                            chemicalName((send ((send ((send gMedicineBottle:contents)):at(0))):chemicalName))
                                                            chemicalAmount((send gMedicineBottle:amount))
                                                        )
))
                                                )
                                                = amount (+ amount (send gMedicineBottle:amount))
                                                (if (> contentState 50)
                                                    = contentState 51
                                                )(else
                                                    = contentState 49
                                                )
                                                (switch ((send gMedicineBottle:form))
                                                    (case 26
                                                        (if (== form 27)
                                                            = form 28
                                                        )
                                                    )
                                                    (case 27
                                                        (if (== form 26)
                                                            = form 28
                                                        )
                                                    )
                                                )
                                            )(else
                                                (send (= contents (List:new())):addToEnd((send ((ChemicalObj:new())):
                                                        chemicalName((send ((send ((send gMedicineBottle:contents)):at(0))):chemicalName))
                                                        chemicalAmount((send gMedicineBottle:amount))
                                                    )
))
                                                = amount (send gMedicineBottle:amount)
                                                (if (== (send gMedicineBottle:form) 27)
                                                    = form 27
                                                )(else
                                                    = form 26
                                                )
                                            )
                                            (send ((send gMedicineBottle:contents)):dispose())
                                            (send gMedicineBottle:
                                                amount(0)
                                                contents(0)
                                                form(0)
                                                contentState(49)
                                            )
                                            proc625_0(self)
                                        )(else
                                            (if (== (send gMedicineBottle:amount) 0)
                                                (send gGameMusic2:
                                                    number(2731)
                                                    flags(1)
                                                    loop(1)
                                                    play()
                                                )
                                                (send gFpMessager:say(51))
                                            )(else
                                                (if (amount)
                                                    = local4 0
                                                    (while ((< local4 (send contents:size)) and (<> (send ((send contents:at(local4))):chemicalName) (send gMedicineBottle:contents)))
                                                        ++local4
                                                    )
                                                    (if (< local4 (send contents:size))
                                                        (send ((send contents:at(local4))):chemicalAmount((+ (send ((send contents:at(local4))):chemicalAmount) (send gMedicineBottle:amount))))
                                                    )(else
                                                        (send contents:addToEnd((send ((ChemicalObj:new())):
                                                                chemicalName((send gMedicineBottle:contents))
                                                                chemicalAmount((send gMedicineBottle:amount))
                                                            )
))
                                                    )
                                                    = amount (+ amount (send gMedicineBottle:amount))
                                                    (if (> contentState 50)
                                                        = contentState 51
                                                    )(else
                                                        = contentState 49
                                                    )
                                                    (switch ((send gMedicineBottle:form))
                                                        (case 26
                                                            (if (== form 27)
                                                                = form 28
                                                            )
                                                        )
                                                        (case 27
                                                            (if (== form 26)
                                                                = form 28
                                                            )
                                                        )
                                                    )
                                                )(else
                                                    (send (= contents (List:new())):addToEnd((send ((ChemicalObj:new())):
                                                            chemicalName((send gMedicineBottle:contents))
                                                            chemicalAmount((send gMedicineBottle:amount))
                                                        )
))
                                                    = amount (send gMedicineBottle:amount)
                                                    (if (== (send gMedicineBottle:form) 27)
                                                        = form 27
                                                    )(else
                                                        = form 26
                                                    )
                                                )
                                                (send gMedicineBottle:amount(0))
                                                (send gMedicineBottle:contents(0))
                                                (send gMedicineBottle:form(0))
                                                (if (== (send gMedicineBottle:objName) 34)
                                                    (send gMedicineBottle:
                                                        setCel(0)
                                                        form(34)
                                                    )
                                                    = gCursorNumber (send ((send gIconBar:curIcon)):cursor)
                                                    (send gCursorNumber:
                                                        view(620)
                                                        setLoop(15)
                                                        setCel(0)
                                                        init()
                                                    )
                                                )
                                                proc625_0(self)
                                            )
                                        )
                                    )
                                )
                            )
                        )
                    )
                    (case 4
                        (if (== (send gMedicineBottle:amount) 0)
                            (send gGameMusic2:
                                number(2731)
                                flags(1)
                                loop(1)
                                play()
                            )
                            (send gFpMessager:say(51))
                        )(else
                            (if (amount)
                                (send gGameMusic2:
                                    number(2926)
                                    loop(1)
                                    flags(1)
                                    play()
                                )
                                (send gFpMessager:say(50 73 11))
                            )(else
                                (send (= contents (List:new())):addToEnd((send ((ChemicalObj:new())):
                                        chemicalName((send gMedicineBottle:contents))
                                        chemicalAmount((send gMedicineBottle:amount))
                                    )
))
                                = amount (send gMedicineBottle:amount)
                                = form (send gMedicineBottle:form)
                                (send gMedicineBottle:amount(0))
                                (send gMedicineBottle:contents(0))
                                (send gMedicineBottle:form(0))
                                (if (== (send gMedicineBottle:objName) 34)
                                    (send gMedicineBottle:
                                        setCel(0)
                                        form(34)
                                    )
                                    = gCursorNumber (send ((send gIconBar:curIcon)):cursor)
                                    (send gCursorNumber:
                                        view(620)
                                        setLoop(15)
                                        setCel(0)
                                        init()
                                    )
                                )
                                proc625_0(self)
                            )
                        )
                    )
                    (default 
                        (send gGameMusic2:
                            number(2926)
                            loop(1)
                            flags(1)
                            play()
                        )
                    )
                )
            )(else
                (if (== (send gMedicineBottle:objType) 3)
                    (switch (objType)
                        (case 1
                            (send gGameMusic2:
                                number(2926)
                                loop(1)
                                flags(1)
                                play()
                            )
                            (send gFpMessager:say(56 76))
                        )
                        (case 2
                            (if (== (send gMedicineBottle:amount) 0)
                                (send gGameMusic2:
                                    number(2731)
                                    flags(1)
                                    loop(1)
                                    play()
                                )
                                (send gFpMessager:say(51))
                            )(else
                                (send gGameMusic2:
                                    number(2926)
                                    loop(1)
                                    flags(1)
                                    play()
                                )
                                (send gFpMessager:say(57 76))
                            )
                        )
                        (case 4
                            (if (== (send gMedicineBottle:amount) 0)
                                (send gGameMusic2:
                                    number(2731)
                                    flags(1)
                                    loop(1)
                                    play()
                                )
                                (send gFpMessager:say(51))
                            )(else
                                (if (amount)
                                    (send gGameMusic2:
                                        number(2926)
                                        loop(1)
                                        flags(1)
                                        play()
                                    )
                                    (send gFpMessager:say(50 73 11))
                                )(else
                                    = contents (send gMedicineBottle:contents)
                                    = amount (send gMedicineBottle:amount)
                                    = form (send gMedicineBottle:form)
                                    = contentState (send gMedicineBottle:contentState)
                                    (send gMedicineBottle:
                                        contents(0)
                                        amount(0)
                                        form(0)
                                        contentState(49)
                                    )
                                    proc625_0(self)
                                )
                            )
                        )
                        (default 
                            (send gGameMusic2:
                                number(2926)
                                loop(1)
                                flags(1)
                                play()
                            )
                        )
                    )
                )(else
                    (if (== (send gMedicineBottle:objType) 4)
                        (switch (objType)
                            (case 1
                                (send gGameMusic2:
                                    number(2926)
                                    loop(1)
                                    flags(1)
                                    play()
                                )
                                (send gFpMessager:say(56 77))
                            )
                            (case 2
                                (send gGameMusic2:
                                    number(2926)
                                    loop(1)
                                    flags(1)
                                    play()
                                )
                                (send gFpMessager:say(57 77))
                            )
                            (case 3
                                (send gGameMusic2:
                                    number(2926)
                                    loop(1)
                                    flags(1)
                                    play()
                                )
                                (send gFpMessager:say(49 77))
                            )
                            (default 
                                (send gGameMusic2:
                                    number(2926)
                                    loop(1)
                                    flags(1)
                                    play()
                                )
                            )
                        )
                    )(else
                        (if (== (send gMedicineBottle:objType) 5)
                            (switch ((send gMedicineBottle:objName))
                                (case 42
                                    (if (((== objType 4) and (== amount 0)) and (<> objName 40))
                                        (send gGameMusic2:
                                            number(2926)
                                            loop(1)
                                            flags(1)
                                            play()
                                        )
                                        (send gFpMessager:say(50 75 12))
                                    )(else
                                        (if ((== objType 4) and (<> objName 40))
                                            proc625_1()
                                            (self:
                                                view(view)
                                                setLoop(loop)
                                                setCel(++cel)
                                            )
                                            Animate((send gOldCast:elements) 1)
                                            = global144 1
                                            (send gEgo:
                                                put(25)
                                                put(26)
                                            )
                                            (switch (global119)
                                                (case 2
                                                    (if (((== (send contents:size) 1) and (== (send ((send contents:at(0))):chemicalName) 10)) and (== (send ((send contents:at(0))):chemicalAmount) 40))
                                                        (send gEgo:get(-1 34))
                                                        proc0_4(104)
                                                    )(else
                                                        (if ((== (send contents:size) 1) and (== (send ((send contents:at(0))):chemicalName) 10))
                                                            proc0_3(104)
                                                            (send gEgo:get(-1 25))
                                                            (if ((send gEgo:has(34)))
                                                                (send gEgo:put(34))
                                                            )
                                                        )(else
                                                            proc0_4(104)
                                                            (send gEgo:get(-1 25))
                                                            (if ((send gEgo:has(34)))
                                                                (send gEgo:put(34))
                                                            )
                                                        )
                                                    )
                                                    = global143 1
                                                    (send gFpMessager:say(34 0 5 0 self))
                                                )
                                                (case 3
                                                    (if ((((== form 29) and (== contentState 50)) and (== (send contents:size) 2)) and (((((== (send ((send contents:at(0))):chemicalName) 6) and (== (send ((send contents:at(0))):chemicalAmount) 15)) and (== (send ((send contents:at(1))):chemicalName) 17)) and (== (send ((send contents:at(1))):chemicalAmount) 30)) or ((((== (send ((send contents:at(1))):chemicalName) 6) and (== (send ((send contents:at(1))):chemicalAmount) 15)) and (== (send ((send contents:at(0))):chemicalName) 17)) and (== (send ((send contents:at(0))):chemicalAmount) 30))))
                                                        (if (== amount 21)
                                                            proc0_4(104)
                                                            (send gEgo:get(-1 35))
                                                        )(else
                                                            proc0_3(104)
                                                            (send gEgo:get(-1 25))
                                                            (if ((send gEgo:has(35)))
                                                                (send gEgo:put(35))
                                                            )
                                                        )
                                                    )(else
                                                        proc0_4(104)
                                                        (send gEgo:get(-1 25))
                                                        (if ((send gEgo:has(35)))
                                                            (send gEgo:put(35))
                                                        )
                                                    )
                                                    = global143 1
                                                    (send gFpMessager:say(34 0 6 0 self))
                                                )
                                                (case 4
                                                    (if ((send gEgo:has(58)))
                                                        (if (((== amount 75) and (== contentState 52)) and (== (send contents:size) 4))
                                                            = local5 0
                                                            = local4 0
                                                            (while (< local4 4)
                                                                (if ((== (send ((send contents:at(local4))):chemicalName) 8) and (== (send ((send contents:at(local4))):chemicalAmount) 10))
                                                                    break
                                                                )
                                                                ++local4
                                                            )
                                                            = local6 0
                                                            = local4 0
                                                            (while (< local4 4)
                                                                (if ((== (send ((send contents:at(local4))):chemicalName) 19) and (== (send ((send contents:at(local4))):chemicalAmount) 30))
                                                                    break
                                                                )
                                                                ++local4
                                                            )
                                                            = local7 0
                                                            = local4 0
                                                            (while (< local4 4)
                                                                (if ((== (send ((send contents:at(local4))):chemicalName) 21) and (== (send ((send contents:at(local4))):chemicalAmount) 5))
                                                                    break
                                                                )
                                                                ++local4
                                                            )
                                                            = local8 0
                                                            = local4 0
                                                            (while (< local4 4)
                                                                (if ((== (send ((send contents:at(local4))):chemicalName) 15) and (== (send ((send contents:at(local4))):chemicalAmount) 30))
                                                                    break
                                                                )
                                                                ++local4
                                                            )
                                                            (if (((local5 and local6) and local7) and local8)
                                                                proc0_3(95)
                                                            )(else
                                                                proc0_4(95)
                                                            )
                                                        )(else
                                                            proc0_4(95)
                                                        )
                                                        = global143 1
                                                        (send gEgo:get(-1 25))
                                                        (send gFpMessager:say(34 0 9 0 self))
                                                    )(else
                                                        (send gEgo:get(-1 25))
                                                        = global143 1
                                                        (send gFpMessager:say(34 0 32 0 self))
                                                    )
                                                )
                                                (case 9
                                                    (if (((== amount 105) and (== contentState 50)) and (== (send contents:size) 4))
                                                        = local5 0
                                                        = local4 0
                                                        (while (< local4 4)
                                                            (if ((== (send ((send contents:at(local4))):chemicalName) 20) and (== (send ((send contents:at(local4))):chemicalAmount) 40))
                                                                break
                                                            )
                                                            ++local4
                                                        )
                                                        = local6 0
                                                        = local4 0
                                                        (while (< local4 4)
                                                            (if ((== (send ((send contents:at(local4))):chemicalName) 9) and (== (send ((send contents:at(local4))):chemicalAmount) 15))
                                                                break
                                                            )
                                                            ++local4
                                                        )
                                                        = local7 0
                                                        = local4 0
                                                        (while (< local4 4)
                                                            (if ((== (send ((send contents:at(local4))):chemicalName) 16) and (== (send ((send contents:at(local4))):chemicalAmount) 45))
                                                                break
                                                            )
                                                            ++local4
                                                        )
                                                        = local8 0
                                                        = local4 0
                                                        (while (< local4 4)
                                                            (if ((== (send ((send contents:at(local4))):chemicalName) 24) and (== (send ((send contents:at(local4))):chemicalAmount) 5))
                                                                break
                                                            )
                                                            ++local4
                                                        )
                                                        (if (((local5 and local6) and local7) and local8)
                                                            (send gEgo:get(-1 13))
                                                            (send gGame:points(5 154))
                                                            = global143 1
                                                            (send gFpMessager:say(34 0 26 0 self))
                                                        )(else
                                                            (if ((send gEgo:has(13)))
                                                                (send gEgo:put(13))
                                                            )
                                                            = global143 1
                                                            (send gFpMessager:say(34 0 21 0 self))
                                                        )
                                                    )(else
                                                        (if ((send gEgo:has(13)))
                                                            (send gEgo:put(13))
                                                        )
                                                        = global143 1
                                                        (send gFpMessager:say(34 0 21 0 self))
                                                    )
                                                )
                                                (case 13
                                                    (if ((((== amount 30) and (== contentState 51)) and (== (send contents:size) 2)) and (((((== (send ((send contents:at(0))):chemicalName) 11) and (== (send ((send contents:at(0))):chemicalAmount) 25)) and (== (send ((send contents:at(1))):chemicalName) 13)) and (== (send ((send contents:at(1))):chemicalAmount) 5)) or ((((== (send ((send contents:at(0))):chemicalName) 13) and (== (send ((send contents:at(0))):chemicalAmount) 5)) and (== (send ((send contents:at(1))):chemicalName) 11)) and (== (send ((send contents:at(1))):chemicalAmount) 25))))
                                                        (send gEgo:get(-1 47))
                                                        = global143 1
                                                        (send gFpMessager:say(34 0 27 0 self))
                                                    )(else
                                                        (if ((send gEgo:has(47)))
                                                            (send gEgo:put(47))
                                                        )
                                                        = global143 1
                                                        (send gFpMessager:say(34 0 21 0 self))
                                                    )
                                                )
                                                (default 
                                                    proc0_4(104)
                                                    (send gEgo:get(-1 25))
                                                    = global143 1
                                                    (send gFpMessager:say(34 0 32 0 self))
                                                )
                                            )
                                        )(else
                                            (send gGameMusic2:
                                                number(2926)
                                                loop(1)
                                                flags(1)
                                                play()
                                            )
                                        )
                                    )
                                )
                                (case 43
                                    (if ((== objName 36) and amount)
                                        (send gGame:handsOff())
                                        (self:
                                            setLoop(3)
                                            setCycle(TimedCue 4 self)
                                        )
                                        (send gGameMusic2:
                                            number(2624)
                                            loop(-1)
                                            flags(1)
                                            play()
                                        )
                                        (switch (contentState)
                                            (case 49
                                                = contentState 50
                                            )
                                            (case 51
                                                = contentState 52
                                            )
                                        )
                                    )(else
                                        (send gGameMusic2:
                                            number(2926)
                                            loop(1)
                                            flags(1)
                                            play()
                                        )
                                    )
                                )
                                (default 
                                    (send gGameMusic2:
                                        number(2926)
                                        loop(1)
                                        flags(1)
                                        play()
                                    )
                                )
                            )
                        )(else
                            (send gGameMusic2:
                                number(2926)
                                loop(1)
                                flags(1)
                                play()
                            )
                        )
                    )
                )
            )
        )
    )

)
