Commit Graph

249 Commits

Author SHA1 Message Date
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
nyuszika7h
051aff9476 fgame: Don't restrict what the default role can be
If it breaks, you get to keep the pieces. ;)
2015-07-11 23:51:38 +02: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
b968f83e8b Optimize var.get_role
It will now return as soon as it finds the role for the player,
instead of calling var.list_players_and_roles every single time.
I haven't tested in a real-world scenario, but in a test game
with 10000 players (don't ask), the speed improvement is very clear
(~1-2s per player when sending out nighttime PMs instead of ~10s).
2015-06-30 20:39:55 +02: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
nyuszika7h
f849eb35c2 Remove debug print 2015-06-21 00:19:56 +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
nyuszika7h
7887b6b2d8 Looks like that op request wasn't so redundant.
I misread the code.
2015-06-15 20:36:43 +02:00
nyuszika7h
6f62831b8a Join all channels at once and remove redundant op request 2015-06-15 20:21:55 +02:00
nyuszika7h
452c1b1ede Fix capability negotiation to be more sane (and IRCv3.2-compliant) 2015-06-15 20:20:28 +02: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
Vgr E.Barry
d8161271c7 Tweak template restrictions handling 2015-06-15 10:28:14 -04:00
Vgr E.Barry
95967b8633 Make events.remove_listener remove empty lists as well 2015-06-15 10:26:58 -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
d069345c2c Refactor of the random game mode to use the role_attribution event 2015-06-14 22:57:23 -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
5c4dcec8e6 Remove \x02 from console and file output 2015-06-14 16:31:29 -04:00
Vgr E.Barry
1d711b9cee s/!roles was disabled/!roles is disabled/ 2015-06-14 16:12:50 -04:00
Vgr E.Barry
81e3e688ab Fix Event.dispatch to return True if execution is to proceed 2015-06-14 16:06:36 -04:00
Vgr E.Barry
28dc0a8e14 Fix corner case with multiple pipers 2015-06-14 12:06:52 -04:00
nyuszika7h
1591655c68 Log admin commands to audit.log as well 2015-06-14 17:45:46 +02: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
Vgr E.Barry
f3ab9b1512 Simplify some conditionals for valentines role attribution 2015-06-13 17:14:22 -04: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
skizzerz
d87db24f51 noreveal balance tweaks
It's been found that larger game sizes heavily favors the village, this
reduces the village power significantly by removing obvious "claim"
roles and shifting more powerful roles later into the rotation where
they are less effective. This may be too much of a shift but that is
currently unknown.

- Shaman removed entirely
- Hunter now at 10p (from 15)
- GA now at 12p (from 10)
- Detective now at 15p (from 12)
2015-06-09 18:22:59 -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
jacob1
255a3562c8 Add village elder to amnesiac blacklist in 'random' games
We really should remove the role altogether but woffle wants to keep it for some reason ...
2015-06-08 22:07:49 -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
Vgr E.Barry
5383ea75f8 Fix error if bot uses temporary nickname 2015-06-08 19:04:22 -04:00
Vgr E.Barry
6a7f9fe906 Fix denied commands still triggering
...
2015-06-05 22:58:38 -04: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
910fd0a8cb Fix decorators erroring with every message 2015-06-04 19:51:21 -04:00
Vgr E.Barry
9dc52441e8 Fix some commands not working in alt channels 2015-06-04 19:37:12 -04:00
skizzerz
c47fa284d2 noreveal tweaks
- Add in new mystic roles, replacing minion and village elder.
- Also add elder to amnesiac blacklist.
2015-06-04 17:53:22 -05: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
4382d91008 Modify hook handling 2015-06-04 10:55:53 -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
dcc23ce554 Modify how permissions are checked 2015-06-04 09:45:31 -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
skizzerz
dadff67f74 Guardian modifications
Modify game over messages to read better
Modify win conds to remove unneeded ones and to also add in some "nobody
wins" conds that happen due to MAD or stalemates.
2015-06-03 10:56:29 -05:00
Vgr E.Barry
f1285d2237 Tweak the decorators to no longer have mangled __call__ 2015-06-03 11:09:26 -04: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
Emanuel Barry
24851f3c56 Fix wrong pingif tables 2015-06-01 14:25:50 -04: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