fix bug
This commit is contained in:
parent
c5cad480d7
commit
63e00b46bb
@ -44,8 +44,8 @@ function BattleBaseController:isUnlockedSkillElementType(elementType)
|
||||
return self.battleData:isUnlockedSkillElementType(elementType, self.curActionSide)
|
||||
end
|
||||
|
||||
function BattleBaseController:getSkillCount(skillId)
|
||||
return self.battleData:getSkillCount(skillId, self.curActionSide)
|
||||
function BattleBaseController:getSkillCount(skillId, side)
|
||||
return self.battleData:getSkillCount(skillId, side or self.curActionSide)
|
||||
end
|
||||
|
||||
function BattleBaseController:getSkillPool()
|
||||
@ -749,10 +749,11 @@ function BattleBaseController:initTimelyRouge()
|
||||
for _, skillId in ipairs(skillIds) do
|
||||
local cfg = SkillRogueCfg[skillId]
|
||||
if cfg.universal and cfg.universal == 3 then
|
||||
ModuleManager.BattleManager:onSelectSkill(skillId)
|
||||
self:onSelectSkill(skillId)
|
||||
end
|
||||
end
|
||||
end
|
||||
self.battleUI:refreshSkill(nil, nil, SIDE_ATK)
|
||||
end
|
||||
|
||||
function BattleBaseController:initAtkUnits(callback)
|
||||
@ -917,7 +918,6 @@ function BattleBaseController:battleStart()
|
||||
self.atkTeam:prepare()
|
||||
self.defTeam:prepare()
|
||||
self.isBattleStart = true
|
||||
self.battleUI:refreshSkill(nil, nil, SIDE_ATK)
|
||||
self.tickSid = BattleScheduler:scheduleGlobal(function(dt, originDt)
|
||||
self:_tick(dt, originDt)
|
||||
end, 0)
|
||||
@ -2530,7 +2530,7 @@ function BattleBaseController:dealSelectSkill(skillId, value, side, isSnapshot)
|
||||
side = side or self:getCurActionSide()
|
||||
local cfg = ConfigManager:getConfig("skill_rogue")
|
||||
local skillCfg = cfg[skillId]
|
||||
if skillCfg.limit_times and self:getSkillCount(skillId) >= skillCfg.limit_times then
|
||||
if skillCfg.limit_times and self:getSkillCount(skillId, side) >= skillCfg.limit_times then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
@ -1,6 +1,11 @@
|
||||
local BattleController = require "app/module/battle/controller/battle_controller"
|
||||
local BattleControllerDungeonGold = class("BattleControllerDungeonGold", BattleController)
|
||||
|
||||
local BattleBaseController = require "app/module/battle/controller/battle_base_controller"
|
||||
local BattleConst = GConst.BattleConst
|
||||
local SIDE_ATK = BattleConst.SIDE_ATK
|
||||
local SIDE_DEF = BattleConst.SIDE_DEF
|
||||
|
||||
function BattleControllerDungeonGold:getBoardConfig()
|
||||
return ConfigManager:getConfig("board_dungeon")
|
||||
end
|
||||
@ -16,6 +21,25 @@ function BattleControllerDungeonGold:getChapterId()
|
||||
return self._chapterId
|
||||
end
|
||||
|
||||
function BattleControllerDungeonGold:onLoadComplete(...)
|
||||
-- 处理技能
|
||||
local unlockAllSkill = function(side)
|
||||
local skillPool = self.battleData:getSkillPool(side)
|
||||
if skillPool then
|
||||
for elementType, list in pairs(skillPool) do -- 先遍历一下未解锁的技能
|
||||
for _, skillId in ipairs(list) do
|
||||
self:dealSelectSkill(skillId, nil, side)
|
||||
end
|
||||
end
|
||||
self.battleUI:refreshSkill(nil, nil, side)
|
||||
end
|
||||
end
|
||||
unlockAllSkill(SIDE_ATK)
|
||||
unlockAllSkill(SIDE_DEF)
|
||||
|
||||
BattleBaseController.onLoadComplete(self, ...)
|
||||
end
|
||||
|
||||
function BattleControllerDungeonGold:refreshWave()
|
||||
end
|
||||
|
||||
|
||||
@ -57,6 +57,9 @@ function BattleControllerPVP:getMaxRoundCount()
|
||||
return 1
|
||||
end
|
||||
|
||||
function BattleControllerPVP:initTimelyRouge()
|
||||
end
|
||||
|
||||
-- *************各个子模块的战斗需要重写的方法 END*************
|
||||
|
||||
function BattleControllerPVP:ctor()
|
||||
@ -100,18 +103,18 @@ function BattleControllerPVP:onLoadComplete(...)
|
||||
local skillPool = self.battleData:getSkillPool(side)
|
||||
if skillPool then
|
||||
for elementType, list in pairs(skillPool) do -- 先遍历一下未解锁的技能
|
||||
if not self.battleData:isUnlockedSkillElementType(elementType, side) then
|
||||
local skillEntity = self.battleData:getSkillEntityByElement(elementType, side)
|
||||
if skillEntity then
|
||||
local skillId = skillEntity:getUnlockId()
|
||||
if skillId then
|
||||
self:dealSelectSkill(skillId, nil, side)
|
||||
end
|
||||
end
|
||||
-- if not self.battleData:isUnlockedSkillElementType(elementType, side) then
|
||||
-- local skillEntity = self.battleData:getSkillEntityByElement(elementType, side)
|
||||
-- if skillEntity then
|
||||
-- local skillId = skillEntity:getUnlockId()
|
||||
-- if skillId then
|
||||
-- self:dealSelectSkill(skillId, nil, side)
|
||||
-- end
|
||||
-- end
|
||||
for _, skillId in ipairs(list) do
|
||||
self:dealSelectSkill(skillId, nil, side)
|
||||
end
|
||||
end
|
||||
-- end
|
||||
end
|
||||
self.battleUI:refreshSkill(nil, nil, side)
|
||||
end
|
||||
|
||||
@ -53,6 +53,10 @@ end
|
||||
|
||||
-- 请求挑战金币副本
|
||||
function DungeonManager:onDungeonStartReq(id)
|
||||
if not DataManager.FormationData:formationIsFull(GConst.BattleConst.FORMATION_TYPE.STAGE) then
|
||||
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_8))
|
||||
return
|
||||
end
|
||||
local params = {
|
||||
id = id,
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@ end
|
||||
function BattleBoardSkillTips:ctor(params)
|
||||
self.params = params
|
||||
self.heroEntity = params.heroEntity
|
||||
self.battleController = params.battleController
|
||||
self.battleData = params.battleController.battleData
|
||||
self.side = params.side
|
||||
self.boardSkillEntity = self.battleData:getSkillEntityByElement(self.heroEntity:getMatchType())
|
||||
|
||||
@ -93,7 +93,11 @@ function SkillTips:refreshSkillDesc()
|
||||
if self.skillId then
|
||||
self.txDesc:setActive(true)
|
||||
self.txDesc:setSizeDeltaX(width - 20)
|
||||
self.txDesc:setText(ModuleManager.HeroManager:getSkillRogueDesc(self.skillId))
|
||||
local str = ModuleManager.HeroManager:getSkillRogueDesc2(self.skillId)
|
||||
if EDITOR_MODE then
|
||||
str = str .. "\n<color=#FF5050>技能ID:" .. self.skillId .. "</color>"
|
||||
end
|
||||
self.txDesc:setText(str)
|
||||
|
||||
local txMeshPro = self.txDesc:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO)
|
||||
txMeshPro:ForceMeshUpdate()
|
||||
|
||||
@ -182,17 +182,15 @@ function BattleBaseData:setTimeSpeed(timeSpeed, timeScale)
|
||||
self.data.timeSpeed = timeSpeed
|
||||
end
|
||||
|
||||
-- function BattleBaseData:getActiveRogueSkills(heroEntity)
|
||||
-- return heroEntity:getActiveRogueSkills()
|
||||
-- end
|
||||
|
||||
function BattleBaseData:initRogueSkills(side, formation)
|
||||
if not self.skillPool then
|
||||
self.skillPool = {}
|
||||
self.skillMap = {}
|
||||
end
|
||||
if not self.skillPool[side] then
|
||||
self.skillPool[side] = {}
|
||||
end
|
||||
if not self.skillMap[side] then
|
||||
self.skillMap[side] = {}
|
||||
end
|
||||
self.skillPool = self.skillPool or {}
|
||||
self.skillMap = self.skillMap or {}
|
||||
self.skillPool[side] = self.skillPool[side] or {}
|
||||
self.skillMap[side] = self.skillMap[side] or {}
|
||||
|
||||
if not formation then
|
||||
return
|
||||
|
||||
@ -80,6 +80,11 @@ function HeroEntity:_updateAllAttr()
|
||||
self.allAttr[k] = v
|
||||
end
|
||||
|
||||
-- 装备
|
||||
local equipAttr = DataManager.EquipData:getEquipAttrBySlotId(self.cfgId, self:getMatchType())
|
||||
for k, v in pairs(equipAttr) do
|
||||
self.allAttr[k] = (self.allAttr[k] or 0) + v
|
||||
end
|
||||
-- GConst.ALL_ATTR = {
|
||||
-- ATTR_ATK_ALL = "atk_all", -- 全体英雄攻击(固定值)
|
||||
-- ATTR_HP_ALL = "attr_hp_all", -- 全体英雄生命(固定值)
|
||||
@ -110,7 +115,8 @@ function HeroEntity:_updateAllAttr()
|
||||
local atkType = GConst.MATCH_ATTACK_NAME[self:getMatchType()]
|
||||
-- 全局增加攻击力
|
||||
local allAtk = self:getGlobalAttrByType(GConst.ATTR_ALL.ATTR_ATK_ALL)
|
||||
local atk = self.allAttr[atkType] + allAtk
|
||||
local persionalAtk = self.allAttr[GConst.ATTR_PERSIONAL.ATTR_ATK] or 0
|
||||
local atk = self.allAttr[atkType] + allAtk + persionalAtk
|
||||
-- 全局元素攻击力百分比加成
|
||||
local allFactorValue = self:getGlobalAttrByType(GConst.MATCH_ALL_ATKP_NAME[self:getMatchType()])
|
||||
-- 个人攻击力百分比加成
|
||||
@ -124,7 +130,8 @@ function HeroEntity:_updateAllAttr()
|
||||
local hpType = GConst.MATCH_HP_NAME[self:getMatchType()]
|
||||
-- 全局增加生命
|
||||
local allHp = self:getGlobalAttrByType(GConst.ATTR_ALL.ATTR_HP_ALL)
|
||||
local hp = self.allAttr[hpType] + allHp
|
||||
local persionalHp = self.allAttr[GConst.ATTR_PERSIONAL.ATTR_HP] or 0
|
||||
local hp = self.allAttr[hpType] + allHp + persionalHp
|
||||
-- 全局元素生命百分比加成
|
||||
local allFactorValue = self:getGlobalAttrByType(GConst.MATCH_ALL_HPP_NAME[self:getMatchType()])
|
||||
-- 个人生命百分比加成
|
||||
@ -137,8 +144,8 @@ function HeroEntity:_updateAllAttr()
|
||||
self.allAttr[ATTR_NAME.DMGDEC] = (self.allAttr[ATTR_NAME.DMGDEC] or 0) + self:getGlobalAttrByType(GConst.ATTR_ALL.ATTR_DMGDEC_ALL)
|
||||
self.allAttr[GConst.MATCH_CRIT_NAME[self:getMatchType()]] = (self.allAttr[GConst.MATCH_CRIT_NAME[self:getMatchType()]] or 0) + self:getGlobalAttrByType(GConst.ATTR_ALL.ATTR_CRIT_ALL)
|
||||
self.allAttr[GConst.MATCH_CRIT_TIME_NAME[self:getMatchType()]] = (self.allAttr[GConst.MATCH_CRIT_TIME_NAME[self:getMatchType()]] or 0) + self:getGlobalAttrByType(GConst.ATTR_ALL.ATTR_CRIT_TIME_ALL)
|
||||
self.allAttr[GConst.MATCH_NORMAL_HURTP_NAME[self:getMatchType()]] = (self.allAttr[GConst.MATCH_NORMAL_HURTP_NAME[self:getMatchType()]] or 0) + self:getGlobalAttrByType(GConst.ATTR_ALL.ATTR_NORMAL_HURTP_ALL)
|
||||
self.allAttr[GConst.MATCH_SKILL_HURTP_NAME[self:getMatchType()]] = (self.allAttr[GConst.MATCH_SKILL_HURTP_NAME[self:getMatchType()]] or 0) + self:getGlobalAttrByType(GConst.ATTR_ALL.ATTR_SKILL_HURTP_ALL)
|
||||
self.allAttr[GConst.MATCH_NORMAL_HURTP_NAME[self:getMatchType()]] = (self.allAttr[GConst.MATCH_NORMAL_HURTP_NAME[self:getMatchType()]] or 0) + self:getGlobalAttrByType(GConst.ATTR_ALL.ATTR_NORMAL_HURTP_ALL) + self:getGlobalAttrByType(GConst.ATTR_PERSIONAL.ATTR_NORMAL_HURTP)
|
||||
self.allAttr[GConst.MATCH_SKILL_HURTP_NAME[self:getMatchType()]] = (self.allAttr[GConst.MATCH_SKILL_HURTP_NAME[self:getMatchType()]] or 0) + self:getGlobalAttrByType(GConst.ATTR_ALL.ATTR_SKILL_HURTP_ALL) + self:getGlobalAttrByType(GConst.ATTR_PERSIONAL.ATTR_SKILL_HURTP)
|
||||
|
||||
self:calcPower()
|
||||
end
|
||||
@ -330,7 +337,6 @@ function HeroEntity:setLv(lv, onlyChangeLv)
|
||||
return
|
||||
end
|
||||
self.isNew = lv == 1
|
||||
self.oldLv = self.data.lv
|
||||
self.data.lv = lv
|
||||
self:_updateAllBaseAttr()
|
||||
self:setDirty()
|
||||
@ -607,7 +613,7 @@ function HeroEntity:getUnlockRogueId()
|
||||
end
|
||||
|
||||
function HeroEntity:checkSkillUnlock()
|
||||
if not self.oldLv then
|
||||
if not self.oldStar then
|
||||
return false
|
||||
end
|
||||
local needPop = false
|
||||
@ -617,7 +623,7 @@ function HeroEntity:checkSkillUnlock()
|
||||
local ids = self.config["rouge_skill_" .. i]
|
||||
if ids then
|
||||
for ii = #ids, 1, -1 do
|
||||
if self.data.lv >= ids[ii][1] and self.oldLv < ids[ii][1] then
|
||||
if self.data.star >= ids[ii][1] and self.oldStar < ids[ii][1] then
|
||||
skillIdx = i
|
||||
needPop = true
|
||||
isUnlock = ii == 1
|
||||
@ -631,7 +637,7 @@ function HeroEntity:checkSkillUnlock()
|
||||
break
|
||||
end
|
||||
end
|
||||
self.oldLv = nil
|
||||
self.oldStar = nil
|
||||
return needPop, isUnlock, skillIdx
|
||||
end
|
||||
|
||||
@ -658,6 +664,26 @@ function HeroEntity:getRogueSkillList()
|
||||
return self.rogueSkillList
|
||||
end
|
||||
|
||||
function HeroEntity:getUnlockSkillIdx(checkUp)
|
||||
if not checkUp then
|
||||
return
|
||||
end
|
||||
local count = 1
|
||||
while true do
|
||||
local ids = self.config["rouge_skill_" .. count]
|
||||
if ids then
|
||||
for i = #ids, 1, -1 do
|
||||
if self.data.star == ids[i][1] then
|
||||
return count
|
||||
end
|
||||
end
|
||||
else
|
||||
break
|
||||
end
|
||||
count = count + 1
|
||||
end
|
||||
end
|
||||
|
||||
function HeroEntity:getRogueSkillListBattle()
|
||||
if not self.rogueSkillListBattle then
|
||||
self.rogueSkillListBattle = {}
|
||||
@ -775,6 +801,7 @@ function HeroEntity:canStarUp(showToast)
|
||||
end
|
||||
|
||||
function HeroEntity:onHeroStarUp()
|
||||
self.oldStar = self.data.star
|
||||
self.data.star = self.data.star + 1
|
||||
self:setBaseAttrDirty()
|
||||
self:setDirty()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user