;;; Sierra Script 1.0 - (do not remove this comment)
(script# 110)
(include sci.sh)
(include Verbs.sh)
(include game.sh)
(include 110.shm)
(include 110.shp)
(use Main)
(use DisposeLoad)
(use Sound)
(use Cycle)
(use Game)
(use Actor)
(use System)
(use Print)
(use Polygon)
(use Controls)

(public
	rm110 0
)

(local storedY)

(instance ySetter of View
	(properties
		x 50
		y 50
		view 200
		loop 0
		cel 0
	)

	(method (doVerb theVerb &tmp foo)
		(if (== theVerb V_TALK)
			(= foo (GetNumber "Input Y" storedY))
			(if (>= foo 0)
				(= storedY foo)
				(gEgo setScale: storedY)
			)
			(return)
		)
		(if (== theVerb V_LOOK)
			(Printf "This allows you to change the scaler Y. Use the talk icon.")
			(return)
		)
		(super doVerb: theVerb)
	)
)

(instance vanYSetter of View
	(properties
		x 200
		y 50
		view 200
		loop 0
		cel 1
	)

	(method (doVerb theVerb)
		(if (== theVerb V_TALK)
			(rm110 vanishingX: (GetNumber "Input room's vanishing X" (rm110 vanishingX?)))
			(rm110 vanishingY: (GetNumber "Input room's vanishing Y" (rm110 vanishingY?)))
			(return)
		)
		(if (== theVerb V_LOOK)
			(Printf "This allows you to change the room's vabishing point. Use the talk icon.")
			(return)
		)
		(super doVerb: theVerb)
	)
)

; Should really be instance of Actions (in CueObj.sc) but that's not working for me just now
(class egoActions of Code
	(method (doVerb theVerb)
		(if (== theVerb V_LOOK)
			(Printf "My exact coordinates are %d, %d" (gEgo x?) (gEgo y?))
			(return 1)
		)
		(return 0)
	)
)

(instance rm110 of Room
	(properties
		picture 110
		style (| dpANIMATION_BLACKOUT dpOPEN_FADEPALETTE)
		horizon 0
		vanishingX 130
		vanishingY 50
		noun N_ROOM
	)
	
	(method (init)
		(AddPolygonsToRoom @P_Default110)
		(super init:)
		(switch gPreviousRoomNumber
			; Add room numbers here to set up the ego when coming from different directions.
			(else 
				(SetUpEgo -1 1)
				(gEgo posn: 150 130)
			)
		)
		(gEgo init:, ignoreHorizon:, actions: egoActions)
		(ySetter init:, ignoreActors:)
		(vanYSetter init:, ignoreActors:)
		; We just came from the title screen, so we need to call this to give control
		; to the player.
		(gGame handsOn:)
	)
)
