Right now the only thing that still tracks accounts if DISABLE_ACCOUNTS
is True is stats stuff (in sqlite), as I'm unsure of how we want to
handle that for when accounts aren't enabled; likely track by nick but
unsure on that right now.
This further implements issue #112 but doesn't fix it entirely yet.
Decoupled ROLE_REVEAL from impacting !stats, added new STATS_TYPE.
ROLE_REVEAL is now a string:
- on = roles revealed on death
- off = roles not revealed on death
- team = user's team revealed on death but not their role
STATS_TYPE is also a string:
- default = stats are calculated as if a villager or nonplayer was
manually tracking who was what; this leads to !stats not revealing
any information that is not publicly known
- accurate = what it used to be with a couple modifications; all roles
are shown (VG and time lord are no longer lumped with villager),
alpha wolf and lycans turning are hidden, nothing else is hidden
(so you can see what amnesiac turned into or when clone turns)
- team = only shows number of people on each team, calculated the same
way as accurate
- disabled = stats are disabled, doing !stats only serves as a mass-ping
of alive players
Removed random_reveal/random_noreveal hack
- !fgame random=role reveal:on|off does the same thing as the hack used
to do.
Allow all game modes to take arguments (aka the blah in roles=blah).
- Allowed arguments are "role reveal" (on/off/team), "stats type"
(default/accurate/team/disabled), and "abstain"
(enabled/restricted/disabled).
- roles obviously still allows for taking individual roles as arguments
as well as specifying a default role, however this functionality is
not available for any other gamemode.
- if any custom options are set as a result of this or changing them in
game mode constructors, players will be informed of which options are
in play.
Performing !frole will force STATS_TYPE from default to accurate, this
is done because the default logic is based not on what roles are
currently in existence, but rather what roles the game was started with
and what transformations could have applied to them. !frole throws a
complete monkey wrench in that to the point where it is impossible to
nicely recover.
Clone and Traitor are now unconditionally blacklisted for amnesiac, as
the additional logic to support them in default !stats is incredibly
complex and as such was not done for this PR.
Matchmaker is conditionally blacklisted for amnesiac if amnesiacs turn
after the first night. It is an allowed choice (unless it appears on the
config blacklist) if amnesiacs turn night 1.
Turncoats initially start off village-aligned, but can change which team
they're on by using the !side command. Turncoats cannot change sides two
nights in a row, and can use !pass if they don't wish to change sides on
any given night.
Seers and detectives see turncoats as turncoats, augurs see them as
having a grey aura. I was initially toying with det and augur seeing
them as their currently-chosen side and for mystics of the opposite team
to detect them, but since they can flip-flop an unlimited number of
times a night that info would be useless at best and misleading at
worst.
These commands are completely useless, they just confuse people. I just
had someone ask me whether it would bring them back to the game, with
their role and everything. If an op wants to talk in the middle of the
game, there are other ways to do that. This isn't even being used
anymore.
Roles are revealed upon death, but not shown in !stats.
This will be used for the random game mode with a 50% chance.
The variant used is displayed when the game is started, and
admins can force a specific variant with !fgame.
Also, ignore conceal_roles in !stats, because partial role reveal
handles that now.
It will now return as soon as it finds the role for the player,
instead of calling var.list_players_and_roles every single time.
I haven't tested in a real-world scenario, but in a test game
with 10000 players (don't ask), the speed improvement is very clear
(~1-2s per player when sending out nighttime PMs instead of ~10s).
!fsend is a very dangerous command if abused (up there with exec), and
should be properly admin-only instead of allowed to be given out to
non-admins. Unlike fsay/fact, there is no easy way to restrict fsend
when a non-admin uses it.
_collections is the C implementation (and where defaultdict lies), and
is as such already loaded when the interpreter is launched. collections
imports a bunch of other useless stuff we're not interested in.
- You can now use "-cmds" to group by command rather than user. This is
useful to, say, check who is allowed to use !revealroles.
- The output is now sorted alphabetically, which should make visual
navigation much easier.
- The command character is no longer prefixed to the commands, as I feel
like it's just a waste of space.
- Long messages are now broken properly, using var.break_long_message().
After a discussion in ##werewolf-dev, we've decided that if a majority
of the players wants a game mode, there's no reason not to allow it.
If a game mode is broken, it can be commented out in the code.
It's been found that larger game sizes heavily favors the village, this
reduces the village power significantly by removing obvious "claim"
roles and shifting more powerful roles later into the rotation where
they are less effective. This may be too much of a shift but that is
currently unknown.
- Shaman removed entirely
- Hunter now at 10p (from 15)
- GA now at 12p (from 10)
- Detective now at 15p (from 12)
This commit adds 3 new roles and changes the semantics of
kills/protections to work more like the impatience and pacifism totems.
- Add mystic and wolf mystic roles which can divine the number of
players still alive on the opposing team each night. These roles are
meant for games where role reveal is off as !stats gives the same info
otherwise.
- Add fallen angel which is a corrupted version of the guardian angel,
created when a guardian angel is bitten by alpha wolf. This role is
incredibly potent as they bypass all forms of protection on their
target. GAs corrupted this way also automatically gain the assassin
template.
- Protections/kills now stack and cancel each other out. As such, 2
kills but only 1 protection will result in the kill still happening.
- Fix help text for active alpha wolf to show the reworked bite command.
- If alpha bites someone who is going to die via other means that night,
refund the bite.
- If the bite was unsuccessful due to whatever reason and was refunded,
give a different message to alpha wolf to let them know that.
- Make adding more wolf roles in the future easier to do by replacing
some hardcoded lists with var.WOLF_ROLES.
Modify game over messages to read better
Modify win conds to remove unneeded ones and to also add in some "nobody
wins" conds that happen due to MAD or stalemates.
- Piper can now only win during daytime (this includes transition_day as
well as chk_decision)
- There is now at most 1 piper in charming regardless of player count,
more than 1 is simply overpowered and impossible to balance
- Replaced all \XX, \XXX and \xXX syntax by \uXXXX syntax
- Replaced all single-quotes messages by double-quotes ones where it
makes sense
- Replace all {} in string literals by {0} syntax (explicit over
implicit)
- Use x.startswith(("a", "e", "i", "o", "u")) instead of x[0] in ("a",
"e", "i", "o", "u")
- Remove list comprehensions where a simple generator would work
(reduces memory consumption where we can)
This fixes the bug where bot would crash on endgame through faftergame
without sending all messages, but introduces a new bug where someone can
quit between endgame and the bot's own quit, crashing it. This is an
extremely tight race condition, and shouldn't matter most of the time.
Further explanation in the big wall of text.
This adds the new piper role, whose goal is to charm all the other
players to win. The charmed players are told who else is charmed, every
night, and must find out the piper and lynch him to win. The piper is a
win stealer, and takes precedence over monster. They can select either
one or two targets, but unless there is exactly one person left to be
charmed, they must pick two targets.
Adds "warlock" role, which is wolf-aligned and in wolfchat. They cannot
kill, but they get to turn someone into a cursed villager each night
(the curse remains in place for the rest of the game). If they act
quickly enough, they can even impact the seer or oracle for the current
night!
Added werekitten role, which is seen villager by seer and is always
missed when shot (even by sharpshooter!). They can still nom tasty
villagers at night, including pesky visiting harlots.
Also fix minor bug with alpha wolf being roleswapped where night may end
prematurely due to not removing their kill selection.
If someone sets it to something other than a function (well, callable
object) or None, it's a programming mistake and we want that to raise an
exception rather than be silently ignored.
This makes up for removing the wait effect of !ping.
Default settings are one !wait every 240 seconds, initially two !wait
tokens, maximum (burst) of three tokens.
Villagers win if the wolves die, wolves win if all villagers are dead
(removes the stupid way of wolves winning for cultists to elect
themselves to be voted).
Also swap shaman and hunter so villagers always have a means of getting
a kill no matter the game size.
Lycans and people with lycanthropy totem now properly show up as wolves
if they turned during the game by removing special-case tracking for
them (var.LYCANS) and opting for the generic role-change tracking
(var.FINAL_ROLES) instead. Also, make it so that wolves don't "turn
into" wolves if they are afflicted with lycanthropy and then
subsequently targeted by wolves (which can happen with luck/misdirection
totem).
I'd prefer not using the same hook ID for anything, but it's convenient
to be able to unhook multiple related things at once, so we'll just
change the hook IDs again if it's ever needed. Nothing should be
hardcoding them anyway, so changing them shouldn't cause issues.