aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Custom
diff options
context:
space:
mode:
Diffstat (limited to 'Northstar.Custom')
-rw-r--r--Northstar.Custom/mod.json12
-rw-r--r--Northstar.Custom/mod/resource/northstar_custom_portuguese.txtbin2639 -> 5338 bytes
-rw-r--r--Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_inf.gnut23
-rw-r--r--Northstar.Custom/mod/scripts/vscripts/sh_custom_air_accel.gnut11
-rw-r--r--Northstar.Custom/mod/scripts/vscripts/sh_custom_pilot_collision.gnut32
5 files changed, 70 insertions, 8 deletions
diff --git a/Northstar.Custom/mod.json b/Northstar.Custom/mod.json
index 4759956a4..e817df6d4 100644
--- a/Northstar.Custom/mod.json
+++ b/Northstar.Custom/mod.json
@@ -334,6 +334,18 @@
"ServerCallback": {
"After": "DisallowedWeapons_Init"
}
+ },
+
+ {
+ "Path": "sh_custom_pilot_collision.gnut",
+ "RunOn": "( CLIENT || SERVER ) && MP",
+ "ClientCallback": {
+ "After": "CustomPilotCollision_InitPlaylistVars"
+ },
+
+ "ServerCallback": {
+ "After": "CustomPilotCollision_InitPlaylistVars"
+ }
}
],
diff --git a/Northstar.Custom/mod/resource/northstar_custom_portuguese.txt b/Northstar.Custom/mod/resource/northstar_custom_portuguese.txt
index 62835f52c..0a7b19d23 100644
--- a/Northstar.Custom/mod/resource/northstar_custom_portuguese.txt
+++ b/Northstar.Custom/mod/resource/northstar_custom_portuguese.txt
Binary files differ
diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_inf.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_inf.gnut
index a0e0b7431..2ccd46ba2 100644
--- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_inf.gnut
+++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_inf.gnut
@@ -30,7 +30,7 @@ void function InfectionInitPlayer( entity player )
if ( GetGameState() < eGameState.Playing )
SetTeam( player, INFECTION_TEAM_SURVIVOR )
else
- InfectPlayer( player )
+ InfectPlayer( player, player )
}
void function SelectFirstInfected()
@@ -45,23 +45,23 @@ void function SelectFirstInfectedDelayed()
array<entity> players = GetPlayerArray()
entity infected = players[ RandomInt( players.len() ) ]
- InfectPlayer( infected )
+ InfectPlayer( infected, infected )
RespawnInfected( infected )
}
void function InfectionOnPlayerKilled( entity victim, entity attacker, var damageInfo )
{
- if ( !victim.IsPlayer() || GetGameState() != eGameState.Playing )
+ if ( !victim.IsPlayer() || !attacker.IsPlayer() || GetGameState() != eGameState.Playing )
return
if ( victim.GetTeam() == INFECTION_TEAM_SURVIVOR )
- InfectPlayer( victim )
+ InfectPlayer( victim, attacker )
if ( attacker.IsPlayer() )
attacker.SetPlayerGameStat( PGS_ASSAULT_SCORE, attacker.GetPlayerGameStat( PGS_ASSAULT_SCORE ) + 1 )
}
-void function InfectPlayer( entity player )
+void function InfectPlayer( entity player, entity attacker )
{
SetTeam( player, INFECTION_TEAM_INFECTED )
player.SetPlayerGameStat( PGS_ASSAULT_SCORE, 0 ) // reset kills
@@ -70,7 +70,12 @@ void function InfectPlayer( entity player )
// check how many survivors there are
array<entity> survivors = GetPlayerArrayOfTeam( INFECTION_TEAM_SURVIVOR )
if ( survivors.len() == 0 )
+ {
+ SetRespawnsEnabled( false )
+ SetKillcamsEnabled( false )
+ SetRoundWinningKillReplayAttacker(attacker)
SetWinner( INFECTION_TEAM_INFECTED )
+ }
else if ( survivors.len() == 1 && !file.hasHadLastInfection )
SetLastSurvivor( survivors[ 0 ] )
@@ -183,8 +188,14 @@ void function SetLastSurvivor( entity player )
int function TimeoutCheckSurvivors()
{
- if ( GetPlayerArrayOfTeam( INFECTION_TEAM_SURVIVOR ).len() > 0 )
+ array<entity> survivors = GetPlayerArrayOfTeam( INFECTION_TEAM_SURVIVOR )
+ if ( survivors.len() > 0 )
+ {
+ SetRespawnsEnabled( false )
+ SetKillcamsEnabled( false )
+ SetRoundWinningKillReplayAttacker(survivors[ 0 ])
return INFECTION_TEAM_SURVIVOR
+ }
return INFECTION_TEAM_INFECTED
}
diff --git a/Northstar.Custom/mod/scripts/vscripts/sh_custom_air_accel.gnut b/Northstar.Custom/mod/scripts/vscripts/sh_custom_air_accel.gnut
index faa924804..2ce930131 100644
--- a/Northstar.Custom/mod/scripts/vscripts/sh_custom_air_accel.gnut
+++ b/Northstar.Custom/mod/scripts/vscripts/sh_custom_air_accel.gnut
@@ -8,7 +8,9 @@ void function CustomAirAccelVars_Init()
#if SERVER
AddCallback_OnPlayerRespawned( ApplyCustomPlayerAirAccel )
- AddCallback_OnPilotBecomesTitan( ApplyCustomPlayerAirAccelFromTitan ) // not sure if necessary but assuming it is
+ AddCallback_OnTitanBecomesPilot( ApplyCustomPlayerAirAccelFromTitan ) // airaccel is reset after player leaves titan
+ AddCallback_OnPilotBecomesTitan( ApplyCustomPlayerAirAccelFromTitan ) // airaccel is also reset after player enters titan
+ AddCallback_OnPlayerGetsNewPilotLoadout( ApplyCustomPlayerAirAccelOnLoadoutChange ) // airaccel is also reset on loadout change for some reason
#endif
}
@@ -22,4 +24,9 @@ void function ApplyCustomPlayerAirAccelFromTitan( entity player, entity titan )
{
player.kv.airAcceleration = GetCurrentPlaylistVarInt( "custom_air_accel_pilot", int( player.GetPlayerSettingsField( "airAcceleration" ) ) )
}
-#endif \ No newline at end of file
+
+void function ApplyCustomPlayerAirAccelOnLoadoutChange( entity player, PilotLoadoutDef loadout )
+{
+ player.kv.airAcceleration = GetCurrentPlaylistVarInt( "custom_air_accel_pilot", int( player.GetPlayerSettingsField( "airAcceleration" ) ) )
+}
+#endif
diff --git a/Northstar.Custom/mod/scripts/vscripts/sh_custom_pilot_collision.gnut b/Northstar.Custom/mod/scripts/vscripts/sh_custom_pilot_collision.gnut
new file mode 100644
index 000000000..b33a4c024
--- /dev/null
+++ b/Northstar.Custom/mod/scripts/vscripts/sh_custom_pilot_collision.gnut
@@ -0,0 +1,32 @@
+global function CustomPilotCollision_InitPlaylistVars
+
+void function CustomPilotCollision_InitPlaylistVars()
+{
+ AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_PILOT", "no_pilot_collision", [ "#SETTING_DISABLED", "#SETTING_ENABLED" ], "0" )
+
+#if SERVER
+ AddCallback_OnPlayerRespawned( SetPilotCollisionFlagsForRespawn )
+ AddCallback_OnPilotBecomesTitan( PilotCollisionOnPilotBecomesTitan )
+ AddCallback_OnTitanBecomesPilot( PilotCollisionOnTitanBecomesPilot )
+#endif
+}
+
+#if SERVER
+void function SetPilotCollisionFlagsForRespawn( entity player )
+{
+ if ( GetCurrentPlaylistVarInt( "no_pilot_collision", 0 ) == 1 )
+ player.kv.CollisionGroup = TRACE_COLLISION_GROUP_BLOCK_WEAPONS
+}
+
+void function PilotCollisionOnPilotBecomesTitan( entity player, entity titan )
+{
+ if ( GetCurrentPlaylistVarInt( "no_pilot_collision", 0 ) == 1 )
+ player.kv.CollisionGroup = TRACE_COLLISION_GROUP_PLAYER
+}
+
+void function PilotCollisionOnTitanBecomesPilot( entity player, entity titan )
+{
+ if ( GetCurrentPlaylistVarInt( "no_pilot_collision", 0 ) == 1 )
+ player.kv.CollisionGroup = TRACE_COLLISION_GROUP_BLOCK_WEAPONS
+}
+#endif \ No newline at end of file