X-Git-Url: http://git.ieval.ro/?p=mafia.git;a=blobdiff_plain;f=lib%2FMafia.pm;h=5c3f788d2a04006d31fa8c1a9c2d62fc6195c147;hp=2b943b4ddf7b6f68448cd3f73ecf547644e8ad15;hb=6a7d850e1b1c4a34f69bac2a99fbb74c32e256df;hpb=061dc5c793b0afe6bd7b8c3aaf9da1df8402aef6 diff --git a/lib/Mafia.pm b/lib/Mafia.pm index 2b943b4..5c3f788 100644 --- a/lib/Mafia.pm +++ b/lib/Mafia.pm @@ -29,7 +29,7 @@ BEGIN { defconst qw/ACT_KILL ACT_LYNCH ACT_PROTECT ACT_GUARD ACT_ROLEBLOCK ACT_GUNCHECK ACT_TRACK ACT_WATCH ACT_ROLECOP ACT_COP ACT_TRACK_RESULT ACT_WATCH_RESULT ACT_HIDE/; } -use constant +{ +use constant +{ ## no critic (Capitalization) townie => town, ROLE => [vanilla, goon, doctor, vigilante, roleblocker, jailkeeper, gunsmith, tracker, watcher, bodyguard, rolecop, cop, sk, hider], FACTION => [mafia, town], @@ -46,7 +46,7 @@ my %INVESTIGATIVE_ACTIONS_HASH = map { $_ => 1 } @{INVESTIGATIVE_ACTIONS()}; my %GUNROLES_HASH = map { $_ => 1 } @{GUNROLES()}; our @EXPORT = do { - no strict 'refs'; + no strict 'refs'; ## no critic (ProhibitNoStrict) grep { $_ !~ [qw/import/] and exists &$_ } keys %{__PACKAGE__ . '::'}; }; @@ -83,7 +83,7 @@ sub phase { return "Night $nightcnt" unless $isday; } -sub rolename { +sub rolename { ## no critic (RequireArgUnpacking) my %player = %{$players{$_[0]}}; my ($faction, $role) = ($player{faction}, $player{role}); if (defined $faction && $faction eq town && $role eq vanilla) { @@ -118,7 +118,7 @@ sub msg { MSG_PLAYERS_ALIVE => sub { @args = sort @args; - say "Players alive: ", join ', ', @args + say 'Players alive: ', join ', ', @args }, MSG_DEATH => sub { @@ -186,7 +186,7 @@ sub putaction { push @{$actions[$delay]->{$type}}, \%args } -sub doaction { +sub doaction { ## no critic (ProhibitExcessComplexity) my ($type, $args) = @_; my %args = %$args; my $source = $args{source}; @@ -201,10 +201,10 @@ sub doaction { # Copy this action to everybody hiding behind $target if (exists $tplayers{$target}{hiders}) { for my $target (@{$tplayers{$target}{hiders}}) { - my %args = %args; - $args{target} = $target; - $args{hidepierce} = 1; - doaction($type, \%args); + my %new_args = %args; + $new_args{target} = $target; + $new_args{hidepierce} = 1; + doaction($type, \%new_args); } } @@ -446,7 +446,7 @@ Mafia - easily moderate Mafia games night; -=head1 DESCRPTION +=head1 DESCRIPTION Mafia.pm is a Perl extension for easily moderating Mafia games. You don't even need to know Perl to use it (see L<"WHAT YOU NEED TO KNOW"> for details).