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

bug fixs

- typo in class sneaky
- show when new competence points
- some users commands used wrong arguments
parent dc624b4c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -3,7 +3,7 @@ package Irpg::Classes::Sneaky;
use strict;
use warnings;
use Irpg::Classes::Shrewd;
our @ISA = qw(Irpg::Classes::Schrewd);
our @ISA = qw(Irpg::Classes::Shrewd);
sub new {
my ($class, $pl_stats) = @_;
......
......@@ -98,7 +98,7 @@ sub reloaddb {
sub finduser {
my $nick = shift;
my $offline = shift;
return undef if !defined($nick);
return undef if (!defined($nick));
for my $user (keys(%$rps)) {
next unless ($rps->{$user}{online} || $offline);
if ($rps->{$user}{nick} eq $nick) { return $user; }
......@@ -315,7 +315,13 @@ sub rpcheck { # check levels, update database
$rps->{$k}{idled} += ($curtime - $$lasttime_ref);
if ($rps->{$k}{next} < 1) {
$rps->{$k}{level}++;
$rps->{$k}{points}++ if (!($rps->{$k}{level} % 5));
if (!($rps->{$k}{level} % 5)){
$rps->{$k}{points}++;
Irpg::Irc::notice(
"Your hard training paid off, and you have ".
"one more point to invest.",
$rps->{$k}{nick});
}
if ($rps->{$k}{level} > 60) {
$rps->{$k}{next} = int(($opts->{rpbase} *
($opts->{rpstep}**60)) +
......@@ -336,7 +342,8 @@ sub rpcheck { # check levels, update database
&& $rps->{$k}{actions} < int($rps->{$k}{level}/10)) {
$rps->{$k}{actions}++;
$rps->{$k}{next_a} = 3600; # 1 hour
Irpg::Irc::notice("You feel ready to perform a new deed !", $rps->{$k}{nick});
Irpg::Irc::notice("You feel ready to perform a new deed !",
$rps->{$k}{nick});
}
}
# attempt to make sure this is an actual user, and not just an
......
......@@ -91,7 +91,7 @@ sub register {
}
$$lastreg_ref = time();
$rps->{$arg[0]}{next} = $opts->{rpbase};
$rps->{$arg[0]}{title} = "@arg[6..$#arg]";
$rps->{$arg[0]}{title} = "@arg[2..$#arg]";
$rps->{$arg[0]}{level} = 0;
foreach (qw(str con wis int cha dex)) {
$rps->{$arg[0]}{stats}{$_} = 1;
......@@ -123,7 +123,7 @@ sub register {
$rps->{$arg[0]}{$pen} = 0;
}
Irpg::Irc::chanmsg("Welcome $usernick\'s new player $arg[0], the ".
"@arg[6..$#arg] Farmer! Next level in ".
"@arg[2..$#arg] Farmer! Next level in ".
duration($opts->{rpbase}).".");
Irpg::Irc::privmsg("Success! Account $arg[0] created. You have ".
"$opts->{rpbase} seconds idleness until you ".
......@@ -222,7 +222,7 @@ sub status {
Irpg::Irc::privmsg("No matching user found.",$source);
}
else {
my $almt = $rps->{$arg[0]}{alignment};
my $almt = $rps->{$asked}{alignment};
$almt = $almt eq 'g' ? 'Good':
$almt eq 'e' ? 'Evil':
'Neutral';
......@@ -243,7 +243,7 @@ sub whoami {
Irpg::Irc::notice("You are not logged in.", $usernick);
}
else {
my $almt = $rps->{$arg[0]}{alignment};
my $almt = $rps->{$username}{alignment};
$almt = $almt eq 'g' ? 'Good':
$almt eq 'e' ? 'Evil':
'Neutral';
......
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