forked from videogamepreservation/softporn
-
Notifications
You must be signed in to change notification settings - Fork 3
/
SOFTP3.INC
638 lines (535 loc) · 15.7 KB
/
SOFTP3.INC
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
{ Softporn Adventure, include file # 3 }
procedure newlines( lines : integer );
(*==================================*)
var i : integer;
begin
for i:=1 to lines do writeln;
end;
procedure I_cant_go_that_way;
(*=========================*)
begin
write_message( 'I can''t go that way!' );
end;
procedure cant_do_that;
(*===================*)
var messg : integer;
begin
messg := random(8) + 1;
case messg of
1: writeln('Huh?');
2: writeln('Ummm......huh?');
3: writeln('You''re nuts!');
4: writeln('You can''t be serious!!');
5: writeln('Not bloody likely!!');
6: writeln('I don''t know how to.');
7: writeln('An interesting idea....');
8: writeln('I can''t do that.');
end;
end;
procedure huh;
(*==========*)
begin
write_message('Huh?');
end;
procedure I_cant_do_that;
(*=====================*)
begin
writeln;
cant_do_that;
end;
procedure I_dont_know_that_word;
(*============================*)
begin
write_message( 'I don''t know that word!' );
end;
procedure find_me_one;
(*==================*)
var messg : integer;
begin
messg := random(4) + 1;
writeln;
case messg of
1: writeln('Find me one!!');
2: writeln('I don''t see it here!');
3: writeln('I can''t find it here!');
4: writeln('You have to find it first!');
end;
end;
procedure I_dont_have_it;
(*=====================*)
begin
write_message('I don''t have it!!');
end;
procedure I_already_have_it;
(*========================*)
begin
with game_position do
write_message( 'I already have it!!');
end;
procedure I_see_nothing_special;
(*============================*)
begin
write_message('I see nothing special');
end;
procedure I_see_something( object : objects; messg : str25 );
(*=========================================================*)
begin
with game_position do
begin
if object_place[object]=nowhere then
begin
write_message('I see something!!!');
object_place[object] := your_place;
end
else if messg='' then
I_see_nothing_special
else
write_message( messg )
end;
end;
procedure not_yet_but_maybe_later;
(*==============================*)
begin
write_message('Not yet but maybe later!');
end;
procedure sorry_no_money;
(*=====================*)
begin
write_message('Sorry -- no money!!');
end;
function is_here ( obj : objects ) : boolean;
(*=========================================*)
begin
with game_position do
is_here := object_place[obj] = your_place;
end;
function is_carried ( obj : objects ) : boolean;
(*============================================*)
begin
with game_position do
is_carried := object_place[obj] = youhavit;
end;
function you_are_in ( place : places ) : boolean;
(*=============================================*)
begin
with game_position do
you_are_in := your_place = place;
end;
function save_file_name( objnam : word_name_string ) : str25;
(*=========================================================*)
var i : integer;
file_name : str25;
begin
file_name := 'SOFTP' + copy(objnam,1,3);
repeat
i := pos( ' ', file_name );
if i>0 then
delete( file_name, i, 1 );
until i=0;
if file_name='SOFTP' then
file_name := 'SOFTPORN';
save_file_name := file_name + '.SAV';
end;
procedure init_new_game;
(*====================*)
var yesno : char;
place : places;
direction : directions;
i : integer;
begin
clrscr;
cursor_to_bottom;
writeln ('Welcome to SOFTPORN ADVENTURE!!'); newlines(2);
write ( 'Do you need instructions? (y/n) '); read_key( yesno, ['Y','N'] );
if yesno='Y' then
give_help
else
newlines(2);
with game_position do
begin
line_from_kbd := '';
object_place := orig_object_place;
path := orig_path;
for place:=first_place to last_place do
place_visited[place] := false;
your_place := b_bar;
objects_carried := 0;
TV_channel := 0;
money := 10; { $1000 }
score := 0;
rope_in_use := false;
window_broken := false;
toilet_flushed := false;
called_555_0987 := false;
called_555_6969 := false;
called_555_0439 := false;
rubber_worn := false;
hooker_fucked := false;
door_W_open := false;
radio_listened := false;
wine_ordered := false;
telephone_ringing := false;
telephone_answered := false;
hole_peeped := false;
girl_2_fucked := false;
tied_to_bed := false;
drawer_open := false;
closet_open := false;
cabinet_open := false;
doll_inflated := false;
stool_climbed := false;
water_on := false;
pitcher_full := false;
seeds_planted := false;
seeds_watered := false;
apple_given := false;
candy_given := false;
flowers_given := false;
ring_given := false;
married_to_girl := false;
end;
end; { Init new game }
procedure look_around;
(*==================*)
var objcount : integer;
obj : objects;
exits,
exitcount : integer;
exit : directions;
anyexit : boolean;
i,j,
hpos,
namelen : integer;
begin
with game_position do
begin
if not place_visited[your_place] then
write_long_message( integer(your_place)+1 );
if (your_place=p_pntpch) and called_555_0439 then
begin
if not telephone_answered and (random(4)=2) then
telephone_ringing := true;
if telephone_ringing then
write_message('The telephone rings');
end;
place_visited[your_place] := true;
newlines(2);
gotoXY(1,1);
clreol;
writeln( place_name[your_place] );
clreol;
write( 'Items in sight are: ' );
hpos := 23;
objcount := 0;
for obj := first_object to last_object do
begin
if is_here(obj) then
begin
if objcount>0 then
begin
write(', ');
hpos := hpos + 2;
end;
objcount := objcount + 1;
namelen := length(object_name[obj]);
if ( hpos + 3 + namelen ) > 80 then
begin
writeln;
clreol;
write( ' ' );
hpos := 23;
end;
write(object_name[obj]);
hpos := hpos + namelen;
end;
end;
if objcount=0 then
writeln( 'Nothing interesting.')
else
writeln;
clreol;
write( 'Other areas are: ');
exitcount := 0;
for exit := first_direction to last_direction do
if path[your_place,exit] <> nowhere then
exitcount := exitcount + 1;
exits := exitcount;
if exits=0 then
write('By magic!')
else
for exit := first_direction to last_direction do
if path[your_place,exit] <> nowhere then
begin
if exitcount<exits then
begin
if exitcount>1 then
write(', ')
else if exits>1 then
write(' and ');
end;
exitcount := exitcount - 1;
write( direction_name[exit]);
end;
writeln;
clreol;
for i:=1 to 79 do
write('=');
writeln;
clreol;
cursor_next_to_bottom;
end; { with }
end; { look_around }
procedure take_inventory;
(*=====================*)
var objcount : integer;
obj : objects;
begin
with game_position do
begin
writeln;
writeln( 'I''m carrying: ');
objcount := 0;
for obj := first_object to last_object do
begin
if is_carried(obj) then
begin
objcount := objcount + 1;
writeln(object_name[obj]);
end;
end;
if objcount=0 then writeln('Nothing') else writeln;
end;
end; { take_inventory }
procedure replace( object, replacement : str10; target : str120 );
(*==============================================================*)
var i : integer;
begin
if object<>replacement then
repeat
i := pos( object, target );
if i>0 then
begin
delete( target, i, length(object) );
insert( replacement, target, i );
end;
until i=0;
end; { replace }
procedure replace_with_space( object : str10; target : str120 );
(*============================================================*)
begin
replace( object, ' ', target );
end; { replace_with_space }
procedure remove_leading_spaces( var str : str120 );
(*================================================*)
var i : integer;
leading_space : boolean;
begin
repeat
i := length(str);
leading_space := (i>0) and (str[1]=' ');
if leading_space then
delete( str,1,1);
until not leading_space;
end; { remove_leading_spaces }
procedure remove_leading_spaces_and_periods( var str : str120 );
(*============================================================*)
var i : integer;
leading_space_period : boolean;
begin
repeat
i := length(str);
leading_space_period := (i>0) and ( (str[1]=' ') or (str[1]='.') );
if leading_space_period then
delete( str,1,1);
until not leading_space_period;
end; { remove_leading_spaces_and_periods }
procedure remove_trailing_spaces( var str : str120 );
(*=================================================*)
var i : integer;
trailing_space : boolean;
begin
repeat
i := length(str);
trailing_space := (i>0) and (str[1]=' ');
if trailing_space then
delete( str,i,1);
until not trailing_space;
end; { remove_trailing_spaces }
procedure remove_multiple_spaces( var str : str120 );
(*=================================================*)
var i : integer;
begin
repeat
i := pos( ' ', str );
if i>0 then
delete( str, i, 1 );
until i=0;
end; { remove_multiple_spaces }
procedure expand_abbreviations( var str : str120 );
(*===============================================*)
var ch1 : char;
str4 : string[4];
i : integer;
begin
str4 := copy( str+' ', 1, 4 );
for i:=1 to length(str4) do
str4[i] := upcase(str4[i]);
if str4 = 'INVE' then
str := 'I';
if length(str)=1 then
begin
ch1 := upcase(str[1]);
if ch1='I' then str := 'TAKE INVE'
else if ch1='N' then str := 'GO NORT'
else if ch1='S' then str := 'GO SOUT'
else if ch1='E' then str := 'GO EAST'
else if ch1='W' then str := 'GO WEST'
else if ch1='U' then str := 'GO UP'
else if ch1='D' then str := 'GO DOWN'
else if ch1='L' then str := 'LOOK';
end;
end; { expand abbreviations }
procedure add_definite_article_to( var full_noun : str25 );
(*=======================================================*)
begin
if full_noun[1] in vowels then
full_noun := ' an ' + full_noun
else
full_noun := ' a ' + full_noun;
end;
procedure split_up_in_verb_and_noun( command : str120;
var verb, noun : word_name_string;
var full_verb, full_noun : str25 );
(*==================================================*)
const spaces = ' ';
var i, p, k : integer;
glue_word : boolean;
word : word_name_string;
full_word : str25;
begin
verb := spaces;
noun := spaces;
full_verb := '';
full_noun := '';
remove_leading_spaces(command);
for i:=1 to 2 do
begin
repeat
p := pos( ' ', command );
if p=0 then
begin
full_word := command;
command := '';
end
else
begin
full_word := copy ( command, 1, p-1 );
delete( command, 1, p );
remove_leading_spaces(command);
end;
word := full_word + spaces;
for k:=1 to length(word) do
word[k] := upcase(word[k]);
glue_word := false;
for k:=1 to gl_words do
if word=glue_words[k] then
glue_word := true;
until not glue_word;
if i=1 then
begin
verb := word;
full_verb := full_word;
end
else
begin
noun := word;
full_noun := full_word;
end;
end; { for i:=1 to 2 do }
for i:=1 to syn_verbs do
if verb=syn_verb[i].orig then
verb := syn_verb[i].repl;
for i:=1 to syn_nouns do
if noun=syn_noun[i].orig then
noun := syn_noun[i].repl;
end; { split up in verb and noun }
procedure read_and_parse_command( var verb, noun : word_name_string;
var full_verb, full_noun : str25 );
(*=================================================================*)
var i, sppos : integer;
command : str120;
command_ok : boolean;
begin
repeat
if line_from_kbd='' then
begin
repeat
look_around;
repeat
writeln;
write( 'What shall I do? ' );
readln( line_from_kbd );
if line_from_kbd='' then
write_message('Beg pardon?');
until line_from_kbd<>'';
repeat
i := pos( '-', line_from_kbd );
if i>0 then
delete( line_from_kbd, i, 1 );
until i=0;
for i := 1 to length(line_from_kbd) do
begin
if line_from_kbd[i] in [ '!', '?', ',' ] then
line_from_kbd[i] := '.'
else if line_from_kbd[i] in [ '!'..'-', '/', ':'..'?' ] then
line_from_kbd[i] := ' ';
end;
remove_leading_spaces_and_periods(line_from_kbd);
remove_trailing_spaces(line_from_kbd);
remove_multiple_spaces(line_from_kbd);
if line_from_kbd=' ' then
line_from_kbd := '';
if line_from_kbd='' then
I_cant_do_that;
until line_from_kbd<>'';
end;
i := pos( '.', line_from_kbd );
if i>0 then
begin
command := copy( line_from_kbd, 1, i-1 );
delete( line_from_kbd, 1, i );
remove_leading_spaces_and_periods( line_from_kbd );
remove_trailing_spaces( command );
end
else
begin
command := line_from_kbd;
line_from_kbd := '';
end;
expand_abbreviations(command);
repeat
i := pos( '555', command );
if i>0 then
delete( command, i, 3 );
until i=0;
split_up_in_verb_and_noun( command, verb, noun, full_verb, full_noun );
command_ok := verb <> ' ';
if noun='LADY' then
begin
write_message('That''s no Lady!!! That''s my sister!!!!');
command_ok := false;
end
else if verb='SAY ' then
begin
write_message('OK');
writeln( copy( command, 5, 120 ) );
command_ok := false;
end
else if (verb='TKAE') or (verb='TAEK') then
begin
write_message('Learn to spell, idiot!!!');
command_ok := false;
end;
until command_ok;
end; { read_and_parse_command }