-
Notifications
You must be signed in to change notification settings - Fork 23
/
char_descs.c
872 lines (741 loc) · 25.7 KB
/
char_descs.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
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
/* Copywright 2007 Stephen Squires */
#include "conf.h"
#include "sysdep.h"
#include "structs.h"
#include "utils.h"
#include "db.h"
#include "spells.h"
#include "interpreter.h"
#include "constants.h"
#include "act.h"
#include "handler.h"
#include "comm.h"
#include "char_descs.h"
#include "race.h"
const char *const eye_descriptions[] = {"undefined",
"blue",
"green",
"brown",
"hazel",
"aquamarine",
"emerald",
"sapphire",
"chocolate",
"honey-tinged",
"wild-looking",
"crazed",
"gleaming",
"glowing",
"intelligent",
"wise-looking",
"shimmering",
"stern",
"calm-looking",
"serene",
"serious-looking",
"sad",
"cheerful",
"intense",
"fierce",
"wild",
"kind-looking",
"lavender",
"tired-looking",
"bored-looking",
"bright",
"alert",
"angry-looking",
"mischevious",
"glaring",
"appraising",
"mysterious",
"emotionless",
"blank",
"disapproving",
"caring",
"compassionate",
"fearful",
"fearless",
"searching",
"blind",
"\n"};
const char *const nose_descriptions[] = {"undefined",
"a big",
"a large",
"a small",
"a button",
"a crooked",
"a hooked",
"a hawk-like",
"a bulbous",
"a thin",
"a long",
"a misshapen",
"a broken",
"a noble-looking",
"a short and thin",
"a short and wide",
"a long and wide",
"a long and thin",
"a perfect-looking",
"a rosy-red",
"a runny",
"a hairy",
"a fair",
"a pretty",
"a handsome",
"\n"};
const char *const ear_descriptions[] = {
"undefined",
"large",
"big",
"long",
"small",
"prominent",
"misshapen",
"pointed",
"scarred",
"tattooed",
"pierced",
"tattooed",
"multiply pierced",
"astute",
"alert",
"torn and tattered",
"\n"};
const char *const face_descriptions[] = {
"undefined", "handsome", "pretty", "ugly", "attractive",
"comely", "unattractive", "scarred", "monstrous", "fierce",
"mouse-like", "hawk-like", "rat-like", "horse-like", "bullish",
"fine", "noble", "chubby", "fair", "bull-like",
"pig-like", "masculine", "feminine", "boyish", "girlish",
"garish", "frightening", "demon-like", "angellic", "celestial",
"infernal", "robotic", "\n"};
const char *const scar_descriptions[] = {
"undefined",
"a scar on the right cheek",
"a scar on the left cheek",
"a scar across the left eye",
"a scar across the right eye",
"a scar across the chin",
"a scar across the nose",
"a scar across the neck",
"scars all over the face",
"a scar on the left hand",
"a scar on the right hand",
"a scar on the left arm",
"a scar on the right arm",
"a scar across the chest",
"a scar across the torso",
"scars all over the body",
"a scar on the back",
"scars all over the back",
"a scar on the left leg",
"a scar on the right leg",
"a scar on the left foot",
"a scar on the right foot",
"scars all over the legs",
"\n"};
const char *const hair_descriptions[] = {
"undefined",
"short red hair",
"long red hair",
"cropped red hair",
"a red pony-tail",
"a red topknot",
"a red crown of hair",
"short auburn hair",
"long auburn hair",
"cropped auburn hair",
"an auburn pony-tail",
"an auburn topknot",
"an auburn crown of hair",
"short blonde hair",
"long blonde hair",
"cropped blonde hair",
"a blonde pony-tail",
"a blonde topknot",
"a blonde crown of hair",
"short sandy-blonde hair",
"long sandy-blonde hair",
"cropped sandy-blonde hair",
"a sandy-blonde pony-tail",
"a sandy-blonde topknot",
"a sandy-blonde crown of hair",
"short brown hair",
"long brown hair",
"cropped brown hair",
"a brown pony-tail",
"a brown topknot",
"a brown crown of hair",
"short black hair",
"long black hair",
"cropped black hair",
"a black pony-tail",
"a black topknot",
"a black crown of hair",
"short white hair",
"long white hair",
"cropped white hair",
"a white pony-tail",
"a white topknot",
"a white crown of hair",
"short silver hair",
"long silver hair",
"cropped silver hair",
"a silver pony-tail",
"a silver topknot",
"a white crown of silver",
"long dreadlocks",
"long, braided hair",
"braided corn-rows",
"a shaven, tattooed scalp",
"a bald, misshapen head",
"a single, long braid",
"a shaven head and braided topknot",
"a bald head",
"a cleanly-shaven head",
"\n"};
const char *const build_descriptions[] = {
"undefined", "tall", "short", "stocky", "average",
"huge", "monstrous", "gigantic", "tiny", "delicate",
"frail", "towering", "snake-like", "wiry", "bulging",
"obese", "chubby", "muscular", "thin", "athletic",
"barrel-chested", "sinewy", "sculpted", "solid", "normal",
"lithe", "curvy", "hulking", "\n"};
const char *const complexion_descriptions[] = {
"undefined", "white", "pale", "dark", "tanned", "bronzed",
"freckled", "weathered", "brown", "black", "chocolate", "olive",
"fair", "jet black", "\n"};
const char *const fur_descriptions[] = {
"undefined", "white fur", "brown fur", "black fur",
"reddish fur", "grey fur", "white and brown fur",
"white and black fur", "white and red fur", "white and grey fur",
"brown and black fur", "brown and red fur", "brown and grey fur",
"black and red fur", "black and grey fur", "red and grey fur",
"\n"};
const char *const skin_descriptions[] = {
"undefined", "white skin", "brown skin", "dark brown skin",
"light brown skin", "black skin", "green skin",
"blue skin", "red skin", "orange skin", "purple skin",
"yellow skin",
"\n"};
const char *const scales_descriptions[] = {
"undefined", "white scales", "brown scales", "dark brown scales",
"light brown scales", "black scales", "green scales", "blue scales",
"red scales", "orange scales", "purple scales", "yellow scales",
"gold scales", "silver scales", "brass scales", "bronze scales",
"copper scales",
"\n"};
const char *horn_descriptions[] = {
"a pair of short horns",
"a pair of long horns",
"a pair of curved horns",
"multiple short horns",
"a crown of short horns",
"a ridge of short horns",
"ridges of short horns",
"\n"};
char *current_short_desc(struct char_data *ch)
{
int i = 0;
char desc[MEDIUM_STRING];
char adj1[SMALL_STRING];
char adj2[SMALL_STRING];
char final[MEDIUM_STRING];
int race = GET_RACE(ch);
int sex = GET_SEX(ch);
int pcd1 = GET_PC_DESCRIPTOR_1(ch);
int pca1 = GET_PC_ADJECTIVE_1(ch);
int pcd2 = GET_PC_DESCRIPTOR_2(ch);
int pca2 = GET_PC_ADJECTIVE_2(ch);
/*
if (AFF_FLAGGED(ch, AFF_DISGUISED) && !DISGUISE_SEEN(ch))
{
race = GET_DISGUISE_RACE(ch);
sex = GET_DISGUISE_SEX(ch);
pcd1 = GET_DISGUISE_DESC_1(ch);
pca1 = GET_DISGUISE_ADJ_1(ch);
pcd2 = GET_DISGUISE_DESC_2(ch);
pca2 = GET_DISGUISE_ADJ_2(ch);
}
*/
snprintf(desc, sizeof(desc), "%s %s %s %s", AN(character_ages[GET_CH_AGE(ch)]), character_ages[GET_CH_AGE(ch)], genders[(int)sex], race_list[(int)race].name);
snprintf(adj1, sizeof(adj1), "\tn");
snprintf(adj2, sizeof(adj2), "\tn");
switch (pcd1)
{
case FEATURE_TYPE_FUR:
snprintf(adj1, sizeof(adj1), " with %s", fur_descriptions[pca1]);
break;
case FEATURE_TYPE_SKIN:
snprintf(adj1, sizeof(adj1), " with %s", skin_descriptions[pca1]);
break;
case FEATURE_TYPE_SCALES:
snprintf(adj1, sizeof(adj1), " with %s", scales_descriptions[pca1]);
break;
case FEATURE_TYPE_HORNS:
snprintf(adj1, sizeof(adj1), " with %s", horn_descriptions[pca1]);
break;
case FEATURE_TYPE_EYES:
snprintf(adj1, sizeof(adj1), " with %s eyes", eye_descriptions[pca1]);
break;
case FEATURE_TYPE_NOSE:
snprintf(adj1, sizeof(adj1), " with %s nose", nose_descriptions[pca1]);
break;
case FEATURE_TYPE_EARS:
snprintf(adj1, sizeof(adj1), " with %s ears", ear_descriptions[pca1]);
break;
case FEATURE_TYPE_FACE:
snprintf(adj1, sizeof(adj1), " with %s features", face_descriptions[pca1]);
break;
case FEATURE_TYPE_SCAR:
snprintf(adj1, sizeof(adj1), " with %s", scar_descriptions[pca1]);
break;
case FEATURE_TYPE_HAIR:
snprintf(adj1, sizeof(adj1), " with %s", hair_descriptions[pca1]);
break;
case FEATURE_TYPE_BUILD:
snprintf(adj1, sizeof(adj1), " with %s %s frame",
AN(build_descriptions[pca1]), build_descriptions[pca1]);
break;
case FEATURE_TYPE_COMPLEXION:
snprintf(adj1, sizeof(adj1), " with %s %s %s",
AN(complexion_descriptions[pca1]),
complexion_descriptions[GET_PC_ADJECTIVE_1(ch)],
"complexion");
break;
}
switch (pcd2)
{
case FEATURE_TYPE_FUR:
snprintf(adj2, sizeof(adj2), " with %s", fur_descriptions[pca2]);
break;
case FEATURE_TYPE_SKIN:
snprintf(adj2, sizeof(adj2), " with %s", skin_descriptions[pca2]);
break;
case FEATURE_TYPE_HORNS:
snprintf(adj2, sizeof(adj2), " with %s", horn_descriptions[pca2]);
break;
case FEATURE_TYPE_SCALES:
snprintf(adj2, sizeof(adj2), " with %s", scales_descriptions[pca2]);
break;
case FEATURE_TYPE_EYES:
snprintf(adj2, sizeof(adj2), " and %s eyes", eye_descriptions[pca2]);
break;
case FEATURE_TYPE_NOSE:
snprintf(adj2, sizeof(adj2), " and %s nose", nose_descriptions[pca2]);
break;
case FEATURE_TYPE_EARS:
snprintf(adj2, sizeof(adj2), " and %s ears", ear_descriptions[pca2]);
break;
case FEATURE_TYPE_FACE:
snprintf(adj2, sizeof(adj2), " and %s features", face_descriptions[pca2]);
break;
case FEATURE_TYPE_SCAR:
snprintf(adj2, sizeof(adj2), " and %s", scar_descriptions[pca2]);
break;
case FEATURE_TYPE_HAIR:
snprintf(adj2, sizeof(adj2), " and %s", hair_descriptions[pca2]);
break;
case FEATURE_TYPE_BUILD:
snprintf(adj2, sizeof(adj2), " and %s %s frame", AN(build_descriptions[pca2]),
build_descriptions[pca2]);
break;
case FEATURE_TYPE_COMPLEXION:
snprintf(adj2, sizeof(adj2), " and %s %s complexion",
AN(complexion_descriptions[pca2]),
complexion_descriptions[pca2]);
break;
}
/*
if (DISGUISE_SEEN(ch) && GET_DISGUISE_ROLL(ch) > 0)
{
strcat(desc, " (disguised)");
}
*/
snprintf(final, sizeof(final), "%s%s%s", desc, adj1, adj2);
for (i = 0; i < strlen(final); i++)
final[i] = tolower((unsigned char) final[i]);
return strdup(final);
}
void short_desc_descriptors_menu(struct char_data *ch)
{
SEND_TO_Q(
"Please choose a descriptor from the list. This will determine what kind of feature\r\n"
"you wish to add to your short description. Once chosen you will choose a specific\r\n"
"describing adjective for the feature you chose.\r\n\r\n",
ch->desc);
SEND_TO_Q(
"1) Describe Eyes\r\n"
"2) Describe Nose\r\n"
"3) Describe Ears\r\n"
"4) Describe Face\r\n"
"5) Describe Scars\r\n"
"6) Describe Hair\r\n"
"7) Describe Build\r\n"
"8) Describe Complexion\r\n"
"9) Describe Fur\r\n"
"10) Describe Skin Color\r\n"
"11) Describe Horns\r\n"
"12) Describe Scales\r\n"
"\r\n",
ch->desc);
}
void short_desc_adjectives_menu(struct char_data *ch, int which_desc)
{
char buf[100];
int i = 1;
SEND_TO_Q("Please choose an adjective to describe the descriptor you just chose.\r\n\r\n", ch->desc);
switch (which_desc)
{
case FEATURE_TYPE_FUR:
while (i < NUM_FUR_DESCRIPTORS)
{
snprintf(buf, sizeof(buf), "%d) %-30s ", i, fur_descriptions[i]);
if (i % 2 == 1)
strcat(buf, "\r\n");
SEND_TO_Q(buf, ch->desc);
i++;
}
break;
case FEATURE_TYPE_SKIN:
while (i < NUM_SKIN_DESCRIPTORS)
{
snprintf(buf, sizeof(buf), "%d) %-30s ", i, skin_descriptions[i]);
if (i % 2 == 1)
strcat(buf, "\r\n");
SEND_TO_Q(buf, ch->desc);
i++;
}
break;
case FEATURE_TYPE_HORNS:
while (i < NUM_HORNS_DESCRIPTORS)
{
snprintf(buf, sizeof(buf), "%d) %-30s ", i, horn_descriptions[i]);
if (i % 2 == 1)
strcat(buf, "\r\n");
SEND_TO_Q(buf, ch->desc);
i++;
}
break;
case FEATURE_TYPE_SCALES:
while (i < NUM_SCALES_DESCRIPTORS)
{
snprintf(buf, sizeof(buf), "%d) %-30s ", i, scales_descriptions[i]);
if (i % 2 == 1)
strcat(buf, "\r\n");
SEND_TO_Q(buf, ch->desc);
i++;
}
break;
case FEATURE_TYPE_EYES:
while (i < NUM_EYE_DESCRIPTORS)
{
snprintf(buf, sizeof(buf), "%d) %-30s ", i, eye_descriptions[i]);
if (i % 2 == 1)
strcat(buf, "\r\n");
SEND_TO_Q(buf, ch->desc);
i++;
}
break;
case FEATURE_TYPE_NOSE:
while (i < NUM_NOSE_DESCRIPTORS)
{
snprintf(buf, sizeof(buf), "%d) %-30s ", i, nose_descriptions[i]);
if (i % 2 == 1)
strcat(buf, "\r\n");
SEND_TO_Q(buf, ch->desc);
i++;
}
break;
case FEATURE_TYPE_EARS:
while (i < NUM_EAR_DESCRIPTORS)
{
snprintf(buf, sizeof(buf), "%d) %-30s n", i, ear_descriptions[i]);
if (i % 2 == 1)
strcat(buf, "\r\n");
SEND_TO_Q(buf, ch->desc);
i++;
}
break;
case FEATURE_TYPE_FACE:
while (i < NUM_FACE_DESCRIPTORS)
{
snprintf(buf, sizeof(buf), "%d) %-30s ", i, face_descriptions[i]);
if (i % 2 == 1)
strcat(buf, "\r\n");
SEND_TO_Q(buf, ch->desc);
i++;
}
break;
case FEATURE_TYPE_SCAR:
while (i < NUM_SCAR_DESCRIPTORS)
{
snprintf(buf, sizeof(buf), "%d) %-30s ", i, scar_descriptions[i]);
if (i % 2 == 1)
strcat(buf, "\r\n");
SEND_TO_Q(buf, ch->desc);
i++;
}
break;
case FEATURE_TYPE_HAIR:
while (i < NUM_HAIR_DESCRIPTORS)
{
snprintf(buf, sizeof(buf), "%d) %-30s ", i, hair_descriptions[i]);
if (i % 2 == 1)
strcat(buf, "\r\n");
SEND_TO_Q(buf, ch->desc);
i++;
}
break;
case FEATURE_TYPE_BUILD:
while (i < NUM_BUILD_DESCRIPTORS)
{
snprintf(buf, sizeof(buf), "%d) %-30s ", i, build_descriptions[i]);
if (i % 2 == 1)
strcat(buf, "\r\n");
SEND_TO_Q(buf, ch->desc);
i++;
}
break;
case FEATURE_TYPE_COMPLEXION:
while (i < NUM_COMPLEXION_DESCRIPTORS)
{
snprintf(buf, sizeof(buf), "%d) %-30s ", i, complexion_descriptions[i]);
if (i % 2 == 1)
strcat(buf, "\r\n");
SEND_TO_Q(buf, ch->desc);
i++;
}
break;
}
if (i % 2 == 0)
SEND_TO_Q("\r\n", ch->desc);
SEND_TO_Q("\r\n", ch->desc);
}
int count_adjective_types(int which_desc)
{
int i = 0;
switch (which_desc)
{
case FEATURE_TYPE_FUR:
while (i < NUM_FUR_DESCRIPTORS)
i++;
break;
case FEATURE_TYPE_SKIN:
while (i < NUM_SKIN_DESCRIPTORS)
i++;
break;
case FEATURE_TYPE_HORNS:
while (i < NUM_HORNS_DESCRIPTORS)
i++;
break;
case FEATURE_TYPE_SCALES:
while (i < NUM_SCALES_DESCRIPTORS)
i++;
break;
case FEATURE_TYPE_EYES:
while (i < NUM_EYE_DESCRIPTORS)
i++;
break;
case FEATURE_TYPE_NOSE:
while (i < NUM_NOSE_DESCRIPTORS)
i++;
break;
case FEATURE_TYPE_EARS:
while (i < NUM_EAR_DESCRIPTORS)
i++;
break;
case FEATURE_TYPE_FACE:
while (i < NUM_FACE_DESCRIPTORS)
i++;
break;
case FEATURE_TYPE_SCAR:
while (i < NUM_SCAR_DESCRIPTORS)
i++;
break;
case FEATURE_TYPE_HAIR:
while (i < NUM_HAIR_DESCRIPTORS)
i++;
break;
case FEATURE_TYPE_BUILD:
while (i < NUM_BUILD_DESCRIPTORS)
i++;
break;
case FEATURE_TYPE_COMPLEXION:
while (i < NUM_COMPLEXION_DESCRIPTORS)
i++;
break;
}
return i;
}
void HandleStateGenericsDescsIntro(struct descriptor_data *d, char *arg)
{
int changeStateTo = STATE(d);
SEND_TO_Q("Current short description: \tW", d);
char *tmpdesc = current_short_desc(d->character);
SEND_TO_Q(tmpdesc, d);
free(tmpdesc);
SEND_TO_Q("\tn\r\n\r\n", d);
short_desc_descriptors_menu(d->character);
changeStateTo = CON_GEN_DESCS_DESCRIPTORS_1;
STATE(d) = changeStateTo;
}
void HandleStateGenericDescsDescriptors1(struct descriptor_data *d, char *arg)
{
if (!*arg || !d || !d->character)
return;
int changeStateTo = STATE(d);
int type = atoi(arg);
if (type < 1 || type > NUM_FEATURE_TYPES)
{
SEND_TO_Q("That number is out of range. Please choose again.\r\n\r\n", d);
}
else if (
(type == FEATURE_TYPE_FUR && !is_furry(GET_REAL_RACE(d->character))) ||
(type == FEATURE_TYPE_HORNS && !has_horns(GET_REAL_RACE(d->character))) ||
(type == FEATURE_TYPE_HAIR && race_has_no_hair(GET_REAL_RACE(d->character))) ||
(type == FEATURE_TYPE_SCALES && !has_scales(GET_REAL_RACE(d->character))))
{
write_to_output(d, "Your race cannot select that descriptor type.\r\n");
}
else
{
GET_PC_DESCRIPTOR_1(d->character) = type;
short_desc_adjectives_menu(d->character, GET_PC_DESCRIPTOR_1(d->character));
changeStateTo = CON_GEN_DESCS_ADJECTIVES_1;
}
STATE(d) = changeStateTo;
}
void HandleStateGenericDescsAdjectives1(struct descriptor_data *d, char *arg)
{
int changeStateTo = STATE(d);
int count = count_adjective_types(GET_PC_DESCRIPTOR_1(d->character));
if (atoi(arg) < 1 || atoi(arg) > count)
{
SEND_TO_Q("That number is out of range. Please choose again.\r\n\r\n", d);
}
else
{
GET_PC_ADJECTIVE_1(d->character) = atoi(arg);
SEND_TO_Q("\tY(Press enter to continue)\tn", d);
changeStateTo = CON_GEN_DESCS_MENU;
}
STATE(d) = changeStateTo;
}
void HandleStateGenericDescsDescriptors2(struct descriptor_data *d, char *arg)
{
if (!*arg || !d || !d->character)
return;
int changeStateTo = STATE(d);
int type = atoi(arg);
if (type < 1 || type > NUM_FEATURE_TYPES)
{
SEND_TO_Q("That number is out of range. Please choose again.\r\n\r\n", d);
}
else if (
(type == FEATURE_TYPE_FUR && !is_furry(GET_REAL_RACE(d->character))) ||
(type == FEATURE_TYPE_HORNS && !has_horns(GET_REAL_RACE(d->character))) ||
(type == FEATURE_TYPE_HAIR && race_has_no_hair(GET_REAL_RACE(d->character))) ||
(type == FEATURE_TYPE_SCALES && !has_scales(GET_REAL_RACE(d->character))))
{
write_to_output(d, "Your race cannot select that descriptor type.\r\n");
}
else
{
GET_PC_DESCRIPTOR_2(d->character) = atoi(arg);
short_desc_adjectives_menu(d->character,
GET_PC_DESCRIPTOR_2(d->character));
changeStateTo = CON_GEN_DESCS_ADJECTIVES_2;
}
STATE(d) = changeStateTo;
}
void HandleStateGenericDescsAdjectives2(struct descriptor_data *d, char *arg)
{
int changeStateTo = STATE(d);
int count = count_adjective_types(GET_PC_DESCRIPTOR_2(d->character));
if (atoi(arg) < 1 || atoi(arg) > count)
{
SEND_TO_Q("That number is out of range. Please choose again.\r\n\r\n", d);
}
else
{
GET_PC_ADJECTIVE_2(d->character) = atoi(arg);
SEND_TO_Q("\tY(Press enter to continue)\tn", d);
changeStateTo = CON_GEN_DESCS_MENU;
}
STATE(d) = changeStateTo;
}
void HandleStateGenericDescsMenu(struct descriptor_data *d, char *arg)
{
int changeStateTo = STATE(d);
int options = 2;
SEND_TO_Q("Current short description: \tW", d);
write_to_output(d, "%s", current_short_desc(d->character));
SEND_TO_Q("\tn\r\n\r\n", d);
SEND_TO_Q("Are you happy with this short description?\r\n", d);
SEND_TO_Q("\r\n", d);
SEND_TO_Q("0) I want to cancel the short description process for now.\r\n", d);
SEND_TO_Q("1) I'm happy with it and want to save it to my character!\r\n", d);
SEND_TO_Q("2) I'm not happy with it and want to start over.\r\n", d);
if (GET_PC_DESCRIPTOR_2(d->character) == 0)
{
SEND_TO_Q("3) I'm not done yet, as I want to add a second descriptor.\r\n", d);
++options;
}
SEND_TO_Q("\r\n", d);
write_to_output(d, "What would you like to do? (1-%d):", options);
changeStateTo = CON_GEN_DESCS_MENU_PARSE;
STATE(d) = changeStateTo;
}
void HandleStateGenericDescsParseMenuChoice(struct descriptor_data *d, char *arg)
{
int changeStateTo = STATE(d);
switch (atoi(arg))
{
case 0:
GET_PC_DESCRIPTOR_1(d->character) = 0;
GET_PC_ADJECTIVE_1(d->character) = 0;
GET_PC_DESCRIPTOR_2(d->character) = 0;
GET_PC_ADJECTIVE_2(d->character) = 0;
changeStateTo = CON_CHAR_RP_MENU;
SEND_TO_Q("\tcCharacter short description setting cancelled.\r\n\tn", d);
show_character_rp_menu(d);
break;
case 1:
changeStateTo = CON_CHAR_RP_MENU;
SEND_TO_Q("\tcYour character descriptions are complete.\r\n\tn", d);
show_character_rp_menu(d);
break;
case 2:
GET_PC_DESCRIPTOR_1(d->character) = 0;
GET_PC_ADJECTIVE_1(d->character) = 0;
GET_PC_DESCRIPTOR_2(d->character) = 0;
GET_PC_ADJECTIVE_2(d->character) = 0;
changeStateTo = CON_GEN_DESCS_INTRO;
SEND_TO_Q("\tYPress enter to continue)\tn\r\n", d);
break;
case 3:
if (GET_PC_DESCRIPTOR_2(d->character) == 0)
{
changeStateTo = CON_GEN_DESCS_DESCRIPTORS_2;
SEND_TO_Q("Current short description: \tW", d);
char *tmpdesc = current_short_desc(d->character);
SEND_TO_Q(tmpdesc, d);
free(tmpdesc);
SEND_TO_Q("\tn\r\n\r\n", d);
short_desc_descriptors_menu(d->character);
SEND_TO_Q("\r\n\tY(Press enter to choose your second descriptor)\tn\r\n", d);
}
else
{
SEND_TO_Q("You have already set your second descriptor. Please choose another option\r\n", d);
}
break;
default:
SEND_TO_Q("That is not a valid option. Please choose again.\r\n", d);
break;
}
STATE(d) = changeStateTo;
}