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],
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__ . '::'};
};
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) {
MSG_PLAYERS_ALIVE => sub {
@args = sort @args;
- say "Players alive: ", join ', ', @args
+ say 'Players alive: ', join ', ', @args
},
MSG_DEATH => sub {
push @{$actions[$delay]->{$type}}, \%args
}
-sub doaction {
+sub doaction { ## no critic (ProhibitExcessComplexity)
my ($type, $args) = @_;
my %args = %$args;
my $source = $args{source};
# 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);
}
}
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).
--- /dev/null
+severity = 1
+
+[-BuiltinFunctions::ProhibitComplexMappings]
+[-CodeLayout::RequireTidyCode]
+[-ControlStructures::ProhibitPostfixControls]
+[-ControlStructures::ProhibitUnlessBlocks]
+[-Documentation::PodSpelling]
+[-Documentation::RequirePodLinksIncludeText]
+[-InputOutput::RequireBracedFileHandleWithPrint]
+[-InputOutput::RequireCheckedClose]
+[-InputOutput::RequireCheckedSyscalls]
+[-Modules::ProhibitAutomaticExportation]
+[-References::ProhibitDoubleSigils]
+[-RegularExpressions::ProhibitEnumeratedClasses]
+[-RegularExpressions::ProhibitUnusualDelimiters]
+[-RegularExpressions::RequireBracesForMultiline]
+[-RegularExpressions::RequireLineBoundaryMatching]
+[-Subroutines::RequireFinalReturn]
+[-ValuesAndExpressions::ProhibitConstantPragma]
+[-ValuesAndExpressions::ProhibitEmptyQuotes]
+[-ValuesAndExpressions::ProhibitLeadingZeros]
+[-ValuesAndExpressions::ProhibitMagicNumbers]
+[-ValuesAndExpressions::ProhibitNoisyQuotes]
+[-Variables::ProhibitLocalVars]
+[-Variables::ProhibitPackageVars]
+[-Variables::ProhibitPunctuationVars]
+
+[BuiltinFunctions::ProhibitStringyEval]
+allow_includes = 1
+
+[RegularExpressions::RequireExtendedFormatting]
+minimum_regex_length_to_complain_about = 20
+
+[Documentation::RequirePodSections]
+lib_sections = NAME | SYNOPSIS | DESCRIPTION | AUTHOR | COPYRIGHT AND LICENSE
+script_sections = NAME | SYNOPSIS | DESCRIPTION | AUTHOR | COPYRIGHT AND LICENSE
+
+[Subroutines::RequireArgUnpacking]
+short_subroutine_statements = 5
+allow_subscripts = 1
+
+[TestingAndDebugging::ProhibitNoWarnings]
+allow_with_category_restriction = 1