(include "sci.sh")
(use "Main")
(use "Class_255_0")
(use "Sound")
(use "Game")
(script 600)



(instance public MineReg of Rgn
    (properties)

    (method (init)
        (if (initialized)
            return 
        )
        = keep 1
        (super:init())
        = global189 1
        (dwarfMusic:play())
    )


    (method (dispose)
        (if (== keep 0)
            = global189 0
            (dwarfMusic:keep(0))
            (send gSounds:eachElementDo(172))
        )
        (super:dispose())
    )


    (method (handleEvent pEvent)
        (var gInvSaidMe)
        return 
            (if ((send pEvent:claimed()))
                return 1
            )(else
                (if (== (send pEvent:type()) 128)
                    (if (Said('look>'))
                        (if (Said('/dwarf'))
                            Print(600 0)
                        )(else
                            (if (Said('/mine[<diamond]'))
                                Print(600 1)
                            )(else
                                (if (Said('/boulder[<gray]'))
                                    Print(600 2)
                                )(else
                                    (if (Said('[<down]/dirt[<mine]'))
                                        Print(600 3)
                                    )(else
                                        (if (Said('/passageway[<mine]'))
                                            Print(600 4)
                                        )(else
                                            (if (Said('/path'))
                                                Print(600 5)
                                            )(else
                                                (if (Said('/wall'))
                                                    Print(600 6)
                                                )(else
                                                    (if (Said('/bucket'))
                                                        Print(600 7)
                                                    )(else
                                                        (if (Said('/diamond'))
                                                            Print(600 8)
                                                        )
                                                    )
                                                )
                                            )
                                        )
                                    )
                                )
                            )
                        )
                    )(else
                        (if (Said('get>'))
                            (if (Said('/boulder'))
                                Print(600 9)
                            )(else
                                (if (Said('/diamond'))
                                    Print(600 10)
                                )(else
                                    (if (Said('/dwarf'))
                                        Print(600 11)
                                    )
                                )
                            )
                        )(else
                            (if (Said('rob/diamond'))
                                Print(600 12)
                            )(else
                                (if (Said('climb/boulder'))
                                    Print(600 13)
                                )(else
                                    (if (Said('converse/dwarf') or Said('converse[/!*]'))
                                        Print(600 14)
                                    )(else
                                        (if (Said('kill/dwarf'))
                                            Print(600 15)
                                        )(else
                                            (if (Said('kiss/dwarf') or Said('kiss[/!*]'))
                                                Print(600 16)
                                            )(else
                                                (if (Said('hit/dwarf'))
                                                    Print(600 17)
                                                )(else
                                                    (if (Said('help/dwarf'))
                                                        Print(600 18)
                                                    )(else
                                                        (if (Said('deliver,return>') and (= gInvSaidMe (send gInv:saidMe())))
                                                            (if ((send gEgo:has((send gInv:indexOf((= gInvSaidMe (send gInv:saidMe())))))))
                                                                Print(600 19)
                                                            )(else
                                                                proc0_19()
                                                            )
                                                        )
                                                    )
                                                )
                                            )
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
            )
    )


    (method (newRoom param1)
        (if (== param1 28)
            (dwarfMusic:keep(0))
        )
        (super:newRoom(param1))
    )

)
(instance dwarfMusic of Sound
    (properties
        number 30
        loop -1
        keep 1
    )
)
