From 28f41fcc49bc49ed0204093de4b061498be7a960 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Tue, 31 Aug 2021 10:57:34 +0200 Subject: [PATCH] feat: get skillname from character --- .../game/abstractmobs/character/datas.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sonic-radiance.love/game/abstractmobs/character/datas.lua b/sonic-radiance.love/game/abstractmobs/character/datas.lua index d688f71..abd7ca4 100644 --- a/sonic-radiance.love/game/abstractmobs/character/datas.lua +++ b/sonic-radiance.love/game/abstractmobs/character/datas.lua @@ -15,4 +15,18 @@ function CharacterData:getResistences() return self.data.resists end +function CharacterData:getSkillName(skill) + local skilldata = core.datas:get("skills", skill) + local name = skilldata.fullname + + + if (skilldata.altName ~= nil) then + if (skilldata.altName[self.simplename] ~= nil) then + name = skilldata.altName[self.simplename] + end + end + print(name) + return name +end + return CharacterData