Commit c3a70cde3fa0becffdf443e1175a65f0d2bf8504
1 parent
ed20b43c
返还
Showing
3 changed files
with
31 additions
and
13 deletions
Show diff stats
src/actions/HeroAction.lua
... | ... | @@ -499,7 +499,7 @@ function _M.referEquipsRpc(agent, data) |
499 | 499 | local curAttr = hero:getTotalAttrs() |
500 | 500 | local attrChange = getChangeAttrJson(oldAttr, curAttr) |
501 | 501 | for typ, data in pairs(wear) do |
502 | - role:log("hero_jewel", { | |
502 | + role:log("equip_wear", { | |
503 | 503 | hero_id = hero:getProperty("type"), --英雄ID |
504 | 504 | equip_id = data.id, --装备ID |
505 | 505 | equip_wear_action = data.act, --装备操作类型:装备:0,卸载:1 |
... | ... | @@ -671,9 +671,26 @@ function _M.getResetRewardRpc(agent, data) |
671 | 671 | end |
672 | 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 | 695 | for itemId, count in pairs(reward) do |
679 | 696 | reward[itemId] = math.floor(count * globalCsv.unit_back_discount) |
... | ... | @@ -682,7 +699,7 @@ function _M.getResetRewardRpc(agent, data) |
682 | 699 | reward, change = role:award(reward, {log = {desc = "resetHero", int1 = msg.id, int2 = hero:getProperty("type")}}) |
683 | 700 | |
684 | 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 | 703 | hero_recycle_reward = reward, -- 回收后获得的奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} |
687 | 704 | hero_recycle_cnt = 1, -- 总回收英雄量 |
688 | 705 | }) | ... | ... |
src/models/RoleLog.lua
src/models/Rune.lua
... | ... | @@ -27,15 +27,15 @@ function Rune:notifyUpdateProperty(field, newValue, oldValue) |
27 | 27 | end |
28 | 28 | |
29 | 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 | 39 | end |
40 | 40 | |
41 | 41 | function Rune:notifyUpdateProperties(params) | ... | ... |