Commit Graph

532 Commits

Author SHA1 Message Date
Lukas Martini
36adb370b4 Demoniac winning takes precedence over monster 2015-10-30 12:19:46 -07:00
skizzerz
627efab5ec Fix priest death in sleepy, update alpha messages for doomsayer 2015-10-30 12:19:21 -07:00
jacob1
7915c56b34 fix succubi related win conditions
entranced wolves could still win with wolves, dead succubi didn't win when succubi team did, maybe others?
2015-10-30 14:06:50 -04:00
Vgr E. Barry
cbed18fd93 Fix the chk_nightdone event not working properly 2015-10-30 12:18:11 -04:00
Vgr E. Barry
6e5203be2d Use a less misleading name for wolflist checks 2015-10-30 11:44:45 -04:00
skizzerz
48b5104b11 Fix doomsayer prematurely ending night if they're killing 2015-10-30 01:18:18 -05:00
skizzerz
9b23f38b65 Add sleepy events (mostly done)
Add back in var.DYING so that events can use it, also added del_player
event.
2015-10-30 01:09:24 -05:00
skizzerz
8dd2bf4e56 Fix issues with priest, cleanup RESTRICT_WOLFCHAT
Move a lot of duplicated logic into helper functions so that it is easy
to ensure that wolfchat restrictions are being consistently applied.
check_exchange still needs to be modified but everything else should be
ok.
2015-10-30 00:01:35 -05:00
skizzerz
b54dff0f89 Fix chk_nightdone and rework blessed villager template to actually do something 2015-10-29 22:57:02 -05:00
skizzerz
2f3e63a02e Start to fix chk_nightdone for priest/prophet/doomsayer 2015-10-29 22:49:07 -05:00
Vgr E. Barry
a5e2e5ac9e Wrap up dullahan 2015-10-29 23:04:15 -04:00
Vgr E. Barry
3cefa8057e Fix vigilante dying regardless of target 2015-10-29 22:37:05 -04:00
Vgr E. Barry
1c0e0194cd Add doomsayer transformation messages 2015-10-29 22:18:40 -04:00
Vgr E. Barry
fc311bb6a5 Dullahan / Vigilante tweaks 2015-10-29 21:47:25 -04:00
Vgr E. Barry
f73267f6e1 Small tweaks 2015-10-29 17:46:32 -04:00
Vgr E. Barry
922842b49c Add vigilante 2015-10-29 17:46:23 -04:00
Vgr E. Barry
e1a3ed7bf2 Add dullahan 2015-10-29 17:46:00 -04:00
Vgr E. Barry
c4029d826d Succubus fixes 2015-10-29 17:44:34 -04:00
Vgr E. Barry
da9a6f5b62 Some succubus fixes 2015-10-29 10:43:01 -04:00
skizzerz
16db66677c Complete doomsayer (untested) 2015-10-29 01:24:27 -05:00
Vgr E. Barry
3571d664ed Some succubus fixes 2015-10-29 00:06:00 -04:00
Vgr E. Barry
e3ad8a24db Make automatic totem aware of entrancement 2015-10-28 22:28:30 -04:00
Vgr E. Barry
c525380be6 Allow !fquit to leave someone from deadchat 2015-10-28 22:17:03 -04:00
Vgr E. Barry
bc8b336640 Finish up succubus 2015-10-28 22:17:02 -04:00
skizzerz
f9d55db79f Finish prophet
pray <role> is kinda awkward, may want to change the command name
2015-10-28 00:09:45 -05:00
Vgr E. Barry
da81909162 Most of succubus 2015-10-27 22:54:18 -04:00
Lukas Martini
70454bfc3a Merge branch 'sleepy' of https://phab.skizzerz.net/diffusion/LKOS/lykos into sleepy 2015-10-27 23:34:38 +01:00
Lukas Martini
c80078d7f4 Add first version of the demoniac role 2015-10-27 23:34:09 +01:00
Vgr E. Barry
9765703902 Finish deadchat 2015-10-27 16:24:06 -04:00
skizzerz
be051dde70 Initial work for prophet role
!pray command is complete, role is missing night messages as well as
initializing/resetting var.PRAYED in transition_night
2015-10-27 01:02:28 -05:00
skizzerz
dea6052ed5 Rename devout to prophet 2015-10-26 23:09:25 -05:00
Vgr E. Barry
10be2e341f First draft of the !deadchat pref 2015-10-26 23:49:41 -04:00
Vgr E. Barry
8517dff63d Add the game events 2015-10-26 23:49:41 -04:00
skizzerz
1a78a2abfb Add blessed villager template, begin devout 2015-10-26 21:01:34 -05:00
Vgr E. Barry
524773bcdf Finish the woflchat restrictions for the Halloween events 2015-10-26 10:40:39 -04:00
nyuszika7h
3222d646de Fix formatting of !start votes 2015-10-26 14:44:07 +01:00
Vgr E. Barry
5476bcdf27 Small tweaks to wolfchat restrictions 2015-10-25 21:37:59 -04:00
skizzerz
f166baeaa9 Add consecrate command for priests 2015-10-25 16:38:46 -05:00
Lukas Martini
99460a3651 Require a minimum number of votes to start a game 2015-10-25 17:21:23 +01:00
Vgr E. Barry
2127b217b7 Add deadchat and wolfchat restrictions 2015-10-23 21:51:57 -04:00
skizzerz
9f4b205c72 Add priest role
Right now only the !bless command is active, subsequent commits
will add other commands.
2015-10-23 19:51:01 -05:00
skizzerz
738ff7a441 Fix alpha wolf biting an immunized person with retribution totem not dying from totem 2015-10-20 22:48:16 -05:00
skizzerz
5a97397cd9 Alpha wolf fixes
- Correctly logic out bite interacting with harlot, immunized, and lycan:
- A harlot that isn't home does not get bit and refunds the bite unless
  they visit a wolfteam member or visit the unprotected wolves' victim
  (in either of those cases, they get bit instead of dying)
