Commit e66080dd739ef2160d1447f845ec192e9e99e2c8

Authored by zhangqijia
1 parent 37502372

test: 去除关卡卡角色等级;改为账号等级解锁角色等级上限

@@ -434,6 +434,7 @@ SystemBnousType = { @@ -434,6 +434,7 @@ SystemBnousType = {
434 ChangeBaseCount = 16, -- 每日奖励关卡挑战卡基础数量增加 434 ChangeBaseCount = 16, -- 每日奖励关卡挑战卡基础数量增加
435 ChangeBuyCount = 17, -- 每日奖励关卡挑战卡可购买次数增加, 435 ChangeBuyCount = 17, -- 每日奖励关卡挑战卡可购买次数增加,
436 ExtraProp = 18, -- 每次探索加速额外获得道具 436 ExtraProp = 18, -- 每次探索加速额外获得道具
  437 + AccountLevel = 19, -- 账号等级提升角色等级上限
437 } 438 }
438 439
439 -- 开箱物品类型 440 -- 开箱物品类型
src/actions/HeroAction.lua
@@ -42,10 +42,14 @@ function _M.levelUpRpc( agent, data ) @@ -42,10 +42,14 @@ function _M.levelUpRpc( agent, data )
42 if not role:checkItemEnough(cost) then return 3 end 42 if not role:checkItemEnough(cost) then return 3 end
43 43
44 -- 通过指定关卡后才能升级英雄等级 44 -- 通过指定关卡后才能升级英雄等级
45 - local pass = globalCsv.unit_exp_level_pass[level + 1]  
46 - if pass then  
47 - if not role:checkHangPass(pass) then return 4 end  
48 - end 45 + --local pass = globalCsv.unit_exp_level_pass[level + 1]
  46 + --if pass then
  47 + -- if not role:checkHangPass(pass) then return 4 end
  48 + --end
  49 +
  50 + --账号等级提升角色等级上限
  51 + local accountLevel = role:getAccountLevel()
  52 + if level >= accountLevel then return 4 end
49 53
50 role:costItems(cost, {log = {desc = "heroLevelUp", int1 = msg.id, int2 = hero:getProperty("type")}}) 54 role:costItems(cost, {log = {desc = "heroLevelUp", int1 = msg.id, int2 = hero:getProperty("type")}})
51 55
@@ -86,10 +90,10 @@ function _M.breakRpc( agent, data ) @@ -86,10 +90,10 @@ function _M.breakRpc( agent, data )
86 if not role:checkItemEnough(cost) then return 4 end 90 if not role:checkItemEnough(cost) then return 4 end
87 91
88 -- 通过指定关卡后才能突破英雄 92 -- 通过指定关卡后才能突破英雄
89 - local pass = globalCsv.unit_break_level_pass[breakL + 1]  
90 - if pass then  
91 - if not role:checkHangPass(pass) then return 4 end  
92 - end 93 + --local pass = globalCsv.unit_break_level_pass[breakL + 1]
  94 + --if pass then
  95 + -- if not role:checkHangPass(pass) then return 4 end
  96 + --end
93 97
94 role:costItems(cost, {log = {desc = "heroBreak", int1 = msg.id, int2 = hero:getProperty("type")}}) 98 role:costItems(cost, {log = {desc = "heroBreak", int1 = msg.id, int2 = hero:getProperty("type")}})
95 local oldAttr = hero:getTotalAttrs() 99 local oldAttr = hero:getTotalAttrs()
src/models/RolePlugin.lua
@@ -3030,6 +3030,12 @@ function RolePlugin.bind(Role) @@ -3030,6 +3030,12 @@ function RolePlugin.bind(Role)
3030 return reward 3030 return reward
3031 end 3031 end
3032 3032
  3033 + function Role:getAccountLevel()
  3034 + local levelBnous = self:getLevelBnous()
  3035 + dump(levelBnous)
  3036 + return levelBnous[SystemBnousType.AccountLevel] or 0
  3037 + end
  3038 +
3033 function Role:getLevelBnous() 3039 function Role:getLevelBnous()
3034 local levelBnous = {} 3040 local levelBnous = {}
3035 local curLevel = self:getProperty("level") 3041 local curLevel = self:getProperty("level")
@@ -3058,6 +3064,11 @@ function RolePlugin.bind(Role) @@ -3058,6 +3064,11 @@ function RolePlugin.bind(Role)
3058 levelBnous[pm1] = 0 3064 levelBnous[pm1] = 0
3059 end 3065 end
3060 levelBnous[pm1] = levelBnous[pm1] + pm2 3066 levelBnous[pm1] = levelBnous[pm1] + pm2
  3067 + elseif pm1 == SystemBnousType.AccountLevel then
  3068 + if type(levelBnous[pm1]) == "table" then
  3069 + levelBnous[pm1] = 0
  3070 + end
  3071 + levelBnous[pm1] = math.max(levelBnous[pm1], pm2)
3061 else 3072 else
3062 levelBnous[pm1][pm2] = (levelBnous[pm1][pm2] or 0) + pm3 3073 levelBnous[pm1][pm2] = (levelBnous[pm1][pm2] or 0) + pm3
3063 end 3074 end