Commit e66080dd739ef2160d1447f845ec192e9e99e2c8
1 parent
37502372
test: 去除关卡卡角色等级;改为账号等级解锁角色等级上限
Showing
3 changed files
with
24 additions
and
8 deletions
Show diff stats
src/GlobalVar.lua
src/actions/HeroAction.lua
... | ... | @@ -42,10 +42,14 @@ function _M.levelUpRpc( agent, data ) |
42 | 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 | 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 | 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 | 98 | role:costItems(cost, {log = {desc = "heroBreak", int1 = msg.id, int2 = hero:getProperty("type")}}) |
95 | 99 | local oldAttr = hero:getTotalAttrs() | ... | ... |
src/models/RolePlugin.lua
... | ... | @@ -3030,6 +3030,12 @@ function RolePlugin.bind(Role) |
3030 | 3030 | return reward |
3031 | 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 | 3039 | function Role:getLevelBnous() |
3034 | 3040 | local levelBnous = {} |
3035 | 3041 | local curLevel = self:getProperty("level") |
... | ... | @@ -3058,6 +3064,11 @@ function RolePlugin.bind(Role) |
3058 | 3064 | levelBnous[pm1] = 0 |
3059 | 3065 | end |
3060 | 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 | 3072 | else |
3062 | 3073 | levelBnous[pm1][pm2] = (levelBnous[pm1][pm2] or 0) + pm3 |
3063 | 3074 | end | ... | ... |