Commit Graph

688 Commits

Author SHA1 Message Date
jacob1
fa326b5fb3 fix fail with complete_match 2015-01-05 12:56:34 -05:00
jacob1
784bbe0111 prevent cases where you can unintentionally vote / act on yourself 2015-01-05 10:59:25 -05:00
skizzerz
5f458cc9dc Fix vengeful ghost incorrectly winning 2015-01-04 20:47:49 -06:00
Vgr E.Barry
e2c5c819d6 Make "frestart normalmode" behave as intended. 2015-01-03 20:04:13 -05:00
Vgr E.Barry
932d9f45f4 Improved argument parsing.
Made launch arguments override the config's values. Added a --normal
switch for overriding both debug and verbose parameters if present.
2015-01-03 19:49:58 -05:00
Vgr E.Barry
11b35c79ff Allow debug and verbose modes to be set directly from config. 2015-01-03 19:33:15 -05:00
Vgr E.Barry
555f80eb5e Merge branch 'master' of https://github.com/lykoss/lykos 2015-01-03 18:21:49 -05:00
Vgr E.Barry
4a6bd6665f Fixes faftergame (again). 2015-01-03 18:21:27 -05:00
jacob1
6fc05abd71 Merge pull request #102 from skizzerz/drunkassassin
Remove some restrictions on who can be assassin
2015-01-03 18:20:58 -05:00
Vgr E.Barry
d780cf04ad Fixes faftergame. I should stop breaking things. 2015-01-03 18:03:13 -05:00
Vgr E.Barry
cd7aac9398 Fix random errors. Blame Vgr. 2015-01-03 17:49:29 -05:00
jacob1
47f4f77f10 check if game ends when bitten/amnesiac turn, instead of sending out PMs and continuing it 2015-01-03 15:41:16 -05:00
jacob1
22ad235620 mad scientist gets told their targets and is reminded of their role every night 2015-01-03 13:30:24 -05:00
skizzerz
9f28036494 Remove some restrictions on who can be assassin
The only roles that should NOT be assassin are roles that the other team
MUST kill in order to have a good shot at winning. Therefore, we don't
need to have so many saferoles unable to be assassin, as well as certain
neutral roles. The current list is as follows:

- wolves + traitor, since these all need to die for village to win
- lycan, because if turned they need to die for village to win
- seer/oracle/harlot/augur/detective, capable of making safes so wolves
  need to focus on killing them in order to have a shot at winning
- bodyguard/GA, capable of preventing other safes from dying, again need
  to die for wolves to have a shot at winning

Everyone else is fair game, including shaman, drunk, hunter, doctor,
crazed shaman, and fool (who were all previously restricted).