- A lycan or someone with a lycanthropy totem that gets bitten
  immediately turns to wolf and refunds the bite. The regular wolf kill
  still happens too, so this is essentially a freebie for alpha wolf.
- An immunized target dies per normal, but the death from the bite does
  not stack with the death from a normal wolf kill for the purposes of
  protection (meaning a single protection will guard against both).
- Fix nightdone check so that night doesn't end prematurely if alpha
  would be eligible to bite but has already done so previously in the
  game.
2015-10-20 22:26:37 -05:00
Vgr E. Barry
8995ec5815 Fix error on starting random 2015-10-19 15:29:55 -04:00
Vgr E. Barry
1a64a72a78 Change variable name 2015-10-19 15:20:10 -04:00
Vgr E. Barry
27f39c916f Change handling of chk_win events 2015-10-19 15:05:14 -04:00
Vgr E. Barry
04180bc036 Add alternate win condition if only lovers are alive
The message could use a better phrasing, but anyway this works.
2015-10-19 14:51:03 -04:00
skizzerz
26e7acc8f8 More fallow/fdeny fixes
- Always apply host-based allows/denies even in var.ACCOUNTS_ONLY is set
- Fix display of mixed-mode allows/denies for a particular user
- Make -acc and -host switches operate more intelligently on both the
  bare command as well as when given an argument
