-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmonspls5.h
5070 lines (3790 loc) · 131 KB
/
monspls5.h
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
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "crawlfnc.h"
#include "fn2.h"
#include "monsstat.h"
#include "fn3.h"
#include "fn4.h"
#include "builder2.h"
#include "invent.h"
/*#include "\borlandc\crawl\crawlfnc.h"
#include "\borlandc\crawl\fn2.h"
#include "\borlandc\crawl\monsstat.h"
#include "\borlandc\crawl\fn3.h"
#include "fn4.h"*/
//void mons_place(void);
int mons_place(int typed, int type_place, int px, int py, char behaviour, int hitting);
//void Wcheck(void);
void monster_attack(int monster_attacking);
char monsters_fight(int monster_attacking, int monster_attacked);
void you_attack(int monster_attacked);
void monster_die(int monster_killed);
void level_change(void);
void lose_level(void);
char *monam(unsigned char mons_sc, int mons_cla, char mons_e, char desc);
char mons_near(unsigned char monst);
char empty_surrounds(int emx, int emy);
void incr(void);
void mesclr(void);
void relay_message(void);
void ouch(int dam, char death_source, char death_type);
int which_cloud(char cx, char cy);
void in_a_cloud(void);
void end_game(char end_status);
void splash_with_acid(char acid_strength);
void weapon_acid(char acid_strength);
void item_corrode(char itco);
char see_grid(unsigned char grx, unsigned char gry);
void monster_polymorph(unsigned char mons, unsigned char targetc, int power);
void monster_drop_ething(int monster_killed);
int jelly_divide(int jel);
void alert(void);
int mons_ench_f2(int o, char is_near, int func_pass [10]);
void poison_monster(int mn, char source); // 0 is you, 1 is something else
char curse_an_item(char which, char power);
void monster_blink(int mn);
char random_near_space(int passed [2]);
void unwield_item(char unw);
void unwear_armour(char unw);
char create_monster(int cls, int dur, int beha, int cr_x, int cr_y);
void swap_places(int swap);
int distance(int x1, int x2, int y1, int y2);
//void place_cloud(void);
void place_cloud(unsigned char cl_type, unsigned char ctarget_x, unsigned char ctarget_y, unsigned char cl_range);
void scrolls_burn(char burn_strength, char target_class);
void alert2(void);
char detect_traps(void);
char you_resist_magic(int power);
void forget_map(void);
void how_hungered(int hunge);
/*
// Character attributes:
int hp = 10; int hp_ch = 1;
int hp_max = 10; int hp_max_ch = 1;
int ep = 3; int ep_ch = 1;
int ep_max = 5; int ep_max_ch = 1;
unsigned int strength = 16; int strength_ch = 1;
unsigned int intel = 13; int intel_ch = 1;
unsigned int dex = 11; int dex_ch = 1;
int AC = 0; int AC_ch = 1; // remember that the AC shown = 10 - AC
int evasion = 10; int evasion_ch = 1;
int damage = 3; int damage_ch = 1; // remember to change damage back to 1!
int nat_damage = 3; // the damage you do unarmed
float rate_regen = 0.06; float incr_regen = 0;
int xp = 0; int xp_ch = 1;
int xl = 1; int xl_ch = 1;
int gp = 0; int gp_ch = 1;
int clas;
*/
int ogo = 0;
void get_monster(void)
{
define_monster(mons_class, mons_hp, mons_hp_max, mons_HD, mons_AC, mons_ev,
mons_speed, mons_speed_inc, mons_sec, k);
/*
mons_HD [k] = mons_define(mons_class [k], 0, mons_sec [k]);
mons_hp [k] = mons_define(mons_class [k], 1, mons_sec [k]);
//mons_hp_max [k] = mons_define(mons_class [k], 2); // can be different initially
mons_hp_max [k] = mons_hp [k];
mons_AC [k] = mons_define(mons_class [k], 3, mons_sec [k]);
mons_ev [k] = mons_define(mons_class [k], 4, mons_sec [k]);
mons_speed [k] = mons_define(mons_class [k], 5, mons_sec [k]);
mons_speed_inc [k] = mons_define(mons_class [k], 6, mons_sec [k]);
mons_sec [k] = mons_define(mons_class [k], 7, mons_sec [k]);
//mons_HD [k] = mons_define(mons_class [k], 0);
*/
}
int mons_place(int typed, int type_place, int px, int py, char behaviour, int hitting)
{
int passed [2];
passed [0] = 0; // DO t worms!!!!!!!!!!!!!!!! plus mention numbered dropping/getting in docs
passed [1] = 0;
char bands = 1;
if (char_direction == 1 && typed == 250)
{
typed = 80 + random2(6);
if (random2(5) == 0) typed = 3;
if (random2(5) == 0) typed = 73;
}
if (typed != 250) bands = 0;
if (no_mons == MNST - 1) return 0;
int glokp = place_monster(mons_class,
mons_hp,
mons_hp_max,
mons_HD,
mons_AC,
mons_ev,
mons_speed,
mons_speed_inc,
mons_inv,
mons_sec,
mons_ench_1,
mons_ench,
mons_hit,
mons_beh,
it_no,
item_ident,
item_class,
unique_items,
item_type,
item_plus,
item_dam,
item_quant,
item_x,
item_y,
icolour,
1, // xtra_quant
item_link,
item_description,
property,
mons_x,
mons_y,
0, //plus_seventy,
typed, //250, // typed,
type_place, //0, //type_place,
px, //1, //px,
py, //1, //py,
behaviour, //0, //behaviour,
hitting, //MHITNOT, //hitting,
bands,//1,//1,//allow_bands
gmon_use,
grid,
mons_alloc,
passed,
igrid,
x_pos,
y_pos
);
no_mons += glokp;
mn_no += glokp;
if (glokp > 0) return passed [0];
else return -1;
//return glokp;
int passout = 0;
int worm = 0;
int pets = 0;
int grid_ok = 17;
//m_all(mons_alloc, curr_level);
// maybe put mons_alloc tables into the level save file so they can be
// tailored for specific levels.
k = 0;
do
{
k ++;
} while (mons_class [k] != -1 && k < 182);
if (k >= 180) return -1;
//return -1;
// Eliminate that nasty pointer problem by passing a string to those
// functions and getting them to fill it in without returning anything!
if (typed == 250)
{
monster_cla : mons_class [k] = mons_alloc [random2(20)];
if (type_place == 1 && mons_class [k] == 19) goto monster_cla;
// can't summon t; shouldn't summon d, F, i?, q? or &
//mons_sec [k] = 250;
mons_class [k] = random2(67);
//if (random2(2) == 0) mons_class [k] = 54;//MLAVA0 + random2(3);
//mons_class [k] = 47;// + random2(8);
} else mons_class [k] = typed;
if (mons_class [k] >= MLAVA0)
{
mons_sec [k] = 0;
if (mons_class [k] >= MWATER0) grid_ok = 12; else grid_ok = 11;
}
//mons_sec [k] = random2(40);
worm_tail:
if (worm > 0 && worm < 5)
{
k++;
if (mons_class [k] != -1)
{
killer = 5;
monster_die(k);
strcpy(info [info_lines], "Ugg!");
incr();
}
mons_class [k] = 56;
worm++;
}
if (mons_class [k] == 19)
{
//if (mons_class [k + 1] == -1 &&
/*
mons_class [k] = -1;
char d = 0;
char bkl = 0;
do
{
char g = 0;
for (g = k; g < k + 5; k ++)
{
if (mons_class [g] != -1)
{
d = 0;
k++;
cout << (int) k << ", "; getch();
bkl = 1;
goto b_out;
}
}
b_out: if (bkl == 1)
{
bkl = 0;
continue;
}
d = 1;
mons_class [k] = 19;
} while (d == 0);
/*
for (g = k; g < k + 5; k ++)
{
if (mons_class [g] != -1) goto monster_cla;
}
*/
worm = 1;
}
// mons_class [k] = 8;
mons_sec [k] = 250;
get_monster();
/*
mons_HD [k] -= 100;
mons_hp [k] -= 100;
mons_hp_max [k] -= 100;
mons_AC [k] -= 100;
mons_ev [k] -= 100;
mons_speed [k] -= 100;
mons_speed [k] /= 10;
mons_speed_inc [k] -= 100;
*/
//mons_speed [k] /= 10;
no_mons ++;
mn_no ++;
mons_beh [k] = behaviour; // Look at this
mons_hit [k] = hitting; //MHITNOT;
/*if (behaviour == 7)
{
for (pets = 0; pets < PETS; pets ++)
{
if (pet_which [pets] == 99)
{
pet_which [pets] = k;
break;
}
} // end of for pets
} // end pets*/
if (mons_class [k] == 46)
{
mons_ench_1 [k] = 1;
mons_ench [k] [2] = 6;
}
if (mons_class [k] == 66)
{
mons_ench_1 [k] = 1;
mons_ench [k] [0] = 5;
}
if (type_place == 1) // summoned
{
mons_x [k] = px;
mons_y [k] = py;
}
else
{
passout = 0;
while (passout < 300)
{
mons_x [k] = 10;// + random2(120) + 100;
mons_y [k] = 10 + random2(60);// + 100;
mons_x [k] += random2 (70);
//mons_x [k] += 100;
passout ++;
if (grid [mons_x [k]] [mons_y [k]] == grid_ok && (mons_x [k] != x_pos | mons_y [k] != y_pos)) break; //passout = 1;
}
if (passout == 300)
{
mons_class [k] = -1;
return -1;
}
if (mons_class [k] == 56)
{
mons_x [k] = mons_x [k - 1] + 1;
mons_y [k] = mons_y [k - 1];
}
} // end of else
grid [mons_x [k]] [mons_y [k]] += 50;
if (worm > 0 && worm < 5) goto worm_tail;
/*
strcpy(info [info_lines], "Giving: ");
itoa(it_no, st_prn, 10);
strcat(info [info_lines], st_prn);
*/
it_no += restock_monsters(mons_class, mons_inv, item_class, item_type, item_dam, icolour, item_plus, item_quant, your_level, grid, item_x, item_y, it_no, k, mons_x, mons_y, item_link, item_ident);
/*
strcat(info [info_lines], ", ");
itoa(it_no, st_prn, 10);
strcat(info [info_lines], st_prn);
incr();
*/
if (mons_sec [k] == 250) mons_sec [k] = 0;
return k;
} // end of mons_place()
/*
void Wcheck(void)
{
brek = 0;
for (count_x = 0; count_x < 80; count_x ++)
{
for (count_y = 0; count_y < 70; count_y ++)
{
if (grid [count_x] [count_y] == 87)
{
for (i = 0; i < MNST; i++)
{
if (mons_x [i] == count_x && mons_y [i] == count_y && mons_class [i] != -1)
brek = 1;
}
// if (brek == 0) cout << "Problem with monster " << i << "at " << count_x << "," << count_y << "\n";
brek = 0;
//cout << "Prboblsdflkgjksdfjglksdg";
}
}
}
} // end of void Wcheck()
*/
void monster_attack(int monster_attacking)
{
//float mons_to_hit;
damage_taken = 0;
char blocked = 0;
char hit = 0;
int specdam = 0;
char heads = 0;
if (mons_class [monster_attacking] == 106) heads = mons_sec [monster_attacking];
hand_used = 0;
if (mons_class [monster_attacking] == 32)
{
mons_hp [monster_attacking] = -1;
return;
}
//if (pet_target == MHITNOT)
{
pet_target = monster_attacking;
}
//int runthru = 0;
//mons_to_hit = mons_HD [monster_attacking]; // not finished yet.
if (mons_beh [monster_attacking] == 7) return;
if (mons_class [monster_attacking] >= MLAVA0 && mons_sec [monster_attacking] == 1) return;
for (runthru = 0; runthru < 4; runthru ++)
{
if (mons_class [monster_attacking] == 106)
{
if (heads <= 0) break;
runthru = 0;
heads --;
}
char mdam = mondamage(mons_class [monster_attacking], runthru);
if (mons_class [monster_attacking] == 25 | mons_class [monster_attacking] == 51)
{
mdam = mondamage(mons_sec [monster_attacking], runthru);
if (mdam > 1 && mdam < 4)
{
mdam --;
}
if (mdam > 3 && mdam < 8)
{
mdam -= 2;
}
if (mdam > 7 && mdam < 13)
{
mdam -= 3;
}
if (mdam > 12)
{
mdam -= 5;
}
}
if (mdam == 0) break;
//gmon_att [mons_class [monster_attacking]] [runthru] == 0) break;
if (mons_class [monster_attacking] == 30 && runthru == 1 && mons_inv [monster_attacking] [1] != 501)
{
hand_used = 1;
}
damage_taken = 0;
mons_to_hit = 20 + mons_HD [monster_attacking]; // * mons_HD [monster_attacking]; // * 3 //strength + (0.5 * dex) + (f_abil);
if (mons_inv [monster_attacking] [hand_used] != 501)
{
if (item_plus [mons_inv [monster_attacking] [hand_used]] - 50 > 130)
{
mons_to_hit += random2(item_plus [mons_inv [monster_attacking] [hand_used]] - 50 - 100 + 1);
} else
{
mons_to_hit += random2(item_plus [mons_inv [monster_attacking] [hand_used]] - 50 + 1); /// 10;
}
// mons_to_hit += item_plus [mons_inv [monster_attacking] [0]];
mons_to_hit += 3 * property [0] [item_type [mons_inv [monster_attacking] [0]]] [1];
if (mons_speed_inc [monster_attacking] >= 25) mons_speed_inc [monster_attacking] -= (float) ((float) (property [item_class [mons_inv [monster_attacking] [0]]] [item_type [mons_inv [monster_attacking] [0]]] [2] - 10)); // / 10);
// a good safety margin
}
//if (inv_class [item_wielded] == 0) mons_to_hit += inv_plus [item_wielded];
//mons_to_hit *= random2(200) / 100;
mons_to_hit = random2(mons_to_hit);
/*
//if (mons_to_hit >= (evasion - 6)) //&& mons_to_hit < evasion && shield_armour != -1) // && random2(6) != 0)
if (mons_to_hit < evasion)
{
strcpy(info [info_lines], "You block the ");
strcat(info [info_lines], gmon_name [mons_class [monster_attacking]]);
if (mons_inv [monster_attacking] [0] != 255)
{
strcat(info [info_lines], "'s ");
strcat(info [info_lines], fake_name [mmov_x]);
}
strcat(info [info_lines], " on your shield!");
incr();
return;
}
*/
// This bit is a bit clumsy:
// not any more.
if (mons_class [monster_attacking] == 10 | mons_class [monster_attacking] == 22)
{
/* if (haste == 0) mons_speed_inc [monster_attacking] -= (mons_speed [monster_attacking] * time_taken);
else mons_speed_inc [monster_attacking] -= (mons_speed [monster_attacking] * (time_taken / 2));
if (slow > 0) mons_speed_inc [monster_attacking] -= (mons_speed [monster_attacking] * time_taken);*/
// maybe this will work better:
if (mons_speed_inc [monster_attacking] >= 15)
mons_speed_inc [monster_attacking] -= 10; //--
}
if (shield_class > 0 && paralysis == 0 && conf == 0 && random2(mons_HD [monster_attacking] + 10) <= random2(shield_class))
{
strcpy(info [info_lines], "You block ");
strcat(info [info_lines], monam (mons_sec [monster_attacking], mons_class [monster_attacking], mons_ench [monster_attacking] [2], 1)); //gmon_name [mons_class [monster_attacking]]);
strcat(info [info_lines], "'s attack.");
incr();
blocked = 1;
hit = 0;
//continue;
} else
if (mons_to_hit >= evasion + random2(dex) / 3 - 2)// | random2(6) == 0) // mons_ev [monster_attacked])
//if (random2(20) + mons_to_hit >= 20 - (10 - AC)) // hit roll
{
hit = 1;
//te = mons_inv [monster_attacking] [0];
//k = item_class [te];
//p = item_type [te];
//j = property [k] [p] [0];
//o = mons_class [monster_attacking];
//k = gmon_att [o] [runthru];
if (mons_inv [monster_attacking] [hand_used] != 501 && item_class [mons_inv [monster_attacking] [hand_used]] == 0 && item_type [mons_inv [monster_attacking] [hand_used]] < 13 | item_type [mons_inv [monster_attacking] [hand_used]] > 15)
{
//damage_taken = random2(mmov_x);
damage_taken = random2(property [item_class [mons_inv [monster_attacking] [0]]] [item_type [mons_inv [monster_attacking] [0]]] [0]);
//if (item_plus [mons_inv [i] [0]] > 80) damage_taken -= 100;
//damage_taken += item_plus [mons_inv [i] [0]];
if (item_plus [mons_inv [monster_attacking] [hand_used]] > 130)
{
damage_taken += random2(item_plus [mons_inv [monster_attacking] [hand_used]] - 150 + 1);
} else
{
damage_taken += random2(item_plus [mons_inv [monster_attacking] [hand_used]] - 50 + 1);// % 10;
}
damage_taken -= random2(3) + 1;//1;
}
damage_taken += random2(mdam) + 1;
//gmon_att [mons_class [monster_attacking]] [runthru]) + 1;
//damage_taken /= (random2 (AC) + 1); // / 3
//damage_taken *= 2;
//if (mons_inv [monster_attacking] [0] != 501)
//{
// damage_taken /= ((random2 (AC) / property [item_class [mons_inv [i] [0]]] [item_type [mons_inv [i] [0]]] [2]) + 1);
//} else
// damage_taken /= (random2 (AC) + 1);
damage_taken -= random2(AC + 1);
if (damage_taken < 1) damage_taken = 0;
//hp -= (int) damage_taken;
//ouch(damage_taken, monster_attacking, 0);
//hp_ch = 1;
} // end of if mons_to_hit >= evasion
else
{
hit = 0;
// strcpy(info [info_lines], "The ");
//} else
//strcat(info [info_lines], "The ");
strcpy(info [info_lines], monam (mons_sec [monster_attacking], mons_class [monster_attacking], mons_ench [monster_attacking] [2], 0)); //gmon_name [mons_class [monster_attacking]]);
strcat(info [info_lines], " misses you.");
incr();
}
if (damage_taken < 1 && hit == 1)
{
//if (78 - strlen(info [info_lines]) < strlen(gmon_name [mons_class [monster_attacking]]) + 17)
// {
//incr();
// strcpy(info [info_lines], "The ");
//} else
//strcat(info [info_lines], "The ");
strcpy(info [info_lines], monam (mons_sec [monster_attacking], mons_class [monster_attacking], mons_ench [monster_attacking] [2], 0)); //gmon_name [mons_class [monster_attacking]]);
strcat(info [info_lines], " hits you but doesn't do any damage.");
incr();
}
if ((int) damage_taken >= 1)
{
//if (78 - strlen(info [info_lines]) < strlen(gmon_name [mons_class [monster_attacking]]) + 15)
// {
// incr();
// strcpy(info [info_lines], "The ");
// } else
// strcpy(info [info_lines], "The ");
hit = 1;
mmov_x = mons_inv [monster_attacking] [hand_used];
strcpy(info [info_lines], monam (mons_sec [monster_attacking], mons_class [monster_attacking], mons_ench [monster_attacking] [2], 0));
strcat(info [info_lines], " hits you");
/* strcat(info [info_lines], " for ");
itoa(damage_taken, st_prn, 10);
strcat(info [info_lines], st_prn);
*/
// itoa(
if (mons_inv [monster_attacking] [hand_used] != 501 && item_class [mons_inv [monster_attacking] [hand_used]] == 0 && item_type [mons_inv [monster_attacking] [hand_used]] < 13 | item_type [mons_inv [monster_attacking] [hand_used]] > 15)
{
strcat(info [info_lines], " with ");
item_name(item_class [mmov_x], item_type [mmov_x], item_dam [mmov_x], item_plus [mmov_x], item_quant [mmov_x], item_ident [mmov_x], 7, str_pass);
strcat(info [info_lines], str_pass);
strcat(info [info_lines], "!");
//incr();
// special weapons:
} else
{
strcat(info [info_lines], "!");
}
//strcat(info [info_lines], "! "); // put something for '.', '!', '!!' etc depending on what % of damage you took.
incr();
// special attacks:
brek = 0;
switch(mons_class [monster_attacking])
{
case 0: // giant ant
if ((damage_taken >= 4 && random2(4) == 0) | random2(20) == 0)
{
strcpy(info [info_lines], monam (mons_sec [monster_attacking], mons_class [monster_attacking], mons_ench [monster_attacking] [2], 0));
strcat(info [info_lines], " stings you!");
incr();
poison++;
}
break;
case 2: // cockatrice.
break;
case 10: // killer bee
if (res_poison == 0 && ((damage_taken >= 3 && random2(3) == 0) | random2(20) == 0))
{
strcpy(info [info_lines], monam (mons_sec [monster_attacking], mons_class [monster_attacking], mons_ench [monster_attacking] [2], 0));
strcat(info [info_lines], " stings you!");
incr();
poison += 1;
}
break;
case 81: // rotting devil
case 13: // necrophage
if ((damage_taken >= 3 && random2(3) == 0) | random2(20) == 0)
{
strcpy(info [info_lines], "You feel your flesh start to rot away!");
incr();
rotting += random2(3) + 1;
}
break;
case 21: // fire vortex
mons_hp [monster_attacking] = -10;
strcpy(info [info_lines], "You are engulfed in flame!");
// strcpy(info [info_lines], monam (mons_sec [monster_attacking], mons_class [monster_attacking], mons_ench [monster_attacking] [2], 0));
// strcat(info [info_lines], " burns you!");
incr();
// damage_taken += specdam;
if (res_fire == 0)
{
damage_taken += 15 + random2(15);
}
scrolls_burn(1, 6);
break;
case 44: // scorpion
case 100: // giant mite
if (res_poison == 0 && ((damage_taken >= 3 && random2(4) == 0) | random2(15) == 0))
{
strcpy(info [info_lines], monam (mons_sec [monster_attacking], mons_class [monster_attacking], mons_ench [monster_attacking] [2], 0));
strcat(info [info_lines], " poisons you!");
incr();
poison++;
}
break;
case 42: // Queen bee
if (res_poison == 0)
{
strcpy(info [info_lines], monam (mons_sec [monster_attacking], mons_class [monster_attacking], mons_ench [monster_attacking] [2], 0));
strcat(info [info_lines], " stings you!");
incr();
poison += 2;
}
break;
case 18: // snake
if (res_poison == 0 && ((damage_taken >= 3 && random2(4) == 0) | random2(20) == 0))
{
strcpy(info [info_lines], monam (mons_sec [monster_attacking], mons_class [monster_attacking], mons_ench [monster_attacking] [2], 0));
strcat(info [info_lines], " stings you!");
incr();
poison++;
}
break;
case 60: // Wight. Is less likely because wights do less damage
case 48: // wraith
case 84: // shadow devil
if (((damage_taken >= 6 && random2(4) == 0) | random2(30) == 0) && prot_life == 0)
{
strcpy(info [info_lines], "You feel drained...");
incr();
brek = 1;
}
break;
case 24: // yellow wasp
if (res_poison == 0 && ((damage_taken >= 3 && random2(3) == 0) | random2(20) == 0))
{
if (paralysis > 0)
{
strcpy(info [info_lines], "You still can't move!");
} else strcpy(info [info_lines], "You suddenly lose the ability to move!");
incr();
paralysis += random2(3) + 1;
}
break;
case 35: // Jelly
strcpy(info [info_lines], "You are splashed with acid!");
incr();
splash_with_acid(10);
break;
case 86: // ice devil
case 34: // Ice beast
case 77: // blue wraith
if (res_cold == 0)
{
damage_taken += 5 + random2(10);
strcpy(info [info_lines], monam (mons_sec [monster_attacking], mons_class [monster_attacking], mons_ench [monster_attacking] [2], 0));
strcat(info [info_lines], " freezes you!");
incr();
// damage_taken += specdam;
}
scrolls_burn(1, 8);
break;
case 47: // Vampire
if (damage_taken >= 7 && random2(3) == 0 | random2(20) == 0)
{
strcpy(info [info_lines], "You feel less resilient.");
incr();
hp_max -= random2(2) + 1;
hp_ch = 1;
if (hp >= hp_max) hp = hp_max;
}
break;
case 63: // shadow
if (((damage_taken >= 1 && random2(3)) == 0 | random2(20) == 0) && strength > 3 && sust_abil == 0)
{
strcpy(info [info_lines], "You feel weaker.");
incr();
strength --;
strength_ch = 1;
}
break;
case 64: // hungry ghost
if (damage_taken >= 1 && random2(3) == 0 | random2(20) == 0)
{
strcpy(info [info_lines], "You feel hungry.");
incr();
hunger -= 400;
//strength_ch = 1;
}
break;
case 39: // Naga
break;
case 15: // phantom
if (random2(3) == 0)
{
strcpy(info [info_lines], monam (mons_sec [monster_attacking], mons_class [monster_attacking], mons_ench [monster_attacking] [2], 0));
strcat(info [info_lines], " blinks.");
incr();
monster_blink(i);
}
break;
case MWATER3: // jellyfish
// if (random2(3) != 0) break;
if (res_poison != 0) break;
strcpy(info [info_lines], monam (mons_sec [monster_attacking], mons_class [monster_attacking], mons_ench [monster_attacking] [2], 0));
strcat(info [info_lines], " stings you!");
incr();
poison++;
if (sust_abil == 0 && strength > 3)