home *** CD-ROM | disk | FTP | other *** search
-
- {PARAM.PA2}
-
-
- PROCEDURE CheckParams;
-
-
- VAR
- NumPara, Spot : Integer;
- P, p1, p2, p3 : words;
- {PARAMCOUNT AND PARAMSTR(I..PARAMCOUNT) ARE TURBO FNS}
-
- PROCEDURE Handle_File_Name;
-
- BEGIN {PROPER FORM TO CREATE FINAL VERSION}
- p2 := '';
- IF POS(':', p1) <> 0 THEN
- BEGIN
- Spot := POS(':', p1);
- p2 := Copy(p1, 1, Spot); {up to ':'}
- p1 := Copy(p1, Spot+1, 255); {after ':'}
- END;
- WHILE POS('\', p1) <> 0 DO
- BEGIN
- Spot := POS('\', p1);
- p2 := p2+Copy(p1, 1, Spot); {up to '\'}
- p1 := Copy(p1, Spot+1, 255); {after '\'}
- END;
- IF p2 <> '' THEN {need to change directory}
- BEGIN
- Spot := Length(p2);
- IF p2[Spot] = '\' THEN p2 := Copy(p2, 1, Spot-1); {strip off last '\'}
- {$I-} ChDir(p2); {$I+}
- IF IoResult <> 0 THEN
- BEGIN
- WriteLn('Cannot find directory: ', p2);
- Halt;
- END;
- END; {change directory}
- P := p1;
- Adventure_Name := P;
- data_file_name := P+'.DAT';
- title_file_name := P+'.TTL';
- descr_file_name := P+'.D$$';
- Command_File_Name := P+'.CMD';
- Instruction_File_Name := P+'.INS';
- IF File_Exists(descr_file_name)
- AND File_Exists(P+'.DA1') {1ST DATA FILE}
- AND File_Exists(P+'.DA2') {ROOM DATA FILE}
- THEN UsingFinalVersion := True
- ELSE
- IF NOT File_Exists(descr_file_name)
- THEN
- BEGIN
- WriteLn(IO, ' ');
- WriteLn(IO, 'Final version data file not present on default drive.');
- WriteLn(IO, 'You need to compile your adventure, before playing it.');
- WriteLn(IO, '(i.e., First "COMPILE CRUSADE")');
- WriteLn(IO, 'RUN program terminated.');
- Halt;
- END; {IF}
- END; {Handle_File_Name}
-
- BEGIN
- {$V-}
- UsingFinalVersion := False;
- DoingUpperCase := True;
- p1 := '';
- p2 := '';
- p3 := '';
- NumPara := ParamCount;
- IF NumPara >= 1 THEN
- BEGIN
- p1 := ParamStr(1);
- P := ParamStr(1);
- Capitalize(p1);
- Capitalize(P);
- END;
- IF NumPara >= 2 THEN
- BEGIN
- p2 := ParamStr(2);
- Capitalize(p2);
- END;
- IF NumPara >= 3 THEN
- BEGIN
- p3 := ParamStr(3);
- Capitalize(p3);
- END;
- IF ((p2 = '/L') OR (p2 = 'L')) THEN
- BEGIN
- DoingUpperCase := False;
- p2 := p3;
- NumPara := NumPara-1;
- END
- ELSE IF ((p2 = '/B') OR (p2 = 'B')) THEN
- BEGIN
- DirectVideo := False;
- p2 := p3;
- NumPara := NumPara-1;
- END;
- IF (p3 = '/L') OR (p3 = 'L') THEN
- BEGIN
- DoingUpperCase := False;
- NumPara := NumPara-1;
- END
- ELSE IF ((p3 = '/B') OR (p3 = 'B')) THEN
- BEGIN
- DirectVideo := False;
- NumPara := NumPara-1;
- END;
- CASE NumPara OF
- 0 : BEGIN
- WriteLn(IO, ' ');
- WriteLn(IO, 'Command format: RUN filename');
- WriteLn(IO, ' (where "filename" is 1..8 characters; do not',
- ' specify any file extension.)');
- WriteLn(IO, ' ');
- Halt;
- END;
- 1 : BEGIN
- IF (p1 = '?') OR (p1 = 'HELP')
- THEN
- BEGIN
- WriteLn(IO, ' ');
- WriteLn(IO, 'Command format: RUN filename');
- WriteLn(IO, ' (where "filename" is 1..8 characters; do not',
- ' specify any file extension.)');
- WriteLn(IO, ' ');
- Halt;
- END
- ELSE Handle_File_Name;
- END; {CASE 1}
- ELSE {FOR CASE}
- BEGIN
- WriteLn(IO, ' ');
- WriteLn(IO, 'Command format: RUN filename');
- WriteLn(IO, ' (where "filename" is 1..8 characters; do not',
- ' specify any file extension.)');
- WriteLn(IO, ' ');
- Halt;
- END; {CASE ELSE}
- END; {CASE STATEMENT}
- END; {CHECKPARAMS}
- {$V+}
-
-
- { TELL (NOUN,OBJECT) }
- {TELL MAN ABOUT SWORD, TALK TO PRINCESS}
- {TALK WITH JEFF ABOUT SCHOOL WORK }
-
- PROCEDURE TELL(noun, object_word : words);
- VAR m_num, o_num : Integer;
-
- BEGIN
- m_num := Noun_Number(noun);
- o_num := Noun_Number(object_word);
- Normalize(noun);
- Normalize(object_word);
- IF (noun = 'all') OR (object_word = 'all') THEN
- WriteLn(IO, 'You can only talk with one person at a time about one subject at a time!')
- ELSE IF (NounNumber < First_creature) OR (NounNumber > MaxCreature)
- THEN BEGIN
- WriteLn(IO, 'Talking with the ', noun, ' is kind of silly, since the ');
- WriteLn(IO, noun, ' can''t talk back!');
- END
- ELSE IF (M[NounNumber]^.gender = Thing) {Thing's can't talk}
- THEN WriteLn(IO, 'The ', noun, ' just listens to you, but remains strangely silent.')
- ELSE {VALID CREATURE}
- BEGIN
- IF object_word = ''
- THEN WriteLn(IO, 'You spend a few minutes in pleasant conversation with the ', noun, '.')
- ELSE BEGIN
- WriteLn(IO, 'You spend a few minutes in pleasant conversation with the ', noun);
- WriteLn(IO, 'chatting about the ', object_word, '.');
- END;
- WriteLn(IO, 'However, you don''t learn anything that you didn''t already know.');
- END;
- END; {TELL}
-
- { ASK (NOUN,OBJECT) }
- {ASK MAN ABOUT SWORD, ASK JEFF ABOUT SCHOOL WORK}
-
- PROCEDURE ASK(noun, object_word : words);
- VAR m_num, o_num : Integer;
-
- BEGIN
- m_num := Noun_Number(noun);
- o_num := Noun_Number(object_word);
- Normalize(noun);
- Normalize(object_word);
- IF (noun = 'all') OR (object_word = 'all') THEN
- WriteLn(IO, 'You can only talk with one person at a time about one subject at a time!')
- ELSE IF (NounNumber < First_creature) OR (NounNumber > MaxCreature)
- THEN BEGIN
- WriteLn(IO, 'Asking the ', noun, ' questions is kind of silly, since the ');
- WriteLn(IO, noun, ' can''t answer back!');
- END
- ELSE IF (M[NounNumber]^.gender = Thing) {Thing's can't talk}
- THEN WriteLn(IO, 'The ', noun, ' just listens to you, but remains strangely silent.')
- ELSE {VALID CREATURE}
- IF object_word = ''
- THEN WriteLn(IO, 'You must ask the ', noun, ' ABOUT something!')
- ELSE BEGIN
- WriteLn(IO, 'The ', noun, ' tells you all about the ', object_word, ', but the ', noun);
- WriteLn(IO, 'isn''t exactly a fountain of knowledge and you don''t learn');
- WriteLn(IO, 'anything that you didn''t already know.');
- END;
- END; {ASK}
-