diff options
Diffstat (limited to 'Northstar.CustomServers/mod/scripts')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut | 10 | ||||
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut | 7 |
2 files changed, 16 insertions, 1 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut index 3e8ac9ea..3161237c 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut @@ -3,6 +3,7 @@ global function SvLoadoutsMP_Init global function SetLoadoutGracePeriodEnabled global function SetWeaponDropsEnabled +global function SetAllowLoadoutChangeFunc global function AddCallback_OnTryGetTitanLoadout global function GetTitanLoadoutForPlayer @@ -22,6 +23,8 @@ struct { array< TryGetTitanLoadoutCallbackType > onTryGetTitanLoadoutCallbacks array<entity> dirtyLoadouts + + bool functionref( entity ) allowChangeLoadoutFunc = null } file void function SvLoadoutsMP_Init() @@ -60,6 +63,11 @@ void function SetLoadoutGracePeriodEnabled( bool enabled ) file.loadoutGracePeriodEnabled = enabled } +void function SetAllowLoadoutChangeFunc( bool functionref( entity ) func ) +{ + file.allowChangeLoadoutFunc = func +} + void function SetWeaponDropsEnabled( bool enabled ) { file.weaponDropsEnabled = enabled @@ -302,7 +310,7 @@ void function TryGivePilotLoadoutForGracePeriod( entity player ) else respawnTimeReal = expect float( player.s.respawnTime ) - if ( ( ( Time() - respawnTimeReal <= CLASS_CHANGE_GRACE_PERIOD || GetGameState() < eGameState.Playing ) && file.loadoutGracePeriodEnabled ) || player.p.usingLoadoutCrate ) + if ( ( ( Time() - respawnTimeReal <= CLASS_CHANGE_GRACE_PERIOD || GetGameState() < eGameState.Playing ) && file.loadoutGracePeriodEnabled ) || player.p.usingLoadoutCrate || ( file.allowChangeLoadoutFunc != null && file.allowChangeLoadoutFunc( player ) ) ) { if ( !Loadouts_CanGivePilotLoadout( player ) && player.GetParent() != null && ( HasCinematicFlag( player, CE_FLAG_INTRO ) || HasCinematicFlag( player, CE_FLAG_CLASSIC_MP_SPAWNING ) || HasCinematicFlag( player, CE_FLAG_WAVE_SPAWNING ) ) ) thread GiveLoadoutWhenIntroOver( player ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut index 77275b9f..e8bc0966 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut @@ -121,6 +121,7 @@ void function GamemodeFD_Init() Riff_ForceBoostAvailability( eBoostAvailability.Disabled ) PlayerEarnMeter_SetEnabled( false ) SetShouldUsePickLoadoutScreen( true ) + SetAllowLoadoutChangeFunc( FD_ShouldAllowChangeLoadout ) SetGetDifficultyFunc( FD_GetDifficultyLevel ) TeamTitanSelectMenu_Init() // show the titan select menu in this mode @@ -167,6 +168,12 @@ void function GamemodeFD_Init() SetUsedCoreCallback( FD_UsedCoreCallback ) } +// this might need updating when we do dropship things +bool function FD_ShouldAllowChangeLoadout( entity player ) +{ + return GetGlobalNetTime( "FD_nextWaveStartTime" ) > Time() +} + void function FD_BoostPurchaseCallback( entity player, BoostStoreData data ) { file.playerAwardStats[player]["moneySpent"] += float( data.cost ) |