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

		(switch(gPreviousRoomNumber)
			(default
				(send gEgo:
					posn(169 180)
					loop(3)
				)
			)
		)
    (aMan1: init())
        (aMan2: init())
    SetUpEgo()
		(send gEgo:init())
	)
)
/******************************************************************************/
(instance Walking of Script
	(properties)
  (method (changeState newState)
  = state newState
  (switch (state)
    (case 0
    Print("Whaz did Dr.Jummybummy want?" #title "Prof. Grankenztein:")
    Print("He asked where to find Jonny." #title "Man 2:")
    Print("Good! Good! And if ze findz him, I'll be waizing! Muhaaa!! And then I'll eliminate Lord Bather!!!!" #title "Prof. Grankenztein:")
   (send gRoom: newRoom(126))
    )
    )
    )
 )
(instance RoomScript of Script
	(properties)
 (method (handleEvent pEvent)
(super:handleEvent(pEvent))
          (if(Said('look>'))
(if(Said('/tools'))
Print("They have no intrest to you.")
)
(if(Said('/counter'))
Print("There's noone behind the counter. That must mean that the profit isn't very big, that would allow to keep a cashier there all the time.")
)
(if(Said('/door'))
Print("This must lead into the backrooms. No intrest!")
)
(if(Said('/sign'))
Print("Two signs: SAWS and TOOLS")
)
(if(Said('/salesman'))
Print("They seem to be bored. Go and talk to them. At least then they won't be that ... bored.")
)
(if(Said('/shelf'))
Print("These shelves contain a few kind of tools. Starting from screwdrivers to electric-screwdrivers.")
)
(if(Said('/'))
Print("From the inside of the tool store, it doesn't look too fancy. Few shelves and two dying-in-boredom-face salesmen.")
        )
        )

(if(Said('talk/man,salesman'))
(if(< (send gEgo:distanceTo(aMan1)) 28)
(if(rebelsCalled)
(if(== salersNum 0)
= salersNum 1
= granz FALSE
Print("Hi! Could you tell me where I could find Jonny?" #title "Dr.Jummybummy:")
Print("I haven't seen him the whole day. Ask the other guy, maybe he knows." #title "Man 1:")
return
)
Print("Do you happen to know where Jonny is?" #title "Dr.Jummybummy:")
Print("No. I haven't seen him today." #title "Man 1:")
return
)
Print("Don't bother me!" #title "Man 1:")
return
)
(if(< (send gEgo:distanceTo(aMan2)) 28)
(if(rebelsCalled)
(if(== salersNum 0)
= salersNum 1
= granz FALSE
Print("Do you happen to know where Jonny is?" #title "Dr.Jummybummy:")
Print("No. I haven't seen him today. But ask the other guy, maybe he knows." #title "Man 2:")
return
)
Print("Do you happen to know where Jonny is?" #title "Dr.Jummybummy:")
Print("No. I haven't seen him today." #title "Man 2:")
return
)
Print("Excuse me, but I'm trying to work here." #title "Man 2:")
return
)
Print("You're not close enough.")
)
)
  (method(doit)
  (if(==(send gEgo: onControl()) ctlRED)
  (if(not(granz) and if(== salersNum 1))
  = granz TRUE
  = jonny FALSE
  (send gEgo: posn(1 1) hide())
   (send gTheSoundFX:
prevSignal(0)
stop()
number(19)
loop(1)
play())
  (aMan3: init() setCycle(Walk) setMotion(MoveTo 256 120 Walking))
  return
  )
  (send gRoom: newRoom(126))
  )
 )
)
(instance aMan1 of Act
(properties
view 158
x 123
y 78
))
(instance aMan2 of Act
(properties
view 158
x 264
y 88
cel 1
))
(instance aMan3 of Act
(properties
view 80
x 317
y 130
))
/******************************************************************************/
