Commit Graph

43 Commits

Author SHA1 Message Date
Bradley Haljendi
a42da38e8e Do not ping players with unacked warnings
This fixes issue #255 by preventing unacked warnings from being pinged entirely (whether or not they would cause stasis).
2018-01-19 08:37:43 -07:00
skizzerz
c9e1845fbb Convert get_reveal_role to use Users 2018-01-10 15:18:41 -07:00
skizzerz
e8408214f5 Kill proxy with fire
It's not needed since we can import at function scope. Also make
chk_nightdone implicit for role commands executed during night, so we
can remove tons of redundant calls.
2017-12-29 16:49:09 -06:00
skizzerz
b677400ce4 General cleanup
- Expand skel.py to be more useful
- Remove circular dependency from utilities.py. It *CANNOT* globally
  import users.
- Remove unused functions from utilities.py and make some others proxy
  through to user-aware functions to ensure functionality stays the
  same.
- Remove duplicate event listener.
- Clarify some comments about stats.
2017-12-29 16:10:32 -06:00
jacob1
15e0d9f503 convert most botconfig.NICK usages to users.Bot.nick 2017-12-29 11:30:04 -05:00
skizzerz
95da346344 Fix mudkip 2017-12-13 21:06:56 -06:00
skizzerz
4fde6f9bae Convert var.ROLES and var.ORIGINAL_ROLES to Users
This gets rid of the (dced) hack, with var.DCED_LOSERS taking its place.
Succubus was not touched, as there is already a PR which converts it,
although the succubus events in other files were touched.

Some sites were updated to be (more) Users-aware, while others replaced
it with an old deprecated get_roles() API. As more things get converted,
these will hopefully get eliminated as well. A FIXME comment was added
to all such occurrences.
2017-12-12 16:25:56 -06:00
jacob1
7a003e4cb7 convert var.SPECTATING_WOLFCHAT to users, prevent !spectate deadchat 2017-11-05 20:11:05 -05:00
Vgr E. Barry
370b2c6ed2 Some function and event updates 2017-08-23 22:06:43 -04:00
skizzerz
8a8a79627f Overhaul how templates work
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.
2017-03-31 12:45:53 -05:00
Andrew "FastLizard4" Adams
e2db3b28a9 In team reveal, be more clear about team names
When a game is being played with team reveal instead of role reveal, use
explicit team names instead of just "wolf" or "villager" to make it clear that
we're referencing teams, not the similarly-named roles.
2017-03-01 14:08:03 -08:00
Fudster
0a6c6200ab Fix for #176 improve invalid role errors 2017-02-05 12:39:52 -05:00
Ryan Schmidt
69fa7d377f Split succubus (#284)
* 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
2017-01-27 14:08:41 -05:00
Vgr E. Barry
accba42ea2 Change var.ALL_PLAYERS to hold User instances
Also some unrelated things
2017-01-17 13:45:38 -05:00
skizzerz
ae5b39c36f Split traitor
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.
2016-11-16 22:19:54 +01:00
Vgr E. Barry
7c753b2810 Improve the error handler
Also, thanks to @nyuszika7h for the uuid idea. I took his early draft and implemented it properly as part of the refactoring I did.
2016-11-06 21:43:01 -05:00
Vgr E. Barry
04e7f952d3 Improve error handler 2016-11-02 15:18:32 -04:00
nyuszika7h
6932c42574 Fix traceback syntax highlighting
Additional text at the end (local variables) has a red border for each
line with py3tb, but not with pytb.
2016-11-01 23:16:55 +01:00
Vgr E. Barry
a2257ce692 Fix pastebin_tb to actually use the passed traceback 2016-10-30 22:32:54 -04:00
jacob1
ab8a05ac1b log errors to errors.log again 2016-10-19 21:01:41 -04:00
skizzerz
9f21eb65c3 Fix gstats reporting 'foo wins' 2016-09-23 18:52:21 -05:00
nyuszika7h
01b7cea83c Use regular lowercase for hosts + minor code cleanup 2016-09-11 19:59:46 +02:00
nyuszika7h
21c3931b7b Reply in private at night if DEVOICE_DURING_NIGHT is on 2016-09-09 21:29:02 +02:00
skizzerz
b5571c82e0 split VG 2016-08-15 18:59:24 -05:00
Vgr E. Barry
fe4ccc3ca7 Add __all__ to src/utilities.py 2016-08-13 13:03:03 -04:00
nyuszika7h
3f5e3fce78 Add syntax highlighting to the pastebin error URLs 2016-08-11 20:31:19 +02:00
nyuszika7h
3f3b5bf1d7 Use ptpb.pw as pastebin with vanity IDs 2016-08-10 23:43:14 +02:00
Ryan Schmidt
672c01ef96 flog ALL the errors 2016-08-08 18:44:10 -07:00
skizzerz
10f94de9b3 Initial work splitting off roles
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
2016-08-08 19:21:05 -05:00
jacob1
75b386917e Fix var.CASEMAPPING error during db upgrade 2016-08-06 12:38:59 -04:00
Ryan Schmidt
cd3f9fc345 Add tempban sanction (#238)
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).
2016-08-02 17:57:09 -04:00
skizzerz
1b7b2f6799 Make discrimination based on case ilegel
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.
2016-07-27 17:03:34 -05:00
Vgr E. Barry
75447310f3 Tweak definition of is_fake_nick
Doesn't change much, just avoids compiling a regex pattern everytime,
and it only calls one function.
2016-06-12 14:37:33 -04:00
nyuszika7h
9ea9a1a317 Fix modelines in other files 2016-05-11 16:09:19 +02:00
nyuszika7h
dfb23a1892 reply(): Add prefix_nick option
This will prefix the nickname of the user if the bot replies in-channel.
2016-04-19 15:49:54 +02:00
jacob1
5108822594 use var.GAME_PLASES for reply() in utilities.py 2016-04-03 22:47:28 -04:00
skizzerz
debf9c78ff Horrible hacky error fix to make pm available in proxy/decorators 2015-11-15 18:42:20 -06:00
skizzerz
6f83a909df Introduce proxies as a means of breaking circular import chains 2015-11-15 13:12:22 -06:00
skizzerz
d3676948c3 Add !fspectate command
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.
2015-11-14 21:04:43 -06:00
jacob1
c350603ea0 add reply() command, cleans up some logic with deciding where to send messages
This also easily fixes the bug where commands in alternate channels would be sent to a /notice
2015-11-04 00:07:35 -05:00
jacob1
b2147cd033 don't message fake nicks in mass_privmsg 2015-10-30 20:06:00 -04:00
Vgr E. Barry
2cf3852518 Fix circular imports 2015-10-30 17:38:39 -04:00
jacob1
55070fd44b add utilities.py, which contains some functions possibly needed by gamemode events
this also fixes it so priest death events finally happen
2015-10-30 17:03:54 -04:00