aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobTheBob9 <for.oliver.kirkham@gmail.com>2022-07-17 23:58:43 +0100
committerBobTheBob9 <for.oliver.kirkham@gmail.com>2022-07-17 23:58:43 +0100
commitbcec5a5e9edd2a2af3a017ea4b250a9ba1112e6f (patch)
tree12225a0f94c2843a5273200bda82f030b07315a0
parent85eb27362bd295a9e1560982a3369a688e13ded0 (diff)
downloadNorthstarMods-bcec5a5e9edd2a2af3a017ea4b250a9ba1112e6f.tar.gz
NorthstarMods-bcec5a5e9edd2a2af3a017ea4b250a9ba1112e6f.zip
dont remove amped weapons after entering titans
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut27
1 files changed, 15 insertions, 12 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut b/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut
index 056f0313..afa8ff3d 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut
@@ -65,6 +65,7 @@ void function BurnMeter_Init()
AddCallback_OnClientConnected( InitBurncardsForLateJoiner )
AddCallback_OnPlayerRespawned( StartPhaseRewindLifetime )
+ AddCallback_OnPlayerRespawned( InitialisePermenantAmpedWeaponsForPlayer )
AddCallback_OnTitanBecomesPilot( RemoveAmpedWeaponsForTitanPilot )
// necessary signals
@@ -82,16 +83,10 @@ void function BurnMeter_SetBoostRewardCount( string burnRef, int rewardCount )
file.boostRewardCount[burnRef] <- rewardCount
}
-int function BurnMeter_GetLimitedRewardCount( entity player, string burnRef = "" )
+int function BurnMeter_GetLimitedRewardCount( entity player )
{
- // added burnRef as a parameter, used for dice roll
- // means we dont call two lots of BurnReward_GetRandom() whilst also being able to give multiple items per dice roll (ticks)
- if (burnRef == "")
- {
- EarnObject earnObject = PlayerEarnMeter_GetReward( player )
- burnRef = earnObject.ref
- }
-
+ EarnObject earnObject = PlayerEarnMeter_GetReward( player )
+ string burnRef = earnObject.ref
int limit = -1
int rewardCount = 1
@@ -339,9 +334,10 @@ void function PlayerUsesAmpedWeaponsBurncardThreaded( entity player )
void function RemoveAmpedWeaponsForTitanPilot( entity player, entity titan )
{
- foreach ( entity weapon in player.GetMainWeapons() )
- foreach ( string mod in GetWeaponBurnMods( weapon.GetWeaponClassName() ) )
- weapon.RemoveMod( mod )
+ if ( !( "hasPermenantAmpedWeapons" in player.s ) || !player.s.hasPermenantAmpedWeapons )
+ foreach ( entity weapon in player.GetMainWeapons() )
+ foreach ( string mod in GetWeaponBurnMods( weapon.GetWeaponClassName() ) )
+ weapon.RemoveMod( mod )
}
void function PlayerUsesSmartPistolBurncard( entity player )
@@ -514,8 +510,15 @@ void function PlayerUsesNukeBurncardThreaded( entity player )
thread TitanEjectPlayer( titan, true )
}
+void function InitialisePermenantAmpedWeaponsForPlayer( entity player )
+{
+ player.s.hasPermenantAmpedWeapons <- false
+}
+
void function PlayerUsesPermanentAmpedWeaponsBurncard( entity player )
{
+ player.s.hasPermenantAmpedWeapons = true
+
array<entity> weapons = player.GetMainWeapons()
//weapons.extend( player.GetOffhandWeapons() ) // idk? unsure of vanilla behaviour here
foreach ( entity weapon in weapons )