Commit c8d4058cadeb059be5d4f1747721fea83d94e747
1 parent
bd220d63
保底机制修改,200次出未拥有的永雄
Showing
2 changed files
with
23 additions
and
1 deletions
Show diff stats
src/actions/HeroAction.lua
| ... | ... | @@ -946,7 +946,28 @@ function _M.drawHeroRpc(agent, data) |
| 946 | 946 | local drawCardReward, val = role:getDrawCardExtraReward(oldVal, newVal) |
| 947 | 947 | -- 空字符穿代表直接给英雄 走以前repayHeroRpc |
| 948 | 948 | if drawCardReward == "" then |
| 949 | - local id = math.randWeight(csvdb["build_giftCsv"], "pool_1") | |
| 949 | + local repayHeroMaxCount = role:getProperty("repayMaxC") or 0 | |
| 950 | + repayHeroMaxCount = repayHeroMaxCount + 1 | |
| 951 | + | |
| 952 | + role:updateProperty({field = "repayMaxC", value = repayHeroMaxCount}) | |
| 953 | + local even = repayHeroMaxCount % 2 | |
| 954 | + local id = 0 | |
| 955 | + if even == 1 then | |
| 956 | + id = math.randWeight(csvdb["build_giftCsv"], "pool_1") | |
| 957 | + else | |
| 958 | + local giftHeroSet = {} | |
| 959 | + for gid, cfg in pairs(csvdb["build_giftCsv"]) do | |
| 960 | + if cfg["pool_1"] ~= 0 and not role:isHaveHero(gid - ItemStartId.Hero) then | |
| 961 | + giftHeroSet[gid] = {1} | |
| 962 | + end | |
| 963 | + end | |
| 964 | + if next(giftHeroSet) then | |
| 965 | + id = math.randWeight(giftHeroSet, 1) | |
| 966 | + end | |
| 967 | + end | |
| 968 | + if id == 0 then | |
| 969 | + id = math.randWeight(csvdb["build_giftCsv"], "pool_1") | |
| 970 | + end | |
| 950 | 971 | |
| 951 | 972 | local r,change = {} |
| 952 | 973 | local itemData = csvdb["itemCsv"][id] | ... | ... |
src/models/Role.lua
| ... | ... | @@ -162,6 +162,7 @@ Role.schema = { |
| 162 | 162 | emailSync = {"number", 0}, -- 已经同步到的邮件Id |
| 163 | 163 | |
| 164 | 164 | repayHero = {"number", 0}, -- 招募次数 (除去友情招募) |
| 165 | + repayMaxC = {"number", 0}, -- 招募保底英雄领取次数 100一次 | |
| 165 | 166 | floorHero = {"table", {}}, -- 招募保底 -- {[poolId] = count} |
| 166 | 167 | ssrUp = {"table", {}}, -- ssr up -- {[poolId] = count} |
| 167 | 168 | newerDraw = {"table", {}}, -- 新手池子 {N, 1} 抽了多少次, 是否出了ssr | ... | ... |