mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-02-09 10:20:16 +01:00
27 lines
753 B
JavaScript
27 lines
753 B
JavaScript
import { game } from ".";
|
|
import { sendUpdatedTeamInformations, teamBroadcast } from "./team_socket";
|
|
|
|
export class PenaltyController {
|
|
constructor(game) {
|
|
|
|
}
|
|
|
|
addPenalty(teamId) {
|
|
let team = game.getTeam(teamId);
|
|
if(team.captured) {
|
|
return;
|
|
}
|
|
team.penalties++;
|
|
if(team.penalties == game.MAX_PENALTIES) {
|
|
game.requestCapture(team.chased);
|
|
sendUpdatedTeamInformations(teamId);
|
|
sendUpdatedTeamInformations(team.chased);
|
|
teamBroadcast(teamId, "warning", "You have been eliminated (reason: too many penalties)")
|
|
teamBroadcast(team.chased, "success", "The team you are chasing has changed")
|
|
}
|
|
}
|
|
|
|
watchZone() {
|
|
|
|
}
|
|
} |