Keyword Interface
version 8 by Aaron Reed
Chapter - Changing Style
Setting the keyword emphasis is an action out of world applying to nothing. Understand "keyword" or "keywords" as setting the keyword emphasis.
tempstyles is a list of keyword emphases that varies.
Carry out setting the keyword emphasis (this is the Keyword Interface carry out setting keyword emphasis rule):
run the keywords routine.
To run the keywords routine:
let mychar be 1;
[Keep track of which menu number is assigned to each of the four possible options.]
let object-number be 0;
let direction-number be 0;
let topic-number be 0;
let parser-number be 0;
while mychar is not 0:
clear the screen;
let menu-counter be 0;
show KI message for keyword-setting-instructions;
say line break;
if object keyword highlighting is true:
increase menu-counter by 1;
say "[menu-counter]) ";
now object-number is menu-counter;
show KI message for keyword-instructions-object;
if direction keyword highlighting is true:
increase menu-counter by 1;
say "[menu-counter]) ";
now direction-number is menu-counter;
show KI message for keyword-instructions-direction;
if topic keyword highlighting is true:
increase menu-counter by 1;
say "[menu-counter]) ";
now topic-number is menu-counter;
show KI message for keyword-instructions-topic;
if parser highlighting is true:
say line break;
increase menu-counter by 1;
say "[menu-counter]) ";
now parser-number is menu-counter;
show KI message for keyword-instructions-parser;
[Print a warning if emphasis is disabled in a game where keywords are required; note that the player is still allowed to disable emphasis, if they choose.]
if keywords required is true:
if ( object keyword highlighting is true and style of object-word is keyword-no-style ) or ( direction keyword highlighting is true and style of direction-word is keyword-no-style ) or ( topic keyword highlighting is true and style of topic-word is keyword-no-style ) :
say line break;
show KI message for keyword-instructions-disabled;
[Print a warning if any two active keyword styles are the same.]
truncate tempstyles to 0 entries;
let duplicated-style be false;
if object keyword highlighting is true:
add style of object-word to tempstyles;
if direction keyword highlighting is true:
if style of direction-word is listed in tempstyles:
now duplicated-style is true;
else:
add style of direction-word to tempstyles;
if topic keyword highlighting is true:
if style of topic-word is listed in tempstyles:
now duplicated-style is true;
if duplicated-style is true:
say line break;
show KI message for keyword-instructions-distinct;
[Show instruction message and get the player's single-character input.]
say line break;
show KI message for keyword-instructions-end;
now mychar is single-character - 48; [Converts ASCII to actual number typed.]
[Process the player's input.]
if mychar is object-number:
advance style with object-word;
otherwise if mychar is direction-number:
advance style with direction-word;
otherwise if mychar is topic-number:
advance style with topic-word;
otherwise if mychar is parser-number:
advance style with parser-word;
otherwise if mychar is 9:
clear the screen;
try setting screen reader mode;
say "Press any key to continue.";
wait for any key;
now mychar is 0;
[Upon quitting, clear the screen and look.]
clear the screen;
if pre-game keyword setting is true:
now pre-game keyword setting is false;
do nothing;
otherwise:
try looking.
To advance style with (kwtype - a keyword type):
now the style of kwtype is the keyword emphasis after the style of kwtype.
To decide which number is single-character: (- (VM_KeyChar()) -).