- revealroles is now enabled by default in normal mode
- spectate has been changed to require +a instead of +A
- fdie has been changed to require +F instead of +D;
unlike the other +D commands (restart, update), die requires
server access to get back up and is more dangerous.
- remove 'send' alias for fsend
- fgame is now enabled by default in normal mode
and has been changed to require +g instead of +d
- fnight has been changed to require +N instead of +d
- fday has been changed to require +N instead of +d
- fstart has been changed to require +S instead of +A
- fstop has been changed to require +S instead of +A
- fwait has been changed to require +w instead of +A
- all remaining commands which require +d (force/rforce/frole)
remain disabled by default in normal mode
- eval and exec can no longer be enabled in normal mode;
they function in debug mode only
Was already mostly in wolf.py, but this takes it out and lays groundwork
for splitting out var.DISEASED_WOLVES and base events that the new
berserker wolf can use.
* Split Mad Scientist
Related changes:
- MS now honors all protections instead of only caring about blessed
villagers
- Allow FA to bypass protection even if FA is applied as a template
- Make bodyguard swap themselves in as the assassination target rather
than blocking the attempt outright and suiciding. This means that
active protections on the bodyguard have a chance to save them as well.
- Redo some messages to make the above sound nice in the bot.
- Add some additional params to the assassinate event to see WHY the
assassination is happening (source) and WHO is doing the assassination
(killer; currently a nick but should be a user sometime in the future).
- Add a target data item to teh assassinate event so that listeners can
change who is being assassinated. Protection boilerplate has been
adjusted to account for this.
- Add helper function to get the targets, avoiding code duplication
Many of these aliases are words that begin sentences. Saying them in
wolfchat/deadchat then makes the bot pm random people with stuff. Let's
NOT do that, kthx. fact is also a word, so replacing that with fdo.
The dead player is already removed from var.ROLES by the time the event
fires. Also, tweak del_player event to make it much easier to support
arbitrary roles as not being the player's main role by changing nicktpls
to allroles (which is a set that includes mainrole). The assassinate
event is similarly tweaked.
They can't be shot during day, so they can't be shot at night either.
Add an event so that it can be easily handled once split (using the new
API, Vgr would be so proud of me).
Templates are still applied on game start according to
var.TEMPLATE_RESTRICTIONS, but now any arbitrary role can be applied as
a template during gameplay without breaking things horribly.
Speaking of breaking things horribly, things are probably broken
horribly due to this. It was lightly tested, but there's a lot of
fundamental stuff that changed.
mm = matchmaker, ms = mad scientist, vg = vengeful ghost
Additionally, allow all special keys to be queried via pstats in an
extensible manner (used for vg activated and vg driven off)
Also allow prefixing commands by their role name to remove ambiguity
should a person be multiple roles. For example, "seer see foo" and
"augur see foo" will now work if a person is both seer and augur
(whereas normal see foo would be ambiguous). A player will be directed
to use the unambiguous prefixed version if we detect that a role command
will fire multiple times for them (note: coming soon).
For sanity reasons, these role prefixes are implemented as exclusive
commands, meaning no other commands or command aliases may use the same
name. Clone needs to be special-cased in this regard, as clone is both a
role name and a command name.
It simply didn't work before now for a while (as in, you could still
join/start). Also make it function during join phase, because having
weird restrictions on which it does/doesn't disable the commands is
weird. The admin can still !fjoin/!fstart as needed if they do want to
run one more game after executing this command during join phase.
Eliminate stupid get_final_role event and instead simply don't add cubs
to var.FINAL_ROLES when they grow up into wolf. That var is only ever
used for end-game stats readouts, so there is no mechanical impact in
omitting adding something there.
Add new event to experimental stats to allow roles like cub and clone to
reflect role swaps when players die. Cubs growing up now shows up in
experimental stats.
Change the behaviour of fjoin in both normal and debug modes:
- Only joins fake nicks in debug mode;
- Only joins one person in normal mode, multiple in debug mode;
- Autocomplete nicks in both normal and debug modes.
* Split + buff succubus
When all succubi die, all entranced people now die along with them. This
should prevent an entranced person from ratting out the succubus early
on so that they go back to their team, as they lose now even if succubus
dies. One exception is if EVERY succubus idles out, then everyone that
is entranced is freed of entrancement, as it isn't their fault that they
didn't protect their friends in that case.
Dullahans now have succubi entirely removed from their list as the
likelihood they get unentranced is low, and it's easier to implement
this way.
Ensure that entranced people can vote along with ANY succubus, even if
that vote isn't the one that succeeded. Before there were cases where
they could vote along with succubus but still end up dying (particularly
in respect to a vote passing when a succubus abstained).
Clear up some message wording with regards to succubi.
Cleaned up chk_win_conditions and eliminated chk_traitor, so they make
much more sense now.
Also fixed minor issues, such as end-game saying "same number" of wolves
even if there are more wolves than villagers, hunter/vigilante dying
during night sometimes not clearing variables correctly (thus causing
premature night end) and some various stupidity going on with some old
code I wrote that doesn't have any visible effects.
* Combine all players into the same succubus death message
* Fix stylistic issues and succubus idling not working
var.ALL_PLAYERS update (for !swap) needs to happen before checking if the new user is in var.ALL_PLAYERS
pl is inaccurate during nick changes because the user's nick in var.ALL_PLAYERS is updated automatically but in var.ROLES isn't, therefore a user that changes nicks would never be returned in list_players()
one instance of prefix incorrectly changed to user.nick
If it is impossible for other (non-wolf) roles to have killed at night,
we do not deduct from the traitor count. This logic isn't perfect yet,
but should cover the majority of cases.
Don't start a new timer every time someone calls !latency, and make it
work even if automatic pinging is disabled. Also, moved the command to
handler.py per @Vgr255's suggestion.
In some cases, disconnection from the server can be unclean and won't be
noticed until the bot tries to send a message, which may never happen if
it did not disconnect during the game. To solve this problem, it will
now ping the server every 2 minutes by default, which will result in
a broken pipe error if the connection is dead. This won't be able to
detect netsplits where the server the bot is on stays online, because
those are impossible to correctly detect in every case.
This commit also adds a !latency command so that users can verify if the
bot is lagging.
Causing way too many bugs, need to use a more sane method of breaking
the cmd API, and only do so when it's actually ready to go. My
personal preference is to make the new API use @command instead of @cmd.
This reverts commits c90d35e6c0 and 5f5966a8b4.
This wasn't working before, because the mode checking was wrong. Furthermore, there may have been some race conditions; this was mitigated by an earlier commit, which allowed delaying some channel handling operations.
As part of this, adjust team and accurate stats to no longer hide any
information. For team stats in particular, it was very misleading to
list traitor as villager, because it gives the village the impression
they have more time than they actually do (i.e. 2 wolfteam 5 vilteam
actually means 3 wolfteam 4 vilteam but that is not obvious). As team
stats were changed, team reveal was also changed to disregard hidden
traitor, so that the two can't be correlated to pick out if traitor died
(if traitor was revealed as vilteam but stats decremented wolfteam, that
would guarantee that traitor died).
Also commit groundwork for the stats rewrite, hidden behind an
"experimental" stats type (so it is not on by default). It is still very
WIP, many things do not yet work with it.
* RULES is now not defined in settings.py, only in botconfig.py.
* If there are no rules specified, a default message is shown
instructing users to configure it.
* The "#CHANNEL channel rules: " prefix is now automatically prepended
(skipped if the string already contains that,
for backwards-compatibility).
* The prefix and the no-rules message can be customized
as they are in messages.py now.
In join phase, var.PLAYERS is empty, so var.ALL_PLAYERS needs to be
checked instead.
(While I'm at it, changed it to <= 9 rather than < 10, just for
consistency with the rest of the code.)
Fixes#263.
Also adjust revealing totem so that it always fires after mayor, in case
someone has both. Before it would depend on the order the files were
imported, which could lead to oddities down the road.
This fixes#256
This also does some more bits of rudimentary user handling, but most of it still remains to be done.
Note: This adds DEV_PREFIX to botconfig and LOG_PREFIX to settings (var), make sure to properly update your bot!
The reason we defer pulling is because if an error happens before
restarting, the line numbers in the traceback may not reflect the
actual line numbers since the code has changed.
It was slightly annoying that there was no way to do this via a command. Should also have these expire if someone !quits to end a game, someone should work on that :)
Also capitalized the role names and "Total wins" for consistency with
!pstats and upgraded the schema to create a new index for game lookups
without specifying the game mode.
Also fixes some bugs with using stop_propagation instead of
stop_processing in events (the former does absolutely nothing).
Added a skeleton file to assist with adding new roles, contains the
needed imports on top and vim modeline on the bottom.
Yes, these are all related and need to go in the same commit, stop
throwing things at me.
Just like when a game is canceled due to taking too long to start,
although in this case players may notice that the bot restarted, it
doesn't hurt to make it clear to them.
This has a number of related changes in other files due to needing to
re-prioritize events and fixing other bits of code to play more nicely
with split-off totems. Alpha wolf handling was moved after protection
handling because it should've been that way to begin with, and as part
of splitting off protection totem it needed to be split at the same
time. Same with fallen angel changes with how protection now adjusts the
killers lists.