chrisgillis / slackwolf

A slack bot that moderates Werewolf games
343 stars 68 forks source link

Werewolves are so uncreative #52

Open chrisgillis opened 7 years ago

chrisgillis commented 7 years ago

They're always killing people the exact same way. Some randomized death text would be a fun, easy feature for new contributors.

Cerberus6320 commented 7 years ago

Hey there chris, I think I might be able to help with that. Would you happen to know where the kill text is hard coded?

Cerberus6320 commented 7 years ago

Actually, I think I found out where it's hard coded. Line 644 of slackwolf/blob/master/src/Game/GameManager.php

I can create a call to a method there soon to create some randomized kill text.

chrisgillis commented 7 years ago

Welcome to the project!

The $killMsg variable is created on line 588 of that file and you can follow it to where it ends on 644. You'll see that there is some amount of logic required to generate even a decent, uncreative kill message.

Please implement your solution by creating a new class and using it in GameManager. I've violated the SIngle Responsibility Principle far too often, we should avoid peppering existing classes with code that does more stuff.

Implement as much or as little as you'd like, but consider the following and would like to hear your thoughts as well.

This game is most often played in the workplace, so I think aiming for funny over gruesome is ideal here. Nothing graphic.

This should be configurable in some way by the admins of the game, so let's use a human readable format such as plain text files so it's easy to add/remove things.

We'd want to utilize the setoption command in Slackwolf so users can turn on/off 'creative' deaths at any time. Some workplaces may prefer to forego death altogether and just want a simple 'player has been eliminated' type message, that could be the new default.

Werewolves can kill villagers. (They have claws, but I can imagine them picking up objects from the village to kill with, they're rather opportunistic).

Villagers can kill werewolves, of course they're back in human form. Boring villagers would hang a wolf, but it's easy to get creative here.

Special roles may want to have their own randomized kill messages for when they eliminate a player or werewolf. For example, the witch probably has many poisons, the hunter has many guns, etc.