From 15cba0bfbdf84f2752ba8d0aec3e141ee023156a Mon Sep 17 00:00:00 2001 From: zhouhaihai Date: Tue, 6 Aug 2019 14:11:35 +0800 Subject: [PATCH] 修改天赋升级消耗 --- src/actions/HeroAction.lua | 4 ++-- src/models/Hero.lua | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/actions/HeroAction.lua b/src/actions/HeroAction.lua index fb93e86..d562f15 100644 --- a/src/actions/HeroAction.lua +++ b/src/actions/HeroAction.lua @@ -60,8 +60,8 @@ function _M.wakeRpc(agent, data) local typ = hero:getProperty("type") local wakeData = csvdb["unit_wakeCsv"][hero:getProperty("wakeL")] if not wakeData then return 3 end - - local cost = {[typ] = wakeData.costFigment,[hero:getStampId()] = wakeData.costMaterial} + local costMaterial = wakeData.costMaterial:toArray(true,"=") + local cost = {[typ] = wakeData.costFigment,[globalCsv.unit_wake_cost[hero:getCamp()][costMaterial[1]]] = costMaterial[2]} if not role:checkItemEnough(cost) then return 4 end diff --git a/src/models/Hero.lua b/src/models/Hero.lua index 8e7d84e..be5c415 100644 --- a/src/models/Hero.lua +++ b/src/models/Hero.lua @@ -87,13 +87,8 @@ function Hero:data() } end -function Hero:getStampId() - local typs = { - [1]=50, - [2]=51, - [3]=52, - } - return typs[csvdb["unitCsv"][self:getProperty("type")].camp] +function Hero:getCamp() + return self:getProperty("type")].camp end return Hero \ No newline at end of file -- libgit2 0.21.2