(Hopefully) Randomize perks for players

This commit is contained in:
Nikita Tomashevich 2024-09-17 11:03:06 +03:00
parent 6d7f5385cf
commit e0d3fe7380
3 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,11 @@
local orig_perk_get_spawn_order = perk_get_spawn_order
function perk_get_spawn_order( ignore_these_ )
SetRandomSeed(1, 2 + CrossCall("ew_per_peer_seed"))
local orig_SetRandomSeed = SetRandomSeed
function SetRandomSeed(x, y) end
orig_perk_get_spawn_order( ignore_these_ )
SetRandomSeed = orig_SetRandomSeed
end

View file

@ -0,0 +1,3 @@
ModLuaFileAppend("data/scripts/perks/perk.lua", "mods/quant.ew/files/system/randomize_perks/override_perk_list.lua")

View file

@ -37,6 +37,10 @@ ModLuaFileAppend("data/scripts/gun/gun_actions.lua", "mods/quant.ew/files/resour
ModMagicNumbersFileAdd("mods/quant.ew/files/magic.xml") ModMagicNumbersFileAdd("mods/quant.ew/files/magic.xml")
np.CrossCallAdd("ew_per_peer_seed", function()
return tonumber(ctx.my_id, 16)
end)
local function load_modules() local function load_modules()
ctx.dofile_and_add_hooks("mods/quant.ew/files/system/item_sync.lua") ctx.dofile_and_add_hooks("mods/quant.ew/files/system/item_sync.lua")
@ -94,6 +98,7 @@ local function load_modules()
ctx.load_system("spectate") ctx.load_system("spectate")
ctx.load_system("effect_data_sync") ctx.load_system("effect_data_sync")
ctx.load_system("gen_sync") ctx.load_system("gen_sync")
ctx.load_system("randomize_perks")
end end
local function is_suitable_target(entity) local function is_suitable_target(entity)