If drunk is assassin, they don't get to choose their target, rather they
get one randomly assigned to them automatically.
2015-01-03 12:16:26 -06:00
Vgr E.Barry
7d49ac4cc4 Fixed a few issues.
Added wildcard * for !force and !rforce, which match all players.
removed leftover error message and fixed !kill and !totem crashing the
bot.
2015-01-03 00:50:57 -05:00
Vgr E.Barry
94d5939f39 Fix calling inexistant variables. 2015-01-02 20:45:03 -05:00
Vgr E.Barry
41089786d8 Remove notice if using a role command you don't have access to. 2015-01-02 20:40:15 -05:00
Vgr E.Barry
0984f79bd9 Improve handling of kill and away/back/in/out.
Uses variables instead of hardcoded roles for kill. Doesn't warn about
incorrect use of away and back if var.OPT_IN_PING is on, and about
incorrect use of in/out if it's off. References #76.
2015-01-02 18:11:07 -05:00
Vgr E.Barry
32fd7b2fa2 Improve help command. 2015-01-02 18:08:19 -05:00
Vgr E.Barry
df26d8d25e Huge overhaul to the decorators + small changes.
- Merge channel and PM commands in a single decorator.
- Add many parameters for the decorators, reducing commands cluster.
- Added back the admin_only check for some commands; special-cased
'<console>'.
- Moved the checking for which roles are seen wolf in the settings; same
for seen as default.
- Added a variable to pick if one is seen as the default role or as a
villager where applicable (default: True).
- Fixed seer/oracle seeing through amnesiac.
- Some fixes to the totem chances that I forgot to add in the previous
commit.
- Removed some useless module imports.
- Moved some functions to settings.
- Changed all single-quotes to double-quotes in commands for
consistency.
- Renamed 'cmd' variable in both force and rforce commands to avoid
confusion.
- Probably a bunch of other things. Don't consider this commit
description to be 100% complete.
2015-01-02 15:57:44 -05:00
nyuszika7h
53cf4970ca Disable !game if !fgame was used 2015-01-01 23:45:46 +01:00
Janik Kleinhoff
698d6f86ae START_QUIT_DELAY: fix duration check 2015-01-01 19:19:56 +00:00
Janik Kleinhoff
b1e59c4f77 !quit: tell player how long until they can quit 2015-01-01 18:59:27 +00:00
Janik Kleinhoff
09b5a62a9b Disallow !quit immediately after starting to avoid accidents 2015-01-01 05:20:52 +00:00
nyuszika7h
7d509e7c1d start: Add per-user rate limit 2014-12-31 21:07:25 +01:00
nyuszika7h
8b6393bf8e fsay, fact: Fix usage message 2014-12-30 22:16:42 +01:00
nyuszika7h
740d8a6e33 Fix signal handling on Windows 2014-12-30 22:13:40 +01:00
Vgr E.Barry
4f4a3f82a2 Fix totem chances.
This fixes the totem chances needing to add up to 1, and now can add up
to any arbitrary number or fraction. This also adds a TOTEM_ORDER
variable for shamans, as an attempt to allow more shamans in the future.
2014-12-30 15:04:43 -05:00
jacob1
453242a257 improve some comments and fix 'f rom' typo 2014-12-28 17:26:30 -05:00
jacob1
8dce5a4d16 gramatical fixes (var.plural one by skizzerz) 2014-12-28 17:06:15 -05:00
jacob1
356b9a25ba fix alpha wolf being seen as villager 2014-12-28 17:03:52 -05:00
skizzerz
1e09bff8df Fix alpha wolf bug 2014-12-26 22:32:44 -06:00
Ryan Schmidt
4e3b61f8dc Merge pull request #98 from skizzerz/alphawolf
Add 2 new roles: doctor and alpha wolf
2014-12-26 19:30:40 -06:00
skizzerz
93f5c6a4f8 Make the bite command make use of the new get_victim function 2014-12-26 01:06:23 -06:00
skizzerz
d42fa45d2f Make alpha wolf more powerful
Each time a wolf dies while a bitten person is undergoing
transformation, they will now transform one night earlier. This makes it
much more likely for the bitten person to actually turn into a wolf
before the game is over. For larger game sizes, the turn is pretty much
guaranteed due to the number of wolves, which means safes need to
tightly coordinate to figure out who was actually bitten due to wolves
possibly having full info and an insider.
2014-12-26 01:06:23 -06:00
skizzerz
9b61dde15e Add 2 new roles: doctor and alpha wolf
Doctor is on the village team, and has a number of immunizations they
can give out during the day. An immunized lycan reverts a normal
villager, and anyone that is immunized will die instead of turning into
a wolf if they are bitten by the alpha wolf. Beware, however, because
attempting to immunize someone already bitten will simply speed up the
process of them becoming a wolf!

