aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers
diff options
context:
space:
mode:
authorx3Karma <juliuslimck@gmail.com>2021-12-30 14:27:17 +0800
committerGitHub <noreply@github.com>2021-12-30 14:27:17 +0800
commit269dda4ad2bf2ecf774f6a1f704b338d357811da (patch)
treed6005abab67c23e2a75bb54d282540ca12650212 /Northstar.CustomServers
parentf98b68820d29c8bf3aad041dec269ea83f33da5f (diff)
downloadNorthstarMods-269dda4ad2bf2ecf774f6a1f704b338d357811da.tar.gz
NorthstarMods-269dda4ad2bf2ecf774f6a1f704b338d357811da.zip
adds timeout checker to PvP
Diffstat (limited to 'Northstar.CustomServers')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut42
1 files changed, 27 insertions, 15 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut
index 7e3e5ea2..7eec7c89 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() && GetGameState() != eGameState.Epilogue )
- 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