aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut
diff options
context:
space:
mode:
authorWilliam Miller <william-millennium@hotmail.com>2023-12-14 10:39:26 -0300
committerGitHub <noreply@github.com>2023-12-14 14:39:26 +0100
commit6d678ac56b104a5c4aa2a2d9da05b163f2e1d6cd (patch)
tree62508ada42c01a1eb787c5388d87409cd062175c /Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut
parentf4df3144adbd45d48d812d102cfaf7cef474824e (diff)
downloadNorthstarMods-6d678ac56b104a5c4aa2a2d9da05b163f2e1d6cd.tar.gz
NorthstarMods-6d678ac56b104a5c4aa2a2d9da05b163f2e1d6cd.zip
Add Aegis Rank reset functionality command for Progression (#727)v1.21.0-rc1
Adds a console command to allow players to reset the Aegis Ranks of their Titans
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut23
1 files changed, 23 insertions, 0 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut
index 496e8b42d..2dc88d0d4 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