Commit 3d8050ef4b5c8f1ceb650bdfb3ecb6266931e754

Authored by liuzujun
1 parent 1279810c

钻石3改成虹光玉8

src/GlobalVar.lua
... ... @@ -126,9 +126,10 @@ ItemStartId = {
126 126 ItemId = {
127 127 Gold = 1, -- 金币
128 128 Exp = 2, -- 经验
129   - Diamond = 3, -- 钻石
  129 + Jade = 3, -- 虹光玉
130 130 PlayerExp = 4, -- 突破材料
131 131 FriendPoint = 5, -- 友情点
  132 + Diamond = 8, -- 钻石
132 133 BreakCost = 10, -- 突破材料
133 134 EquipUp = 11, -- 装备升级材料
134 135 DinerCoin = 12, --后勤物资
... ...
src/actions/ActivityAction.lua
... ... @@ -1275,8 +1275,8 @@ function _M.buyBattleCommandLvlRpc(agent, data)
1275 1275 end
1276 1276 if cost == 0 then return 5 end
1277 1277  
1278   - if not role:checkItemEnough({[ItemId.Diamond] = cost}) then return 6 end
1279   - role:costItems({[ItemId.Diamond] = cost}, {log = {desc = "actBuyBpLevel", int1 = curLvl}})
  1278 + if not role:checkItemEnough({[ItemId.Jade] = cost}) then return 6 end
  1279 + role:costItems({[ItemId.Jade] = cost}, {log = {desc = "actBuyBpLevel", int1 = curLvl}})
1280 1280 actData["lvl"] = nextLvl
1281 1281 role.activity:updateActData("BattleCommand", actData)
1282 1282  
... ...
src/actions/AdvAction.lua
... ... @@ -381,8 +381,8 @@ function _M.quickHangRpc(agent, data)
381 381  
382 382 local cost = math.ceil((info.time - skynet.timex()) / 3600 * globalCsv.adv_idle_quicken)
383 383  
384   - if not role:checkItemEnough({[ItemId.Diamond] = cost}) then return end
385   - role:costItems({[ItemId.Diamond] = cost}, {log = {desc = "advQuickHang", int1 = chapterId}})
  384 + if not role:checkItemEnough({[ItemId.Jade] = cost}) then return end
  385 + role:costItems({[ItemId.Jade] = cost}, {log = {desc = "advQuickHang", int1 = chapterId}})
386 386 info.time = 0
387 387 role:changeUpdates({{type = "advHang", field = chapterId, value = info}})
388 388  
... ... @@ -508,10 +508,10 @@ function _M.buyAdvCountRpc(agent , data)
508 508 local cost
509 509 if isEl then
510 510 if math.illegalNum(count, 1, globalCsv.adv_endless_daily_buy_count - role.dailyData:getProperty("advElBC")) then return end
511   - cost = {[ItemId.Diamond] = count * globalCsv.adv_endless_daily_buy_cost}
  511 + cost = {[ItemId.Jade] = count * globalCsv.adv_endless_daily_buy_cost}
512 512 else
513 513 if math.illegalNum(count, 1, globalCsv.adv_daily_buy_count - role.dailyData:getProperty("advBC")) then return end
514   - cost = {[ItemId.Diamond] = count * globalCsv.adv_daily_buy_cost}
  514 + cost = {[ItemId.Jade] = count * globalCsv.adv_daily_buy_cost}
515 515 end
516 516  
517 517  
... ... @@ -1029,8 +1029,8 @@ function _M.refreshSupportRpc(agent, data)
1029 1029 if cr < al then --免费
1030 1030 role.dailyData:updateProperty({field = "advSupRe", delta = 1})
1031 1031 else -- 付费
1032   - if not role:checkItemEnough({[ItemId.Diamond] = globalCsv.adv_support_refresh_cost}) then return end
1033   - role:costItems({[ItemId.Diamond] = globalCsv.adv_support_refresh_cost}, {log = {desc = "advReSupport"}})
  1032 + if not role:checkItemEnough({[ItemId.Jade] = globalCsv.adv_support_refresh_cost}) then return end
  1033 + role:costItems({[ItemId.Jade] = globalCsv.adv_support_refresh_cost}, {log = {desc = "advReSupport"}})
1034 1034 end
1035 1035  
1036 1036 role:advRandomSupportEffect()
... ...
src/actions/DinerAction.lua
... ... @@ -253,7 +253,7 @@ function _M.expediteSellRpc( agent, data )
253 253 end
254 254 local diamond = globalCsv.diner_sell_quick_cost[count]
255 255 if diamond > 0 then
256   - local cost = {[ItemId.Diamond] = diamond}
  256 + local cost = {[ItemId.Jade] = diamond}
257 257 if not role:checkItemEnough(cost) then
258 258 return 2
259 259 end
... ... @@ -612,7 +612,7 @@ function _M.refreshTaskRpc( agent, data )
612 612 local role = agent.role
613 613 local msg = MsgPack.unpack(data)
614 614  
615   - --local cost = {[ItemId.Diamond] = 40}
  615 + --local cost = {[ItemId.Jade] = 40}
616 616 --if not role:checkItemEnough(cost) then
617 617 -- return 1
618 618 --end
... ...
src/actions/HangAction.lua
... ... @@ -424,8 +424,8 @@ function _M.quickRpc(agent , data)
424 424 local costs = globalCsv.idle_quickproduce_cost:toArray(true, "=")
425 425 if not costs[curCount] then return end
426 426 if costs[curCount] > 0 then
427   - if not role:checkItemEnough({[ItemId.Diamond] = costs[curCount]}) then return end
428   - role:costItems({[ItemId.Diamond] = costs[curCount]}, {log = {desc = "quickHang", int1 = hangInfo.carbonId}})
  427 + if not role:checkItemEnough({[ItemId.Jade] = costs[curCount]}) then return end
  428 + role:costItems({[ItemId.Jade] = costs[curCount]}, {log = {desc = "quickHang", int1 = hangInfo.carbonId}})
429 429 end
430 430  
431 431 role.dailyData:updateProperty({field = "hangQC", value = curCount})
... ... @@ -502,9 +502,9 @@ function _M.buyBonusCountRpc(agent, data)
502 502 local lastCount = globalCsv.bonus_daily_buy_count * coef + extraCnt - bonusC[btype]["b"]
503 503 if math.illegalNum(count, 1, lastCount) then return 1 end
504 504  
505   - if not role:checkItemEnough({[ItemId.Diamond] = globalCsv.bonus_buy_cost * count}) then return 2 end
  505 + if not role:checkItemEnough({[ItemId.Jade] = globalCsv.bonus_buy_cost * count}) then return 2 end
506 506  
507   - role:costItems({[ItemId.Diamond] = globalCsv.bonus_buy_cost * count}, {log = {desc = "buyBonusCount", int1 = btype, int2 = count}})
  507 + role:costItems({[ItemId.Jade] = globalCsv.bonus_buy_cost * count}, {log = {desc = "buyBonusCount", int1 = btype, int2 = count}})
508 508 bonusC[btype]["b"] = bonusC[btype]["b"] + count
509 509 bonusC[btype]["c"] = bonusC[btype]["c"] - count
510 510  
... ... @@ -777,11 +777,11 @@ function _M.bagFieldRpc(agent, data)
777 777 if not costD then
778 778 return 1
779 779 end
780   - if costD ~= 0 and not role:checkItemEnough({[ItemId.Diamond] = costD}) then
  780 + if costD ~= 0 and not role:checkItemEnough({[ItemId.Jade] = costD}) then
781 781 return 2
782 782 end
783 783 role:updateProperty({field = "hangBagLimit", value = curBL + 1})
784   - role:costItems({[ItemId.Diamond] = costD}, {log = {desc = "bagField"}})
  784 + role:costItems({[ItemId.Jade] = costD}, {log = {desc = "bagField"}})
785 785 SendPacket(actionCodes.Hang_bagFieldRpc, '')
786 786 return true
787 787 end
... ...
src/actions/HeroAction.lua
... ... @@ -630,11 +630,11 @@ function _M.getResetRewardRpc(agent, data)
630 630 totalCost[costArr[1]] = costArr[2]
631 631 else
632 632 local diamond = (costArr[2] - itemCount) * costArr[3]
633   - if role:getItemCount(ItemId.Diamond) < diamond then
  633 + if role:getItemCount(ItemId.Jade) < diamond then
634 634 return 1
635 635 end
636 636 totalCost[costArr[1]] = itemCount
637   - totalCost[ItemId.Diamond] = diamond
  637 + totalCost[ItemId.Jade] = diamond
638 638 end
639 639  
640 640 --if pay and not role:costDiamond({count = globalCsv.unit_heroBack_cost or 200, log = {desc = "resetHero", int1 = msg.id}}) then
... ...
src/actions/PvpAction.lua
... ... @@ -241,7 +241,7 @@ function _M.buyCountRpc(agent, data)
241 241 return 1
242 242 end
243 243  
244   - local cost = {[ItemId.Diamond] = globalCsv.pvp_buy_cost * count}
  244 + local cost = {[ItemId.Jade] = globalCsv.pvp_buy_cost * count}
245 245 if not role:checkItemEnough(cost) then return 2 end
246 246 role:costItems(cost, {log = {desc = "buyPvpKey"}})
247 247 role:award({[ItemId.PvpKey] = count}, {log = {desc = "buyPvpKey"}})
... ...
src/actions/RoleAction.lua
... ... @@ -615,8 +615,8 @@ function _M.openTimeBoxRpc(agent, data)
615 615 stopTime = nowTime + quick
616 616 local cost_pre = globalCsv.box_timeOpen_diamond:toArray(true, "=")
617 617 local costKey = math.ceil(quick / (cost_pre[1] * 60)) * cost_pre[2]
618   - if not role:checkItemEnough({[ItemId.Diamond] = costKey}) then return 5 end
619   - role:costItems({[ItemId.Diamond] = costKey}, {log = {desc = "openTimeBox", int1 = slot, int2 = oper}})
  618 + if not role:checkItemEnough({[ItemId.Jade] = costKey}) then return 5 end
  619 + role:costItems({[ItemId.Jade] = costKey}, {log = {desc = "openTimeBox", int1 = slot, int2 = oper}})
620 620 else
621 621 stopTime = math.min(nowTime,time + globalCsv.box_productLine_time * 3600)
622 622 end
... ... @@ -805,8 +805,8 @@ function _M.storyBookRewardRpc(agent, data)
805 805 role:log("carriage_video", {
806 806 carriage_video_type = storyBookData.type, --放映室类型,剧情CG:0, 角色CG:1, 主线剧情:2, 角色剧情:3, 活动剧情:4, 图鉴:5
807 807 carriage_video_id = storyId, --放映室片段ID
808   - carriage_video_coinid = reward[ItemId.Diamond] and ItemId.Diamond or 0, --放映奖励货币类型,无奖励则填写0
809   - carriage_video_coinnum = reward[ItemId.Diamond] or 0, --放映奖励货币数量,无奖励则填写0
  808 + carriage_video_coinid = reward[ItemId.Jade] and ItemId.Jade or 0, --放映奖励货币类型,无奖励则填写0
  809 + carriage_video_coinnum = reward[ItemId.Jade] or 0, --放映奖励货币数量,无奖励则填写0
810 810 carriage_video_item = reward, --放映奖励其他物品数量,json格式记录,{'itemid1':10,'itemid2':5,…………..},无奖励则填写0
811 811 })
812 812  
... ... @@ -1337,7 +1337,7 @@ function _M.goldBuyRpc(agent, data)
1337 1337 if not costD then
1338 1338 return 1
1339 1339 end
1340   - if costD ~= 0 and not role:checkItemEnough({[ItemId.Diamond] = costD}) then
  1340 + if costD ~= 0 and not role:checkItemEnough({[ItemId.Jade] = costD}) then
1341 1341 return 2
1342 1342 end
1343 1343 local goldC = 0
... ... @@ -1359,7 +1359,7 @@ function _M.goldBuyRpc(agent, data)
1359 1359 local coef = role.storeData:getGearExchangeCoef()
1360 1360 goldC = goldC * coef
1361 1361 role.dailyData:updateProperty({field = "goldBuyT", value = curT + 1})
1362   - role:costItems({[ItemId.Diamond] = costD}, {log = {desc = "goldBuy"}})
  1362 + role:costItems({[ItemId.Jade] = costD}, {log = {desc = "goldBuy"}})
1363 1363 local reward, change = role:award({[ItemId.Gold] = math.floor(goldC)}, {log = {desc = "goldBuy"}})
1364 1364 SendPacket(actionCodes.Role_goldBuyRpc, MsgPack.pack(role:packReward(reward, change)))
1365 1365 return true
... ...
src/actions/SeaportAction.lua
... ... @@ -198,8 +198,8 @@ function _M.taskRpc(agent, data)
198 198  
199 199 if quick and remainT > 0 then
200 200 local cost = math.ceil(remainT / 3600) * globalCsv.seaport_task_quick
201   - if not role:checkItemEnough({[ItemId.Diamond] = cost}) then return 8 end
202   - role:costItems({[ItemId.Diamond] = cost}, {log = {desc = "seaportTask", int1 = taskId, int2 = level}})
  201 + if not role:checkItemEnough({[ItemId.Jade] = cost}) then return 8 end
  202 + role:costItems({[ItemId.Jade] = cost}, {log = {desc = "seaportTask", int1 = taskId, int2 = level}})
203 203 end
204 204  
205 205 local carbonCsv = csvdb["idle_battleCsv"]
... ...
src/models/Role.lua
... ... @@ -61,6 +61,7 @@ Role.schema = {
61 61 ignoreMt = {"number", 0}, -- 忽略维护拦截
62 62 sversion = {"number", STRUCT_VERSION or 0}, -- 重整数据版本
63 63 timeReset = {"table", {}}, --重置轮回记录
  64 + jade = {"number", 0}, -- 虹光玉
64 65 diamond = {"number", 0}, -- 免费钻
65 66 reDiamond = {"number", 0}, -- android充值钻
66 67 reDiamondIos = {"number", 0}, -- ios充值钻
... ...
src/models/RolePlugin.lua
... ... @@ -346,7 +346,7 @@ function RolePlugin.bind(Role)
346 346 function Role:addItem(params)
347 347 params = params or {}
348 348 params.count = math.floor(params.count or 0)
349   - if params.itemId == ItemId.Diamond then
  349 + if params.itemId == ItemId.Jade then
350 350 self:gainDiamond(params)
351 351 return
352 352 end
... ... @@ -404,14 +404,14 @@ function RolePlugin.bind(Role)
404 404  
405 405 function Role:costItems(itemCountT, params)
406 406 local pms = clone(params or {})
407   - if itemCountT[ItemId.Diamond] then --优先扣除钻石
408   - pms.count = itemCountT[ItemId.Diamond]
  407 + if itemCountT[ItemId.Jade] then --优先扣除钻石
  408 + pms.count = itemCountT[ItemId.Jade]
409 409 if not self:costDiamond(pms) then
410 410 return
411 411 end
412 412 end
413 413 for itemId, count in pairs(itemCountT) do
414   - if itemId ~= ItemId.Diamond then
  414 + if itemId ~= ItemId.Jade then
415 415 pms.itemId = itemId
416 416 pms.count = - count
417 417 self:addItem(pms)
... ... @@ -453,7 +453,8 @@ function RolePlugin.bind(Role)
453 453  
454 454 function Role:getAllDiamond()
455 455 local diamond = self:getProperty("sid") == IOS_SID and self:getProperty("reDiamondIos") or self:getProperty("reDiamond")
456   - return self:getProperty("diamond") + diamond
  456 + --return self:getProperty("diamond") + diamond
  457 + return diamond
457 458 end
458 459  
459 460 function Role:gainDiamond(params)
... ... @@ -462,20 +463,20 @@ function RolePlugin.bind(Role)
462 463 if isnan(count) then
463 464 return false
464 465 end
465   - local origind = self:getProperty("diamond")
  466 + local origind = 0 -- self:getProperty("diamond")
466 467 local originr = self:getProperty("sid") == IOS_SID and self:getProperty("reDiamondIos") or self:getProperty("reDiamond")
467 468 local origin = origind + originr
468   - if params.isRecharge then
  469 + --if params.isRecharge then
469 470 if params.sid == IOS_SID then
470 471 self:incrProperty("reDiamondIos", count)
471 472 else
472 473 self:incrProperty("reDiamond", count)
473 474 end
474   - else
475   - self:incrProperty("diamond", count)
476   - end
  475 + --else
  476 + --self:incrProperty("diamond", count)
  477 + --end
477 478  
478   - self:logItems(ItemId.Diamond, origin, count, params.log)
  479 + self:logItems(ItemId.Jade, origin, count, params.log)
479 480 if params.log then
480 481 local log = clone(params.log)
481 482 if log["cint1"] or log["cint2"] or log["cint3"] then
... ... @@ -502,7 +503,7 @@ function RolePlugin.bind(Role)
502 503 return false
503 504 end
504 505 local isIos = self:getProperty("sid") == IOS_SID
505   - local origind = self:getProperty("diamond")
  506 + local origind = 0 -- self:getProperty("diamond")
506 507 local originr = isIos and self:getProperty("reDiamondIos") or self:getProperty("reDiamond")
507 508 local origin = origind + originr
508 509  
... ... @@ -512,18 +513,20 @@ function RolePlugin.bind(Role)
512 513 if origin < count then
513 514 return false
514 515 end
515   - local last = count
516   - local costFirst = isIos and {"diamond", "reDiamondIos"} or {"diamond", "reDiamond"}
517   - if params.isRecharge then
518   - costFirst = isIos and {"reDiamondIos", "diamond"} or {"reDiamond", "diamond"}
519   - end
520   - last = math.max(last - self:getProperty(costFirst[1]), 0)
521   - if last < count then
522   - self:incrProperty(costFirst[1], last - count)
523   - end
524   - if last > 0 then
525   - self:incrProperty(costFirst[2], -last)
526   - end
  516 + local diamondKey = isIos and "reDiamondIos" or "reDiamond"
  517 + self:incrProperty(diamondKey, -count)
  518 + --local last = count
  519 + --local costFirst = isIos and {"diamond", "reDiamondIos"} or {"diamond", "reDiamond"}
  520 + --if params.isRecharge then
  521 + -- costFirst = isIos and {"reDiamondIos", "diamond"} or {"reDiamond", "diamond"}
  522 + --end
  523 + --last = math.max(last - self:getProperty(costFirst[1]), 0)
  524 + --if last < count then
  525 + -- self:incrProperty(costFirst[1], last - count)
  526 + --end
  527 + --if last > 0 then
  528 + -- self:incrProperty(costFirst[2], -last)
  529 + --end
527 530  
528 531  
529 532 self:logItems(ItemId.Diamond, origin, count, params.log)
... ... @@ -2124,7 +2127,7 @@ function RolePlugin.bind(Role)
2124 2127 end
2125 2128  
2126 2129 if diamondCount > 0 then
2127   - reward[ItemId.Diamond] = (reward[ItemId.Diamond] or 0) + diamondCount
  2130 + reward[ItemId.Jade] = (reward[ItemId.Jade] or 0) + diamondCount
2128 2131 end
2129 2132  
2130 2133 self:checkTaskEnter("Pay", {rmb = rechargeData.rmb, twd = rechargeData.twd})
... ...
src/services/dbseed.lua
... ... @@ -201,10 +201,10 @@ local steps = {
201 201 handler = initAutoIncreUidTable,
202 202 desc = "initialize auto_increment_uid table "
203 203 },
204   - [3] = {
205   - handler = initAdvSeasonTable,
206   - desc = "initialize adv_season table "
207   - },
  204 + --[3] = {
  205 + -- handler = initAdvSeasonTable,
  206 + -- desc = "initialize adv_season table "
  207 + --},
208 208 [4] = {
209 209 handler = checkRoleTables,
210 210 desc = "check role tables "
... ...