aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/burnmeter
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-01-05 01:35:54 +0000
committerGitHub <noreply@github.com>2022-01-05 01:35:54 +0000
commit0837c54ac652e371871f90441117065aa0edcf2e (patch)
treec2ef41f2f694a9fa0e272bb5344c3e5058d038fd /Northstar.CustomServers/mod/scripts/vscripts/burnmeter
parent614fcf2f354cc5883364c49fa3b557100c76f373 (diff)
parentb537fe6db52e0a30aa84592461ba7c1e27715036 (diff)
downloadNorthstarMods-0837c54ac652e371871f90441117065aa0edcf2e.tar.gz
NorthstarMods-0837c54ac652e371871f90441117065aa0edcf2e.zip
Merge pull request #71 from connieprice/main
Boost Fixes Redux
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/burnmeter')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut30
1 files changed, 23 insertions, 7 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut b/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut
index 9bcfd308..73277371 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut
@@ -2,7 +2,8 @@ untyped
global function BurnMeter_Init
global function BurnMeter_SetBoostLimit
-global function BurnMeter_CheckBoostLimit
+global function BurnMeter_SetBoostRewardCount
+global function BurnMeter_GetLimitedRewardCount
global function ForceSetGlobalBurncardOverride
global function GetSelectedBurncardRefFromWeaponOrPlayer
global function RunBurnCardUseFunc
@@ -22,8 +23,10 @@ const float AMPED_WEAPONS_LENGTH = 30.0
const int MAPHACK_PULSE_COUNT = 4
const float MAPHACK_PULSE_DELAY = 2.0
-struct {
+struct
+{
string forcedGlobalBurncardOverride = ""
+ table<string, int> boostRewardCount
table<string, int> boostLimits
} file
@@ -49,6 +52,8 @@ void function BurnMeter_Init()
BurnReward_GetByRef( "burnmeter_rodeo_grenade" ).rewardAvailableCallback = PlayerUsesRodeoGrenadeBurncard
BurnReward_GetByRef( "burnmeter_nuke_titan" ).rewardAvailableCallback = PlayerUsesNukeTitanBurncard // unused in vanilla, fun though
+ BurnMeter_SetBoostRewardCount( "burnmeter_ticks", 2 )
+
BurnMeter_SetBoostLimit( "burnmeter_ticks", 6 )
BurnMeter_SetBoostLimit( "burnmeter_ap_turret_weapon", 3 )
BurnMeter_SetBoostLimit( "burnmeter_at_turret_weapon", 3 )
@@ -70,24 +75,35 @@ void function BurnMeter_SetBoostLimit( string burnRef, int limit )
file.boostLimits[burnRef] <- limit
}
-bool function BurnMeter_CheckBoostLimit( entity player )
+
+void function BurnMeter_SetBoostRewardCount( string burnRef, int rewardCount )
+{
+ file.boostRewardCount[burnRef] <- rewardCount
+}
+
+int function BurnMeter_GetLimitedRewardCount( entity player )
{
EarnObject earnObject = PlayerEarnMeter_GetReward( player )
string burnRef = earnObject.ref
int limit = -1
+ int rewardCount = 1
if ( burnRef in file.boostLimits )
limit = file.boostLimits[burnRef]
+ if ( burnRef in file.boostRewardCount )
+ rewardCount = file.boostRewardCount[burnRef]
+
if ( limit < 0 )
- return false
+ return rewardCount
int current = PlayerInventory_CountBurnRef( player, burnRef )
+ int delta = limit - current
- if ( current < limit )
- return false
+ if ( delta <= 0 )
+ return 0
- return true
+ return int( min( delta, rewardCount ) )
}
void function ForceSetGlobalBurncardOverride( string ref )