使用技能
This commit is contained in:
parent
5977527c8d
commit
602983faee
@ -81,6 +81,7 @@ function ConfigManager:preLoadConfig()
|
||||
local data = baseData[v.monster_base]
|
||||
if data then
|
||||
monsterFullData[k].model_id = data.model_id
|
||||
monsterFullData[k].hurt_num = data.hurt_num
|
||||
-- else
|
||||
-- Logger.logHighlight("not data monster_baseid = " .. v.monster_baseid)
|
||||
end
|
||||
|
||||
@ -1,92 +1,122 @@
|
||||
local monster_base = {
|
||||
[10001]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m10001"
|
||||
},
|
||||
[10002]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m10002"
|
||||
},
|
||||
[10003]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m10003"
|
||||
},
|
||||
[10004]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m10004"
|
||||
},
|
||||
[10005]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m10005"
|
||||
},
|
||||
[10006]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m10006"
|
||||
},
|
||||
[10007]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m10007"
|
||||
},
|
||||
[10008]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m10008"
|
||||
},
|
||||
[10009]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m10009"
|
||||
},
|
||||
[10010]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m10010"
|
||||
},
|
||||
[10011]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m10011"
|
||||
},
|
||||
[10012]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m10012"
|
||||
},
|
||||
[10013]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m10013"
|
||||
},
|
||||
[10014]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m10014"
|
||||
},
|
||||
[10015]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m10015"
|
||||
},
|
||||
[10016]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m10016"
|
||||
},
|
||||
[10017]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m10017"
|
||||
},
|
||||
[10018]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m10018"
|
||||
},
|
||||
[20001]={
|
||||
["hurt_num"]=1,
|
||||
["model_id"]="m0001"
|
||||
},
|
||||
[20002]={
|
||||
["hurt_num"]=1,
|
||||
["model_id"]="m0001"
|
||||
},
|
||||
[20003]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m0001"
|
||||
},
|
||||
[20004]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m0001"
|
||||
},
|
||||
[20005]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m0001"
|
||||
},
|
||||
[20006]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m0001"
|
||||
},
|
||||
[20007]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m0001"
|
||||
},
|
||||
[20008]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m0001"
|
||||
},
|
||||
[20009]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m0001"
|
||||
},
|
||||
[20010]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m0001"
|
||||
},
|
||||
[20011]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m0001"
|
||||
},
|
||||
[20012]={
|
||||
["hurt_num"]=3,
|
||||
["model_id"]="m0001"
|
||||
}
|
||||
}
|
||||
|
||||
@ -181,7 +181,8 @@ local skill = {
|
||||
},
|
||||
["icon"]=10,
|
||||
["battle_icon"]=1,
|
||||
["skill_position"]=1
|
||||
["skill_position"]=1,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[220011]={
|
||||
["energy"]=10,
|
||||
@ -201,7 +202,8 @@ local skill = {
|
||||
}
|
||||
},
|
||||
["obj"]=2,
|
||||
["skill_position"]=1
|
||||
["skill_position"]=1,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[220012]={
|
||||
["energy"]=10,
|
||||
@ -241,7 +243,8 @@ local skill = {
|
||||
["round"]=0
|
||||
}
|
||||
},
|
||||
["skill_position"]=1
|
||||
["skill_position"]=1,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[420011]={
|
||||
["energy"]=10,
|
||||
@ -256,7 +259,8 @@ local skill = {
|
||||
},
|
||||
["icon"]=30,
|
||||
["battle_icon"]=3,
|
||||
["skill_position"]=2
|
||||
["skill_position"]=2,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[520011]={
|
||||
["energy"]=10,
|
||||
@ -276,7 +280,8 @@ local skill = {
|
||||
}
|
||||
},
|
||||
["obj"]=1,
|
||||
["skill_position"]=2
|
||||
["skill_position"]=2,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[120011]={
|
||||
["energy"]=10,
|
||||
@ -295,7 +300,8 @@ local skill = {
|
||||
},
|
||||
["icon"]=50,
|
||||
["battle_icon"]=5,
|
||||
["skill_position"]=2
|
||||
["skill_position"]=2,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[330011]={
|
||||
["energy"]=10,
|
||||
@ -315,7 +321,8 @@ local skill = {
|
||||
}
|
||||
},
|
||||
["obj"]=1,
|
||||
["skill_position"]=2
|
||||
["skill_position"]=2,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[230011]={
|
||||
["energy"]=10,
|
||||
@ -458,7 +465,8 @@ local skill = {
|
||||
["round"]=1
|
||||
}
|
||||
},
|
||||
["skill_position"]=1
|
||||
["skill_position"]=1,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[430012]={
|
||||
["energy"]=10,
|
||||
@ -501,7 +509,8 @@ local skill = {
|
||||
["round"]=1
|
||||
}
|
||||
},
|
||||
["skill_position"]=1
|
||||
["skill_position"]=1,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[1000000]={
|
||||
["effect_type"]=1,
|
||||
@ -545,7 +554,8 @@ local skill = {
|
||||
["obj"]=1,
|
||||
["skill_position"]=2,
|
||||
["cd"]=3,
|
||||
["cd_start"]=3
|
||||
["cd_start"]=3,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[1000003]={
|
||||
["effect_type"]=1,
|
||||
@ -561,7 +571,8 @@ local skill = {
|
||||
["obj"]=2,
|
||||
["skill_position"]=1,
|
||||
["cd"]=4,
|
||||
["cd_start"]=4
|
||||
["cd_start"]=4,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[1000004]={
|
||||
["effect_type"]=1,
|
||||
@ -577,7 +588,8 @@ local skill = {
|
||||
["obj"]=1,
|
||||
["skill_position"]=2,
|
||||
["cd"]=2,
|
||||
["cd_start"]=2
|
||||
["cd_start"]=2,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[1000005]={
|
||||
["effect_type"]=2,
|
||||
@ -612,7 +624,8 @@ local skill = {
|
||||
["obj"]=2,
|
||||
["skill_position"]=1,
|
||||
["cd"]=3,
|
||||
["cd_start"]=3
|
||||
["cd_start"]=3,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[1000007]={
|
||||
["effect_type"]=2,
|
||||
@ -637,7 +650,8 @@ local skill = {
|
||||
["obj"]=2,
|
||||
["skill_position"]=2,
|
||||
["cd"]=2,
|
||||
["cd_start"]=2
|
||||
["cd_start"]=2,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[1000009]={
|
||||
["effect_type"]=2,
|
||||
@ -668,7 +682,8 @@ local skill = {
|
||||
["obj"]=2,
|
||||
["skill_position"]=2,
|
||||
["cd"]=2,
|
||||
["cd_start"]=2
|
||||
["cd_start"]=2,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[1000011]={
|
||||
["effect_type"]=1,
|
||||
@ -684,7 +699,8 @@ local skill = {
|
||||
["obj"]=2,
|
||||
["skill_position"]=2,
|
||||
["cd"]=2,
|
||||
["cd_start"]=2
|
||||
["cd_start"]=2,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[1000012]={
|
||||
["effect_type"]=2,
|
||||
@ -714,7 +730,8 @@ local skill = {
|
||||
["obj"]=1,
|
||||
["skill_position"]=2,
|
||||
["cd"]=3,
|
||||
["cd_start"]=3
|
||||
["cd_start"]=3,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[1000014]={
|
||||
["effect_type"]=2,
|
||||
@ -739,7 +756,8 @@ local skill = {
|
||||
["obj"]=2,
|
||||
["skill_position"]=2,
|
||||
["cd"]=2,
|
||||
["cd_start"]=2
|
||||
["cd_start"]=2,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[1000016]={
|
||||
["skill_type"]=3,
|
||||
@ -750,7 +768,8 @@ local skill = {
|
||||
["obj"]=2,
|
||||
["skill_position"]=2,
|
||||
["cd"]=2,
|
||||
["cd_start"]=2
|
||||
["cd_start"]=2,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[1000017]={
|
||||
["effect_type"]=2,
|
||||
@ -767,7 +786,7 @@ local skill = {
|
||||
["skill_position"]=2
|
||||
},
|
||||
[1000018]={
|
||||
["effect_type"]=1,
|
||||
["effect_type"]=2,
|
||||
["trigger"]=3,
|
||||
["effect"]={
|
||||
{
|
||||
@ -796,7 +815,8 @@ local skill = {
|
||||
["obj"]=1,
|
||||
["skill_position"]=2,
|
||||
["cd"]=3,
|
||||
["cd_start"]=3
|
||||
["cd_start"]=3,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[1000020]={
|
||||
["effect_type"]=2,
|
||||
@ -821,10 +841,11 @@ local skill = {
|
||||
["obj"]=2,
|
||||
["skill_position"]=2,
|
||||
["cd"]=2,
|
||||
["cd_start"]=2
|
||||
["cd_start"]=2,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[1000022]={
|
||||
["effect_type"]=1,
|
||||
["effect_type"]=2,
|
||||
["trigger"]=3,
|
||||
["effect"]={
|
||||
{
|
||||
@ -848,7 +869,8 @@ local skill = {
|
||||
["obj"]=2,
|
||||
["skill_position"]=2,
|
||||
["cd"]=3,
|
||||
["cd_start"]=3
|
||||
["cd_start"]=3,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[1000024]={
|
||||
["skill_type"]=3,
|
||||
@ -859,7 +881,8 @@ local skill = {
|
||||
["obj"]=2,
|
||||
["skill_position"]=2,
|
||||
["cd"]=3,
|
||||
["cd_start"]=3
|
||||
["cd_start"]=3,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[1000025]={
|
||||
["effect_type"]=2,
|
||||
@ -889,7 +912,8 @@ local skill = {
|
||||
["obj"]=2,
|
||||
["skill_position"]=2,
|
||||
["cd"]=2,
|
||||
["cd_start"]=2
|
||||
["cd_start"]=2,
|
||||
["name_act"]="skill_01"
|
||||
},
|
||||
[1000027]={
|
||||
["effect_type"]=2,
|
||||
@ -906,7 +930,7 @@ local skill = {
|
||||
["skill_position"]=2
|
||||
},
|
||||
[1000028]={
|
||||
["effect_type"]=1,
|
||||
["effect_type"]=2,
|
||||
["trigger"]=3,
|
||||
["effect"]={
|
||||
{
|
||||
|
||||
@ -727,10 +727,16 @@ local skill_rogue = {
|
||||
["weight"]=3000,
|
||||
["qlt"]=2,
|
||||
["type"]=3,
|
||||
["parameter"]={
|
||||
1000
|
||||
},
|
||||
["skill_position"]=3,
|
||||
["effect"]={
|
||||
{
|
||||
["type"]="atkp",
|
||||
["num"]=1000,
|
||||
["ratio"]=10000,
|
||||
["round"]=1
|
||||
}
|
||||
},
|
||||
["obj"]=1,
|
||||
["icon"]=200102
|
||||
},
|
||||
[200103]={
|
||||
@ -766,10 +772,16 @@ local skill_rogue = {
|
||||
["weight"]=3000,
|
||||
["qlt"]=2,
|
||||
["type"]=3,
|
||||
["parameter"]={
|
||||
1000
|
||||
},
|
||||
["skill_position"]=2,
|
||||
["effect"]={
|
||||
{
|
||||
["type"]="atkp",
|
||||
["num"]=1000,
|
||||
["ratio"]=10000,
|
||||
["round"]=1
|
||||
}
|
||||
},
|
||||
["obj"]=1,
|
||||
["icon"]=200202
|
||||
},
|
||||
[200203]={
|
||||
@ -796,10 +808,16 @@ local skill_rogue = {
|
||||
["weight"]=3000,
|
||||
["qlt"]=2,
|
||||
["type"]=11,
|
||||
["parameter"]={
|
||||
1000
|
||||
},
|
||||
["skill_position"]=4,
|
||||
["effect"]={
|
||||
{
|
||||
["type"]="atkp",
|
||||
["num"]=1000,
|
||||
["ratio"]=10000,
|
||||
["round"]=1
|
||||
}
|
||||
},
|
||||
["obj"]=1,
|
||||
["icon"]=200302
|
||||
},
|
||||
[200303]={
|
||||
@ -871,10 +889,16 @@ local skill_rogue = {
|
||||
["weight"]=3000,
|
||||
["qlt"]=2,
|
||||
["type"]=3,
|
||||
["parameter"]={
|
||||
1000
|
||||
},
|
||||
["skill_position"]=1,
|
||||
["effect"]={
|
||||
{
|
||||
["type"]="atkp",
|
||||
["num"]=1000,
|
||||
["ratio"]=10000,
|
||||
["round"]=1
|
||||
}
|
||||
},
|
||||
["obj"]=1,
|
||||
["icon"]=200502
|
||||
},
|
||||
[200503]={
|
||||
@ -907,10 +931,16 @@ local skill_rogue = {
|
||||
["weight"]=3000,
|
||||
["qlt"]=2,
|
||||
["type"]=3,
|
||||
["parameter"]={
|
||||
1000
|
||||
},
|
||||
["skill_position"]=3,
|
||||
["effect"]={
|
||||
{
|
||||
["type"]="atkp",
|
||||
["num"]=1000,
|
||||
["ratio"]=10000,
|
||||
["round"]=1
|
||||
}
|
||||
},
|
||||
["obj"]=1,
|
||||
["icon"]=200602
|
||||
},
|
||||
[200603]={
|
||||
@ -923,7 +953,7 @@ local skill_rogue = {
|
||||
{
|
||||
["type"]="heal",
|
||||
["num"]=500,
|
||||
["ratio"]=1000,
|
||||
["ratio"]=10000,
|
||||
["round"]=1
|
||||
}
|
||||
},
|
||||
@ -946,10 +976,16 @@ local skill_rogue = {
|
||||
["weight"]=3000,
|
||||
["qlt"]=2,
|
||||
["type"]=3,
|
||||
["parameter"]={
|
||||
1000
|
||||
},
|
||||
["skill_position"]=2,
|
||||
["effect"]={
|
||||
{
|
||||
["type"]="atkp",
|
||||
["num"]=1000,
|
||||
["ratio"]=10000,
|
||||
["round"]=1
|
||||
}
|
||||
},
|
||||
["obj"]=1,
|
||||
["icon"]=200702
|
||||
},
|
||||
[200703]={
|
||||
@ -979,10 +1015,16 @@ local skill_rogue = {
|
||||
["weight"]=3000,
|
||||
["qlt"]=2,
|
||||
["type"]=3,
|
||||
["parameter"]={
|
||||
1000
|
||||
},
|
||||
["skill_position"]=4,
|
||||
["effect"]={
|
||||
{
|
||||
["type"]="atkp",
|
||||
["num"]=1000,
|
||||
["ratio"]=10000,
|
||||
["round"]=1
|
||||
}
|
||||
},
|
||||
["obj"]=1,
|
||||
["icon"]=200802
|
||||
},
|
||||
[200803]={
|
||||
|
||||
@ -103,11 +103,12 @@ function BattleUnitComp:getAnimationDuration(aniName)
|
||||
return duration or 0
|
||||
end
|
||||
|
||||
function BattleUnitComp:useSkill(index, callback)
|
||||
function BattleUnitComp:useSkill(index, count, callback)
|
||||
self.actionOverCallback = callback
|
||||
self.normalSkillCount = count + self.unitEntity:getNormalAttackAddCount()
|
||||
self.activeSkillIndex = nil
|
||||
self.currActiveSkill = self.unitEntity:getActiveSkill(index)
|
||||
if self.currActiveSkill == nil then
|
||||
if self.currActiveSkill == nil and self.normalSkillCount <= 0 then
|
||||
self.actionOverCallback = nil
|
||||
callback()
|
||||
return
|
||||
@ -120,23 +121,25 @@ end
|
||||
|
||||
function BattleUnitComp:useAllSkills(callback)
|
||||
self.actionOverCallback = callback
|
||||
self.normalSkillCount = self.unitEntity:getNormalSkillCount() + self.unitEntity:getNormalAttackAddCount()
|
||||
self.activeSkillIndex = 1
|
||||
self.currActiveSkill = self.unitEntity:getActiveSkill(self.activeSkillIndex)
|
||||
if self.currActiveSkill == nil then
|
||||
if self.currActiveSkill == nil then -- 没有技能就用普攻
|
||||
if not self:changeState(UNIT_STATE.NORMAL_ATTACK) then
|
||||
self.actionOverCallback = nil
|
||||
callback()
|
||||
return
|
||||
end
|
||||
else
|
||||
if not self:changeState(UNIT_STATE.SKILL_ATTACK) then
|
||||
self.actionOverCallback = nil
|
||||
callback()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function BattleUnitComp:useNormalSkill(count, callback)
|
||||
self.baseObject:getTransform():SetAsLastSibling()
|
||||
self.actionOverCallback = callback
|
||||
self.normalSkillCount = count + self.unitEntity:getNormalAttackCount()
|
||||
self.normalSkillCount = count + self.unitEntity:getNormalAttackAddCount()
|
||||
if not self:changeState(UNIT_STATE.NORMAL_ATTACK) then
|
||||
self.actionOverCallback = nil
|
||||
callback()
|
||||
@ -285,7 +288,7 @@ end
|
||||
function BattleUnitComp:enterEnterBattlefieldState()
|
||||
self:hideOutsideScreen()
|
||||
self.isMove = true
|
||||
self:playAnimation(SPINE_ANIMATION_NAME.MOVE, true, false)
|
||||
self:playAnimation(SPINE_ANIMATION_NAME.BORN, true, false)
|
||||
self.positionX = self.baseObject:fastGetLocalPosition()
|
||||
if self.side == BattleConst.SIDE_ATK then
|
||||
self.targetX = -BattleConst.INIT_POS_X
|
||||
@ -389,7 +392,14 @@ function BattleUnitComp:updateSkillAttack(dt)
|
||||
end
|
||||
else -- 到位置该攻击了
|
||||
self.attackTime = 0
|
||||
local attackName = self.currActiveSkill:getSkillAttackName()
|
||||
self.currAttackKeyTime = 0.3
|
||||
local attackName = nil
|
||||
if self.normalSkillCount > 0 then
|
||||
local skill = self.unitEntity:getNormalSkill()
|
||||
attackName = skill:getRandomNormalAttackName()
|
||||
else
|
||||
attackName = self.currActiveSkill:getSkillAttackName()
|
||||
end
|
||||
self.currAttackDuration = self:getAnimationDuration(attackName)
|
||||
self:playAnimation(attackName, false, false)
|
||||
end
|
||||
@ -400,6 +410,10 @@ function BattleUnitComp:updateSkillAttack(dt)
|
||||
self.attackTime = self.attackTime + dt
|
||||
if self.attackTime >= self.currAttackDuration then
|
||||
self.attackOver = true
|
||||
if self.normalSkillCount > 0 then
|
||||
self.normalSkillCount = self.normalSkillCount - 1
|
||||
end
|
||||
if self.normalSkillCount <= 0 then
|
||||
local currActiveSkill = nil
|
||||
if self.activeSkillIndex then
|
||||
self.activeSkillIndex = self.activeSkillIndex + 1
|
||||
@ -426,7 +440,7 @@ function BattleUnitComp:updateSkillAttack(dt)
|
||||
end
|
||||
end
|
||||
return
|
||||
else -- 继续攻击
|
||||
else
|
||||
self.currActiveSkill = currActiveSkill
|
||||
self.attackTime = 0
|
||||
self.currAttackKeyTime = 0.3
|
||||
@ -434,12 +448,25 @@ function BattleUnitComp:updateSkillAttack(dt)
|
||||
self.currAttackDuration = self:getAnimationDuration(attackName)
|
||||
self:playAnimation(attackName, false, false)
|
||||
end
|
||||
else -- 继续攻击
|
||||
self.attackTime = 0
|
||||
self.currAttackKeyTime = 0.3
|
||||
local skill = self.unitEntity:getNormalSkill()
|
||||
local attackName = skill:getRandomNormalAttackName()
|
||||
self.currAttackDuration = self:getAnimationDuration(attackName)
|
||||
self:playAnimation(attackName, false, false)
|
||||
end
|
||||
else
|
||||
if self.currAttackKeyTime > 0 and self.attackTime >= self.currAttackKeyTime then -- 到达关键后使用
|
||||
self.currAttackKeyTime = 0
|
||||
if self.normalSkillCount > 0 then
|
||||
local skill = self.unitEntity:getNormalSkill()
|
||||
self:onSkillTakeEffect(skill)
|
||||
else
|
||||
self:onSkillTakeEffect(self.currActiveSkill)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function BattleUnitComp:enterNormalAttackState()
|
||||
@ -487,6 +514,7 @@ function BattleUnitComp:updateNormalAttack(dt)
|
||||
end
|
||||
else -- 到位置该攻击了
|
||||
self.attackTime = 0
|
||||
self.currAttackKeyTime = 0.3
|
||||
local skill = self.unitEntity:getNormalSkill()
|
||||
local attackName = skill:getRandomNormalAttackName()
|
||||
self.currAttackDuration = self:getAnimationDuration(attackName)
|
||||
@ -624,13 +652,9 @@ function BattleUnitComp:takeDamageOrCure(atker, buff, num, effectType, effectSta
|
||||
self:showEffectNumber(num, x, y)
|
||||
self.battleController:refreshHp(self.side, self.unitEntity:getHp(), self.unitEntity:getHpPercent())
|
||||
|
||||
-- local shieldHp = self.unitEntity:getShieldHp()
|
||||
-- if shieldHp and shieldHp.value > 0 then
|
||||
-- local percent = self.unitEntity:getShieldHpPercent()
|
||||
-- self.controlUnitComp:RefreshShieldBar(percent, true)
|
||||
-- else
|
||||
-- self.controlUnitComp:RefreshShieldBar(0, false)
|
||||
-- end
|
||||
if self.currState == UNIT_STATE.IDLE then
|
||||
self:playHurt()
|
||||
end
|
||||
end
|
||||
|
||||
function BattleUnitComp:showEffectNumber(num, x, y)
|
||||
|
||||
@ -1233,7 +1233,7 @@ local function _generalAttack(self, instruction, callback)
|
||||
end
|
||||
|
||||
local function _playSkill(self, instruction, callback)
|
||||
self.atkTeam:useSkill(instruction.skillMatch, callback)
|
||||
self.atkTeam:useSkill(instruction.skillMatch, instruction.count, callback)
|
||||
end
|
||||
|
||||
BattleController._doInstruction = {
|
||||
|
||||
@ -44,7 +44,7 @@ function BattleTeam:useNormalSkill(matchType, count, callback)
|
||||
unit:useNormalSkill(count, callback)
|
||||
end
|
||||
|
||||
function BattleTeam:useSkill(matchType, callback)
|
||||
function BattleTeam:useSkill(matchType, count, callback)
|
||||
local unit = nil
|
||||
if matchType == nil then
|
||||
unit = self.unitList[1]
|
||||
@ -55,7 +55,7 @@ function BattleTeam:useSkill(matchType, callback)
|
||||
return callback()
|
||||
end
|
||||
self.mainUnit = unit
|
||||
unit:useSkill(1, callback)
|
||||
unit:useSkill(1, count, callback)
|
||||
end
|
||||
|
||||
function BattleTeam:mainUnitUseAllSkills(callback)
|
||||
|
||||
@ -377,6 +377,7 @@ function BattleData:initHeroData()
|
||||
matchType = matchType,
|
||||
normalSkill = heroEntity:getHurtSkill(),
|
||||
activeSkills = {activeSkill},
|
||||
normalSkillCount = heroEntity:getHurtNum(),
|
||||
attr = {
|
||||
hp = hp,
|
||||
max_hp = hp,
|
||||
@ -409,6 +410,7 @@ function BattleData:addMonster(monsterId, newTeam)
|
||||
matchType = 0,
|
||||
normalSkill = monsterInfo.hurt_skill,
|
||||
activeSkills = monsterInfo.skill,
|
||||
normalSkillCount = monsterInfo.hurt_num,
|
||||
attr = {
|
||||
hp = hp,
|
||||
max_hp = hp,
|
||||
@ -426,4 +428,16 @@ function BattleData:addMonster(monsterId, newTeam)
|
||||
return self.defTeam:addUnit(unitData)
|
||||
end
|
||||
|
||||
function BattleData:getNormalAttackName(index)
|
||||
if self.normalAttackName == nil then
|
||||
self.normalAttackName = {}
|
||||
end
|
||||
local name = self.normalAttackName[index]
|
||||
if name == nil then
|
||||
name = string.format("attack%02d", index)
|
||||
self.normalAttackName[index] = name
|
||||
end
|
||||
return name
|
||||
end
|
||||
|
||||
return BattleData
|
||||
@ -31,7 +31,11 @@ end
|
||||
|
||||
function BattleSkillEntity:getRandomNormalAttackName()
|
||||
if self.normalSkillNameList == nil then
|
||||
self.normalSkillNameList = {"attack01", "attack02", "attack03"}
|
||||
local normalSkillNameList, count = self.owner:getNormalSkillNameList()
|
||||
self.normalSkillNameList = {}
|
||||
for i = 1, count do
|
||||
self.normalSkillNameList[i] = normalSkillNameList[i]
|
||||
end
|
||||
end
|
||||
if self.normalSkillNameIndex == nil then
|
||||
self.normalSkillNameIndex = math.random(1, #self.normalSkillNameList)
|
||||
@ -45,8 +49,7 @@ function BattleSkillEntity:getRandomNormalAttackName()
|
||||
end
|
||||
|
||||
function BattleSkillEntity:getSkillAttackName()
|
||||
-- return self.skillInfo.name_act
|
||||
return "attack01"
|
||||
return self.skillInfo.name_act
|
||||
end
|
||||
|
||||
function BattleSkillEntity:getEffectList()
|
||||
|
||||
@ -161,7 +161,7 @@ function BattleTeamEntity:getCureAddition()
|
||||
return self.attr.cure_addition or 0
|
||||
end
|
||||
|
||||
function BattleTeamEntity:getNormalAttackCount()
|
||||
function BattleTeamEntity:getNormalAttackAddCount()
|
||||
return self.attr[ATTR_NAME.NORMAL_ATTACK_COUNT] or 0
|
||||
end
|
||||
|
||||
|
||||
@ -57,6 +57,21 @@ function BattleUnitEntity:getActiveSkill(index)
|
||||
return self.activeSkills[index]
|
||||
end
|
||||
|
||||
function BattleUnitEntity:getNormalSkillCount()
|
||||
return self.unitData.normalSkillCount or 0
|
||||
end
|
||||
|
||||
function BattleUnitEntity:getNormalSkillNameList()
|
||||
local count = self.unitData.normalSkillCount or 0
|
||||
if self.normalSkillNameList == nil then
|
||||
self.normalSkillNameList = {}
|
||||
for i = 1, count do
|
||||
table.insert(self.normalSkillNameList, DataManager.BattleData:getNormalAttackName(i))
|
||||
end
|
||||
end
|
||||
return self.normalSkillNameList, count
|
||||
end
|
||||
|
||||
function BattleUnitEntity:takeDamageOrCure(num)
|
||||
return self.team:takeDamageOrCure(num)
|
||||
end
|
||||
@ -97,8 +112,8 @@ function BattleUnitEntity:getCureAddition()
|
||||
return self.team:getCureAddition()
|
||||
end
|
||||
|
||||
function BattleUnitEntity:getNormalAttackCount()
|
||||
return self.team:getNormalAttackCount()
|
||||
function BattleUnitEntity:getNormalAttackAddCount()
|
||||
return self.team:getNormalAttackAddCount()
|
||||
end
|
||||
|
||||
function BattleUnitEntity:addLimit(name)
|
||||
|
||||
@ -197,6 +197,10 @@ function HeroEntity:getIcon()
|
||||
return self.config.icon
|
||||
end
|
||||
|
||||
function HeroEntity:getHurtNum()
|
||||
return self.config.hurt_num
|
||||
end
|
||||
|
||||
function HeroEntity:getName()
|
||||
return I18N:getConfig("hero")[self:getCfgId()].name
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user