(include "sci.sh")
(use "Main")
(use "rmnScript")
(use "SQRoom")
(use "RandCycle")
(use "Sound")
(use "Cycle")
(use "PicView")
(use "Obj")
(script 345)



(instance public rm345 of SQRoom
    (properties
        picture 345
    )

    (method (init)
        proc0_14(10)
        (switch (global12)
            (case 340
                (eyebrows:init())
                (mouth:init())
                (arm:init())
                (coil:init())
                (wizz:init())
                (wizzSfx:init())
                (armSFX:init())
                (self:setScript(threatScript))
            )
            (default 
                (eyebrows:init())
                (mouth:init())
                (arm:init())
                (coil:init())
                (wizz:init())
                (wizzSfx:init())
                (armSFX:init())
                (self:setScript(threatScript))
            )
        )
        (super:init())
    )

)
(instance threatScript of rmnScript
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gLongSong:hold(0))
                proc0_2()
                = seconds 3
            )
            (case 1
                (eyebrows:setCel(1))
                (mouth:setCycle(RandCycle 25))
                (self:save1(proc0_12("\"Let me introduce you to a friend of mine.\"" 67 2 1 28 global130 29 global155 30 1 70 315)))
                = seconds 6
            )
            (case 3
                (send gLongSong:pause(1))
                (armSFX:play())
                (arm:
                    z(0)
                    setPri(13)
                    setCycle(Beg)
                )
                = cycles 30
            )
            (case 4
                (armSFX:dispose())
                (send gLongSong:pause(0))
                (wizzSfx:play())
                = cycles 1
            )
            (case 5
                = start state
                (coil:
                    z(0)
                    setPri(14)
                    setCel(1)
                )
                (wizz:
                    z(0)
                    setCycle(End self)
                )
                = cycles 5
            )
            (case 6
                (coil:setCel(0))
                (wizz:setCycle(Beg self))
            )
            (case 7
                (if (< ++register 10)
                    (self:init())
                )(else
                    (wizz:dispose())
                    (wizzSfx:dispose())
                    = cycles 1
                )
            )
            (case 8
                (eyebrows:setCel(0))
                (mouth:setCycle(RandCycle 35))
                (self:save1(proc0_12("\"This is the EpiRip 357, the most powerful hand hair remover in the universe and it's capable of shaving your legs clean off.\"" 67 2 1 28 global130 29 global155 30 1 70 315)))
                = seconds 10
            )
            (case 10
                (eyebrows:setCel(1))
                (mouth:setCycle(RandCycle 35))
                (self:save1(proc0_12("\"I've always wanted to see a man shave with one of these, but I guess you'll do.\"" 67 2 1 28 global130 29 global155 30 1 70 315)))
                = seconds 10
            )
            (case 12
                (eyebrows:setCel(1))
                (mouth:setCycle(RandCycle 25))
                (self:save1(proc0_12("\"Now you will know the meaning of the word PAIN.\"" 67 2 1 28 global130 29 global155 30 1 70 315)))
                = seconds 8
            )
            (case 14
                (self:setScript(shockScript))
            )
            (default 
                (self:restore())
                (mouth:setCycle(0))
                = cycles 1
            )
        )
    )

)
(instance shockScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (wizz:dispose())
                (send global2:overlay(346))
                (roarSFX:
                    init()
                    play()
                )
                (face:init())
                (arm:z(64536))
                = seconds 4
            )
            (case 1
                (send gLongSong:
                    init()
                    number(2)
                    loop(-1)
                    vol(127)
                    flags(1)
                    playBed()
                )
                = cycles 20
            )
            (case 2
                (send global2:newRoom(335))
            )
        )
    )

)
(instance wizzSfx of Sound
    (properties
        number 157
        loop -1
    )
)
(instance roarSFX of Sound
    (properties
        number 828
    )
)
(instance armSFX of Sound
    (properties
        number 866
    )
)
(instance face of Prop
    (properties
        x 142
        y 88
        view 345
        loop 2
    )
)
(instance eyebrows of Prop
    (properties
        x 138
        y 62
        view 345
    )
)
(instance mouth of Prop
    (properties
        x 146
        y 87
        view 345
        loop 1
    )
)
(instance arm of Prop
    (properties
        x 109
        y 189
        z 64536
        view 345
        loop 3
        cel 3
        priority 13
    )
)
(instance coil of Prop
    (properties
        x 136
        y 148
        z 64536
        view 345
        loop 4
        cel 1
    )
)
(instance wizz of Prop
    (properties
        x 176
        y 86
        z 64536
        view 345
        loop 5
    )
)
