nethack: subargument updates
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 11 Jan 2009 17:14:41 +0000 (17:14 +0000)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 3 Feb 2009 14:31:29 +0000 (14:31 +0000)
Fix support for different argument types (detect any arg? in
Shiar_Sheet::Keyboard).  Various other description improvements;
seperate modes for I and D arguments.

Shiar_Sheet/Keyboard.pm
nethack.inc.pl
nethack.plp

index f56437f7e6160830f650567aabbe632c036b67fd..3aa18833b477710a74f071376b9bada3a0d2c910 100644 (file)
@@ -5,7 +5,7 @@ use warnings;
 no  warnings 'uninitialized';  # save some useless checks for more legible code
 use Carp;
 
-our $VERSION = '1.00';
+our $VERSION = '1.01';
 
 my @casedesc = qw(ctrl shift);
 my @rowdesc = qw(numeric top home bottom);
@@ -84,7 +84,7 @@ sub print_key {
 
 #      $key = $keytrans{$key} if defined $keytrans{$key};
        my $keytxt = $mode . escapehtml($key) if $key ne '^0';
-          $keytxt .= $self->{sign}->{arg} while $flags =~ s/ ?\barg\b//;  # argument
+          $keytxt .= $self->{sign}->{$1} while $flags =~ s/(?:^| )(arg[a-ln-z]?)\b//;  # arguments
           $keytxt .= "<small>$self->{sign}->{motion}</small>" if $flags =~ s/ ?\bargm\b//;  # motion argument
           $keytxt =~ s{\^(?=.)}{<small>^</small>};  # element around ctrl-identifier
        my $onclick = $flags =~ s/ ?\bmode(\S*)// && defined $self->{keys}{$1} && sprintf(
index 82fed9c1955e196e8531f4e8c8d7ad314f878674..5c580086354166863198f08407d2d2a5c707c772 100644 (file)
@@ -21,14 +21,14 @@ use utf8;
        'K' => ["go up",           'po', 'shift numpad 8'],
        'U' => ["go right up",     'po', 'shift numpad 9'],
 
-       '^b'=> ["run left down",   'po', 'numpad 1'],
-       '^j'=> ["run down",        'po', 'numpad 2'],
-       '^n'=> ["run right down",  'po', 'numpad 3'],
-       '^h'=> ["run left",        'po', 'numpad 4'],
-       '^l'=> ["run right",       'po', 'numpad 6'],
-       '^y'=> ["run left up",     'po', 'numpad 7'],
-       '^k'=> ["run up",          'po', 'numpad 8'],
-       '^u'=> ["run right up",    'po', 'numpad 9'],
+       '^b'=> ["run left down",   'po', 'numpad 1'],
+       '^j'=> ["run down",        'po', 'numpad 2'],
+       '^n'=> ["run right down",  'po', 'numpad 3'],
+       '^h'=> ["run left",        'po', 'numpad 4'],
+       '^l'=> ["run right",       'po', 'numpad 6'],
+       '^y'=> ["run left up",     'po', 'numpad 7'],
+       '^k'=> ["run up",          'po', 'numpad 8'],
+       '^u'=> ["run right up",    'po', 'numpad 9'],
 
        'g' => ["run until interest", 'po argm'],
        'm' => ["move blind", 'po argm', 'no pickup'],
@@ -38,8 +38,8 @@ use utf8;
        '+?'=> ["more help", 'mv'],
        '/' => ["explain symbol", 'mi arg mode/'], #whatis
        '&' => ["explain comm$sign{_}and", 'mi arg'],
-       '<' => ["climb up a ladder",   'pm'], #up
-       '>' => ["climb down a ladder", 'pm'], #down
+       '<' => ["climb up ladder", 'pm'], #up
+       '>' => ["desc$sign{_}ent ladder", 'pm'], #down
        '.' => ["rest (noop)", 'pm'], #rest
        '_' => ["travel to", 'po argM'], #travel
 
@@ -52,7 +52,7 @@ use utf8;
        'C' => ["call monster", 'co arg'], #call
        '+c'=> ["chat", 'co arg'], #chat
        'd' => ["drop item", 'co argi'], #drop
-       'D' => ["Drop items", 'co arg'], #Drop
+       'D' => ["drop items", 'co arg modeD'], #Drop
        '^d'=> ["kick", 'co argm'], #kick
        '+d'=> ["dip", 'co argi'], #dip
        'e' => ["eat food", 'co argi'], #eat
@@ -62,7 +62,7 @@ use utf8;
        'F' => ["fight monster", 'co argm'], #fight
        '+f'=> ["force lock", 'co'], #force
        'i' => ["invent$sign{_}ory", 'mo'], #invent
-       'I' => ["invent$sign{_}ory part", 'mo arg'], #Invent
+       'I' => ["invent$sign{_}ory part", 'mo arg modeI'], #Invent
        '+i'=> ["invoke object", 'co argi'], #invoke
        '+j'=> ["jump", 'co'], #jump
        '+l'=> ["loot", 'co'], #loot
@@ -121,3 +121,22 @@ use utf8;
        '#' => ["more comm$sign{_}ands", 'mv'],
 },
 
+'D' => {
+       'B' => ['drop blessed', 'co'],
+       'U' => ['drop uncursed', 'co'],
+       'C' => ['drop cursed', 'co'],
+       'X' => ['drop unknown', 'co'],
+       'a' => ['drop all', 'co'],
+       'i' => ['inventory', 'mi'],
+       'u' => ['drop unpaid', 'co'],
+       'm' => ['drop any', 'co argi'],
+       '%' => ['drop more', 'co arg'],
+},
+
+'I' => {
+       '*' => ['list gems', 'mi'],
+       'u' => ['list unpaid', 'mi'],
+       'x' => ['list billed', 'mi'],
+       '$' => ['count money', 'mi'],
+},
+
index b73a765fe4eb451226617ec2dec234293012be87..d6a37b136b4752830b29cf54b90a36501a60d153 100644 (file)
@@ -80,7 +80,7 @@ function setmode(classname) {
 
 <li class="row">
        <ul class="keys omni">
-       <li class="mo" onclick="setmode()"><b>Esc</b>
+       <li class="me" onclick="setmode()"><b>Esc</b>
                <!-- not as static anymore, but never bothered; just see ^[ -->
        </ul>
 </li>
@@ -88,7 +88,9 @@ function setmode(classname) {
 <:
 our %sign = (
        arg    => $ascii ? '.' : '·',  # described as 'dot'
-       argi   => $ascii ? ':' : ':',
+       args   => $ascii ? ':' : '⁚',
+       argi   => $ascii ? "'" : '′',
+       argm   => $ascii ? '|' : '↕',
        motion => $ascii ? '|' : '↕',
        alias  => $ascii ? 'see: ' : '»',
        up     => $ascii ? 'up'    : '▲',
@@ -136,10 +138,12 @@ $keys->print_rows($get{static});
                <dl class="legend legend-options">
                <dt>key<:= $sign{arg} :>
                        <dd>Commands with a dot need at least one argument afterwards.
-               <dt>key<:= $sign{motion} :>
-                       <dd>Requires a direction afterwards.
                <dt>key<:= $sign{argi} :>
                        <dd>Asks for an inventory item.
+               <dt>key<:= $sign{argm} :>
+                       <dd>Thing
+               <dt>key<:= $sign{motion} :>
+                       <dd>Requires a direction afterwards.
                </dl>
 
                <ul class="legend legend-set">