home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Source Code 1994 March
/
Source_Code_CD-ROM_Walnut_Creek_March_1994.iso
/
compsrcs
/
games
/
vmsnet
/
monhl104
/
part12
< prev
next >
Wrap
Internet Message Format
|
1992-08-02
|
44KB
Path: uunet!mcsun!news.funet.fi!hydra!klaava!hurtta
From: Kari.Hurtta@Helsinki.FI (Kari E. Hurtta)
Newsgroups: vmsnet.sources.games
Subject: Monster Helsinki V 1.04 - part 12/32
Keywords: Monster, a multiplayer adventure game
Message-ID: <1992Jun14.014835.4289@klaava.Helsinki.FI>
Date: 14 Jun 92 01:48:35 GMT
Sender: hurtta@klaava.Helsinki.FI (Kari Hurtta)
Followup-To: vmsnet.sources.d
Organization: University of Helsinki
Lines: 1286
Archieve-name: monster_helsinki_104/part12
Author: Kari.Hurtta@Helsinki.FI
Product: Monster Helsinki V 1.04
Environment: VMS, Pascal
Part: 12/32
-+-+-+-+-+-+-+-+ START OF PART 12 -+-+-+-+-+-+-+-+
X BAD_PUNCH = 10; `123 punch for experience people `125
X`009`009`009`009`123 hurtta@finuh `125
X`009maxlevels = 50;`009`009`123 how many levels there are `125
X`009DEFAULT_LINE = 32000;`009`123 A virtual one liner record number that
X`009`009`009`009 really means "use the default one liner
X`009`009`009`009 description instead of reading one from
X`009`009`009`009 the file" `125
X
X
X`009START_LOCATION = 1;`009`123 new player start from Great Hall `125
X
X`123 Mnemonics for directions `125
X
X`009north = 1;
X`009south = 2;
X`009east = 3;
X`009west = 4;
X`009up = 5;
X`009down = 6;
X
X
X`123 Index record mnemonics `125
X
X`009I_BLOCK = 1;`009`123 True if description block is not used`009`009`125
X`009I_LINE = 2;`009`123 True if line slot is not used`009`009`009`125
X`009I_ROOM = 3;`009`123 True if room slot is not in use`009`009`125
X`009I_PLAYER = 4;`009`123 True if slot is not occupied by a player`009`125
X`009I_ASLEEP = 5;`009`123 True if player is not playing`009`009`009`125
X`009I_OBJECT = 6;`009`123 True if object record is not being used`009`125
X`009I_INT = 7;`009`123 True if int record is not being used`009`009`125
X `009I_HEADER = 8;`009`123 True if interpreter header record not being`009`1
V25
X`009`009`009`123 used (hurtta@finuh)`009`009`009`009`125
X`009`123I_GLOBAL = 9;`125`009`123 Values of global flags - default: true`009
V`125
X`009I_SPELL = 10;`009`123 True if spell not defined`009`009`009`125
X
X
X`123 Integer record mnemonics `125
X
X`009N_LOCATION = 1;`009`009`123 Player's location `125
X`009N_NUMROOMS = 2;`009`009`123 How many rooms they've made `125
X`009N_ALLOW = 3;`009`009`123 How many rooms they're allowed to make `125
X`009N_ACCEPT = 4;`009`009`123 Number of open accept exits they have `125
X`009N_EXPERIENCE = 5;`009`123 How "good" they are `125
X`009N_SELF = 6;`009`009`123 player's self descriptions `125
X`009N_PRIVILEGES = 7;`009`123 Players' privileges `125 `123leino@finuha`125
X N_HEALTH = 8;`009`009`123 Players' health `125 `123 hurtta@finuh `12
V5
X`009N_SPELL`009 = 9;`009`009`123 Spell's header number `125
X N_GLOBAL = 10;`009`009`123 Global flags and values (default: false)
V `125
X
X`123 Name record mnemonics `125
X
X`009T_NAM`009= 1;`009 `123 rooms' name `125
X`009T_OWN`009= 2;`009 `123 rooms' owner `125
X`009T_PERS`009= 3;`009 `123 players' personal name `125
X`009T_USER`009= 4;`009 `123 players' userid `125
X`009T_OBJNAM = 5;`009 `123 objects' name `125
X`009T_OBJOWN = 6;`009 `123 objects' owner `125
X`009T_DATE`009= 7;`009 `123 players' date of last play `125
X`009T_TIME`009= 8;`009 `123 players' time of last play `125
X`009T_PASSWD = 9;`009 `123 players' password `125
X`009T_REAL_USER = 10; `123 players' userid `125
X`009T_SPELL_NAME = 11; `123 spells' name `125
X
X`009T_MAX = 11;
X
X`123 object kind mnemonics `125
X
X`009O_BLAND = 0;`009`009`123 bland object, good for keys `125
X`009O_WEAPON = 1;
X`009O_ARMOR = 2;
X`009O_THRUSTER = 3;`009`009`123 use puts player through an exit `125
X`009O_DISGUISE = 4;`009`009`123 Don't show player name `125
X`009O_BOOK = 5;`009`009`123 learns new spell `125
X
X
X`009O_TRAP = 10;`009`009`123 use causes attack to player who tries to `125
X`009`009`009`009`123 get it (hurtta@finuh) `125
X
X`009O_BAG = 100;
X`009O_CRYSTAL = 101;
X`009O_WAND = 102;
X`009O_HAND = 103;
X`009O_TELEPORT_RING = 104;`009`123 causes random teleporting`009`125
X O_HEALTH_RING = 105;
X `032
X`009O_MAGIC_RING = 200;
X
X`123 object parms fiels `125
X`009`123 O_BOOK: `125
X`009OP_SPELL = 1;`009`009`123 spell number `125
X
X
X
X`123 player kind mnemonics `125
X
X`009P_PLAYER = 1;
X`009P_MONSTER = 2;
X
X`123 Command Mnemonics `125
X`009error = 0;
X`009setnam = 1;
X`009help = 2;
X`009quest = 3;
X`009quit = 4;
X`009look = 5;
X`009go = 6;
X`009form = 7;
X`009link = 8;
X`009unlink = 9;
X`009c_whisper = 10;
X`009poof = 11;
X`009desc = 12; `032
X c_dcl = 13;
X`009dbg = 14;
X`009say = 15;
X c_scan = 16;
X`009c_rooms = 17;
X`009c_system = 18;
X`009c_disown = 19;
X`009c_claim = 20;
X`009c_create = 21;
X`009c_public = 22;
X`009c_accept = 23;
X`009c_refuse = 24;
X`009c_zap = 25;
X`009c_hide = 26;
X`009c_l = 27;
X`009c_north = 28;
X`009c_south = 29;
X`009c_east = 30;
X`009c_west = 31;
X`009c_up = 32;
X`009c_down = 33;
X`009c_n = 34;
X`009c_s = 35;
X`009c_e = 36;
X`009c_w = 37;
X`009c_u = 38;
X`009c_d = 39;
X`009c_custom = 40;
X`009c_who = 41;
X`009c_players = 42;
X`009c_search = 43;
X`009c_unhide = 44;
X`009c_punch = 45;
X`009c_ping = 46;
X`009c_health = 47;
X`009c_get = 48;
X`009c_drop = 49;
X`009c_inv = 50;
X`009c_i = 51;
X`009c_self = 52;
X`009c_whois = 53;
X`009c_duplicate = 54;
X`009c_score = 55;
X`009c_version = 56;
X`009c_objects = 57;
X`009c_use = 58;
X`009c_wield = 59;
X`009c_brief = 60;
X`009c_wear = 61;
X`009c_relink = 62;
X`009c_unmake = 63;
X`009c_destroy = 64;
X`009c_show = 65;
X`009c_set = 66;
X`009c_monster = 67;
X`009c_erase = 68;
X`009c_atmosphere = 69;
X`009c_reset = 70;
X`009c_summon = 71;
X`009c_spells = 72;
X`009c_monsters = 73;
X`009`123 for alias `125
X`009A_list = 74;
X`009A_create = 75;
X`009A_delete = 76;
X`009`123 ---- `125
X
X`009e_detail = 100;`009`009`123 pseudo command for log_action of desc exit `
V125
X`009e_custroom = 101;`009`123 customizing this room `125
X`009e_program = 102;`009`123 customizing (programming) an object `125
X`009e_usecrystal = 103;`009`123 using a crystal ball `125
X`009e_custommonster = 104; `123 customizing monster `125
X`009e_customspell = 105; `123 customizing spell `125`032
X
X
X`123 Show Mnemonics `125
X `032
X`009s_exits = 1;
X`009s_object = 2;
X`009s_quest = 3;
X`009s_details = 4;
X`009s_monster = 5;
X`009s_priv = 6;
X`009s_time = 7;
X`009s_room = 8;
X`009s_paper = 9;
X`009s_levels = 10;
X`009s_quota = 11;
X`009s_spell = 12;
X
X`123 Set Mnemonics `125
X
X`009y_quest = 1;
X
X`123`009y_altmsg = 2;
X`009y_group1 = 3;
X`009y_group2 = 4;`009`125
X
X`009y_passwd = 2;
X`009y_peace`009= 3;
X`009y_war`009= 4;
X`009y_priv = 5;
X`009y_spell = 6;
X`009y_newplayer = 7;
X`009y_welcome =8;
X
X
X`123 Event Mnemonics `125
X
X`009E_EXIT = 1;`009`009`123 player left room`009`009`009`125
X`009E_ENTER = 2;`009`009`123 player entered room`009`009`009`125
X`009E_BEGIN = 3;`009`009`123 player joined game here`009`009`125
X`009E_QUIT = 4;`009`009`123 player here quit game`009`009`009`125
X`009
X`009E_SAY = 5;`009`009`123 someone said something`009`009`125
X`009E_SETNAM = 6;`009`009`123 player set his personal name`009`009`125
X`009E_POOFIN = 8;`009`009`123 someone poofed into this room`009`009`125
X`009E_POOFOUT = 9;`009`009`123 someone poofed out of this room`009`125
X`009E_DETACH = 10;`009`009`123 a link has been destroyed`009`009`125
X`009E_EDITDONE = 11;`009`123 someone is finished editing a desc`009`125
X`009E_NEWEXIT = 12;`009`009`123 someone made an exit here`009`009`125
X`009E_BOUNCEDIN = 13;`009`123 an object "bounced" into the room`009`125
X`009E_EXAMINE = 14;`009`009`123 someone is examining something`009`125
X`009E_CUSTDONE = 15;`009`123 someone is done customizing an exit`009`125
X`009E_FOUND = 16;`009`009`123 player found something`009`009`125
X`009E_SEARCH = 17;`009`009`123 player is searching room`009`009`125
X`009E_DONEDET = 18;`009`009`123 done adding details to a room`009`009`125
X`009E_HIDOBJ = 19;`009`009`123 someone hid an object here`009`009`125
X`009E_UNHIDE = 20;`009`009`123 voluntarily revealed themself`009`009`125
X`009E_FOUNDYOU = 21;`009`123 someone found someone else hiding`009`125
X`009E_PUNCH = 22;`009`009`123 someone has punched someone else`009`125
X`009E_MADEOBJ = 23;`009`009`123 someone made an object here`009`009`125
X`009E_GET = 24;`009`009`123 someone picked up an object`009`009`125
X`009E_DROP = 25;`009`009`123 someone dropped an object`009`009`125
X`009E_DROPALL = 26;`009`009`123 quit & dropped stuff on way out`009`125
X`009E_IHID = 27;`009`009`123 tell others that I have hidden (!)`009`125
X`009E_NOISES = 28;`009`009`123 strange noises from hidden people`009`125
X`009E_PING = 29;`009`009`123 send a ping to a potential zombie`009`125
X`009E_PONG = 30;`009`009`123 ping answered`009`009`009`009`125
X`009E_HIDEPUNCH = 31;`009`123 someone hidden is attacking`009`009`125
X`009E_SLIPPED = 32;`009`009`123 attack caused obj to drop unwillingly `125
X`009E_ROOMDONE = 33;`009`123 done customizing this room`009`009`125
X`009E_OBJDONE = 34;`009`009`123 done programming an object`009`009`125
X`009E_HPOOFOUT = 35;`009`123 someone hiding poofed`009out`009`009`125
X`009E_FAILGO = 36;`009`009`123 a player failed to go through an exit `125
X`009E_HPOOFIN = 37;`009`009`123 someone poofed into a room hidden`009`125
X`009E_TRYPUNCH = 38;`009`123 someone failed to punch someone else`009`125
X`009E_PINGONE = 39;`009`009`123 someone was pinged away . . .`009`009`125
X`009E_CLAIM = 40;`009`009`123 someone claimed this room`009`009`125
X`009E_DISOWN = 41;`009`009`123 owner of this room has disowned it`009`125
X`009E_WEAKER = 42;`009`009`123 person is weaker from battle`009`009`125
X`009E_OBJCLAIM = 43;`009`123 someone claimed an object`009`009`125
X`009E_OBJDISOWN = 44;`009`123 someone disowned an object`009`009`125
X`009E_SELFDONE = 45;`009`123 done editing self description`009`009`125
X`009E_WHISPER = 46;`009`009`123 someone whispers to someone else`009`125
X`009E_WIELD = 47;`009`009`123 player wields a weapon`009`009`125
X`009E_UNWIELD = 48;`009`009`123 player puts a weapon away`009`009`125
X`009E_DONECRYSTALUSE = 49;`009`123 done using the crystal ball`009`009`125
X`009E_WEAR = 50;`009`009`123 someone has put on something`009`009`125
X`009E_UNWEAR = 51;`009`009`123 someone has taken off something`009`125
X`009E_DESTROY = 52;`009`009`123 someone has destroyed an object`009`125
X`009E_HIDESAY = 53;`009`009`123 anonymous say`009`009`009`009`125
X`009E_OBJPUBLIC = 54;`009`123 someone made an object public`009`009`125
X`009E_SYSDONE = 55;`009`009`123 done with system maint. mode`009`009`125
X`009E_UNMAKE = 56;`009`009`123 remove typedef for object`009`009`125
X`009E_LOOKDETAIL = 57;`009`123 looking at a detail of this room`009`125
X`009E_ACCEPT = 58;`009`009`123 made an "accept" exit here`009`009`125
X`009E_REFUSE = 59;`009`009`123 got rid of an "accept" exit here`009`125
X`009E_DIED = 60;`009`009`123 someone died and evaporated`009`009`125
X`009E_LOOKYOU = 61;`009`009`123 someone is looking at you`009`009`125
X`009E_FAILGET = 62;`009`009`123 someone can't get something`009`009`125
X`009E_FAILUSE = 63;`009`009`123 someone can't use something`009`009`125
X`009E_CHILL = 64;`009`009`123 someone scrys you`009`009`009`125
X`009E_NOISE2 = 65;`009`009`123 say while in crystal ball`009`009`125
X`009E_LOOKSELF = 66;`009`123 someone looks at themself`009`009`125
X`009E_INVENT = 67;`009`009`123 someone takes inventory`009`009`125
X`009E_POOFYOU = 68;`009`009`123 MM poofs someone away . . . .`009`009`125
X`009E_WHO = 69;`009`009`123 someone does a who`009`009`009`125
X`009E_PLAYERS = 70;`009`009`123 someone does a players`009`009`125
X`009E_VIEWSELF = 71;`009`123 someone views a self description`009`125
X`009E_REALNOISE = 72;`009`123 make the real noises message print`009`125
X`009E_ALTNOISE = 73;`009`123 alternate mystery message`009`009`125
X`009E_MIDNIGHT = 74;`009`123 it's midnight now, tell everyone`009`125
X E_DCLDONE = 75; `123 return from dcl-level`009`009`009`125
X E_ATTACK = 76; `123 some attack someone with weapon`009`125
X E_HATTACK = 77; `123 hiding attack ...`009`009`009`125
X E_ADDEXPERIENCE = 78; `123 someone get more experience`009`009`125
X `123 Killed person send this message`009`125
X`009E_TRAP = 79;`009`009`123 some failure to get trap`009`009`125
X`009E_ERASE = 80;
X E_MONSTERDONE = 81;
X E_BROADCAST = 82; `123 NPC interpreter say something`009`009`1
V25
X`009E_SCAN = 83;
X`009E_LOOKAROUND = 84;
X`009E_NEWLEVEL = 85;
X`009E_SUBMIT = 86;`009`009`123 NPC interpreter switch control`009`125
X`009E_KICK_OUT = 87;`009`123 Kick out player from Monster`009`009`125
X`009E_ATMOSPHERE = 88;`009`123 for atmosphere command`009`009`125
X
X`009`123 --------- stolen from monster version 3.0 ------------------- `125
X
X`009E_ANNOUNCE = 89;`009`123 message over monster universe`009`009`125
X`009E_SHUTDOWN = 90;`009`123 shutdown message`009`009`009`125
X
X`009`123 ------------------------------------------------------------- `125
X
X`009E_RESET = 91;`009`009`123 move object to home `125
X`009E_GLOBAL_CHANGE = 92; `123 global flags is changed `125
X`009E_SUMMON = 93;`009`009`123 summon spell `125
X`009E_SPELLDONE = 94;`009`123 finish customizing spell `125
X
X`009E_ACTION = 100;`009`009`123 base command action event`009`009`125
X `032
X
X`123 Misc. `125 `032
X
X`009GOODHEALTH = 7;
X
X statmax = 8; `123 maksimi tilastointi tietueet `125`032
X sorthmax = 15;
X `032
X MAXATOM = 500;`009`123 Ohjelman maksimi koko `125
X
X
X`123 Code flags `125
X
X CF_NO_CONTROL = 1;`009 `123 no control access `125
X CF_SPELL_MODE = 2;`009 `123 spell mode `125
X
XType global_T = ( G_Flag, G_Int, G_Text, G_Code );
X
XConst
X
X`123 Global flags `125
X GF_ACTIVE = 1;`009 `123 Monster database open `125
X GF_VALID`009 = 2;`009 `123 Monster database is available `125
X GF_WARTIME = 3; `123 Violance is allowed `125
X GF_NEWPLAYER = 4; `123 New Player starting text `125
X GF_STARTGAME = 5; `123 Star palying text `125
X GF_CODE`009 = 6;`009 `123 Global code `125
X
X GF_MAX`009 = 6;
X
XVar GF_Types : array `091 1 .. GF_MAX `093 of global_T :=`032
X ( G_Flag,
X G_Flag,
X G_Flag,
X G_Text,
X G_Text,
X G_Code
X );
X
XType
X
X`009string = varying`091string_len`093 of char;
X`009veryshortstring = varying`091veryshortlen`093 of char;
X`009shortstring = varying`091shortlen`093 of char;
X`009mega_string = varying `091 MEGA_LENGTH `093 of char; `032
X
X`009`123 for system services `125
X`009$UWORD = `091WORD`093 0..65535; `032
X`009`009`009`123 must declare, because`009`009 `125
X`009`009`009`123 $UWORD in STARLET is with `091HIDDEN`093 `125
X`009string_body = packed array (.1..string_len.) of char;
X`009itmlst_type = record
X`009 buffer_length : $uword;
X`009 item_code : $uword;
X`009 buffer_address : `094string_body;
X`009 return_length_address : `094integer;
X`009 itmlst_end : unsigned
X`009end;
X
X
X`009`123 This is a list of description block numbers;
X`009 If a number is zero, there is no text for that block `125
X`009
X
X`009`123 exit kinds:
X`009`0090: no way - blocked exit
X`009`0091: open passageway
X`009`0092: object required
X
X`009`0096: exit only exists if player is holding the key
X`009`125
X
X`009exit = record
X`009`009toloc: integer;`009`009`123 location exit goes to `125
X`009`009kind: integer;`009`009`123 type of the exit `125
X`009`009slot: integer;`009`009`123 exit slot of toloc target `125
X
X`009`009exitdesc, `123 one liner description of exit `125
X`009`009closed, `123 desc of a closed door `125
X`009`009fail,`009 `123 description if can't go thru `125
X`009`009success, `123 desc while going thru exit `125
X`009`009goin, `123 what others see when you go into the exit `125
X`123`009`009ofail,`009`125
X`009`009comeout: `123 what others see when you come out of the exit `125
X`009`009`009 integer; `123 all refer to the liner file `125
X`009`009`009`009 `123 if zero defaults will be printed `125
X
X`009`009hidden: integer;`009`123 **** about to change this **** `125
X`009`009objreq: integer;`009`123 object required to pass this exit `125
X
X`009`009alias: veryshortstring; `123 alias for the exit dir, a keyword `125
X
X`009`009reqverb: boolean;`009`123 require alias as a verb to work `125
X`009`009reqalias: boolean;`009`123 require alias only (no direction) to
X`009`009`009`009`009 pass through the exit `125
X`009`009autolook: boolean;`009`123 do a look when user comes out of exit `12
V5
X`009end;
X
X
X`009`123 index record # 1 is block index `125
X`009`123 index record # 2 is line index `125
X`009`123 index record # 3 is room index `125
X`009`123 index record # 4 is player alloc index `125
X`009`123 index record # 5 is player awake (in game) index `125
X
X`009indexrec = record`009`009`123 must be same as PARSER -module `125
X`009`009indexnum: integer;`009`123 validation number `125
X`009`009free: packed array`0911..maxindex`093 of boolean;
X`009`009top: integer; `123 max records available `125
X`009`009inuse: integer; `123 record #s in use `125
X`009end;
X
X
X`009`123 names are record #1 `125
X`009`123 owners are record # 2 `125
X`009`123 player pers_names are record # 3 `125
X`009`123 userids are record # 4 `125
X`009`123 object names are record # 5 `125
X`009`123 object creators are record # 6 `125
X`009`123 date of last play is # 7 `125
X`009`123 time of last play is # 8 `125
X`009`123 passwords are # 9 `125
X`009`123 real usernames are # 10 `125
X`009`123 spell names are #11 `125
X
X`009namrec = record`009`009`009`123 must be same as PARSER -module `125
X`009`009validate: integer;
X`009`009loctop: integer;
X`009`009idents: array`0911..maxroom`093 of shortstring;
X`009end;
X
X`009objectrec = record
X`009`009objnum: integer;`009`123 allocation number for the object `125
X`009`009onum: integer;`009`009`123 number index to objnam/objown `125
X`009`009oname: shortstring;`009`123 duplicate of name of object `125
X`009`009kind: integer;`009`009`123 what kind of object this is `125
X`009`009linedesc: integer;`009`123 liner desc of object Here `125
X
X`009`009home: integer;`009`009`123 if object at home, then print the `125
X`009`009homedesc: integer;`009`123 home description `125
X
X`009`009actindx: integer;`009`123 action index -- for hook (hurtta@finuh) `1
V25
X`009`009examine: integer;`009`123 desc block for close inspection `125
X`009`009worth: integer;`009`009`123 how much it cost to make (in gold) `125
X`009`009numexist: integer;`009`123 number in existence `125
X
X`009`009sticky: boolean;`009`123 can they ever get it? `125
X`009`009getobjreq: integer;`009`123 object required to get this object `125
X`009`009getfail: integer;`009`123 fail-to-get description `125
X`009`009getsuccess: integer;`009`123 successful picked up description `125
X
X`009`009useobjreq: integer;`009`123 object require to use this object `125
X`009`009uselocreq: integer;`009`123 place have to be to use this object `125
X`009`009usefail: integer;`009`123 fail-to-use description `125
X`009`009usesuccess: integer;`009`123 successful use of object description `1
V25
X
X`009`009usealias: veryshortstring;
X`009`009reqalias: boolean;
X`009`009reqverb: boolean;
X
X`009`009particle: integer;`009`123 a,an,some, etc... "particle" is not
X`009`009`009`009`009 be right, but hey, it's in the code `125
X
X`009`009parms: array`0911..maxparm`093 of integer;
X
X`009`009d1: integer;`009`009`123 extra description # 1 `125
X`009`009d2: integer;`009`009`123 extra description # 2 `125
X
X`009`009ap: Integer;`009`009`123 attack power `125
X exreq: Integer;`009`009`123 required experiece `125
X`009`009exp5,exp6: integer;
X`009end;
X
X`009anevent = record
X`009`009sender,`009`009`009`123 slot of sender `125
X`009`009action,`009`009`009`123 what event this is, E_something `125
X`009`009target,`009`009`009`123 opt target of action `125
X`009`009parm: integer;`009`009`123 expansion parm `125
X`009`009msg: string;`009`009`123 string for SAY and other cmds `125
X`009`009loc: integer;`009`009`123 room that event is targeted for `125
X`009end;
X
X`009eventrec = record
X`009`009validat: integer;`009`123 validation number for record locking `125
X`009`009evnt: array`0911..maxevent`093 of anevent;
X`009`009point: integer;`009`009`123 circular buffer pointer `125
X`009end;
X
X`009peoplerec = record
X`009`009kind: integer;`009`009 `123 0=none,1=player,2=npc `125
X`009`009parm: integer;`009`009 `123 index to npc controller (object?) `125
X
X`009`009username: veryshortstring; `123 actual userid of person `125
X`009`009name: shortstring;`009 `123 chosen name of person `125
X`009`009hiding: integer;`009 `123 degree to which they're hiding `125
X`009`009act,targ: integer;`009 `123 last thing that this person did `125
X
X`009`009holding: array`0911..maxhold`093 of integer;`009`123 objects being h
Veld `125
X`009`009experience: integer;
X
X`009`009wearing: integer;`009`123 object that they're wearing `125
X`009`009wielding: integer;`009`123 weapon they're wielding `125
X`009`009health: integer;`009`123 how healthy they are `125
X
X`009`009self: integer;`009`009`123 self description `125
X
X`009`009ex1,ex2,ex3,ex4,ex5: integer;
X`009end;
X
X`009spellrec = record
X`009`009recnum: integer;
X`009`009level: array`0911..maxspells`093 of integer;
X`009end;
X
X`009descrec = record
X`009`009descrinum: integer;
X`009`009lines: array`0911..descmax`093 of string;
X`009`009desclen: integer; `123 number used in this block `125
X`009end;
X
X`009linerec = record
X`009`009linenum: integer;
X`009`009theline: string;
X`009end;
X
X`009room = record`009`009
X`009`009valid: integer;`009`009`123 validation number for record locking `12
V5
X`009`009locnum: integer;
X`009`009owner: veryshortstring; `123 who owns the room: userid if private
X`009`009`009`009`009`123 other values is in module PARSER `125
X`009`009nicename: string;`009`123 pretty name for location `125
X`009`009nameprint: integer;`009`123 code for printing name:
X`009`009`009`009`009`0090: don't print it
X`009`009`009`009`009`0091: You're in
X`009`009`009`009`009`0092: You're at
X`009`009`009`009`009`125
X
X`009`009primary: integer;`009`123 room descriptions `125
X`009`009secondary: integer;
X`009`009which: integer;`009`009`123 0 = only print primary room desc.
X`009`009`009`009`009 1 = only print secondary room desc.
X`009`009`009`009`009 2 = print both
X`009`009`009`009`009 3 = print primary then secondary
X`009`009`009`009`009`009if has magic object `125
X
X`009`009magicobj: integer;`009`123 special object for this room `125
X`009`009effects: integer;
X`009`009parm: integer;
X
X`009`009exits: array`0911..maxexit`093 of exit;
X
X`009`009pile: integer;`009`009`123 if more than maxobjs objects here `125
X`009`009objs: array`0911..maxobjs`093 of integer;`009`123 refs to object fil
Ve `125
X`009`009objhide: array`0911..maxobjs`093 of integer;`009`123 how much each o
Vbject
X`009`009`009`009`009`009`009 is hidden `125
X`009`009`009`009`009`009`009`123 see hidden on exitrec
X`009`009`009`009`009`009`009 above `125
X
X`009`009objdrop: integer;`009`123 where objects go when they're dropped `125
X`009`009objdesc: integer;`009`123 what it says when they're dropped `125
X`009`009objdest: integer;`009`123 what it says in target room when
X`009`009`009`009`009 "bounced" object comes in `125
X
X`009`009people: array`0911..maxpeople`093 of peoplerec;
X
X`009`009grploc1,grploc2: integer;
X`009`009grpnam1,grpnam2: shortstring;
X
X`009`009detail: array`0911..maxdetail`093 of veryshortstring;
X`009`009detaildesc: array`0911..maxdetail`093 of integer;
X
X`009`009trapto: integer;`009`123 where the "trapdoor" goes `125
X`009`009trapchance: integer;`009`123 how often the trapdoor works `125
X
X`009`009rndmsg: integer;`009`123 message that randomly prints `125
X
X`009`009xmsg2: integer;`009`009`123 another random block `125
X
X`009`009Hook: integer;`009`009`123 Link to hook code `125
X`009`009exp3,exp4: integer;
X`009`009exitfail: integer;`009`123 default fail description for exits `125
X`009`009ofail: integer;`009`009`123 what other's see when you fail, default
V `125
X`009end;
X
X
X`009intrec = record
X`009`009intnum: integer;
X`009`009int: array`0911..maxplayers`093 of integer;
X`009end;
X
X`009levelrec = record
X`009`009name: shortstring;`009`123 Level name `125
X`009`009exp: integer;`009`009`123 required experience `125
X`009`009priv: integer;`009`009`123 new privilege `125
X`009`009health: integer;`009`123 maximun health `125
X`009`009factor:`009integer;`009`123 hit factor 0 - 100 `125
X`009`009maxpower: integer;`009`123 max power for weapons `125
X`009`009hidden: boolean;`009`123 list in show levels? `125
X`009end;
X
X statrec = record`009`009`009 `123 tilastointitietue`009 `125
X lab: shortstring;`009`009`009 `123 label, josta k`228ynis
Vtetty`125
X runcount: integer;`009`009 `123 ajokertojen lukum`228`228
Vr`228 `125
X errorcount: integer;`009`009 `123 virheinen lukum`228`228
Vr`228 `125
X lastrun: shortstring`009`009 `123 viimeisen ajokerran aik
Va`125
X end;
X
X `032
X headerrec = record`032
X validate: integer; `123 validation number `125
X`009`009runnable: boolean;`009`009 `123 lippu: saako koodin aja `125
X`009`009priv: boolean;`009`009`009 `123 lippu: onko koodi`009 `125
X`009`009`009`009`009`009 `123 privileged -moodissa `125
X interlocker: shortstring; `123 who write or read code file `
V125
X `123 '' if none`125
X owner: shortstring; `123 monster owner `125
X ctime: shortstring; `123 creation time `125
X stats: array `0911..statmax`093 of statrec; `123 running sta
Vtics `125
X author: shortstring; `123 code writer `125
X wtime: shortstring; `123 code loading time `125
X running_id: shortstring; `123 who running it now `125
X `123 '' if none `125
X state: mega_string; `123 monster 'state' `125
X`009`009version: integer; `123 code version number `125
X ex1,ex2,ex3: shortstring; `123 unused (reserved) string `12
V5
X flags: integer;`009`009 `123 flags `125
X`009`009ex5: integer; `123 unused (reserved) integer `125
X ex6: real; `123 unused (reserved) real `125
X end; `032
X
X`009classrec = record
X`009`009name:`009shortstring;
X`009`009id:`009shortstring;
X`009end;
X
Xvar
X
X`009`123 variables from PRIVUSERS.PAS `125
X`009MM_userid : `091global`093 veryshortstring;
X`009
X`009`009`123 The Monster Manager has the most power; this should be
X`009`009 the game administrator. `125
X
X`123`009protected_MM : `091global`093 boolean;`009`125
X
X`009gen_debug : `091global`093 boolean;
X`009`009`123 this tells whether everyone may use the debug command.
X it must be able to be disabled because it tells players
X too much about monsters. On the other hand, it must also`0
V32
X be able to be enabled, if we want to do test runs under
X an unprivileged userid`009`009`125
X
X
X`009REBUILD_OK : `091global`093 boolean;
X
X`009`009`123 if this is TRUE, the MM can blow away and reformat the
X`009`009 entire universe. It's a good idea to set this to FALSE `125
X
X`009root : `091global`093 string;
X`009coderoot : `091global`093 string;
X `032
X`009`009`123 This is where the Monster database goes.
X`009`009 The root directory must be world:e and
X`009`009 the datafiles Monster creates in it
X`009`009 world:rw for people to be able to play.
X`009`009 The coderoot directory is where the
X`009`009 codefiles for monsters go. The directory
X`009`009 must additionally have an ACL default
X`009`009 world:rw for files and ACL rw for the
X`009`009 managers. This sucks, but we don't have
X`009`009 setgid to games on VMS. `125
X
X
X
X`009leveltable : `091global`093 array `091 1 .. maxlevels `093 of levelrec;
X
X`009levels`009`009: `091global`093 integer;`009`123 Levels really used `125
X`009
X
X maxexperience`009: `091global`093 integer; `123 maximum experien
Vce `125
X`009`009`009`123 Monster Manager's experience is MaxInt `125
X
X`009protect_exp : `091global`093 integer;
X`009`009`009`009`123 gives protection agaist violence `125
X
X`009debug: `091global`093 boolean; `123 minor change by hurtta@finuh
V `125
X
XEnd.`009`123 end of module `125
$ CALL UNPACK GLOBAL.PAS;48 1560473208
$ create/nolog 'f'
X- LABEL start ()
X
X- LABEL enter()
X
X- LABEL leave()
X
X- LABEL say()
X
X- LABEL look around()
X
X- LABEL command(
X`009`009null(
X`009`009`009pprint(+("Unknow command: ",command)),
X`009`009`009pprint("Please type ? or HELP for help.")
X`009`009)
X`009)
$ CALL UNPACK GREAT_HALL.MDL;5 1097426403
$ create/nolog 'f'
X`091environment,inherit ('sys$library:starlet','global')`093
X
X
XMODULE guts(input,output);
X`123+
XCOMPONENT: Low level interfase to VMS
X`032
XPROGRAM DESCRIPTION:
X`032
X `032
X`032
XAUTHORS:
X`032
X Rich Skrenta
X Antti Leino
X Kari Hurtta
X`032
XCREATION DATE: Unknow
X`032
XDESIGN ISSUES:
X`032
X
X`032
XMODIFICATION HISTORY:
X`032
X Date `124 Name `124 Description
X--------------+---------+---------------------------------------------------
V----
X 28.5.1992 `124 Hurtta`009`124 Partially rewritten, new do_dcl and grab_l
Vine
X 31.5.1992 `124`009`009`124 This header, database poll time in check time
Vr`032
X `124 `124 changed from 0 ::2 to 0 ::1 (ie. one second)
V.
X 10.6.1992 `124 `124 in grab_line 'terminator not seen' action ch
Vanged
X-`125
X
X`032
Xconst
X SHORT_WAIT = 0.1;
X LONG_WAIT = 0.2;
X maxcycle = 10; `123 attempting to fine tune nextkey `125
X
X`009smg$_eof = 1213442;`009`123 ei m`228`228ritelly starlet.pas:issa vaan`03
V2
X`009`009`009`009 smsg$routines.pas `125
X
X base_efn = 32;`009`009`123 ensimm`228isen EF:n numero t`228ss`228 EF
V clusterissa `125
X`009tmr_efn = 33;`009`009`123 timer eventflag `125
X`032
Xtype
X
X`009$UBYTE = `091BYTE`093 0..255;
X `123 $uword is declared in glopal.pas `125
X`009$UQUAD = `091QUAD,UNSAFE`093 RECORD
X`009`009L0,L1:UNSIGNED; END;
X
X
X ident = packed array`0911..12`093 of char;
X `032
X iosb_type = record
X cond: $uword;
X trans: $uword;
X junk: unsigned; `123longword`125
X end;
X`032
X il3 = record
X buflen : $uword;
X itm : $uword;
X baddr : unsigned;
X laddr : unsigned;
X end;
X`032
X`032
Xvar
X
X save_dcl_ctrl: unsigned;
X out_chan,inp_chan: `091volatile`093 $uword;
X
X`123 vaxid: `091global`093 packed array`0911..12`093 of char;
X line: `091global`093 string; `125
X old_prompt: `091global`093 string;`032
X`032
X
X`009need_reprint : boolean := false;
X
X seed: integer;
X`032
X user_rec,uname:varying`09131`093 of char;
X sts:integer;
X il:array`0911..2`093 of il3;
X key:$uword;
X`032
X userident: `091global`093 ident;
X
X`009Terminal: `091 global `093 Boolean := false;`032
X`009DecCRT:`009 `091 global `093 Boolean := False; `123 least vt100 `125
X`009Terminal_line_len: `091global`093 integer := 80; `123 default = 80 `125
X`009Terminal_page_len: `091global`093 integer := 24; `123 default = 24 `125
X
X`009grab_next: `091global `093 integer := 0;
X
X`009cur_position : Integer := 0;`009`123 0 is leftmost column`009`125
X
X`009leave_monster : boolean := false;
X`009eof_counter : integer := 0;
X
X`091asynchronous, external (lib$signal)`093 `032
Xfunction lib$signal (
X %ref status : `091unsafe`093 unsigned) : unsigned; external;
X`032
X`091asynchronous, external (str$trim)`093
Xfunction str$trim (
X destination_string : `091class_s`093 packed array `091$l1..$u1:integer`09
V3 of char;
X source_string : `091class_s`093 packed array `091$l2..$u2:integer`093 of
V char;
X %ref resultant_length : $uword) : unsigned; external;
X
X`032
X`091asynchronous, external (lib$disable_ctrl)`093
Xfunction lib$disable_ctrl (
X %ref disable_mask : unsigned;
X %ref old_mask : unsigned := %immed 0) : unsigned; external;
X`032
X`091asynchronous, external (lib$enable_ctrl)`093
Xfunction lib$enable_ctrl (
X %ref enable_mask : unsigned;
X %ref old_mask : unsigned := %immed 0) : unsigned; external;
X`032
X
X`091asynchronous`093`032
Xprocedure syscall( s: `091unsafe`093 unsigned );
X`032
Xbegin
X if not odd( s ) then begin
X lib$signal( s );
X end;
Xend;
X`032
X`032
X`091external,asynchronous`093
Xfunction mth$random(var seed: integer): real;
Xexternal;
X
X
X`091global`093
Xprocedure quit_monster;
Xbegin
X leave_monster := true;
X eof_counter := 0;
Xend; `123 quit_monster `125
X`032
X`091global`093
Xfunction random: real;
X`032
Xbegin
X random := mth$random(seed);
Xend;
X`032
X`091global`093
Xfunction rnd100: integer; `123 random int between 0 & 100, maybe `125
X`032
Xbegin
X rnd100 := round(mth$random(seed)*100);
Xend;
X`032
X`032
X`091external`093 function lib$wait(seconds:`091reference`093 real):integer;
Xexternal;
X`032
X`091global`093
Xprocedure wait(seconds: real);
X`032
Xbegin
X syscall( lib$wait(seconds) );
Xend;
X`032
X`091external`093 procedure checkevents(silent: boolean := false);
Xextern;
X`032
X
Xfunction check_timer(force: boolean := false): boolean;
Xvar code: unsigned;
X time: $uquad;
Xbegin
X syscall ($readef (base_efn,code));
X if (uand(code,2 ** (tmr_efn-base_efn)) > 0) or force then begin
X`009syscall($clref (tmr_efn));
X`009syscall($bintim ('0 ::1',time)); `123 kaksi sekunttia laukeamiseen `125
X`009syscall($setimr (tmr_efn,time,,,));
X`009check_timer := true;
X end else check_timer := false;
Xend; `123 check_timer `125
X `032
X`091global`093
Xprocedure doawait(time: real);
X`032
Xbegin
X syscall( lib$wait(time) );
Xend;
X`032
X`032
X`091global`093
Xfunction trim(s: string): string;
Xvar
X tmp: `091static`093 string := '';
X`032
Xbegin
X syscall( str$trim(tmp.body,s,tmp.length) );
X trim := tmp;
Xend;
X`032
X`032
X`091global`093
Xfunction get_userid: string;
X`032
Xbegin
X il:=zero;
X il`0911`093.itm := jpi$_username;
X il`0911`093.buflen := size(user_rec.body);
X il`0911`093.baddr := iaddress(user_rec.body);
X il`0911`093.laddr := iaddress(user_rec.length);
X syscall($getjpiw(,,,il));
X syscall( str$trim(uname.body,user_rec,uname.length) );
X userident := user_rec;
X get_userid := uname;
Xend;
X`032
X`032
X`091global,asynchronous`093
Xprocedure putchars(s: mega_string; tokeyboard: boolean := false);
Xvar
X msg: packed array`0911..MEGA_LENGTH`093 of char;
X len: integer;
X`032
Xbegin
X msg := s;
X len := length(s);
X`009if tokeyboard then`032
X`009 syscall($qiow(,inp_chan,
X`009`009io$_writevblk+io$m_refresh,,,,msg,len,,,,))
X else`032
X`009 syscall($qiow(,out_chan,io$_writevblk,,,,msg,len,,,,));
Xend;
X
X`091external(LIB$GETDVI)`093`009`123 Uses SYS$GETDVI, but it is too`009`125
XFunction GetDvi`009(`009`009`123 complicated,so I use library routine`009`12
V5
X`009%REF`009ItemCode:`009`009$uword; `032
X`009%REF`009Channel:`009`009$uword`009`009:= %IMMED 0;
X`009%DESCR`009DeviceName:`009`009String`009`009:= %IMMED 0;
X`009%REF`009OutValue:`009`009Unsigned`009:= %IMMED 0;
X`009%DESCR`009OutString:`009`009String`009`009:= %IMMED 0
X`009):`009Integer;`009Extern;
X
X
X
X`091global`093
Xprocedure reprint_grab;
Xbegin
X if need_reprint then putchars(''(13),tokeyboard := true);
Xend;
X
X
X`091global`093
Xprocedure grab_line(prompt:string; var s:string;echo:boolean := true;
X erase: boolean := false; edit_mode: boolean := false;
X`009`009 procedure eof_handler);
Xlabel again,out;
XConst`009max_line = size(s.body);
X`009Lines = 100;
X`009grab_efn = 34;
X`009max_esc = 10;
X
X`009ESC_NONE = 0;
X`009ESC_RETURN = 1;
X`009ESC_EOF = 2;
X`009ESC_F10 = 3;
X`009ESC_B = 4;
X`009ESC_UP1 = 5;
X`009ESC_UP2 = 6;
X`009ESC_UP3`009= 7;
X`009ESC_UP4 = 8;
X`009ESC_DOWN1 = 9;
X`009ESC_DOWN2 = 10;
X`009ESC_DOWN3 = 11;
X`009ESC_DOWN4 = 12;
X
X`009ESC_LAST = 12;
X
Xtype`009Line_buffer = Array `091 1 .. Lines `093 of string;
X
X item = record
X`009 len: $uword;
X`009 code: $uword;
X`009 addr: `091long`093 unsigned;
X`009 rtradr: `091long`093 unsigned;
X`009end;
Xvar
X esc_table : array `091 0 .. ESC_LAST`093 of shortstring :=
X`009 ( '',`009 `123 ESC_NONE `125
X`009 ''(13),`009 `123 ESC_RETURN `125
X`009 ''(26),`009 `123 ESC_EOF `125
X`009 ''(27)'`09121`126', `123 ESC_F10 `125
X`009 ''(2),`009 `123 ESC_B `125
X`009 ''(27)'`091A', `123 ESC_UP1 `125
X`009 ''(155)'A', `123 ESC_UP2 `125
X`009 ''(27)'OA', `123 ESC_UP3 `125
X`009 ''(143)'A', `123 ESC_UP4 `125
X`009 ''(27)'`091B', `123 ESC_DOWN1 `125
X`009 ''(155)'B', `123 ESC_DOWN2 `125
X`009 ''(27)'OB', `123 ESC_DOWN3 `125
X`009 ''(143)'B'); `123 ESC_DOWN4 `125
X`009 `032
X
X
X mask:`009 unsigned := 2 ** (grab_efn-base_efn) +`032
X`009`009`0092 ** (tmr_efn-base_efn);
X`009end_grab: boolean := false;
X`009code:`009 unsigned;
X`009start: `091volatile`093 string;
X`009line:`009 string;
X`009area:`009 `091volatile`093 packed array `091 1 .. max_line + max_esc
V `093 of char;
X`009modifiers: unsigned := 0;
X`009iosb:`009 `091volatile`093 record
X`009 status: `091volatile`093 $uword;
X`009 offtrm: `091volatile`093 $uword;
X`009 trmchr: `091volatile`093 $ubyte;
X`009 reserved: `091volatile`093 $ubyte;
X`009 trmlen: `091volatile`093 $ubyte;
X`009 crspos: `091volatile`093 $ubyte;
X`009end;
X
X`009buffer`009: `091static`093 Line_buffer;`009`123 saved values`009`009`125
X`009used`009: `091static`093 0 .. Lines := 0;`009`123 between calls `009`125
X current : 1 .. Lines;
X`009maxlen,i : integer;
X`009itemlist : array `091 1 .. 4 `093 of item;
X
X result : unsigned;
X`009terminator : shortstring;
X`009esccode : integer;
X`009eof_detected : boolean := false;
X
X procedure erase_line;
X begin
X`009if echo then begin`009`009
X`009 if DecCRT Then putchars(chr(13)+chr(27)+'`091K',true)
X`009 else begin`032
X`009`009putchars(chr(13),true);`009`009`009
X`009`009for i := 1 to length (prompt) + length(line) do
X`009`009putchars(' ',true);`009`009`009
X`009`009putchars(chr(13),true);`009`009`009
X`009 end;
X`009end;`032
X end; `123 erase_line `125
X
X
Xbegin
X
X syscall(GetDvi(DVI$_TRM,inp_chan,,result));
X if not odd(result) then begin
X`009writeln('SYS$INPUT must point to terminal !!!');
X`009HALT;
X end;
X putchars(''(13)''(10),tokeyboard := true);
X
X line := ''; start := '';
X
X if not edit_mode then begin `032
X if used < lines then begin`032
X used := used +1;
X current := used; `032
X buffer `091current`093 := ''
X end else begin`009`009`009`009
X current := lines;
X for i := 1 to lines - 1 do buffer `091i`093 := buffer `091i+1`093;
X buffer `091current`093 := '';
X end; `032
X end else start := s;
X
X again:
X
X modifiers := uor(uor(TRM$M_TM_ESCAPE,TRM$M_TM_TRMNOECHO),TRM$M_TM_NORECALL
V);`032
X if not echo then modifiers := uor(modifiers,TRM$M_TM_NOECHO);
X
X itemlist`0911`093.len := 0;
X itemlist`0911`093.code := TRM$_ESCTRMOVR;
X itemlist`0911`093.addr := MAX_ESC;
X itemlist`0911`093.rtradr := 0; `123 escape koodin koko `125
X itemlist`0912`093.len := prompt.length;
X itemlist`0912`093.code := TRM$_PROMPT;
X itemlist`0912`093.addr := IADDRESS(prompt.body);
X itemlist`0912`093.rtradr := 0;
X itemlist`0913`093.len := start.length;
X itemlist`0913`093.code := TRM$_INISTRNG;
X itemlist`0913`093.addr := IADDRESS(start.body);
X itemlist`0913`093.rtradr := 0;
X itemlist`0914`093.len := 0;
X itemlist`0914`093.code := TRM$_MODIFIERS;
X itemlist`0914`093.addr := modifiers;
X itemlist`0914`093.rtradr := 0;
X
X iosb := zero;
X
X need_reprint := true;
X area := ' ';
X
X syscall($clref(grab_efn));
X syscall($qio( efn := grab_efn,
X`009`009chan := inp_chan,
X`009 func := IO$_READVBLK+IO$M_EXTEND,
X`009`009iosb := iosb,
X`009`009p1 := area,
X`009`009p2 := size(area),
X`009`009p5 := iaddress(itemlist),
X`009`009p6 := size(itemlist)));
X
X end_grab := false;
X while not end_grab do `123 odotetaan loppumista `125
X begin
X `032
X syscall($wflor(base_efn,mask)); `123 odotetaan ett`228 timerin tai I
VO:n
X`009`009`009`009 EF laukeaa `125
X
X if (check_timer) then checkevents;`032
X`009`009`009`123 check_timer my`246skin laittaa timeri uudestaan `125
X`009`009`009`123 k`228yntiin. alunperin se on k`228ynistetty `125
X`009`009`009`123 setup_guts:issa `125
X
X if leave_monster then begin
X`009syscall($cancel(inp_chan));
X`009if eof_counter > 10 then begin
X`009 putchars(chr(10)+chr(13)+
X`009`009'%quit monster failed. Notify Monster Manager.'+chr(13),
X`009`009tokeyboard := true);
X`009 leave_monster := false;
X`009 goto again;
X`009end else begin
X`009 eof_counter := eof_counter +1;
X`009 eof_detected := true;
X`009 goto out;
X`009end;
X end;
X
X syscall ($readef (base_efn,code));
X end_grab := uand(code,2 ** (grab_efn-base_efn)) > 0; `123 Onko IO p`22
V8`228ttynyt `125
X end;
X
X syscall(iosb.status); `123 if failed .. > out `125
X terminator := '';
X for i := 1 to iosb.trmlen do terminator := terminator + area`091iosb.offtr
Vm+i`093;
X line := '';
X for i := 1 to iosb.offtrm do line := line + area`091i`093;
X
X esccode := -1;
X for i := 0 to ESC_LAST do if esc_table`091i`093 = terminator then esccode
V := i;
X
X case esccode of
X -1: begin`009 `032
X`009 putchars(''(10)''(13),tokeyboard := true);
X`009 writeln('Unknown function key.');
X`009 start := line;
X`009 goto again;
X`009end;
X ESC_NONE: begin
X`009 putchars(''(10)''(13),tokeyboard := true);
X`009 writeln('Terminator not seen.');
X`009 if length(line) >= max_line then
X`009`009line := substr(line,1,max_line-1);
X`009 start := line;
X`009 goto again;
X`009end;
X ESC_RETURN: begin
X`009 grab_next := 0;
X`009 ;
X`009end;
X ESC_EOF, ESC_F10: begin
X`009 eof_detected := true;
X`009 grab_next := 0;
X`009end;
X ESC_B, ESC_UP1, ESC_UP2, ESC_UP3, ESC_UP4: begin
X`009 if edit_mode then grab_next := -1
X`009 else begin`032
X`009`009if current > 1 then current := current -1; `032
X`009`009putchars(''(13)''(0),tokeyboard := true);
X`009`009erase_line;
X`009`009start := buffer`091current`093;
X`009`009goto again;
X`009 end;
X`009end;
X ESC_DOWN1, ESC_DOWN2, ESC_DOWN3, ESC_DOWN4: begin
X`009 if edit_mode then grab_next := 1
X`009 else begin`032
X`009`009if current < used then current := current +1; `032
X`009`009putchars(''(13)''(0),tokeyboard := true);
X`009`009erase_line;
X`009`009start := buffer`091current`093;
X`009`009goto again;
X`009 end;
X`009end;
X otherwise halt;
X end; `123 case `125
X
X need_reprint := false;
X
X out:
X
X if erase then erase_line
X else putchars(''(13)''(0),true);`009`009`009
X if not edit_mode then begin`009`009`009
X if echo then buffer `091used`093 := line`009
+-+-+-+-+-+-+-+- END OF PART 12 +-+-+-+-+-+-+-+-