diff options
author | GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> | 2023-12-31 18:58:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-31 18:58:50 +0100 |
commit | a1502e9ad3ed44b2a0a8ab5f17d4d2bf5238d9cf (patch) | |
tree | 0f171ab768fa6f8dd8d68fc4f0675baffbfd5e5d /Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut | |
parent | ad70253601a77844347d8aa1989ae5ab4fb4217c (diff) | |
parent | 00a4bb6fb5e107788ea77cad51c8c8004a9537f1 (diff) | |
download | NorthstarMods-a1502e9ad3ed44b2a0a8ab5f17d4d2bf5238d9cf.tar.gz NorthstarMods-a1502e9ad3ed44b2a0a8ab5f17d4d2bf5238d9cf.zip |
Merge pull request #777 from R2Northstar/main
Update FD branch
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut index ceb5e837..2dc88d0d 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut @@ -38,6 +38,7 @@ void function Progression_Init() #if SERVER AddCallback_OnClientDisconnected( OnClientDisconnected ) AddClientCommandCallback( "ns_progression", ClientCommand_SetProgression ) + AddClientCommandCallback( "ns_resettitanaegis", ClientCommand_ResetTitanAegis ) AddCallback_GameStateEnter( eGameState.Playing, OnPlaying ) #elseif CLIENT AddCallback_OnClientScriptInit( OnClientScriptInit ) @@ -84,6 +85,28 @@ bool function ClientCommand_SetProgression( entity player, array<string> args ) return true } + +/// Resets a specific Titan's Aegis rank back to `0` +/// * `player` - The player entity to perform the action on +/// * `args` - The arguments passed from the client command. `args[0]` should be an integer corresponding to the index of the Titan to reset. +/// +/// Returns `true` on success and `false` on missing args. +bool function ClientCommand_ResetTitanAegis( entity player, array<string> args ) +{ + if ( !args.len() ) + return false + + int suitIndex = args[0].tointeger() + player.SetPersistentVar( "titanFDUnlockPoints[" + suitIndex + "]", 0 ) + player.SetPersistentVar( "previousFDUnlockPoints[" + suitIndex + "]", 0 ) + player.SetPersistentVar( "fdTitanXP[" + suitIndex + "]", 0 ) + player.SetPersistentVar( "fdPreviousTitanXP[" + suitIndex + "]", 0 ) + + // Refresh Highest Aegis Titan since we might get all of them back to 1 if players wants + RecalculateHighestTitanFDLevel( player ) + + return true +} #endif #if CLIENT @@ -268,7 +291,7 @@ void function ValidateEquippedItems( entity player ) // camoIndex if ( loadout.skinIndex == TITAN_SKIN_INDEX_CAMO ) { - array<ItemData> camoSkins = GetAllItemsOfType( eItemTypes.CAMO_SKIN ) + array<ItemData> camoSkins = GetAllItemsOfType( eItemTypes.CAMO_SKIN_TITAN ) if ( loadout.camoIndex >= camoSkins.len() || loadout.camoIndex < 0 ) { printt( " - INVALID TITAN CAMO/SKIN, RESETTING" ) @@ -363,7 +386,7 @@ void function ValidateEquippedItems( entity player ) // primeCamoIndex if ( loadout.primeSkinIndex == TITAN_SKIN_INDEX_CAMO ) { - array<ItemData> camoSkins = GetAllItemsOfType( eItemTypes.CAMO_SKIN ) + array<ItemData> camoSkins = GetAllItemsOfType( eItemTypes.CAMO_SKIN_TITAN ) if ( loadout.primeCamoIndex >= camoSkins.len() || loadout.primeCamoIndex < 0 ) { printt( " - INVALID TITAN CAMO/SKIN, RESETTING" ) |