diff options
author | Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> | 2022-07-12 04:22:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-12 05:22:17 +0200 |
commit | eb46de39a5d14da45a69ee4826c4fd3113358fe8 (patch) | |
tree | 666f675e36712a9873c1168f1b9ff52a1ae0fa61 /Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut | |
parent | b9cfd8d22065a3b8396d9156313eef72405a5201 (diff) | |
download | NorthstarMods-eb46de39a5d14da45a69ee4826c4fd3113358fe8.tar.gz NorthstarMods-eb46de39a5d14da45a69ee4826c4fd3113358fe8.zip |
improve nav + a couple other things (#421)
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut | 62 |
1 files changed, 58 insertions, 4 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut index e97ab396..15da6866 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut @@ -3,6 +3,10 @@ global function RateSpawnpoints_FD global function startHarvester global function GetTargetNameForID +global function DisableTitanSelection +global function DisableTitanSelectionForPlayer +global function EnableTitanSelection +global function EnableTitanSelectionForPlayer struct player_struct_fd{ bool diedThisRound @@ -25,6 +29,7 @@ struct player_struct_fd{ global HarvesterStruct& fd_harvester global vector shopPosition +global vector shopAngles = <0,0,0> global table<string,array<vector> > routes global array<entity> routeNodes global array<entity> spawnedNPCs @@ -157,6 +162,11 @@ void function GamemodeFD_InitPlayer(entity player) if(GetGlobalNetInt("FD_currentWave")>1) PlayerEarnMeter_AddEarnedAndOwned(player,1.0,1.0) + if ( GetGlobalNetInt("FD_currentWave") != 0 ) + DisableTitanSelectionForPlayer( player ) // this might need moving to when they exit the titan selection UI when we do that + else + EnableTitanSelectionForPlayer( player ) + } void function SetTurretSettings_threaded(entity player) { //has to be delayed because PlayerConnect callbacks get called in wrong order @@ -277,8 +287,13 @@ void function mainGameLoop() showShop = true foreach(entity player in GetPlayerArray()) { - PlayerEarnMeter_AddEarnedAndOwned(player,1.0,1.0) + PlayerEarnMeter_AddEarnedAndOwned(player,1.0,1.0) } + DisableTitanSelection() + } + else if (i + 1 == waveEvents.len() ) + { + EnableTitanSelection() } } @@ -985,8 +1000,7 @@ bool function isSecondWave() void function LoadEntities() { - - CreateBoostStoreLocation(TEAM_MILITIA,shopPosition,<0,0,0>) + CreateBoostStoreLocation(TEAM_MILITIA,shopPosition,shopAngles) foreach ( entity info_target in GetEntArrayByClass_Expensive("info_target") ) { @@ -1203,4 +1217,44 @@ void function AddTurretSentry(entity turret) turret.Minimap_AlwaysShow( TEAM_MILITIA, null ) turret.Minimap_SetHeightTracking( true ) turret.Minimap_SetCustomState( eMinimapObject_npc.FD_TURRET ) -}
\ No newline at end of file +} + +void function DisableTitanSelection( ) +{ + foreach ( entity player in GetPlayerArray() ) + { + DisableTitanSelectionForPlayer( player ) + } +} + +void function EnableTitanSelection( ) +{ + foreach ( entity player in GetPlayerArray() ) + { + EnableTitanSelectionForPlayer( player ) + } +} + +void function EnableTitanSelectionForPlayer( entity player ) +{ + int enumCount = PersistenceGetEnumCount( "titanClasses" ) + for ( int i = 0; i < enumCount; i++ ) + { + string enumName = PersistenceGetEnumItemNameForIndex( "titanClasses", i ) + if ( enumName != "" ) + player.SetPersistentVar( "titanClassLockState[" + enumName + "]", TITAN_CLASS_LOCK_STATE_AVAILABLE ) + + } +} + +void function DisableTitanSelectionForPlayer( entity player ) +{ + int enumCount = PersistenceGetEnumCount( "titanClasses" ) + for ( int i = 0; i < enumCount; i++ ) + { + string enumName = PersistenceGetEnumItemNameForIndex( "titanClasses", i ) + string selectedEnumName = PersistenceGetEnumItemNameForIndex( "titanClasses", player.GetPersistentVarAsInt("activeTitanLoadoutIndex") ) + if ( enumName != "" && enumName != selectedEnumName ) + player.SetPersistentVar( "titanClassLockState[" + enumName + "]", TITAN_CLASS_LOCK_STATE_LOCKED ) + } +} |