aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'Northstar.CustomServers/mod/scripts')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_coliseum.nut17
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut52
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut2
3 files changed, 21 insertions, 50 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_coliseum.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_coliseum.nut
index 2f20d876..e0664b1e 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_coliseum.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_coliseum.nut
@@ -5,14 +5,17 @@ global function GamemodeColiseum_CustomIntro
// outro anims
// winner anims are for the winner, loser anims are for the loser
-// the loss number refers to the number of rounds the winner lost
-const array<string> OUTROANIMS_WINNER_0LOSS = [ "pt_coliseum_winner_gunkick", "pt_coliseum_winner_compassion", "pt_coliseum_winner_drinking" ]
-const array<string> OUTROANIMS_WINNER_1LOSS = [ "pt_coliseum_winner_respect", "pt_coliseum_winner_headlock", "pt_coliseum_winner_authority" ]
-const array<string> OUTROANIMS_WINNER_2LOSS = [ "pt_coliseum_winner_punch", "pt_coliseum_winner_kick", "pt_coliseum_winner_stomp" ]
+const array< array<string> > OUTROANIMS_WINNER = [
+ [ "pt_coliseum_winner_gunkick", "pt_coliseum_winner_compassion", "pt_coliseum_winner_drinking" ], // winner lost 0 rounds
+ [ "pt_coliseum_winner_respect", "pt_coliseum_winner_headlock", "pt_coliseum_winner_authority" ], // winner lost 1 round
+ [ "pt_coliseum_winner_punch", "pt_coliseum_winner_kick", "pt_coliseum_winner_stomp" ] // winner lost 2 rounds
+]
-const array<string> OUTROANIMS_LOSER_0LOSS = [ "pt_coliseum_loser_gunkick", "pt_coliseum_loser_compassion", "pt_coliseum_loser_drinking" ]
-const array<string> OUTROANIMS_LOSER_1LOSS = [ "pt_coliseum_loser_respect", "pt_coliseum_loser_headlock", "pt_coliseum_loser_authority" ]
-const array<string> OUTROANIMS_LOSER_2LOSS = [ "pt_coliseum_loser_punch", "pt_coliseum_loser_kick", "pt_coliseum_loser_stomp" ]
+const array< array<string> > OUTROANIMS_LOSER = [
+ [ "pt_coliseum_loser_gunkick", "pt_coliseum_loser_compassion", "pt_coliseum_loser_drinking" ], // winner lost 0 rounds
+ [ "pt_coliseum_loser_respect", "pt_coliseum_loser_headlock", "pt_coliseum_loser_authority" ], // winner lost 1 round
+ [ "pt_coliseum_loser_punch", "pt_coliseum_loser_kick", "pt_coliseum_loser_stomp" ], // winner lost 2 rounds
+]
struct {
bool hasShownIntroScreen
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut
index fcad7d31..6673d174 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut
@@ -218,6 +218,7 @@ void function CodeCallback_OnPlayerRespawned( entity player )
Remote_CallFunction_NonReplay( player, "ServerCallback_YouRespawned" )
player.s.respawnTime = Time()
+ player.SetPredictionEnabled( true )
Loadouts_TryGivePilotLoadout( player )
SetHumanRagdollImpactTable( player )
@@ -270,7 +271,6 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga
if ( !IsValid( player ) )
return
- player.SetPredictionEnabled( true )
player.s.inPostDeath = false
})
@@ -294,26 +294,6 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga
if ( shouldDoReplay )
thread TrackDestroyTimeForReplay( attacker, replayTracker )
- int damageSource = DamageInfo_GetDamageSourceIdentifier( damageInfo )
- //if ( damageSource == eDamageSourceId.fall )
- //{
- // // this is straight up just incorrect lol, based off tf1 stuff
- //
- // player.SetObserverModeStaticPosition( player.GetOrigin() )
- // player.SetObserverModeStaticAngles( player.GetVelocity() * -1 )
- //
- // player.StartObserverMode( OBS_MODE_STATIC_LOCKED )
- // player.SetObserverTarget( null )
- //}
- //else
- //{
- player.StartObserverMode( OBS_MODE_DEATHCAM )
- if ( ShouldSetObserverTarget( attacker ) )
- player.SetObserverTarget( attacker )
- else
- player.SetObserverTarget( null )
- //}
-
if ( !file.playerDeathsHidden )
Remote_CallFunction_NonReplay( player, "ServerCallback_YouDied", attacker.GetEncodedEHandle(), GetHealthFrac( attacker ), methodOfDeath )
@@ -330,10 +310,8 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga
}
// quick note: in cases where player.Die() is called: e.g. for round ends, player == attacker
- if ( shouldDoReplay )
- {
- player.SetPredictionEnabled( false )
-
+ if ( shouldDoReplay && KillcamsEnabled() ) // hack: double check if killcams are enabled here in case gamestate has changed this
+ {
player.watchingKillreplayEndTime = Time() + replayLength
float beforeTime = GetKillReplayBeforeTime( player, methodOfDeath )
@@ -362,7 +340,6 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga
player.WaitSignal( "RespawnMe" ) // set in base_gametype: ClientCommand_RespawnPlayer
- player.SetPredictionEnabled( true )
ClearRespawnAvailable( player ) // need so the respawn icon doesn't show for like a frame on next death
if ( ( expect bool( player.GetPersistentVar( "spawnAsTitan" ) ) && IsTitanAvailable( player ) ) || ( Riff_SpawnAsTitan() > 0 && Riff_ShouldSpawnAsTitan( player ) ) ) // spawn as titan
@@ -378,28 +355,19 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga
void function PlayerWatchesKillReplayWrapper( entity player, entity attacker, float timeSinceAttackerSpawned, float timeOfDeath, float beforeTime, table replayTracker )
{
- PlayerWatchesKillReplay( player, attacker.GetEncodedEHandle(), attacker.GetIndexForEntity(), timeSinceAttackerSpawned, timeOfDeath, beforeTime, replayTracker )
- player.ClearReplayDelay()
- player.ClearViewEntity()
- player.SetPredictionEnabled( true )
-}
-
-void function EndReplayOnTime( entity player, float replayLength )
-{
player.EndSignal( "RespawnMe" )
player.EndSignal( "OnRespawned" )
+ player.EndSignal( "GameStateChanged" )
- wait replayLength
- if ( IsValid( player ) && KillcamsEnabled() )
- {
- print( "fucking how" )
-
+ OnThreadEnd( function() : ( player )
+ {
player.ClearReplayDelay()
player.ClearViewEntity()
player.SetPredictionEnabled( true )
-
- player.SetObserverTarget( null )
- }
+ })
+
+ player.SetPredictionEnabled( false )
+ PlayerWatchesKillReplay( player, attacker.GetEncodedEHandle(), attacker.GetIndexForEntity(), timeSinceAttackerSpawned, timeOfDeath, beforeTime, replayTracker )
}
void function DecideRespawnPlayer( entity player )
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
index e3b252f7..46872692 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
@@ -39,7 +39,7 @@ struct {
bool roundWinningKillReplayTrackPilotKills = true
bool roundWinningKillReplayTrackTitanKills = false
-
+
float roundWinningKillReplayTime
entity roundWinningKillReplayVictim
entity roundWinningKillReplayAttacker