Commit c3a70cde3fa0becffdf443e1175a65f0d2bf8504

Authored by zhouhaihai
1 parent ed20b43c

返还

src/actions/HeroAction.lua
@@ -499,7 +499,7 @@ function _M.referEquipsRpc(agent, data) @@ -499,7 +499,7 @@ function _M.referEquipsRpc(agent, data)
499 local curAttr = hero:getTotalAttrs() 499 local curAttr = hero:getTotalAttrs()
500 local attrChange = getChangeAttrJson(oldAttr, curAttr) 500 local attrChange = getChangeAttrJson(oldAttr, curAttr)
501 for typ, data in pairs(wear) do 501 for typ, data in pairs(wear) do
502 - role:log("hero_jewel", { 502 + role:log("equip_wear", {
503 hero_id = hero:getProperty("type"), --英雄ID 503 hero_id = hero:getProperty("type"), --英雄ID
504 equip_id = data.id, --装备ID 504 equip_id = data.id, --装备ID
505 equip_wear_action = data.act, --装备操作类型:装备:0,卸载:1 505 equip_wear_action = data.act, --装备操作类型:装备:0,卸载:1
@@ -671,9 +671,26 @@ function _M.getResetRewardRpc(agent, data) @@ -671,9 +671,26 @@ function _M.getResetRewardRpc(agent, data)
671 end 671 end
672 end 672 end
673 673
674 - hero:updateProperty({field = "level", value = level})  
675 - hero:updateProperty({field = "breakL", value = breakL})  
676 - hero:updateProperty({field = "talent", value = ""}) 674 + local equip = hero:getProperty("equip")
  675 + for k, v in pairs(equip:toNumMap()) do
  676 + role:addEquip(k, v, 1, {log = {desc = "resetHero", int1 = msg.id, int2 = hero:getProperty("type")}})
  677 + end
  678 +
  679 + local rune = hero:getProperty("rune")
  680 + for _, id in pairs(rune:toNumMap()) do
  681 + local curRune = role.runeBag[id]
  682 + if curRune then
  683 + curRune:updateProperty({field = "refer", value = 0})
  684 + end
  685 + end
  686 +
  687 + hero:updateProperties({
  688 + level = level,
  689 + breakL = breakL,
  690 + talent = "",
  691 + equip = "",
  692 + rune = "",
  693 + })
677 694
678 for itemId, count in pairs(reward) do 695 for itemId, count in pairs(reward) do
679 reward[itemId] = math.floor(count * globalCsv.unit_back_discount) 696 reward[itemId] = math.floor(count * globalCsv.unit_back_discount)
@@ -682,7 +699,7 @@ function _M.getResetRewardRpc(agent, data) @@ -682,7 +699,7 @@ function _M.getResetRewardRpc(agent, data)
682 reward, change = role:award(reward, {log = {desc = "resetHero", int1 = msg.id, int2 = hero:getProperty("type")}}) 699 reward, change = role:award(reward, {log = {desc = "resetHero", int1 = msg.id, int2 = hero:getProperty("type")}})
683 700
684 role:log("hero_recycle", { 701 role:log("hero_recycle", {
685 - hero_recycle_list = hero:getProperty("type"), -- 回收的英雄id列表,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} 702 + hero_recycle_list = {[hero:getProperty("type")] = 1}, -- 回收的英雄id列表,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
686 hero_recycle_reward = reward, -- 回收后获得的奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} 703 hero_recycle_reward = reward, -- 回收后获得的奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
687 hero_recycle_cnt = 1, -- 总回收英雄量 704 hero_recycle_cnt = 1, -- 总回收英雄量
688 }) 705 })
src/models/RoleLog.lua
@@ -98,6 +98,7 @@ local ItemReason = { @@ -98,6 +98,7 @@ local ItemReason = {
98 resetHero = 1207, -- 重置养成 98 resetHero = 1207, -- 重置养成
99 unlockPool = 1208, -- 解锁英雄定向抽卡池 99 unlockPool = 1208, -- 解锁英雄定向抽卡池
100 downloadCv = 1209, -- 下载 cv包奖励 100 downloadCv = 1209, -- 下载 cv包奖励
  101 + refer = 1210, -- 穿戴
101 } 102 }
102 103
103 104
src/models/Rune.lua
@@ -27,15 +27,15 @@ function Rune:notifyUpdateProperty(field, newValue, oldValue) @@ -27,15 +27,15 @@ function Rune:notifyUpdateProperty(field, newValue, oldValue)
27 end 27 end
28 28
29 function Rune:log(contents) 29 function Rune:log(contents)
30 - contents = contents or {}  
31 - if contents["cint1"] or contents["cint2"] or contents["cint3"] then  
32 - print("heroLog error log have cint1 or cint2 or cint3 ", debug.traceback())  
33 - end  
34 - contents["cint1"] = self:getProperty("uid")  
35 - contents["cint2"] = self:getProperty("type")  
36 - contents["cint3"] = self:getProperty("id") 30 + -- contents = contents or {}
  31 + -- if contents["cint1"] or contents["cint2"] or contents["cint3"] then
  32 + -- print("heroLog error log have cint1 or cint2 or cint3 ", debug.traceback())
  33 + -- end
  34 + -- contents["cint1"] = self:getProperty("uid")
  35 + -- contents["cint2"] = self:getProperty("type")
  36 + -- contents["cint3"] = self:getProperty("id")
37 37
38 - self.owner:log("rune_action", contents) 38 + -- self.owner:log("rune_action", contents)
39 end 39 end
40 40
41 function Rune:notifyUpdateProperties(params) 41 function Rune:notifyUpdateProperties(params)