summaryrefslogtreecommitdiffstats
path: root/TemplePushing.c4s/Script.c
diff options
context:
space:
mode:
authorJan <>2015-02-02 18:49:15 +0100
committerJan <_>2015-07-10 17:52:21 +0200
commitde97f8b2898e8fd00c5d6108e2832b7e6cd3668f (patch)
treedc8d478aec0b71e0c4dd797e51080335220d02cf /TemplePushing.c4s/Script.c
parentca61c54b9bd69af897e4cc9d4385137fb56fd11a (diff)
downloadtempelschubsen-de97f8b2898e8fd00c5d6108e2832b7e6cd3668f.tar.gz
tempelschubsen-de97f8b2898e8fd00c5d6108e2832b7e6cd3668f.zip
TemplePushingB.c4s
Diffstat (limited to 'TemplePushing.c4s/Script.c')
-rw-r--r--TemplePushing.c4s/Script.c58
1 files changed, 40 insertions, 18 deletions
diff --git a/TemplePushing.c4s/Script.c b/TemplePushing.c4s/Script.c
index ea02517..97f88bd 100644
--- a/TemplePushing.c4s/Script.c
+++ b/TemplePushing.c4s/Script.c
@@ -3,9 +3,10 @@
#strict 2
static const MODE_Classic = 0, MODE_Magic = 1, MODE_Festive = 2, MODE_Apocalyptic = 3, MODE_Knightly = 4;
-static const SBRD_ScoreCol = 0, SBRD_RelaunchesCol = 1;
+static const SBRD_RelaunchesCol = 0;
static const MaxTeamCount = 2;
+static SBRD_ScoreCol;
static section, mode;
static numRelaunches;
static deathmatchEnabled, deathmatchWinScore;
@@ -19,9 +20,9 @@ func Initialize()
{
ShowLobby();
- // Create Thrones for recreational purposes...
+ // Create Thrones for recreational purposes
CreateObject(THRN, 590, 420, NO_OWNER);
- CreateObject(THRN, 470, 210, NO_OWNER);
+ CreateObject(THRN, 410, 210, NO_OWNER);
// Initial values
deathmatchWinScore = 20;
@@ -32,7 +33,7 @@ func Initialize()
// Create setup menu
var menu = CreateObject(SPMU, 0, 0, NO_OWNER);
- menu->LocalN("extinguisherEnabled") = false;
+ menu->LocalN("extinguisherEnabled") = true;
menu->LocalN("rotateInJumpEnabled") = true;
menu->LocalN("numRelaunches") = 10;
menu->LocalN("deathmatchWinScore") = 20;
@@ -81,6 +82,9 @@ func UpdateScoreboard(int player, bool leaver)
{
var playerID = GetPlayerID(player);
var text;
+
+ if (!deathmatchEnabled) SBRD_ScoreCol = 1;
+ if (deathmatchEnabled) SBRD_ScoreCol = 0;
// Ignore invalid player numbers
if (!playerID) return;
@@ -100,14 +104,6 @@ func UpdateScoreboard(int player, bool leaver)
}
}
- // Normal and deathmatch mode: Show score
- if (leaver)
- text = "{{SLVR}}";
- else
- text = Format("%d", playerScore[playerID]);
-
- SetScoreboardData(PlayerRow(player), SBRD_ScoreCol, text, playerScore[playerID]);
-
// Normal mode only: Show remaining relaunches
if (!deathmatchEnabled)
{
@@ -121,11 +117,24 @@ func UpdateScoreboard(int player, bool leaver)
SetScoreboardData(PlayerRow(player), SBRD_RelaunchesCol, text, relaunchesLeft);
}
+
+ // Normal and deathmatch mode: Show score
+ if (leaver)
+ text = "{{SLVR}}";
+ else
+ text = Format("%d", playerScore[playerID]);
+
+ SetScoreboardData(PlayerRow(player), SBRD_ScoreCol, text, playerScore[playerID]);
+
// Sort rows
+ if (!deathmatchEnabled)
+ {
+ SortScoreboard(SBRD_RelaunchesCol, true);
SortScoreboard(SBRD_ScoreCol, true);
- if (!deathmatchEnabled) SortScoreboard(SBRD_RelaunchesCol, true);
- SortScoreboard(SBRD_Caption);
+ }
+ else SortScoreboard(SBRD_ScoreCol, true);
+ // SortScoreboard(SBRD_Caption);
}
func ShowLobby()
@@ -170,7 +179,7 @@ func StartGame(object menu, string message)
}
if (mode == MODE_Festive)
{
- spawnPointSpawner->SetDefinitions([[TSWB,5], [SCRL, 5], [ROCK, 1]]);
+ spawnPointSpawner->SetDefinitions([[TSWB, 10], [SCRL, 5]]);
spawnPointSpawner->SetSpawnInterval(600);
}
if (mode == MODE_Knightly)
@@ -195,6 +204,14 @@ func StartGame(object menu, string message)
AddEffect("Bottom", 0, 20, 2);
AddEffect("SkyAdjust", 0, 20, 1);
}
+
+ // Effects for festive mode
+ if (mode == MODE_Festive)
+ {
+ if (ambienceEnabled) CreateObject(SNOR, 0, 0, NO_OWNER);
+ SetSkyAdjust(RGB(189, 189, 255));
+ SetGamma(RGB(0, 0, 50), RGB(100, 100, 128), RGB(200, 200, 255));
+ }
// Create melee goal
Log("Creating melee goal");
@@ -414,7 +431,7 @@ func OnClonkDeath(object clonk, int killedBy)
if (gameStarted && HandleKill(player, killedBy)) return;
// Relaunch
- if (GetPlayerID(player)) LaunchClonk(player, clonk, true);
+ if (GetPlayerID(player)) LaunchClonk(player, clonk, true);
}
func LaunchClonk(int player, object clonk, bool relaunch)
@@ -432,7 +449,6 @@ func LaunchClonk(int player, object clonk, bool relaunch)
}
clonk = newClonk;
}
-
ResetHealth(clonk);
SelectCrew(player, clonk, true);
@@ -485,8 +501,14 @@ func LaunchClonk(int player, object clonk, bool relaunch)
clonk->Schedule("SelectCrew(GetOwner(), this, true)", 20);
}
- PlayerMessage(player, "<c %x>{{FLAG}}</c>", clonk, GetPlrColorDw(player));
+ 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);
+ 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);
+ 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);
}
func ResetHealth(object clonk)