(include "sci.sh")
(use "Main")
(use "Class_255_0")
(use "Cycle")
(use "Game")
(use "InvI")
(use "PV")
(use "Obj")
(script 509)


(local
    newBlk
    newBlk_2

)
(instance public sForReg of Rgn
    (properties)

    (method (handleEvent pEvent)
        (var gInvSaidMe)
        (if ((send pEvent:claimed()))
            return 1
        )
        return 
            (if (== (send pEvent:type()) 128)
                (if (Said('look>'))
                    (if (Said('/boulder'))
                        Print(509 0)
                    )(else
                        (if (Said('/dirt'))
                            Print(509 1)
                        )(else
                            (if (Said('/bush'))
                                Print(509 2)
                            )(else
                                (if (Said('/sky') or Said('<up'))
                                    (if (not global100)
                                        Print(509 3)
                                    )(else
                                        Print(509 4)
                                    )
                                )(else
                                    (if (Said('/grass'))
                                        Print(509 5)
                                    )(else
                                        (if (Said('/flora'))
                                            Print(509 6)
                                        )(else
                                            (if (Said('/blossom'))
                                                Print(509 7)
                                            )(else
                                                (if (Said('/forest'))
                                                    Print(509 8)
                                                )(else
                                                    (if (Said('/eye'))
                                                        Print(509 9)
                                                    )(else
                                                        (send pEvent:claimed(0))
                                                    )
                                                )
                                            )
                                        )
                                    )
                                )
                            )
                        )
                    )
                )(else
                    (if (Said('get/blossom'))
                        Print(509 10)
                    )(else
                        (if (Said('climb/boulder'))
                            Print(509 11)
                        )(else
                            (if (Said('climb/forest'))
                                Print(509 12)
                            )(else
                                (if (Said('kill/forest'))
                                    Print(509 13)
                                )(else
                                    (if (Said('break,hit,chop/branch,branch,branch,forest') or Said('swing,use,wave/ax'))
                                        (if (global112)
                                            Print(509 14)
                                        )(else
                                            (if (not global112 and not (send ((Inv:at(16))):ownedBy(gEgo)))
                                                Print(509 15)
                                            )(else
                                                (if ((send gEgo:has(16)))
                                                    (send gGame:changeScore(4))
                                                    (send gSounds:eachElementDo(172))
                                                    = global112 1
                                                    (send gEgo:setScript(chop))
                                                    (chop:changeState(1))
                                                )
                                            )
                                        )
                                    )(else
                                        (if (Said('conceal/forest'))
                                            Print(509 16)
                                        )(else
                                            (if (Said('converse'))
                                                Print(509 17)
                                            )(else
                                                (if (Said('deliver>'))
                                                    (if ((= gInvSaidMe (send gInv:saidMe())) and (send gEgo:has((send gInv:indexOf((= gInvSaidMe (send gInv:saidMe())))))))
                                                        Print(509 18)
                                                    )(else
                                                        (send pEvent:claimed(0))
                                                    )
                                                )
                                            )
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
            )(else
                0
            )
    )

)
(instance chop of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 1
                (proc0_10() (send gEgo:
                    view(86)
                    setCycle(Fwd)
                )
 (send (ScriptID(0 4)):setReal(self 4))  )
            )
            (case 2
                ((send gEgo:
                    view(2)
                    setCycle(Walk)
                )
 Print(509 19) proc0_11() 
                (switch (gGNewPropX)
                    (case 11
                        ((send (= newBlk (Blk:new())):
                            left(212)
                            top(103)
                            right(224)
                            bottom(106)
                        )
 (send gEgo:observeBlocks(newBlk))  )
                    )
                    (case 12
                        (= newBlk (Blk:new()) = newBlk_2 (Blk:new()) (send newBlk:
                            left(197)
                            top(112)
                            right(230)
                            bottom(117)
                        )
 (send newBlk_2:
                            left(170)
                            top(108)
                            right(185)
                            bottom(110)
                        )
 (send gEgo:observeBlocks(newBlk newBlk_2)) )
                    )
                )
 )
            )
        )
    )

)
