diff options
Diffstat (limited to 'Northstar.Custom/mod/scripts/vscripts/gamemodes')
10 files changed, 62 insertions, 20 deletions
diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fastball.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fastball.gnut index 6dabb655..0f04ed57 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fastball.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fastball.gnut @@ -18,7 +18,9 @@ void function GamemodeFastball_Init() SetShouldUseRoundWinningKillReplay( true ) SetRoundBased( true ) SetRespawnsEnabled( false ) + Riff_ForceTitanAvailability( eTitanAvailability.Never ) Riff_ForceSetEliminationMode( eEliminationMode.Pilots ) + ScoreEvent_SetupEarnMeterValuesForMixedModes() // implementing intro in a different file because it'll likely be big ClassicMP_SetCustomIntro( GamemodeFastballIntroSetup, 14.5 ) // bit of a guess number diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fastball_intro.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fastball_intro.gnut index 86094693..b4e5ef2b 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fastball_intro.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fastball_intro.gnut @@ -118,26 +118,30 @@ void function AddPlayerToFastballIntro( entity player ) void function FastballPlayer( entity player ) { + player.EndSignal( "OnDestroy" ) + if ( IsAlive( player ) ) player.Die() // kill player if they're alive so there's no issues with that WaitFrame() player.EndSignal( "OnDeath" ) - player.EndSignal( "OnDestroy" ) // do this here so it's in OnThreadEnd var oldVisibility = player.kv.VisibilityFlags OnThreadEnd( function() : ( player, oldVisibility ) { - RemoveCinematicFlag( player, CE_FLAG_CLASSIC_MP_SPAWNING ) - player.ClearParent() - ClearPlayerAnimViewEntity( player ) - player.DeployWeapon() - player.PlayerCone_Disable() - player.ClearInvulnerable() - player.kv.VisibilityFlags = oldVisibility // restore visibility + if ( IsValid( player ) ) + { + RemoveCinematicFlag( player, CE_FLAG_CLASSIC_MP_SPAWNING ) + player.ClearParent() + ClearPlayerAnimViewEntity( player ) + player.DeployWeapon() + player.PlayerCone_Disable() + player.ClearInvulnerable() + player.kv.VisibilityFlags = oldVisibility // restore visibility + } }) FirstPersonSequenceStruct throwSequence diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut index 5794260b..608fd869 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut @@ -36,7 +36,8 @@ void function OnPlayerRespawned_Threaded( entity player ) // bit of a hack, need to rework earnmeter code to have better support for completely disabling it // rn though this just waits for earnmeter code to set the mode before we set it back WaitFrame() - PlayerEarnMeter_SetMode( player, eEarnMeterMode.DISABLED ) + if ( IsValid( player ) ) + PlayerEarnMeter_SetMode( player, eEarnMeterMode.DISABLED ) } void function OnPlayerKilled( entity victim, entity attacker, var damageInfo ) diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_hs.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_hs.gnut index 7b96cac7..ed245152 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_hs.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_hs.gnut @@ -17,6 +17,7 @@ void function GamemodeHideAndSeek_Init() Riff_ForceBoostAvailability( eBoostAvailability.Disabled ) SetRespawnsEnabled( false ) Riff_ForceSetEliminationMode( eEliminationMode.Pilots ) + SetLoadoutGracePeriodEnabled( false ) SetTimeoutWinnerDecisionFunc( HideAndSeekDecideWinner ) ClassicMP_SetCustomIntro( GamemodeHideAndSeekIntroSetup, 0.0 ) @@ -85,12 +86,11 @@ void function HideAndSeekIntroPrematch() ClassicMP_OnIntroStarted() file.hidingStartTime = Time() - foreach ( entity player in GetPlayerArray() ) AddPlayerToHideAndSeekIntro( player ) // this intro is mostly done in playing, so just finish the intro up now and we can do fully custom logic from here - WaitFrame() + wait 2.5 ClassicMP_OnIntroFinished() thread GlobalSeekerIntroThread() @@ -98,6 +98,9 @@ void function HideAndSeekIntroPrematch() void function HiderIntroThread( entity player ) { + player.EndSignal( "OnDestroy" ) + // need to wait a frame in case we're joining after eGameState.Playing, in which case we'll be turned into a spectator on first frame + WaitFrame() RespawnAsPilot( player ) wait ( file.hidingStartTime + file.hidingTime ) - Time() @@ -107,6 +110,7 @@ void function HiderIntroThread( entity player ) void function SeekerIntroThread( entity player ) { + player.EndSignal( "OnDestroy" ) MuteHalfTime( player ) player.SetObserverModeStaticPosition( file.intermissionCam.GetOrigin() ) @@ -132,7 +136,12 @@ void function GlobalSeekerIntroThread() Remote_CallFunction_NonReplay( hider, "ServerCallback_SeekersIncoming" ) array<entity> seekers = GetPlayerArrayOfTeam( HIDEANDSEEK_TEAM_SEEKER ) - entity podSpawn = file.droppodSpawns.getrandom() + entity podSpawn + if ( file.droppodSpawns.len() != 0 ) + podSpawn = file.droppodSpawns.getrandom() + else + podSpawn = SpawnPoints_GetPilot().getrandom() + SpawnPlayersInDropPod( seekers, podSpawn.GetOrigin(), podSpawn.GetAngles() ) foreach ( entity seeker in seekers ) @@ -162,11 +171,24 @@ void function SetupHideAndSeekPlayer( entity player ) // remove red outline, ideally should work tm Highlight_ClearEnemyHighlight( player ) + thread PlayHintSoundsForHider( player ) } else player.TakeWeapon( "mp_weapon_grenade_sonar" ) // seekers should not have pulse blade } +void function PlayHintSoundsForHider( entity player ) +{ + player.EndSignal( "OnDeath" ) + player.EndSignal( "OnDestroy" ) + + while ( true ) + { + wait 1.0 + EmitSoundOnEntity( player, "weapon_chargerifle_fire_3p" ) + } +} + void function TryNotifyLastPlayerAlive( entity victim, entity attacker, var damageInfo ) { if ( victim.GetTeam() == HIDEANDSEEK_TEAM_HIDER ) diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_inf.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_inf.gnut index 1e6778e1..ee6c2c0a 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_inf.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_inf.gnut @@ -170,7 +170,8 @@ void function SetLastSurvivor( entity player ) Remote_CallFunction_NonReplay( otherPlayer, "ServerCallback_AnnounceLastSurvivor", player.GetEncodedEHandle() ) Highlight_SetEnemyHighlight( player, "enemy_sonar" ) - thread CreateTitanForPlayerAndHotdrop( player, GetTitanReplacementPoint( player, false ) ) + if ( SpawnPoints_GetTitan().len() > 0 ) + thread CreateTitanForPlayerAndHotdrop( player, GetTitanReplacementPoint( player, false ) ) if ( GameTime_TimeLeftSeconds() > 45 ) SetServerVar( "gameEndTime", Time() + 45.0 ) diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_kr.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_kr.gnut index 7a226e21..67ace695 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_kr.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_kr.gnut @@ -16,6 +16,7 @@ void function GamemodeKR_Init() ClassicMP_ForceDisableEpilogue( true ) Riff_ForceTitanAvailability( eTitanAvailability.Never ) Riff_ForceBoostAvailability( eBoostAvailability.Disabled ) + ScoreEvent_SetupEarnMeterValuesForMixedModes() AddSpawnCallback( "info_hardpoint", AddFlagSpawnPoint ) @@ -40,7 +41,7 @@ void function OnPlayerKilled( entity victim, entity attacker, var damageInfo ) attacker.SetPlayerNetTime( "killRaceTime", killRaceTime ) if ( killRaceTime > file.currentHighestKillraceAmount ) file.currentHighestKillraceAmount = killRaceTime - if ( file.currentRacer != null ) + if ( file.currentRacer != null && attacker == file.currentRacer ) file.currentKillraceScore++ } diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/cl_gamemode_fastball.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/cl_gamemode_fastball.gnut index 80dc548a..b7c225c7 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/cl_gamemode_fastball.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/cl_gamemode_fastball.gnut @@ -17,6 +17,7 @@ void function ClGamemodeFastball_Init() RegisterLevelMusicForTeam( eMusicPieceID.LEVEL_INTRO, "Music_Beacon_14_BTThrowThruFirstCrane", TEAM_MILITIA ) AddCallback_OnClientScriptInit( FastballCreateRui ) + AddCallback_GameStateEnter( eGameState.Postmatch, DisplayPostMatchTop3 ) } void function FastballCreateRui( entity player ) diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/cl_gamemode_hs.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/cl_gamemode_hs.gnut index 8bfbb10e..5ba571b2 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/cl_gamemode_hs.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/cl_gamemode_hs.gnut @@ -17,6 +17,8 @@ void function ClGamemodeHideAndSeek_Init() RegisterLevelMusicForTeam( eMusicPieceID.GAMEMODE_2, "music_skyway_04_smartpistolrun", TEAM_IMC ) RegisterLevelMusicForTeam( eMusicPieceID.GAMEMODE_2, "music_skyway_04_smartpistolrun", TEAM_MILITIA ) + + AddCallback_GameStateEnter( eGameState.Postmatch, DisplayPostMatchTop3 ) } void function ServerCallback_ShowHideAndSeekCountdown( float endTime ) diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/cl_gamemode_kr.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/cl_gamemode_kr.gnut index 32753da1..2cbd1372 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/cl_gamemode_kr.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/cl_gamemode_kr.gnut @@ -45,6 +45,8 @@ void function ClGamemodeKR_Init() AddCallback_OnClientScriptInit( CreateKRUI ) AddCreateCallback( "item_flag", OnFlagCreated ) AddDestroyCallback( "item_flag", OnFlagDestroyed ) + + AddCallback_GameStateEnter( eGameState.Postmatch, DisplayPostMatchTop3 ) } void function CreateKRUI( entity player ) @@ -66,15 +68,14 @@ void function CreateKRUI( entity player ) void function OnFlagCreated( entity flag ) { - if ( IsValid( file.flagIncomingRui ) ) - RuiDestroy( file.flagIncomingRui ) - + RuiDestroyIfAlive( file.flagIncomingRui ) RuiSetBool( file.flagRui, "isVisible", true ) RuiTrackFloat3( file.flagRui, "pos", flag, RUI_TRACK_OVERHEAD_FOLLOW ) } void function OnFlagDestroyed( entity flag ) { + RuiDestroyIfAlive( file.flagIncomingRui ) RuiSetBool( file.flagRui, "isVisible", false ) } @@ -202,15 +203,20 @@ void function ServerCallback_NewKillRacer( int playerHandle, float endTime ) void function LerpTimeDuringRace( float endTime ) { + GetLocalClientPlayer().EndSignal( "OnDeath" ) + + OnThreadEnd( function() : () + { + UpdateCurrentTimeAmount( 0.0 ) + file.isCurrentlyInRace = false + }) + while ( Time() < endTime ) { // manually update this here so we can get more frequent updates than what we'd get with networked vars UpdateCurrentTimeAmount( endTime - Time() ) WaitFrame() } - - UpdateCurrentTimeAmount( 0.0 ) - file.isCurrentlyInRace = false } void function ServerCallback_EndKillrace( int playerHandle, int score ) diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/cl_gamemode_tt.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/cl_gamemode_tt.gnut index b73ed958..11dc7261 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/cl_gamemode_tt.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/cl_gamemode_tt.gnut @@ -23,4 +23,6 @@ void function ClGamemodeTT_Init() RegisterLevelMusicForTeam( eMusicPieceID.LEVEL_LAST_MINUTE, "music_mp_pilothunt_lastminute", TEAM_IMC ) RegisterLevelMusicForTeam( eMusicPieceID.LEVEL_LAST_MINUTE, "music_mp_pilothunt_lastminute", TEAM_MILITIA ) + + AddCallback_GameStateEnter( eGameState.Postmatch, DisplayPostMatchTop3 ) }
\ No newline at end of file |