# HG changeset patch # User Matti Hamalainen # Date 1312791924 -10800 # Node ID d352ae078cbba0cb9dcfbd604721036a86d04340 # Parent e5e8083769fabbecfc467c17532bc8cbd05ea8ec Add support for 'bash' and 'push' skills. Fix some minor warnings. diff -r e5e8083769fa -r d352ae078cbb log2template.pl --- a/log2template.pl Mon Aug 08 08:16:36 2011 +0300 +++ b/log2template.pl Mon Aug 08 11:25:24 2011 +0300 @@ -325,7 +325,7 @@ } # Check for nun relics - if ($$id{"full"} =~ / \(holy\)/) { + if (defined($$id{"full"}) && $$id{"full"} =~ / \(holy\)/) { $$id{"cat"}{"relic"} = 1; } @@ -338,14 +338,16 @@ } # Check if the weight data is for FW'd item - if ($$id{"full"} =~ / <(yellow|green|white) glow>$/) { - $$id{"kg"} = ""; - $$id{"weight"} = ""; - } else { - if (defined($$id{"kg"}{$$id{"full"}})) { - $$id{"kg"} = $$id{"kg"}{$$id{"full"}}; + if (defined($$id{"full"})) { + if ($$id{"full"} =~ / <(yellow|green|white) glow>$/) { + $$id{"kg"} = ""; + $$id{"weight"} = ""; } else { - $$id{"kg"} = ""; + if (defined($$id{"kg"}{$$id{"full"}})) { + $$id{"kg"} = $$id{"kg"}{$$id{"full"}}; + } else { + $$id{"kg"} = ""; + } } } } @@ -441,7 +443,9 @@ } elsif ($s =~ /^(.+?) did the heroic deed to bring this piece of equipment before you (.+)$/) { parse_id_blob($2); - $ids{$$id{"full"}} = $id; + if (defined($$id{"full"})) { + $ids{$$id{"full"}} = $id; + } set_state(0, $s); } elsif ($s =~ /^It has been in the game for (.+)$/) { @@ -537,6 +541,12 @@ elsif ($s =~ /^([A-Za-z][A-Za-z\'\ -]+?) starts grappling [A-Z][a-z]+\.$/) { $skills{$1}{$line} = "grapple"; } + elsif ($s =~ /^([A-Za-z][A-Za-z\'\ -]+?) pushes [A-Z][a-z]+ extremely hard\.$/) { + $skills{$1}{$line} = "push"; + } + elsif ($s =~ /^([A-Za-z][A-Za-z\'\ -]+?)\'s (powerful bash sends [A-Z][a-z]+ sprawling to the floor|tries to bash [A-Z][a-z]+ but promptly falls flat on his face)\.$/) { + $skills{$1}{$line} = "bash"; + } }