-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathtipa.c
645 lines (552 loc) · 20.8 KB
/
tipa.c
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
639
640
641
642
643
644
645
// Tabboz Simulator
// (C) Copyright 1997-2000 by Andrea Bonomi
// 31 Maggio 1999 - Conversione Tabbozzo -> Tabbozza
/*
This file is part of Tabboz Simulator.
Tabboz Simulator is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Tabboz Simulator is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tabboz Simulator. If not, see <http://www.gnu.org/licenses/>.
*/
#include "os.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "zarrosim.h"
static char sccsid[] = "@(#)" __FILE__ " " VERSION " (Andrea Bonomi) " __DATE__;
static int spostamento;
static char descrizione[30];
int figTemp;
char nomeTemp[30];
HWND tipahDlg; // Serve per BMPTipaWndProc (in Tabimg.c )
BOOL FAR PASCAL CercaTipa(HWND hDlg, WORD message, WORD wParam, LONG lParam);
BOOL FAR PASCAL DueDiPicche(HWND hDlg, WORD message, WORD wParam, LONG lParam);
void DescrizioneTipa(int f);
void DescrizioneTipo(int f);
long FAR PASCAL BMPTipaWndProc(HWND hWnd, WORD msg,
WORD wParam, LONG lParam);
// ------------------------------------------------------------------------------------------
// Tipa...
// ------------------------------------------------------------------------------------------
#pragma argsused
BOOL FAR PASCAL Tipa(HWND hDlg, WORD message, WORD wParam, LONG lParam)
{
char buf[128];
char tmp[128];
FARPROC lpproc;
int lasciaoraddoppia;
switch (message)
{
case WM_INITDIALOG:
if (sesso == 'M')
spostamento = 0;
else
spostamento = 100;
AggiornaTipa(hDlg);
tipahDlg = hDlg;
return (TRUE);
case WM_COMMAND:
switch (wParam)
{
case 110: // Cerca tipa
lpproc = MakeProcInstance(CercaTipa, hInst);
DialogBox(hInst,
MAKEINTRESOURCE(CERCATIPA + spostamento),
hDlg,
lpproc);
FreeProcInstance(lpproc);
AggiornaTipa(hDlg);
return (TRUE);
case 111: // Lascia tipa
if (Rapporti <= 0)
{
if (sesso == 'M')
MessageBox(hDlg,
"Scusa, che ragazza avresti intenzione di lasciare ???",
"Lascia Tipa", MB_OK | MB_ICONINFORMATION);
else
MessageBox(hDlg,
"Scusa, che tipo avresti intenzione di lasciare, visto che sei sola come un cane ???",
"Lascia Tipo", MB_OK | MB_ICONINFORMATION);
return (TRUE);
}
sprintf(tmp, "Sei proprio sicuro di voler lasciare %s ?", Nometipa);
if (sesso == 'M')
lasciaoraddoppia = MessageBox(hDlg,
tmp,
"Lascia tipa", MB_YESNO | MB_ICONQUESTION);
else
lasciaoraddoppia = MessageBox(hDlg,
tmp,
"Molla tipo", MB_YESNO | MB_ICONQUESTION);
if (lasciaoraddoppia == IDYES)
{
if (sound_active)
TabbozPlaySound(603);
Rapporti = 0;
if ((FigTipa >= 79) && (sesso == 'M'))
{
MessageBox(hDlg,
"Appena vengono a sapere quello che hai fatto, i tuoi amici ti prendono a scarpate.\nQualcuno, piu' furbo di te, va a consolarla...",
"Idiota...", MB_OK | MB_ICONINFORMATION);
Reputazione -= 8;
if (Reputazione < 0)
Reputazione = 0;
}
if ((FigTipa <= 40) && (sesso == 'M'))
{
Reputazione += 4;
if (Reputazione > 100)
Reputazione = 100;
}
Evento(hDlg);
}
AggiornaTipa(hDlg);
return (TRUE);
case 112:
if (Rapporti <= 0)
{
if (sesso == 'M')
MessageBox(hDlg,
"Scusa, che ragazza vorresti chiamare ???",
"Non sei molto intelligente...", MB_OK | MB_ICONINFORMATION);
else
MessageBox(hDlg,
"Scusa, che ragazzo vorresti chiamare, visto che sei sola ???",
"Non sei molto intelligente...", MB_OK | MB_ICONINFORMATION);
return (TRUE);
}
if ((Soldi <= 5) && ((AbbonamentData.creditorest < 2) && (CellularData.stato < 0)))
{
MessageBox(hDlg,
""
"Sei fai ancora una telefonata, ti spezzo le gambe"
", disse tuo padre con un accetta in mano...",
"Non toccare quel telefono...", MB_OK | MB_ICONSTOP);
}
else
{
if (sound_active)
TabbozPlaySound(602);
// 5 Maggio 1999 - Telefono di casa o telefonino ???
if ((AbbonamentData.creditorest >= 2) && (CellularData.stato > -1))
AbbonamentData.creditorest -= 2;
else
Soldi -= 5;
#ifdef TABBOZ_DEBUG
sprintf(tmp, "tipa: Telefona alla tipa//o (%s)", MostraSoldi(5));
writelog(tmp);
#endif
if (Rapporti <= 60)
Rapporti++;
}
AggiornaTipa(hDlg);
return (TRUE);
case 113:
if (Rapporti <= 0)
{
if (sesso == 'M')
MessageBox(hDlg,
"Scusa, con che tipa vorresti uscire ???",
"Non sei molto intelligente...", MB_OK | MB_ICONINFORMATION);
else
MessageBox(hDlg,
"Scusa, ma con chi vorresti uscire, ???",
"Non sei molto intelligente...", MB_OK | MB_ICONINFORMATION);
return (TRUE);
}
if ((ScooterData.stato <= 0) && (sesso == 'M'))
{
MessageBox(hDlg,
"Finche' non comprerai lo scooter, non usciremo piu' insieme...",
"Compra lo scooter", MB_OK | MB_ICONSTOP);
return (TRUE);
}
if ((ScooterData.attivita != 1) && (sesso == 'M'))
{
sprintf(buf, "Finche' il tuo scooter restera' %s non potremo uscire insieme...", n_attivita[ScooterData.attivita]);
MessageBox(hDlg, buf, "Risistema la scooter", MB_OK | MB_ICONINFORMATION);
return (TRUE);
}
if ((ScooterData.stato <= 35) && (sesso == 'M'))
{
MessageBox(hDlg,
"Finche' non riparerai lo scooter, non usciremo piu' insieme...",
"Ripara lo scooter", MB_OK | MB_ICONSTOP);
return (TRUE);
}
if (Soldi < 15)
{
if (sesso == 'M')
MessageBox(hDlg,
"Se mi vuoi portare fuori, cerca di avere almeno un po' di soldi...",
"Sei povero", MB_OK | MB_ICONSTOP);
else
MessageBox(hDlg,
"Oh tipa... cioe' non posso pagare sempre tutto io, cioe' ohhhh...",
"Che palle", MB_OK | MB_ICONSTOP);
return (TRUE);
}
Soldi -= 15;
#ifdef TABBOZ_DEBUG
sprintf(tmp, "tipa: Esci con la tipa/o (%s)", MostraSoldi(15));
writelog(tmp);
#endif
Rapporti += 5;
if (Rapporti > 100)
Rapporti = 100;
if (FigTipa > Fama)
Fama++;
if (Fama > 100)
Fama = 100;
benzina -= 3;
if (benzina < 1)
benzina = 0;
CalcolaVelocita(hDlg);
AggiornaTipa(hDlg);
return (TRUE);
#ifdef TABBOZ_EM
case 130:
BMPTipaWndProc(hDlg, WM_LBUTTONDOWN, wParam, lParam);
break;
#endif
case IDCANCEL:
case IDOK:
tipahDlg = 0; // Non si sa' mai...
EndDialog(hDlg, TRUE);
return (TRUE);
default:
return (TRUE);
}
}
return (FALSE);
}
// ------------------------------------------------------------------------------------------
// Due Donne - 22 Aprile 1999
// ------------------------------------------------------------------------------------------
#pragma argsused
BOOL FAR PASCAL DueDonne(HWND hDlg, WORD message, WORD wParam, LONG lParam)
{
char tmp[255];
if (message == WM_INITDIALOG)
{
sprintf(tmp, "Resto con %s", Nometipa);
SetDlgItemText(hDlg, 2, tmp);
if (!strcmp(Nometipa, nomeTemp))
{ // Se le tipe si chiamano tutte e due con lo stesso nome
if (sesso == 'M')
sprintf(tmp, "Preferisco quella nuova");
else
sprintf(tmp, "Preferisco quello nuovo");
}
else
sprintf(tmp, "Preferisco %s", nomeTemp);
SetDlgItemText(hDlg, 102, tmp);
return (TRUE);
}
else if (message == WM_COMMAND)
{
switch (wParam)
{
case 101: // Ottima scelta...
if (sesso == 'M')
sprintf(tmp, "Mentre sei appartato con la %s, arriva la tua ragazza, %s, ti tira uno schiaffo e ti lascia.\
Capendo finalmente di che pasta sei fatto, anche la %s si allontana...",
nomeTemp, Nometipa, nomeTemp);
else
sprintf(tmp, "%s viene a sapere che di %s, gli spacca la faccia e ti molla...\
Dopo questa tragica esperienza anche %s sparisce...",
Nometipa, nomeTemp, nomeTemp);
Rapporti = 0;
Reputazione -= 8;
if (Reputazione < 0)
Reputazione = 0;
Fama -= 4;
if (Fama < 0)
Fama = 0;
MessageBox(hDlg,
tmp,
"La vita e' bella", MB_OK | MB_ICONSTOP);
EndDialog(hDlg, TRUE);
return (TRUE);
case 102: // Preferisci quella nuova...
sprintf(Nometipa, "%s", nomeTemp);
FigTipa = figTemp;
Rapporti = 30 + random(15);
Fama += FigTipa / 10;
if (Fama > 100)
Fama = 100;
Reputazione += FigTipa / 13;
if (Reputazione > 100)
Reputazione = 100;
EndDialog(hDlg, TRUE);
return (TRUE);
case IDCANCEL: // Resti con la tua vecchia ragazza, bravo...
default:
EndDialog(hDlg, TRUE);
return (TRUE);
}
}
return (FALSE);
}
// ------------------------------------------------------------------------------------------
// Cerca Tipa
// ------------------------------------------------------------------------------------------
#pragma argsused
BOOL FAR PASCAL CercaTipa(HWND hDlg, WORD message, WORD wParam, LONG lParam)
{
char tmp[255];
static int i;
if (message == WM_INITDIALOG)
{
figTemp = random(71) + 30; // 30 -> 100
if (sesso == 'M')
{
DescrizioneTipa(figTemp);
i = 200 + random(20); // 200 -> 219 [nomi tipe]
}
else
{
DescrizioneTipo(figTemp);
i = 1200 + random(20); // 1200 -> 1219 [nomi tipi]
}
SetDlgItemText(hDlg, 107, descrizione);
LoadString(hInst, i, (LPSTR)nomeTemp, 30);
sprintf(tmp, "%s", nomeTemp);
SetDlgItemText(hDlg, 105, tmp);
sprintf(tmp, "%d/100", figTemp);
SetDlgItemText(hDlg, 106, tmp);
return (TRUE);
}
else if (message == WM_COMMAND)
{
switch (wParam)
{
case IDCANCEL:
EndDialog(hDlg, TRUE);
return (TRUE);
case 101:
// Calcola se ce la fa o meno con la tipa... ------------------------------------
if (((figTemp * 2) + random(50)) <= (Fama + Reputazione + random(30)))
{
// E' andata bene... ----------------------------------------------------
if (sesso == 'M')
MessageBox(hDlg,
"Con il tuo fascino nascosto da tabbozzo, seduci la tipa e ti ci metti insieme.",
"E' andata bene !", MB_OK | MB_ICONINFORMATION);
else
MessageBox(hDlg,
"Ora non ti puoi piu' lamentare di essere sola...",
"Qualcono ti caga...", MB_OK | MB_ICONINFORMATION);
// ...ma comunque controlla che tu non abbia gia' una tipa -------------------------
if (Rapporti > 0)
{ // hai gia' una tipa..
FARPROC lpproc = MakeProcInstance(DueDonne, hInst);
DialogBox(hInst,
MAKEINTRESOURCE(92 + spostamento),
hDlg,
lpproc);
FreeProcInstance(lpproc);
}
else
{ // bravo, no hai una tipa...
sprintf(Nometipa, "%s", nomeTemp);
FigTipa = figTemp;
Rapporti = 30 + random(15);
Fama += FigTipa / 10;
if (Fama > 100)
Fama = 100;
Reputazione += FigTipa / 13;
if (Reputazione > 100)
Reputazione = 100;
}
}
else
{
FARPROC lpproc;
// 2 di picche... -------------------------------------------------------
if (sound_active)
TabbozPlaySound(601);
lpproc = MakeProcInstance(DueDiPicche, hInst);
DialogBox(hInst,
MAKEINTRESOURCE(95),
hDlg,
lpproc);
FreeProcInstance(lpproc);
}
Evento(hDlg);
EndDialog(hDlg, TRUE);
return (TRUE);
default:
return (TRUE);
}
}
return (FALSE);
}
// ------------------------------------------------------------------------------------------
// Abbina una descrizione(breve) alla figosita' di una tipa.
// ------------------------------------------------------------------------------------------
void DescrizioneTipa(int f)
{
char buf[30];
if (f > 97)
sprintf(buf, "Ultramegafiga");
else if (f > 90)
sprintf(buf, "Fighissima");
else if (f > 83)
sprintf(buf, "Molto figa");
else if (f > 72)
sprintf(buf, "Figa");
else if (f > 67)
sprintf(buf, "Abbastanza Figa");
else if (f > 55)
sprintf(buf, "Interessante");
else if (f > 45)
sprintf(buf, "Passabile");
else if (f > 35)
sprintf(buf, "Puo' piacere..");
else
sprintf(buf, "E' un tipo...");
strncpy(descrizione, buf, sizeof(buf));
}
// ------------------------------------------------------------------------------------------
// Abbina una descrizione(breve) alla figosita' di un tipo.
// ------------------------------------------------------------------------------------------
void DescrizioneTipo(int f)
{
char buf[30];
if (f > 97)
sprintf(buf, "Ultramegafigo");
else if (f > 90)
sprintf(buf, "Bellissimo");
else if (f > 83)
sprintf(buf, "Molto figo");
else if (f > 72)
sprintf(buf, "Bello");
else if (f > 67)
sprintf(buf, "Abbastanza Figo");
else if (f > 55)
sprintf(buf, "Interessante");
else if (f > 45)
sprintf(buf, "Passabile");
else if (f > 35)
sprintf(buf, "Puo' piacere..");
else
sprintf(buf, "Inutile...");
strncpy(descrizione, buf, sizeof(buf));
}
// ------------------------------------------------------------------------------------------
// 2 di picche (la vita e' bella...)
// ------------------------------------------------------------------------------------------
#pragma argsused
BOOL FAR PASCAL DueDiPicche(HWND hDlg, WORD message, WORD wParam, LONG lParam)
{
char tmp[1024];
static int i;
if (message == WM_INITDIALOG)
{ // un giorno fortunato...
DDP++; // log due di picche...
Reputazione -= 2; // decremento reputazione
if (Reputazione < 0)
Reputazione = 0;
Fama -= 2; // decremento figosita'
if (Fama < 0)
Fama = 0;
// IN QUESTA PARTE C'ERA UN BUG CHE FACEVA CRASCIARE IL TABBOZ SIMULATOR...
if (sesso == 'M')
i = 300 + random(20); // 300 -> 319 [sfighe varie]
else
i = 1300 + random(20); // 300 -> 319 [sfighe varie]
LoadString(hInst, i, (LPSTR)tmp, 1024);
SetDlgItemText(hDlg, 105, tmp);
i = 0;
return (TRUE);
}
else if (message == WM_COMMAND)
{
switch (wParam)
{
case 201:
i++;
if (i > 5)
{
sprintf(tmp, "Fino ad ora hai preso %lu due di picche !\nNon ti preoccupare, capita a tutti di prendere qualche due di picche nella vita ...", DDP);
MessageBox(hDlg,
tmp, "La vita e' bella...", MB_OK | MB_ICONINFORMATION);
i = 0;
}
return (TRUE);
case IDCANCEL:
case IDOK:
EndDialog(hDlg, TRUE);
return (TRUE);
default:
return (TRUE);
}
}
return (FALSE);
}
// ------------------------------------------------------------------------------------------
// AggiornaTipa
// ------------------------------------------------------------------------------------------
void AggiornaTipa(HWND hDlg)
{
char tmp[128];
if (Rapporti == 0)
{
if (sesso == 'M')
SetDlgItemText(hDlg, 101, "Cerca Tipa");
SetDlgItemText(hDlg, 101, "Cerca Tipo");
sprintf(tmp, "");
SetDlgItemText(hDlg, 105, tmp);
SetDlgItemText(hDlg, 106, tmp);
SetDlgItemText(hDlg, 107, tmp);
}
else
{
if (sesso == 'M')
SetDlgItemText(hDlg, 101, "Cerca Nuova Tipa");
else
SetDlgItemText(hDlg, 101, "Cerca Nuovo Tipo");
sprintf(tmp, "%s", Nometipa);
SetDlgItemText(hDlg, 105, tmp);
sprintf(tmp, "%d", FigTipa);
SetDlgItemText(hDlg, 106, tmp);
sprintf(tmp, "%d/100", Rapporti);
SetDlgItemText(hDlg, 107, tmp);
}
sprintf(tmp, "%d/100", Fama);
SetDlgItemText(hDlg, 104, tmp);
}
// ------------------------------------------------------------------------------------------
// 4 gennaio 1999
// ------------------------------------------------------------------------------------------
#pragma argsused
BOOL FAR PASCAL MostraSalutieBaci(HWND hDlg, WORD message, WORD wParam, LONG lParam)
{
if (message == WM_INITDIALOG)
{
return (TRUE);
}
else if (message == WM_COMMAND)
{
switch (wParam)
{
case 205:
case IDOK:
case IDCANCEL:
EndDialog(hDlg, TRUE);
return (TRUE);
default:
return (TRUE);
}
}
return (FALSE);
}