summaryrefslogtreecommitdiffstats
path: root/TemplePushing.c4s
diff options
context:
space:
mode:
authorMittendrein Markus <maxmitti@gmx.net>2015-08-26 22:47:46 +0200
committerMittendrein Markus <maxmitti@gmx.net>2015-09-03 19:22:38 +0200
commit736efdaf6aea46dc44322e84656a7a489face44a (patch)
tree58803fed93d6fef0f7ff01d6d7476ff4a3b16d9e /TemplePushing.c4s
parent14ea123b3950acd08d136ee0a6a23201df074756 (diff)
downloadtempelschubsen-736efdaf6aea46dc44322e84656a7a489face44a.tar.gz
tempelschubsen-736efdaf6aea46dc44322e84656a7a489face44a.zip
Add GameComments to show current game state
Diffstat (limited to 'TemplePushing.c4s')
-rw-r--r--TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/Script.c17
-rw-r--r--TemplePushing.c4s/Script.c41
-rw-r--r--TemplePushing.c4s/StringTblDE.txt12
-rw-r--r--TemplePushing.c4s/StringTblUS.txt11
-rw-r--r--TemplePushing.c4s/System.c4g/Compatibility.c5
5 files changed, 80 insertions, 6 deletions
diff --git a/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/Script.c b/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/Script.c
index ea902f8..11c2587 100644
--- a/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/Script.c
+++ b/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/Script.c
@@ -18,6 +18,16 @@ local ambienceEnabled;
local numRelaunches;
local deathmatchEnabled, deathmatchWinScore;
+public func GetModes()
+{
+ return
+ [[MODE_Classic, "$ModeClassic$", CLSC],
+ [MODE_Magic, "$ModeMagic$", MLPG],
+ [MODE_Festive, "$ModeFestive$", FSTV],
+ [MODE_Apocalyptic, "$ModeApocalyptic$", APCE],
+ [MODE_Knightly, "$ModeKnightly$", MKNI]];
+}
+
protected func Initialize()
{
Sections = [];
@@ -27,12 +37,7 @@ protected func Initialize()
}
section = Sections[0];
- Modes = [
- [MODE_Classic, "$ModeClassic$", CLSC],
- [MODE_Magic, "$ModeMagic$", MLPG],
- [MODE_Knightly, "$ModeKnightly$", MKNI],
- [MODE_Apocalyptic, "$ModeApocalyptic$", APCE],
- [MODE_Festive, "$ModeFestive$", FSTV]];
+ Modes = GetModes();
}
private func ShowSetup()
diff --git a/TemplePushing.c4s/Script.c b/TemplePushing.c4s/Script.c
index 197757c..a75c6cf 100644
--- a/TemplePushing.c4s/Script.c
+++ b/TemplePushing.c4s/Script.c
@@ -154,11 +154,14 @@ func UpdateScoreboard(int player, bool leaver)
SortScoreboard(SBRD_ScoreCol, true);
if (!deathmatchEnabled) SortScoreboard(SBRD_RelaunchesCol, true);
SortScoreboard(SBRD_SortCol);
+
+ UpdateComment();
}
func ShowLobby()
{
LoadScenarioSection("Lobby");
+ UpdateComment(true);
}
func SetupDone(object menu, string message)
@@ -719,3 +722,41 @@ func ToggleAmbienceSounds(int player)
SetPlrExtraData(player, PlrData_EnableAmbienceSounds, preference);
DoAmbienceSounds(player);
}
+
+func UpdateComment(bool inLobby)
+{
+ if (inLobby) SetGameComment(" $LobbyComment$");
+ else
+ {
+ var score = "";
+ var teams = [];
+ var teamRelaunches = [];
+ for (var i = 0; i < GetPlayerCount(); i++)
+ {
+ if (!eliminatedPlayers[GetPlayerID(GetPlayerByIndex(i))])
+ {
+ ++teams[GetPlayerTeam(GetPlayerByIndex(i))];
+ if (!deathmatchEnabled) teamRelaunches[GetPlayerTeam(GetPlayerByIndex(i))] += numRelaunches - playerDeaths[GetPlayerID(GetPlayerByIndex(i))];
+ }
+ }
+
+ for (var i = 1; i <= GetTeamCount(); ++i)
+ {
+ if (teams[i])
+ {
+ if (GetLength(score)) score = Format("%s : ", score);
+ if (deathmatchEnabled) score = Format("%s<c %x>%d</c>", score, GetTeamColor(i), teamScore[i]);
+ else score = Format("%s<c %x>%d</c>", score, GetTeamColor(i), teamRelaunches[i]);
+ }
+ }
+
+ var modes = SPMU->GetModes();
+ var sudden = "";
+ if(suddendeathEnabled) sudden = " $SuddenDeath$";
+ var goalDesc;
+ if(deathmatchEnabled) goalDesc = Format("$DM$", deathmatchWinScore);
+ else goalDesc = Format("$LMS$", numRelaunches);
+
+ SetGameComment(Format(" $GameComment$", GetName(0, sectionID), modes[mode][1], sudden, goalDesc, score));
+ }
+}
diff --git a/TemplePushing.c4s/StringTblDE.txt b/TemplePushing.c4s/StringTblDE.txt
index 457bf8a..d4c3ea8 100644
--- a/TemplePushing.c4s/StringTblDE.txt
+++ b/TemplePushing.c4s/StringTblDE.txt
@@ -1,3 +1,8 @@
+ModeClassic=<c e6b800>Klassisch</c>
+ModeMagic=<c 4700b2>Magisch</c>
+ModeKnightly=<c 99ff66>Mittelalterlich</c>
+ModeApocalyptic=<c b20000>Apokalyptisch</c>
+ModeFestive=<c f0ffff>Winterlich</c>
TeamOne=Lldhyr
TeamTwo=Phephr
TeamThree=Ghardûr
@@ -12,3 +17,10 @@ WinScore=Ziel
MsgDeathmatchWin=<c %x>Team %s</c> erringt den Sieg.
Win=Sieg
Rematch=Startet eine weitere Runde Tempelschubsen.
+
+# GameComment-Strings
+LobbyComment= <i>Es wird noch eingestellt…<i>
+SuddenDeath=mit <c ff0000>Sudden Death</c>
+DM=<c ff0000>DM</c> mit %d Punkten
+LMS=<c 80>LMS</c> mit %d Relaunches
+GameComment=<c ffffc0>Tempel</c>: %s| <c ffffc0>Modus</c>: %s%s| <c ffffc0>Ziel</c>: %s| <c ffffc0>Spielstand</c>: %s
diff --git a/TemplePushing.c4s/StringTblUS.txt b/TemplePushing.c4s/StringTblUS.txt
index d6ef77a..5d7f552 100644
--- a/TemplePushing.c4s/StringTblUS.txt
+++ b/TemplePushing.c4s/StringTblUS.txt
@@ -1,3 +1,8 @@
+ModeClassic=<c e6b800>Classic</c>
+ModeMagic=<c 4700b2>Magical</c>
+ModeKnightly=<c 99ff66>Medieval</c>
+ModeApocalyptic=<c b20000>Apocalyptical</c>
+ModeFestive=<c f0ffff>Winterly</c>
TeamOne=Lldhyr
TeamTwo=Phephr
TeamThree=Ghardûr
@@ -13,3 +18,9 @@ MsgDeathmatchWin=<c %x>Team %s</c> wins the match.
Win=Win
Rematch=Starts another round of Temple Pushing.
+# GameComment-Strings
+LobbyComment= <i>Settings are still being chosen…</i>
+SuddenDeath=with <c ff0000>sudden death</c>
+DM=<c ff0000>DM</c> with %d points
+LMS=<c 80>LMS</c> with %d relaunches
+GameComment=<c ffffc0>Temple</c>: %s| <c ffffc0>Mode</c>: %s%s| <c ffffc0>Goal</c>: %s| <c ffffc0>Score</c>: %s
diff --git a/TemplePushing.c4s/System.c4g/Compatibility.c b/TemplePushing.c4s/System.c4g/Compatibility.c
new file mode 100644
index 0000000..5d3865e
--- /dev/null
+++ b/TemplePushing.c4s/System.c4g/Compatibility.c
@@ -0,0 +1,5 @@
+/*-- Avoid errors from non-existent Engine-Functions --*/
+
+#strict 2
+
+global func SetGameComment() { return _inherited(...); }