aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/titan_xp.gnut
diff options
context:
space:
mode:
authorWilliam Miller <william-millennium@hotmail.com>2024-06-28 15:10:45 -0300
committerGitHub <noreply@github.com>2024-06-28 20:10:45 +0200
commit6581c4e800e5cec0e4d6f5b3f87b80bd6989233c (patch)
treeee4b1825304312ac4ce24f1d1ee1ab077483159e /Northstar.CustomServers/mod/scripts/vscripts/titan_xp.gnut
parent83e97763b3421e59d13e9a40bf20c0d987da9129 (diff)
downloadNorthstarMods-6581c4e800e5cec0e4d6f5b3f87b80bd6989233c.tar.gz
NorthstarMods-6581c4e800e5cec0e4d6f5b3f87b80bd6989233c.zip
Implement Match Goals menu and XP tracking (#756)v1.26.0-rc4v1.26.0
for vanilla parity when it comes to the progression system. See PR description for full details
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/titan_xp.gnut')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/titan_xp.gnut22
1 files changed, 22 insertions, 0 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/titan_xp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/titan_xp.gnut
index 0436a393..847881b5 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/titan_xp.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/titan_xp.gnut
@@ -1,17 +1,39 @@
global function AddTitanXP
+global function AddFDTitanXP
void function AddTitanXP( entity player, int amount )
{
string titan = GetActiveTitanLoadout( player ).titanClass
int oldLevel = TitanGetLevel( player, titan )
+ int TitanXPMatch = player.GetPersistentVarAsInt( "xp_match[" + XP_TYPE.TITAN_LEVELED + "]" )
// increment xp
player.SetPersistentVar( "titanXP[" + titan + "]", min( TitanGetXP( player, titan ) + amount, TitanGetMaxXP( titan ) ) )
+ Remote_CallFunction_NonReplay( player, "ServerCallback_TitanXPAdded", shTitanXP.titanClasses.find( titan ), TitanGetXP( player, titan ), amount )
// level up notif
if ( TitanGetLevel( player, titan ) != oldLevel )
{
Remote_CallFunction_NonReplay( player, "ServerCallback_TitanLeveledUp", shTitanXP.titanClasses.find( titan ), TitanGetGen( player, titan ), TitanGetLevel( player, titan ) )
AddPlayerScore( player, "TitanLevelUp" )
+ IncrementPlayerChallengeTitanLeveledUp( player )
+ player.SetPersistentVar( "xp_match[" + XP_TYPE.TITAN_LEVELED + "]", TitanXPMatch + 1 )
+
+ if( ProgressionEnabledForPlayer( player ) )
+ AwardRandomItemsForTitanLevels( player, titan, oldLevel, TitanGetLevel( player, titan ) )
}
+}
+
+void function AddFDTitanXP( entity player, int fdXPamount )
+{
+ string titanRef = GetActiveTitanLoadout( player ).titanClass
+
+ player.SetPersistentVar( "fdTitanXP[" + titanRef + "]", FD_TitanGetPreviousXP( player, titanRef ) + fdXPamount )
+ int startingLevel = FD_TitanGetLevelForXP( titanRef, FD_TitanGetPreviousXP( player, titanRef ) )
+ int endingLevel = FD_TitanGetLevelForXP( titanRef, FD_TitanGetXP( player, titanRef ) )
+
+ Player_GiveFDUnlockPoints( player, endingLevel - startingLevel )
+
+ if( ProgressionEnabledForPlayer( player ) )
+ AwardRandomItemsForFDTitanLevels( player, titanRef, startingLevel, endingLevel )
} \ No newline at end of file