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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

@ -30,6 +30,13 @@ function BattleHelper:random(min, max)
return min + self.seed*(max - min + 1)//233280
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)
local pool = self.characterPools[id]
if pool and #pool > 0 then

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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