From: Mischa POSLAWSKY Date: Sun, 11 Jan 2009 17:14:41 +0000 (+0000) Subject: nethack: subargument updates X-Git-Tag: v1.3~201 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/aba1357633e2f377e38961d379cf072aa7462afd nethack: subargument updates Fix support for different argument types (detect any arg? in Shiar_Sheet::Keyboard). Various other description improvements; seperate modes for I and D arguments. --- diff --git a/Shiar_Sheet/Keyboard.pm b/Shiar_Sheet/Keyboard.pm index f56437f..3aa1883 100644 --- a/Shiar_Sheet/Keyboard.pm +++ b/Shiar_Sheet/Keyboard.pm @@ -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 .= "$self->{sign}->{motion}" if $flags =~ s/ ?\bargm\b//; # motion argument $keytxt =~ s{\^(?=.)}{^}; # element around ctrl-identifier my $onclick = $flags =~ s/ ?\bmode(\S*)// && defined $self->{keys}{$1} && sprintf( diff --git a/nethack.inc.pl b/nethack.inc.pl index 82fed9c..5c58008 100644 --- a/nethack.inc.pl +++ b/nethack.inc.pl @@ -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 5 1'], + '^j'=> ["run down", 'po', 'numpad 5 2'], + '^n'=> ["run right down", 'po', 'numpad 5 3'], + '^h'=> ["run left", 'po', 'numpad 5 4'], + '^l'=> ["run right", 'po', 'numpad 5 6'], + '^y'=> ["run left up", 'po', 'numpad 5 7'], + '^k'=> ["run up", 'po', 'numpad 5 8'], + '^u'=> ["run right up", 'po', 'numpad 5 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'], +}, + diff --git a/nethack.plp b/nethack.plp index b73a765..d6a37b1 100644 --- a/nethack.plp +++ b/nethack.plp @@ -80,7 +80,7 @@ function setmode(classname) {
  • @@ -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});
    key<:= $sign{arg} :>
    Commands with a dot need at least one argument afterwards. -
    key<:= $sign{motion} :> -
    Requires a direction afterwards.
    key<:= $sign{argi} :>
    Asks for an inventory item. +
    key<:= $sign{argm} :> +
    Thing +
    key<:= $sign{motion} :> +
    Requires a direction afterwards.