|
|
@@ -1070,17 +1070,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
|
|
|
@@ -2531,28 +2531,28 @@ end
|
|
|
|
|
|
|
|
|
--处理战斗前属性加成
|
|
|
--- function onFightBegin(human, cbParam, combatType, param)
|
|
|
--- local nBattleType = BattleLogic_GetBattleType(human)
|
|
|
--- local attrAddData = getBattleAttrByType(human, nBattleType)
|
|
|
+function onFightBegin(human, cbParam, combatType, param)
|
|
|
+ local nBattleType = BattleLogic_GetBattleType(human)
|
|
|
+ local attrAddData = getBattleAttrByType(human, nBattleType)
|
|
|
|
|
|
--- if not attrAddData or not attrAddData.chosenAttrList then
|
|
|
--- return
|
|
|
--- end
|
|
|
+ if not attrAddData or not attrAddData.chosenAttrList then
|
|
|
+ return
|
|
|
+ end
|
|
|
|
|
|
--- local attrList = calcAttr(attrAddData.chosenAttrList)
|
|
|
+ local attrList = calcAttr(attrAddData.chosenAttrList)
|
|
|
|
|
|
--- for index = 1, CombatDefine.COMBAT_HERO_CNT do
|
|
|
--- local atkPos = CombatLogic.getPos(CombatDefine.ATTACK_SIDE, index)
|
|
|
--- local atkObj = CombatImpl.objList[atkPos]
|
|
|
+ for index = 1, CombatDefine.COMBAT_HERO_CNT do
|
|
|
+ local atkPos = CombatLogic.getPos(CombatDefine.ATTACK_SIDE, index)
|
|
|
+ local atkObj = CombatImpl.objList[atkPos]
|
|
|
|
|
|
--- if atkObj then
|
|
|
--- for attrId, attrVal in pairs(attrList) do
|
|
|
--- atkObj.sysAttr[attrId] = (atkObj.sysAttr[attrId] or 0) + attrVal
|
|
|
--- end
|
|
|
--- atkObj.isSysAttrChange = true
|
|
|
--- end
|
|
|
--- end
|
|
|
--- end
|
|
|
+ if atkObj then
|
|
|
+ for attrId, attrVal in pairs(attrList) do
|
|
|
+ atkObj.sysAttr[attrId] = (atkObj.sysAttr[attrId] or 0) + attrVal
|
|
|
+ end
|
|
|
+ atkObj.isSysAttrChange = true
|
|
|
+ end
|
|
|
+ end
|
|
|
+end
|
|
|
|
|
|
|
|
|
|
|
|
@@ -2588,11 +2588,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]
|
|
|
@@ -2802,22 +2802,35 @@ 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()
|
|
|
-
|
|
|
- -- if totalWeight > 0 then
|
|
|
- -- for i=1, 3 do
|
|
|
- -- local id = getIndexByRand(totalWeight, randList)
|
|
|
- -- -- local cfg = battleRougeCfg[id]
|
|
|
- -- attrAddData.unSelectedAttrList = attrAddData.unSelectedAttrList or {}
|
|
|
- -- -- attrAddData.unSelectedAttrList[id] = cfg.lv
|
|
|
- -- attrAddData.unSelectedAttrList[i] = id
|
|
|
- -- end
|
|
|
- -- QueryDiffBattleUnSelectAttr(human)
|
|
|
- -- end
|
|
|
- -- end
|
|
|
+ local nowStageCfg = tBattleConfig.node[battleID]
|
|
|
+ if nowStageCfg.isRouge and type(nowStageCfg.isRouge) == "number" and nowStageCfg.isRouge == 1 then
|
|
|
+ local attrAddData = getBattleAttrByType(human, nBattleType)
|
|
|
+
|
|
|
+ --需求修改: 普通模式第一次战斗获得肉鸽属性时为指定属性: 9,5,4
|
|
|
+ if not human.db.isBattleFirst and nBattleType == EliteDefine.COPY_ELITE_NORMAL and (not attrAddData.chosenAttrList or not next(attrAddData.chosenAttrList))
|
|
|
+ and battleRougeCfg[9] and battleRougeCfg[5] and battleRougeCfg[4] then
|
|
|
+ attrAddData.unSelectedAttrList = attrAddData.unSelectedAttrList or {}
|
|
|
+
|
|
|
+ attrAddData.unSelectedAttrList[1] = 9
|
|
|
+ attrAddData.unSelectedAttrList[2] = 5
|
|
|
+ attrAddData.unSelectedAttrList[3] = 4
|
|
|
+
|
|
|
+ human.db.isBattleFirst = true
|
|
|
+ else
|
|
|
+ local totalWeight, randList = generateCfgWeightInfo()
|
|
|
+ if totalWeight > 0 then
|
|
|
+ for i=1, 3 do
|
|
|
+ local id = getIndexByRand(totalWeight, randList)
|
|
|
+ -- local cfg = battleRougeCfg[id]
|
|
|
+ attrAddData.unSelectedAttrList = attrAddData.unSelectedAttrList or {}
|
|
|
+ -- attrAddData.unSelectedAttrList[id] = cfg.lv
|
|
|
+ attrAddData.unSelectedAttrList[i] = id
|
|
|
+ end
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
+ QueryDiffBattleUnSelectAttr(human)
|
|
|
+ end
|
|
|
|
|
|
if nBattleType == EliteDefine.COPY_ELITE_NORMAL then
|
|
|
TriggerLogic.PublishEvent(TriggerDefine.BATTLE_NORMAL_MODE_PASS, human.db._id, 1)
|
|
|
@@ -4291,12 +4304,14 @@ function ChooseAttr(human, idx)
|
|
|
if chosenAttrList[targetId].lv >= 4 then
|
|
|
local newId = getMaxQualityId(targetId)
|
|
|
|
|
|
- chosenAttrList[newId] = {
|
|
|
- lv = chosenAttrList[targetId].lv,
|
|
|
- cfgNum = chosenAttrList[targetId].cfgNum
|
|
|
- }
|
|
|
+ if newId ~= targetId then
|
|
|
+ chosenAttrList[newId] = {
|
|
|
+ lv = chosenAttrList[targetId].lv,
|
|
|
+ cfgNum = chosenAttrList[targetId].cfgNum
|
|
|
+ }
|
|
|
|
|
|
- chosenAttrList[targetId] = nil
|
|
|
+ chosenAttrList[targetId] = nil
|
|
|
+ end
|
|
|
end
|
|
|
else
|
|
|
chosenAttrList[id] = {
|