援助技能
This commit is contained in:
parent
ebf0d93d30
commit
74cffb310d
@ -163,6 +163,12 @@ function CharacterSpineObject:playAnimation(animName, loop, forceRefresh)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function CharacterSpineObject:setDefaultMix(mixDuration)
|
||||||
|
if self.characterSpineHelper then
|
||||||
|
self.characterSpineHelper:SetDefaultMix(mixDuration)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- 战斗里面粒子特效和spine特效混用,统一调用的stop接口,这里先放一个空方法
|
-- 战斗里面粒子特效和spine特效混用,统一调用的stop接口,这里先放一个空方法
|
||||||
function CharacterSpineObject:stop()
|
function CharacterSpineObject:stop()
|
||||||
end
|
end
|
||||||
|
|||||||
@ -5,6 +5,7 @@ local hero = {
|
|||||||
["hurt_skill"]=1,
|
["hurt_skill"]=1,
|
||||||
["hurt_num"]=3,
|
["hurt_num"]=3,
|
||||||
["base_skill"]=120011,
|
["base_skill"]=120011,
|
||||||
|
["support_skill"]=120010,
|
||||||
["rouge_skill_1"]=200501,
|
["rouge_skill_1"]=200501,
|
||||||
["rouge_skill_2"]=200502,
|
["rouge_skill_2"]=200502,
|
||||||
["rouge_skill_3"]=200503,
|
["rouge_skill_3"]=200503,
|
||||||
@ -53,6 +54,7 @@ local hero = {
|
|||||||
["hurt_skill"]=2,
|
["hurt_skill"]=2,
|
||||||
["hurt_num"]=3,
|
["hurt_num"]=3,
|
||||||
["base_skill"]=220011,
|
["base_skill"]=220011,
|
||||||
|
["support_skill"]=220010,
|
||||||
["rouge_skill_1"]=200201,
|
["rouge_skill_1"]=200201,
|
||||||
["rouge_skill_2"]=200202,
|
["rouge_skill_2"]=200202,
|
||||||
["rouge_skill_3"]=200203,
|
["rouge_skill_3"]=200203,
|
||||||
@ -101,6 +103,7 @@ local hero = {
|
|||||||
["hurt_skill"]=2,
|
["hurt_skill"]=2,
|
||||||
["hurt_num"]=3,
|
["hurt_num"]=3,
|
||||||
["base_skill"]=230011,
|
["base_skill"]=230011,
|
||||||
|
["support_skill"]=230010,
|
||||||
["rouge_skill_1"]=200701,
|
["rouge_skill_1"]=200701,
|
||||||
["rouge_skill_2"]=200702,
|
["rouge_skill_2"]=200702,
|
||||||
["rouge_skill_3"]=200703,
|
["rouge_skill_3"]=200703,
|
||||||
@ -149,6 +152,7 @@ local hero = {
|
|||||||
["hurt_skill"]=3,
|
["hurt_skill"]=3,
|
||||||
["hurt_num"]=3,
|
["hurt_num"]=3,
|
||||||
["base_skill"]=320011,
|
["base_skill"]=320011,
|
||||||
|
["support_skill"]=320010,
|
||||||
["rouge_skill_1"]=200101,
|
["rouge_skill_1"]=200101,
|
||||||
["rouge_skill_2"]=200102,
|
["rouge_skill_2"]=200102,
|
||||||
["rouge_skill_3"]=200103,
|
["rouge_skill_3"]=200103,
|
||||||
@ -197,6 +201,7 @@ local hero = {
|
|||||||
["hurt_skill"]=3,
|
["hurt_skill"]=3,
|
||||||
["hurt_num"]=3,
|
["hurt_num"]=3,
|
||||||
["base_skill"]=330011,
|
["base_skill"]=330011,
|
||||||
|
["support_skill"]=330010,
|
||||||
["rouge_skill_1"]=200601,
|
["rouge_skill_1"]=200601,
|
||||||
["rouge_skill_2"]=200602,
|
["rouge_skill_2"]=200602,
|
||||||
["rouge_skill_3"]=200603,
|
["rouge_skill_3"]=200603,
|
||||||
@ -245,6 +250,7 @@ local hero = {
|
|||||||
["hurt_skill"]=9,
|
["hurt_skill"]=9,
|
||||||
["hurt_num"]=3,
|
["hurt_num"]=3,
|
||||||
["base_skill"]=420011,
|
["base_skill"]=420011,
|
||||||
|
["support_skill"]=420010,
|
||||||
["rouge_skill_1"]=200301,
|
["rouge_skill_1"]=200301,
|
||||||
["rouge_skill_2"]=200302,
|
["rouge_skill_2"]=200302,
|
||||||
["rouge_skill_3"]=200303,
|
["rouge_skill_3"]=200303,
|
||||||
@ -293,6 +299,7 @@ local hero = {
|
|||||||
["hurt_skill"]=4,
|
["hurt_skill"]=4,
|
||||||
["hurt_num"]=3,
|
["hurt_num"]=3,
|
||||||
["base_skill"]=430011,
|
["base_skill"]=430011,
|
||||||
|
["support_skill"]=430010,
|
||||||
["rouge_skill_1"]=200801,
|
["rouge_skill_1"]=200801,
|
||||||
["rouge_skill_2"]=200802,
|
["rouge_skill_2"]=200802,
|
||||||
["rouge_skill_3"]=200803,
|
["rouge_skill_3"]=200803,
|
||||||
@ -341,6 +348,7 @@ local hero = {
|
|||||||
["hurt_skill"]=5,
|
["hurt_skill"]=5,
|
||||||
["hurt_num"]=3,
|
["hurt_num"]=3,
|
||||||
["base_skill"]=520011,
|
["base_skill"]=520011,
|
||||||
|
["support_skill"]=520010,
|
||||||
["rouge_skill_1"]=200401,
|
["rouge_skill_1"]=200401,
|
||||||
["rouge_skill_2"]=200402,
|
["rouge_skill_2"]=200402,
|
||||||
["rouge_skill_3"]=200403,
|
["rouge_skill_3"]=200403,
|
||||||
|
|||||||
@ -164,8 +164,23 @@ local skill = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
[320010]={
|
||||||
|
["position"]=3,
|
||||||
|
["effect_type"]=1,
|
||||||
|
["trigger"]=1,
|
||||||
|
["effect"]={
|
||||||
|
{
|
||||||
|
["type"]="hurt_green",
|
||||||
|
["num"]=10000,
|
||||||
|
["ratio"]=10000,
|
||||||
|
["round"]=0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
["skill_position"]=2,
|
||||||
|
["name_act"]="support01"
|
||||||
|
},
|
||||||
[320011]={
|
[320011]={
|
||||||
["energy"]=10,
|
["energy"]=2,
|
||||||
["position"]=3,
|
["position"]=3,
|
||||||
["method"]=2,
|
["method"]=2,
|
||||||
["skill_type"]=1,
|
["skill_type"]=1,
|
||||||
@ -184,8 +199,23 @@ local skill = {
|
|||||||
["skill_position"]=1,
|
["skill_position"]=1,
|
||||||
["name_act"]="skill01"
|
["name_act"]="skill01"
|
||||||
},
|
},
|
||||||
|
[220010]={
|
||||||
|
["position"]=2,
|
||||||
|
["effect_type"]=1,
|
||||||
|
["trigger"]=1,
|
||||||
|
["effect"]={
|
||||||
|
{
|
||||||
|
["type"]="hurt_yellow",
|
||||||
|
["num"]=10000,
|
||||||
|
["ratio"]=10000,
|
||||||
|
["round"]=0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
["skill_position"]=2,
|
||||||
|
["name_act"]="support01"
|
||||||
|
},
|
||||||
[220011]={
|
[220011]={
|
||||||
["energy"]=10,
|
["energy"]=2,
|
||||||
["position"]=2,
|
["position"]=2,
|
||||||
["method"]=2,
|
["method"]=2,
|
||||||
["skill_type"]=0,
|
["skill_type"]=0,
|
||||||
@ -206,7 +236,7 @@ local skill = {
|
|||||||
["name_act"]="skill01"
|
["name_act"]="skill01"
|
||||||
},
|
},
|
||||||
[220012]={
|
[220012]={
|
||||||
["energy"]=10,
|
["energy"]=2,
|
||||||
["position"]=2,
|
["position"]=2,
|
||||||
["method"]=1,
|
["method"]=1,
|
||||||
["skill_type"]=2,
|
["skill_type"]=2,
|
||||||
@ -246,8 +276,23 @@ local skill = {
|
|||||||
["skill_position"]=1,
|
["skill_position"]=1,
|
||||||
["name_act"]="skill01"
|
["name_act"]="skill01"
|
||||||
},
|
},
|
||||||
|
[420010]={
|
||||||
|
["position"]=4,
|
||||||
|
["effect_type"]=1,
|
||||||
|
["trigger"]=1,
|
||||||
|
["effect"]={
|
||||||
|
{
|
||||||
|
["type"]="hurt_blue",
|
||||||
|
["num"]=10000,
|
||||||
|
["ratio"]=10000,
|
||||||
|
["round"]=0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
["skill_position"]=2,
|
||||||
|
["name_act"]="support01"
|
||||||
|
},
|
||||||
[420011]={
|
[420011]={
|
||||||
["energy"]=10,
|
["energy"]=2,
|
||||||
["position"]=4,
|
["position"]=4,
|
||||||
["method"]=2,
|
["method"]=2,
|
||||||
["skill_type"]=1,
|
["skill_type"]=1,
|
||||||
@ -262,8 +307,23 @@ local skill = {
|
|||||||
["skill_position"]=2,
|
["skill_position"]=2,
|
||||||
["name_act"]="skill01"
|
["name_act"]="skill01"
|
||||||
},
|
},
|
||||||
|
[520010]={
|
||||||
|
["position"]=5,
|
||||||
|
["effect_type"]=1,
|
||||||
|
["trigger"]=1,
|
||||||
|
["effect"]={
|
||||||
|
{
|
||||||
|
["type"]="hurt_purple",
|
||||||
|
["num"]=10000,
|
||||||
|
["ratio"]=10000,
|
||||||
|
["round"]=0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
["skill_position"]=2,
|
||||||
|
["name_act"]="support01"
|
||||||
|
},
|
||||||
[520011]={
|
[520011]={
|
||||||
["energy"]=10,
|
["energy"]=2,
|
||||||
["position"]=5,
|
["position"]=5,
|
||||||
["method"]=2,
|
["method"]=2,
|
||||||
["skill_type"]=0,
|
["skill_type"]=0,
|
||||||
@ -283,8 +343,23 @@ local skill = {
|
|||||||
["skill_position"]=2,
|
["skill_position"]=2,
|
||||||
["name_act"]="skill01"
|
["name_act"]="skill01"
|
||||||
},
|
},
|
||||||
|
[120010]={
|
||||||
|
["position"]=1,
|
||||||
|
["effect_type"]=1,
|
||||||
|
["trigger"]=1,
|
||||||
|
["effect"]={
|
||||||
|
{
|
||||||
|
["type"]="hurt_red",
|
||||||
|
["num"]=10000,
|
||||||
|
["ratio"]=10000,
|
||||||
|
["round"]=0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
["skill_position"]=2,
|
||||||
|
["name_act"]="support01"
|
||||||
|
},
|
||||||
[120011]={
|
[120011]={
|
||||||
["energy"]=10,
|
["energy"]=2,
|
||||||
["position"]=1,
|
["position"]=1,
|
||||||
["method"]=2,
|
["method"]=2,
|
||||||
["skill_type"]=1,
|
["skill_type"]=1,
|
||||||
@ -303,8 +378,23 @@ local skill = {
|
|||||||
["skill_position"]=2,
|
["skill_position"]=2,
|
||||||
["name_act"]="skill01"
|
["name_act"]="skill01"
|
||||||
},
|
},
|
||||||
|
[330010]={
|
||||||
|
["position"]=3,
|
||||||
|
["effect_type"]=1,
|
||||||
|
["trigger"]=1,
|
||||||
|
["effect"]={
|
||||||
|
{
|
||||||
|
["type"]="hurt_green",
|
||||||
|
["num"]=10000,
|
||||||
|
["ratio"]=10000,
|
||||||
|
["round"]=0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
["skill_position"]=2,
|
||||||
|
["name_act"]="support01"
|
||||||
|
},
|
||||||
[330011]={
|
[330011]={
|
||||||
["energy"]=10,
|
["energy"]=2,
|
||||||
["position"]=3,
|
["position"]=3,
|
||||||
["method"]=2,
|
["method"]=2,
|
||||||
["skill_type"]=0,
|
["skill_type"]=0,
|
||||||
@ -324,8 +414,23 @@ local skill = {
|
|||||||
["skill_position"]=2,
|
["skill_position"]=2,
|
||||||
["name_act"]="skill01"
|
["name_act"]="skill01"
|
||||||
},
|
},
|
||||||
|
[230010]={
|
||||||
|
["position"]=2,
|
||||||
|
["effect_type"]=1,
|
||||||
|
["trigger"]=1,
|
||||||
|
["effect"]={
|
||||||
|
{
|
||||||
|
["type"]="hurt_yellow",
|
||||||
|
["num"]=10000,
|
||||||
|
["ratio"]=10000,
|
||||||
|
["round"]=0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
["skill_position"]=2,
|
||||||
|
["name_act"]="support01"
|
||||||
|
},
|
||||||
[230011]={
|
[230011]={
|
||||||
["energy"]=10,
|
["energy"]=2,
|
||||||
["position"]=2,
|
["position"]=2,
|
||||||
["method"]=2,
|
["method"]=2,
|
||||||
["skill_type"]=0,
|
["skill_type"]=0,
|
||||||
@ -345,7 +450,7 @@ local skill = {
|
|||||||
["skill_position"]=2
|
["skill_position"]=2
|
||||||
},
|
},
|
||||||
[230012]={
|
[230012]={
|
||||||
["energy"]=10,
|
["energy"]=2,
|
||||||
["position"]=2,
|
["position"]=2,
|
||||||
["method"]=1,
|
["method"]=1,
|
||||||
["skill_type"]=2,
|
["skill_type"]=2,
|
||||||
@ -386,7 +491,7 @@ local skill = {
|
|||||||
["skill_position"]=2
|
["skill_position"]=2
|
||||||
},
|
},
|
||||||
[230013]={
|
[230013]={
|
||||||
["energy"]=10,
|
["energy"]=2,
|
||||||
["position"]=2,
|
["position"]=2,
|
||||||
["method"]=1,
|
["method"]=1,
|
||||||
["skill_type"]=2,
|
["skill_type"]=2,
|
||||||
@ -442,8 +547,23 @@ local skill = {
|
|||||||
["obj"]=1,
|
["obj"]=1,
|
||||||
["skill_position"]=2
|
["skill_position"]=2
|
||||||
},
|
},
|
||||||
|
[430010]={
|
||||||
|
["position"]=4,
|
||||||
|
["effect_type"]=1,
|
||||||
|
["trigger"]=1,
|
||||||
|
["effect"]={
|
||||||
|
{
|
||||||
|
["type"]="hurt_blue",
|
||||||
|
["num"]=10000,
|
||||||
|
["ratio"]=10000,
|
||||||
|
["round"]=0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
["skill_position"]=2,
|
||||||
|
["name_act"]="support01"
|
||||||
|
},
|
||||||
[430011]={
|
[430011]={
|
||||||
["energy"]=10,
|
["energy"]=2,
|
||||||
["position"]=4,
|
["position"]=4,
|
||||||
["method"]=2,
|
["method"]=2,
|
||||||
["skill_type"]=0,
|
["skill_type"]=0,
|
||||||
@ -469,7 +589,7 @@ local skill = {
|
|||||||
["name_act"]="skill01"
|
["name_act"]="skill01"
|
||||||
},
|
},
|
||||||
[430012]={
|
[430012]={
|
||||||
["energy"]=10,
|
["energy"]=2,
|
||||||
["position"]=4,
|
["position"]=4,
|
||||||
["method"]=2,
|
["method"]=2,
|
||||||
["skill_type"]=1,
|
["skill_type"]=1,
|
||||||
@ -967,6 +1087,6 @@ local skill = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
local config = {
|
local config = {
|
||||||
data=skill,count=54
|
data=skill,count=62
|
||||||
}
|
}
|
||||||
return config
|
return config
|
||||||
@ -14,6 +14,8 @@ BattleConst.MAX_ELEMENT_WIGHT = 500
|
|||||||
BattleConst.SIDE_ATK = 1
|
BattleConst.SIDE_ATK = 1
|
||||||
BattleConst.SIDE_DEF = 2
|
BattleConst.SIDE_DEF = 2
|
||||||
BattleConst.SKILL_TYPE_ACTIVE = 1
|
BattleConst.SKILL_TYPE_ACTIVE = 1
|
||||||
|
BattleConst.SKILL_TYPE_NORMAL = 2
|
||||||
|
BattleConst.SKILL_TYPE_ASSISTING = 3
|
||||||
BattleConst.SKILL_SELECT_COUNT = 3
|
BattleConst.SKILL_SELECT_COUNT = 3
|
||||||
BattleConst.DEFAULT_FACTOR = 10000
|
BattleConst.DEFAULT_FACTOR = 10000
|
||||||
BattleConst.INIT_POS_X = 200 -- 战斗单位初始化的坐标
|
BattleConst.INIT_POS_X = 200 -- 战斗单位初始化的坐标
|
||||||
@ -62,6 +64,7 @@ BattleConst.UNIT_STATE = {
|
|||||||
ENTER_BATTLEFIELD = 6, -- 进入战场
|
ENTER_BATTLEFIELD = 6, -- 进入战场
|
||||||
SWITCH_IN = 7, -- 入场
|
SWITCH_IN = 7, -- 入场
|
||||||
SWITCH_OUT = 8, -- 离场
|
SWITCH_OUT = 8, -- 离场
|
||||||
|
ASSISTING_ATTACK = 9, -- 协助攻击
|
||||||
}
|
}
|
||||||
|
|
||||||
BattleConst.MATCH_DMG_ADDITION_NAME = {
|
BattleConst.MATCH_DMG_ADDITION_NAME = {
|
||||||
|
|||||||
@ -61,6 +61,7 @@ function BattleUnitComp:_initBase()
|
|||||||
self.activeSkillIndex = nil
|
self.activeSkillIndex = nil
|
||||||
self.currActiveSkill = nil
|
self.currActiveSkill = nil
|
||||||
self.targetX = nil
|
self.targetX = nil
|
||||||
|
self.assistingDmgAddition = 0
|
||||||
self.currState = UNIT_STATE.INIT
|
self.currState = UNIT_STATE.INIT
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -103,6 +104,23 @@ function BattleUnitComp:getAnimationDuration(aniName)
|
|||||||
return duration or 0
|
return duration or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleUnitComp:useAssistingSkill(count, callback)
|
||||||
|
local skill = self.unitEntity:getAssistingSkill()
|
||||||
|
if skill == nil then
|
||||||
|
callback()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self.assistingDmgAddition = count
|
||||||
|
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()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function BattleUnitComp:useSkill(index, count, callback)
|
function BattleUnitComp:useSkill(index, count, callback)
|
||||||
self.actionOverCallback = callback
|
self.actionOverCallback = callback
|
||||||
self.activeSkillIndex = index
|
self.activeSkillIndex = index
|
||||||
@ -181,6 +199,8 @@ function BattleUnitComp:changeState(state)
|
|||||||
self:exitNormalAttackState()
|
self:exitNormalAttackState()
|
||||||
elseif self.currState == UNIT_STATE.SKILL_ATTACK then
|
elseif self.currState == UNIT_STATE.SKILL_ATTACK then
|
||||||
self:exitSkillAttackState()
|
self:exitSkillAttackState()
|
||||||
|
elseif self.currState == UNIT_STATE.ASSISTING_ATTACK then
|
||||||
|
self:exitAssistingAttackState()
|
||||||
elseif self.currState == UNIT_STATE.DEAD then
|
elseif self.currState == UNIT_STATE.DEAD then
|
||||||
self:exitDeadState()
|
self:exitDeadState()
|
||||||
elseif self.currState == UNIT_STATE.ENTER_BATTLEFIELD then
|
elseif self.currState == UNIT_STATE.ENTER_BATTLEFIELD then
|
||||||
@ -198,6 +218,8 @@ 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
|
||||||
|
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 self.currState == UNIT_STATE.BORN then
|
||||||
@ -344,6 +366,42 @@ function BattleUnitComp:updateHurt(dt)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleUnitComp:enterAssistingAttackState()
|
||||||
|
self.attackOver = false
|
||||||
|
self.attackTime = 0
|
||||||
|
self.isMove = false
|
||||||
|
self.currAttackKeyTime = 0.3
|
||||||
|
local skill = self.unitEntity:getAssistingSkill()
|
||||||
|
local attackName = skill:getSkillAttackName()
|
||||||
|
self.currAttackDuration = self:getAnimationDuration(attackName)
|
||||||
|
self:playAnimation(attackName, false, false)
|
||||||
|
self:initPosition()
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleUnitComp:exitAssistingAttackState()
|
||||||
|
self:hideOutsideScreen()
|
||||||
|
if self.assistingDmgAddition > 0 then
|
||||||
|
local attrName = GConst.MATCH_ATTACK_NAME[self:getMatchType()]
|
||||||
|
self.unitEntity:addAttr(attrName, -self.assistingDmgAddCount, false)
|
||||||
|
self.assistingDmgAddition = 0
|
||||||
|
self.assistingDmgAddCount = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleUnitComp:updateAssistingAttackState(dt)
|
||||||
|
self.attackTime = self.attackTime + dt
|
||||||
|
if self.attackTime >= self.currAttackDuration then
|
||||||
|
self.attackOver = true
|
||||||
|
self:onAttackOver()
|
||||||
|
else
|
||||||
|
if self.currAttackKeyTime > 0 and self.attackTime >= self.currAttackKeyTime then -- 到达关键后使用
|
||||||
|
self.currAttackKeyTime = 0
|
||||||
|
local skill = self.unitEntity:getAssistingSkill()
|
||||||
|
self:onSkillTakeEffect(skill)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function BattleUnitComp:enterSkillAttackState()
|
function BattleUnitComp:enterSkillAttackState()
|
||||||
self.attackOver = false
|
self.attackOver = false
|
||||||
self.attackTime = 0
|
self.attackTime = 0
|
||||||
@ -701,6 +759,8 @@ function BattleUnitComp:tick(dt)
|
|||||||
self:updateNormalAttack(dt)
|
self:updateNormalAttack(dt)
|
||||||
elseif self.currState == UNIT_STATE.SKILL_ATTACK then
|
elseif self.currState == UNIT_STATE.SKILL_ATTACK then
|
||||||
self:updateSkillAttack(dt)
|
self:updateSkillAttack(dt)
|
||||||
|
elseif self.currState == UNIT_STATE.ASSISTING_ATTACK then
|
||||||
|
self:updateAssistingAttackState(dt)
|
||||||
elseif self.currState == UNIT_STATE.ENTER_BATTLEFIELD then
|
elseif self.currState == UNIT_STATE.ENTER_BATTLEFIELD then
|
||||||
self:updateEnterBattlefieldState(dt)
|
self:updateEnterBattlefieldState(dt)
|
||||||
elseif self.currState == UNIT_STATE.SWITCH_IN then
|
elseif self.currState == UNIT_STATE.SWITCH_IN then
|
||||||
|
|||||||
@ -681,16 +681,20 @@ function BattleController:generateInstructions(skillEntity, elementType, influen
|
|||||||
end
|
end
|
||||||
|
|
||||||
local elementTypeCount = 0
|
local elementTypeCount = 0
|
||||||
|
local assistingList = nil
|
||||||
---- 援助
|
---- 援助
|
||||||
for element, count in pairs(elementTypeMap) do
|
for element, count in pairs(elementTypeMap) do
|
||||||
if element == elementType then
|
if element == elementType then
|
||||||
elementTypeCount = count
|
elementTypeCount = count
|
||||||
else
|
else
|
||||||
table.insert(self.instructions, {
|
if assistingList == nil then
|
||||||
name = BattleConst.INSTRUCTION_NAME.ASSISTING,
|
assistingList = {}
|
||||||
|
end
|
||||||
|
local obj = {
|
||||||
count = count,
|
count = count,
|
||||||
skillMatch = element,
|
skillMatch = element,
|
||||||
})
|
}
|
||||||
|
table.insert(assistingList, obj)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -711,6 +715,13 @@ function BattleController:generateInstructions(skillEntity, elementType, influen
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if assistingList then
|
||||||
|
table.insert(self.instructions, {
|
||||||
|
name = BattleConst.INSTRUCTION_NAME.ASSISTING,
|
||||||
|
assistingList = assistingList,
|
||||||
|
})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleController:exeInstructions(callback)
|
function BattleController:exeInstructions(callback)
|
||||||
@ -1223,12 +1234,11 @@ local function _addCurRoundAttr(self, instruction, callback)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function _assisting(self, instruction, callback)
|
local function _assisting(self, instruction, callback)
|
||||||
self:addBattleExp(instruction.count)
|
Logger.logHighlight("援助攻击")
|
||||||
callback()
|
self.atkTeam:useAssistingSkill(instruction.assistingList, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function _generalAttack(self, instruction, callback)
|
local function _generalAttack(self, instruction, callback)
|
||||||
self:addBattleExp(instruction.count) -- 先直接加
|
|
||||||
self.atkTeam:useNormalSkill(instruction.skillMatch, instruction.count, callback)
|
self.atkTeam:useNormalSkill(instruction.skillMatch, instruction.count, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ BattleFormula.calculateFormula = {
|
|||||||
end,
|
end,
|
||||||
-- 角色攻击力*技能倍率*(1+治疗效果增加)
|
-- 角色攻击力*技能倍率*(1+治疗效果增加)
|
||||||
[3] = function(unitComp, buff, targetUnit)
|
[3] = function(unitComp, buff, targetUnit)
|
||||||
local result = targetUnit.unitEntity:getAtk() * buff:getEffectNum() // DEFAULT_FACTOR * (unitComp.unitEntity:getCureAddition() + DEFAULT_FACTOR) // DEFAULT_FACTOR
|
local result = unitComp.unitEntity:getAtk() * buff:getEffectNum() // DEFAULT_FACTOR * (unitComp.unitEntity:getCureAddition() + DEFAULT_FACTOR) // DEFAULT_FACTOR
|
||||||
return result, 0
|
return result, 0
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,6 +28,7 @@ function BattleHelper:loadBattleHeroModel(id, parent, callback)
|
|||||||
callback(spineObject)
|
callback(spineObject)
|
||||||
else
|
else
|
||||||
SpineManager:loadHeroAsync(id, parent, function(spineObject)
|
SpineManager:loadHeroAsync(id, parent, function(spineObject)
|
||||||
|
spineObject:setDefaultMix(0)
|
||||||
if self.characterMap then
|
if self.characterMap then
|
||||||
self.characterMap[spineObject:getInstanceID()] = spineObject
|
self.characterMap[spineObject:getInstanceID()] = spineObject
|
||||||
callback(spineObject)
|
callback(spineObject)
|
||||||
|
|||||||
@ -58,6 +58,27 @@ function BattleTeam:useSkill(matchType, count, callback)
|
|||||||
unit:useSkill(1, count, callback)
|
unit:useSkill(1, count, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleTeam:useAssistingSkill(assistingList, callback)
|
||||||
|
local count = #assistingList
|
||||||
|
if count <= 0 then
|
||||||
|
return callback()
|
||||||
|
end
|
||||||
|
local function finish()
|
||||||
|
count = count - 1
|
||||||
|
if count == 0 then
|
||||||
|
callback()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, v in ipairs(assistingList) do
|
||||||
|
local unit = self.unitMap[v.skillMatch]
|
||||||
|
if unit then
|
||||||
|
unit:useAssistingSkill(v.count, finish)
|
||||||
|
else
|
||||||
|
finish()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function BattleTeam:mainUnitUseAllSkills(callback)
|
function BattleTeam:mainUnitUseAllSkills(callback)
|
||||||
self.mainUnit:useAllSkills(callback)
|
self.mainUnit:useAllSkills(callback)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -378,6 +378,7 @@ function BattleData:initHeroData()
|
|||||||
normalSkill = heroEntity:getHurtSkill(),
|
normalSkill = heroEntity:getHurtSkill(),
|
||||||
activeSkills = {activeSkill},
|
activeSkills = {activeSkill},
|
||||||
normalSkillCount = heroEntity:getHurtNum(),
|
normalSkillCount = heroEntity:getHurtNum(),
|
||||||
|
assistingSkill = heroEntity:getAssistingSkill(),
|
||||||
attr = {
|
attr = {
|
||||||
hp = hp,
|
hp = hp,
|
||||||
max_hp = hp,
|
max_hp = hp,
|
||||||
@ -389,7 +390,6 @@ function BattleData:initHeroData()
|
|||||||
atk_purple = heroAttr[ATTR_TYPE.atk_purple] // DEFAULT_FACTOR,
|
atk_purple = heroAttr[ATTR_TYPE.atk_purple] // DEFAULT_FACTOR,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Logger.printTable(unitData)
|
|
||||||
table.insert(units, unitData)
|
table.insert(units, unitData)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -411,6 +411,7 @@ function BattleData:addMonster(monsterId, newTeam)
|
|||||||
normalSkill = monsterInfo.hurt_skill,
|
normalSkill = monsterInfo.hurt_skill,
|
||||||
activeSkills = monsterInfo.skill,
|
activeSkills = monsterInfo.skill,
|
||||||
normalSkillCount = monsterInfo.hurt_num,
|
normalSkillCount = monsterInfo.hurt_num,
|
||||||
|
assistingSkill = nil,
|
||||||
attr = {
|
attr = {
|
||||||
hp = hp,
|
hp = hp,
|
||||||
max_hp = hp,
|
max_hp = hp,
|
||||||
|
|||||||
@ -15,7 +15,10 @@ end
|
|||||||
function BattleUnitEntity:initSkill()
|
function BattleUnitEntity:initSkill()
|
||||||
self.activeSkills = {}
|
self.activeSkills = {}
|
||||||
if self.unitData.normalSkill then
|
if self.unitData.normalSkill then
|
||||||
self.normalSkill = BattleSkillEntity:create(self.unitData.normalSkill, GConst.BattleConst.SKILL_TYPE_ACTIVE, self)
|
self.normalSkill = BattleSkillEntity:create(self.unitData.normalSkill, GConst.BattleConst.SKILL_TYPE_NORMAL, self)
|
||||||
|
end
|
||||||
|
if self.unitData.assistingSkill then
|
||||||
|
self.assistingSkill = BattleSkillEntity:create(self.unitData.assistingSkill, GConst.BattleConst.SKILL_TYPE_ASSISTING, self)
|
||||||
end
|
end
|
||||||
if self.unitData.activeSkills then
|
if self.unitData.activeSkills then
|
||||||
for k, v in ipairs(self.unitData.activeSkills) do
|
for k, v in ipairs(self.unitData.activeSkills) do
|
||||||
@ -53,6 +56,10 @@ function BattleUnitEntity:getNormalSkill()
|
|||||||
return self.normalSkill
|
return self.normalSkill
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleUnitEntity:getAssistingSkill()
|
||||||
|
return self.assistingSkill
|
||||||
|
end
|
||||||
|
|
||||||
function BattleUnitEntity:getActiveSkill(index)
|
function BattleUnitEntity:getActiveSkill(index)
|
||||||
return self.activeSkills[index]
|
return self.activeSkills[index]
|
||||||
end
|
end
|
||||||
|
|||||||
@ -185,6 +185,10 @@ function HeroEntity:getActiveSkill()
|
|||||||
return self.config.base_skill
|
return self.config.base_skill
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function HeroEntity:getAssistingSkill()
|
||||||
|
return self.config.support_skill
|
||||||
|
end
|
||||||
|
|
||||||
function HeroEntity:getHurtSkill()
|
function HeroEntity:getHurtSkill()
|
||||||
return self.config.hurt_skill
|
return self.config.hurt_skill
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user