Commit 1c24ba6eee839409cd304e3fbeb5f78c36f83793
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,6 +78,17 @@ function RolePlugin.bind(Role) | ||
78 | self:addHero(pms) | 78 | self:addHero(pms) |
79 | end | 79 | end |
80 | end, | 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 | [ItemType.AdvItem] = function() --冒险道具不会进入 玩家仓库 | 92 | [ItemType.AdvItem] = function() --冒险道具不会进入 玩家仓库 |
82 | count = 0 | 93 | count = 0 |
83 | end, | 94 | end, |
@@ -474,7 +485,7 @@ function RolePlugin.bind(Role) | @@ -474,7 +485,7 @@ function RolePlugin.bind(Role) | ||
474 | newRune:generateAttrs() | 485 | newRune:generateAttrs() |
475 | newRune.owner = self | 486 | newRune.owner = self |
476 | self.runeBag[runeUid] = newRune | 487 | self.runeBag[runeUid] = newRune |
477 | - | 488 | + newRune:notifyUpdateProperties(newRune:data()) |
478 | return 0 | 489 | return 0 |
479 | else | 490 | else |
480 | return 1 | 491 | return 1 |
src/models/Rune.lua
@@ -56,7 +56,7 @@ local function getRandomValue(types,values) | @@ -56,7 +56,7 @@ local function getRandomValue(types,values) | ||
56 | local tk | 56 | local tk |
57 | local tmp = math.random(1,weightSum) | 57 | local tmp = math.random(1,weightSum) |
58 | for k,v in ipairs(typTab) do | 58 | for k,v in ipairs(typTab) do |
59 | - if v.w > tmp then | 59 | + if v.w >= tmp then |
60 | typ = v.t | 60 | typ = v.t |
61 | tk = k | 61 | tk = k |
62 | break | 62 | break |