diff options
author | Connie Price <contact@connieprice.co.uk> | 2022-01-04 19:13:56 +0000 |
---|---|---|
committer | Connie Price <contact@connieprice.co.uk> | 2022-01-04 19:13:56 +0000 |
commit | a352fbb877aabdaf9b124eee47fb78f2ac0007a6 (patch) | |
tree | a97dc0ed1c8673715e1fce1420560589aa312973 /Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter.gnut | |
parent | e128e87bd23d5c7702e92c01e07684e3804f5a69 (diff) | |
download | NorthstarMods-a352fbb877aabdaf9b124eee47fb78f2ac0007a6.tar.gz NorthstarMods-a352fbb877aabdaf9b124eee47fb78f2ac0007a6.zip |
Big Boost/Earn Meter Fixes!
* Only set the boost from persistence once, allowing for the boost to be changed mid game by other scripts.
* Added `PlayerEarnMeter_SetBoostByRef(string boostRef)` to simplify setting boosts.
* Boosts now correctly disappear after being reward to the player.
* Client-side reward icon will now update when the boost is changed.
* Titan cores will now pull the HUD icon from the core, instead of the titan chassis. Allowing this to be handled better by other scripts.
* Player boost inventory implemented! Now players will be able to store multiple boosts like vanilla.
* Boost inventory limits, all vanilla boost limits are respected, and `BurnMeter_SetBoostLimit( string burnRef, int limit )` was added to accommodate this.
* Fixed the unused nuke titan boost code so that if anyone decides to use it it's not horribly error prone.
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter.gnut')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter.gnut | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter.gnut b/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter.gnut index dda84976c..691f07fb4 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter.gnut @@ -39,6 +39,8 @@ global function SharedEarnMeter_AddEarnedAndOwned global function PlayerEarnMeter_SetEnabled global function PlayerEarnMeter_Enabled +global function PlayerEarnMeter_SetBoostByRef + global struct EarnMeterThresholdEarnedStruct { float threshold @@ -505,4 +507,24 @@ void function PlayerEarnMeter_SetEnabled( bool enabled ) bool function PlayerEarnMeter_Enabled() { return file.earnMeterEnabled +} + +void function PlayerEarnMeter_SetBoostByRef( entity player, string boostRef ) { + EarnObject earnobject = EarnObject_GetByRef( boostRef ) + BurnReward burncard = BurnReward_GetByRef( boostRef ) + + if ( Riff_BoostAvailability() != eBoostAvailability.Disabled ) + { + PlayerEarnMeter_SetReward( player, earnobject ) // pretty sure this works? + PlayerEarnMeter_SetRewardFrac( player, burncard.cost ) + PlayerEarnMeter_EnableReward( player ) + } + + if ( EarnMeterMP_IsTitanEarnGametype() ) + { + PlayerEarnMeter_SetGoal( player, EarnObject_GetByRef( GetTitanLoadoutForPlayer( player ).titanClass ) ) + PlayerEarnMeter_EnableGoal( player ) // prevents goalstate from being set incorrectly + } + else + PlayerEarnMeter_SetGoal( player, earnobject ) }
\ No newline at end of file |