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

		(switch(gPreviousRoomNumber)

			(case 98
				(send gEgo:
					posn(124 165)
					loop(3)
				)
			)
		)
        (aBart: init())
		SetUpEgo()
		(send gEgo:init())
  (SL: doit())
   (aMan1: posn(249 127) cel(1) init())
   (if(fireAlarm)
     (aChair: posn(249 127) init())
    (aBart: cel(1))
    (aMan1: dispose())
   )
     (if(lineIs and (if(not(fireAlarm))))
  (aMan1: posn(78 112) cel(2))
  )
	)
)
/******************************************************************************/
(instance RoomScript2 of Script
	(properties)
 (method(changeState newState)
 = state newState
 (switch(state)
 (case 0
 (aMan1: dispose())
 )

)))
(instance RoomScript of Script
	(properties)
  (method (handleEvent pEvent)
(super:handleEvent(pEvent))
(if(Said('sit'))
Print("Sitting only makes one lazy.")
)
(if(Said('get,order'))
Print("I don't need anything at the moment.")
)
(if(Said('use/tap'))
Print("At some point it probably even worked.")
)
(if(Said('cut,pull/wire'))
(if(repaired)
Print("Why break the wire of a working slot machine that you just repaired?")
return
)
Print("That action is not needed to complete the game. So, don't touch it.")
)
(if(Said('give'))
Print("I'm not giving anything to that guy." #title"Dr.Jummybummy" #icon 777 0 0)
)
(if(Said('push,fight/man,customer'))
Print("Don't you know that violence does not solve anything?")
)
(if(Said('look>'))
(if(Said('/panel'))
Print("You can't see anything trough it.")
)
(if(Said('/shelf'))
Print("You can only see some empty bottles on the shelf.")
)
(if(Said('/counter'))
Print("It's a sleazy counter. What else do you expect from such place?")
)
(if(Said('/button,alarm,(alarm<button),(fire<alarm),(fire<alarm<button)'))
Print("On a closer look, you discover that it's a fire alarm button.")
)
(if(Said('/floor'))
Print("A cable is running from the slot machine to the counter. This wire is not important.")
)
(if(Said('/door'))
Print("One door is leading the back outside. The other door, behind the counter, must be leading to the kitchen area.")
)

(if(Said('/vent,hole,shaft,(vent,hole<shaft,entrance)') or (if(Said('/vent,hole'))))
Print("This must go all the way out, trough the kitchen.")
)
(if(Said('/picture'))
Print("It ain't exactly Picasso but does the work.")
)
(if(Said('/wire,cable,tap'))
Print("Not interesting. Try something else!")
)
(if(Said('/stool,chair'))
Print("It's the only stool in this bar. Funny...")
)
(if(Said('/wall'))
Print("You can see a shelf with a few empty botlles. Also, there is a button on the wall near the back of the counter. Up in the right corner, you see a air ventilation tunnel.")
)
(if(Said('/man,customer'))
(if(fireAlarm)
Print("He ran out.")
return
)
(if(lineIs and (if(not(fireAlarm))))
Print("He's playing slots.")
return
)
Print("He's just sitting there, on his bar-stool.")
)
(if(Said('/bartender'))
 (if(fireAlarm)
 Print("He's wearing a gas-mask. Probably because of the \"fire\" you set up outside.")
 return
 )
Print("He's just standing there, looking bored as hell. Go and talk to him.")
)
(if(Said('/slots,slot,game,machine,(slots,slot<machine)'))
Print("Maybe you should give it a few spins.")
)
(if(Said('/'))
Print("You're inside the bar. The bartender is behind the counter. A louzy slot machine is in the corner.")
Print("You can also see some guy sitting at the counter.")
        )
        )
   (if(Said('press/button,alarm,(alarm<button),(fire<alarm),(fire<alarm<button)'))
 Print("You can't reach the button from here.")
 Print("And besides, I don't think that the bartender will let you push it.")
 )
(if(Said('fix,use>'))
(if(Said('/tools,hammer,slots,slot,game,machine,(slots,slot<machine)') or (if(Said('/slots,slot,game,machine,(slots,slot<machine)/tools,hammer'))))
 (if(==(send gEgo: onControl()) ctlYELLOW)
(if(send gEgo: has(INV_TOOLS))
(if(repaired)
Print("You already repaired it.")
return
)
(if(not(bartender))
Print("Why should you do that?")
return
)
Print("Ok")
+= gScore 3
Wait(80)
Print("Done!")
= repaired TRUE
Print("Here, take these 10 dakos I promised."#title"Bartender:" #icon 777 0 11)
Print("Thanks!"#title"Dr.Jummybummy" #icon 777 0 0)
(send gEgo: get(INV_MONEY))
return
)
Print("You need some tools for that.")
return
)
Print("You're too far away from the slots machine.")
return
)
(if(Said('/'))
Print("Repair what?")
)
)
(if(Said('play,use/slots,slot,game,machine,(slots,slot<machine)') or if(Said('play')))
(if(slotsMaxedOut2)
Print("You have broken the house limit with this machine. You can't play anymore.")
return
)
 (if(==(send gEgo: onControl()) ctlYELLOW)
(if(not(repaired))
Print("You can't. The machine is broken.")
return
)
(if(lineIs)
(if(not(fireAlarm))
Print("Can't you see that there are other people who want to play too?")
Print("Try to get rid of the guy.")
return
)
Print("Ok")
 (send gRoom: newRoom(95))
return
)
 (if(talkedBum)
= bummm TRUE
Print("Before that, go and talk to the bum again. Maybe he has changed his mind.")
return
 )
Print("Not just yet. And besides, what would you do with the local money. You don't need it anywhere, yet.")
return
)
Print("You're too far away from the slots machine.")
return
)
(if(Said('talk/man'))
(if(lineIs and (if(not(fireAlarm))))
(if(< (send gEgo:distanceTo(aMan1)) 32)
Print("Can I play too?" #icon 777 0 0 #title "Dr.Jummybummy")
Print("How about, no." #icon 778 0 7 #title "Guy:")
Print("Darn!" #icon 777 0 0 #title "Dr.Jummybummy")
return
)
)
(if(==(send gEgo: onControl()) ctlRED)
(if(fireAlarm)
Print("Who are you trying to talk to? The bartender?")
return
)
Print("Hello! I'm Dr.Jummybummy." #icon 777 0 0 #title "Dr.Jummybummy")
Print("Well, good for you then." #icon 778 0 7 #title "Guy:")
return
)
Print("Move closer to the guy.")
)
(if(Said('talk/bartender'))
(if(==(send gEgo: onControl()) ctlRED)
(if(slotsMaxedOut2)
Print("Congratulations on breaking the house limit in the slots."#title"Bartender:" #icon 777 0 11)
return
)
Print("You don't have anything else to say at the moment.")
return
)
Print("You're too far away from the bartender.")
)
)
 (method(doit)
 (if(==(send gEgo: onControl()) ctlNAVY)
 (send gRoom: newRoom(98))
 )
 )
)
(instance aBart of Prop
(properties
view 119
x 191
y 87
cel 0
))
(instance aMan1 of Act
(properties
view 150
x 78
y 112
loop 3
cel 2
))
(instance aChair of Act
(properties
view 150
loop 3
cel 3
))
/******************************************************************************/
