diff --git a/Irpg/Action.pm b/Irpg/Action.pm index 6cbe307735808d23d203e9d2697321eaa3086c3a..7212728f4683291156f16d8c21c7d17e6d071c67 100644 --- a/Irpg/Action.pm +++ b/Irpg/Action.pm @@ -177,21 +177,20 @@ sub steal_result { "remains unaware of ".pronoun(2, $rps->{$p2}{gender}). " own demise."); Irpg::Irc::notice( - "You (rightfully) acquired a new level ". - int($rps->{$p1}{item}{$type})." $type, which looks far better ". - "than your old level ".int($rps->{$p2}{item}{$type})." $type! ". + "You (rightfully) acquired a new level $item2 $type, which ". + "looks far better than your old level $item1 $type! ". "You left your old one to whom you took the new from.", $rps->{$p1}{nick}); Irpg::Irc::notice( "Waking up from your daydreaming, you realize your level ". - int($rps->{$p1}{item}{$type})." $type has been stolen, and ". - "replaced by a level ".int($rps->{$p2}{item}{$type})." $type!", + "$item2 $type has been stolen, and replaced by a level ". + "$item1 $type!", $rps->{$p2}{nick}); } else { push(@queue, - "Unfortunately, $p2\'s stolen equipement ". - "revealed itself to be useless to $p1, who returns it ". + "Unfortunately, $p2\'s stolen \x035equipement revealed ". + "itself to be useless\x03 to $p1, who returns it ". "to its rightful owner."); } } @@ -200,11 +199,14 @@ sub steal_result { my $type = "ring"; my $val = 0; while( my ($k,$v) = each(%{$rps->{$p2}{item}}) ) { - ($type, $val) = ($k, $v) if ($v > $val) + my ($v_d,) = $v =~ m/(\d+)\D?/; + ($type, $val) = ($k, $v_d) if ($v_d > $val) } - if ($val > $rps->{$p1}{item}{$type}) { + my ($item1,) = $rps->{$p1}{item}{$type} =~ m/(\d+)\D?/; + my ($item2,) = $rps->{$p2}{item}{$type} =~ m/(\d+)\D?/; + if ($val > $item1) { my $tempitem = $rps->{$p1}{item}{$type}; - $rps->{$p1}{item}{$type}=$rps->{$p2}{item}{$type}; + $rps->{$p1}{item}{$type} = $rps->{$p2}{item}{$type}; $rps->{$p2}{item}{$type} = $tempitem; $queue[$#queue] .= ucfirst(pronoun(1, $rps->{$p1}{gender}))." has retrieved ". "the finest of $p2\'s equipment. $p1 then proceeds to crawl ". @@ -213,11 +215,15 @@ sub steal_result { "unknown from any soul but ".pronoun(3, $rps->{$p1}{gender}). "self."; Irpg::Irc::notice( - "You (rightfully) acquired a new level ". - int($rps->{$p1}{item}{$type})." $type, which looks far better ". - "than you old level ".int($rps->{$p2}{item}{$type})." $type! ". + "You (rightfully) acquired a new level $item2 $type, which ". + "looks far better than your old level $item1 $type! ". "You left your old one to whom you took the new from.", $rps->{$p1}{nick}); + Irpg::Irc::notice( + "Waking up from your daydreaming, you realize your level ". + "$item2 $type has been stolen, and replaced by a level ". + "$item1 $type!", + $rps->{$p2}{nick}); } else { $queue[$#queue] .= "Alas, despite ".pronoun(2, $rps->{$p1}{gender}).