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

new classes

commands showing player info also show alignment
tabulation homogenized
parent de8c2de8
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
package Irpg::Classes::Cunning;
use strict;
use warnings;
use Irpg::Classes::Sneaky;
our @ISA = qw(Irpg::Classes::Sneaky);
sub new {
my ($class, $pl_stats) = @_;
# condition to enter the class
if ($pl_stats->['cha'] + $pl_stats->['dex'] >= 7) {
return undef;
}
my $self = $class->SUPER::new($pl_stats);
bless $self, $class;
$self->{NAME} = 'Cunning';
$self->{MOD_CHA} = 1.3;
$self->{MOD_DEX} = 1.3;
return $self;
}
1;
package Irpg::Classes::Enlightened;
use strict;
use warnings;
use Irpg::Classes::Apprentice;
our @ISA = qw(Irpg::Classes::Apprentice);
sub new {
my ($class, $pl_stats) = @_;
# condition to enter the class
if ($pl_stats->['int'] + $pl_stats->['wis'] >= 7) {
return undef;
}
my $self = $class->SUPER::new($pl_stats);
bless $self, $class;
$self->{NAME} = 'Enlightened';
$self->{MOD_WIS} = 1.3;
$self->{MOD_INT} = 1.3;
return $self;
}
1;
package Irpg::Classes::Fighter;
use strict;
use warnings;
use Irpg::Classes::Rookie;
our @ISA = qw(Irpg::Classes::Rookie);
sub new {
my ($class, $pl_stats) = @_;
# condition to enter the class
if ($pl_stats->['str'] + $pl_stats->['con'] >= 7) {
return undef;
}
my $self = $class->SUPER::new($pl_stats);
bless $self, $class;
$self->{NAME} = 'Fighter';
$self->{MOD_STR} = $pl_stats->{str}*1.3;
$self->{MOD_CON} = $pl_stats->{con}*1.3;
return $self;
}
1;
......@@ -184,8 +184,12 @@ sub login {
$rps->{$arg[0]}{nick} = $usernick;
$rps->{$arg[0]}{userhost} = $userhost;
$rps->{$arg[0]}{lastlogin} = time();
my $almt = $rps->{$arg[0]}{alignment};
$almt = $almt eq 'g' ? 'Good':
$almt eq 'e' ? 'Evil':
'Neutral';
Irpg::Irc::chanmsg("$arg[0], the level $rps->{$arg[0]}{level} ".
"$rps->{$arg[0]}{title} $rps->{$arg[0]}{class}->{NAME}, ".
"$rps->{$arg[0]}{title} $almt $rps->{$arg[0]}{class}->{NAME}, ".
"is now online from nickname $usernick. Next level in ".
duration($rps->{$arg[0]}{next}).".");
Irpg::Irc::notice("Logon successful. Next level in ".
......@@ -218,8 +222,12 @@ sub status {
Irpg::Irc::privmsg("No matching user found.",$source);
}
else {
my $almt = $rps->{$arg[0]}{alignment};
$almt = $almt eq 'g' ? 'Good':
$almt eq 'e' ? 'Evil':
'Neutral';
Irpg::Irc::privmsg("$asked: Level $rps->{$asked}{level} ".
"$rps->{$asked}{title} $rps->{$asked}{class}->{NAME}; ".
"$rps->{$asked}{title} $almt $rps->{$asked}{class}->{NAME}; ".
"Status: O".($rps->{$asked}{online}?"n":"ff")."line; ".
"TTL: ".duration($rps->{$asked}{next})."; ".
"Idled: ".duration($rps->{$asked}{idled})."; ".
......@@ -235,9 +243,13 @@ sub whoami {
Irpg::Irc::notice("You are not logged in.", $usernick);
}
else {
my $almt = $rps->{$arg[0]}{alignment};
$almt = $almt eq 'g' ? 'Good':
$almt eq 'e' ? 'Evil':
'Neutral';
Irpg::Irc::privmsg("You are $username, the level ".
"$rps->{$username}{level} $rps->{$username}{title} ".
"$rps->{$username}{class}->{NAME}. You have ".
"$almt $rps->{$username}{class}->{NAME}. You have ".
"$rps->{$username}{points} point(s) available, and ".
"$rps->{$username}{actions} action(s) you can trigger. ".
"Next level in ".duration($rps->{$username}{next}),
......
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