aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut
diff options
context:
space:
mode:
authorF1F7Y <64418963+F1F7Y@users.noreply.github.com>2021-12-30 23:52:05 +0100
committerGitHub <noreply@github.com>2021-12-30 23:52:05 +0100
commit66ddb8c0afd4b91f0dbdc35dd4a4cac5d28dcca5 (patch)
tree2b8fe2d0fc65af16ba57cdc4163ef16030fdf841 /Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut
parent8ea10a9e5c32daac938b0672efa13e7401968f0b (diff)
parentaed2841ebbecb6376f00bf190503ce5c694f9fa4 (diff)
downloadNorthstarMods-66ddb8c0afd4b91f0dbdc35dd4a4cac5d28dcca5.tar.gz
NorthstarMods-66ddb8c0afd4b91f0dbdc35dd4a4cac5d28dcca5.zip
Merge branch 'R2Northstar:main' into main
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut40
1 files changed, 26 insertions, 14 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut
index 4e62e8c54..7eec7c89f 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut
@@ -1,15 +1,27 @@
-global function GamemodePs_Init
-
-void function GamemodePs_Init()
-{
- Riff_ForceTitanAvailability( eTitanAvailability.Never )
-
- AddCallback_OnPlayerKilled( GiveScoreForPlayerKill )
- ScoreEvent_SetupEarnMeterValuesForMixedModes()
-}
-
-void function GiveScoreForPlayerKill( entity victim, entity attacker, var damageInfo )
-{
- if ( victim != attacker && victim.IsPlayer() && attacker.IsPlayer() )
- AddTeamScore( attacker.GetTeam(), 1 )
+global function GamemodePs_Init
+
+void function GamemodePs_Init()
+{
+ Riff_ForceTitanAvailability( eTitanAvailability.Never )
+
+ AddCallback_OnPlayerKilled( GiveScoreForPlayerKill )
+ ScoreEvent_SetupEarnMeterValuesForMixedModes()
+ SetTimeoutWinnerDecisionFunc( CheckScoreForDraw )
+
+}
+
+void function GiveScoreForPlayerKill( entity victim, entity attacker, var damageInfo )
+{
+ if ( victim != attacker && victim.IsPlayer() && attacker.IsPlayer() || GetGameState() != eGameState.Playing )
+ AddTeamScore( attacker.GetTeam(), 1 )
+}
+
+int function CheckScoreForDraw()
+{
+ if (GameRules_GetTeamScore(TEAM_IMC) > GameRules_GetTeamScore(TEAM_MILITIA))
+ return TEAM_IMC
+ else if (GameRules_GetTeamScore(TEAM_MILITIA) > GameRules_GetTeamScore(TEAM_IMC))
+ return TEAM_MILITIA
+
+ return TEAM_UNASSIGNED
} \ No newline at end of file