9 open my $fh, '<', 'effectinfo.txt';
14 next if /^\/\/ used in /;
15 next if /^\/\/ used nowhere in code$/;
17 if(/^effect\s+([^\s\/]+)\s*(?:\/\/.*)?$/i)
21 print STDERR "Handling $1...\n";
25 $1 eq 'TR_BLOOD' ? 'MF_GIB' :
26 $1 eq 'TR_SLIGHTBLOOD' ? 'MF_ZOMGIB' :
27 $1 eq 'TR_WIZSPIKE' ? 'MF_TRACER' :
28 $1 eq 'TR_KNIGHTSPIKE' ? 'MF_TRACER2' :
29 $1 eq 'TR_ROCKET' ? 'MF_ROCKET' :
30 $1 eq 'TR_GRENADE' ? 'MF_GRENADE' :
31 $1 eq 'TR_VORESPIKE' ? 'MF_TRACER3' :
33 local $ENV{effectre} =
35 ? "\"$search\"|\"$search2\""
36 : "\"$search\"|\\<" . lc($search) . "\\>|\\<" . $search . "\\>|"
37 . "\"$search2\"|\\<" . lc($search2) . "\\>|\\<" . $search2 . "\\>";
38 print "$ENV{effectre}\n";
39 my $occurrences = `grep -E "\$effectre" qcsrc/server/*.qc qcsrc/client/*.qc`;
40 $occurrences =~ s/\r/\n/g;
41 $occurrences =~ s/;//g;
43 for(split /\n/, $occurrences)
46 next if /^qcsrc\/server\/gamecommand\.qc:/; # list of quake effects is there
47 next if /^qcsrc\/client\/csqc_builtins\.qc:/; # list of quake effects is there
48 next if /^qcsrc\/client\/csqc_constants\.qc:/; # list of quake effects is there
49 $out .= "// used in $_\n";
54 $out .= "// used nowhere in code\n";
63 open $fh, '>', 'effectinfo.txt';