aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers
diff options
context:
space:
mode:
Diffstat (limited to 'Northstar.CustomServers')
-rw-r--r--Northstar.CustomServers/mod.json8
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/_respawn_protection.gnut39
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/_utility.gnut2
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_private_lobby_modes_init.gnut1
4 files changed, 49 insertions, 1 deletions
diff --git a/Northstar.CustomServers/mod.json b/Northstar.CustomServers/mod.json
index 9388b16f..e7c00daa 100644
--- a/Northstar.CustomServers/mod.json
+++ b/Northstar.CustomServers/mod.json
@@ -104,6 +104,14 @@
{
"Path": "lobby/sh_private_lobby_modes_init.gnut",
"RunOn": "( SERVER || CLIENT ) && MP"
+ },
+
+ {
+ "Path": "_respawn_protection.gnut",
+ "RunOn": "SERVER && MP",
+ "ServerCallback": {
+ "Before": "RespawnProtection_Init"
+ }
}
]
} \ No newline at end of file
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_respawn_protection.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_respawn_protection.gnut
new file mode 100644
index 00000000..2fb17767
--- /dev/null
+++ b/Northstar.CustomServers/mod/scripts/vscripts/_respawn_protection.gnut
@@ -0,0 +1,39 @@
+global function RespawnProtection_Init
+
+void function RespawnProtection_Init(){
+ AddCallback_OnPlayerRespawned( OnPlayerRespawned )
+}
+
+void function OnPlayerRespawned( entity player )
+{
+ thread RespawnProtection(player,GetCurrentPlaylistVarFloat("respawnprotection",0.0))
+}
+
+void function RespawnProtection( entity player , float time ){
+ OnThreadEnd(
+ function() : ( player )
+ {
+ //cancel protect if player attack
+ if( IsDemigod( player ) )
+ {
+ DisableDemigod( player );
+ }
+ }
+ )
+
+ player.EndSignal( "OnDeath" )
+ player.EndSignal( "OnDestroy" )
+ player.EndSignal( "OnPrimaryAttack" )
+
+ if( IsDemigod( player ) )
+ {
+ DisableDemigod( player );
+ }
+ else{
+ //start protect
+ EnableDemigod( player )
+ wait time
+ //cancel protect
+ DisableDemigod( player );
+ }
+}
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_utility.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_utility.gnut
index 59bba002..1644afd9 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/_utility.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/_utility.gnut
@@ -4401,4 +4401,4 @@ bool function PlayerHasTitan( entity player )
return true
return false
-}
+} \ No newline at end of file
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_private_lobby_modes_init.gnut b/Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_private_lobby_modes_init.gnut
index 68d6a5d7..719ea336 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_private_lobby_modes_init.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_private_lobby_modes_init.gnut
@@ -10,6 +10,7 @@ void function PrivateMatchModesInit()
AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_MATCH", "roundscorelimit", "0" ) //, "Score Limit (round-based modes)" )
AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_MATCH", "timelimit", "12" ) //, "Time Limit" )
AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_MATCH", "roundtimelimit", "0" ) //, "Time Limit (round-based modes)" )
+ AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_MATCH", "respawnprotection", "0.0" ) //, "Player Respawn Protection Time" )
AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_PILOT", "pilot_health_multiplier", "1.0" )
AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_PILOT", "respawn_delay", "0.0" )