Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
Chalwk77 committed Jul 7, 2023
1 parent c6743a8 commit 64c3692
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 6 deletions.
2 changes: 1 addition & 1 deletion INDEV/Battle Royale/map settings/bloodgulch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ return {
-- Weapons will jam over time, as they degrade.
-- They will progressively jam more often as they get closer to breaking.
-- When a weapon jams, it will not fire until it is unjammed.
-- The player will have to unjam the weapon by pressing the reload button.
-- The player will have to unjam the weapon by pressing the melee button.
weapon_degradation = {

-- If enabled, weapons will degrade over time.
Expand Down
4 changes: 4 additions & 0 deletions INDEV/Battle Royale/map settings/dangercanyon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ return {


--- Weapon degradation (decay):
-- Weapons will jam over time, as they degrade.
-- They will progressively jam more often as they get closer to breaking.
-- When a weapon jams, it will not fire until it is unjammed.
-- The player will have to unjam the weapon by pressing the melee button.
weapon_degradation = {

-- If enabled, weapons will degrade over time.
Expand Down
4 changes: 4 additions & 0 deletions INDEV/Battle Royale/map settings/deathisland.lua
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ return {


--- Weapon degradation (decay):
-- Weapons will jam over time, as they degrade.
-- They will progressively jam more often as they get closer to breaking.
-- When a weapon jams, it will not fire until it is unjammed.
-- The player will have to unjam the weapon by pressing the melee button.
weapon_degradation = {

-- If enabled, weapons will degrade over time.
Expand Down
4 changes: 4 additions & 0 deletions INDEV/Battle Royale/map settings/gephyrophobia.lua
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ return {


--- Weapon degradation (decay):
-- Weapons will jam over time, as they degrade.
-- They will progressively jam more often as they get closer to breaking.
-- When a weapon jams, it will not fire until it is unjammed.
-- The player will have to unjam the weapon by pressing the melee button.
weapon_degradation = {

-- If enabled, weapons will degrade over time.
Expand Down
4 changes: 4 additions & 0 deletions INDEV/Battle Royale/map settings/icefields.lua
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ return {


--- Weapon degradation (decay):
-- Weapons will jam over time, as they degrade.
-- They will progressively jam more often as they get closer to breaking.
-- When a weapon jams, it will not fire until it is unjammed.
-- The player will have to unjam the weapon by pressing the melee button.
weapon_degradation = {

-- If enabled, weapons will degrade over time.
Expand Down
4 changes: 4 additions & 0 deletions INDEV/Battle Royale/map settings/infinity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ return {


--- Weapon degradation (decay):
-- Weapons will jam over time, as they degrade.
-- They will progressively jam more often as they get closer to breaking.
-- When a weapon jams, it will not fire until it is unjammed.
-- The player will have to unjam the weapon by pressing the melee button.
weapon_degradation = {

-- If enabled, weapons will degrade over time.
Expand Down
4 changes: 4 additions & 0 deletions INDEV/Battle Royale/map settings/sidewinder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ return {


--- Weapon degradation (decay):
-- Weapons will jam over time, as they degrade.
-- They will progressively jam more often as they get closer to breaking.
-- When a weapon jams, it will not fire until it is unjammed.
-- The player will have to unjam the weapon by pressing the melee button.
weapon_degradation = {

-- If enabled, weapons will degrade over time.
Expand Down
4 changes: 4 additions & 0 deletions INDEV/Battle Royale/map settings/timberland.lua
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ return {


--- Weapon degradation (decay):
-- Weapons will jam over time, as they degrade.
-- They will progressively jam more often as they get closer to breaking.
-- When a weapon jams, it will not fire until it is unjammed.
-- The player will have to unjam the weapon by pressing the melee button.
weapon_degradation = {

-- If enabled, weapons will degrade over time.
Expand Down
12 changes: 7 additions & 5 deletions INDEV/Battle Royale/weapon degradation/degradation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ local function reloading(dynamic_player)
return (read_byte(dynamic_player + 0x2A4) == 5)
end

local function reloadButton(dynamic_player)
return (read_word(dynamic_player + 0x208) == 1024)
local function meleeButton(dynamic_player)
return (read_word(dynamic_player + 0x208) == 128)
end

function weapons:getWeapon(object)
Expand Down Expand Up @@ -47,6 +47,8 @@ function weapons:degrade()
self.decay[object] = nil
end

print(read_word(dyn + 0x208))

self:addWeapon(object, weapon) -- add weapon to decay table

local is_reloading = reloading(dyn)
Expand Down Expand Up @@ -109,10 +111,10 @@ function weapons:isJammed(weapon, dyn)
return false
end

--todo add support for energy weapons
--todo add support for energy weapons (energy weapons cannot be reloaded!)

local reload_pressed = reloadButton(dyn)
if (not reload_pressed) then
local melee = meleeButton(dyn)
if (not melee) then
write_word(weapon.object + 0x2B8, 0) -- primary clip
write_word(weapon.object + 0x2B6, 0) -- reserve ammo
sync_ammo(weapon.weapon)
Expand Down

0 comments on commit 64c3692

Please sign in to comment.