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

choosing your adversary for an action costs 2 points

parent 70977453
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -401,6 +401,14 @@ sub do_action { ...@@ -401,6 +401,14 @@ sub do_action {
"an undefined deed, but collapses out of exhaustion."); "an undefined deed, but collapses out of exhaustion.");
return; return;
} }
if ($rps->{$username}{action} < 2 && exists($arg[0])) {
Irpg::Irc::notice("You do not have enough energy to ".
"look for anyone.", $usernick);
Irpg::Irc::chanmsg("$username tries to contact someone, but ".
pronoun(2, $rps->{$username}{gender})." call dies with ".
pronoun(2, $rps->{$username}{gender})." breath.");
return;
}
my @opps = grep { $rps->{$_}{online} && $username ne $_ } keys(%$rps); my @opps = grep { $rps->{$_}{online} && $username ne $_ } keys(%$rps);
if (!@opps) { if (!@opps) {
Irpg::Irc::notice("Your call echoes in the ambient silence...",$usernick); Irpg::Irc::notice("Your call echoes in the ambient silence...",$usernick);
...@@ -430,6 +438,8 @@ sub do_action { ...@@ -430,6 +438,8 @@ sub do_action {
} }
elsif (exists($arg[0])) { elsif (exists($arg[0])) {
$p2 = $arg[0]; $p2 = $arg[0];
# choosing your adversary cost an extra action point
$rps->{$username}{actions}--;
} }
else { else {
$p2 = $opps[int(rand(@opps))]; $p2 = $opps[int(rand(@opps))];
...@@ -442,7 +452,6 @@ sub do_action { ...@@ -442,7 +452,6 @@ sub do_action {
my $p1_res = "[$ret_action->{p1roll}/$ret_action->{p1sum}]"; my $p1_res = "[$ret_action->{p1roll}/$ret_action->{p1sum}]";
my $p2_res = "[$ret_action->{p2roll}/$ret_action->{p2sum}]"; my $p2_res = "[$ret_action->{p2roll}/$ret_action->{p2sum}]";
#my $mesg = "$p1 $p1_res has come upon $p2 $p2_res and ";
my $mesg = ''; my $mesg = '';
if ($action_type eq 'fight') { if ($action_type eq 'fight') {
......
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