特殊天赋

This commit is contained in:
puxuan 2025-10-17 16:12:49 +08:00
parent d8a9bc459d
commit 9e99bea561
6 changed files with 61 additions and 4 deletions

View File

@ -508,6 +508,7 @@ end
function BattleBaseController:ctor() function BattleBaseController:ctor()
self.battleData = DataManager.BattleData self.battleData = DataManager.BattleData
self.talentSelectCount = DataManager.TalentData:getSelectSkillBegin()
end end
function BattleBaseController:init(params, snapshot) function BattleBaseController:init(params, snapshot)
@ -1149,6 +1150,12 @@ function BattleBaseController:enterElimination(needDelay)
return return
end end
if self.talentSelectCount > 0 then
self.talentSelectCount = self.talentSelectCount - 1
self:tryShowSelectSkillComp(needDelay)
return
end
self.battleUI:hideAllBoardSfxs() self.battleUI:hideAllBoardSfxs()
-- 检查棋盘 -- 检查棋盘
@ -3146,7 +3153,8 @@ function BattleBaseController:addBattleExp(exp)
if not self.battleData or not exp then if not self.battleData or not exp then
return return
end end
self.battleData:addExp(exp) local expAdd = DataManager.TalentData:getExpAdd()
self.battleData:addExp(exp * (1 + expAdd / BattleConst.DEFAULT_FACTOR))
end end
function BattleBaseController:addTaskProgress(fieldName, count) function BattleBaseController:addTaskProgress(fieldName, count)

View File

@ -196,6 +196,7 @@ function BattleTeam:onRoundEnd()
end end
self:doBuffWork() self:doBuffWork()
self:doFinalBuffWork() self:doFinalBuffWork()
self:doTalentHpRestore()
self.comboCount = 0 self.comboCount = 0
if self:getMainUnit():isInitState() then if self:getMainUnit():isInitState() then
return return
@ -203,6 +204,13 @@ function BattleTeam:onRoundEnd()
self:getMainUnit():changeState(BattleConst.UNIT_STATE.IDLE) self:getMainUnit():changeState(BattleConst.UNIT_STATE.IDLE)
end 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) function BattleTeam:addShield(buffEffect)
if buffEffect then if buffEffect then
table.insert(self.shieldBuffList, buffEffect) table.insert(self.shieldBuffList, buffEffect)

View File

@ -117,7 +117,7 @@ function BattlePauseUI:_refreshScrollRect()
valueStr = ModuleManager.HeroManager:getSkillRogueDesc(skillId, value) valueStr = ModuleManager.HeroManager:getSkillRogueDesc(skillId, value)
end end
if EDITOR_MODE then if EDITOR_MODE then
valueStr = valueStr .. skillId valueStr = valueStr .. "\n" .. skillId
end end
ModuleManager.TipsManager:showDescTips(valueStr, cell:getBaseObject()) ModuleManager.TipsManager:showDescTips(valueStr, cell:getBaseObject())
end) end)

View File

@ -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"))) uiMap["battle_select_skill_comp.skill_node.diamond_btn.tx"]:setText(GFunc.getRewardNum(GFunc.getConstReward("refresh_skill_cost")))
local battleController = ModuleManager.BattleManager.battleController local battleController = ModuleManager.BattleManager.battleController
local talentCount = DataManager.TalentData:getSkillRefreshCount()
local cfgAdCount = GFunc.getConstIntValue("ad_refresh_skill") local cfgAdCount = GFunc.getConstIntValue("ad_refresh_skill")
local cfgRefreshCount = GFunc.getConstIntValue("diamond_refresh_skill") + cfgAdCount local cfgRefreshCount = GFunc.getConstIntValue("diamond_refresh_skill") + cfgAdCount + talentCount
local adCount = battleController.battleData:getADRefreshSkillCount() local adCount = battleController.battleData:getADRefreshSkillCount() + talentCount
local refreshCount =battleController.battleData:getRefreshSkillCount() local refreshCount =battleController.battleData:getRefreshSkillCount()
local showAdBtn = cfgAdCount > adCount local showAdBtn = cfgAdCount > adCount
uiMap["battle_select_skill_comp.skill_node.ad_btn"]:setActive(showAdBtn) uiMap["battle_select_skill_comp.skill_node.ad_btn"]:setActive(showAdBtn)

View File

@ -711,6 +711,7 @@ function BattleBaseData:setMaxBattleLv(maxLv)
end end
function BattleBaseData:addExp(exp) function BattleBaseData:addExp(exp)
exp = math.floor(exp + 0.0000001)
self.curBattleExp = self.curBattleExp + exp self.curBattleExp = self.curBattleExp + exp
while self.curBattleExp >= self.needBattleExp do while self.curBattleExp >= self.needBattleExp do
if self.maxBattleLv then -- 超过最大等级后跳出 if self.maxBattleLv then -- 超过最大等级后跳出

View File

@ -3,6 +3,12 @@ local TalentData = class("TalentData", BaseData)
local TalentCfg = ConfigManager:getConfig("talent") local TalentCfg = ConfigManager:getConfig("talent")
local PlayerExpCfg = ConfigManager:getConfig("player_exp") 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() function TalentData:setDirty()
self.data.isDirty = not self.data.isDirty self.data.isDirty = not self.data.isDirty
end end
@ -148,4 +154,37 @@ function TalentData:_updateAllAttr()
return self.allAttr return self.allAttr
end end
--@endregion --@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 return TalentData