! testing normal scoring
!
#Iftrue (#version_number == 8);
Constant USEINFORM;
#Endif;

Constant Story      "Parser test";
Constant Headline   "^A parser test suite for PunyInform.^";
Serial "200827";
Constant INITIAL_LOCATION_VALUE = LitRoom;

! Uncomment to show time instead of score/turns
!Statusline time;

!Constant DEBUG;
!Constant DEBUG_PARSEANDPERFORM;
!Constant DEBUG_PARSEPATTERN;
!Constant DEBUG_PARSETOKEN;
!Constant DEBUG_PARSENOUNPHRASE;
!Constant DEBUG_GETNEXTNOUN;
!Constant DEBUG_SCOPE;

! Uncomment to add optional features to PunyLib
!Constant DEBUG;
!Constant CUSTOM_ABBREVIATIONS;
!Constant OPTIONAL_ALLOW_WRITTEN_NUMBERS;
Constant OPTIONAL_EXTENDED_METAVERBS;
!Constant OPTIONAL_EXTENDED_VERBSET;
Constant OPTIONAL_SCORED;
Constant OPTIONAL_FULL_SCORE;
!Constant OPTIONAL_FULL_DIRECTIONS;
!Constant OPTIONAL_GUESS_MISSING_NOUN;
!Constant OPTIONAL_MANUAL_SCOPE;
!Constant RUNTIME_ERRORS = 0;

!Constant OPTIONAL_SL_NO_SCORE;
!Constant OPTIONAL_SL_NO_MOVES;

#IfDef OPTIONAL_FULL_SCORE;
Constant MAX_SCORE = 7;
Constant OBJECT_SCORE = 1;
Array task_scores -> 3 0; ! inform doens't like array of length 1
Constant TASKS_PROVIDED;
Constant NUMBER_TASKS = 1;
#IfNot;
Constant MAX_SCORE = 3;
#EndIf;

[ PrintTaskName task_number;
  switch (task_number) {
      0: "opening the box";
  }
];


#Ifdef USEINFORM;
Include "Parser";
Include "VerbLib";
#IfNot;
Include "globals.h";
#EndIf;

#Ifndef USEINFORM;
Include "puny.h";
#EndIf;

! Uncomment to add PunyLib extensions
!Include "ext_menu.h";
!Include "ext_flags.h";
!Include "ext_quote_box.h";
!Include "ext_cheap_scenery.h";

#Ifdef USEINFORM;
Include "Grammar";
#Endif;

Object LitRoom "Lit Room"
	with
		description [;
			print "You are in a brightly lit room.^";
		],
	has light;

Object -> Box "box"
    with
        name 'box',
        after [;
        LetGo:
            --score;
            "Yay, got rid of ", (the) noun, "!";
        Open:
#IfDef OPTIONAL_FULL_SCORE;
            Achieved(0); ! opening the box is an achievement
#EndIf;
        Receive:
            ++score;
            ! win if you put two things in the box
            if(score >= MAX_SCORE) deadflag = 2;
        ],
    has openable static container;

Object -> Poison "poison"
    with
        name 'poison',
        before [;
        Eat:
            deadflag = true;
            "AAAargh!";
        ];

Object -> Point "one point"
    with
        name 'one' 'point'
    has scored;

Object -> Toy "toy"
    with
        name 'toy';

Object -> Torch "torch"
    with
        name 'torch';

[Initialise;
	print "^^The testsuite is open for business!^^";
#IfDef USEINFORM;
    location=INITIAL_LOCATION_VALUE;;
#EndIf;
];


