(version 2)
(include "sci.sh")
(exports
    0 rm420
)
(use "Main")
(use "FPRoom")
(use "Obj")
(script 420)


(local
    local0
    local1 =     100

)
(instance public rm420 of FPRoom
    (properties
        picture 420
    )

    (method (init)
        proc0_9(0)
        (super:init())
        (self:setScript(sCartoon))
    )

)
(instance sCartoon of Script
    (properties)

    (method (doit)
        (if ((== state 3) and (== PalVary(pvGET_CURRENT_STEP) 64))
            (self:cue())
        )(else
            (if (local0 and local1)
                Palette(palSET_INTENSITY 0 255 --local1)
                (if (not local1)
                    (self:cue())
                )
            )
        )
        (super:doit())
    )


    (method (changeState newState)
        (switch (= state newState)
            (case 0
                = cycles 2
                proc0_4(1)
                proc0_3(59)
            )
            (case 1
                (send gFpMessager:say(1 0 0 0 self))
            )
            (case 2
                (send gIconBar:disable(1 2 3 4 5 6 7))
                (send gGame:setCursor(996))
                = seconds 1
            )
            (case 3
                PalVary(pvINIT 630 5)
            )
            (case 4
                = local0 1
            )
            (case 5
                PalVary(pvUNINIT)
                (send gOldCast:eachElementDo(#dispose))
                Palette(palSET_INTENSITY 0 256 0)
                (send global2:drawPic(780))
                = cycles 1
            )
            (case 6
                (send global2:newRoom(26))
                (self:dispose())
            )
        )
    )

)
