Module:Sandbox/SkillTree: Difference between revisions
From Melvor Idle
(THIS SHIT IS EVIL!!!) |
No edit summary |
||
Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
local GameData = require('Module:GameData') | local GameData = require('Module:GameData') | ||
local SkillData = GameData.skillData | local SkillData = GameData.skillData | ||
function p.getSkillTreeNodes(checkFunc) | function p.getSkillTreeNodes(checkFunc) |
Revision as of 15:51, 30 August 2024
Documentation for this module may be created at Module:Sandbox/SkillTree/doc
local p = {}
local GameData = require('Module:GameData')
local SkillData = GameData.skillData
function p.getSkillTreeNodes(checkFunc)
local nodes = {}
for skillName, skillData in pairs(GameData.skillData) do
local skillTrees = skillData.skillTrees
if skillTrees then
for _, skillTree in ipairs(skillTrees) do
for _, node in ipairs(GameData.getEntities(skillTree.nodes, checkFunc)) do
local nodeCopy = {}
for k, v in pairs(node) do
nodeCopy[k] = v
end
nodeCopy.skillName = skillName
table.insert(nodes, nodeCopy)
end
end
end
end
return nodes
end
return p