2021-04-22 18:11:11 +02:00
|
|
|
local CharacterData = Object:extend()
|
|
|
|
|
|
|
|
function CharacterData:getCommonData()
|
2021-05-15 21:43:15 +02:00
|
|
|
self.data = core.datas:get("characters", self.simplename)
|
2021-04-22 18:11:11 +02:00
|
|
|
self.name = self.data.name
|
|
|
|
self.fullname = self.data.fullname
|
|
|
|
self.turns = self.data.turns
|
|
|
|
end
|
|
|
|
|
2021-05-16 10:06:20 +02:00
|
|
|
function CharacterData:getWeaknesses()
|
|
|
|
return self.data.weakTo
|
|
|
|
end
|
|
|
|
|
|
|
|
function CharacterData:getResistences()
|
|
|
|
return self.data.resists
|
|
|
|
end
|
|
|
|
|
2021-08-31 10:57:34 +02:00
|
|
|
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
|
|
|
|
|
2021-04-22 18:11:11 +02:00
|
|
|
return CharacterData
|