X-Git-Url: http://git.ieval.ro/?p=mafia.git;a=blobdiff_plain;f=lib%2FMafia.pm;h=5c3f788d2a04006d31fa8c1a9c2d62fc6195c147;hp=40eeaba1989f1932d71db666af4c0ccf79f324b2;hb=6a7d850e1b1c4a34f69bac2a99fbb74c32e256df;hpb=2f8ca3114cd2e460cea51702808e74f103ed13a5 diff --git a/lib/Mafia.pm b/lib/Mafia.pm index 40eeaba..5c3f788 100644 --- a/lib/Mafia.pm +++ b/lib/Mafia.pm @@ -1,6 +1,6 @@ package Mafia; -use 5.014000; +use 5.010001; use strict; use warnings; use parent qw/Exporter/; @@ -8,7 +8,7 @@ use parent qw/Exporter/; use constant; use Storable qw/dclone/; -our $VERSION = '0.001001'; +our $VERSION = '0.001002'; sub defconst { constant->import($_ => $_) for @_ } @@ -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). @@ -575,7 +575,7 @@ Marius Gavrilescu, Emarius@ieval.roE =head1 COPYRIGHT AND LICENSE -Copyright (C) 2013 by Marius Gavrilescu +Copyright (C) 2013-2015 by Marius Gavrilescu This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or,