Skip to content
Extraits de code Groupes Projets
Valider 4a065351 rédigé par ElTata's avatar ElTata :ok_hand:
Parcourir les fichiers

no more argument isn't numeric warning

parent 4042ecee
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -177,21 +177,20 @@ sub steal_result { ...@@ -177,21 +177,20 @@ sub steal_result {
"remains unaware of ".pronoun(2, $rps->{$p2}{gender}). "remains unaware of ".pronoun(2, $rps->{$p2}{gender}).
" own demise."); " own demise.");
Irpg::Irc::notice( Irpg::Irc::notice(
"You (rightfully) acquired a new level ". "You (rightfully) acquired a new level $item2 $type, which ".
int($rps->{$p1}{item}{$type})." $type, which looks far better ". "looks far better than your old level $item1 $type! ".
"than your old level ".int($rps->{$p2}{item}{$type})." $type! ".
"You left your old one to whom you took the new from.", "You left your old one to whom you took the new from.",
$rps->{$p1}{nick}); $rps->{$p1}{nick});
Irpg::Irc::notice( Irpg::Irc::notice(
"Waking up from your daydreaming, you realize your level ". "Waking up from your daydreaming, you realize your level ".
int($rps->{$p1}{item}{$type})." $type has been stolen, and ". "$item2 $type has been stolen, and replaced by a level ".
"replaced by a level ".int($rps->{$p2}{item}{$type})." $type!", "$item1 $type!",
$rps->{$p2}{nick}); $rps->{$p2}{nick});
} }
else { else {
push(@queue, push(@queue,
"Unfortunately, $p2\'s stolen equipement ". "Unfortunately, $p2\'s stolen \x035equipement revealed ".
"revealed itself to be useless to $p1, who returns it ". "itself to be useless\x03 to $p1, who returns it ".
"to its rightful owner."); "to its rightful owner.");
} }
} }
...@@ -200,9 +199,12 @@ sub steal_result { ...@@ -200,9 +199,12 @@ sub steal_result {
my $type = "ring"; my $type = "ring";
my $val = 0; my $val = 0;
while( my ($k,$v) = each(%{$rps->{$p2}{item}}) ) { 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}; 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; $rps->{$p2}{item}{$type} = $tempitem;
...@@ -213,11 +215,15 @@ sub steal_result { ...@@ -213,11 +215,15 @@ sub steal_result {
"unknown from any soul but ".pronoun(3, $rps->{$p1}{gender}). "unknown from any soul but ".pronoun(3, $rps->{$p1}{gender}).
"self."; "self.";
Irpg::Irc::notice( Irpg::Irc::notice(
"You (rightfully) acquired a new level ". "You (rightfully) acquired a new level $item2 $type, which ".
int($rps->{$p1}{item}{$type})." $type, which looks far better ". "looks far better than your old level $item1 $type! ".
"than you old level ".int($rps->{$p2}{item}{$type})." $type! ".
"You left your old one to whom you took the new from.", "You left your old one to whom you took the new from.",
$rps->{$p1}{nick}); $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 { else {
$queue[$#queue] .= "Alas, despite ".pronoun(2, $rps->{$p1}{gender}). $queue[$#queue] .= "Alas, despite ".pronoun(2, $rps->{$p1}{gender}).
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter