diff options
Diffstat (limited to 'TemplePushing.c4s/Script.c')
| -rw-r--r-- | TemplePushing.c4s/Script.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/TemplePushing.c4s/Script.c b/TemplePushing.c4s/Script.c index e185707..b770c28 100644 --- a/TemplePushing.c4s/Script.c +++ b/TemplePushing.c4s/Script.c @@ -49,13 +49,13 @@ func Initialize() menu->LocalN("numRelaunches") = 7; menu->LocalN("deathmatchWinScore") = 15; menu->LocalN("ambienceEnabled") = !GetLeague(); - + // Modulate endscreen SetNextMission("TemplePushing.c4s", "Rematch", "$Rematch$"); // Set possible spells SetScrollSpells([ABLA, MBOT, MFRB, MDBT, GVTY, MLGT, CFAL, MSSH, MINV, MARK, MFWV, MGFL, LAVS, MGPL, ICNL, MDFL, AFST, MGCY, MATT]); - + // Disable music altogether SetPlayList(" "); } @@ -70,7 +70,7 @@ func InitializePlayer(int player) SetFoW(false, player); if (LobbyActive()) return; - + playerDeaths[GetPlayerID(player)] = 0; if (deathmatchEnabled) { @@ -80,7 +80,7 @@ func InitializePlayer(int player) SetScoreboardData(TeamRow(team), SBRD_NameCol, Format("<c %x>Team %s</c>", GetTeamColor(team), GetTeamName(team))); SetScoreboardData(TeamRow(team), SBRD_SortCol, " ", SORT_SORTCOL_Team); } - } + } SetScoreboardData(PlayerRow(player), SBRD_NameCol, GetTaggedPlayerName(player)); SetScoreboardData(PlayerRow(player), SBRD_SortCol, " ", SORT_SORTCOL_Player); SetScoreboardData(PlayerRow(player), SBRD_TeamSortCol, " ", GetPlayerTeam(player)); @@ -139,7 +139,7 @@ func UpdateScoreboard(int player, bool leaver) SetScoreboardData(PlayerRow(player), SBRD_RelaunchesCol, text, relaunchesLeft); } - + // Normal and deathmatch mode: Show player score if (leaver) { @@ -150,7 +150,7 @@ func UpdateScoreboard(int player, bool leaver) } else text = Format("%d", playerScore[playerID]); - + SetScoreboardData(PlayerRow(player), SBRD_ScoreCol, text, playerScore[playerID]); // Sort rows @@ -212,22 +212,22 @@ func Script0() spawnPointSpawner->SetDefinitions(mode->SpawnpointDefinitions()); spawnPointSpawner->SetSpawnInterval(mode->SpawnpointInterval()); - + spawnPointSpawner->CreateSpawnPoints(); } - + // Create melee goal CreateObject(MELE, 0, 0, NO_OWNER); - + // Create rules CreateObject(TBMC, 0, 0, NO_OWNER); // Rule for enabling/disabling music CreateObject(_ETG, 0, 0, NO_OWNER); if (suddendeathEnabled) CreateObject(SDDT, 0, 0, NO_OWNER); if (rotateInJumpEnabled) CreateObject(RIJP, 0, 0, NO_OWNER); CreateObject(OFDR, 0, 0, NO_OWNER); - + SetScoreboardData(SBRD_Caption, SBRD_NameCol, " "); // Make sure the name column gets created first - + // Deathmatch? if (deathmatchEnabled) { @@ -240,14 +240,14 @@ func Script0() { SetScoreboardData(SBRD_Caption, SBRD_RelaunchesCol, "{{SREL}}"); } - + SetScoreboardData(SBRD_Caption, SBRD_ScoreCol, "{{SKIL}}"); for (var sound in ambienceSounds) { SoundLevel(sound[0], sound[1]); } - + // Initialize players for (var i = 0; i < GetPlayerCount(); ++i) { @@ -264,14 +264,14 @@ func ShowCountdown() gameStartMessage = 0; Message(""); Schedule("SetMaxPlayer(0)", 60 * 38); - + // Reenable crew for (var i = 0; i < GetPlayerCount(); ++i) { var player = GetPlayerByIndex(i); var clonk = GetCrew(player); if (!clonk) continue; // Happens if player still in team choice menu - + // Relaunch if clonk does not stand. if (clonk->GetAction() != "Walk") { @@ -286,7 +286,7 @@ func ShowCountdown() clonk->Extinguish(); ResetHealth(clonk); } - + gameStarted = true; } else @@ -294,7 +294,7 @@ func ShowCountdown() Message("@<c ffff00>%d</c>|%s", 0, countdown, gameStartMessage); Schedule("GameCall(\"ShowCountdown\")", 38); } - + --countdown; } @@ -310,7 +310,7 @@ global func GetActiveTeamCount() ++teams[GetPlayerTeam(GetPlayerByIndex(i))]; } } - + teams[-1] = 0; var count = 0; for(var teamCount in teams) @@ -322,7 +322,7 @@ global func GetActiveTeamCount() } return count; } - + global func EliminatePlayer(int iPlr, bool fQuiet) { var ret = _inherited(iPlr, fQuiet); @@ -342,7 +342,7 @@ func HandleKill(int killed, int killer) { // Check if the game is over if (GetEffectCount("GameOver")) return 0; - + // Assume suicide if killer cannot be determined if (killer == NO_OWNER) killer = killed; @@ -350,9 +350,9 @@ func HandleKill(int killed, int killer) var killedID = GetPlayerID(killed), killerID = GetPlayerID(killer); var killedTeam = GetPlayerTeam(killed), killerTeam = GetPlayerTeam(killer); var teamKill = killedTeam != 0 && killedTeam == killerTeam; - + ++playerDeaths[killedID]; - + // Update kill score if (!teamKill) { @@ -426,10 +426,10 @@ func HandleKill(int killed, int killer) } } } - + UpdateScoreboard(killed); UpdateScoreboard(killer); - + return killedEliminated; } @@ -552,19 +552,19 @@ func LaunchClonk(int player, object clonk, bool relaunch) clonk->SetPosition(bestPosition[0], bestPosition[1]); clonk->SetDir(bestPosition[0] < LandscapeWidth()/2); - + // Still in countdown? if (!LobbyActive() && !gameStarted) { clonk->SetCrewEnabled(false); } - + // No corpses in apocalypse mode if (mode->~NoCorpses()) clonk->LocalN("removeOnDeath") = true; - + // Enable rotation in jump for the clonk if allowed by rule if (FindObject(RIJP)) clonk->LocalN("rotateInJump") = true; - + // Do not immediately pass player control to the new clonk to prevent accidental jumps if (relaunch) { @@ -574,7 +574,7 @@ func LaunchClonk(int player, object clonk, bool relaunch) clonk->SetObjectLayer(clonk); clonk->Schedule("SetObjectLayer(0)", 50); } - + // Respawn effects PlayerMessage(player, "{{SREL}}", clonk); DrawParticleLine("PSpark", GetX(clonk), 0, GetX(clonk), GetY(clonk), 10, 150, RGBa(Random(255), Random(255), Random(255),50), RGBa(Random(255), Random(255), Random(255),50), 0); @@ -582,7 +582,7 @@ func LaunchClonk(int player, object clonk, bool relaunch) DrawParticleLine("PSpark", GetX(clonk) - RandomX(5, 60), 0, GetX(clonk), GetY(clonk), 10, 150, RGBa(Random(255), Random(255), Random(255),50), RGBa(Random(255), Random(255), Random(255),50), 0); Sound("PlayerJoin", 0, clonk, 100); CastParticles("MSpark", 50, 20, GetX(clonk), GetY(clonk), 50, 75, RGBa(128,128,255,0), RGBa(255,255,255,127)); - + SetPlrView(player, clonk); ResetHealth(clonk); } |
