/******************************************************************************/
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script 27)
/******************************************************************************/
(use "controls")
(use "cycle")
(use "door")
(use "feature")
(use "game")
(use "inv")
(use "main")
(use "obj")
(local
die
prev
dying
butt
)
/******************************************************************************/
(instance public rm027 of Rm
	(properties
		picture scriptNumber
		north 0
		east 0
		south 30
		west 28
	)
	(method (init)
		(super:init())
		(self:setScript(RoomScript))


        = prev 34  //34
		(switch(gPreviousRoomNumber)
			(case 30
				(send gEgo:
					posn(Xposn 168)
					loop(3)
				)
			)
   		(case 34
				(send gEgo:
					posn(157 98)
					loop(2)
				)
			)
   		(case 28
				(send gEgo:
					posn(4 Yposn)
					loop(0)
				)
			)



		)

		SetUpEgo()
		(send gEgo:init())
  (aPod: init())
(if(== gPreviousRoomNumber prev)
= randomMusic Random(531 533)
   (send gEgo:init())
            (send gTheMusic:
			prevSignal(0)
			stop()
			number(606) //531,532,533
			loop(-1)
			play()
		)
(send gEgo:hide())
)
	)
)
/******************************************************************************/
(instance RoomScript of Script
	(properties)
 (method (handleEvent pEvent)
(super:handleEvent(pEvent))
(if(Said('take>'))
(if(Said('/rope'))
(if(==(send gEgo: onControl()) ctlNAVY)
(if(hasRope)
Print("You already took it.")
return
)
Print("Ok")
+= gScore 2
= hasRope TRUE
(send gEgo: get(INV_ROPE))
return
)
Print("Move closer to the entrance of the pod.")
)
(if(Said('/water,bottle'))
(if(==(send gEgo: onControl()) ctlNAVY)
(if(hasWater)
Print("You already took it.")
return
)
Print("Ok")
+= gScore 2
= hasWater TRUE
(send gEgo: get(INV_WATER))
return
)
Print("Move closer to the entrance of the pod.")
)
)
(if(Said('look>'))
(if(Said('/sky'))
Print("The sky has a very strange colour. Also you can see some clouds in the sky.")
)
(if(Said('/cloud'))
Print("These \"clouds\" look more like some dust.")
)
(if(Said('/sand,ground'))
Print("This ground looks dangerous. Better be careful.")
)
(if(Said('/water,bottle'))
(if(send gEgo: has(INV_WATER))
Print("You have it in your inventory. Press TAB to see it.")
return
)
(if(==(send gEgo: onControl()) ctlNAVY)
Print("It's water bottle filled with water.")
return
)
Print("Do you really expect to see it from this distance.")
)
(if(Said('/rope'))
(if(send gEgo: has(INV_WATER))
Print("You have it in your inventory. Press TAB to see it.")
return
)
(if(==(send gEgo: onControl()) ctlNAVY)
Print("It looks like a long piece of rope.")
return
)
Print("Do you really expect to see it from this distance.")
)
(if(Said('/mountain'))
Print("Aaah...what a great panoramic view.")
)
(if(Said('/view,panorama'))
Print("The view looks nice. You wish you had a view like that from your home window.")
)
(if(Said('/entrance,door,doorway'))
(if(==(send gEgo: onControl()) ctlNAVY)
Print("You can see inside the pod from here.")
return
)
Print("You can't see it from here. It's on the other side of the pod.")
return
)
(if(Said('/rocket,pod,vessel,vehicle'))
(if(==(send gEgo: onControl()) ctlNAVY)
(if(send gEgo: has(INV_ROPE))
(if(send gEgo: has(INV_WATER))
Print("You look inside the escape pod and don't see anything interesting in there.")
return
)
(if(send gEgo: has(INV_ROPE))
Print("You look inside the escape pod and see a bottle of water in there.")
return
)
Print("You look inside the escape pod and see a bottle of water and a rope in there.")
return
)
(if(send gEgo: has(INV_WATER))
Print("You look inside the escape pod and see a rope in there.")
return
)
Print("You look inside the escape pod and see a bottle of water and a rope in there.")
return
)
Print("This is the rocet you came down with. Maybe you should take a look inside since there may be something useful there. Move to entrance of the pod.")
)
(if(Said('/[ /* , !* ]'))
Print("You're on some other planet. Presumably it's the Moon Base planet. There's your escape pod you crashed with.")
)
)
)

        (method (changeState newState)
         (var dyingScript)
  = state newState
  (switch (state)
    (case 0
= cycles 1


    )
    (case 1
    (send gGame:setSpeed(3))
        (send gEgo: hide())
       = dyingScript ScriptID(DYING_SCRIPT)
  (send dyingScript:
    caller(3)
    register("You just sank into the sand. Be more careful!")
  )
  (send gGame:setScript(dyingScript))

   )
   )
   )
 (method(doit)
 (if(== gPreviousRoomNumber prev)
 = gPreviousRoomNumber 0
 (send gEgo: put(INV_COURSE_KEY))
 (send gEgo: put(INV_CARD))
 (send gEgo: put(INV_PAPER))
 (send gEgo: put(INV_SIGNAL_DEVICE))
 (send gEgo: put(INV_VESSEL_KEY))
 (send gEgo: put(INV_MAP))
 (send gEgo: put(INV_HAIRPIN))
 Wait(80)
 Print("... after you regain consciousness again, you step out of the pod ... Hey! What is this place. Is it the Moon Base...?")
 (send gEgo: show()posn(148 98))
  = butt Print("Now it's a good time to save your game. Wish to do so?" #title "Well ... ?" #button "Oki doki" 0 #button "Nah!" 1)
 (if(== butt 0)
(send gGame:save())
 return
 )



 )
 (if(==(send gEgo: onControl()) ctlYELLOW)
 (if(not(dying))
 = dying TRUE
 ProgramControl()
 (send gEgo: view(701) cycleSpeed(2) setCycle(End RoomScript))
 )
 )
 )
)
(instance aPod of Act
(properties
view 705
x 178
y 110
))
/******************************************************************************/
