// Setting the "town_mood" value
::town_mood <- "town_mood" in getroottable() ? ::town_mood : 0
// Defining this entity's methods
function Increase() {
if (::town_mood < 3) ::town_mood++
ClientPrint(null, 3, "\x07FF3F3FRed\x07EEFFAA wins! Increasing the score to \x07FFFFFF"+::town_mood)
}
function Decrease() {
if (::town_mood > 0) ::town_mood--
ClientPrint(null, 3, "\x0799CCFFBlue\x07EEFFAA wins! Decreasing the score to \x07FFFFFF"+::town_mood)
}
// Checking this round's "town_mood"
switch (::town_mood) {
case 3:
for (local spawn; spawn = Entities.FindByName(spawn, "spawn_town_*");) spawn.AcceptInput("Disable", "", null, null)
for (local spawn; spawn = Entities.FindByName(spawn, "spawn_otherside_*");) spawn.AcceptInput("Enable", "", null, null)
self.AcceptInput("FireUser1", "", null, null)
break
default:
for (local spawn; spawn = Entities.FindByName(spawn, "spawn_town_*");) spawn.AcceptInput("Enable", "", null, null)
for (local spawn; spawn = Entities.FindByName(spawn, "spawn_otherside_*");) spawn.AcceptInput("Disable", "", null, null)
self.AcceptInput("FireUser2", "", null, null)
}
// Debug print
ClientPrint(null, 3, "----- ---- --- -- -")
ClientPrint(null, 3, "\x07EEFFAACurrent town mood: \x07FFFFFF"+::town_mood)
ClientPrint(null, 3, "\x07EEFFAAWin as \x07FF3F3FRed\x07EEFFAA to increase the value or win as \x0799CCFFBlue\x07EEFFAA to decrease it!")
ClientPrint(null, 3, "----- ---- --- -- -")