Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some nodes on the tree not working with Ignite or fire damage #10

Merged
merged 1 commit into from
Jan 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 74 additions & 35 deletions src/Data/Global.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,49 +96,88 @@
-- NOTE: the LuaJIT bitwise operations we have are not 64-bit
-- so we need to implement them ourselves. Lua uses 53-bit doubles.
HIGH_MASK_53 = 0x1FFFFF
function OR64(a, b)
-- Split into high and low 32-bit parts
local ah = math.floor(a / 0x100000000)
local al = a % 0x100000000
local bh = math.floor(b / 0x100000000)
local bl = b % 0x100000000
function OR64(...)
local args = {...}
if #args < 2 then
return args[1] or 0
end

-- Perform OR operation on both parts
local high = bit.bor(ah, bh)
local low = bit.bor(al, bl)
-- Start with first value
local result = args[1]

-- Combine the results
return bit.band(high, HIGH_MASK_53) * 0x100000000 + low
-- OR with each subsequent value
for i = 2, #args do
-- Split into high and low 32-bit parts
local ah = math.floor(result / 0x100000000)
local al = result % 0x100000000
local bh = math.floor(args[i] / 0x100000000)
local bl = args[i] % 0x100000000

-- Perform OR operation on both parts
local high = bit.bor(ah, bh)
local low = bit.bor(al, bl)

-- Combine the results
result = bit.band(high, HIGH_MASK_53) * 0x100000000 + low
end

return result
end

function AND64(a, b)
-- Split into high and low 32-bit parts
local ah = math.floor(a / 0x100000000)
local al = a % 0x100000000
local bh = math.floor(b / 0x100000000)
local bl = b % 0x100000000

-- Perform AND operation on both parts
local high = bit.band(ah, bh)
local low = bit.band(al, bl)

-- Combine the results
return bit.band(high, HIGH_MASK_53) * 0x100000000 + low
function AND64(...)
local args = {...}
if #args < 2 then
return args[1] or 0
end

-- Start with first value
local result = args[1]

-- AND with each subsequent value
for i = 2, #args do
-- Split into high and low 32-bit parts
local ah = math.floor(result / 0x100000000)
local al = result % 0x100000000
local bh = math.floor(args[i] / 0x100000000)
local bl = args[i] % 0x100000000

-- Perform AND operation on both parts
local high = bit.band(ah, bh)
local low = bit.band(al, bl)

-- Combine the results
result = bit.band(high, HIGH_MASK_53) * 0x100000000 + low
end

return result
end

function XOR64(a, b)
-- Split into high and low 32-bit parts
local ah = math.floor(a / 0x100000000)
local al = a % 0x100000000
local bh = math.floor(b / 0x100000000)
local bl = b % 0x100000000
function XOR64(...)
local args = {...}
if #args < 2 then
return args[1] or 0
end

-- Perform XOR operation on both parts
local high = bit.bxor(ah, bh)
local low = bit.bxor(al, bl)
-- Start with first value
local result = args[1]

-- Combine the results
return bit.band(high, HIGH_MASK_53) * 0x100000000 + low
-- XOR with each subsequent value
for i = 2, #args do
-- Split into high and low 32-bit parts
local ah = math.floor(result / 0x100000000)
local al = result % 0x100000000
local bh = math.floor(args[i] / 0x100000000)
local bl = args[i] % 0x100000000

-- Perform XOR operation on both parts
local high = bit.bxor(ah, bh)
local low = bit.bxor(al, bl)

-- Combine the results
result = bit.band(high, HIGH_MASK_53) * 0x100000000 + low
end

return result
end

function NOT64(a)
Expand Down Expand Up @@ -392,7 +431,7 @@
UseGlobalStats = 129,
ModifiesNextSkill = 130,
OngoingSkill = 131,
UsableWhileShapeshifted = 132,

Check warning on line 434 in src/Data/Global.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Shapeshifted)
Meta = 133,
Bear = 134,
Wolf = 135,
Expand All @@ -411,7 +450,7 @@
SkillConsumesShock = 148,
Wall = 149,
Persistent = 150,
Nonpathing = 151,

Check warning on line 453 in src/Data/Global.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Nonpathing)
CanBecomeArrowRain = 152,
MultipleReservation = 153,
SupportedByElementalDischarge = 154,
Expand All @@ -427,7 +466,7 @@
SupportedByComboFinisher = 164,
Offering = 165,
Retaliation = 166,
Shapeshift = 167,

Check warning on line 469 in src/Data/Global.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Shapeshift)
Invocation = 168,
Grenade = 169,
NoDualWield = 170,
Expand All @@ -454,7 +493,7 @@
IsBlasphemy = 191,
PersistentShowsCastTime = 192,
GeneratesEnergy = 193,
CommandableMinion = 194,

Check warning on line 496 in src/Data/Global.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Commandable)
}

GlobalCache = {
Expand Down
Loading