Werewolf: Fixed various warnings.

This commit is contained in:
Elijah Perrault committed 2011-04-10 22:48:09 -06:00
1 parent a328fc45cd
commit a2975d4859
2 files changed
+19 -16

No files matched your search

+1
View File
@@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log
3.0 Indev
===============================================================================
* Werewolf: Fixed various warnings.
* Werewolf: Handful of bugs fixed, timeouts rewritten, wolf assignment
rewritten. (see ROLES:Werewolf)
* Werewolf: Fixed an annoyance in VOTES.
+18 -16
View File
@@ -1228,22 +1228,24 @@ sub _getrole {
my ($plyr, $lev) = @_;
my $role;
if ($lev == 1) {
if ($PLAYERS{$plyr} =~ m/w/xsm) { $role = 'wolf' }
elsif ($PLAYERS{$plyr} =~ m/s/xsm) { $role = 'seer' }
elsif ($PLAYERS{$plyr} =~ m/h/xsm) { $role = 'harlot' }
elsif ($PLAYERS{$plyr} =~ m/g/xsm) { $role = 'guardian angel' }
elsif ($PLAYERS{$plyr} =~ m/d/xsm) { $role = 'detective' }
elsif ($PLAYERS{$plyr} =~ m/(v|t)/xsm) { $role = 'villager' }
}
elsif ($lev == 2) {
if ($PLAYERS{$plyr} =~ m/w/xsm) { $role = 'wolf' }
elsif ($PLAYERS{$plyr} =~ m/s/xsm) { $role = 'seer' }
elsif ($PLAYERS{$plyr} =~ m/h/xsm) { $role = 'harlot' }
elsif ($PLAYERS{$plyr} =~ m/g/xsm) { $role = 'guardian angel' }
elsif ($PLAYERS{$plyr} =~ m/d/xsm) { $role = 'detective' }
elsif ($PLAYERS{$plyr} =~ m/t/xsm) { $role = 'traitor' }
elsif ($PLAYERS{$plyr} =~ m/v/xsm) { $role = 'villager' }
if (exists $PLAYERS{$plyr}) {
if ($lev == 1) {
if ($PLAYERS{$plyr} =~ m/w/xsm) { $role = 'wolf' }
elsif ($PLAYERS{$plyr} =~ m/s/xsm) { $role = 'seer' }
elsif ($PLAYERS{$plyr} =~ m/h/xsm) { $role = 'harlot' }
elsif ($PLAYERS{$plyr} =~ m/g/xsm) { $role = 'guardian angel' }
elsif ($PLAYERS{$plyr} =~ m/d/xsm) { $role = 'detective' }
elsif ($PLAYERS{$plyr} =~ m/(v|t)/xsm) { $role = 'villager' }
}
elsif ($lev == 2) {
if ($PLAYERS{$plyr} =~ m/w/xsm) { $role = 'wolf' }
elsif ($PLAYERS{$plyr} =~ m/s/xsm) { $role = 'seer' }
elsif ($PLAYERS{$plyr} =~ m/h/xsm) { $role = 'harlot' }
elsif ($PLAYERS{$plyr} =~ m/g/xsm) { $role = 'guardian angel' }
elsif ($PLAYERS{$plyr} =~ m/d/xsm) { $role = 'detective' }
elsif ($PLAYERS{$plyr} =~ m/t/xsm) { $role = 'traitor' }
elsif ($PLAYERS{$plyr} =~ m/v/xsm) { $role = 'villager' }
}
}
if (!$role) { $role = 'person' }