Commit d42dd6932ee31a971710243b37babacb58f809b0
Merge branch 'cn/develop' of 120.26.43.151:wasteland/server into cn/develop
Showing
4 changed files
with
38 additions
and
24 deletions
Show diff stats
src/actions/HeroAction.lua
... | ... | @@ -153,7 +153,8 @@ function _M.wakeRpc(agent, data) |
153 | 153 | end |
154 | 154 | |
155 | 155 | if curLevel >= 4 then --自动觉醒技能 |
156 | - hero:increGeniusTree() | |
156 | + local new = hero:increGeniusTree() | |
157 | + hero:updateProperty({field = "genius", value = new}) | |
157 | 158 | end |
158 | 159 | hero:mylog({desc = "wake", int1 = hero:getProperty("wakeL")}) |
159 | 160 | |
... | ... | @@ -556,8 +557,10 @@ function _M.referRunesRpc(agent, data) |
556 | 557 | end |
557 | 558 | end |
558 | 559 | |
560 | + local roleId = role:getProperty("id") | |
559 | 561 | for cheroId, cIds in pairs(used) do |
560 | - local chero = role.heros[cheroId] | |
562 | + local heroId = cheroId % (roleId * MAX_HERO_NUM) | |
563 | + local chero = role.heros[heroId] | |
561 | 564 | local hrunes = chero:getProperty("rune") |
562 | 565 | for slot, rId in pairs(hrunes:toNumMap()) do |
563 | 566 | if cIds[rId] then |
... | ... | @@ -809,6 +812,7 @@ function _M.drawHeroRpc(agent, data) |
809 | 812 | |
810 | 813 | -- 计算抽卡消耗品 |
811 | 814 | local cost = {} |
815 | + local drawAddReward = {} | |
812 | 816 | if buildTypeData["draw_coin_1"] == "" then |
813 | 817 | return 11 |
814 | 818 | end |
... | ... | @@ -1004,10 +1008,20 @@ function _M.drawHeroRpc(agent, data) |
1004 | 1008 | table.insert(reward, {id = itemId, count = 1}) |
1005 | 1009 | end |
1006 | 1010 | |
1011 | + -- 招募得到的英雄追加奖励 | |
1012 | + local unitData = csvdb["unitCsv"][itemData.id - ItemStartId.Hero] | |
1013 | + if unitData.build_award ~= "" then | |
1014 | + for tId, tCount in pairs(unitData.build_award:toNumMap()) do | |
1015 | + drawAddReward[tId] = (drawAddReward[tId] or 0) + tCount | |
1016 | + end | |
1017 | + end | |
1018 | + -- | |
1019 | + | |
1007 | 1020 | dailyDrawCnt = dailyDrawCnt + 1 |
1008 | 1021 | role:checkTaskEnter("DrawHeroLimitPack", {count = dailyDrawCnt}) |
1009 | 1022 | end |
1010 | 1023 | |
1024 | + role:award(drawAddReward, {log = {desc = "drawHero", int1 = btype}}) | |
1011 | 1025 | role.dailyData:setProperty("drawHeroCnt", dailyDrawCnt) |
1012 | 1026 | |
1013 | 1027 | if draw_floor_back_counts then |
... | ... | @@ -1041,7 +1055,7 @@ function _M.drawHeroRpc(agent, data) |
1041 | 1055 | }) |
1042 | 1056 | |
1043 | 1057 | role:mylog("hero_action", {desc = "drawHero", int1=poolId, int2=btype, short1 = drawCount[drawType]}) |
1044 | - SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward})) -- 这个 reward 是数组 | |
1058 | + SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward, subReward = drawAddReward})) -- 这个 reward 是数组 | |
1045 | 1059 | |
1046 | 1060 | local feedbackId = buildTypeData["can_feedback"] or 0 |
1047 | 1061 | if feedbackId ~= 0 then |
... | ... | @@ -1291,6 +1305,9 @@ function _M.saveGeniusTreeRpc(agent, data) |
1291 | 1305 | local hero = role.heros[tonumber(heroId)] |
1292 | 1306 | |
1293 | 1307 | if not hero then print("hero is nil") return 0 end |
1308 | + | |
1309 | + if wakeL and wakeL > hero:getProperty("wakeL") then return 1 end | |
1310 | + | |
1294 | 1311 | local genius = hero:saveGeniusTree(wakeL, awake) |
1295 | 1312 | if #genius == 0 then |
1296 | 1313 | genius = "" | ... | ... |
src/actions/RoleAction.lua
... | ... | @@ -1063,7 +1063,7 @@ function _M.achiveRpc(agent, data) |
1063 | 1063 | if preMaxCount < pData.request and overCount >= pData.request then |
1064 | 1064 | role:sendMail(101, skynet.timex(), pData.reward, {pData.level}) |
1065 | 1065 | flag = true |
1066 | - role:mylog("role_action", {desc="fux", int1=pdata.level}) | |
1066 | + role:mylog("role_action", {desc="fux", int1=pData.level}) | |
1067 | 1067 | end |
1068 | 1068 | end |
1069 | 1069 | if flag then |
... | ... | @@ -1388,29 +1388,24 @@ function _M.goldBuyRpc(agent, data) |
1388 | 1388 | if not costD then |
1389 | 1389 | return 1 |
1390 | 1390 | end |
1391 | - if costD ~= 0 and not role:checkItemEnough({[ItemId.Diamond] = costD}) then | |
1391 | + if costD ~= 0 and not role:checkItemEnough({[ItemId.Jade] = costD}) then | |
1392 | 1392 | return 2 |
1393 | 1393 | end |
1394 | + | |
1395 | + --特权卡倍数 | |
1394 | 1396 | local goldC = 0 |
1395 | - local hangPass = role:getProperty("hangPass") | |
1396 | - for i = 1, 3 do | |
1397 | - if hangPass[i] then | |
1398 | - local carbonData = csvdb["idle_battleCsv"][hangPass[i]] | |
1399 | - goldC = math.max(goldC, carbonData.money * globalCsv.idle_quickMoney_effect) | |
1400 | - end | |
1401 | - end | |
1402 | - local carbonId = role:getProperty("hangInfo").carbonId | |
1403 | - if carbonId then | |
1404 | - local carbonData = csvdb["idle_battleCsv"][carbonId] | |
1405 | - goldC = math.max(goldC, carbonData.money * globalCsv.idle_quickMoney_effect) | |
1406 | - end | |
1407 | - if goldC == 0 then | |
1397 | + local multiple = role.storeData:getGearExchangeCoef() | |
1398 | + | |
1399 | + local hangInfo = role:getProperty("hangInfo") | |
1400 | + local expCarbon_Data = hangInfo.expData or globalCsv.oriCarbonData | |
1401 | + goldC = expCarbon_Data.money * globalCsv.idle_quickMoney_effect * multiple | |
1402 | + | |
1403 | + if goldC == 0 then | |
1408 | 1404 | return 3 |
1409 | 1405 | end |
1410 | - local coef = role.storeData:getGearExchangeCoef() | |
1411 | - goldC = goldC * coef | |
1406 | + | |
1412 | 1407 | role.dailyData:updateProperty({field = "goldBuyT", value = curT + 1}) |
1413 | - role:costItems({[ItemId.Diamond] = costD}, {log = {desc = "goldBuy"}}) | |
1408 | + role:costItems({[ItemId.Jade] = costD}, {log = {desc = "goldBuy"}}) | |
1414 | 1409 | local reward, change = role:award({[ItemId.Gold] = math.floor(goldC)}, {log = {desc = "goldBuy"}}) |
1415 | 1410 | SendPacket(actionCodes.Role_goldBuyRpc, MsgPack.pack(role:packReward(reward, change))) |
1416 | 1411 | return true | ... | ... |
src/models/RolePlugin.lua
... | ... | @@ -836,7 +836,7 @@ function RolePlugin.bind(Role) |
836 | 836 | newRune:create() |
837 | 837 | newRune:generateAttrs() |
838 | 838 | newRune.owner = self |
839 | - self.runeBag[runeUid] = newRune | |
839 | + self.runeBag[roleId * MAX_RUNE_NUM + runeUid] = newRune | |
840 | 840 | if not params.notNotify then |
841 | 841 | local response = {} |
842 | 842 | table.insert(response, newRune:data()) |
... | ... | @@ -887,7 +887,7 @@ function RolePlugin.bind(Role) |
887 | 887 | newSpark:create() |
888 | 888 | newSpark:addAttr(data.attr:toNumMap()) |
889 | 889 | newSpark.owner = self |
890 | - self.sparkBag[sparkUid] = newSpark | |
890 | + self.sparkBag[roleId * MAX_SPARK_NUM + sparkUid] = newSpark | |
891 | 891 | if not params.notNotify then |
892 | 892 | local response = {} |
893 | 893 | table.insert(response, newSpark:data()) |
... | ... | @@ -1777,6 +1777,7 @@ function RolePlugin.bind(Role) |
1777 | 1777 | info.type = hero:getProperty("type") |
1778 | 1778 | info.level = hero:getProperty("level") |
1779 | 1779 | info.wakeL = hero:getProperty("wakeL") |
1780 | + info.genius = hero:getProperty("genius") | |
1780 | 1781 | info.blockLevel = hero:getSkillLevel(4) |
1781 | 1782 | info.specialLevel = hero:getSkillLevel(1) |
1782 | 1783 | info.passiveLevel = hero:getSkillLevel(3) |
... | ... | @@ -1800,6 +1801,7 @@ function RolePlugin.bind(Role) |
1800 | 1801 | type = hero:getProperty("type"), |
1801 | 1802 | level = hero:getProperty("level"), |
1802 | 1803 | wakeL = hero:getProperty("wakeL"), |
1804 | + genius = hero:getProperty("genius"), | |
1803 | 1805 | } |
1804 | 1806 | end |
1805 | 1807 | format.heros = heros | ... | ... |
src/models/Store.lua
... | ... | @@ -301,7 +301,7 @@ function Store:onBuyCard(type, duration, id, actid) |
301 | 301 | actData["unlock"] = 1 |
302 | 302 | if actCfg.condition ~= 0 then |
303 | 303 | actData["lvl"] = (actData["lvl"] or 0) + actCfg.condition |
304 | - role:mylog("act_action", {desc="buyBcLvl", int1=actCfg.condition, int2=actData["lvl"]}) | |
304 | + self.owner:mylog("act_action", {desc="buyBcLvl", int1=actCfg.condition, int2=actData["lvl"]}) | |
305 | 305 | end |
306 | 306 | self.owner:mylog("act_action", {desc="buyBc", int1=id, int2=actData["lvl"] or 0}) |
307 | 307 | self.owner.activity:updateActData("BattleCommand", actData) | ... | ... |