This commit is contained in:
xiekaidong 2023-04-18 22:26:25 +08:00
commit 64b4a0962c
15 changed files with 4026 additions and 4093 deletions

View File

@ -182,6 +182,10 @@ local buff = {
} }
}, },
[33]={ [33]={
["name"]="heal_normal_attack",
["buff_type"]=1
},
[34]={
["name"]="stun", ["name"]="stun",
["buff_type"]=8, ["buff_type"]=8,
["icon"]="stun", ["icon"]="stun",
@ -189,60 +193,60 @@ local buff = {
4001 4001
} }
}, },
[34]={ [35]={
["name"]="shield", ["name"]="shield",
["buff_type"]=2, ["buff_type"]=2,
["fx_continued"]={ ["fx_continued"]={
4001 4001
} }
}, },
[35]={ [36]={
["name"]="atkp_add", ["name"]="atkp_add",
["buff_type"]=1 ["buff_type"]=1
}, },
[36]={ [37]={
["name"]="normal_attack_dec", ["name"]="normal_attack_dec",
["buff_type"]=1, ["buff_type"]=1,
["fx_continued"]={ ["fx_continued"]={
4001 4001
} }
}, },
[37]={ [38]={
["name"]="normal_attack_add", ["name"]="normal_attack_add",
["buff_type"]=1, ["buff_type"]=1,
["fx_continued"]={ ["fx_continued"]={
4001 4001
} }
}, },
[38]={ [39]={
["name"]="block", ["name"]="block",
["buff_type"]=1 ["buff_type"]=1
}, },
[39]={ [40]={
["name"]="hpp_add", ["name"]="hpp_add",
["buff_type"]=1 ["buff_type"]=1
}, },
[40]={ [41]={
["name"]="crit_add", ["name"]="crit_add",
["buff_type"]=1 ["buff_type"]=1
}, },
[41]={ [42]={
["name"]="crit_time_add", ["name"]="crit_time_add",
["buff_type"]=1 ["buff_type"]=1
}, },
[42]={ [43]={
["name"]="exp_time_add", ["name"]="exp_time_add",
["buff_type"]=7 ["buff_type"]=7
}, },
[43]={ [44]={
["name"]="cured_add", ["name"]="cured_add",
["buff_type"]=1 ["buff_type"]=1
}, },
[44]={ [45]={
["name"]="add_skill", ["name"]="add_skill",
["buff_type"]=7 ["buff_type"]=7
}, },
[45]={ [46]={
["name"]="skill_fire_times", ["name"]="skill_fire_times",
["buff_type"]=7 ["buff_type"]=7
} }
@ -281,24 +285,25 @@ local keys = {
["atkp_purple_add"]=buff[30], ["atkp_purple_add"]=buff[30],
["wavehealp"]=buff[31], ["wavehealp"]=buff[31],
["heal"]=buff[32], ["heal"]=buff[32],
["stun"]=buff[33], ["heal_normal_attack"]=buff[33],
["shield"]=buff[34], ["stun"]=buff[34],
["atkp_add"]=buff[35], ["shield"]=buff[35],
["normal_attack_dec"]=buff[36], ["atkp_add"]=buff[36],
["normal_attack_add"]=buff[37], ["normal_attack_dec"]=buff[37],
["block"]=buff[38], ["normal_attack_add"]=buff[38],
["hpp_add"]=buff[39], ["block"]=buff[39],
["crit_add"]=buff[40], ["hpp_add"]=buff[40],
["crit_time_add"]=buff[41], ["crit_add"]=buff[41],
["exp_time_add"]=buff[42], ["crit_time_add"]=buff[42],
["cured_add"]=buff[43], ["exp_time_add"]=buff[43],
["add_skill"]=buff[44], ["cured_add"]=buff[44],
["skill_fire_times"]=buff[45] ["add_skill"]=buff[45],
["skill_fire_times"]=buff[46]
} }
} }
local config = { local config = {
data=buff, data=buff,
keys=keys, keys=keys,
count=45 count=46
} }
return config return config

File diff suppressed because it is too large Load Diff

View File

