Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Aegis Reset Functionality to use titan chassis ref instead of raw index #788

Merged
merged 7 commits into from
Jan 26, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,26 @@ bool function ClientCommand_SetProgression( entity player, array<string> args )

/// 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.
/// * `args` - The arguments passed from the client command. `args[0]` should be a string corresponding to the chassis name of the Titan to reset.
Zanieon marked this conversation as resolved.
Show resolved Hide resolved
/// * `chassis name` - Valid chassis are: Ion, Tone, Vanguard, Northstar, Ronin, Legion and Scorch.
Zanieon marked this conversation as resolved.
Show resolved Hide resolved
///
/// 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()
string titanRef = args[0]
Zanieon marked this conversation as resolved.
Show resolved Hide resolved
if( !PersistenceEnumValueIsValid( "titanClasses", titanRef ) )
return false

int suitIndex = PersistenceGetEnumIndexForItemName( "titanClasses", titanRef )
Zanieon marked this conversation as resolved.
Show resolved Hide resolved

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
Expand Down
Loading