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

bug fixes

- corrections colors
- correction space in classe name
parent 63930b94
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -280,11 +280,10 @@ sub challenge_opp { # pit argument player against random player ...@@ -280,11 +280,10 @@ sub challenge_opp { # pit argument player against random player
my $p1_res = "[$ret_action->{p1roll}/$ret_action->{p1sum}]*$ret_action->{p1atk}"; my $p1_res = "[$ret_action->{p1roll}/$ret_action->{p1sum}]*$ret_action->{p1atk}";
my $p2_res = "[$ret_action->{p2roll}/$ret_action->{p2sum}]*$ret_action->{p2def}"; my $p2_res = "[$ret_action->{p2roll}/$ret_action->{p2sum}]*$ret_action->{p2def}";
my $mesg = ''; my $mesg = '';
my $msg .= $ret_action->{vict} ? "\x033" : "\x035";
if ($action_type eq 'fight') { if ($action_type eq 'fight') {
$mesg .= "$p1 $p1_res has challenged $p2 $p2_res in combat and \x03". $mesg .= "$p1 $p1_res has challenged $p2 $p2_res in combat and \x03".
($ret_action->{vict} ? "3won" : "5lost")."!\x03 "; ($ret_action->{vict} ? "3won" : "5lost")."!";
} }
elsif ($action_type eq 'mystic') { elsif ($action_type eq 'mystic') {
$mesg .= "$p1 $p1_res has cast a spell on $p2 $p2_res and \x03". $mesg .= "$p1 $p1_res has cast a spell on $p2 $p2_res and \x03".
...@@ -476,21 +475,22 @@ sub do_action { ...@@ -476,21 +475,22 @@ sub do_action {
my $mesg = ''; my $mesg = '';
if ($action_type eq 'fight') { if ($action_type eq 'fight') {
$mesg .= "$p1 $p1_res has provoked $p2 $p2_res in a fight, and ". $mesg .= "$p1 $p1_res has provoked $p2 $p2_res in a fight, and \x03".
($ret_action->{vict} ? 'won': 'lost')."! "; ($ret_action->{vict} ? "3won": "5lost")."!";
} }
elsif ($action_type eq 'mystic') { elsif ($action_type eq 'mystic') {
$mesg .= "$p1 $p1_res has performed mystical deeds on $p2 $p2_res, and ". $mesg .= "$p1 $p1_res has performed mystical deeds on $p2 $p2_res, and \x03".
($ret_action->{vict} ? ($ret_action->{vict} ?
'dazed '.pronoun(3, $rps->{$p2}{gender}): "3dazed ".pronoun(3, $rps->{$p2}{gender}):
'got confused'). "5got confused").
"!"; "!";
} }
else { #($action_type eq 'steal') else { #($action_type eq 'steal')
$mesg .= "$p1 $p1_res has sneaked on $p2 $p2_res in the shadows and ". $mesg .= "$p1 $p1_res has sneaked on $p2 $p2_res in the shadows and \x03".
($ret_action->{vict} ? 'stolen ' : 'been caught stealing '). ($ret_action->{vict} ? "3stolen " : "5been caught stealing ").
'from '.pronoun(3, $rps->{$p2}{gender})."!"; 'from '.pronoun(3, $rps->{$p2}{gender})."!";
} }
$mesg .= "\x03 ";
$mesg .= shift @$res_action; $mesg .= shift @$res_action;
Irpg::Irc::chanmsg(Irpg::Utils::clog($mesg)); Irpg::Irc::chanmsg(Irpg::Utils::clog($mesg));
foreach (@$res_action) { Irpg::Irc::chanmsg(Irpg::Utils::clog($_)); } foreach (@$res_action) { Irpg::Irc::chanmsg(Irpg::Utils::clog($_)); }
......
...@@ -410,6 +410,7 @@ sub chclass { ...@@ -410,6 +410,7 @@ sub chclass {
my ($userhost, $usernick, $username, $source, @arg) = @_; my ($userhost, $usernick, $username, $source, @arg) = @_;
my $cname = lc(join(' ', @arg)); my $cname = lc(join(' ', @arg));
$cname =~ s/\b(\w)/\u$1/g; # capitalize the first letter of each word $cname =~ s/\b(\w)/\u$1/g; # capitalize the first letter of each word
my $cname_ = $cname =~ s/ /_/g;
if (!defined($username)) { if (!defined($username)) {
Irpg::Irc::notice("You are not logged in.", $usernick); Irpg::Irc::notice("You are not logged in.", $usernick);
return; return;
...@@ -423,7 +424,7 @@ sub chclass { ...@@ -423,7 +424,7 @@ sub chclass {
s/Irpg\/Classes\/(\w+)\.pm/$1/; s/Irpg\/Classes\/(\w+)\.pm/$1/;
push @classes, $_; push @classes, $_;
} }
if (!grep { $cname eq $_ } @classes) { if (!grep { $cname_ eq $_ } @classes) {
Irpg::Irc::privmsg("I know you are a very special unique person ". Irpg::Irc::privmsg("I know you are a very special unique person ".
"with your very own feelings, sensitivity, emotions, ". "with your very own feelings, sensitivity, emotions, ".
"competences and everything, but you really can't be ". "competences and everything, but you really can't be ".
...@@ -437,8 +438,8 @@ sub chclass { ...@@ -437,8 +438,8 @@ sub chclass {
$source) $source)
} }
else { else {
eval "require Irpg::Classes::$cname"; eval "require Irpg::Classes::$cname_";
my $new_class = eval 'Irpg::Classes::'.$cname.'->new($rps->{$username}{stats})'; my $new_class = eval 'Irpg::Classes::'.$cname_.'->new($rps->{$username}{stats})';
if ($new_class) { if ($new_class) {
$rps->{$username}{class} = $new_class; $rps->{$username}{class} = $new_class;
Irpg::Main::penalize($username, 'chclass'); Irpg::Main::penalize($username, 'chclass');
......
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