@ -11,21 +11,21 @@ local hero = {
["rouge_skill_3"]=200503, ["rouge_skill_3"]=200503,
["begin_lv"]=1, ["begin_lv"]=1,
["hp"]={ ["hp"]={
1000000,
1100000,
1200000,
1300000,
1400000,
1500000,
1600000,
1700000,
1800000,
1900000,
2000000, 2000000,
2100000, 2100000,
2200000, 2200000,
2300000, 2300000,
2400000 2400000,
2500000,
2600000,
2700000,
2800000,
2900000,
3000000,
3100000,
3200000,
3300000,
3400000
}, },
["atk"]={ ["atk"]={
1000000, 1000000,
@ -60,21 +60,21 @@ local hero = {
["rouge_skill_3"]=200203, ["rouge_skill_3"]=200203,
["begin_lv"]=1, ["begin_lv"]=1,
["hp"]={ ["hp"]={
1000000,
1100000,
1200000,
1300000,
1400000,
1500000,
1600000,
1700000,
1800000,
1900000,
2000000, 2000000,
2100000, 2100000,
2200000, 2200000,
2300000, 2300000,
2400000 2400000,
2500000,
2600000,
2700000,
2800000,
2900000,
3000000,
3100000,
3200000,
3300000,
3400000
}, },
["atk"]={ ["atk"]={
1000000, 1000000,
@ -109,21 +109,21 @@ local hero = {
["rouge_skill_3"]=200703, ["rouge_skill_3"]=200703,
["begin_lv"]=3, ["begin_lv"]=3,
["hp"]={ ["hp"]={
1000000,
1100000,
1200000,
1300000,
1400000,
1500000,
1600000,
1700000,
1800000,
1900000,
2000000, 2000000,
2100000, 2100000,
2200000, 2200000,
2300000, 2300000,
2400000 2400000,
2500000,
2600000,
2700000,
2800000,
2900000,
3000000,
3100000,
3200000,
3300000,
3400000
}, },
["atk"]={ ["atk"]={
1000000, 1000000,
@ -158,21 +158,21 @@ local hero = {
["rouge_skill_3"]=200103, ["rouge_skill_3"]=200103,
["begin_lv"]=1, ["begin_lv"]=1,
["hp"]={ ["hp"]={
1000000,
1100000,
1200000,
1300000,
1400000,
1500000,
1600000,
1700000,
1800000,
1900000,
2000000, 2000000,
2100000, 2100000,
2200000, 2200000,
2300000, 2300000,
2400000 2400000,
2500000,
2600000,
2700000,
2800000,
2900000,
3000000,
3100000,
3200000,
3300000,
3400000
}, },
["atk"]={ ["atk"]={
1000000, 1000000,
@ -207,21 +207,21 @@ local hero = {
["rouge_skill_3"]=200603, ["rouge_skill_3"]=200603,
["begin_lv"]=3, ["begin_lv"]=3,
["hp"]={ ["hp"]={
1000000,
1100000,
1200000,
1300000,
1400000,
1500000,
1600000,
1700000,
1800000,
1900000,
2000000, 2000000,
2100000, 2100000,
2200000, 2200000,
2300000, 2300000,
2400000 2400000,
2500000,
2600000,
2700000,
2800000,
2900000,
3000000,
3100000,
3200000,
3300000,
3400000
}, },
["atk"]={ ["atk"]={
1000000, 1000000,
@ -256,21 +256,21 @@ local hero = {
["rouge_skill_3"]=200303, ["rouge_skill_3"]=200303,
["begin_lv"]=1, ["begin_lv"]=1,
["hp"]={ ["hp"]={
1000000,
1100000,
1200000,
1300000,
1400000,
1500000,
1600000,
1700000,
1800000,
1900000,
2000000, 2000000,
2100000, 2100000,
2200000, 2200000,
2300000, 2300000,
2400000 2400000,
2500000,
2600000,
2700000,
2800000,
2900000,
3000000,
3100000,
3200000,
3300000,
3400000
}, },
["atk"]={ ["atk"]={
1000000, 1000000,
@ -305,21 +305,21 @@ local hero = {
["rouge_skill_3"]=200803, ["rouge_skill_3"]=200803,
["begin_lv"]=3, ["begin_lv"]=3,
["hp"]={ ["hp"]={
1000000,
1100000,
1200000,
1300000,
1400000,
1500000,
1600000,
1700000,
1800000,
1900000,
2000000, 2000000,
2100000, 2100000,
2200000, 2200000,
2300000, 2300000,
2400000 2400000,
2500000,
2600000,
2700000,
2800000,
2900000,
3000000,
3100000,
3200000,
3300000,
3400000
}, },
["atk"]={ ["atk"]={
1000000, 1000000,
@ -354,21 +354,21 @@ local hero = {
["rouge_skill_3"]=200403, ["rouge_skill_3"]=200403,
["begin_lv"]=1, ["begin_lv"]=1,
["hp"]={ ["hp"]={
1000000,
1100000,
1200000,
1300000,
1400000,
1500000,
1600000,
1700000,
1800000,
1900000,
2000000, 2000000,
2100000, 2100000,
2200000, 2200000,
2300000, 2300000,
2400000 2400000,
2500000,
2600000,
2700000,
2800000,
2900000,
3000000,
3100000,
3200000,
3300000,
3400000
}, },
["atk"]={ ["atk"]={
1000000, 1000000,

File diff suppressed because it is too large Load Diff

View File

@ -11,6 +11,7 @@ local skill = {
["round"]=0 ["round"]=0
} }
}, },
["obj"]=2,
["skill_position"]=1 ["skill_position"]=1
}, },
[2]={ [2]={
@ -25,6 +26,7 @@ local skill = {
["round"]=0 ["round"]=0
} }
}, },
["obj"]=2,
["skill_position"]=1 ["skill_position"]=1
}, },
[3]={ [3]={
@ -39,6 +41,7 @@ local skill = {
["round"]=0 ["round"]=0
} }
}, },
["obj"]=2,
["skill_position"]=1 ["skill_position"]=1
}, },
[4]={ [4]={
@ -53,6 +56,7 @@ local skill = {
["round"]=0 ["round"]=0
} }
}, },
["obj"]=2,
["skill_position"]=1 ["skill_position"]=1
}, },
[5]={ [5]={
@ -67,6 +71,7 @@ local skill = {
["round"]=0 ["round"]=0
} }
}, },
["obj"]=2,
["skill_position"]=1 ["skill_position"]=1
}, },
[6]={ [6]={
@ -81,6 +86,7 @@ local skill = {
["round"]=0 ["round"]=0
} }
}, },
["obj"]=2,
["skill_position"]=2 ["skill_position"]=2
}, },
[7]={ [7]={
@ -95,6 +101,7 @@ local skill = {
["round"]=0 ["round"]=0
} }
}, },
["obj"]=2,
["skill_position"]=2 ["skill_position"]=2
}, },
[8]={ [8]={
@ -109,6 +116,7 @@ local skill = {
["round"]=0 ["round"]=0
} }
}, },
["obj"]=2,
["skill_position"]=2 ["skill_position"]=2
}, },
[9]={ [9]={
@ -123,6 +131,7 @@ local skill = {
["round"]=0 ["round"]=0
} }
}, },
["obj"]=2,
["skill_position"]=2 ["skill_position"]=2
}, },
[10]={ [10]={
@ -137,6 +146,7 @@ local skill = {
["round"]=0 ["round"]=0
} }
}, },
["obj"]=2,
["skill_position"]=2 ["skill_position"]=2
}, },
[11]={ [11]={
@ -153,6 +163,7 @@ local skill = {
["round"]=0 ["round"]=0
} }
}, },
["obj"]=1,
["skill_position"]=2 ["skill_position"]=2
}, },
[12]={ [12]={
@ -166,6 +177,7 @@ local skill = {
["round"]=0 ["round"]=0
} }
}, },
["obj"]=1,
["skill_position"]=2 ["skill_position"]=2
}, },
[13]={ [13]={
@ -179,8 +191,22 @@ local skill = {
["round"]=1 ["round"]=1
} }
}, },
["obj"]=2,
["skill_position"]=2 ["skill_position"]=2
}, },
[14]={
["effect_type"]=2,
["trigger"]=3,
["effect"]={
{
["type"]="heal_normal_attack",
["num"]=500,
["ratio"]=10000,
["round"]=1
}
},
["obj"]=1
},
[320010]={ [320010]={
["position"]=3, ["position"]=3,
["effect_type"]=1, ["effect_type"]=1,
@ -213,8 +239,7 @@ local skill = {
}, },
["icon"]=10, ["icon"]=10,
["battle_icon"]="1", ["battle_icon"]="1",
["skill_position"]=1, ["skill_position"]=1
["name_act"]="skill01"
}, },
[220010]={ [220010]={
["position"]=2, ["position"]=2,
@ -321,8 +346,7 @@ local skill = {
}, },
["icon"]=30, ["icon"]=30,
["battle_icon"]="3", ["battle_icon"]="3",
["skill_position"]=2, ["skill_position"]=2
["name_act"]="skill01"
}, },
[520010]={ [520010]={
["position"]=5, ["position"]=5,
@ -392,8 +416,7 @@ local skill = {
}, },
["icon"]=50, ["icon"]=50,
["battle_icon"]="5", ["battle_icon"]="5",
["skill_position"]=2, ["skill_position"]=2
["name_act"]="skill01"
}, },
[330010]={ [330010]={
["position"]=3, ["position"]=3,
@ -1104,6 +1127,6 @@ local skill = {
} }
} }
local config = { local config = {
data=skill,count=63 data=skill,count=64
} }
return config return config

