(include "sci.sh")
(use "Main")
(use "Sq5InvItem")
(use "ScrollableInventory")
(use "ScrollInsetWindow")
(use "Print")
(use "IconI")
(use "InvI")
(use "Obj")
(script 15)



(class Sq5InvItem of InvI
    (properties
        view 0
        loop 0
        cel 0
        nsLeft 0
        nsTop 0
        nsRight 0
        nsBottom 0
        state 0
        cursor 999
        type 16384
        message 0
        modifiers 0
        signal 0
        maskView 0
        maskLoop 0
        maskCel 0
        highlightColor 0
        lowlightColor 0
        noun 0
        modNum 0
        helpVerb 0
        owner 0
        script 0
        value 0
    )

    (method (doVerb param1)
        (var temp0, temp1)
        (if (not modNum)
            = modNum gModNum
        )
        (switch (param1)
            (case 1
                (
                (if (GetMessage(2 modNum noun 1 0 1))
                    = temp1 CelWide(view loop cel)
                    = temp0 GetPort()
                    (Print:
                        addIcon(view loop cel 0 0)
                        addText(noun 1 0 1 + temp1 4 0 modNum)
                        init()
                    )
                    SetPort(temp0)
                )
 )
            )
            (case 4
                (
                (if (GetMessage(2 modNum noun 4 0 1))
                    = temp0 GetPort()
                    (Print:
                        addText(noun 4 0 0 0 0 modNum)
                        init()
                    )
                    SetPort(temp0)
                )(else
                    = temp0 GetPort()
                    (Print:
                        addText(0 4 0 0 0 0 modNum)
                        init()
                    )
                    SetPort(temp0)
                )
 )
            )
            (default 
                (
                (if (GetMessage(2 modNum noun param1 0 1))
                    = temp0 GetPort()
                    (Print:
                        addText(noun param1 0 0 0 0 modNum)
                        init()
                    )
                    SetPort(temp0)
                )(else
                    = temp0 GetPort()
                    (Print:
                        addText(0 7 0 0 0 0 modNum)
                        init()
                    )
                    SetPort(temp0)
                )
 )
            )
        )
    )

)
(instance sq5Inv of ScrollableInventory
    (properties)

    (method (init param1)
        (super:init(rest param1))
        (invWin:
            color(0)
            back(3)
            topBordColor(5)
            lftBordColor(4)
            rgtBordColor(2)
            botBordColor(1)
            insideColor(2)
            topBordColor2(1)
            lftBordColor2(1)
            botBordColor2(6)
            rgtBordColor2(6)
        )
        (self:
            add(Buckazoids {Floor Scrubber} {Safety Cones} {Distributor Cap} {Transporter Fuse} Antacid {Ship Opener} {Cutting Torch} Spike {Oxygen Tank} Communicator {Hole Punch} {Cloaking Device} {Space Monkeys Package} {Business Card} {Genetix Canister} {Liquid Nitro Tank} {Kiz Branch} {Kiz Fruit} frock {WD40 Head} {Oxygen Mask} Paper)
            eachElementDo(220 2)
            add(invLook invSelect invHelp invUp invDown ok)
        )
        (self:
            state(2048)
            upIcon(invUp)
            downIcon(invDown)
            window(invWin)
            helpIconItem(invHelp)
            selectIcon(invSelect)
            okButton(ok)
            numCols(5)
            scrollAmount(5)
            dispAmount(10)
            empty(13)
            normalHeading(15)
            eachElementDo(219 0)
            eachElementDo(222 15)
            eachElementDo(110)
        )
    )

)
(instance public invCode of Code
    (properties)

    (method (init)
        (send (= gSq5Inv sq5Inv):init())
    )

)
(instance public invWin of ScrollInsetWindow
    (properties
        priority -1
        topBordHgt 30
        botBordHgt 5
    )

    (method (open param1)
        (invLook:nsLeft((- (/ (- (self:right) (self:left)) 2) 84)))
        (invLook:nsTop(2))
        (super:open(rest param1))
    )

)
(instance invUp of IconI
    (properties
        view 991
        loop 5
        cel 0
        cursor 999
        maskView 991
        maskLoop 5
        maskCel 2
        lowlightColor 5
        noun 18
        helpVerb 5
    )

    (method (select param1)
        (if ((super:select(rest param1)))
            (send gSq5Inv:scroll(-1))
        )
        return 0
    )

)
(instance invDown of IconI
    (properties
        view 991
        loop 6
        cel 0
        cursor 999
        maskView 991
        maskLoop 6
        maskCel 2
        lowlightColor 5
        noun 11
        helpVerb 5
    )

    (method (select param1)
        (if ((super:select(rest param1)))
            (send gSq5Inv:scroll(1))
        )
        return 0
    )

)
(instance ok of IconI
    (properties
        view 991
        loop 3
        cel 0
        cursor 999
        signal 67
        lowlightColor 5
        noun 16
        helpVerb 5
    )
)
(instance invLook of IconI
    (properties
        view 991
        loop 2
        cel 0
        cursor 981
        message 1
        signal 129
        lowlightColor 5
        noun 15
        helpVerb 5
    )
)
(instance invHand of IconI
    (properties
        view 991
        loop 0
        cel 0
        cursor 982
        message Sq5InvItem
        lowlightColor 5
        noun 12
        helpVerb 5
    )
)
(instance invHelp of IconI
    (properties
        view 991
        loop 1
        cel 0
        cursor 989
        message 5
        lowlightColor 5
        noun 14
        helpVerb 5
    )
)
(instance invSelect of IconI
    (properties
        view 991
        loop Sq5InvItem
        cel 0
        cursor 999
        lowlightColor 5
        noun 17
        helpVerb 5
    )
)
(instance Buckazoids of Sq5InvItem
    (properties
        view 900
        loop 1
        cursor 900
        message 17
        signal 2
        noun 3
    )
)
(instance {Floor Scrubber} of Sq5InvItem
    (properties
        view 901
        loop 1
        cursor 901
        message 18
        signal 2
        noun 28
    )
)
(instance {Safety Cones} of Sq5InvItem
    (properties
        view 903
        loop 1
        cursor 903
        message 20
        signal 2
        noun 27
    )
)
(instance {Distributor Cap} of Sq5InvItem
    (properties
        view 904
        loop 1
        cursor 904
        message 19
        signal 2
        noun 7
    )
)
(instance {Transporter Fuse} of Sq5InvItem
    (properties
        view 905
        loop 1
        cursor 905
        message 28
        signal 2
        noun 9
    )
)
(instance Antacid of Sq5InvItem
    (properties
        view 906
        loop 1
        cursor 906
        message 29
        signal 2
        noun 1
    )
)
(instance {Ship Opener} of Sq5InvItem
    (properties
        view 907
        loop 1
        cursor 907
        message 6
        signal 2
        noun 29
    )
)
(instance {Cutting Torch} of Sq5InvItem
    (properties
        view 908
        loop 1
        cursor 908
        message 30
        signal 2
        noun 31
    )
)
(instance Spike of Sq5InvItem
    (properties
        view 909
        loop 1
        cursor 909
        message 31
        signal 2
        noun 30
    )
)
(instance {Oxygen Tank} of Sq5InvItem
    (properties
        view 917
        loop 1
        cursor 917
        message 25
        signal 2
        noun 24
    )
)
(instance Communicator of Sq5InvItem
    (properties
        view 911
        loop 1
        cursor 911
        message 32
        signal 2
        noun 6
    )
)
(instance {Hole Punch} of Sq5InvItem
    (properties
        view 912
        loop 1
        cursor 912
        message 33
        signal 2
        noun 26
    )
)
(instance {Cloaking Device} of Sq5InvItem
    (properties
        view 913
        loop 1
        cursor 913
        message 26
        signal 2
        noun 5
    )
)
(instance {Space Monkeys Package} of Sq5InvItem
    (properties
        view 914
        loop 1
        cursor 914
        message 34
        signal 2
        noun 21
    )

    (method (doVerb param1)
        (var temp0, temp1)
        (if (not modNum)
            = modNum gModNum
        )
        (if (GetMessage(2 modNum noun param1 0 1))
            = temp1 CelWide(529 0 0)
            = temp0 GetPort()
            (Print:
                addIcon(529 0 0 0 0)
                addText(noun param1 0 1 + temp1 4 0 modNum)
                init()
            )
            SetPort(temp0)
        )
    )

)
(instance {Business Card} of Sq5InvItem
    (properties
        view 915
        loop 1
        cursor 915
        message 35
        signal 2
        noun 2
    )

    (method (doVerb param1 param2)
        (var temp0)
        (if (== param1 33)
            (if (proc999_5(gModNum 201 200 228 226 620 640))
                = temp0 GetPort()
                (Print:
                    addText(noun param1 1 1 0 0 15)
                    init()
                )
                SetPort(temp0)
            )(else
                (send gSq5Inv:hide())
                (send (ScriptID(2000 0)):doit())
            )
        )(else
            (super:doVerb(param1 rest param2))
        )
    )

)
(instance {Genetix Canister} of Sq5InvItem
    (properties
        view 916
        loop 1
        cursor 916
        message 36
        signal 2
        noun Sq5InvItem
    )
)
(instance {Liquid Nitro Tank} of Sq5InvItem
    (properties
        view 910
        loop 1
        cursor 910
        message 37
        signal 2
        noun 22
    )
)
(instance {Kiz Branch} of Sq5InvItem
    (properties
        view 918
        loop 1
        cursor 918
        message 21
        signal 2
        noun 19
    )
)
(instance {Kiz Fruit} of Sq5InvItem
    (properties
        view 919
        loop 1
        cursor 919
        message 22
        signal 2
        noun 20
    )
)
(instance frock of Sq5InvItem
    (properties
        view 920
        loop 1
        cursor 920
        message 23
        signal 2
        noun 8
    )
)
(instance {WD40 Head} of Sq5InvItem
    (properties
        view 921
        loop 1
        cursor 921
        message 38
        signal 2
        noun 10
    )
)
(instance {Oxygen Mask} of Sq5InvItem
    (properties
        view 922
        loop 1
        cursor 922
        message 39
        signal 2
        noun 23
    )
)
(instance Paper of Sq5InvItem
    (properties
        view 923
        loop 1
        cursor 923
        message 42
        signal 2
        noun 25
    )

    (method (doVerb param1)
        (var temp0, temp1)
        (if (not modNum)
            = modNum gModNum
        )
        (if (GetMessage(2 modNum noun param1 0 1))
            = temp1 CelWide(614 0 0)
            = temp0 GetPort()
            (Print:
                addIcon(614 0 0 0 0)
                addText(noun param1 0 1 + temp1 4 0 modNum)
                init()
            )
            SetPort(temp0)
        )
    )

)
