* 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.
For now, seer and wild child are done. There are some aspects of those
roles that are still incomplete, namely:
- sorcerer and alpha wolf handling of seer/oracle/augur is still in
wolfgame.py instead of via events
- wild child does not modify !stats
I could have avoided the two-liner in src/wolfgame.py, but it's much
more cleaner that way, even if it's not in src/gamemodes.py
To have the code in src/gamemodes.py means we'd have duplicated code
(and thus increased the chance of random bugs, as well as maintenance
burden). And practicality beats purity.
Can be either time-based or points-based. Also, made fwarn a bit smarter
at guessing what the user actually wanted to do based on the parameters
given to it. Warnings now always require acknowledgement, because that
paves the way for a future commit only beginning stasis once a warning
is acknowledged.
Warnings also split off into their own file to declutter wolfgame.py a
bit (now only 9k lines, wooooo! >_>)
Does not play nice with eir, that functionality isn't going to be in the
bot itself but rather some custom code in lykos (hooking into privmsg).
Before a winner of "" indicated abnormal game stop, so it wasn't logged;
add a new log parameter to account for those so we can free up "" for
games wherein nobody should win but the game should still be logged.
Also make the everyone dying condition use that.
All hostmask and account comparisons are now case-insensitive (nicks
still aren't, related to #217 -- changing nick sensitivity would break
everything in numerous places).
Also, refactor some things into other files where it makes sense to do
so, because putting unrelated things into the same commit is fun.
- alpha wolf can now both bite and kill during the same night
- any wolf death (instead of just one during day) is counted towards
activating alpha wolf
- fix role message to be more in line with other wolfteam messages
- Always use UTC (time issued was already UTC, but expiration was not)
- Remove some duplicate code about parsing expiration date
- Round dates to the nearest minute
- fflags no longer says things were modified on account "*" when they
weren't
- don't give an autowarning on kick anymore; if an op is kicking chances
are they'll be giving their own warning anyway
- attempt to make a backup copy of the database before migrating to new
schema
bug. Now it should actually work even if the user has no warnings.
Also don't list expired/deleted warnings as unacknowledged.
Warning expiration can now be modified via !fwarn set, and the default
expiration is now 30d instead of never (never can be manually specified
along with a handful of aliases that mean the same thing).
These allow for access control, and work pretty much exactly like they
do in atheme's ChanServ (the /cs flags and /cs template commands).
Also remove unused things from botconfig.py.example.
- fwarn/warn commands to view and manipulate warnings
- fstasis can now only decrease stasis, not add to it
- refreshdb command can sync bot game state with what is in the db
(including expiring any unexpired stasis or warnings)
- stasis now expires
- tempban is still not implemented and will not be implemented as
part of the PR (it will come later, if ever)
- sanctions can be automatically applied after warnings cross a
certain threshold; some defaults are configured
Wolf gunners are now added to var.GUNNERS. To facilitate !revealroles,
they are also automatically given the gunner template if they were not
already a gunner or sharpshooter (otherwise their bullet count was not
listed in !revealroles, although night role messages and !myrole worked
just fine).
- Redo prophet messages so that they don't split into multiple lines
- If prophet never reveals, don't bother making them pray twice
- Split prophet messages into different messages based on reveal setting
instead of putting it together piecemeal -- this allows for easier
customization/translation down the road.
And as thus we sat in darkness,
Each one busy in his prayers,
“We are lost!” the captain shouted,
As he staggered down the stairs.
But his little daughter whispered,
As she took his icy hand,
“Isn’t God upon the ocean,
Just the same as on the land?”
Then we kissed the little maiden,
And we spoke in better cheer;
And we anchored safe in harbor
When the morn was shining clear.
Commands starting with ! will no longer be relayed regardless of if one
is in wolfchat or deadchat. All wolf roles that issue commands now have
their commands properly relayed, so hiding commands this way isn't
really any issue.
This only happens for simultaneous deaths (e.g. night deaths), as
chained deaths are resolved in a fashion that makes it impossible for
the clone to know he is also dying until after he inherits the new role.
Closes#214
If both seer and target have deceit totem, the result should be printed normally (e.g. the totems cancel out). They were not doing that previously, as it would route all non-village non-wolf roles into villager (e.g. harlot -> villager). Let's fix that.
This ensures that code paths that should not be run if the user is stasised are not run if we don't know the user's status. Generally we don't know the user's status because they are not in the main channel, and therefore allowing them to effectively bypass stasis by not being around is a bad thing. We return -1 to differentiate between actual stasis, and because -1 is still True when cast to boolean. This may have the effect of giving some very odd-looking error messages but that's a very minor issue.
Now observes every role that acts at night as "not in bed" EXCEPT:
- matchmaker
- assassin
- clone
- turncoat
matchmaker and clone are night 1-only, and allowing them to be observed
would only serve to reduce werecrow power. assassin and turncoat's night
actions are passive and not anything that would require staying up late
at night or moving around at night for.
In the event that a luck or misdirection totem is applied, wolf-aligned
roles are now also observable as not in bed should they act. This will
also apply if RESTRICT_WOLFCHAT is used to take those roles out of
wolfchat.
Admin-only command (can be !fallowed) to spectate deadchat or wolfchat.
The person spectating is not revealed to anyone in the chat, however
they can see everyone in that chat.
If used outside of debug mode, it is restricted a la !revealroles where
it cannot be used by an alive player or an active vengeful ghost.
Notably, this will cause the nick to be consdered "dced" so they do not
receive a win, and it applies stasis just as !quit would (preventing the
nick from joining deadchat, among other uses for stasis).
Fixes#183
Instead of treating dullahan as if they have a permanent retribution and
desperation totem, they now instead kill a random target in their list
should they die. If all of their targets are dead, nothing special
happens when they die.