diff --git a/src/actions/HeroAction.lua b/src/actions/HeroAction.lua index 1ceec92..7c3c533 100644 --- a/src/actions/HeroAction.lua +++ b/src/actions/HeroAction.lua @@ -464,19 +464,6 @@ function _M.loveTaskRpc(agent, data) return true end -function _M.changeSkinRpc(agent, data) - local role = agent.role - local msg = MsgPack.unpack(data) - local hero = role.heros[msg.id] - if not hero then return end - local skin = msg.skin - local skinData = csvdb["unit_skinCsv"][hero:getSkinId(skin)] - if not skinData or (skinData.itemId ~= 0 and not role:checkItemEnough({[skinData.itemId] = 1})) then return end - hero:updateProperty({field = "skin", value = skin}) - SendPacket(actionCodes.Hero_changeSkinRpc, "") - return true -end - function _M.createHeroRpc(agent, data) local role = agent.role local msg = MsgPack.unpack(data) diff --git a/src/adv/AdvBattle.lua b/src/adv/AdvBattle.lua index b89b472..9b2e734 100644 --- a/src/adv/AdvBattle.lua +++ b/src/adv/AdvBattle.lua @@ -42,7 +42,7 @@ function Battle:initPlayer() local hero = self.adv.owner.heros[heroId] if hero then heroLevel = heroLevel + hero:getProperty("level") - local advSkillId = csvdb["unitCsv"][self.adv.owner.heros[heroId]:getSkinId()]["adv"] + local advSkillId = csvdb["unitCsv"][self.adv.owner.heros[heroId]:getProperty("type")]["adv"] if advSkillId > 1000 then table.insert(player.passives, {id = advSkillId, level = hero:getSkillLevel(4)}) end diff --git a/src/models/Hero.lua b/src/models/Hero.lua index 15c2cc8..b098b7f 100644 --- a/src/models/Hero.lua +++ b/src/models/Hero.lua @@ -14,7 +14,6 @@ Hero.schema = { battleV = {"number", 0}, -- 保存战斗力 loveExp = {"number", 0}, --好感度经验 loveL = {"number", 0}, --好感度等级 - skin = {"number", 0}, --皮肤 0 、 1、 2、 3 equip = {"string",""}, --装备 type=level rune = {"string",""}, --零件 type=id } @@ -57,7 +56,7 @@ function Hero:updateProperty(params) local datas = {} table.insert(datas, {key = params.field, newValue = self:getProperty(params.field)}) - local check = {level = true, breakL = true, wakeL = true, talent = true, loveL = true, skin = true, equip = true, rune = true} + local check = {level = true, breakL = true, wakeL = true, talent = true, loveL = true, equip = true, rune = true} if check[params.field] then local orginValue = self:getProperty("battleV") local curValue = self:saveBattleValue() @@ -81,7 +80,6 @@ function Hero:data() battleV = self:getProperty("battleV"), loveExp = self:getProperty("loveExp"), loveL = self:getProperty("loveL"), - skin = self:getProperty("skin"), equip = self:getProperty("equip"), rune = self:getProperty("rune"), } diff --git a/src/models/HeroPlugin.lua b/src/models/HeroPlugin.lua index e5a44ca..fda580c 100644 --- a/src/models/HeroPlugin.lua +++ b/src/models/HeroPlugin.lua @@ -76,17 +76,10 @@ function HeroPlugin.bind(Hero) end end - --皮肤 - local skinUp = {} - local reward = (csvdb["unit_skinCsv"][self:getSkinId()] or {})["reward"] or "" - for attrId, value in pairs(reward:toNumMap()) do - skinUp[AttsEnumEx[attrId]] = (skinUp[AttsEnumEx[attrId]] or 0) + value - end - --觉醒 local wData = csvdb["unit_wakeCsv"][wakeL] for attr, value in pairs(attrs) do - attrs[attr] = attrs[attr] * (100 + (wData[attr .. "Level"] or 0) + (talentAttrS[attr] or 0) + (loveUp[attr] or 0) + (skinUp[attr] or 0)) / 100 + attrs[attr] = attrs[attr] * (100 + (wData[attr .. "Level"] or 0) + (talentAttrS[attr] or 0) + (loveUp[attr] or 0)) / 100 end return attrs @@ -206,7 +199,7 @@ function HeroPlugin.bind(Hero) return self:getProperty("skillL"):getv(idx, 1) end - function Hero:getSkillData(idx, skin) + function Hero:getSkillData(idx) local unitData = csvdb["unitCsv"][self:getProperty("type")] if idx == 1 then return csvdb["skill_specialCsv"][unitData.special] @@ -219,16 +212,6 @@ function HeroPlugin.bind(Hero) end return {} end - - function Hero:getSkinId(skin) - skin = skin or self:getProperty("skin") - if skin == 0 then - return self:getProperty("type") - else - return 30000 + self:getProperty("type") * 10 + skin - end - end - end -- libgit2 0.21.2