This commit is contained in:
xiekaidong 2023-04-19 15:50:00 +08:00
commit f6847beaa8
14 changed files with 319 additions and 273 deletions

View File

@ -1,183 +1,183 @@
local battle_exp = { local battle_exp = {
[1]={ [1]={
["exp"]=2 ["exp"]=10000
}, },
[2]={ [2]={
["exp"]=18 ["exp"]=20000
}, },
[3]={ [3]={
["exp"]=58 ["exp"]=30000
}, },
[4]={ [4]={
["exp"]=108 ["exp"]=40000
}, },
[5]={ [5]={
["exp"]=188 ["exp"]=50000
}, },
[6]={ [6]={
["exp"]=298 ["exp"]=60000
}, },
[7]={ [7]={
["exp"]=448 ["exp"]=70000
}, },
[8]={ [8]={
["exp"]=658 ["exp"]=80000
}, },
[9]={ [9]={
["exp"]=948 ["exp"]=90000
}, },
[10]={ [10]={
["exp"]=1318 ["exp"]=100000
}, },
[11]={ [11]={
["exp"]=1858 ["exp"]=110000
}, },
[12]={ [12]={
["exp"]=2568 ["exp"]=120000
}, },
[13]={ [13]={
["exp"]=3448 ["exp"]=130000
}, },
[14]={ [14]={
["exp"]=4498 ["exp"]=140000
}, },
[15]={ [15]={
["exp"]=5718 ["exp"]=150000
}, },
[16]={ [16]={
["exp"]=7138 ["exp"]=160000
}, },
[17]={ [17]={
["exp"]=8758 ["exp"]=170000
}, },
[18]={ [18]={
["exp"]=10628 ["exp"]=180000
}, },
[19]={ [19]={
["exp"]=12748 ["exp"]=190000
}, },
[20]={ [20]={
["exp"]=15118 ["exp"]=200000
}, },
[21]={ [21]={
["exp"]=17738 ["exp"]=210000
}, },
[22]={ [22]={
["exp"]=20608 ["exp"]=220000
}, },
[23]={ [23]={
["exp"]=23728 ["exp"]=230000
}, },
[24]={ [24]={
["exp"]=27098 ["exp"]=240000
}, },
[25]={ [25]={
["exp"]=30718 ["exp"]=250000
}, },
[26]={ [26]={
["exp"]=34588 ["exp"]=260000
}, },
[27]={ [27]={
["exp"]=38708 ["exp"]=270000
}, },
[28]={ [28]={
["exp"]=43078 ["exp"]=280000
}, },
[29]={ [29]={
["exp"]=47798 ["exp"]=290000
}, },
[30]={ [30]={
["exp"]=52868 ["exp"]=300000
}, },
[31]={ [31]={
["exp"]=58288 ["exp"]=310000
}, },
[32]={ [32]={
["exp"]=64058 ["exp"]=320000
}, },
[33]={ [33]={
["exp"]=70178 ["exp"]=330000
}, },
[34]={ [34]={
["exp"]=76648 ["exp"]=340000
}, },
[35]={ [35]={
["exp"]=83468 ["exp"]=350000
}, },
[36]={ [36]={
["exp"]=90638 ["exp"]=360000
}, },
[37]={ [37]={
["exp"]=98158 ["exp"]=370000
}, },
[38]={ [38]={
["exp"]=106028 ["exp"]=380000
}, },
[39]={ [39]={
["exp"]=114248 ["exp"]=390000
}, },
[40]={ [40]={
["exp"]=122918 ["exp"]=400000
}, },
[41]={ [41]={
["exp"]=132038 ["exp"]=410000
}, },
[42]={ [42]={
["exp"]=141608 ["exp"]=420000
}, },
[43]={ [43]={
["exp"]=151628 ["exp"]=430000
}, },
[44]={ [44]={
["exp"]=162098 ["exp"]=440000
}, },
[45]={ [45]={
["exp"]=173018 ["exp"]=450000
}, },
[46]={ [46]={
["exp"]=184388 ["exp"]=460000
}, },
[47]={ [47]={
["exp"]=196208 ["exp"]=470000
}, },
[48]={ [48]={
["exp"]=208478 ["exp"]=480000
}, },
[49]={ [49]={
["exp"]=221198 ["exp"]=490000
}, },
[50]={ [50]={
["exp"]=234368 ["exp"]=500000
}, },
[51]={ [51]={
["exp"]=247988 ["exp"]=510000
}, },
[52]={ [52]={
["exp"]=262058 ["exp"]=520000
}, },
[53]={ [53]={
["exp"]=276578 ["exp"]=530000
}, },
[54]={ [54]={
["exp"]=291548 ["exp"]=540000
}, },
[55]={ [55]={
["exp"]=306968 ["exp"]=550000
}, },
[56]={ [56]={
["exp"]=322838 ["exp"]=560000
}, },
[57]={ [57]={
["exp"]=339158 ["exp"]=570000
}, },
[58]={ [58]={
["exp"]=355928 ["exp"]=580000
}, },
[59]={ [59]={
["exp"]=373148 ["exp"]=590000
}, },
[60]={ [60]={
["exp"]=390368 ["exp"]=600000
} }
} }
local config = { local config = {

View File

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

View File

@ -1,9 +1,12 @@
local const = { local const = {
["element_combo"]={ ["element_combo"]={
["value"]=2 ["value"]=2
},
["support_interval"]={
["value"]=500
} }
} }
local config = { local config = {
data=const,count=1 data=const,count=2
} }
return config return config

File diff suppressed because it is too large Load Diff

View File

@ -196,10 +196,10 @@ local skill = {
}, },
[14]={ [14]={
["effect_type"]=2, ["effect_type"]=2,
["trigger"]=3, ["trigger"]=5,
["effect"]={ ["effect"]={
{ {
["type"]="heal_normal_attack", ["type"]="heal",
["num"]=500, ["num"]=500,
["ratio"]=10000, ["ratio"]=10000,
["round"]=1 ["round"]=1

View File

@ -72,6 +72,7 @@ BattleConst.UNIT_STATE = {
SWITCH_IN = 7, -- 入场 SWITCH_IN = 7, -- 入场
SWITCH_OUT = 8, -- 离场 SWITCH_OUT = 8, -- 离场
ASSISTING_ATTACK = 9, -- 协助攻击 ASSISTING_ATTACK = 9, -- 协助攻击
WAIT = 10, -- 等待
} }
BattleConst.MATCH_DMG_ADDITION_NAME = { BattleConst.MATCH_DMG_ADDITION_NAME = {

View File

@ -91,6 +91,7 @@ end
function BattleUnitComp:resetBeforeAttack() function BattleUnitComp:resetBeforeAttack()
self.attackCount = 0 self.attackCount = 0
self.baseObject:getTransform():SetAsLastSibling()
end end
function BattleUnitComp:initPassiveSkills() function BattleUnitComp:initPassiveSkills()
@ -222,7 +223,7 @@ function BattleUnitComp:beforeAttack()
self:checkPassiveEvent(PASSIVE_EVENT.ON_UNI_ATTACK_START, self) self:checkPassiveEvent(PASSIVE_EVENT.ON_UNI_ATTACK_START, self)
end end
function BattleUnitComp:useAssistingSkill(count, callback) function BattleUnitComp:useAssistingSkill(count, delay, callback)
local skill = self.unitEntity:getAssistingSkill() local skill = self.unitEntity:getAssistingSkill()
if skill == nil then if skill == nil then
callback() callback()
@ -232,11 +233,23 @@ function BattleUnitComp:useAssistingSkill(count, callback)
local attrName = GConst.MATCH_ATTACK_NAME[self:getMatchType()] local attrName = GConst.MATCH_ATTACK_NAME[self:getMatchType()]
self.assistingDmgAddCount = self.unitEntity:addAttr(attrName, count*DEFAULT_FACTOR, true) self.assistingDmgAddCount = self.unitEntity:addAttr(attrName, count*DEFAULT_FACTOR, true)
self.actionOverCallback = callback self.actionOverCallback = callback
if delay > 0 then
self.waitTime = delay
self.waitingState = UNIT_STATE.ASSISTING_ATTACK
if not self:changeState(UNIT_STATE.WAIT) then
if not self:changeState(UNIT_STATE.ASSISTING_ATTACK) then if not self:changeState(UNIT_STATE.ASSISTING_ATTACK) then
self.actionOverCallback = nil self.actionOverCallback = nil
self.unitEntity:addAttr(attrName, -self.assistingDmgAddCount, false) self.unitEntity:addAttr(attrName, -self.assistingDmgAddCount, false)
callback() callback()
end end
end
else
if not self:changeState(UNIT_STATE.ASSISTING_ATTACK) then
self.actionOverCallback = nil
self.unitEntity:addAttr(attrName, -self.assistingDmgAddCount, false)
callback()
end
end
end end
function BattleUnitComp:useSkill(index, count, callback) function BattleUnitComp:useSkill(index, count, callback)
@ -341,6 +354,8 @@ function BattleUnitComp:changeState(state)
self:exitSwitchInState() self:exitSwitchInState()
elseif self.currState == UNIT_STATE.SWITCH_OUT then elseif self.currState == UNIT_STATE.SWITCH_OUT then
self:exitSwitchOutState() self:exitSwitchOutState()
elseif self.currState == UNIT_STATE.WAIT then
self:exitWaitState()
end end
-- 进入目标状态 -- 进入目标状态
self.currState = state self.currState = state
@ -350,18 +365,20 @@ function BattleUnitComp:changeState(state)
self:enterNormalAttackState() self:enterNormalAttackState()
elseif state == UNIT_STATE.SKILL_ATTACK then elseif state == UNIT_STATE.SKILL_ATTACK then
self:enterSkillAttackState() self:enterSkillAttackState()
elseif self.currState == UNIT_STATE.ASSISTING_ATTACK then elseif state == UNIT_STATE.ASSISTING_ATTACK then
self:enterAssistingAttackState() self:enterAssistingAttackState()
elseif state == UNIT_STATE.DEAD then elseif state == UNIT_STATE.DEAD then
self:enterDeadState() self:enterDeadState()
elseif self.currState == UNIT_STATE.BORN then elseif state == UNIT_STATE.BORN then
self:enterBornState() self:enterBornState()
elseif self.currState == UNIT_STATE.ENTER_BATTLEFIELD then elseif state == UNIT_STATE.ENTER_BATTLEFIELD then
self:enterEnterBattlefieldState() self:enterEnterBattlefieldState()
elseif self.currState == UNIT_STATE.SWITCH_IN then elseif state == UNIT_STATE.SWITCH_IN then
self:enterSwitchInState() self:enterSwitchInState()
elseif self.currState == UNIT_STATE.SWITCH_OUT then elseif state == UNIT_STATE.SWITCH_OUT then
self:enterSwitchOutState() self:enterSwitchOutState()
elseif state == UNIT_STATE.WAIT then
self:enterWaitState()
end end
return true return true
end end
@ -498,6 +515,19 @@ function BattleUnitComp:updateHurt(dt)
end end
end end
function BattleUnitComp:enterWaitState()
end
function BattleUnitComp:exitWaitState()
end
function BattleUnitComp:updateWaitState(dt)
self.waitTime = self.waitTime - dt
if self.waitTime < 0 then
self:changeState(self.waitingState)
end
end
function BattleUnitComp:enterAssistingAttackState() function BattleUnitComp:enterAssistingAttackState()
self.attackOver = false self.attackOver = false
self.attackTime = 0 self.attackTime = 0
@ -989,6 +1019,8 @@ function BattleUnitComp:tick(dt)
self:updateSwitchInState(dt) self:updateSwitchInState(dt)
elseif self.currState == UNIT_STATE.SWITCH_OUT then elseif self.currState == UNIT_STATE.SWITCH_OUT then
self:updateSwitchOutState(dt) self:updateSwitchOutState(dt)
elseif self.currState == UNIT_STATE.WAIT then
self:updateWaitState(dt)
end end
end end

View File

@ -30,6 +30,13 @@ function BattleHelper:random(min, max)
return min + self.seed*(max - min + 1)//233280 return min + self.seed*(max - min + 1)//233280
end end
function BattleHelper:getSupportInterval()
if self.supportInterval == nil then
self.supportInterval = GFunc.getConstIntValue("support_interval")/1000
end
return self.supportInterval
end
function BattleHelper:loadBattleHeroModel(id, parent, callback) function BattleHelper:loadBattleHeroModel(id, parent, callback)
local pool = self.characterPools[id] local pool = self.characterPools[id]
if pool and #pool > 0 then if pool and #pool > 0 then

View File

@ -1,4 +1,5 @@
local BattleBuffHandle = require "app/module/battle/helper/battle_buff_handle" local BattleBuffHandle = require "app/module/battle/helper/battle_buff_handle"
local BattleHelper = require "app/module/battle/helper/battle_helper"
local BattleTeam = class("BattleTeam") local BattleTeam = class("BattleTeam")
@ -88,11 +89,13 @@ function BattleTeam:useAssistingSkill(assistingList, callback)
callback() callback()
end end
end end
local delay = 0
for _, v in ipairs(assistingList) do for _, v in ipairs(assistingList) do
local unit = self.unitMap[v.skillMatch] local unit = self.unitMap[v.skillMatch]
if unit then if unit then
unit:resetBeforeAttack() unit:resetBeforeAttack()
unit:useAssistingSkill(v.count, finish) unit:useAssistingSkill(v.count, delay, finish)
delay = delay + BattleHelper:getSupportInterval()
else else
finish() finish()
end end

View File

@ -64,8 +64,8 @@ function HeroCell:addClickListener(callback)
self.clickCallback = callback self.clickCallback = callback
end end
function HeroCell:setVisible(visible) function HeroCell:setVisible(visible, scale)
self.baseObject:setVisible(visible) self.baseObject:setVisible(visible, scale)
end end
function HeroCell:setGray(isGray) function HeroCell:setGray(isGray)

View File

@ -78,6 +78,7 @@ function HeroComp:refreshStageFormation()
self.heroSpineList[i]:destroy() self.heroSpineList[i]:destroy()
end end
spineObject:playAnimation("idle", true) spineObject:playAnimation("idle", true)
spineObject:setLocalScale(0.7, 0.7, 0.7)
self.heroSpineList[i] = spineObject self.heroSpineList[i] = spineObject
self.heroSpineList[i]:setLocalPosition(0, -52, 0) self.heroSpineList[i]:setLocalPosition(0, -52, 0)
end) end)

View File

@ -129,7 +129,7 @@ function MainComp:refreshStageFormaion()
if formation[i] then if formation[i] then
local heroEntity = DataManager.HeroData:getHeroById(formation[i]) local heroEntity = DataManager.HeroData:getHeroById(formation[i])
if heroEntity then if heroEntity then
heroCell:setVisible(true) heroCell:setVisible(true, 0.84)
heroCell:refresh(heroEntity) heroCell:refresh(heroEntity)
heroCell:addClickListener(function() heroCell:addClickListener(function()
ModuleManager.HeroManager:showHeroDetailUI(heroEntity:getCfgId()) ModuleManager.HeroManager:showHeroDetailUI(heroEntity:getCfgId())

View File

@ -23,6 +23,7 @@ function BattleSkillEntity:init()
self.cd = 0 self.cd = 0
end end
self:initSkillEffect() self:initSkillEffect()
self.available = self.skillInfo.effect_type ~= nil
end end
function BattleSkillEntity:initSkillEffect() function BattleSkillEntity:initSkillEffect()
@ -55,6 +56,9 @@ end
-- 技能是否可用 -- 技能是否可用
function BattleSkillEntity:getIsAvailable() function BattleSkillEntity:getIsAvailable()
if not self.available then
return false
end
return self.cd == 0 return self.cd == 0
end end
@ -100,7 +104,7 @@ function BattleSkillEntity:addSkillEffectRound(effect)
end end
end end
function BattleSkillEntity:getSkillid() function BattleSkillEntity:getSkillId()
return self.skillId return self.skillId
end end

View File

@ -144,7 +144,7 @@ end
function BattleUnitEntity:changeActiveSkillId(originSkillId, tartgetSkillId) function BattleUnitEntity:changeActiveSkillId(originSkillId, tartgetSkillId)
for _, skillEntity in ipairs(self.activeSkills) do for _, skillEntity in ipairs(self.activeSkills) do
if skillEntity:getSkillid() == originSkillId then if skillEntity:getSkillId() == originSkillId then
skillEntity:changeSkillId(tartgetSkillId) skillEntity:changeSkillId(tartgetSkillId)
break break
end end
@ -153,7 +153,7 @@ end
function BattleUnitEntity:addActiveSkillParams(skillId, effect) function BattleUnitEntity:addActiveSkillParams(skillId, effect)
for _, skillEntity in ipairs(self.activeSkills) do for _, skillEntity in ipairs(self.activeSkills) do
if skillEntity:getSkillid() == skillId then if skillEntity:getSkillId() == skillId then
skillEntity:addSkillEffectParams(effect) skillEntity:addSkillEffectParams(effect)
break break
end end
@ -162,7 +162,7 @@ end
function BattleUnitEntity:addActiveSkillRound(skillId, effect) function BattleUnitEntity:addActiveSkillRound(skillId, effect)
for _, skillEntity in ipairs(self.activeSkills) do for _, skillEntity in ipairs(self.activeSkills) do
if skillEntity:getSkillid() == skillId then if skillEntity:getSkillId() == skillId then
skillEntity:addSkillEffectRound(effect) skillEntity:addSkillEffectRound(effect)
break break
end end