/******************************************************************************/
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script 45)
/******************************************************************************/
(use "controls")
(use "cycle")
(use "door")
(use "feature")
(use "game")
(use "inv")
(use "main")
(use "obj")
(local
red
)
/******************************************************************************/
(instance public rm045 of Rm
	(properties
		picture scriptNumber
		north 0
		east 0
		south 46
		west 37
	)
	(method (init)
		(super:init())
		(self:setScript(RoomScript))

		(switch(gPreviousRoomNumber)
			(case 37
				(send gEgo:
					posn(4 107)
					loop(0)
				)
			)
           	(case 46
				(send gEgo:
					posn(182 185)
					loop(3)
				)
			)
		)
  (aGuard1: init())
		SetUpEgo()
		(send gEgo:init())
	)
)
/******************************************************************************/
(instance RoomScript of Script
	(properties)
    (method (handleEvent pEvent)
(super:handleEvent(pEvent))
(if(Said('kill,fight,attack/guard'))
Print("Play Doom 3 instead. It's out you know.")
Print("Actually, finish this game before, and then do.")
)
(if(Said('climb/wall'))
Print("You climb? With your weak muscles?")
Print("Haaa haaa haaa hah haaa!!" #title "Eigen Lenk:" #icon 777 0 5)
Print("Dude, you're funny!" #title "Eigen Lenk:" #icon 777 0 5)
)
(if(Said('look>'))
(if(Said('/sky'))
Print("You look up in the sky, and about a second later, you don't. Because there's nothing.")
)
(if(Said('/wall'))
Print("Pretty high one. Forget about climbing it.")
)
(if(Said('/house'))
Print("Yet another private house.")
)
(if(Said('/guard'))
Print("He's watching the entrance, to make sure strangers could not enter.")
)
(if(Said('/sand'))
Print("Boooooooring......")
)
(if(Said('/'))
Print("There's quite a high wall here. A guard is watching the entrance.")
        )
        )
  (if(Said('talk/man,guard'))
   (if(< (send gEgo:distanceTo(aGuard1)) 25)
 (if(guardT)
 Print("I already told you: No entering this town for you!" #title"Guard:" #icon 777 0 9)
 return
 )
 Print("May I enter the town?" #title"Dr.Jummybummy:" #icon 777 0 0)
 Print("No you may not! I scanned you through our citizen database and you're not on the list. Get lost!" #title"Guard:" #icon 777 0 9)
 Wait(60)
 Print("(Guess no entering here, if only I could find another way in...)" #title"Dr.Jummybummy:" #icon 777 0 0)
 += gScore 2
 = guardT TRUE
 return
  )
  Print("You have to move closer to the guard.")
  )
  
  )
 (method(doit)
 (if(==(send gEgo: onControl()) ctlBLACK)
 = red FALSE
 )
 (if(==(send gEgo: onControl()) ctlRED)
 (if(not(red))
 = red TRUE
 (if(guardT)
 Print("I already told you: No entering this town for you!" #title"Guard:" #icon 777 0 9)
  (send gEgo: setMotion(MoveTo 215 130))
 return
 )
 Print("HALT! Where do you think you're going?" #title"Guard:" #icon 777 0 9)
 Print("Town..." #title"Dr.Jummybummy:" #icon 777 0 0)
 Print("No you're not. I scanned you trough our citizen database and you're not on the list. Get lost!" #title"Guard:" #icon 777 0 9)
 Wait(60)
 Print("(Guess no entering here, if I only could find an other way in...)" #title"Dr.Jummybummy:" #icon 777 0 0)
 += gScore 2
 = guardT TRUE
 (send gEgo: setMotion(MoveTo 215 130))
 return
 )
 )
 )
)
(instance aGuard1 of Act
(properties
view 58
x 266
y 134
))
/******************************************************************************/
