diff options
author | Dinorush <62536724+Dinorush@users.noreply.github.com> | 2022-04-14 23:00:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-15 04:00:19 +0100 |
commit | b3693a35f8b856279c6844ad92f9ab61f9fc352a (patch) | |
tree | 084a86ae86750d72a8d101d250d931fca0ef5667 | |
parent | 59df0969a282b72bff574695845e86e198272850 (diff) | |
download | NorthstarMods-b3693a35f8b856279c6844ad92f9ab61f9fc352a.tar.gz NorthstarMods-b3693a35f8b856279c6844ad92f9ab61f9fc352a.zip |
Add core meter gain exceptions (#284)
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/mp/_codecallbacks.gnut | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_codecallbacks.gnut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_codecallbacks.gnut index 2e565142..425a8b8b 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_codecallbacks.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_codecallbacks.gnut @@ -6,6 +6,9 @@ global function CodeCallback_DamagePlayerOrNPC global function GameModeRulesShouldGiveTimerCredit global function SetGameModeRulesShouldGiveTimerCredit global function SetGameModeRulesEarnMeterOnDamage +global function GameModeRulesRegisterTimerCreditExceptions +global function GameModeRulesRegisterTimerCreditException +global function GameModeRulesGetTimerCreditExceptions global function GetDamageOrigin global function CodeCallBack_ShouldTriggerSniperCam global function CodeCallback_ForceAIMissPlayer @@ -31,6 +34,13 @@ struct float titanMeterGainScale = 0.0001 bool functionref( entity, entity, var ) ShouldGiveTimerCreditGameModeRules void functionref( entity, entity, TitanDamage, float ) earnMeterOnDamageGameModeRulesCallback + array<int> gameModeRulesTimerCreditExceptions = [ + eDamageSourceId.mp_titancore_flame_wave, + eDamageSourceId.mp_titancore_flame_wave_secondary, + eDamageSourceId.mp_titancore_salvo_core, + damagedef_titan_fall, + damagedef_nuclear_core + ] table<entity, AccumulatedDamageData> playerAccumulatedDamageData } file @@ -582,15 +592,8 @@ bool function ShouldGiveTimerCredit_Default( entity player, entity victim, var d return false int damageSourceID = DamageInfo_GetDamageSourceIdentifier( damageInfo ) - switch ( damageSourceID ) - { - case eDamageSourceId.mp_titancore_flame_wave: - case eDamageSourceId.mp_titancore_flame_wave_secondary: - case eDamageSourceId.mp_titancore_salvo_core: - case damagedef_titan_fall: - case damagedef_nuclear_core: - return false - } + if ( file.gameModeRulesTimerCreditExceptions.contains( damageSourceID ) ) + return false return true } @@ -605,6 +608,23 @@ void function SetGameModeRulesShouldGiveTimerCredit( bool functionref( entity, e file.ShouldGiveTimerCreditGameModeRules = rules } +void function GameModeRulesRegisterTimerCreditExceptions( array<int> ids ) +{ + foreach( id in ids ) + GameModeRulesRegisterTimerCreditException( id ) +} + +void function GameModeRulesRegisterTimerCreditException( int id ) +{ + if ( !file.gameModeRulesTimerCreditExceptions.contains( id ) ) + file.gameModeRulesTimerCreditExceptions.append( id ) +} + +array<int> function GameModeRulesGetTimerCreditExceptions() +{ + return file.gameModeRulesTimerCreditExceptions +} + function TitanDamageFlinch( entity ent, damageInfo ) { if ( DamageInfo_GetCustomDamageType( damageInfo ) & DF_DOOMED_HEALTH_LOSS ) |