npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mafia-example-game

v1.2.0

Published

An example game for the module mafia

Downloads

4

Readme

Mafia-Example-Game

A little console game to show off the mafia module. Note that this isn't really the purpose of the module - it's to create multiplayer mafia games. This is just a little test playground you can modify to test stuff.

(Pst, you should open the gif on a new window to see it better!) Imgur

Downloading

Download this playground via NPM:

npm i mafia-example-game

or download this repository as a zip file or clone it. You need these 3 modules to make the game work if you download it this way:

npm i chalk
npm i mafia
npm i readline-sync

How to play

Go to the module's directory and run the game with npm run play.

Playing is pretty self explanatory. See the gif at the beginning of this readme for an example.

Default Roles

  • Sheriff (Town Investigative) - Check if your target is Wolf/Town every night. The werewolf appears as Town.
  • Villiger (Town Casual) - No special abilities.
  • Escort (Town Support) - Roleblock one player every night. If you roleblock a killer wolf, they will kill you.
  • Reviver (Town Protective) - Scry one person every night. If you die during the night, you will revive all dead scried players.
  • Protector (Town Protective) - Protect one person every night from an attack.
  • Werewolf (Wolfs Evil) - On every even night, frame one person. They will appear as Wolf to sheriff. On every odd night, kill one player.
  • Killer Wolf (Wolfs Power) - Kill one player every night.

Town wins when there is 1 or 0 wolfs left. Wolfs win if the town size is equal to the wolf size.

Default Rolelist

Game.rolelist = [
  "Town Investigative",
  "Town Protective",
  "Random Town",
  "Villager",
  "Villager",
  "Werewolf",
  "KillerWolf"
]

Default events

  • On day 1, you'll have the ability to vote.
  • On day 2, Lily will be lynched.
  • On night 1, you'll have the ability to send an action
  • On night 2, you'll have the ability to send an action AND someone else will send an action as well.