fix fool wins with lover setting, adjust lots of numbers

This commit is contained in:
jacob1 2014-11-30 17:08:09 -05:00
parent 9e83ac941c
commit 47f3b0e4d3
2 changed files with 13 additions and 12 deletions

View File

@ -1186,7 +1186,6 @@ def stop_game(cli, winner = ""):
iwon = False
elif rol == "fool" and "@" + splr == winner:
iwon = True
winner = "fool"
elif rol == "monster" and splr in survived and winner == "monsters":
iwon = True
elif splr in var.LOVERS and splr in survived:
@ -1318,7 +1317,7 @@ def chk_win(cli, end_game = True):
if lpl < 1:
message = "Game over! There are no players remaining. Nobody wins."
winner = ""
winner = "none"
elif lwolves == lpl / 2:
if len(var.ROLES["monster"]) > 0:
plural = "s" if len(var.ROLES["monster"]) > 1 else ""
@ -4868,14 +4867,14 @@ def start(cli, nick, chann_, rest):
for gamemode in var.GAMEMODE_VOTES.values():
if len(villagers) >= var.GAME_MODES[gamemode][1] and len(villagers) <= var.GAME_MODES[gamemode][2]:
votes[gamemode] = votes.get(gamemode, 0) + 1
voted = [gamemode for gamemode in votes if votes[gamemode] == max(votes.values()) and votes[gamemode] > 2*len(villagers)/5]
voted = [gamemode for gamemode in votes if votes[gamemode] == max(votes.values()) and votes[gamemode] >= len(villagers)/2]
if len(voted):
cgamemode(cli, random.choice(voted))
else:
possiblegamemodes = []
for gamemode in var.GAME_MODES.keys():
if len(villagers) >= var.GAME_MODES[gamemode][1] and len(villagers) <= var.GAME_MODES[gamemode][2] and var.GAME_MODES[gamemode][3] > 0:
possiblegamemodes += [gamemode]*(var.GAME_MODES[gamemode][3]+votes.get(gamemode, 0)*7)
possiblegamemodes += [gamemode]*(var.GAME_MODES[gamemode][3]+votes.get(gamemode, 0)*15)
cgamemode(cli, random.choice(possiblegamemodes))
for index in range(len(var.ROLE_INDEX) - 1, -1, -1):
@ -6128,8 +6127,9 @@ if botconfig.DEBUG_MODE or botconfig.ALLOWED_NORMAL_MODE_COMMANDS:
return
if rest:
rest = mode = rest.lower().split()[0]
if rest not in var.GAME_MODES.keys():
rest = mode = rest.strip().lower()
if rest not in var.GAME_MODES.keys() and not rest.startswith("roles"):
rest = rest.split()[0]
#players can vote by only using partial name
matches = 0
for gamemode in var.GAME_MODES.keys():

View File

@ -339,7 +339,7 @@ class ChangedRolesMode(object):
except ValueError:
raise InvalidModeException("A bad value was used in mode roles.")
@game_mode("default", minp = 4, maxp = 24, likelihood = 10)
@game_mode("default", minp = 4, maxp = 24, likelihood = 15)
class DefaultMode(object):
"""Default game mode."""
def __init__(self):
@ -510,7 +510,7 @@ class DrunkFireMode(object):
"sharpshooter" : ( 2 , 2 , 3 , 3 , 4 ),
})
@game_mode("noreveal", minp = 4, maxp = 21, likelihood = 2)
@game_mode("noreveal", minp = 4, maxp = 21, likelihood = 0)
class NoRevealMode(object):
"""Roles are not revealed when players die."""
def __init__(self):
@ -538,7 +538,7 @@ class NoRevealMode(object):
"cursed villager" : ( 0 , 1 , 1 , 1 , 1 , 1 , 2 , 2 ),
})
@game_mode("lycan", minp = 7, maxp = 21, likelihood = 2)
@game_mode("lycan", minp = 7, maxp = 21, likelihood = 1)
class LycanMode(object):
"""Many lycans will turn into wolves. Hunt them down before the wolves overpower the village."""
def __init__(self):
@ -579,11 +579,12 @@ class AmnesiaMode(object):
# Credits to Metacity for designing and current name
# Blame arkiwitect for the original name of KrabbyPatty
@game_mode("aleatoire", minp = 4, maxp = 24, likelihood = 2)
@game_mode("aleatoire", minp = 4, maxp = 24, likelihood = 3)
class AleatoireMode(object):
"""Game mode created by Metacity and balanced by woffle."""
def __init__(self):
self.SHARPSHOOTER_CHANCE = 1 # SHAMAN , CRAZED SHAMAN
self.SHARPSHOOTER_CHANCE = 1
# SHAMAN , CRAZED SHAMAN
self.TOTEM_CHANCES = { "death": ( 4/20 , 1/15 ),
"protection": ( 8/20 , 1/15 ),
"silence": ( 2/20 , 1/15 ),
@ -795,7 +796,7 @@ def update_game_stats(gamemode, size, winner):
vwins += 1
elif winner == "monsters":
mwins += 1
elif winner == "fool":
elif winner.startswith("@"):
fwins += 1
total += 1