Commit 1c24ba6eee839409cd304e3fbeb5f78c36f83793

Authored by gaofengduan
1 parent 99912630

fix equip

#gm 接口兼容
#零件属性生成边界处理
Showing 2 changed files with 13 additions and 2 deletions   Show diff stats
src/models/RolePlugin.lua
... ... @@ -78,6 +78,17 @@ function RolePlugin.bind(Role)
78 78 self:addHero(pms)
79 79 end
80 80 end,
  81 + [ItemType.EquipBase] = function()
  82 + local typ = math.floor((itemId-7000)/100)
  83 + local lv = (itemId-7000)%100
  84 + self:addEquip({type = typ,level = lv,count = count})
  85 + end,
  86 + [ItemType.Rune] = function()
  87 + local typ = math.floor((itemId-2000)/100)
  88 + for _= 1, count do
  89 + self:addRune({type = typ,id = itemId})
  90 + end
  91 + end,
81 92 [ItemType.AdvItem] = function() --冒险道具不会进入 玩家仓库
82 93 count = 0
83 94 end,
... ... @@ -474,7 +485,7 @@ function RolePlugin.bind(Role)
474 485 newRune:generateAttrs()
475 486 newRune.owner = self
476 487 self.runeBag[runeUid] = newRune
477   -
  488 + newRune:notifyUpdateProperties(newRune:data())
478 489 return 0
479 490 else
480 491 return 1
... ...
src/models/Rune.lua
... ... @@ -56,7 +56,7 @@ local function getRandomValue(types,values)
56 56 local tk
57 57 local tmp = math.random(1,weightSum)
58 58 for k,v in ipairs(typTab) do
59   - if v.w > tmp then
  59 + if v.w >= tmp then
60 60 typ = v.t
61 61 tk = k
62 62 break
... ...