Void 1.0
This commit is contained in:
1 parent
cb15cf56c4
commit
281672fe0d
1 file changed
+30
-21
@@ -818,19 +818,34 @@ end
|
|||||||
-- Runs 30 times a second; doesn't update while paused
|
-- Runs 30 times a second; doesn't update while paused
|
||||||
|
|
||||||
local collSpawned = false
|
local collSpawned = false
|
||||||
|
|
||||||
|
EID.VoidStatIncreases = {}
|
||||||
|
EID.BlackRuneStatIncreases = {}
|
||||||
local function VoidRNGNext(num)
|
local function VoidRNGNext(num)
|
||||||
num = num ~ ((num >> 5) & 4294967295)
|
num = num ~ ((num >> 5) & 4294967295)
|
||||||
num = num ~ ((num << 9) & 4294967295)
|
num = num ~ ((num << 9) & 4294967295)
|
||||||
num = num ~ ((num >> 7) & 4294967295)
|
num = num ~ ((num >> 7) & 4294967295)
|
||||||
return num >> 0;
|
return num >> 0;
|
||||||
end
|
end
|
||||||
-- Speed, Fire Rate, Damage, Range, Shot Speed, Luck
|
local function GetTwoIncreases(rng, tbl)
|
||||||
-- (Same order as it is on the Extra Hud)
|
local statTable = {1,2,3,4,5,6}
|
||||||
local voidStatUps = { 0.2, 0.5, 1, 1.5, 0.2, 1 }
|
-- perform 5 random swaps of our stat table
|
||||||
|
for i = 6, 2, -1 do
|
||||||
|
rng = VoidRNGNext(rng)
|
||||||
|
local result = (rng % i) + 1
|
||||||
|
local temp = statTable[i]
|
||||||
|
statTable[i] = statTable[result]
|
||||||
|
statTable[result] = temp
|
||||||
|
end
|
||||||
|
-- the first two entries in the stat table get increased
|
||||||
|
tbl[statTable[1]] = tbl[statTable[1]] + 1
|
||||||
|
tbl[statTable[2]] = tbl[statTable[2]] + 1
|
||||||
|
return rng
|
||||||
|
end
|
||||||
|
|
||||||
function EID:onGameUpdate()
|
function EID:onGameUpdate()
|
||||||
EID.GameUpdateCount = EID.GameUpdateCount + 1
|
EID.GameUpdateCount = EID.GameUpdateCount + 1
|
||||||
|
|
||||||
|
|
||||||
if collSpawned then
|
if collSpawned then
|
||||||
collSpawned = false
|
collSpawned = false
|
||||||
local numVoidable = 0
|
local numVoidable = 0
|
||||||
@@ -855,29 +870,23 @@ function EID:onGameUpdate()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Recalculate our total Void stat-ups if a collectible spawned this frame
|
-- Recalculate our total Void stat-ups if a collectible spawned this frame
|
||||||
-- NOTE: NEED AB+ NUMBERS STILL
|
-- THIS COULD APPLY TO BLACK RUNE AS WELL
|
||||||
-- THIS COULD APPLY TO BLACK RUNE AS WELL, WHATS ITS RNG??? getplayer:getcardrng?
|
|
||||||
if EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_VOID) then
|
if EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_VOID) then
|
||||||
local curRoomIndex = game:GetLevel():GetCurrentRoomIndex()
|
local curRoomIndex = game:GetLevel():GetCurrentRoomIndex()
|
||||||
local increases = {0, 0, 0, 0, 0, 0}
|
local increases = {0, 0, 0, 0, 0, 0}
|
||||||
|
local runeIncreases = {0, 0, 0, 0, 0, 0}
|
||||||
--CHANGE THIS TO THE PLAYER THAT HAS VOID
|
--CHANGE THIS TO THE PLAYER THAT HAS VOID
|
||||||
local startRNG = Isaac.GetPlayer(0):GetCollectibleRNG(CollectibleType.COLLECTIBLE_VOID):GetSeed()
|
local startRNG = Isaac.GetPlayer(0):GetCollectibleRNG(CollectibleType.COLLECTIBLE_VOID):GetSeed()
|
||||||
startRNG = VoidRNGNext(startRNG)
|
local runeRNG = Isaac.GetPlayer(0):GetCardRNG(Card.RUNE_BLACK):GetSeed()
|
||||||
for pedestals = 1, numVoidable do
|
-- in Repentance, an additional RNG call is done before the 5 for stat ups
|
||||||
local statTable = {1,2,3,4,5,6}
|
if REPENTANCE then startRNG = VoidRNGNext(startRNG) end
|
||||||
-- perform 5 random swaps of our stat table
|
for pedestals = 1, 1 do
|
||||||
for i = 6, 2, -1 do
|
startRNG = GetTwoIncreases(startRNG, increases)
|
||||||
startRNG = VoidRNGNext(startRNG)
|
runeRNG = GetTwoIncreases(runeRNG, runeIncreases)
|
||||||
local result = (startRNG % i) + 1
|
break -- only doing 1 preview for now
|
||||||
local temp = statTable[i]
|
|
||||||
statTable[i] = statTable[result]
|
|
||||||
statTable[result] = temp
|
|
||||||
end
|
|
||||||
-- the first two entries in the stat table get increased
|
|
||||||
increases[statTable[1]] = increases[statTable[1]] + voidStatUps[statTable[1]]
|
|
||||||
increases[statTable[2]] = increases[statTable[2]] + voidStatUps[statTable[2]]
|
|
||||||
end
|
end
|
||||||
for i,v in ipairs(increases) do print(v) end
|
EID.VoidStatIncreases = increases
|
||||||
|
EID.BlackRuneStatIncreases = runeIncreases
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user