ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/doc/spoiler-html/spells-extract
Revision: 1.1.1.1 (vendor branch)
Committed: Fri Feb 3 07:12:45 2006 UTC (18 years, 5 months ago) by root
Branch: UPSTREAM
CVS Tags: UPSTREAM_2006_03_15, LAST_C_VERSION, STABLE, UPSTREAM_2006_02_22, difficulty_fix_merge_060810_2300, UPSTREAM_2006_02_03
Branch point for: difficulty_fix
Changes since 1.1: +0 -0 lines
Log Message:
initial import

File Contents

# User Rev Content
1 root 1.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</td><td>%s</td><td>%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("<tr><th>%s</th><td>%s</td><td>%s</td><td>%d</td><td>%d</td><td>%s</td></tr>\n",
31     capitalize(spell), arch_b, arch_a, level, sp, checks);
32     }
33     }
34    
35     function check(i) {
36     /* I suggest the 'x' is replaced by a cool checkmark gif */
37    
38     return (i+0 != 0) ? "x" : " ";
39     }
40    
41     function capitalize(str) {
42     return toupper(substr(str, 1, 1)) substr(str, 2);
43     }