#!../bin/jacl

constant game_title		"Parser Lab"
constant game_author	"Stuart Allen"
constant game_version	1

{+intro
write "^^" game_title " by " game_author "^^"
print:
   This program is simply an object-rich environment for testing the JACL 
   parser.^^
.
if here hasnt OUTDOORS
   move north_wall to here
   move south_wall to here
   move east_wall to here
   move west_wall to here
endall
move ground to here
look
}

location lab : parser lab

{look
write "Gloss white walls match the floor and ceiling, a uniform glow emits "
write "from them all. In the centre of the room two long benches run "
write "north-south parallel to each other. A clock hangs high on the wall.^"
execute "+spaced_contents<west_bench"
execute "+spaced_contents<east_bench"
}

object east_bench : long east eastern bench
 plural			benches
 short			the "east bench"
 has			SURFACE
 capacity		50

object west_bench : long west western bench
 plural			benches
 short			the "west bench"
 has			SURFACE
 capacity		50

object ball : ball
 plural			balls
 short			a "ball"
 long			"There is a ball on the floor.^"
 mass			10
 parent			west_bench
 x				100
 y				100
 bearing		25
 velocity		8

object red_ball : red ball
 plural			balls
 short			a "red ball"
 long			"There is a red ball on the floor.^"
 mass			10
 parent			west_bench
 x				2000
 y				2500

{disambiguate
if arg = 0
   ifstring command = "read"
      return -1
   endif
   ifstring command = "eat"
      return -1
   endif
endif
return false
}

object big_red_ball : big red ball
 plural			balls
 short			a "big red ball"
 long			"There is a big red ball on the floor.^"
 mass			10
 parent			east_bench

object small_red_ball : small red ball
 plural			balls
 short			a "small red ball"
 long			"There is a small red ball on the floor.^"
 mass			10
 parent			east_bench

object book : red book 
 short			a "red book"
 long			"There is a red book here.^"
 mass			5
 parent			east_bench

{disambiguate
if arg = 0
   ifstring command = "read"
      return true
   endif
   ifstringall command[0] = "look" : command[1] = "in"
      return true
   endif
   ifstring command = "eat"
      return -1
   endif
endif
return false
}

object can : red can
 short			a "can of red bull"
 long			"A can of Red Bull stands on the ground.^"
 mass			3
 parent			west_bench

{disambiguate
if arg = 0
   ifstring command = "read"
      return -1
   endif
   ifstring command = "drink"
      return true
   endif
   ifstring command = "eat"
      return -1
   endif
endif
return false
}

object silver_ring : shiny silver ring
 plural			rings
 short			a "silver ring"
 long			"A shiny silver ring rests nearby.^"
 mass			2
 parent			west_bench

{disambiguate
write "VERB: " command[0] ".^"
ifstring verb_function = "take"
   return true
else
   return false
endif
}

object gold_ring : shiny gold ring
 plural			rings
 short			a "gold ring"
 long			"A shiny gold ring is on the ground.^"
 mass			2
 parent			east_bench
	
object pin : bobby pin
 short			a "bobby pin"
 long			"You notice a bobby pin on the floor.^"
 mass			1
 parent			lab

object mug : coffee mug
 has			CONTAINER
 short			a "coffee mug"
 long			"A coffee mug rests on the floor.^"
 mass			10
 capacity		4
 parent			lab

object clock : clock
 has			OUT_OF_REACH
 short			the "clock"
 
object kryten: myself self me
 has		ANIMATE
 short		name "yourself"
 capacity	100
 parent		lab
 player

{examine
write "As beautiful as ever.^"
execute "+inventory"
}

{take
write "...seriously?"
set time = false
}

object coat : white lab coat
 short		your "white lab coat"
 long		"Your lab coat lies on the ground."
 has		WEARABLE WORN
 parent		kryten
 mass		10

object glasses : safety glasses goggles
 short		your "safety glasses"
 long		"Your safety glasses are nearby.^"
 has		WEARABLE WORN
 parent		kryten
 mass		5

{+no_light
write "It is too dark to see.^"
set time = false
}

{+title
if player has SITTING
   write "(sitting)^"
endif
}

object north_wall: north north wall
 has			NO_TAB
 plural			walls
 short          the "north wall"

object south_wall: south southern wall
 has			NO_TAB
 plural			walls
 short          the "south wall"

object east_wall: east eastern wall
 has			NO_TAB
 plural			walls
 short          the "east wall"

object west_wall: west western wall
 has			NO_TAB
 plural			walls
 short          the "west wall"

object ground: ground floor
 has            SURFACE NO_TAB
 short          the "ground"

{+before
write "COMMAND: "
set INDEX = 0
repeat
   write "~" command[INDEX] "~ "
   set INDEX + 1
until INDEX = @command
return false
}

#include "verbs.library"
