diff --git a/.metadata b/.metadata index 7646585e..7c555c2f 100644 --- a/.metadata +++ b/.metadata @@ -9,5 +9,5 @@ "requires" : [], "steamContentId" : "763259329", "tags" : "Species|Mechanics", - "version" : "5.2.65" + "version" : "5.2.67" } \ No newline at end of file diff --git a/items/active/weapons/ranged/gunfire.lua b/items/active/weapons/ranged/gunfire.lua index d6477bd9..b808125d 100644 --- a/items/active/weapons/ranged/gunfire.lua +++ b/items/active/weapons/ranged/gunfire.lua @@ -83,8 +83,8 @@ end function GunFire:update(dt, fireMode, shiftHeld) - WeaponAbility.update(self, dt, fireMode, shiftHeld) - + WeaponAbility.update(self, dt, fireMode, shiftHeld) + self.currentFireMode = fireMode -- *** FU Weapon Additions --check if ammo bar should vanish @@ -93,7 +93,9 @@ function GunFire:update(dt, fireMode, shiftHeld) self.timerReloadBar = 5 end if (self.timerReloadBar == 5) then -- is reload bar timer expired? - world.sendEntityMessage(self.playerId,"removeBar","ammoBar") --clear ammo bar + if (self.isAmmoBased == 1) then + world.sendEntityMessage(self.playerId,"removeBar","ammoBar") --clear ammo bar + end self.timerReloadBar = 0 end @@ -441,14 +443,16 @@ function GunFire:checkAmmo() --check current ammo and create an ammo bar to inform the user self.currentAmmoPercent = 1 self.barColor = {0,250,112,125} - + + if (self.fireMode == "primary") then world.sendEntityMessage( self.playerId, "setBar", "ammoBar", self.currentAmmoPercent, self.barColor - ) + ) + end self.weapon:setStance(self.stances.cooldown) self:setState(self.cooldown) end @@ -460,9 +464,9 @@ function GunFire:checkMagazine() self.isAmmoBased = config.getParameter("isAmmoBased",0) if (self.isAmmoBased == 1) then --check current ammo and create an ammo bar to inform the user - self.currentAmmoPercent = self.magazineAmount / self.magazineSize - + self.currentAmmoPercent = self.magazineAmount / self.magazineSize + if (self.fireMode == "primary") then world.sendEntityMessage( self.playerId, "setBar", @@ -470,7 +474,8 @@ function GunFire:checkMagazine() self.currentAmmoPercent, self.barColor ) - + end + if self.magazineAmount <= 0 then self.weapon:setStance(self.stances.cooldown) self:setState(self.cooldown) diff --git a/items/active/weapons/ranged/gunfirefixed.lua b/items/active/weapons/ranged/gunfirefixed.lua index 4ad636dd..1754d612 100644 --- a/items/active/weapons/ranged/gunfirefixed.lua +++ b/items/active/weapons/ranged/gunfirefixed.lua @@ -99,7 +99,7 @@ end function GunFireFixed:update(dt, fireMode, shiftHeld) WeaponAbility.update(self, dt, fireMode, shiftHeld) - + self.currentFireMode = fireMode -- *** FU Weapon Additions --check if ammo bar should vanish @@ -108,7 +108,9 @@ function GunFireFixed:update(dt, fireMode, shiftHeld) self.timerReloadBar = 5 end if (self.timerReloadBar == 5) then -- is reload bar timer expired? - world.sendEntityMessage(self.playerId,"removeBar","ammoBar") --clear ammo bar + if (self.isAmmoBased == 1) then + world.sendEntityMessage(self.playerId,"removeBar","ammoBar") --clear ammo bar + end self.timerReloadBar = 0 end @@ -369,7 +371,6 @@ end function GunFireFixed:uninit() status.clearPersistentEffects("weaponBonus") - world.sendEntityMessage(self.playerId,"removeBar","ammoBar") --clear ammo bar end function GunFireFixed:isResetting() @@ -493,7 +494,8 @@ function GunFireFixed:checkAmmo() --check current ammo and create an ammo bar to inform the user self.currentAmmoPercent = 1.0 self.barColor = {0,250,112,125} - + + if (self.fireMode == "primary") then world.sendEntityMessage( self.playerId, "setBar", @@ -501,7 +503,7 @@ function GunFireFixed:checkAmmo() self.currentAmmoPercent, self.barColor ) - + end self.weapon:setStance(self.stances.cooldown) self:setState(self.cooldown) end @@ -526,7 +528,7 @@ function GunFireFixed:checkMagazine() elseif self.currentAmmoPercent <= 0.25 then self.barColor = {255,0,0,255} end - + if (self.fireMode == "primary") then world.sendEntityMessage( self.playerId, "setBar", @@ -534,7 +536,7 @@ function GunFireFixed:checkMagazine() self.currentAmmoPercent, self.barColor ) - + end if self.magazineAmount <= 0 then self.weapon:setStance(self.stances.cooldown) self:setState(self.cooldown)