|
|
@@ -469,23 +469,6 @@ local function calcAttr(attrData)
|
|
|
end
|
|
|
|
|
|
|
|
|
---获得当前闯关模式的属性加成
|
|
|
--- local function getTargetBattleAttrAdd(human)
|
|
|
--- local nBattleType = BattleLogic_GetBattleType(human)
|
|
|
-
|
|
|
--- if EliteDefine.COPY_ELITE_ERROR >= nBattleType or EliteDefine.COPY_ELITE_DIFFICULTY < nBattleType then
|
|
|
--- assert(false)
|
|
|
--- end
|
|
|
-
|
|
|
--- if EliteDefine.COPY_ELITE_NORMAL == nBattleType then
|
|
|
--- return human.db.normalBattleAttrData
|
|
|
--- elseif EliteDefine.COPY_LEVEL_ELITE == nBattleType then
|
|
|
--- return human.db.eliteBattleAttrData
|
|
|
--- elseif EliteDefine.COPY_ELITE_DIFFICULTY == nBattleType then
|
|
|
--- return human.db.hardBattleAttrData
|
|
|
--- end
|
|
|
--- end
|
|
|
-
|
|
|
|
|
|
-----------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
@@ -976,17 +959,17 @@ function onLogin(human)
|
|
|
end
|
|
|
|
|
|
-- 处理老号的闯关的属性加成
|
|
|
- local normalBattleAttrData = getBattleAttrByType(human, EliteDefine.COPY_ELITE_NORMAL)
|
|
|
- if not normalBattleAttrData then
|
|
|
- human.db.normalBattleAttrData = {}
|
|
|
- human.db.normalBattleAttrData.chosenAttrList = generateDiffBattleAttr(human, EliteDefine.COPY_ELITE_NORMAL)
|
|
|
+ -- local normalBattleAttrData = getBattleAttrByType(human, EliteDefine.COPY_ELITE_NORMAL)
|
|
|
+ -- if not normalBattleAttrData then
|
|
|
+ -- human.db.normalBattleAttrData = {}
|
|
|
+ -- human.db.normalBattleAttrData.chosenAttrList = generateDiffBattleAttr(human, EliteDefine.COPY_ELITE_NORMAL)
|
|
|
|
|
|
- human.db.eliteBattleAttrData = {}
|
|
|
- human.db.eliteBattleAttrData.chosenAttrList = generateDiffBattleAttr(human, EliteDefine.COPY_LEVEL_ELITE)
|
|
|
+ -- human.db.eliteBattleAttrData = {}
|
|
|
+ -- human.db.eliteBattleAttrData.chosenAttrList = generateDiffBattleAttr(human, EliteDefine.COPY_LEVEL_ELITE)
|
|
|
|
|
|
- human.db.hardBattleAttrData = {}
|
|
|
- human.db.hardBattleAttrData.chosenAttrList = generateDiffBattleAttr(human, EliteDefine.COPY_ELITE_DIFFICULTY)
|
|
|
- end
|
|
|
+ -- human.db.hardBattleAttrData = {}
|
|
|
+ -- human.db.hardBattleAttrData.chosenAttrList = generateDiffBattleAttr(human, EliteDefine.COPY_ELITE_DIFFICULTY)
|
|
|
+ -- end
|
|
|
|
|
|
|
|
|
if human.db.lv >= BATTLE_LOGIN_LEV_TIPS then
|
|
|
@@ -2436,7 +2419,7 @@ function nodeDetailQuery(human, battleID)
|
|
|
end
|
|
|
|
|
|
|
|
|
---战斗前处理下属性加成
|
|
|
+--处理战斗前属性加成
|
|
|
function onFightBegin(human, cbParam, combatType, param)
|
|
|
local nBattleType = BattleLogic_GetBattleType(human)
|
|
|
local attrAddData = getBattleAttrByType(human, nBattleType)
|
|
|
@@ -2494,11 +2477,11 @@ function fight(human)
|
|
|
end
|
|
|
|
|
|
--如果有加成属性还没有选也不能挑战
|
|
|
- local nBattleType = BattleLogic_GetBattleType(human)
|
|
|
- local attrAddData = getBattleAttrByType(human, nBattleType)
|
|
|
- if attrAddData and attrAddData.unSelectedAttrList then
|
|
|
- return Broadcast.sendErr(human, Lang.BATTLE_CHOOSE_ATTR)
|
|
|
- end
|
|
|
+ -- local nBattleType = BattleLogic_GetBattleType(human)
|
|
|
+ -- local attrAddData = getBattleAttrByType(human, nBattleType)
|
|
|
+ -- if attrAddData and attrAddData.unSelectedAttrList then
|
|
|
+ -- return Broadcast.sendErr(human, Lang.BATTLE_CHOOSE_ATTR)
|
|
|
+ -- end
|
|
|
|
|
|
|
|
|
local config = tBattleConfig.node[battleID]
|
|
|
@@ -2740,30 +2723,30 @@ function onFightEnd(human, result, fightTypeID, param1, combatInfo)
|
|
|
|
|
|
|
|
|
--肉鸽属性加成判断
|
|
|
- local nowStageCfg = tBattleConfig.node[battleID]
|
|
|
- if nowStageCfg.isRouge and type(nowStageCfg.isRouge) == "number" and nowStageCfg.isRouge == 1 then
|
|
|
- local attrAddData = getBattleAttrByType(human, nBattleType)
|
|
|
- local totalWeight, randList = generateCfgWeightInfo()
|
|
|
-
|
|
|
- local msgRet = Msg.gc.GC_GETCHOOSEATTR_INFO
|
|
|
- msgRet.attrInfo[0] = 3
|
|
|
- for i=1, 3 do
|
|
|
- local id = getIndexByRand(totalWeight, randList)
|
|
|
- local cfg = battleRougeCfg[id]
|
|
|
- attrAddData.unSelectedAttrList = attrAddData.unSelectedAttrList or {}
|
|
|
- attrAddData.unSelectedAttrList[id] = cfg.lv
|
|
|
-
|
|
|
- msgRet.attrInfo[i].name = cfg.name
|
|
|
- msgRet.attrInfo[i].id = id
|
|
|
- msgRet.attrInfo[i].quality = cfg.quality
|
|
|
- msgRet.attrInfo[i].level = cfg.lv
|
|
|
- msgRet.attrInfo[i].attr.key = cfg.attrs[1]
|
|
|
- msgRet.attrInfo[i].attr.value = cfg.attrs[2]
|
|
|
- end
|
|
|
+ -- local nowStageCfg = tBattleConfig.node[battleID]
|
|
|
+ -- if nowStageCfg.isRouge and type(nowStageCfg.isRouge) == "number" and nowStageCfg.isRouge == 1 then
|
|
|
+ -- local attrAddData = getBattleAttrByType(human, nBattleType)
|
|
|
+ -- local totalWeight, randList = generateCfgWeightInfo()
|
|
|
+
|
|
|
+ -- local msgRet = Msg.gc.GC_GETCHOOSEATTR_INFO
|
|
|
+ -- msgRet.attrInfo[0] = 3
|
|
|
+ -- for i=1, 3 do
|
|
|
+ -- local id = getIndexByRand(totalWeight, randList)
|
|
|
+ -- local cfg = battleRougeCfg[id]
|
|
|
+ -- attrAddData.unSelectedAttrList = attrAddData.unSelectedAttrList or {}
|
|
|
+ -- attrAddData.unSelectedAttrList[id] = cfg.lv
|
|
|
+
|
|
|
+ -- msgRet.attrInfo[i].name = cfg.name
|
|
|
+ -- msgRet.attrInfo[i].id = id
|
|
|
+ -- msgRet.attrInfo[i].quality = cfg.quality
|
|
|
+ -- msgRet.attrInfo[i].level = cfg.lv
|
|
|
+ -- msgRet.attrInfo[i].attr.key = cfg.attrs[1]
|
|
|
+ -- msgRet.attrInfo[i].attr.value = cfg.attrs[2]
|
|
|
+ -- end
|
|
|
|
|
|
- Grid.makeItem(msgRet.refreshCost, ItemDefine.ITEM_ZUANSHI_ID, 100)
|
|
|
- Msg.send(msgRet, human.fd)
|
|
|
- end
|
|
|
+ -- Grid.makeItem(msgRet.refreshCost, ItemDefine.ITEM_ZUANSHI_ID, 100)
|
|
|
+ -- Msg.send(msgRet, human.fd)
|
|
|
+ -- end
|
|
|
end
|
|
|
|
|
|
function setBattleID(human, guajiID)
|
|
|
@@ -3992,6 +3975,19 @@ function BattleLogic_AddMopup(human, nGoodsID, nGoodsNum)
|
|
|
..human.db.name.." nAddNum ="..nGoodsNum)
|
|
|
end
|
|
|
|
|
|
+--获取某个模式的通关层数
|
|
|
+function GetLevelByType(human, battleType)
|
|
|
+ if EliteDefine.COPY_ELITE_NORMAL == battleType then
|
|
|
+ return human.db.guajiID
|
|
|
+ elseif EliteDefine.COPY_LEVEL_ELITE == battleType then
|
|
|
+ return human.db.guajiID_elite
|
|
|
+ elseif EliteDefine.COPY_ELITE_DIFFICULTY == battleType then
|
|
|
+ return human.db.guajiID_hard
|
|
|
+ else
|
|
|
+ return -1
|
|
|
+ end
|
|
|
+end
|
|
|
+
|
|
|
|
|
|
--获取小游戏奖励
|
|
|
function GetGameReward(human, indexStr)
|