Commit 98d3cb4205d1bde1cda367bf5b1b2e3181a5542d
Merge branch 'cn/develop' into cn/publish/release
Showing
11 changed files
with
92 additions
and
59 deletions
Show diff stats
src/GlobalVar.lua
@@ -433,7 +433,7 @@ SystemBnousType = { | @@ -433,7 +433,7 @@ SystemBnousType = { | ||
433 | UpSpeedNum = 15, -- 加速次数上限增加 15=1探索加速or 2齿轮加速or 3餐厅加速=增加次数 | 433 | UpSpeedNum = 15, -- 加速次数上限增加 15=1探索加速or 2齿轮加速or 3餐厅加速=增加次数 |
434 | ChangeBaseCount = 16, -- 每日奖励关卡挑战卡基础数量增加 | 434 | ChangeBaseCount = 16, -- 每日奖励关卡挑战卡基础数量增加 |
435 | ChangeBuyCount = 17, -- 每日奖励关卡挑战卡可购买次数增加, | 435 | ChangeBuyCount = 17, -- 每日奖励关卡挑战卡可购买次数增加, |
436 | - ExtraProp = 18, -- 每次探索加速额外获得道具 | 436 | + ExtraProps= 18, -- 每次探索加速额外获得道具 |
437 | AccountLevel = 19, -- 账号等级提升角色等级上限 | 437 | AccountLevel = 19, -- 账号等级提升角色等级上限 |
438 | } | 438 | } |
439 | 439 |
src/ProtocolCode.lua
@@ -62,8 +62,8 @@ actionCodes = { | @@ -62,8 +62,8 @@ actionCodes = { | ||
62 | Role_setFriendTeamRpc = 143, -- 设置好友切磋队伍 | 62 | Role_setFriendTeamRpc = 143, -- 设置好友切磋队伍 |
63 | Role_setBgRpc = 144, -- 设置看板娘 | 63 | Role_setBgRpc = 144, -- 设置看板娘 |
64 | Role_itemConvertSpecialRpc = 145, -- 兑换月卡/战令探索指令等 特殊道具 | 64 | Role_itemConvertSpecialRpc = 145, -- 兑换月卡/战令探索指令等 特殊道具 |
65 | - Role_worldLineRoulette = 146, --世界线抽轮盘 | ||
66 | - Role_worldLineReward = 147, -- 世界线一键领取奖励 | 65 | + Role_worldLineRouletteRpc = 146, --世界线抽轮盘 |
66 | + Role_worldLineRewardRpc = 147, -- 世界线一键领取奖励 | ||
67 | 67 | ||
68 | Adv_startAdvRpc = 151, | 68 | Adv_startAdvRpc = 151, |
69 | Adv_startHangRpc = 152, | 69 | Adv_startHangRpc = 152, |
@@ -117,6 +117,7 @@ actionCodes = { | @@ -117,6 +117,7 @@ actionCodes = { | ||
117 | Hero_setWishPoolRpc = 226, | 117 | Hero_setWishPoolRpc = 226, |
118 | Hero_changeSparkRpc = 227, | 118 | Hero_changeSparkRpc = 227, |
119 | Hero_saveGeniusTreeRpc = 228, | 119 | Hero_saveGeniusTreeRpc = 228, |
120 | + Hero_stickersConvertRpc = 229, --兑换英雄贴纸 | ||
120 | 121 | ||
121 | Hang_startRpc = 251, | 122 | Hang_startRpc = 251, |
122 | Hang_checkRpc = 252, | 123 | Hang_checkRpc = 252, |
src/actions/ActivityAction.lua
@@ -327,12 +327,16 @@ function _M.actBattleCommandTaskRpc(agent, data) | @@ -327,12 +327,16 @@ function _M.actBattleCommandTaskRpc(agent, data) | ||
327 | end | 327 | end |
328 | end | 328 | end |
329 | 329 | ||
330 | - local taskReward = {} | 330 | + local taskReward |
331 | if recordFlag then | 331 | if recordFlag then |
332 | + -- recordFlag = true时,taskCfg.reward 只会有经验奖励 | ||
333 | + taskReward = {} | ||
332 | for k, v in pairs(taskCfg.reward:toNumMap()) do | 334 | for k, v in pairs(taskCfg.reward:toNumMap()) do |
333 | taskReward[k] = (taskReward[k] or 0) + v + taskCfg.battlepass_reward | 335 | taskReward[k] = (taskReward[k] or 0) + v + taskCfg.battlepass_reward |
334 | break | 336 | break |
335 | end | 337 | end |
338 | + else | ||
339 | + taskReward = taskCfg.reward | ||
336 | end | 340 | end |
337 | 341 | ||
338 | local reward, change = role:award(taskReward, {log = {desc = "battleCommandTask"}}) | 342 | local reward, change = role:award(taskReward, {log = {desc = "battleCommandTask"}}) |
src/actions/AdvAction.lua
@@ -506,14 +506,15 @@ function _M.buyAdvCountRpc(agent , data) | @@ -506,14 +506,15 @@ function _M.buyAdvCountRpc(agent , data) | ||
506 | local msg = MsgPack.unpack(data) | 506 | local msg = MsgPack.unpack(data) |
507 | 507 | ||
508 | local count = msg.count --购买次数 | 508 | local count = msg.count --购买次数 |
509 | - local isEl = msg.isEl -- 是否是无尽模式 | 509 | + local isEl = msg.isEl -- 是否是无尽模式 国服没有 |
510 | local cost | 510 | local cost |
511 | if isEl then | 511 | if isEl then |
512 | if math.illegalNum(count, 1, globalCsv.adv_endless_daily_buy_count - role.dailyData:getProperty("advElBC")) then return end | 512 | if math.illegalNum(count, 1, globalCsv.adv_endless_daily_buy_count - role.dailyData:getProperty("advElBC")) then return end |
513 | cost = {[ItemId.Jade] = count * globalCsv.adv_endless_daily_buy_cost} | 513 | cost = {[ItemId.Jade] = count * globalCsv.adv_endless_daily_buy_cost} |
514 | else | 514 | else |
515 | - if math.illegalNum(count, 1, globalCsv.adv_daily_buy_count - role.dailyData:getProperty("advBC")) then return end | ||
516 | - cost = {[ItemId.Jade] = count * globalCsv.adv_daily_buy_cost} | 515 | + --if math.illegalNum(count, 1, globalCsv.adv_daily_buy_count - role.dailyData:getProperty("advBC")) then return end |
516 | + local advCount = (role.dailyData:getProperty("advBC") + count ) * globalCsv.adv_daily_buy_num | ||
517 | + cost = {[ItemId.Jade] = table.findMinKeyByItem(globalCsv.adv_buy_cost, advCount, globalCsv.adv_daily_buy_num)} | ||
517 | end | 518 | end |
518 | 519 | ||
519 | 520 |
src/actions/HangAction.lua
@@ -128,12 +128,10 @@ local function checkReward(role, isTreasure, carbonId) | @@ -128,12 +128,10 @@ local function checkReward(role, isTreasure, carbonId) | ||
128 | --挂机得到的宝藏加入到挂机奖励 | 128 | --挂机得到的宝藏加入到挂机奖励 |
129 | if isTreasure or false == true then | 129 | if isTreasure or false == true then |
130 | local treasureList= role.dailyData:checkTreasureList(carbonId or hangInfo.carbonId) or {} | 130 | local treasureList= role.dailyData:checkTreasureList(carbonId or hangInfo.carbonId) or {} |
131 | - if next(treasureList) then | ||
132 | - for _, val in pairs(treasureList) do | ||
133 | - local award = val.award:toNumMap() | ||
134 | - for k,v in pairs(award) do | ||
135 | - items[k] = (items[k] or 0) + v | ||
136 | - end | 131 | + for _, val in pairs(treasureList) do |
132 | + local award = val.award:toNumMap() | ||
133 | + for k,v in pairs(award) do | ||
134 | + items[k] = (items[k] or 0) + v | ||
137 | end | 135 | end |
138 | end | 136 | end |
139 | end | 137 | end |
@@ -473,30 +471,17 @@ function _M.quickRpc(agent , data) | @@ -473,30 +471,17 @@ function _M.quickRpc(agent , data) | ||
473 | local role = agent.role | 471 | local role = agent.role |
474 | 472 | ||
475 | local hangInfo = role:getProperty("hangInfo") | 473 | local hangInfo = role:getProperty("hangInfo") |
476 | - if not hangInfo.carbonId then return end | 474 | + if not hangInfo.carbonId then return 1 end |
477 | local carbonData = csvdb["idle_battleCsv"][hangInfo.carbonId] | 475 | local carbonData = csvdb["idle_battleCsv"][hangInfo.carbonId] |
478 | --local expCarbonData = csvdb["idle_battleCsv"][hangInfo.expCarbonId] | 476 | --local expCarbonData = csvdb["idle_battleCsv"][hangInfo.expCarbonId] |
479 | local expCarbonData = hangInfo.expData or {} | 477 | local expCarbonData = hangInfo.expData or {} |
480 | 478 | ||
479 | + local change = globalCsv.idle_quickproduce_time / 3600 | ||
481 | local curCount = role.dailyData:getProperty("hangQC") + 1 | 480 | local curCount = role.dailyData:getProperty("hangQC") + 1 |
482 | - local costs = globalCsv.idle_quickproduce_cost:toArray(true, "=") | ||
483 | - | ||
484 | - -- 增加今日探索加速次数 | ||
485 | - local maxIdx = #costs | ||
486 | - local maxCount = maxIdx + role:getBnousUpSpeedNum(UpSpeedType.ExplorationUpSpeed) | ||
487 | - if curCount > maxCount then return end | 481 | + local costCount = table.findMinKeyByItem(globalCsv.idle_quickproduce_cost, curCount * change, change) |
488 | 482 | ||
489 | - if curCount > maxIdx then | ||
490 | - for idx = maxIdx+1, curCount do | ||
491 | - costs[idx] = costs[maxIdx] | ||
492 | - end | ||
493 | - end | ||
494 | - | ||
495 | - if not costs[curCount] then return end | ||
496 | - if costs[curCount] > 0 then | ||
497 | - if not role:checkItemEnough({[ItemId.Jade] = costs[curCount]}) then return end | ||
498 | - role:costItems({[ItemId.Jade] = costs[curCount]}, {log = {desc = "quickHang", int1 = hangInfo.carbonId}}) | ||
499 | - end | 483 | + if not role:checkItemEnough({[ItemId.Jade] = costCount}) then return 2 end |
484 | + role:costItems({[ItemId.Jade] = costCount}, {log = {desc = "quickHang", int1 = hangInfo.carbonId}}) | ||
500 | 485 | ||
501 | role.dailyData:updateProperty({field = "hangQC", value = curCount}) | 486 | role.dailyData:updateProperty({field = "hangQC", value = curCount}) |
502 | 487 | ||
@@ -536,8 +521,8 @@ function _M.quickRpc(agent , data) | @@ -536,8 +521,8 @@ function _M.quickRpc(agent , data) | ||
536 | end | 521 | end |
537 | end | 522 | end |
538 | 523 | ||
539 | - --等级 额外奖励 | ||
540 | - local levelReward = role:getExtraProp() | 524 | + --等级 每次探索加速额外获得道具 |
525 | + local levelReward = role:getBnousExtraProps() | ||
541 | for k, v in pairs(levelReward or {}) do | 526 | for k, v in pairs(levelReward or {}) do |
542 | reward[k] = (reward[k] or 0) + v | 527 | reward[k] = (reward[k] or 0) + v |
543 | end | 528 | end |
@@ -586,13 +571,16 @@ function _M.buyBonusCountRpc(agent, data) | @@ -586,13 +571,16 @@ function _M.buyBonusCountRpc(agent, data) | ||
586 | local bonusC = role.dailyData:getProperty("bonusC") | 571 | local bonusC = role.dailyData:getProperty("bonusC") |
587 | local extraCnt = role.storeData:getBonusExtraFightCount() | 572 | local extraCnt = role.storeData:getBonusExtraFightCount() |
588 | bonusC[btype] = bonusC[btype] or {c = 0, b = 0} | 573 | bonusC[btype] = bonusC[btype] or {c = 0, b = 0} |
589 | - local lastCount = (globalCsv.bonus_daily_buy_count + role:getBnousChangeBuyCount()) * coef + extraCnt - bonusC[btype]["b"] | ||
590 | - if math.illegalNum(count, 1, lastCount) then return 1 end | 574 | + --local lastCount = (globalCsv.bonus_daily_buy_count + role:getBnousChangeBuyCount()) * coef + extraCnt - bonusC[btype]["b"] |
575 | + --if math.illegalNum(count, 1, lastCount) then return 1 end | ||
576 | + | ||
577 | + local costCount = bonusC[btype]["b"] + count | ||
578 | + local cost = table.findMinKeyByItem(globalCsv.bonus_buy_cost, costCount, 1) | ||
591 | 579 | ||
592 | - if not role:checkItemEnough({[ItemId.Jade] = globalCsv.bonus_buy_cost * count}) then return 2 end | 580 | + if not role:checkItemEnough({[ItemId.Jade] = cost}) then return 2 end |
593 | 581 | ||
594 | - role:costItems({[ItemId.Jade] = globalCsv.bonus_buy_cost * count}, {log = {desc = "buyBonusCount", int1 = btype, int2 = count}}) | ||
595 | - bonusC[btype]["b"] = bonusC[btype]["b"] + count | 582 | + role:costItems({[ItemId.Jade] = cost}, {log = {desc = "buyBonusCount", int1 = btype, int2 = count}}) |
583 | + bonusC[btype]["b"] = costCount | ||
596 | bonusC[btype]["c"] = bonusC[btype]["c"] - count | 584 | bonusC[btype]["c"] = bonusC[btype]["c"] - count |
597 | 585 | ||
598 | role.dailyData:updateProperty({field = "bonusC", value = bonusC}) | 586 | role.dailyData:updateProperty({field = "bonusC", value = bonusC}) |
src/actions/HeroAction.lua
@@ -1389,4 +1389,27 @@ function _M.saveGeniusTreeRpc(agent, data) | @@ -1389,4 +1389,27 @@ function _M.saveGeniusTreeRpc(agent, data) | ||
1389 | return true | 1389 | return true |
1390 | end | 1390 | end |
1391 | 1391 | ||
1392 | +function _M.stickersConvertRpc(agent, data) | ||
1393 | + local role = agent.role | ||
1394 | + local msg = MsgPack.unpack(data) | ||
1395 | + local itemId = msg.itemId | ||
1396 | + local heroType = msg.heroType -- heroId-300 举例 [泡泡]= {[heroType] = 120, [heroId]= 420} | ||
1397 | + | ||
1398 | + local itemData = csvdb["itemCsv"][itemId] | ||
1399 | + if not itemData then return 1 end | ||
1400 | + | ||
1401 | + local useEffect = itemData["use_effect"]:toNumMap() | ||
1402 | + if not useEffect[heroType] then return 2 end | ||
1403 | + | ||
1404 | + if not role:isHaveHero(heroType) then return 3 end | ||
1405 | + | ||
1406 | + local cost = {[itemId] = 1} | ||
1407 | + if not role:checkItemEnough(cost) then return 4 end | ||
1408 | + role:costItems({[heroType] = cost}, {log = {desc = "heroStickers"}}) | ||
1409 | + local reward, change = role:award({[heroType] = 1}, {log = {desc = "heroStickers"}}) | ||
1410 | + | ||
1411 | + SendPacket(actionCodes.Hero_stickersConvertRpc, MsgPack.pack(role:packReward(reward, change))) | ||
1412 | + return true | ||
1413 | +end | ||
1414 | + | ||
1392 | return _M | 1415 | return _M |
src/actions/RoleAction.lua
@@ -83,6 +83,9 @@ function _M.loginRpc( agent, data ) | @@ -83,6 +83,9 @@ function _M.loginRpc( agent, data ) | ||
83 | end | 83 | end |
84 | end | 84 | end |
85 | 85 | ||
86 | + -- 设备记录 | ||
87 | + redisproxy:sadd(string_format("device:%d", roleId), msg.device) | ||
88 | + | ||
86 | local now = skynet.timex() | 89 | local now = skynet.timex() |
87 | local role = agent.role | 90 | local role = agent.role |
88 | -- 2 | 91 | -- 2 |
@@ -614,11 +617,11 @@ function _M.openItemRpc(agent, data) | @@ -614,11 +617,11 @@ function _M.openItemRpc(agent, data) | ||
614 | local msg = MsgPack.unpack(data) | 617 | local msg = MsgPack.unpack(data) |
615 | local itemId = msg.itemId | 618 | local itemId = msg.itemId |
616 | local count = msg.count | 619 | local count = msg.count |
617 | - if math.illegalNum(count, 1, role:getItemCount(itemId)) then return end | 620 | + if math.illegalNum(count, 1, role:getItemCount(itemId)) then return 1 end |
618 | local itemData = csvdb["itemCsv"][itemId] | 621 | local itemData = csvdb["itemCsv"][itemId] |
619 | - if itemData.use_type ~= 2 then return end | 622 | + if itemData.use_type ~= 2 then return 2 end |
620 | local randomData = csvdb["item_randomCsv"][tonumber(itemData.use_effect)] | 623 | local randomData = csvdb["item_randomCsv"][tonumber(itemData.use_effect)] |
621 | - if not randomData or randomData.openTime > 0 then return end | 624 | + if not randomData or randomData.openTime > 0 then return 3 end |
622 | 625 | ||
623 | local reward = {} | 626 | local reward = {} |
624 | for _i = 1, count do | 627 | for _i = 1, count do |
@@ -1549,9 +1552,11 @@ function _M.diamondConvertRpc(agent, data) | @@ -1549,9 +1552,11 @@ function _M.diamondConvertRpc(agent, data) | ||
1549 | local allReward = {} | 1552 | local allReward = {} |
1550 | if remain > old then | 1553 | if remain > old then |
1551 | allReward[ItemId.Jade] = remain - old | 1554 | allReward[ItemId.Jade] = remain - old |
1555 | + role:checkWorldChangePoints({[ItemWorldLine.CostJade]= quan * globalCsv.recruit_cost}) | ||
1552 | elseif remain == old then | 1556 | elseif remain == old then |
1553 | else | 1557 | else |
1554 | role:costItems({[ItemId.Jade] = old - remain}, {log = {desc = "convert", short1=oper}}) | 1558 | role:costItems({[ItemId.Jade] = old - remain}, {log = {desc = "convert", short1=oper}}) |
1559 | + role:checkWorldChangePoints({[ItemWorldLine.CostJade]= quan * globalCsv.recruit_cost - (old - remain)}) | ||
1555 | end | 1560 | end |
1556 | 1561 | ||
1557 | if quan > 0 then | 1562 | if quan > 0 then |
@@ -1759,7 +1764,7 @@ function _M.itemConvertSpecialRpc(agent, data) | @@ -1759,7 +1764,7 @@ function _M.itemConvertSpecialRpc(agent, data) | ||
1759 | return true | 1764 | return true |
1760 | end | 1765 | end |
1761 | 1766 | ||
1762 | -function _M.worldLineRoulette(agent, data) | 1767 | +function _M.worldLineRouletteRpc(agent, data) |
1763 | local role = agent.role | 1768 | local role = agent.role |
1764 | 1769 | ||
1765 | local worldChangePoints = role:getProperty("worldChangePoints") or {} | 1770 | local worldChangePoints = role:getProperty("worldChangePoints") or {} |
@@ -1776,7 +1781,7 @@ function _M.worldLineRoulette(agent, data) | @@ -1776,7 +1781,7 @@ function _M.worldLineRoulette(agent, data) | ||
1776 | for k, v in pairs(globalCsv.worldline_gift_magnification_1) do | 1781 | for k, v in pairs(globalCsv.worldline_gift_magnification_1) do |
1777 | worldline_gift_magnification_1[k] = {v} | 1782 | worldline_gift_magnification_1[k] = {v} |
1778 | end | 1783 | end |
1779 | - for k, v in pairs(globalCsv.worldline_gift_magnification_0) do | 1784 | + for k, v in pairs(globalCsv["worldline_gift_magnification_0.1"]) do |
1780 | worldline_gift_magnification_0[k] = {v} | 1785 | worldline_gift_magnification_0[k] = {v} |
1781 | end | 1786 | end |
1782 | 1787 | ||
@@ -1788,21 +1793,21 @@ function _M.worldLineRoulette(agent, data) | @@ -1788,21 +1793,21 @@ function _M.worldLineRoulette(agent, data) | ||
1788 | 1793 | ||
1789 | local points = math.floor((gift_base_10 + gift_base_1) * (gift_magnification_1 + gift_magnification_0)) | 1794 | local points = math.floor((gift_base_10 + gift_base_1) * (gift_magnification_1 + gift_magnification_0)) |
1790 | worldChangePoints[ItemWorldLine.RouletteCount] = worldChangePoints[ItemWorldLine.RouletteCount] - 1 | 1795 | worldChangePoints[ItemWorldLine.RouletteCount] = worldChangePoints[ItemWorldLine.RouletteCount] - 1 |
1791 | - worldChangePoints[ItemWorldLine.Points] = worldChangePoints[ItemWorldLine.Points] + points | 1796 | + worldChangePoints[ItemWorldLine.Points] = (worldChangePoints[ItemWorldLine.Points] or 0) + points |
1792 | role:updateProperty({field = "worldChangePoints", value = worldChangePoints}) | 1797 | role:updateProperty({field = "worldChangePoints", value = worldChangePoints}) |
1793 | 1798 | ||
1794 | - SendPacket(actionCodes.Role_worldLineRoulette, MsgPack.pack(worldChangePoints)) | 1799 | + SendPacket(actionCodes.Role_worldLineRouletteRpc, MsgPack.pack({base_10 = gift_base_10, base_1 = gift_base_1, magnification_1 = gift_magnification_1, magnification_0 = gift_magnification_0})) |
1795 | return true | 1800 | return true |
1796 | end | 1801 | end |
1797 | 1802 | ||
1798 | -function _M.worldLineReward(agent, data) | 1803 | +function _M.worldLineRewardRpc(agent, data) |
1799 | local role = agent.role | 1804 | local role = agent.role |
1800 | local worldLineReward = role:getProperty("worldLineReward") or {} | 1805 | local worldLineReward = role:getProperty("worldLineReward") or {} |
1801 | local worldChangePoints = role:getProperty("worldChangePoints") or {} | 1806 | local worldChangePoints = role:getProperty("worldChangePoints") or {} |
1802 | local points = worldChangePoints[ItemWorldLine.Points] or 0 | 1807 | local points = worldChangePoints[ItemWorldLine.Points] or 0 |
1803 | 1808 | ||
1804 | local reward, change = {} | 1809 | local reward, change = {} |
1805 | - for key, val in pairs(csvdb["worldline_rewardCsv"]) do | 1810 | + for key, val in pairs(csvdb["worldline_awardCsv"]) do |
1806 | if points >= key and not worldLineReward[key] then | 1811 | if points >= key and not worldLineReward[key] then |
1807 | for k, v in pairs(val.award:toNumMap()) do | 1812 | for k, v in pairs(val.award:toNumMap()) do |
1808 | reward[k] = (reward[k] or 0) + v | 1813 | reward[k] = (reward[k] or 0) + v |
@@ -1816,7 +1821,7 @@ function _M.worldLineReward(agent, data) | @@ -1816,7 +1821,7 @@ function _M.worldLineReward(agent, data) | ||
1816 | if next(reward) then | 1821 | if next(reward) then |
1817 | reward, change = role:award(reward, {log = {desc = "worldLine", int1 = role:getProperty("id")}}) | 1822 | reward, change = role:award(reward, {log = {desc = "worldLine", int1 = role:getProperty("id")}}) |
1818 | end | 1823 | end |
1819 | - SendPacket(actionCodes.Role_worldLineReward, MsgPack.pack(role:packReward(reward, change))) | 1824 | + SendPacket(actionCodes.Role_worldLineRewardRpc, MsgPack.pack(role:packReward(reward, change))) |
1820 | return true | 1825 | return true |
1821 | end | 1826 | end |
1822 | 1827 |
src/actions/StoreAction.lua
@@ -535,8 +535,16 @@ function _M.getExploreCommandRewardRpc(agent, data) | @@ -535,8 +535,16 @@ function _M.getExploreCommandRewardRpc(agent, data) | ||
535 | return 3 | 535 | return 3 |
536 | end | 536 | end |
537 | 537 | ||
538 | - if not role:checkHangPass(config.level) then | ||
539 | - return 4 | 538 | + for k, level in pairs(config.level:toNumMap()) do |
539 | + if k == 1 then | ||
540 | + if not role:checkHangPass(level) then | ||
541 | + return 4 | ||
542 | + end | ||
543 | + elseif k == 2 then | ||
544 | + if not role:checkAdvChapterPass(level) then | ||
545 | + return 4 | ||
546 | + end | ||
547 | + end | ||
540 | end | 548 | end |
541 | 549 | ||
542 | local gift = "" | 550 | local gift = "" |
src/models/RoleLog.lua
@@ -146,6 +146,7 @@ local ItemReason = { | @@ -146,6 +146,7 @@ local ItemReason = { | ||
146 | sparkLvlUp = 1214, -- 火花强化 | 146 | sparkLvlUp = 1214, -- 火花强化 |
147 | sparkQualityUp = 1215, -- 火花升华 | 147 | sparkQualityUp = 1215, -- 火花升华 |
148 | heroGenius = 1216, -- 英雄天赋点 | 148 | heroGenius = 1216, -- 英雄天赋点 |
149 | + heroStickers = 1217, -- 英雄贴纸 | ||
149 | 150 | ||
150 | -- pvp | 151 | -- pvp |
151 | pvpCHead = 1301, -- pvp 跨服竞技场头像 | 152 | pvpCHead = 1301, -- pvp 跨服竞技场头像 |
src/models/RolePlugin.lua
@@ -3020,19 +3020,13 @@ function RolePlugin.bind(Role) | @@ -3020,19 +3020,13 @@ function RolePlugin.bind(Role) | ||
3020 | return levelBnous[SystemBnousType.ChangeBuyCount] or 0 | 3020 | return levelBnous[SystemBnousType.ChangeBuyCount] or 0 |
3021 | end | 3021 | end |
3022 | 3022 | ||
3023 | - function Role:getExtraProp() | 3023 | + function Role:getBnousExtraProps() |
3024 | local levelBnous = self:getLevelBnous() | 3024 | local levelBnous = self:getLevelBnous() |
3025 | - local extraPropReward = levelBnous[SystemBnousType.ExtraProp] or {} | ||
3026 | - local reward = {} | ||
3027 | - for k, v in pairs(extraPropReward) do | ||
3028 | - reward[k] = (reward[k] or 0) + v | ||
3029 | - end | ||
3030 | - return reward | 3025 | + return levelBnous[SystemBnousType.ExtraProps] or {} |
3031 | end | 3026 | end |
3032 | 3027 | ||
3033 | function Role:getAccountLevel() | 3028 | function Role:getAccountLevel() |
3034 | local levelBnous = self:getLevelBnous() | 3029 | local levelBnous = self:getLevelBnous() |
3035 | - dump(levelBnous) | ||
3036 | return levelBnous[SystemBnousType.AccountLevel] or 0 | 3030 | return levelBnous[SystemBnousType.AccountLevel] or 0 |
3037 | end | 3031 | end |
3038 | 3032 | ||
@@ -3307,7 +3301,7 @@ function RolePlugin.bind(Role) | @@ -3307,7 +3301,7 @@ function RolePlugin.bind(Role) | ||
3307 | worldChangePoints[ItemWorldLine.CostDiamond] = worldChangePoints[ItemWorldLine.CostDiamond] - cost * globalCsv.worldline_count_currency | 3301 | worldChangePoints[ItemWorldLine.CostDiamond] = worldChangePoints[ItemWorldLine.CostDiamond] - cost * globalCsv.worldline_count_currency |
3308 | worldChangePoints[ItemWorldLine.Points] = (worldChangePoints[ItemWorldLine.Points] or 0) + cost | 3302 | worldChangePoints[ItemWorldLine.Points] = (worldChangePoints[ItemWorldLine.Points] or 0) + cost |
3309 | end | 3303 | end |
3310 | - self:setProperty("worldChangePoints", worldChangePoints) | 3304 | + self:updateProperty({field = "worldChangePoints", value = worldChangePoints}) |
3311 | end | 3305 | end |
3312 | end | 3306 | end |
3313 | 3307 |
src/shared/functions.lua
@@ -865,6 +865,14 @@ function table.array2Table(arr) | @@ -865,6 +865,14 @@ function table.array2Table(arr) | ||
865 | return ret | 865 | return ret |
866 | end | 866 | end |
867 | 867 | ||
868 | +function table.findMinKeyByItem(t, item, change) | ||
869 | + if next(t) and not t[item] then | ||
870 | + item = item - change | ||
871 | + return table.findMinKeyByItem(t, item, change) | ||
872 | + else | ||
873 | + return t[item] | ||
874 | + end | ||
875 | +end | ||
868 | 876 | ||
869 | function table.rewardMerge(dest, src) | 877 | function table.rewardMerge(dest, src) |
870 | for k, v in pairs(src) do | 878 | for k, v in pairs(src) do |