;;; Sierra Script 1.0 - (do not remove this comment)
(script# 509)
(include sci.sh)
(use Main)
(use Class_255_0)
(use Cycle)
(use Game)
(use InvI)
(use Feature)
(use Obj)

(public
	sForReg 0
)
(synonyms
	(branch arm branch)
)

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

(instance chop of Script
	(properties)
	
	(method (changeState newState)
		(switch (= state newState)
			(1
				(proc0_8)
				(gEgo view: 86 setCycle: Fwd)
				((ScriptID 0 4) setReal: self 4)
			)
			(2
				(gEgo view: 2 setCycle: Walk)
				(Print 509 19)
				(proc0_9)
				(switch gCurRoomNum
					(11
						((= newBlk (Blk new:))
							left: 212
							top: 103
							right: 224
							bottom: 106
						)
						(gEgo observeBlocks: newBlk)
					)
					(12
						(= newBlk (Blk new:))
						(= newBlk_2 (Blk new:))
						(newBlk left: 197 top: 112 right: 230 bottom: 117)
						(newBlk_2 left: 170 top: 108 right: 185 bottom: 110)
						(gEgo observeBlocks: newBlk newBlk_2)
					)
				)
			)
		)
	)
)
