forked from historicalsource/softporn
-
Notifications
You must be signed in to change notification settings - Fork 1
/
softporn-2.inc.pas
563 lines (510 loc) · 12.9 KB
/
softporn-2.inc.pas
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
{ Softporn Adventure, include file # 2 }
function locase( c : char ) : char;
(*===============================*)
begin
case c of
'A'..'Z': c := chr( ord(c) + $20 );
#$8F: c := #$86;
#$8E: c := #$84;
#$99: c := #$94;
{ '': c := '†';
'Ž': c := '„';
'™': c := '”'; }
end;
locase := c;
end;
procedure read_key ( var ch : char; cset : set_of_char );
(*=====================================================*)
var ch_up : char;
begin
repeat
ch := ReadKey(); { from unit keyboard }
ch_up := upcase(ch);
if ch_up in cset then
writeln( ch )
else
write(#7);
until ch_up in cset;
ch := ch_up;
end; { Read key }
procedure write_long_messg( messg_no : integer );
(*=============================================*)
const EOL = #$0D;
NULL = #0;
var i : integer;
c : char;
begin
seek( messg_file, messg_no-1 );
read( messg_file, messg_rec );
for i:=1 to recsize-1 do
begin
c := messg_rec[i];
if c=EOL then
writeln
else if c>=' ' then
begin
write(pred(c));
if messg_no in [39,58,69] then
delay(150);
end;
end; { for i=1 to recsize-1 do }
end; { Write long messg }
procedure write_long_message( messg_no : integer );
(*===============================================*)
begin
{ $ifndef omit_extra_newlines}
writeln;
{ $endif}
write_long_messg( messg_no );
end; { Write long message }
procedure write_message( message : messg_string );
(*==============================================*)
begin
{ $ifndef omit_extra_newlines}
writeln;
{ $endif}
writeln(message);
end;
procedure wait_for_space;
(*=====================*)
var c : char;
begin
c := 'x';
write(' Press <SPACE> to continue ');
repeat
c := ReadKey();
if c<>' ' then write(#7);
until c=' ';
end;
procedure cursor_to_bottom;
(*=======================*)
begin
gotoXY(1,bottom_line);
end;
procedure cursor_next_to_bottom;
(*============================*)
begin
gotoXY(1,bottom_line-1);
end;
procedure give_help;
(*================*)
var message : integer;
begin
clrscr;
writeln;
writeln;
for message:=70 to 72 do
write_long_messg( message );
writeln;
wait_for_space;
clrscr;
cursor_to_bottom;
end;
procedure look_graffiti;
(*====================*)
var message : integer;
begin
clrscr;
for message:=59 to 62 do
begin
write_long_messg( message );
end;
wait_for_space;
clrscr;
cursor_to_bottom;
end; { Look graffiti }
procedure purgatory;
(*================*)
var choice, door : integer;
c : char;
begin
delay(700);
door := 0;
repeat
if door=0 then
write_long_message( 65 )
else
begin
writeln;
writeln('You''re still here!');
writeln;
end;
write('Choose your door: 1, 2 or 3?? ');
read_key( c, ['1'..'3'] );
choice := ord(c) - ord('0');
door := ( random(3) + choice ) mod 3;
game_position.game_ended := door=1;
until door<>2;
end; { Purgatory }
procedure bum_tells_story;
(*======================*)
var i,j : integer;
begin
writeln;
writeln('He looks at me and starts to speak:');
delay(400);
write_long_message( 39 );
writeln;
delay(300);
for i:=0 to 128 do
begin
for j:=1 to i do
write(' ');
writeln('Like I did!!');
end;
for i:=1 to 5 do
writeln;
delay(500);
writeln('He throws up and gives me back the bottle of wine.');
writeln;
end; { Bum tells story }
procedure watch_TV ( var TV_channel : integer );
(*============================================*)
var ch : char;
begin
repeat
write('Which channel? (1-9) ');
read_key( ch, ['1'..'9'] );
TV_channel := ord(ch) - ord('0');
write_long_message( 40 + TV_channel );
writeln;
write('Change the channel? (y/n) ');
read_key( ch, ['Y','N'] );
until ch='N';
end; { Watch TV }
procedure wine_in_taxi;
(*===================*)
begin
write_long_message( 58 );
delay(500);
writeln;
write('What shall I do? ');
delay(1000);
writeln;
writeln;
writeln('The idiot cab driver backs over me and kills me!!!!!!');
purgatory;
end; { Wine in taxi }
procedure stab_someone;
(*===================*)
begin
writeln;
writeln('OK - warmonger!');
delay(1000);
writeln('Parry!!');
delay(500);
writeln('Thrust!!!');
delay(1000);
writeln('I just got myself!!');
purgatory;
end; { Stab }
procedure falling_down;
(*===================*)
var i : integer;
begin
for i:=1 to 50 do
writeln('Aaaaaeeeeeiiiiiiii!!!!!!!!');
delay(300);
writeln('Splaaatttttt!!!!!');
if game_position.verb<>jump then
begin
delay(500);
writeln;
writeln('I should have used safety rope!!!!!!!!');
end;
purgatory;
end; { Falling down }
procedure play_slot( var money : integer );
(*=======================================*)
const slot : array[0..4] of char = ( '!', '#', '*', '$', '^' );
slot_figs = 5;
var answer : char;
i, x1, x2, x3 : integer;
begin
writeln;
writeln('This will cost $100 each time');
repeat
randomize;
write('You have $',money,'00. Would you like to play? (y/n) ');
read_key( answer, ['Y','N'] );
if answer='Y' then
begin
for i:=1 to 30 do
begin
x1 := random(slot_figs);
x2 := random(slot_figs);
x3 := random(slot_figs);
delay(30);
write( #13, slot[x1]:1, slot[x2]:5, slot[x3]:5 );
end;
writeln;
if (x1=x2) and (x2=x3) then
begin
writeln('Triples!!!!!! You win $1500');
money := money + 15;
end
else if (x1=x2) or (x2=x3) or (x3=x1) then
begin
writeln('A pair! You win $300');
money := money + 3;
end
else
begin
writeln('You lose!');
money := money - 1;
end;
end;
until (money<1) or (answer='N');
writeln;
if money<1 then
begin
writeln('I''m broke!!! -- that means death!!!!!!!');
purgatory;
end;
end; { Play slot }
procedure play_21( var money : integer );
(*=====================================*)
const card_name : array[1..13] of string[7]
= ( 'an Ace', 'a 2', 'a 3', 'a 4', 'a 5', 'a 6', 'a 7',
'an 8', 'a 9', 'a 10', 'a Jack', 'a Queen', 'a King' );
delay_21 = 400;
var answer : char;
dollars, code, mi, md, yd, ym, ad, am, a, y, z, ac, i : integer;
answer_ok, game_over : boolean;
dollar_string, doll_00 : string[20];
card : string[7];
procedure deal_card;
(*----------------*)
begin
z := random(13) + 1;
y := 0;
ac := 0;
card := card_name[z];
if z>10 then z := 10;
if z=1 then z := 11;
if z>9 then y := 1;
if z=11 then ac := 1;
end;
procedure check;
(*------------*)
begin
if (md>21) and (ad>0) then
begin
ad := ad - 1;
md := md - 10;
end;
delay(delay_21);
writeln('The dealer has ',md);
if md<17 then
a := 6
else if (md>21) or (mi>md) then
begin
delay(delay_21);
writeln('You win!!');
money := money + dollars;
game_over := true;
end
else if mi<md then
begin
delay(delay_21);
writeln('You lose!');
money := money - dollars;
game_over := true;
end
else {if mi=md then}
begin
delay(delay_21);
writeln('Tie!');
game_over := true;
end;
end;
procedure check_hit;
(*----------------*)
begin
if (mi>21) and (am>0) then
begin
am := am - 1;
mi := mi - 10;
end;
delay(delay_21);
writeln('Your total is ',mi,'.');
if mi>21 then
begin
delay(delay_21);
writeln('Busted!');
money := money - dollars;
game_over := true;
end
else if (ym=2) and (mi=21) then
begin
delay(delay_21);
writeln('You''ve got a ***BLACKJACK***');
money := money + dollars + dollars;
game_over := true;
end
else if (yd=2) and (md=21) then
begin
delay(delay_21);
writeln('The dealer has a ***BLACKJACK***');
money := money - dollars;
game_over := true;
end
else
begin
delay(delay_21);
write('Would you like a hit? (y/n) ');
read_key( answer, ['Y','N']);
if answer='N' then check;
end;
end;
begin
writeln;
repeat
randomize;
mi := 0;
md := 0;
yd := 0;
ym := 0;
ad := 0;
am := 0;
repeat
answer_ok := false;
write('You have $',money,'00. How many dollars would you like to bet? ');
readln(dollar_string);
repeat
i := pos( ' ', dollar_string);
if i>0 then delete( dollar_string, i, 1 );
until i=0;
i := length(dollar_string);
if i>2 then
begin
doll_00 := copy( dollar_string, i-1, 2 );
delete( dollar_string, i-1, 2 );
end
else
begin
doll_00 := dollar_string;
dollar_string := '';
end;
val( doll_00, dollars, code );
if code=0 then val( dollar_string, dollars, code );
if (code<>0) or (dollars<=0) then
writeln('Huh?')
else if doll_00 <> '00' then
writeln('$100 increments only!!')
else if dollars > money then
writeln('You don''t have that much!!!')
else
answer_ok := true;
until answer_ok;
a := 1;
game_over := false;
repeat
deal_card;
delay(delay_21);
case a of
1,3 : begin
mi := mi + z;
writeln('You''re dealt ',card);
ym := ym + y;
am := am + ac;
a := a + 1;
end;
2 : begin
md := md + z;
writeln('The dealer gets a card down');
yd := yd + y;
ad := ad + ac;
a := a + 1;
end;
4 : begin
md := md + z;
writeln('The dealer gets ',card);
a := 5;
ad := ad + ac;
yd := yd + y;
check_hit;
end;
5 : begin
mi := mi + z;
writeln('You get ',card);
am := am + ac;
check_hit;
end;
6 : begin
md := md + z;
writeln('The dealer gets ',card);
ad := ad + ac;
check;
end;
end;
until game_over;
if money<1 then
begin
writeln('You''re out of money!!! So long!!!!!!!!!!');
purgatory;
end
else
begin
write('Play again?? (y/n) ');
read_key( answer, ['Y','N'] );
end;
until (answer='N') or (money<1);
end; { Play 21 }
procedure buy_rubber;
(*=================*)
var answer : char;
i : integer;
begin
with game_position do
begin
rubber_lubricated := 'non-lubricated';
rubber_ribbed := 'non-ribbed';
writeln;
writeln('The man leans over the counter and whispers:');
write('What color? '); readln(rubber_color);
for i:=1 to length(rubber_color) do
rubber_color[i] := locase(rubber_color[i]);
write('And for a flavor? '); readln(rubber_flavor);
for i:=1 to length(rubber_flavor) do
rubber_flavor[i] := locase(rubber_flavor[i]);
write('Lubricated or not? (y/n) ');
read_key( answer, ['Y','N'] );
if answer='Y' then delete( rubber_lubricated, 1, 4 );
write('Ribbed? (y/n) ');
read_key( answer, ['Y','N'] );
if answer='Y' then delete( rubber_ribbed, 1, 4 );
writeln('He yells -- This pervert just bought a ',rubber_color,', ');
writeln(rubber_flavor,'-flavored, ',rubber_lubricated,', ',
rubber_ribbed,' rubber!!!!');
writeln('A lady walks by and looks at me in disgust!!!!');
writeln;
end;
end; { Buy rubber }
procedure OK;
(*=========*)
begin
write_message('OK');
end;
procedure _open( var object_open : boolean );
(*=========================================*)
begin
if object_open then
write_message('It''s already open!!')
else
begin
OK;
object_open := true;
end;
end;
procedure _close( var object_open : boolean );
(*=========================================*)
begin
if not object_open then
write_message('It''s already closed!!')
else
begin
OK;
object_open := false;
end;
end;