소스 검색

修改皮肤活动,直接获得皮肤奖励

mafei 1 년 전
부모
커밋
f19a7a8945
2개의 변경된 파일23개의 추가작업 그리고 17개의 파일을 삭제
  1. 12 14
      script/module/present/HeroSkinLogic.lua
  2. 11 3
      script/module/role/NewLogic.lua

+ 12 - 14
script/module/present/HeroSkinLogic.lua

@@ -1,10 +1,9 @@
 --- 英雄皮肤
 local Grid = require("bag.Grid")
 local BuyExcel = require("excel.buy").buy
-local NewLogic = require("role.NewLogic")
 local BagLogic = require("bag.BagLogic")
-local ItemDefine = require("bag.ItemDefine")
 local HeroSkinExcel = require("excel.present").heroSkin
+local SkinExcel = require("excel.skin").skin
 
 local GC_SKIN_QUERY = 14
 
@@ -23,23 +22,22 @@ local function genSkinUnit(human,id)
         zhekou = buyCfg.zhekou,
         ttl =  cfg.ttl,
     }
-    local itemData = {}
-    for _,item in ipairs(cfg.content) do 
-        local data = {
-            getway = {},
-            suipian = {},
-            equip = {},
-            fuwen = {},
+    local skinId = cfg.content[1]
+    local skinCfg = SkinExcel[skinId]
+    local attrs = {}
+    for _,v in pairs(skinCfg.attrs) do 
+        attrs[#attrs + 1] = {
+            key = v[1],
+            value = v[2],
         }
-        if not ItemDefine.isEquip(item[1]) then
-            Grid.makeItem(data, item[1], item[2])
-        end
-        itemData[#itemData+1] = data
     end
     return {
         id = id,
         buyItem = buyItem,
-        itemData = itemData,
+        skinData = {
+            Id = skinId,
+            attrs = attrs
+        },
     }
 end
 

+ 11 - 3
script/module/role/NewLogic.lua

@@ -29,10 +29,20 @@ local WarOrder               = require("shop.WarOrder")
         content : {item}  -- 礼包内容
     }
 
+    attr = {
+        key = number,   --属性类型
+        value = number, -- 属性值
+    }
+
+    SkinData = {
+        id = number  -- 皮肤id
+        attrs = [attr]array
+    }
+
     Skin = {
         id : number  -- 皮肤配置ID
         buyItem : Buyitem -- 皮肤信息
-        content : [item]  -- 单元内容
+        skinData : []SkinData  -- 皮肤内容
     }
 ]]
 
@@ -179,7 +189,6 @@ end
 
 -- 主动推送给客户端
 function PushClient(human,type,data) 
-    print("======= push to client type",type)
     if not push[type] then 
         Broadcast.sendErr(human, Lang.DRILL_CHOOSE_MY_ERR_INDEX .. " type is " .. type)
         return
@@ -187,6 +196,5 @@ function PushClient(human,type,data)
     local msgRet = Msg.gc.GC_ROLE_CHANGE_BASEINFO
     msgRet.ret = type
     msgRet.tip = Json.Encode(data)
-    print("============ send msg len is ",#msgRet.tip)
     Msg.send(msgRet,human.fd)
 end