aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers
diff options
context:
space:
mode:
authorRoyalBlue1 <malte.hoermeyer@web.de>2022-07-18 02:19:01 +0200
committerRoyalBlue1 <malte.hoermeyer@web.de>2022-07-18 02:19:01 +0200
commit6e97ffcb8ac1d2b3ab0b6af798a51a15ffd34db6 (patch)
tree0f3ef6dd1a77f9d7e2f0795b6ea6ab9b1fbc66ae /Northstar.CustomServers
parent7df82f8a57c17e6f25d024cbe9f2d695193fef53 (diff)
parentbcec5a5e9edd2a2af3a017ea4b250a9ba1112e6f (diff)
downloadNorthstarMods-6e97ffcb8ac1d2b3ab0b6af798a51a15ffd34db6.tar.gz
NorthstarMods-6e97ffcb8ac1d2b3ab0b6af798a51a15ffd34db6.zip
Merge remote-tracking branch 'upsteam/permanent-amped-weapons-fix-pr' into gamemode_fd
Diffstat (limited to 'Northstar.CustomServers')
-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 )