2015-10-18 20:56:27 -05:00
skizzerz
db0823bb37 Let vengeful ghosts use !retract 2015-10-18 19:20:08 -05:00
skizzerz
15b547ed77 Fix -acc and -host switches on fallow/fdeny 2015-10-18 15:18:55 -05:00
Lane Farrow
a9210b03c4 update simple, notice to track ident@host for users sharing hosts 2015-10-14 20:23:02 -05:00
Vgr E. Barry
45d13846a1 Fix !game and !lynch to not display the same vote twice
Players may no longer vote-spam individual players (or mistakenly vote
the same person/game mode twice)
2015-10-13 16:46:21 -04:00
jacob1
a83911f054 fix error when returning to the game via /nick 2015-10-11 21:59:00 -04:00
jacob1
3845d4e0b3 fix matchmaker, warlock, and piper causing night to end early if they !quit after acting
alpha wolf and turncoat also aren't removed from variables when quitting, but chk_nightdone checks if those roles are still in pl for some reason
2015-10-09 12:44:40 -04:00
Vgr E. Barry
6dd8f88bf6 Ensure socket is closed unconditionally (re: #169)
I cannot reproduce the bug locally, but this will force the socket to
close if it didn't for whatever reason, which is what seems like could
have caused the issue.
2015-10-08 12:03:08 -04:00
jacob1
7a058f77e7 fix !swap bugs
Didn't remove players from var.DISCONNECTED, leading to idling out every 10 seconds and getting lots of stasis while still being in the game
Didn't actually check whether the player was in channel or not
2015-10-06 23:01:39 -04:00
skizzerz
da762e6d73 Fix pl not being updated with chained deaths in del_player 2015-10-03 22:12:42 -05:00
jacob1
b047963cdb fix !roles roles erroring 2015-10-03 22:44:48 -04:00
jacob1
86ae193541 fix hag not working
broken in d9812e552d (blame woffle)
2015-10-03 19:01:53 -04:00
jacob1
5048af853e fix players not being devoiced when unidentifying mid game
fixes flaw in 151d010047
2015-10-03 17:57:44 -04:00
jacob1
c8dea37284 devoice all players before faftergame commands get run 2015-10-03 17:37:41 -04:00
jacob1
3f112b19bc fix previous !fjoin commit not working 2015-10-03 16:27:22 -04:00
jacob1
4612c0dec5 fix using !frole to join a new player during a game 2015-10-03 16:26:09 -04:00
jacob1
1e420a0235 !fjoin checks if the bot is opped before joining the list of players
prevents mass spam ...
2015-10-03 16:25:29 -04:00
jacob1
9c36602e21 fix error when lover changes nickname and then is matched again 2015-10-03 16:12:45 -04:00
Vgr E. Barry
151d010047 Fix devoicing someone twice when they unidentify 2015-09-30 08:38:35 -04:00
nyuszika7h
d1902392ba Add missing import 2015-09-22 23:02:51 +02:00
skizzerz
5132908397 Fix alpha wolf issues
- Make bite able to end night
- Bite was always working even if the target was immunized
- Ensure protection applies when killing a target that was
  immunized-but-bitten
2015-09-21 22:33:52 -05:00
Emanuel Barry
112ffdf80b Fix indent (blame woffle)
You can't `.update()` a dict you're currently iterating over.
2015-09-13 10:17:03 -04:00
skizzerz
d9812e552d Lots of shaman fixes (blame jacob1)
- var.SHAMANS now properly stores who is actually receiving totem, as it
  should. It now holds a tuple so it can still track the original target
  for purposes of letting shaman know if target changed.
- properly reset all totem vars before handing them out so totems don't
  last for multiple days.
- luck/misdirection now applies before exchange totem is checked, making
  it consistent with every other role ever.

completely untested, but should be fine :)
2015-09-13 00:04:24 -05:00
Vgr E. Barry
0219941d08 Get rid of conceal_roles in the game_mode decorator
A game mode is considered "hidden" if it doesn't have a `ROLE_GUIDE`
attribute. The `default` game mode was modified to have those
attributes, and is not hidden.
2015-09-09 10:37:45 -04:00
jacob1
9467a21279 fix some comments in transition_day to be on their own line 2015-09-09 01:36:10 -04:00
jacob1
50dc87938a allow hunter to pick a new target if their old one idles/quits
It also sends hunters/ghosts a message informing them of this
2015-09-09 01:18:39 -04:00
jacob1
4257de5f76 fix hunter being able to use 'pass' after killing on a previous night (ending night early) 2015-09-08 23:24:38 -04:00
jacob1
0246698b87 fix !roles # to work as intended 2015-09-08 23:03:24 -04:00
jacob1
5b62c5c3f6 minor fix, sometimes used 'seems' when it should have used 'seemed' 2015-09-08 22:56:33 -04:00
nyuszika7h
adec2362e4 Fix bot breaking with fake nicks
(blame @skizzerz)
2015-09-07 20:19:20 +02:00
skizzerz
6a0a0bdbd0 Fix fjoining people stasised by hostmask 2015-09-06 15:16:06 -05:00
nyuszika7h
8a90145474 Case-insensitively compare the bot's nick when checking for PMs
Closes #161.
2015-09-06 11:46:49 +02:00
skizzerz
2bd5acab53 fix fallow/fdeny redux 2015-09-05 22:09:22 -05:00
skizzerz
5e1fb7dbcf fix fallow/fdeny 2015-09-05 22:01:25 -05:00
Ryan Schmidt
458d678009 Merge pull request #159 from lykoss/ident-support
Expand host-based variables to take full-on hostmasks
2015-09-05 19:59:01 -07:00
skizzerz
07fdf64aae Fix fool winning
If a fool is also a lover and they are lynched, they don't win (but
their lover might depending on bot settings).

Fixes #162
2015-09-05 18:19:24 -05:00
skizzerz
88180a1ec2 Revert "Make fallen angel become assassin in all cases"
This change negatively impacts balance, assassin should in general never
be applied to any role the other team is required to kill in order to
win. Alpha wolf is the exception here, not the rule, since there is
counterplay involved with alpha biting GA (GA is likely immunized, can
guard self, game might end before turning, etc.) that simply does not
exist in other instances.

