chat-plugins/mafia.js
// Triggers after the user has selected their target.
Triggers after the user has selected their target.
Triggers after the user has selected their target .
onReceiveTarget(target) {
		if (!this.targeting) {
			return this.sendRoom("You're not selecting a target right now.");
		}
		if (target in this.validTargets || target === 'none') {
			if (target === 'none') {
				if (this.using) delete this.using;
				this.toExecute = null;
			} else {
				this.target = this.game.players[target];
			}
			this.updateTarget(this.class.image);
			for (let i in this.game.players) {
				if (!this.game.players[i].done) {
					return;
				}
			}
			this.game.progress();
		} else {
			this.sendRoom("Invalid target");
		}
	}
onReceiveTarget ( target ) { if ( ! this . targeting ) { return this . sendRoom ( "You're not selecting a target right now." ) ; } if ( target in this . validTargets || target === 'none' ) { if ( target === 'none' ) { if ( this . using ) delete this . using ; this . toExecute = null ; } else { this . target = this . game . players [ target ] ; } this . updateTarget ( this . class . image ) ; for ( let i in this . game . players ) { if ( ! this . game . players [ i ] . done ) { return ; } } this . game . progress ( ) ; } else { this . sendRoom ( "Invalid target" ) ; } }
Triggers after the user has selected their target.
Triggers after the user has selected their target .