(include "sci.sh")
(use "Main")
(use "Class_255_0")
(use "Game")
(use "InvI")
(use "PV")
(script 14)


(local
    local0

)
(instance public Room14 of Rm
    (properties
        picture 14
    )

    (method (init)
        = north 8
        = south 20
        = east 15
        = west 13
        = horizon 68
        = global101 0
        Load(rsVIEW 174)
        (if (<= (send gEgo:y()) horizon)
            (send gEgo:posn((send gEgo:x()) (- horizon 2)))
        )
        (if ((== gPicture 20) and (> (send gEgo:x()) 209))
            (send gEgo:x(209))
        )
        (if (global100)
            = picture 114
        )
        (super:init())
        = local0 (+ (* (- global160 global213) 60) (- global159 global214))
        (if ((send ((Inv:at(9))):ownedBy(203)) and (>= local0 3))
            = global118 (/ (= global118 Random(1 300)) 100)
        )
        (if (== global118 2)
            (send (= gNewAct (Act:new())):
                posn(168 130)
                view(174)
                loop(2)
                setCel(0)
                illegalBits(0)
                init()
            )
        )
        (self:setRegions(506 516))
        (send gEgo:
            view(2)
            init()
        )
        (if (== gPicture 0)
            (send gEgo:posn(150 188))
        )
    )


    (method (handleEvent pEvent)
        (if ((send pEvent:claimed()))
            return 1
        )
        return 
            (if (== (send pEvent:type()) 128)
                (if (((Said('look/around') or Said('look/room')) or Said('look[<around][/!*]')) or Said('smell/blossom'))
                    Print(14 0)
                )(else
                    (if (Said('look/stump'))
                        Print(14 1)
                    )
                )
            )(else
                0
            )
    )


    (method (newRoom param1)
        (if ((send gCast:contains(gNewAct)))
            = global213 global160
            = global214 global159
        )
        (super:newRoom(param1))
    )

)
