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 |
# | Content |
---|---|
1 | BEGIN { |
2 | oldFS=FS; FS=":"; |
3 | crosscmd = crosscmd " 2>&1"; |
4 | while (crosscmd | getline == 1) { |
5 | if ($2 != "(null)" && $2 != "null" ) |
6 | before[$1] = $2; |
7 | if ($3 != "(null)" && $3 != "null" ) |
8 | after[$1] = $3; |
9 | } |
10 | close(crosscmd); |
11 | FS=oldFS; |
12 | } |
13 | |
14 | /^spell spells/,/^}/ { |
15 | ++line; |
16 | if (line < 3 || $0 ~ /^}/) |
17 | next; |
18 | if ($4 > 0 || $7 > 0 || $8 > 0) { |
19 | spell = $1; sub("^[{ \t]*", "", spell); |
20 | level = $2; sp = $3; |
21 | checks = sprintf("%s & %s & %s", |
22 | check($4), check($7), check($8)); |
23 | # wand, scroll, book |
24 | # Skip the next line, we have the info needed in the mappings |
25 | getline; |
26 | |
27 | arch_b = (spell in before) ? "~~" before[spell] "~~" : ""; |
28 | arch_a = (spell in after) ? "~~" after[spell] "~~" : ""; |
29 | |
30 | printf("%s &%s &%s &%d &%d &%s \\\\\n", |
31 | capitalize(spell), arch_b, arch_a, level, sp, checks); |
32 | } |
33 | } |
34 | |
35 | function check(i) { |
36 | return (i+0 != 0) ? "$\\surd$" : ""; |
37 | } |
38 | |
39 | function capitalize(str) { |
40 | return toupper(substr(str, 1, 1)) substr(str, 2); |
41 | } |