chat-plugins/mafia.js
// Triggers after the user has voted.
Triggers after the user has voted.
Triggers after the user has voted .
onReceiveVote(target) {
		if (!this.voting) {
			return this.sendRoom("You don't need to vote right now.");
		}
		if (target in this.validVotes || target === 'none') {
			this.game.currentVote.set(this, target);
			this.game.updateVotes();
			for (let i in this.game.players) {
				if (!this.game.players[i].done) {
					return;
				}
			}
			this.game.progress();
		} else {
			this.sendRoom("You can't vote for that person");
		}
	}
onReceiveVote ( target ) { if ( ! this . voting ) { return this . sendRoom ( "You don't need to vote right now." ) ; } if ( target in this . validVotes || target === 'none' ) { this . game . currentVote . set ( this , target ) ; this . game . updateVotes ( ) ; for ( let i in this . game . players ) { if ( ! this . game . players [ i ] . done ) { return ; } } this . game . progress ( ) ; } else { this . sendRoom ( "You can't vote for that person" ) ; } }
Triggers after the user has voted.
Triggers after the user has voted .