(include "sci.sh")
(use "Main")
(use "eureka")
(use "Print")
(use "Sound")
(use "Obj")
(script 218)



(instance theMusic3 of Sound
    (properties)
)
(instance public sCommandCliffy of Script
    (properties)

    (method (dispose param1)
        (super:dispose(rest param1))
        DisposeScript(218)
        DisposeScript(205)
    )


    (method (changeState newState)
        (var temp0[20])
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (send (ScriptID(202 13)):setScript(0)) = cycles 1  )
            )
            (case 1
                ((send gSQ5:handsOn()) (send gSq5IconBar:select((send gSq5IconBar:at(2)))) (send gSQ5:setCursor(982 1)) = register (Print:
                        mode(1)
                        window(ScriptID(205 0))
                        width(125)
                        addColorButton(0 1 0 0 19 0 0 205 13 29 31 0 0 0)
                        addColorButton(1 1 0 0 20 0 10 205 13 29 31 0 0 0)
                        addColorButton(2 1 0 0 21 0 20 205 13 29 31 0 0 0)
                        addColorButton(3 1 0 0 22 0 30 205 13 29 31 0 0 0)
                        addColorButton(4 1 0 0 23 0 40 205 13 29 31 0 0 0)
                        init()
                    )
 = cycles 1  )
            )
            (case 2
                (
                (switch (register)
                    (case 0
                        ((self:setScript(sStatusReport self))  )
                    )
                    (case 1
                        ((self:setScript(sCloakShip self))  )
                    )
                    (case 2
                        ((self:setScript(sDeCloakShip self))  )
                    )
                    (case 3
                        ((self:setScript(sMorePower self))  )
                    )
                    (case 4
                        ((self:setScript(sForgetIt self))  )
                    )
                    (default 
                        (= cycles 1 )
                    )
                )
  )
            )
            (case 3
                (
                (if ((== gEurekaCurLocation 14) and not proc0_1(39))
                    (eureka:setScript(ScriptID(210 1) 0 1))
                )
 
                (if (<> register 4)
                    (send gTestMessager:say(43 0 0 1 self))
                    = state 0
                )(else
                    = cycles 1
                )
 )
            )
            (case 4
                ((send gSQ5:handsOn()) (send gSq5IconBar:select((send gSq5IconBar:at(2)))) (send gSQ5:setCursor(982 1)) (self:dispose()) )
            )
        )
    )

)
(instance sStatusReport of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (
                (if (proc0_1(61))
                    (send gTestMessager:say(8 0 13 1 self))
                )(else
                    (if ((> global126 1) and not proc0_1(56))
                        (send gTestMessager:say(8 0 12 1 self))
                    )(else
                        (if ((== gEurekaCurLocation 14) and proc0_1(39))
                            (send gTestMessager:say(8 0 55 1 self))
                        )(else
                            (if ((eureka:damaged))
                                (send gTestMessager:say(8 0 11 1 self))
                            )(else
                                (if (>= (eureka:puke) 4)
                                    (send gTestMessager:say(8 0 16 1 self))
                                )(else
                                    (if ((== global170 2) and not proc0_1(47))
                                        (send gTestMessager:say(8 0 5 1 self))
                                        proc0_2(47)
                                    )(else
                                        (if (proc0_1(30))
                                            (send gTestMessager:say(8 0 3 Random(1 3) self))
                                        )(else
                                            (send gTestMessager:say(8 0 4 Random(1 3) self))
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
 )
            )
            (case 1
                ((self:dispose()) )
            )
        )
    )

)
(instance sCloakShip of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (
                (if (proc0_1(39))
                    (send gTestMessager:say(7 0 9 1 self))
                )(else
                    (if (not proc0_1(89))
                        (if (proc0_1(30))
                            (send gTestMessager:say(7 0 3 Random(1 3) self))
                        )(else
                            (send gTestMessager:say(7 0 4 Random(1 3) self))
                        )
                    )(else
                        (if (proc0_1(32))
                            (send gTestMessager:say(7 0 45 1 self))
                        )(else
                            (if ((== global142 2) and proc0_1(75))
                                proc0_2(39)
                                (self:setScript(sCloaking self))
                            )(else
                                (send gTestMessager:say(7 0 10 1 self))
                            )
                        )
                    )
                )
 )
            )
            (case 1
                ((self:dispose()) )
            )
        )
    )

)
(instance sCloaking of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (send gTestMessager:say(42 0 52 1 self))  )
            )
            (case 1
                (= seconds 2  )
            )
            (case 2
                (
                (if (proc0_1(37))
                    proc0_10(194 50)
                    (eureka:setScript(ScriptID(210 4) 0 1))
                )
 (theMusic3:
                    number(106)
                    loop(1)
                    play(self)
                )
  )
            )
            (case 3
                ((theMusic3:dispose()) (self:dispose()) )
            )
        )
    )

)
(instance sDeCloakShip of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (
                (if (not proc0_1(39))
                    (if (proc0_1(30))
                        (send gTestMessager:say(10 0 3 Random(1 3) self))
                    )(else
                        (send gTestMessager:say(10 0 4 Random(1 3) self))
                    )
                )(else
                    (self:setScript(sCloaking self))
                    proc0_3(39)
                )
 )
            )
            (case 1
                ((self:dispose()) )
            )
        )
    )

)
(instance sMorePower of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gTestMessager:say(26 0 0 0 self))  )
            )
            (case 1
                ((self:dispose()) )
            )
        )
    )

)
(instance sForgetIt of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (
                (if (proc0_1(30))
                    (send gTestMessager:say(17 0 3 Random(1 3) self))
                )(else
                    (send gTestMessager:say(17 0 4 Random(1 3) self))
                )
 )
            )
            (case 1
                ((self:dispose()) )
            )
        )
    )

)
