特殊天赋
This commit is contained in:
parent
d8a9bc459d
commit
9e99bea561
@ -508,6 +508,7 @@ end
|
||||
|
||||
function BattleBaseController:ctor()
|
||||
self.battleData = DataManager.BattleData
|
||||
self.talentSelectCount = DataManager.TalentData:getSelectSkillBegin()
|
||||
end
|
||||
|
||||
function BattleBaseController:init(params, snapshot)
|
||||
@ -1149,6 +1150,12 @@ function BattleBaseController:enterElimination(needDelay)
|
||||
return
|
||||
end
|
||||
|
||||
if self.talentSelectCount > 0 then
|
||||
self.talentSelectCount = self.talentSelectCount - 1
|
||||
self:tryShowSelectSkillComp(needDelay)
|
||||
return
|
||||
end
|
||||
|
||||
self.battleUI:hideAllBoardSfxs()
|
||||
|
||||
-- 检查棋盘
|
||||
@ -3146,7 +3153,8 @@ function BattleBaseController:addBattleExp(exp)
|
||||
if not self.battleData or not exp then
|
||||
return
|
||||
end
|
||||
self.battleData:addExp(exp)
|
||||
local expAdd = DataManager.TalentData:getExpAdd()
|
||||
self.battleData:addExp(exp * (1 + expAdd / BattleConst.DEFAULT_FACTOR))
|
||||
end
|
||||
|
||||
function BattleBaseController:addTaskProgress(fieldName, count)
|
||||
|
||||
@ -196,6 +196,7 @@ function BattleTeam:onRoundEnd()
|
||||
end
|
||||
self:doBuffWork()
|
||||
self:doFinalBuffWork()
|
||||
self:doTalentHpRestore()
|
||||
self.comboCount = 0
|
||||
if self:getMainUnit():isInitState() then
|
||||
return
|
||||
@ -203,6 +204,13 @@ function BattleTeam:onRoundEnd()
|
||||
self:getMainUnit():changeState(BattleConst.UNIT_STATE.IDLE)
|
||||
end
|
||||
|
||||
function BattleTeam:doTalentHpRestore()
|
||||
local hp = DataManager.TalentData:getHpRestore()
|
||||
if hp > 0 then
|
||||
self.mainUnit:takeDamageOrCure(self.mainUnit, hp // BattleConst.DEFAULT_FACTOR, BattleConst.EFFECT_TYPE.HEAL, 0)
|
||||
end
|
||||
end
|
||||
|
||||
function BattleTeam:addShield(buffEffect)
|
||||
if buffEffect then
|
||||
table.insert(self.shieldBuffList, buffEffect)
|
||||
|
||||
@ -117,7 +117,7 @@ function BattlePauseUI:_refreshScrollRect()
|
||||
valueStr = ModuleManager.HeroManager:getSkillRogueDesc(skillId, value)
|
||||
end
|
||||
if EDITOR_MODE then
|
||||
valueStr = valueStr .. skillId
|
||||
valueStr = valueStr .. "\n" .. skillId
|
||||
end
|
||||
ModuleManager.TipsManager:showDescTips(valueStr, cell:getBaseObject())
|
||||
end)
|
||||
|
||||
@ -78,9 +78,10 @@ function BattleSkillSelectComp:refreshBtns()
|
||||
uiMap["battle_select_skill_comp.skill_node.diamond_btn.tx"]:setText(GFunc.getRewardNum(GFunc.getConstReward("refresh_skill_cost")))
|
||||
|
||||
local battleController = ModuleManager.BattleManager.battleController
|
||||
local talentCount = DataManager.TalentData:getSkillRefreshCount()
|
||||
local cfgAdCount = GFunc.getConstIntValue("ad_refresh_skill")
|
||||
local cfgRefreshCount = GFunc.getConstIntValue("diamond_refresh_skill") + cfgAdCount
|
||||
local adCount = battleController.battleData:getADRefreshSkillCount()
|
||||
local cfgRefreshCount = GFunc.getConstIntValue("diamond_refresh_skill") + cfgAdCount + talentCount
|
||||
local adCount = battleController.battleData:getADRefreshSkillCount() + talentCount
|
||||
local refreshCount =battleController.battleData:getRefreshSkillCount()
|
||||
local showAdBtn = cfgAdCount > adCount
|
||||
uiMap["battle_select_skill_comp.skill_node.ad_btn"]:setActive(showAdBtn)
|
||||
|
||||
@ -711,6 +711,7 @@ function BattleBaseData:setMaxBattleLv(maxLv)
|
||||
end
|
||||
|
||||
function BattleBaseData:addExp(exp)
|
||||
exp = math.floor(exp + 0.0000001)
|
||||
self.curBattleExp = self.curBattleExp + exp
|
||||
while self.curBattleExp >= self.needBattleExp do
|
||||
if self.maxBattleLv then -- 超过最大等级后跳出
|
||||
|
||||
@ -3,6 +3,12 @@ local TalentData = class("TalentData", BaseData)
|
||||
local TalentCfg = ConfigManager:getConfig("talent")
|
||||
local PlayerExpCfg = ConfigManager:getConfig("player_exp")
|
||||
|
||||
local SKILL_REFESH_ID = 9
|
||||
local HP_RESTORE_ID = 10
|
||||
local SELECT_SKILL_ID = 11
|
||||
local ICON_ADD_ID = 12
|
||||
local EXP_ADD_ID = 16
|
||||
|
||||
function TalentData:setDirty()
|
||||
self.data.isDirty = not self.data.isDirty
|
||||
end
|
||||
@ -148,4 +154,37 @@ function TalentData:_updateAllAttr()
|
||||
return self.allAttr
|
||||
end
|
||||
--@endregion
|
||||
|
||||
--@region 获取特殊天赋属性
|
||||
function TalentData:getSkillRefreshCount()
|
||||
local lv = self:getLevels(SKILL_REFESH_ID)
|
||||
local cfg = TalentCfg[SKILL_REFESH_ID]
|
||||
return lv * (cfg.value or 0)
|
||||
end
|
||||
|
||||
function TalentData:getHpRestore()
|
||||
local lv = self:getLevels(HP_RESTORE_ID)
|
||||
local cfg = TalentCfg[HP_RESTORE_ID]
|
||||
return lv * (cfg.value or 0)
|
||||
end
|
||||
|
||||
function TalentData:getSelectSkillBegin()
|
||||
local lv = self:getLevels(SELECT_SKILL_ID)
|
||||
local cfg = TalentCfg[SELECT_SKILL_ID]
|
||||
return lv * (cfg.value or 0)
|
||||
end
|
||||
|
||||
function TalentData:getIconAdd()
|
||||
local lv = self:getLevels(ICON_ADD_ID)
|
||||
local cfg = TalentCfg[ICON_ADD_ID]
|
||||
return lv * (cfg.value or 0)
|
||||
end
|
||||
|
||||
function TalentData:getExpAdd()
|
||||
local lv = self:getLevels(EXP_ADD_ID)
|
||||
lv = 1
|
||||
local cfg = TalentCfg[EXP_ADD_ID]
|
||||
return lv * (cfg.value or 0)
|
||||
end
|
||||
--@endregion
|
||||
return TalentData
|
||||
Loading…
x
Reference in New Issue
Block a user