Skip to content

Commit

Permalink
Sanity checks, minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Zanieon committed Nov 5, 2023
1 parent 85d10e1 commit 4c52449
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 9 deletions.
5 changes: 3 additions & 2 deletions Northstar.CustomServers/mod/scripts/vscripts/_xp.gnut
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ bool function PlayerProgressionAllowed( entity player )
void function HandleXPGainForScoreEvent( entity player, ScoreEvent event )
{
// note: obviously all xp stuff can be cheated in if people want to on customs, this is mainly just here for fun for those who want it and feature completeness

int xpValue = ScoreEvent_GetXPValue( event )
int weaponXp = ScoreEvent_GetXPValueWeapon( event )
int titanXp = ScoreEvent_GetXPValueTitan( event )
Expand Down Expand Up @@ -76,6 +76,7 @@ void function AddXP( entity player, int amount )
if ( newLevel != oldLevel )
{
Remote_CallFunction_NonReplay( player, "ServerCallback_PlayerLeveledUp", player.GetPersistentVarAsInt( "gen" ), newLevel )
AwardRandomItemsForPlayerLevels( player, player.GetPersistentVarAsInt( "gen" ), newLevel )
if( PlayerLevelHasRandomUnlock( PlayerGetRawLevel( player ) ) )
AwardRandomItemsForPlayerLevels( player, player.GetPersistentVarAsInt( "gen" ), newLevel )
}
}
3 changes: 2 additions & 1 deletion Northstar.CustomServers/mod/scripts/vscripts/faction_xp.gnut
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ void function AddFactionXP( entity player, int amount )
if ( FactionGetLevel( player, faction ) != oldLevel )
{
AddPlayerScore( player, "FactionLevelUp" )
AwardRandomItemsForFactionLevels( player, faction, oldLevel, FactionGetLevel( player, faction ) )
IncrementPlayerChallengeFactionLeveledUp( player )
player.SetPersistentVar( "xp_match[" + XP_TYPE.FACTION_LEVELED + "]", FactionXPMatch + 1 )
if( FactionLevelHasRandomUnlock( FactionGetRawLevel( player, faction ) ) )
AwardRandomItemsForFactionLevels( player, faction, oldLevel, FactionGetLevel( player, faction ) )
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,17 @@ void function GamemodeCP_InitPlayer(entity player)
playerStruct.timeOnPoints = [0.0,0.0,0.0]
playerStruct.isOnHardpoint = false
file.players.append(playerStruct)
file.playerAssaultPoints[player] <- 0
file.playerDefensePoints[player] <- 0
thread PlayerThink(playerStruct)
}

void function GamemodeCP_RemovePlayer(entity player)
{

if(player in file.playerAssaultPoints)
delete file.playerAssaultPoints[player]
if(player in file.playerDefensePoints)
delete file.playerDefensePoints[player]
foreach(index,CP_PlayerStruct playerStruct in file.players)
{
if(playerStruct.player==player)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ void function GamemodeFRA_Init()
ScoreEvent_SetEarnMeterValues( "PilotBatteryPickup", 0.0, 0.34 )
EarnMeterMP_SetPassiveMeterGainEnabled( false )
PilotBattery_SetMaxCount( 3 )
SetupGenericFFAChallenge()

AddCallback_OnPlayerKilled( FRARemoveEarnMeter )
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,6 @@ void function OnPlayerKilled( entity victim, entity attacker, var damageInfo )
else
return
}

ShowDeathHint( victim, damageInfo )

entity inflictor = DamageInfo_GetInflictor( damageInfo )
bool shouldUseInflictor = IsValid( inflictor ) && ShouldTryUseProjectileReplay( victim, attacker, damageInfo, true )
Expand Down
6 changes: 4 additions & 2 deletions Northstar.CustomServers/mod/scripts/vscripts/titan_xp.gnut
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ void function AddTitanXP( entity player, int amount )
Remote_CallFunction_NonReplay( player, "ServerCallback_TitanLeveledUp", shTitanXP.titanClasses.find( titan ), TitanGetGen( player, titan ), TitanGetLevel( player, titan ) )
AddPlayerScore( player, "TitanLevelUp" )
IncrementPlayerChallengeTitanLeveledUp( player )
AwardRandomItemsForTitanLevels( player, titan, oldLevel, TitanGetLevel( player, titan ) )
player.SetPersistentVar( "xp_match[" + XP_TYPE.TITAN_LEVELED + "]", TitanXPMatch + 1 )
if( TitanLevelHasRandomUnlock( TitanGetRawLevel( player, titan ) ) )
AwardRandomItemsForTitanLevels( player, titan, oldLevel, TitanGetLevel( player, titan ) )
}
}

Expand All @@ -31,5 +32,6 @@ void function AddFDTitanXP( entity player, int fdXPamount )
int endingLevel = FD_TitanGetLevelForXP( titanRef, FD_TitanGetXP( player, titanRef ) )

Player_GiveFDUnlockPoints( player, endingLevel - startingLevel )
AwardRandomItemsForFDTitanLevels( player, titanRef, startingLevel, endingLevel )
if( FDTitanLevelHasRandomUnlock( FD_TitanGetRawLevel( player, titan ) ) )
AwardRandomItemsForFDTitanLevels( player, titanRef, startingLevel, endingLevel )
}
3 changes: 2 additions & 1 deletion Northstar.CustomServers/mod/scripts/vscripts/weapon_xp.gnut
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ void function AddWeaponXP( entity player, int amount )
Remote_CallFunction_NonReplay( player, "ServerCallback_WeaponLeveledUp", shWeaponXP.weaponClassNames.find( weaponClassname ), WeaponGetGen( player, weaponClassname ), WeaponGetLevel( player, weaponClassname ) )
AddPlayerScore( player, "WeaponLevelUp" )
IncrementPlayerChallengeWeaponLeveledUp( player )
AwardRandomItemsForWeaponLevels( player, weaponClassname, oldLevel, WeaponGetLevel( player, weaponClassname ) )
player.SetPersistentVar( "xp_match[" + XP_TYPE.WEAPON_LEVELED + "]", WeaponXPMatch + 1 )
if( WeaponLevelHasRandomUnlock( WeaponGetRawLevel( player, weaponClassname ) ) )
AwardRandomItemsForWeaponLevels( player, weaponClassname, oldLevel, WeaponGetLevel( player, weaponClassname ) )
}

// proscreen
Expand Down

0 comments on commit 4c52449

Please sign in to comment.