Alpha wolf has a once-per-game ability where they can bite the wolves'
target instead of killing them following the death of a werewolf during
the day. The bitten person will subsequently turn into a wolf in 3
nights.
2014-12-26 01:06:17 -06:00
nyuszika7h
db9c52a3e2 Fix admin check in fdie and frestart 2014-12-23 23:56:55 +01:00
jacob1
ff737609b5 Fix error when silenced gunner shoots 2014-12-23 17:45:07 -05:00
nyuszika7h
274aedf050 Add SIGUSR2 for aftergame restart 2014-12-23 12:05:50 +01:00
nyuszika7h
036ac29f4b Add signal handling
- SIGINT (Ctrl-C) and SIGTERM will do a clean quit now.
- SIGUSR1 will restart the bot.
2014-12-22 23:38:06 +01:00
jacob1
15fab6c0b7 possibly prevent error if bot is opped before WHO results come back 2014-12-19 12:24:21 -05:00
jacob1
a6a87c2dde add villager and cultist to the amnesiac blacklist 2014-12-19 10:29:07 -05:00
jacob1
6a09f77a85 fix for recent gstats commit 2014-12-18 22:42:05 -05:00
jacob1
4573242f78 !roles uses var.role_order also (useful with !roles #) 2014-12-18 22:37:10 -05:00
jacob1
93cd95cfef fix !goat (also wasn't fully fixed) 2014-12-18 20:37:10 -05:00
jacob1
3a7c7f777b fix !faftergame frestart
was calling the pmcmd version with the arguments inside chan instead of *rest
2014-12-18 18:18:57 -05:00
jacob1
61e41a5776 fix gstats error when using 8p instead of just 8 2014-12-18 18:18:57 -05:00
jacob1
1a4ad90dd2 don't show "was x" for templates (thought I did this already) 2014-12-18 18:18:57 -05:00
jacob1
92a7697584 order !pstats and !stats using var.role_order() 2014-12-18 13:26:20 -05:00
jacob1
7d2d65f80d fix player count not appearing when quitting in join phase 2014-12-18 00:03:36 -05:00
jacob1
e9944f06eb stop_game errors don't prevent !frestart and !fdie from working 2014-12-17 23:44:32 -05:00
jacob1
5736f3d758 fix error if mad scientist-assassin targets one of their own kills 2014-12-17 23:18:27 -05:00
skizzerz
6911ce2ac7 Revert "amnesiac can't turn into default role"
They most certainly can, changing this is a gameplay change and is not
the proper place for this anyway.

This reverts commit 43676344a8.
2014-12-17 21:40:32 -06:00
jacob1
43676344a8 amnesiac can't turn into default role
It seems I wasn't a villager, I was actually a villager all along
2014-12-17 22:37:13 -05:00
jacob1
4bced1cf2a ping villagers in end of game list + some bugfixes 2014-12-17 21:49:39 -05:00
Ryan Schmidt
44a10b206e Merge pull request #97 from lykoss/nickcomplete
new complete_match/get_victim functions to clean up code for role commands
2014-12-17 20:29:45 -06:00
Ryan Schmidt
a960696e6e Merge pull request #95 from kernelpanic3/dyn-quit
Dynamic quit messages, take 2
2014-12-17 20:27:38 -06:00
jacob1
0a48c3ced4 end of game role list shows role swaps / is ordered mostly alphabetically
TODO: also order !stats, !pstats, others; and maybe show villagers in end of game list
2014-12-17 18:12:13 -05:00
Ominous
8eb1138a4b Remove unnecessary function calls, add DYNQUIT_DURING_GAME check for noreveal per woffle 2014-12-17 14:35:32 -05:00
jacob1
898893f72c fix killing cultist/minion, !goat, and other minor bugs 2014-12-16 22:14:18 -05:00
skizzerz
a7928399a7 Fix hunter and vengeful ghost being unable to kill a visiting harlot 2014-12-14 23:53:27 -06:00
skizzerz
baa3831ce7 Fix bot's handling of WHO replies on connect:
Some IRCds always output the servername on a WHOX query even if it
wasn't asked for. Let's ask for it now and just ignore the response. The
order of parameters in WHOX is now in the order they are returned, to
make life easier.

Also tidy up the generator a tad; if we aren't using things we're
computing then there's no need to compute it at all :)
2014-12-14 23:48:24 -06:00
Ominous
5c57c62be3 Make dynquit during game configurable, per woffle 2014-12-14 23:34:15 -05:00
jacob1
18199b166c fix multiple letter command prefixes 2014-12-14 17:42:36 -05:00
jacob1
be250fabe2 !roles/!gamestats accept partial names, new complete_match/get_victim functions to clean up code for role commands 2014-12-14 17:06:22 -05:00
jacob1
bc60357ae5 !roles/!gamestats accept partial names, new complete_match/get_victim functions to clean up code for role commands (reverted from commit c1a937f763) 2014-12-14 16:30:25 -05:00
jacob1
c1a937f763 !roles/!gamestats accept partial names, new complete_match/get_victim functions to clean up code for role commands 2014-12-14 16:23:52 -05:00
nyuszika7h
c4fb449a77 Reintroduce !mystats
It's useful for things like "!m wolf", and it's easier to do this than
hacking !pstats to support "!p wolf", which could be ambiguous if
there's a player with an account name of "wolf".
2014-12-14 15:14:28 +01:00
jacob1
60cd1ee06c allow gstats and pstats in pm during games 2014-12-14 01:30:07 -05:00
Ominous
3294c01b49 Avert convention rot per woffle 2014-12-13 19:27:09 -05:00
skizzerz
970e55e828 Fix instance where harlot A would not die if harlot A is visiting harlot B, harlot B is visiting someone, and wolves attack harlot B 2014-12-13 17:19:25 -06:00
Vgr E.Barry
3aa54cf565 Add an automatic mode toggling. 2014-12-13 14:23:56 -05:00
skizzerz
7d3a7cd140 Fix fjoining fake nicks 2014-12-13 11:30:06 -06:00
Janik Kleinhoff
5789be967e ping: more useful behaviour when noone can be pinged 2014-12-12 18:53:50 +00:00
Vgr E.Barry
17c59fd277 Fix a few random issues with previous commit. 2014-12-09 21:40:25 -05:00
Vgr E.Barry
6a2eec608a Huge overhaul to the system to use accounts. 2014-12-09 19:44:06 -05:00
Ominous
0f6ee5c994 Distinction between a and an 2014-12-09 00:17:33 -05:00
kernelpanic3
b8361ab6bc Dynamic, random quit messages 2014-12-08 23:22:32 -05:00
Janik Kleinhoff
1d06b68d24 Move database/persistence initialization into a function
This allows us to postpone init_db(). One advantage of this is that
specifying AWAY in botconfig.py won't overwrite the away list from the
DB anymore, but properly get added to (as would be expected).
2014-12-08 14:02:09 +00:00
Janik Kleinhoff
45e59ea647 fquit: say "No more players remaining" at 0 players 2014-12-08 12:36:58 +00:00
Vgr E.Barry
f43dba4a3f Fix some specific PM commands not working. 2014-12-07 16:33:39 -05:00
Vgr E.Barry
a7fe73c355 Allow admins to invite the bot to any channel. 2014-12-07 11:01:06 -05:00
nyuszika7h
f5b9c3e612 Small refactor to log_cmd 2014-12-07 16:50:18 +01:00
nyuszika7h
7f668cbb2c Add a common logging function for fsend et al
This is just a basic logging function designed for logging (admin)
command calls. We'll have a better logging system eventually (ref:
lykoss/lykos#72).
2014-12-07 16:39:25 +01:00
jacob1
8ecef11482 fixes to lots of bugs with the bot being in an alternate channel 2014-12-06 22:33:42 -05:00
Ryan Schmidt
45f640e9c9 Fix impatient message showing up in places it shouldn't 2014-12-06 19:01:22 -06:00
Vgr E.Barry
87f74d3265 Adds ability for the bot to be in multiple channels. 2014-12-06 17:39:21 -05:00
Vgr E.Barry
3192052add Allow admins and owners tracking via account. 2014-12-06 15:43:34 -05:00
Vgr E.Barry
5cc9715eb1 Move argument parsing out of botconfig. 2014-12-06 15:03:03 -05:00
jacob1
ab1edec0cb Merge pull request #86 from Vgr255/master
Add ability to carry settings from botconfig to var.
2014-12-06 14:57:51 -05:00
Vgr E.Barry
859bc842da Add ability to carry settings from botconfig to var. 2014-12-06 14:31:49 -05:00
jacob1
1519ba3765 add var.GRAVEYARD_LOCK check in chk_win, add more checks for game ending in those 2014-12-06 14:03:31 -05:00
Ryan Schmidt
6aeb149241 Merge pull request #85 from skizzerz/fiximpatience
Impatience and pacifism totem improvements
2014-12-05 09:00:16 -06:00
nyuszika7h
a69a070c27 fpull: Show diffstat
It isn't shown by default with rebase, but it's pretty useful.
2014-12-05 11:33:48 +01:00
jacob1
fc53b905be Merge pull request #83 from lykoss/fix-cub-error
Fix KeyError in chk_win
2014-12-05 00:10:36 -05:00
jacob1
c9c5317ecf Merge pull request #82 from lykoss/refactor-fsay-fact
Refactor fsay and fact
2014-12-05 00:10:03 -05:00
skizzerz
5819976a1f Pacifism/Impatience totem improvements
- A message is now displayed whenever a pacifism or impatience totem is
  triggered, e.g. "X impatiently votes for Y." or "X meekly votes to not
  lynch anyone today." These are played immediately before the vote
  passes, so there is no opportunity for people to abandon course.
- Reinstate people with impatience totems being the ones that die to
  desperation totems. Due to the above message playing, it is now more
  obvious why they died, and I believe that doing it this way adds to
  gameplay ("I have a random totem and so does the person being voted. I
  should try to jump in early just in case I have impatience so I don't
  die."). If someone with impatience votes normally, their actual vote
  counts for determing vote order (so they aren't last unless they voted
  last). If there are multiple people with impatience that didn't vote,
  then the order in which they vote is random.
2014-12-04 22:45:11 -06:00
skizzerz
7b2ee4ecd5 Fix impatience totem interaction with abstaining:
- Moving code to chk_decision means that doing an actual !abstain
will still make you show up in !votes (unlike now where it does not)
- impatience and pacifism should balance each other out if they
are present in equal numbers, preventing an !abstain from working
if you have impatience does not yield that behavior
2014-12-04 21:57:30 -06:00
Vgr E.Barry
4ac967be1d Fix hunter passing ending night early. 2014-12-04 20:38:08 -05:00
nyuszika7h
f646844aad Fix KeyError in chk_win
This fixes the error with wolf cub that has been appearing for a while
now, and also prevents similar errors from happening with monster and
traitor in the same function.
2014-12-04 11:41:09 +01:00