From bcec5a5e9edd2a2af3a017ea4b250a9ba1112e6f Mon Sep 17 00:00:00 2001 From: BobTheBob9 Date: Sun, 17 Jul 2022 23:58:43 +0100 Subject: dont remove amped weapons after entering titans --- .../mod/scripts/vscripts/burnmeter/_burnmeter.gnut | 27 ++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'Northstar.CustomServers') 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 weapons = player.GetMainWeapons() //weapons.extend( player.GetOffhandWeapons() ) // idk? unsure of vanilla behaviour here foreach ( entity weapon in weapons ) -- cgit v1.2.3