Skip to content

Adding Characters

AgentCucco edited this page Jun 24, 2021 · 1 revision

Right now the page is missing, but here's a practical example of how to add your characters to the mod

local TaintedJobDoor = Encyclopedia.RegisterSprite(CCO.JobMod.path .. "content/gfx/characterportraitsalt.anm2", "Job", 1)
Encyclopedia.AddCharacter({
    ModName = "Job Modpack",
    Name = "Job",
    ID = CCO.JobMod.PlayerJob,
    CompletionTrackerFuncs = { -- You can skip this one if your mod doesn't have custom unlocks.
        function()
            local UnlocksTab = {}
            
            for boss, tab in pairs(CCO.JobMod.UnlockData.PlayerJob) do
                if type(tab) == "table" then
                    UnlocksTab[boss] = CCO.JobMod.UnlockData.PlayerJob[boss]
                end
            end
            
            return UnlocksTab
        end
    },
})
Encyclopedia.AddCharacterTainted({
    ModName = "Job Modpack",
    Name = "Job",
    Description = "The Unwavering",
    ID = CCO.JobMod.PlayerJob_B,
    CompletionTrackerFuncs = { -- electric boogaloo
        function()
            local UnlocksTab = {}
            
            for boss, tab in pairs(CCO.JobMod.UnlockData.PlayerJob_B) do
                if type(tab) == "table" then
                    UnlocksTab[boss] = CCO.JobMod.UnlockData.PlayerJob[boss]
                end
            end
            
            return UnlocksTab
        end
    },
    UnlockFunc = function(self) -- Again this is in case your tainted is "unlockable"
        if not CCO.JobMod.UnlockData.PlayerJob.Tainted then
            self.Spr = TaintedJobDoor
            self.Desc = "Use Red Key on the hidden door in the Final Chapter as Job."
            self.TargetColor = Encyclopedia.VanillaColor
            
            return self
        end
    end,
})

Clone this wiki locally