View File

@ -743,11 +743,11 @@ local skill_rogue = {
["limit_times"]=1, ["limit_times"]=1,
["weight"]=1000, ["weight"]=1000,
["qlt"]=4, ["qlt"]=4,
["type"]=9, ["type"]=12,
["skill_position"]=3, ["skill_position"]=3,
["effect"]={ ["effect"]={
{ {
["type"]="skill_add", ["type"]="add_skill",
["num"]=13, ["num"]=13,
["ratio"]=10000, ["ratio"]=10000,
["round"]=1 ["round"]=1
@ -788,7 +788,7 @@ local skill_rogue = {
["limit_times"]=1, ["limit_times"]=1,
["weight"]=1000, ["weight"]=1000,
["qlt"]=4, ["qlt"]=4,
["type"]=9, ["type"]=12,
["skill_position"]=2, ["skill_position"]=2,
["effect"]={ ["effect"]={
{ {
@ -963,8 +963,8 @@ local skill_rogue = {
["skill_position"]=3, ["skill_position"]=3,
["effect"]={ ["effect"]={
{ {
["type"]="heal", ["type"]="add_skill",
["num"]=500, ["num"]=14,
["ratio"]=10000, ["ratio"]=10000,
["round"]=1 ["round"]=1
} }

View File

@ -1730,6 +1730,10 @@ function GFunc.getRewardType(reward)
end end
end end
function GFunc.DOBFSliderValue(slider, endValue, duration, snapping)
return CS.BF.Utils.DOBFSliderValue(slider, endValue, duration, snapping)
end
--[[ --[[
tabLe只速 Lua error tabLe只速 Lua error
locaL readOnlyCfg = GFunc.readOnlyTab(cfg) return readOnlyCfg locaL readOnlyCfg = GFunc.readOnlyTab(cfg) return readOnlyCfg

View File

@ -243,16 +243,19 @@ function BattleUnitComp:useSkill(index, count, callback)
if self.normalSkillCount <= 0 then if self.normalSkillCount <= 0 then
self.actionOverCallback = nil self.actionOverCallback = nil
self.activeSkillIndex = nil self.activeSkillIndex = nil
self.battleController:setIsPauseHpProgress(false)
callback() callback()
return return
end end
if not self:changeState(UNIT_STATE.NORMAL_ATTACK) then if not self:changeState(UNIT_STATE.NORMAL_ATTACK) then
self.actionOverCallback = nil self.actionOverCallback = nil
self.battleController:setIsPauseHpProgress(false)
callback() callback()
end end
else else
if not self:changeState(UNIT_STATE.SKILL_ATTACK) then if not self:changeState(UNIT_STATE.SKILL_ATTACK) then
self.actionOverCallback = nil self.actionOverCallback = nil
self.battleController:setIsPauseHpProgress(false)
callback() callback()
end end
end end
@ -274,16 +277,19 @@ function BattleUnitComp:useAllSkills(callback)
if self.currActiveSkill == nil then -- 没有技能就用普攻 if self.currActiveSkill == nil then -- 没有技能就用普攻
if self.normalSkillCount <= 0 then if self.normalSkillCount <= 0 then
self.actionOverCallback = nil self.actionOverCallback = nil
self.battleController:setIsPauseHpProgress(false)
callback() callback()
return return
end end
if not self:changeState(UNIT_STATE.NORMAL_ATTACK) then if not self:changeState(UNIT_STATE.NORMAL_ATTACK) then
self.actionOverCallback = nil self.actionOverCallback = nil
self.battleController:setIsPauseHpProgress(false)
callback() callback()
end end
else else
if not self:changeState(UNIT_STATE.SKILL_ATTACK) then if not self:changeState(UNIT_STATE.SKILL_ATTACK) then
self.actionOverCallback = nil self.actionOverCallback = nil
self.battleController:setIsPauseHpProgress(false)
callback() callback()
end end
end end
@ -294,6 +300,7 @@ function BattleUnitComp:useNormalSkill(count, callback)
self.normalSkillCount = count + self.unitEntity:getNormalAttackAddCount() self.normalSkillCount = count + self.unitEntity:getNormalAttackAddCount()
if not self:changeState(UNIT_STATE.NORMAL_ATTACK) then if not self:changeState(UNIT_STATE.NORMAL_ATTACK) then
self.actionOverCallback = nil self.actionOverCallback = nil
self.battleController:setIsPauseHpProgress(false)
callback() callback()
end end
end end
@ -634,13 +641,38 @@ function BattleUnitComp:updateSkillAttack(dt)
if self.normalSkillCount > 0 then if self.normalSkillCount > 0 then
local skill = self.unitEntity:getNormalSkill() local skill = self.unitEntity:getNormalSkill()
self:onSkillTakeEffect(skill) self:onSkillTakeEffect(skill)
if self.normalSkillCount == 1 and self.currActiveSkill == nil then -- 最后一次攻击
self.battleController:setIsPauseHpProgress(false)
end
else else
self:onSkillTakeEffect(self.currActiveSkill) self:onSkillTakeEffect(self.currActiveSkill)
if not self:getIsHaveNextAvailableActiveSkill() then
self.battleController:setIsPauseHpProgress(false)
end
end end
end end
end end
end end
function BattleUnitComp:getIsHaveNextAvailableActiveSkill()
local skillCanUseTimes = self.currActiveSkill:getSkillCanUseTimes()
if skillCanUseTimes and skillCanUseTimes > 0 then -- 当前技能可以多次使用
return true
elseif self.activeSkillIndex then
local currActiveSkill = nil
local activeSkillIndex = self.activeSkillIndex + 1
local activeSkillCount = self.unitEntity:getActiveSkillCount()
while activeSkillIndex <= activeSkillCount do
currActiveSkill = self.unitEntity:getAvailableActiveSkill(activeSkillIndex)
if currActiveSkill then
return true
end
activeSkillIndex = activeSkillIndex + 1
end
end
return false
end
function BattleUnitComp:moveBackToInitPosition() function BattleUnitComp:moveBackToInitPosition()
self.isMove = true self.isMove = true
self:playAnimation(BattleConst.SPINE_ANIMATION_NAME.MOVE, true, false) self:playAnimation(BattleConst.SPINE_ANIMATION_NAME.MOVE, true, false)
@ -763,6 +795,9 @@ function BattleUnitComp:updateNormalAttack(dt)
self.currAttackKeyTime = 0 self.currAttackKeyTime = 0
local skill = self.unitEntity:getNormalSkill() local skill = self.unitEntity:getNormalSkill()
self:onSkillTakeEffect(skill) self:onSkillTakeEffect(skill)
if self.normalSkillCount == 1 then -- 如果是最后一次攻击,那么可以开始跑血条了
self.battleController:setIsPauseHpProgress(false)
end
end end
end end
end end

View File

@ -155,9 +155,13 @@ end
function BattleController:initBattleTeam() function BattleController:initBattleTeam()
self.atkTeam = BattleTeam:create() self.atkTeam = BattleTeam:create()
self.atkTeam:init(BattleConst.SIDE_ATK) self.atkTeam:init(BattleConst.SIDE_ATK, self)
self.defTeam = BattleTeam:create() self.defTeam = BattleTeam:create()
self.defTeam:init(BattleConst.SIDE_DEF) self.defTeam:init(BattleConst.SIDE_DEF, self)
end
function BattleController:setIsPauseHpProgress(value)
self.battleUI:setIsPauseHpProgress(value)
end end
function BattleController:prepareFight() function BattleController:prepareFight()

View File

@ -61,14 +61,12 @@ end
function BattleHelper:getEffectText(parent) function BattleHelper:getEffectText(parent)
if #self.battleEffectTextPool <= 0 then if #self.battleEffectTextPool <= 0 then
local prefab = CS.UnityEngine.Object.Instantiate(self.effectTextCache:getGameObject(), parent:getTransform(), false) local prefab = CS.UnityEngine.Object.Instantiate(self.effectTextCache:getGameObject())
local prefabObject = UIPrefabObject:create() local prefabObject = UIPrefabObject:create()
prefabObject:initWithPrefab(self.effectTextCache:getAssetPath(), prefab) prefabObject:initWithPrefab(self.effectTextCache:getAssetPath(), prefab)
prefabObject:initPrefabHelper() prefabObject:initPrefabHelper()
prefabObject:addUnloadCallback(function(obj)
ResourceManager:unload(obj:getAssetPath())
end)
prefabObject:getTransform():SetAsLastSibling() prefabObject:getTransform():SetAsLastSibling()
prefabObject:setParent(parent, false)
local comp = prefabObject:addLuaComponent(GConst.BattleConst.TYPEOF_LUA_COMP.BATTLE_NUMBER_COMPONENT) local comp = prefabObject:addLuaComponent(GConst.BattleConst.TYPEOF_LUA_COMP.BATTLE_NUMBER_COMPONENT)
comp:setEnabled(true) comp:setEnabled(true)
return comp return comp

View File

@ -25,16 +25,16 @@ end
local function _checkhpLowerThan(unitComp, skill, targetComp, hpPercent) local function _checkhpLowerThan(unitComp, skill, targetComp, hpPercent)
local triggerValue = skill:getPassiveTriggerValue() or 0 local triggerValue = skill:getPassiveTriggerValue() or 0
if hpPercent*DEFAULT_FACTOR < triggerValue then -- 低于指定血量,触发技能 if hpPercent*DEFAULT_FACTOR < triggerValue then -- 低于指定血量,触发技能
local data = skill:getRecordData(SKILL_RECORD_DATA_NAME.HP_LOWER_THAN) or 0 local data = unitComp.unitEntity:getTeamRecordData(SKILL_RECORD_DATA_NAME.HP_LOWER_THAN) or 0
if data == 1 then -- 已经触发过了 if data == 1 then -- 已经触发过了
return 0 return 0
end end
skill:setRecordData(SKILL_RECORD_DATA_NAME.HP_LOWER_THAN, 1) unitComp.unitEntity:setTeamRecordData(SKILL_RECORD_DATA_NAME.HP_LOWER_THAN, 1)
return 1 return 1
else else
local data = skill:getRecordData(SKILL_RECORD_DATA_NAME.HP_LOWER_THAN) or 0 local data = unitComp.unitEntity:getTeamRecordData(SKILL_RECORD_DATA_NAME.HP_LOWER_THAN) or 0
if data == 1 then -- 已经触发过了,那么需要取消 if data == 1 then -- 已经触发过了,那么需要取消
skill:setRecordData(SKILL_RECORD_DATA_NAME.HP_LOWER_THAN, 0) unitComp.unitEntity:setTeamRecordData(SKILL_RECORD_DATA_NAME.HP_LOWER_THAN, 0)
return -1 return -1
end end
end end

View File

@ -2,8 +2,9 @@ local BattleBuffHandle = require "app/module/battle/helper/battle_buff_handle"
local BattleTeam = class("BattleTeam") local BattleTeam = class("BattleTeam")
function BattleTeam:init(side) function BattleTeam:init(side, battleController)
self.side = side self.side = side
self.battleController = battleController
self.unitList = {} self.unitList = {}
self.unitMap = {} self.unitMap = {}
self.buffList = {} self.buffList = {}
@ -53,6 +54,7 @@ function BattleTeam:useNormalSkill(matchType, count, callback)
return callback() return callback()
end end
self.mainUnit = unit self.mainUnit = unit
self.battleController:setIsPauseHpProgress(true)
unit:beforeAttack() unit:beforeAttack()
unit:useNormalSkill(count, callback) unit:useNormalSkill(count, callback)
end end
@ -68,6 +70,7 @@ function BattleTeam:useSkill(matchType, count, callback)
return callback() return callback()
end end
self.mainUnit = unit self.mainUnit = unit
self.battleController:setIsPauseHpProgress(true)
unit:beforeAttack() unit:beforeAttack()
unit:useSkill(1, count, callback) unit:useSkill(1, count, callback)
end end
@ -94,6 +97,7 @@ function BattleTeam:useAssistingSkill(assistingList, callback)
end end
function BattleTeam:mainUnitUseAllSkills(callback) function BattleTeam:mainUnitUseAllSkills(callback)
self.battleController:setIsPauseHpProgress(true)
self.mainUnit:beforeAttack() self.mainUnit:beforeAttack()
self.mainUnit:useAllSkills(callback) self.mainUnit:useAllSkills(callback)
end end

View File

@ -92,20 +92,149 @@ end
function BattleUI:initHpNode() function BattleUI:initHpNode()
self.hpProgressLeft = self.uiMap["battle_ui.top_node.bg_l.atk_slider_green"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER) self.hpProgressLeft = self.uiMap["battle_ui.top_node.bg_l.atk_slider_green"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
self.hpProgressRight = self.uiMap["battle_ui.top_node.bg_r.def_slider_red"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER) self.hpProgressRight = self.uiMap["battle_ui.top_node.bg_r.def_slider_red"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
self.hpProgressLeft.value = 1
self.hpProgressRight.value = 1
self.hpProgressYellowLeft = self.uiMap["battle_ui.top_node.bg_l.atk_slider_yellow"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER) self.hpProgressYellowLeft = self.uiMap["battle_ui.top_node.bg_l.atk_slider_yellow"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
self.hpProgressYellowRight = self.uiMap["battle_ui.top_node.bg_r.def_slider_yellow"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER) self.hpProgressYellowRight = self.uiMap["battle_ui.top_node.bg_r.def_slider_yellow"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
self.hpProgressYellowLeft.value = 1
self.hpProgressYellowRight.value = 1
self.hpTextLeft = self.uiMap["battle_ui.top_node.atk_hp"] self.hpTextLeft = self.uiMap["battle_ui.top_node.atk_hp"]
self.hpTextRight = self.uiMap["battle_ui.top_node.def_hp"] self.hpTextRight = self.uiMap["battle_ui.top_node.def_hp"]
self.hpPercentLeft = 1
self.hpPercentRight = 1
end
function BattleUI:setIsPauseHpProgress(value)
if self.isPauseHpProgress == value then
return
end
self.isPauseHpProgress = value
if not value then
local timeLeft = math.abs(self.hpProgressYellowLeft.value - self.hpPercentLeft)
if timeLeft > 0.01 then
local delayTime = math.abs(self.hpProgressLeft.value - self.hpPercentLeft)*2
if delayTime > 0.05 then
if self.hpProgressYellowLeftSid then
self:unscheduleGlobal(self.hpProgressYellowLeftSid)
end
self.hpProgressYellowLeftSid = self:performWithDelayGlobal(function()
self:playHpProgressYellowRightTween(timeLeft)
end, delayTime)
else
self:playHpProgressYellowRightTween(timeLeft)
end
else
if self.hpProgressYellowLeftTween then
self.hpProgressYellowLeftTween:Pause()
end
self.hpProgressYellowLeft.value = self.hpPercentLeft
end
local timeRight = math.abs(self.hpProgressYellowRight.value - self.hpPercentRight)
if timeRight > 0.01 then
local delayTime = math.abs(self.hpProgressRight.value - self.hpPercentRight)*2
if delayTime > 0.05 then
if self.hpProgressYellowRightSid then
self:unscheduleGlobal(self.hpProgressYellowRightSid)
end
self.hpProgressYellowRightSid = self:performWithDelayGlobal(function()
self:playHpProgressYellowRightTween(delayTime)
end, delayTime)
else
self:playHpProgressYellowRightTween(delayTime)
end
else
if self.hpProgressYellowRightTween then
self.hpProgressYellowRightTween:Pause()
end
self.hpProgressYellowRight.value = self.hpPercentRight
end
end
end
function BattleUI:playHpProgressYellowLeftTween(time)
if self.hpProgressYellowLeftTween == nil then
self.hpProgressYellowLeftTween = GFunc.DOBFSliderValue(self.hpProgressYellowLeft, self.hpPercentLeft, time, false)
self.hpProgressYellowLeftTween:SetIntId(GConst.DOTWEEN_IDS.BATTLE)
self.hpProgressYellowLeftTween:SetAutoKill(false)
else
self.hpProgressYellowLeftTween:ChangeEndValue(self.hpPercentLeft, time, true)
self.hpProgressYellowLeftTween:Restart()
end
end
function BattleUI:playHpProgressYellowRightTween(time)
if self.hpProgressYellowRightTween == nil then
self.hpProgressYellowRightTween = GFunc.DOBFSliderValue(self.hpProgressYellowRight, self.hpPercentRight, time, false)
self.hpProgressYellowRightTween:SetIntId(GConst.DOTWEEN_IDS.BATTLE)
self.hpProgressYellowRightTween:SetAutoKill(false)
else
self.hpProgressYellowRightTween:ChangeEndValue(self.hpPercentRight, time, true)
self.hpProgressYellowRightTween:Restart()
end
end end
function BattleUI:refreshAtkHp(num, percent) function BattleUI:refreshAtkHp(num, percent)
self.hpTextLeft:setText(GFunc.num2Str(num)) self.hpTextLeft:setText(GFunc.num2Str(num))
self.hpProgressLeft.value = percent if not self.isPauseHpProgress then
if self.hpProgressLeftTween then
self.hpProgressLeftTween:Pause()
end
if self.hpProgressYellowLeftTween then
self.hpProgressYellowLeftTween:Pause()
end
if self.hpProgressYellowLeftSid then
self:unscheduleGlobal(self.hpProgressYellowLeftSid)
self.hpProgressYellowLeftSid = nil
end
self.hpProgressLeft.value = percent
self.hpProgressYellowLeft.value = percent
return
end
if self.hpPercentLeft == percent then
return
end
self.hpPercentLeft = percent
local time = math.abs(self.hpProgressLeft.value - percent)*2
if self.hpProgressLeftTween == nil then
self.hpProgressLeftTween = GFunc.DOBFSliderValue(self.hpProgressLeft, percent, time, false)
self.hpProgressLeftTween:SetIntId(GConst.DOTWEEN_IDS.BATTLE)
self.hpProgressLeftTween:SetAutoKill(false)
else
self.hpProgressLeftTween:ChangeEndValue(percent, time, true)
self.hpProgressLeftTween:Restart()
end
end end
function BattleUI:refreshDefHp(num, percent) function BattleUI:refreshDefHp(num, percent)
self.hpTextRight:setText(GFunc.num2Str(num)) self.hpTextRight:setText(GFunc.num2Str(num))
self.hpProgressRight.value = percent if not self.isPauseHpProgress then
if self.hpProgressRightTween then
self.hpProgressRightTween:Pause()
end
if self.hpProgressYellowRightTween then
self.hpProgressYellowRightTween:Pause()
end
if self.hpProgressYellowRightSid then
self:unscheduleGlobal(self.hpProgressYellowRightSid)
self.hpProgressYellowRightSid = nil
end
self.hpProgressRight.value = percent
self.hpProgressYellowRight.value = percent
return
end
if self.hpPercentRight == percent then
return
end
self.hpPercentRight = percent
local time = math.abs(self.hpProgressRight.value - percent)*2
if self.hpProgressRightTween == nil then
self.hpProgressRightTween = GFunc.DOBFSliderValue(self.hpProgressRight, percent, time, false)
self.hpProgressRightTween:SetIntId(GConst.DOTWEEN_IDS.BATTLE)
self.hpProgressRightTween:SetAutoKill(false)
else
self.hpProgressRightTween:ChangeEndValue(percent, time, true)
self.hpProgressRightTween:Restart()
end
end end
function BattleUI:refreshSkill(elementMap) function BattleUI:refreshSkill(elementMap)
@ -545,6 +674,30 @@ function BattleUI:clear()
if self.battleNode then if self.battleNode then
self.battleNode:removeAllChildren() self.battleNode:removeAllChildren()
end end
if self.hpProgressYellowLeftSid then
self:unscheduleGlobal(self.hpProgressYellowLeftSid)
self.hpProgressYellowLeftSid = nil
end
if self.hpProgressYellowRightSid then
self:unscheduleGlobal(self.hpProgressYellowRightSid)
self.hpProgressYellowRightSid = nil
end
if self.hpProgressLeftTween then
self.hpProgressLeftTween:Kill()
self.hpProgressLeftTween = nil
end
if self.hpProgressYellowLeftTween then
self.hpProgressYellowLeftTween:Kill()
self.hpProgressYellowLeftTween = nil
end
if self.hpProgressRightTween then
self.hpProgressRightTween:Kill()
self.hpProgressRightTween = nil
end
if self.hpProgressYellowRightTween then
self.hpProgressYellowRightTween:Kill()
self.hpProgressYellowRightTween = nil
end
if self.battleNumberNode then if self.battleNumberNode then
self.battleNumberNode:removeAllChildren() self.battleNumberNode:removeAllChildren()
end end

View File

@ -229,11 +229,34 @@ function BattleTeamEntity:handleShield(damageNum)
end end
end end
function BattleTeamEntity:getRecordData(name)
if self.recordData == nil then
self.recordData = {}
end
return self.recordData[name]
end
function BattleTeamEntity:setRecordData(name, value)
if self.recordData == nil then
self.recordData = {}
end
self.recordData[name] = value
end
function BattleTeamEntity:clearRecordData()
if self.recordData then
for k, v in pairs(self.recordData) do
self.recordData[k] = nil
end
end
end
function BattleTeamEntity:die() function BattleTeamEntity:die()
if self.isDead then if self.isDead then
return return
end end
self.isDead = true self.isDead = true
self:clearRecordData()
end end
function BattleTeamEntity:getIsDead() function BattleTeamEntity:getIsDead()

View File

@ -247,6 +247,14 @@ function BattleUnitEntity:getSkillExtraUseTimes(skillId)
return self.skillExtraUseTimes[skillId] or 0 return self.skillExtraUseTimes[skillId] or 0
end end
function BattleUnitEntity:getTeamRecordData(name)
return self.team:getRecordData(name)
end
function BattleUnitEntity:setTeamRecordData(name, value)
self.team:setRecordData(name, value)
end
function BattleUnitEntity:onRoundEnd() function BattleUnitEntity:onRoundEnd()
for k, v in ipairs(self.activeSkills) do for k, v in ipairs(self.activeSkills) do
v:cooldown() v:cooldown()