ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/doc/historic/spoiler/monster-extract
Revision: 1.1
Committed: Thu Sep 7 21:43:09 2006 UTC (17 years, 10 months ago) by pippijn
Branch: MAIN
CVS Tags: rel-2_82, rel-2_81, rel-2_80, rel-3_1, rel-3_0, rel-2_6, rel-2_7, rel-2_4, rel-2_5, rel-2_2, rel-2_3, rel-2_0, rel-2_1, rel-2_72, rel-2_73, rel-2_71, rel-2_76, rel-2_77, rel-2_74, rel-2_75, rel-2_54, rel-2_55, rel-2_56, rel-2_79, rel-2_52, rel-2_53, rel-2_32, rel-2_90, rel-2_92, rel-2_93, rel-2_78, rel-2_61, rel-2_43, rel-2_42, rel-2_41, HEAD
Log Message:
Moved documents to doc/historic

File Contents

# Content
1 BEGIN {
2 # special is a list of what special things we should look for.
3 # The value of the array is how many commas we should skip.
4 special["attacks"] = 1;
5 special["protected"] = 1;
6 special["immune"] = 1;
7 special["vulnerable"] = 1;
8 special["spell abilities"] = 1;
9 }
10
11 {
12
13 # Old stuff:
14 # if ($2 > 25000) z = "Ordeal";
15 # else if ($2 > 10000) z = "Mighty";
16 # else if ($2 > 5000) z = "Powerful";
17 # else if ($2 > 1000) z = "Dangerous";
18 # else if ($2 > 400) z = "Tough";
19 # else if ($2 > 200) z = "Tricky";
20 # else if ($2 > 100) z = "Hard";
21 # else if ($2 > 50) z = "Easy";
22 # else if ($2 > 25) z = "Simple";
23 # else if ($2 > 14) z = "Weak";
24 # else if ($2 > 8) z = "Feeble";
25 # else z = "Defenseless";
26
27 # Expl:
28 # name - ..
29 # comma - Print a comma or not
30 # antall - number of (sub)fields in the 'Special' field; antall(Nor) <-> "number of".
31 # i - counter. Should start as values 2.
32
33 name = capitalize($1);
34 sub("_", " ", name);
35 comma = 0;
36 # The split allows "(", ")(", ", ", ":", ":)(" etc. as delimiters
37 antall = split($5, field, "([():,][():,]*) *");
38
39 printf("%s &~~%s~~ &%s &%s &%s &%s &",
40 name, $6, $7 ? "~~" $7 "~~" : "", $2, $3, $4);
41 for (i = 2; i < antall; i++) {
42 if (field[i] in special) {
43 if (comma > 0)
44 printf("\\newline ");
45 printf("%s: ", capitalize(field[i]));
46 comma = 1 - special[field[i]];
47 } else {
48 if (comma > 0)
49 printf(", ");
50 else
51 ++comma;
52 printf(i == 2 ? capitalize(field[i]) : field[i]);
53 }
54 }
55 printf("\\\\\n");
56 }
57
58 function capitalize(str) {
59 return toupper(substr(str, 1, 1)) substr(str, 2);
60 }