This reverts commit 3eb437fad6.
2015-09-04 19:33:58 -05:00
jacob1
028c5c9ae2 fix crash in games with traitor / wolf cub 2015-09-04 18:39:41 -04:00
Vgr E. Barry
3eb437fad6 Make fallen angel become assassin in all cases
Not just from getting bitten by alpha wolf, but also from turning from
amnesiac, and also if in the default role rotation (this one currently
doesn't affect any game modes, but in the future it might).
2015-09-04 11:49:30 -04:00
Vgr E. Barry
279328296d Fix 'devoice' parameter not working in some cases in del_player 2015-09-04 08:25:50 -04:00
skizzerz
f5ec9c9627 Expand host-based variabls to take full-on hostmasks
This allows for things like making ADMINS/OWNERS take a full hostmask,
or fallowing/fdenying a full hostmask with wildcards. It also allows for
a distinction between two people that share a hostmask but have a
different ident.

stasis now checks all matching stasis and returns the highest amount

fallow/fdeny have two new options -acc and -host to explicitly specify
what type the argument is

-cmds in fallow/fdeny show commands from all matching masks, to bring it
in line with how actual allow/deny parsing works, before it would only
show the first match
2015-09-03 19:38:59 -05:00
Vgr E. Barry
0d316d1ec6 Fix bot not devoicing player during day/join phases 2015-09-03 17:05:00 -04:00
Vgr E. Barry
5294f92c6c Add !games to show the available game modes 2015-09-03 12:00:40 -04:00
Vgr E. Barry
609f3282b8 Fix missing name error
The worst part is that I tested that change quite a lot
2015-09-02 22:31:16 -04:00
Vgr E. Barry
bd93e96445 Improve !fgame to allow an arbitrary number of spaces
This also allows to be a bit more liberal with the punctuation
2015-09-02 18:37:49 -04:00
Vgr E. Barry
d827eae2d8 Add option to devoice players during night 2015-09-02 17:48:58 -04:00
Vgr E. Barry
78465c9769 Perform game-ending checks for random earlier on 2015-09-01 23:14:44 -04:00
Vgr E. Barry
245bc57b66 Separate chk_win in two functions 2015-09-01 23:13:10 -04:00
Vgr E. Barry
7702509f90 Fix changing nicks in join phase not working 2015-08-31 19:20:54 -04:00
jacob1
e4c53906fb fix !swap when the player you are replacing already disconnected 2015-08-31 11:57:19 -04:00
Vgr E. Barry
2a35212ca4 Fix fallen angel's kill playing the wrong message 2015-08-29 20:56:26 -04:00
Vgr E. Barry
1fe1a7bfb3 Fix leftovers from the data types refactor 2015-08-29 20:56:15 -04:00
Vgr E.Barry
aca7ea418f Mass refactor of the data types 2015-08-29 23:45:44 +02:00
nyuszika7h
fa7cec485b frole: Add new players to default role and voice them 2015-08-28 16:13:15 +02:00
jacob1
5bc3a96203 fix duplication and possible empty player list in the message previously charmed players get 2015-08-28 01:35:30 -04:00
jacob1
36c56f8f5f fix error every time you PM the bot in debug mode 2015-08-28 01:18:42 -04:00
nyuszika7h
403e491c60 Fix bot sending idle warning in PM when messaging it after you're dead
Also changed it to use var.IDLE_WARNED_PM, as @skizzerz suggested a wolf
may want to intentionally idle sometimes.
2015-08-27 23:47:08 +02:00
nyuszika7h
a5a5c1c022 Mention oracle & augur in traitor message; fix cursed traitor message
Closes #150.
2015-08-27 23:12:02 +02:00
nyuszika7h
8be512c216 Repeat idle warning in PM if the player is PMing the bot 2015-08-27 21:08:04 +02:00
Emanuel Barry
77619306ec Fix bodyguard message 2015-08-27 14:51:21 -04:00
skizzerz
3dc3e4d172 Fix race condition for day timing out immediately when a vote succeeds 2015-08-26 20:09:57 -05:00
skizzerz
bb5cb78c68 Fix fgame bug, str.split has idiotic semantics in python 2015-08-25 22:46:45 -05:00
skizzerz
75c407c403 Track player stats by nick if accounts are disabled 2015-08-25 15:52:27 -05:00
nyuszika7h
886434272f Remove !me alias for !mystats
It conflicts with normal messages like "me too" in wolfchat, and I think
it's rarely (if ever) used.
2015-08-24 19:54:13 +02:00
nyuszika7h
82ef99b837 Fix !join telling you to !swap if you're already joined 2015-08-18 12:43:01 +02:00
jacob1
3ce856818a fix the bot pinging everyone instead of just people using !pingif if DISABLE_ACCOUNTS is on 2015-08-17 18:17:45 -04:00
nyuszika7h
5a2a098db6 !wiki: Catch socket.timeout 2015-08-17 22:53:12 +02:00
nyuszika7h
79066e5ec6 Fix error in on_invite (blame @Vgr255) 2015-08-16 12:06:15 +02:00
jacob1
835441caea fix bug where you could fdeny the same command multiple times if done by host 2015-08-14 01:31:48 -04:00
nyuszika7h
0dd3c08862 Exit immediately if Ctrl-C is pressed twice 2015-08-08 22:46:32 +02:00
nyuszika7h
e8fc9f01bb Ping players when ending game due to error in join phase 2015-08-08 22:16:06 +02:00
nyuszika7h
58286e7596 !swap: Don't error if user is not playing
I blame @Vgr255.
2015-08-08 22:07:02 +02:00
skizzerz
7e1c656185 Fix harlot dying visiting protected victim 2015-08-06 22:30:32 -05:00
Vgr E.Barry
38b7ef81e2 Add proper error handling. Closes #151
All exceptions, if not caught, are unconditionally sent to `sys.stderr`.
We only need to use our own custom class with some modifications and we
can intercept all errors, even those in threads (which #151 was about).
The only real downside from this practice is that `cli` is not
accessible to us when the errors happen, so I used a hack to set it on
an instance variable. If anyone can find a better solution, please step
forward. For the time being, this will have to do.

If for some obscure reason this class breaks, `sys.__stderr__` holds the
original `sys.stderr`
2015-08-06 12:29:47 -04:00
nyuszika7h
e27cb0c1e0 Add another ping message 2015-08-06 12:27:10 +02:00
Vgr E.Barry
b3c8fd562a Fix some errors and style in !swap 2015-08-05 21:55:09 -04:00
Vgr E.Barry
a6a128586d Add a !swap command. Closes #129
This allows people to swap out an existing player from the game, and
join instead. Useful if, say, your home connection dropped, but your ZNC
is still online and you want to keep playing through your phone for
example. The player swapping and the one being swapped must be
identified to the same account for this to work. After the command has
been used, an implicit !myrole is performed, informing the player of
their role and templates. The on_nick handler has been decoupled into
two functions, where most of the logic is now in rename_player (which
swap uses).

Known issues: Hard drive space is left untouched.
2015-08-05 21:28:04 -04:00
Vgr E.Barry
188ede0b2e Change is_user_altpinged to return only an integer 2015-08-05 21:22:42 -04:00
Vgr E.Barry
397d7362db Update !roles
Now `!roles` while in a game will have the same effect as `!roles n`
where n is the number of players that joined. Also got rid of string
concatenation.
2015-08-01 09:54:08 -04:00
Vgr E.Barry
ff53ad4bcf Modify is_user_stasised to return only an integer, not a tuple 2015-08-01 09:22:42 -04:00
Vgr E.Barry
29cf18f7be Update revealroles
Now shows which side turncoat is on, and what role someone was if they
changed during game. Also removed string concanetation so save on
memory/time.
2015-07-31 13:30:40 -04:00
Vgr E.Barry
e259502ad4 Change a few hasattr/getattr calls for something more intuitive 2015-07-31 13:29:05 -04:00
Vgr E.Barry
f40e749c07 Allow !fjoin to join ranges of fake nicks 2015-07-31 13:28:34 -04:00
Vgr E.Barry
dc54fdc883 Add random !ping replies 2015-07-31 13:26:50 -04:00
skizzerz
6fecec6df3 Re-add limit for fwait
Now restricted to adding/removing 900 seconds (15 minutes). There are no
valid reasons I can think of or that were given in -dev that would
require more time than this. 15 minutes is still likely too much and
from previous experience such long forced waits generally trigger a mass
exodus of players who would rather play a game than doing absolutely
nothing.
2015-07-30 13:06:48 -05:00
Vgr E.Barry
9d10a1a342 Display what amnesiac would have turned into at end of night 2015-07-27 10:24:55 -04:00
skizzerz
80f5f7d4e8 Separate bite from kill for alpha wolf.
Alpha now can choose to either bite or kill, but not both. If other
wolves are alive, they can still kill as normal allowing both to happen
that night. Additional interactions were added to deal with visiting
harlots and to not accidentally kill bodyguards/GAs in the event that
they are bitten and would die from wolves (if
BODYGUARD/GUARDIAN_ANGEL_DIES_AT_NIGHT_CHANCE is set).

Things to consider for the future but didn't have time to do yet:
- Should we play a message in channel if alpha wolf successfully bites
  someone at night?
- Avoid killing a bodyguard/GA if Fallen Angel is in play and said
  bodyguard/GA was bitten that night.
- Should wolves avoid automatically killing people bitten on previous
  nights (e.g. a bitten harlot wouldn't get nommed visiting wolves or
  victims, bitten bodyguards/GAs wouldn't die from fallen angel, etc.)?
2015-07-26 23:29:40 -05:00
Vgr E.Barry
017811b7db Fix game mode docstring parsing 2015-07-26 13:34:04 -04:00
skizzerz
4eaedea442 Fix fgame autocompletion 2015-07-26 12:32:07 -05:00
nyuszika7h
0e704e5533 Fix missing period in !hex message 2015-07-25 22:27:10 +02:00
skizzerz
6dd9c199fd Disable stats for noreveal, and make the 'no reveal' message more clear 2015-07-24 12:27:08 -05:00
nyuszika7h
2f5712cb3b Prefix "/me"s in wolfchat with an asterisk
This is needed to disambiguate them from the bot announcing wolfteam
actions in wolfchat, which was recently added.
2015-07-24 13:50:42 +02:00
nyuszika7h
bf18c5fbb2 Fix previous commit 2015-07-22 21:10:15 +02:00
nyuszika7h
c3fa5d4907 Change all "to not" -> "not to" 2015-07-22 21:01:09 +02:00
nyuszika7h
0d0bda349d Announce wolf/alpha retracting in wolfchat too & remove redunant check 2015-07-22 20:56:55 +02:00
nyuszika7h
e1271290aa Add note about random picking to shaman and matchmaker role message 2015-07-22 19:03:16 +02:00
nyuszika7h
a41d302607 Fix "already charmed" message for piper
"For tonight" implies that charmed players are only charmed until the
night ends, which is certainly not true.
2015-07-22 18:32:20 +02:00
nyuszika7h
164785d589 Announce wolf actions in wolfchat
This way it's immediately obvious if it was a legit command or not. The
result of werecrow's observation is not announced, because it's possible
for the crow to be killed at night and this would take away that
strategy. For sorcerer, it does not even bother announcing the fact that
they observed, since they can tell the result immediately if they are
alive, so the message is pretty much redundant.

Also, minor fixes:

* Log kill by angry wolves properly, instead of the non-obvious hack
  that @Vgr255 used.

* Add missing quotes in angry wolves wolfchat message.
2015-07-22 17:59:53 +02:00
nyuszika7h
22faf0b961 Skip leading symbols in complete_match
This allows you to vote |evil| with "!v evil", for example, provided
that no other nick matches that.
2015-07-22 16:11:38 +02:00
skizzerz
d26c621b55 Fix win sequencing bug
If all wolves are dead and there are the same number of wolfteam as
vills (due to sorcerers, hags, etc.), then village should be credited
with win.
2015-07-20 23:06:22 -05:00
nyuszika7h
f65f48c70d Add missing bolding + period & fix format string 2015-07-20 17:52:40 +02:00
skizzerz
93345c990d Make DISABLE_ACCOUNTS actually disable account-related stuff.
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.
2015-07-19 14:37:17 -05:00
skizzerz
99e4a49fe6 Also deduct min lycans if it is possible alpha turn with GAs around 2015-07-19 04:02:57 -05:00
skizzerz
7ad4098aed Fix idlers breaking stats 2015-07-17 13:15:52 -05:00
nyuszika7h
efcb60e4f5 Merge pull request #152 from lykoss/stats_overhaul
!stats Overhaul
2015-07-17 18:42:57 +02:00
skizzerz
116653432b !stats Overhaul
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.
2015-07-17 18:42:07 +02:00
nyuszika7h
ccc1bb68ec Fix "currently not" -> "not currently"
Both are correct; this is just for consistency.
2015-07-17 09:47:14 +02:00
jacob1
90a02de767 remove 'curse <self>' pass alias for warlock 2015-07-16 22:31:45 -04:00
jacob1
680e24dd8b allow warlock and piper to use !pass (they can later decide to use their powers) 2015-07-16 22:26:12 -04:00
jacob1
e9fa4a0293 fix var.LASTGIVEN with silenced shamans 2015-07-16 20:32:30 -04:00
jacob1
b08849b14f if there are multiple pipers ('random' games), tell the other pipers who is being charmed 2015-07-16 19:46:30 -04:00
jacob1
bbfa5331e4 silenced shamans no longer randomly give out totem at end of night 2015-07-16 19:25:38 -04:00
jacob1
bd4b89ef01 delay PMing charmed players until daytime 2015-07-16 19:07:58 -04:00
skizzerz
75d55ab461 Make non-simple message to turncoats more clear if they don't have a side 2015-07-15 21:00:15 -05:00
nyuszika7h
2f3f4b17ea Add support for stasising wildcard hostmasks 2015-07-15 20:15:39 +02:00
skizzerz
3b5a72f3d8 Add missing space 2015-07-15 12:32:26 -05:00
skizzerz
d4f786200b Fix turncoat handling for amnesiacs and clones 2015-07-14 22:45:53 -05:00
skizzerz
c0575bd460 Add turncoat role
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.
2015-07-14 22:20:53 -05:00
skizzerz
0286a55e6b Add 'r' as an alias for 'retract' 2015-07-13 21:10:48 -05:00
jacob1
37c52337e6 fix !revealroles error 2015-07-13 12:08:13 -04:00
jacob1
4a1c10b697 allow shaman to change targets during the night
totem vars get set in transition_day
2015-07-12 19:42:53 -04:00
skizzerz
adddbe70ff Properly fix error when shaman idles (obsolotes f72a9c3) 2015-07-12 11:46:46 -05:00
nyuszika7h
21d3a8aa68 Fix !frestart on InspIRCd 2015-07-12 16:21:52 +02:00
nyuszika7h
f72a9c37d9 Fix error when shaman idles 2015-07-12 12:57:00 +02:00
nyuszika7h
c30faf8831 Re-add "Nobody wins." when there are no players remaining
I have no idea why I removed it in the first place.
2015-07-12 10:54:07 +02:00
jacob1
e9874441fa !pstats without arguments sends a /notice instead of spamming the channel 2015-07-12 01:42:02 -04:00
jacob1
8e78068a6c small keyword argument change please ignore 2015-07-12 01:42:01 -04:00
skizzerz
25f1bd0ee0 Allow hunters, bodyguards, and GAs to use pass. Guarding self is no longer an alias for passing as bodyguard. 2015-07-12 00:39:45 -05:00
skizzerz
3c8979295b Force matchmaker selection if they didn't pick. matchmaker is not told who is matched in this instance 2015-07-12 00:39:45 -05:00
jacob1
e1832def6e remove some code duplication: call chk_win when fool is lynched 2015-07-12 01:26:36 -04:00
jacob1
cca871262a fix for broken nick tracking in join phase if you get removed due to a Guest/away nick 2015-07-12 00:57:27 -04:00
jacob1
1af572f12a shuffle villager list before pming them the roles
prevents you from knowing if you are a hidden role based on the timing of the message
2015-07-12 00:02:25 -04:00
jacob1
e6ed567364 call the chk_win event when fool is lynched
useful for some 'creative' game modes and should be called anyway
2015-07-11 22:34:40 -04:00
skizzerz
50752ccb5c Remove unused variable 2015-07-11 13:49:56 -05:00
skizzerz
8299a2ee91 Force shaman to act at night 2015-07-11 13:43:50 -05:00
skizzerz
ee2a4ef2cf Fix protection not working against assassin sometimes 2015-07-11 12:16:50 -05:00
nyuszika7h
130a859458 Actually fix restarting on excess flood 2015-07-10 00:07:10 +02:00
nyuszika7h
3649c82174 Fix auto-restart on excess flood 2015-07-09 23:55:04 +02:00
skizzerz
4e6b7ad372 Make !time report remaining wait time during join phase 2015-07-07 13:04:25 -05:00
skizzerz
627da811f8 Make fallen angel kill ALL of the protectors, not just the one that would have taken effect 2015-07-06 13:38:59 -05:00
skizzerz
51d747e7d1 Instantly end night if nobody can act during it 2015-07-06 13:38:59 -05:00
nyuszika7h
8d528bf047 Remove !fghost and !funghost
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.
2015-07-06 20:12:01 +02:00
nyuszika7h
751a284f6d Properly remove stasis on !fjoin
Previously, stasis would be removed locally but not from the database.
2015-07-05 00:23:35 +02:00
nyuszika7h
7f0623b4b0 Add partial role reveal
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.
2015-07-04 23:57:07 +02:00
skizzerz
649649a355 Fix hunter turning into some other nightrole prematurely ending night on occasion 2015-07-02 17:00:31 -05:00
nyuszika7h
ad26f0b693 Remove surrounding whitespace in fortunes 2015-06-30 12:59:14 +02:00
nyuszika7h
ca9b6a2009 Allow using !coin and !pony in PM 2015-06-28 11:11:08 +02:00
Vgr E.Barry
91e122f86d Fix del_player to pass in an argument instead of using a list 2015-06-26 08:51:03 -04:00
skizzerz
2274e945a0 Disallow fallowing fsend
!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.
2015-06-25 13:02:51 -05:00
nyuszika7h
4e53a3556b Fix compatibility with Python 3.2 (no list.clear()) 2015-06-25 17:53:06 +02:00
Vgr E.Barry
a009eb4819 Fix issue where !roles would output the wrong number of players 2015-06-19 11:54:09 -04:00
Vgr E.Barry
5c6a14154e Change !help to not display aliases
Also improve message splitting and remove string concatenation to use
faster and more memory-efficient methods
2015-06-18 23:20:56 -04:00
Vgr E.Barry
260918555d Change del_player to devoice all at once in multiple-deaths scenarios 2015-06-18 22:48:48 -04:00
skizzerz
3cab412a9b Fix silenced VG causing day transition to error out 2015-06-15 16:44:45 -05:00
skizzerz
1a506907c9 Wording fix 2015-06-15 11:04:50 -05:00
Vgr E.Barry
106b1d61f3 Allow events to only partially determine roles to attribute 2015-06-15 10:30:44 -04:00
Vgr E.Barry
7f875d3b33 Remove the roles_check event 2015-06-15 10:29:04 -04:00
nyuszika7h
dd2d82392d Reorganize imports 2015-06-15 15:20:27 +02:00
Vgr E.Barry
4d8576481b Change event dispatchers to not pass in mutable arguments 2015-06-14 23:24:48 -04:00
skizzerz
4d15ee0421 Revert "Speed up startup time a bit"
This reverts commit 77d1eda074.

Let's not use "private" modules for nonexistent performance boosts.
2015-06-14 22:25:58 -05:00
Vgr E.Barry
77d1eda074 Speed up startup time a bit
_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.
2015-06-14 23:13:49 -04:00
Vgr E.Barry
a7a3b4a045 Add a role_attribution event dispatcher 2015-06-14 22:56:57 -04:00
Vgr E.Barry
3888c51da5 s/!roles was disabled/!roles is disabled/ again
Forgot one
2015-06-14 22:54:51 -04:00
Vgr E.Barry
5d8cd14db8 Add chk_traitor event (for the random game mode) 2015-06-14 16:35:14 -04:00
Vgr E.Barry
aaaf3df0f5 Add a roles check event for when game starts
Also remove `var.IGNORE_NO_WOLF` hack
2015-06-14 16:34:42 -04:00
Vgr E.Barry
a8984b6a56 Add event for amnesiac turning (for the random game mode) 2015-06-14 16:32:39 -04:00
Vgr E.Barry
1d711b9cee s/!roles was disabled/!roles is disabled/ 2015-06-14 16:12:50 -04:00
Vgr E.Barry
28dc0a8e14 Fix corner case with multiple pipers 2015-06-14 12:06:52 -04:00
nyuszika7h
f8cc2aef1d fallow/fdeny: Add -cmd to complement -cmds
You can use this to see which people are allowed or denied to use a
particular command, rather than listing all commands.
2015-06-14 16:14:39 +02:00
nyuszika7h
36d2e6b83e Tweaks to !fallow/!fdeny
- 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().
2015-06-14 14:48:58 +02:00
nyuszika7h
fb964e370a Remove DISABLED_GAMEMODES
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.
2015-06-13 17:25:23 +02:00
skizzerz
93e842f9aa Rage rage grumble grumble
Fix breakage in ORIGINAL_ROLES on nickchange if the person has more than
one role (e.g. templates)
2015-06-12 23:53:09 -05:00
skizzerz
7b9b79a0d1 Make code a tiny bit more readable 2015-06-12 12:29:45 -05:00
nyuszika7h
5ad726601e Fix previous commit
ntotems wasn't being reset in the loop, as pointed out by @skizzerz.
2015-06-12 19:11:30 +02:00
nyuszika7h
ff4f186498 If a player got multiple totems, send only one message 2015-06-12 19:08:06 +02:00
skizzerz
fde409aea2 Don't show (Account) in fallow/fdeny list if ACCOUNTS_ONLY is set 2015-06-12 11:21:54 -05:00
jacob1
b374bd42a2 don't show disabled game modes in !help game 2015-06-09 12:19:14 -04:00
jacob1
22bc669650 fix is/are grammar in [wolf] mystic messages 2015-06-09 12:08:57 -04:00
nyuszika7h
c5fa4445b2 Reset some rate limits when game is started 2015-06-09 17:01:02 +02:00
jacob1
47b18d3655 remove village elder role 2015-06-09 01:39:16 -04:00
Emanuel Barry
fdd1fc5c12 Merge pull request #146 from lykoss/fallen
New roles, protection semantics, and alpha fixes
2015-06-08 20:26:16 -04:00
skizzerz
02a35b8d20 Fix TypeError from list+tuple and s/sum/count/ where able 2015-06-08 19:22:09 -05:00
skizzerz
6604de63e3 Also hide villager-like roles from wolf mystic 2015-06-05 19:34:47 -05:00
Vgr E.Barry
6fa4910430 Further improve flastgame
derp
2015-06-04 21:07:49 -04:00
Vgr E.Barry
ca8719fc7d Fix flastgame 2015-06-04 20:53:37 -04:00
Vgr E.Barry
9dc52441e8 Fix some commands not working in alt channels 2015-06-04 19:37:12 -04:00
Ryan Schmidt
562fba2029 Merge pull request #145 from lykoss/new-decorators
Change decorators
2015-06-04 15:43:12 -07:00
skizzerz
70bced24a6 New roles, protection semantics, and alpha fixes
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.
2015-06-04 17:37:32 -05:00
Vgr E.Barry
8b1315eef6 Fix error on exchange totem if harlot who visits oneself is targetted 2015-06-04 12:45:09 -04:00
Vgr E.Barry
ee97d6f45e Fix duplicate function name 2015-06-04 10:55:06 -04:00
Vgr E.Barry
49f0ba220b Modify all commands call to properly call the commands 2015-06-04 10:50:10 -04:00
Vgr E.Barry
b6211748a1 Add the 'phases' and 'silenced' arguments to the cmd decorator 2015-06-04 09:44:34 -04:00
skizzerz
581cda4ac3 Fix revealroles/myrole bitten messages 2015-06-03 12:12:38 -05:00
jacob1
d8bc216df4 fix !frestart not actually restarting the bot 2015-06-03 01:31:46 -04:00
skizzerz
040be2ff31 Piper/charming fixes
- 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
2015-06-02 23:57:36 -05:00
Janik Kleinhoff
3f0bce320e Fix typo, blame Vgr 2015-06-03 03:28:19 +00:00
Vgr E.Barry
ca2e901d58 Mass overhaul to the decorators 2015-06-01 16:37:22 -04:00
Vgr E.Barry
416ded936d Fix another faulty len() call 2015-06-01 14:39:48 -04:00
Vgr E.Barry
f75592d571 Fix error in !stats if alpha wolf is in play 2015-06-01 14:36:13 -04:00
nyuszika7h
1ac59cea78 fpull: Support git versions older than 1.9
Those versions don't support the --rebase=preserve option of git pull.
2015-06-01 20:39:06 +02:00
nyuszika7h
ce880950cd frestart: Look for ERROR instead of QUIT
The IRCd sends ERROR when we get disconnected, so this is more reliable.
2015-05-31 18:32:38 +02:00
Vgr E.Barry
6278f3fe29 src/wolfgame.py: Consistency fixes
- 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)
2015-05-30 10:29:13 -04:00
Vgr E.Barry
ced87d21ea Remove backslash in line 2015-05-30 09:28:14 -04:00