普攻改成数组

This commit is contained in:
chenxi 2023-04-21 17:11:59 +08:00
parent c6ea40de7e
commit 2a9f4350b0
12 changed files with 3060 additions and 962 deletions

View File

@ -63,6 +63,18 @@ local fx = {
["res"]="sfx_m10016_b03",
["bind"]="root"
},
[100016]={
["res"]="sfx_m10008_b01",
["bind"]="root"
},
[100017]={
["res"]="sfx_m10008_b02",
["bind"]="root"
},
[100018]={
["res"]="sfx_m10008_b03",
["bind"]="root"
},
[200000]={
["res"]="sfx_m20001_b01",
["bind"]="root"
@ -357,6 +369,6 @@ local fx = {
}
}
local config = {
data=fx,count=89
data=fx,count=92
}
return config

View File

@ -2,10 +2,15 @@ local hero = {
[12001]={
["position"]=1,
["qlt"]=2,
["hurt_skill"]=1,
["hurt_skill"]={
1200111,
1200112,
1200113,
1200114
},
["hurt_num"]=3,
["base_skill"]=120011,
["support_skill"]=120010,
["base_skill"]=1200120,
["support_skill"]=1200110,
["rouge_skill"]=200500,
["rouge_skill_1"]=200501,
["rouge_skill_2"]=200502,
@ -53,10 +58,15 @@ local hero = {
[22001]={
["position"]=2,
["qlt"]=2,
["hurt_skill"]=2,
["hurt_skill"]={
2200111,
2200112,
2200113,
2200114
},
["hurt_num"]=3,
["base_skill"]=220011,
["support_skill"]=220010,
["base_skill"]=2200120,
["support_skill"]=2200110,
["rouge_skill"]=200200,
["rouge_skill_1"]=200201,
["rouge_skill_2"]=200202,
@ -104,10 +114,15 @@ local hero = {
[23001]={
["position"]=2,
["qlt"]=3,
["hurt_skill"]=2,
["hurt_skill"]={
2300111,
2300112,
2300113,
2300114
},
["hurt_num"]=3,
["base_skill"]=230011,
["support_skill"]=230010,
["base_skill"]=2300120,
["support_skill"]=2300110,
["rouge_skill"]=200700,
["rouge_skill_1"]=200701,
["rouge_skill_2"]=200702,
@ -155,10 +170,15 @@ local hero = {
[32001]={
["position"]=3,
["qlt"]=2,
["hurt_skill"]=3,
["hurt_skill"]={
3200111,
3200112,
3200113,
3200114
},
["hurt_num"]=3,
["base_skill"]=320011,
["support_skill"]=320010,
["base_skill"]=3200120,
["support_skill"]=3200110,
["rouge_skill"]=200100,
["rouge_skill_1"]=200101,
["rouge_skill_2"]=200102,
@ -206,10 +226,15 @@ local hero = {
[33001]={
["position"]=3,
["qlt"]=3,
["hurt_skill"]=3,
["hurt_skill"]={
3300111,
3300112,
3300113,
3300114
},
["hurt_num"]=3,
["base_skill"]=330011,
["support_skill"]=330010,
["base_skill"]=3300120,
["support_skill"]=3300110,
["rouge_skill"]=200600,
["rouge_skill_1"]=200601,
["rouge_skill_2"]=200602,
@ -257,10 +282,15 @@ local hero = {
[42001]={
["position"]=4,
["qlt"]=2,
["hurt_skill"]=9,
["hurt_skill"]={
4200111,
4200112,
4200113,
4200114
},
["hurt_num"]=3,
["base_skill"]=420011,
["support_skill"]=420010,
["base_skill"]=4200120,
["support_skill"]=4200110,
["rouge_skill"]=200300,
["rouge_skill_1"]=200301,
["rouge_skill_2"]=200302,
@ -308,10 +338,15 @@ local hero = {
[43001]={
["position"]=4,
["qlt"]=3,
["hurt_skill"]=4,
["hurt_skill"]={
4300111,
4300112,
4300113,
4300114
},
["hurt_num"]=3,
["base_skill"]=430011,
["support_skill"]=430010,
["base_skill"]=4300120,
["support_skill"]=4300110,
["rouge_skill"]=200800,
["rouge_skill_1"]=200801,
["rouge_skill_2"]=200802,
@ -359,10 +394,15 @@ local hero = {
[52001]={
["position"]=5,
["qlt"]=2,
["hurt_skill"]=5,
["hurt_skill"]={
5200111,
5200112,
5200113,
5200114
},
["hurt_num"]=3,
["base_skill"]=520011,
["support_skill"]=520010,
["base_skill"]=5200120,
["support_skill"]=5200110,
["rouge_skill"]=200400,
["rouge_skill_1"]=200401,
["rouge_skill_2"]=200402,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -724,7 +724,7 @@ local skill_rogue = {
["qlt"]=3,
["type"]=1,
["parameter"]={
220012
2200121
},
["skill_position"]=2,
["icon"]="34"
@ -755,13 +755,13 @@ local skill_rogue = {
["effect"]={
{
["type"]="skill_fire_times",
["num"]=220011,
["num"]=2200120,
["ratio"]=10000,
["round"]=1
},
{
["type"]="skill_fire_times",
["num"]=220012,
["num"]=2200121,
["ratio"]=10000,
["round"]=1
}
@ -980,7 +980,7 @@ local skill_rogue = {
["qlt"]=3,
["type"]=1,
["parameter"]={
230012
2300121
},
["skill_position"]=2,
["icon"]="49"
@ -1008,7 +1008,7 @@ local skill_rogue = {
["qlt"]=4,
["type"]=1,
["parameter"]={
230013
2300122
},
["skill_position"]=2,
["icon"]="51"
@ -1027,7 +1027,7 @@ local skill_rogue = {
["qlt"]=3,
["type"]=1,
["parameter"]={
430012
4300121
},
["skill_position"]=4,
["icon"]="52"

View File

@ -2,7 +2,6 @@ local tutorial = {
[10000]={
["next_id"]=10010,
["type"]=6,
["finish"]=4,
["target_element"]={
53,
44,
@ -33,7 +32,6 @@ local tutorial = {
[10040]={
["next_id"]=10050,
["type"]=6,
["finish"]=4,
["target_element"]={
33,
23,
@ -55,7 +53,6 @@ local tutorial = {
},
[10060]={
["type"]=6,
["finish"]=4,
["target_element"]={
23,
13,

View File

@ -653,7 +653,7 @@ function BattleUnitComp:enterSkillAttackState()
self.targetX = nil
local skill
if self.normalSkillCount > 0 then
skill = self.unitEntity:getNormalSkill()
skill = self.unitEntity:getNormalSkill(true)
else
skill = self.currActiveSkill
end
@ -672,12 +672,9 @@ function BattleUnitComp:enterSkillAttackState()
else
self.isMove = false
self.attackTime = 0
local attackName
local attackName = skill:getSkillAttackName()
if self.normalSkillCount > 0 then
attackName = skill:getRandomNormalAttackName()
self:attackAndSpeedUp()
else
attackName = skill:getSkillAttackName()
end
self.currAttackDuration = self:getAnimationDuration(attackName)
self.currAttackKeyTime = self:getAnimationKeyFrameTime(attackName)
@ -842,8 +839,9 @@ end
function BattleUnitComp:doNextNormalAttack()
self.attackTime = 0
local skill = self.unitEntity:getNormalSkill()
local attackName = skill:getRandomNormalAttackName()
local skill = self.unitEntity:getNormalSkill(true)
skill:startUse()
local attackName = skill:getSkillAttackName()
self.currAttackDuration = self:getAnimationDuration(attackName)
self.currAttackKeyTime = self:getAnimationKeyFrameTime(attackName)
self:playAnimation(attackName, false, false)
@ -855,8 +853,9 @@ function BattleUnitComp:doNextAttack()
self.attackTime = 0
local attackName = nil
if self.normalSkillCount > 0 then
local skill = self.unitEntity:getNormalSkill()
attackName = skill:getRandomNormalAttackName()
local skill = self.unitEntity:getNormalSkill(true)
skill:startUse()
attackName = skill:getSkillAttackName()
if attackName then
self.currAttackDuration = self:getAnimationDuration(attackName)
self.currAttackKeyTime = self:getAnimationKeyFrameTime(attackName)
@ -867,6 +866,7 @@ function BattleUnitComp:doNextAttack()
self:moveBackToInitPosition()
end
elseif self.currActiveSkill then
self.currActiveSkill:startUse()
attackName = self.currActiveSkill:getSkillAttackName()
if attackName then
self.currAttackDuration = self:getAnimationDuration(attackName)
@ -885,7 +885,7 @@ end
function BattleUnitComp:enterNormalAttackState()
self.attackOver = false
self.attackTime = 0
local skill = self.unitEntity:getNormalSkill()
local skill = self.unitEntity:getNormalSkill(true)
skill:startUse()
if skill:getMoveType() == BattleConst.SKILL_MOVE_TYPE.MOVE then
self.isMove = true
@ -901,7 +901,7 @@ function BattleUnitComp:enterNormalAttackState()
else
self.isMove = false
self.attackTime = 0
local attackName = skill:getRandomNormalAttackName()
local attackName = skill:getSkillAttackName()
self.currAttackDuration = self:getAnimationDuration(attackName)
self.currAttackKeyTime = self:getAnimationKeyFrameTime(attackName)
self:playAnimation(attackName, false, false)
@ -1278,9 +1278,8 @@ function BattleUnitComp:getEffectAndPlay(skill, fxInfo)
-- effectObj:changeSortingOrderToFudge(BattleConst.BATTLE_BASE_ORDER, BattleConst.FX_SORTING_FUDGE_COEFFICIENT)
-- end
effectObj:play()
duration = duration or effectObj:getDuration()
local sid
sid = BattleHelper:performDurationDelay(duration, function()
sid = BattleHelper:performDurationDelay(effectObj:getDuration(), function()
BattleHelper:recycleEffect(effectObj)
end)
end)

View File

@ -177,9 +177,9 @@ function BattleController:init(params)
self.time = 0
self.battleData:init()
BattleScheduler:init()
BattlePool:init()
BattleHelper:init()
BattlePassive:init()
BattlePool:init()
self:setTimeScale(DataManager.BattleData:getTimeScale())
self:bindData()
self:initBattleTeam()

View File

@ -1,5 +1,6 @@
local UIPrefabObject = require "app/bf/unity/uiprefab_object"
local BattlePool = require "app/module/battle/helper/battle_pool"
local BattleScheduler = require "app/module/battle/helper/battle_scheduler"
local BattleHelper = {}
@ -100,14 +101,15 @@ function BattleHelper:getEffectAsync(name, parent, callback)
end
local effect = self.effectPools:pop(path)
if effect then
if parent then
effect:setParent(parent, false)
end
-- if parent then
-- effect:setParent(parent, false)
-- end
if self.effectMap then
self.effectMap[effect:getInstanceID()] = effect
end
local timeScale = DataManager.BattleData:getTimeScale()
effect:setTimeScale(timeScale)
effect:setActive(true)
callback(effect)
else
EffectManager:loadBattleEffectAsync(path, parent, function(effect)
@ -134,8 +136,9 @@ function BattleHelper:recycleEffect(effect)
end
end
effect:stop()
effect:setActive(false)
if self.effectPools then
self.effectPools:push(effect)
self.effectPools:push(effect, true)
end
if self.effectMap then
self.effectMap[effect:getInstanceID()] = nil
@ -218,6 +221,18 @@ function BattleHelper:recycleBuffEffect(buffEffect)
table.insert(self.buffEffectPool, buffEffect)
end
function BattleHelper:performDurationDelay(delay, func)
return BattleScheduler:performWithDelayGlobal(func, delay)
end
function BattleHelper:scheduleGlobal(inter, func)
return BattleScheduler:scheduleGlobal(func, inter)
end
function BattleHelper:unscheduleGlobal(scheduleId)
BattleScheduler:unscheduleGlobal(scheduleId)
end
function BattleHelper:clear()
self.isClear = true
self.characterPools = nil

View File

@ -479,9 +479,8 @@ function BattleData:initHeroData()
id = heroId,
modelId = heroEntity:getModelId(),
matchType = matchType,
normalSkill = heroEntity:getHurtSkill(),
normalSkills = heroEntity:getHurtSkill(),
activeSkills = {activeSkill},
normalSkillCount = heroEntity:getHurtNum(),
assistingSkill = heroEntity:getAssistingSkill(),
attr = {
hp = hp,
@ -512,9 +511,8 @@ function BattleData:addMonster(monsterId, newTeam)
id = monsterId,
modelId = monsterInfo.model_id,
matchType = 0,
normalSkill = monsterInfo.hurt_skill,
normalSkills = monsterInfo.hurt_skill,
activeSkills = monsterInfo.skill,
normalSkillCount = monsterInfo.hurt_num,
assistingSkill = nil,
isBoss = monsterInfo.is_boss,
exp = monsterInfo.monster_exp or 0,

View File

@ -125,25 +125,6 @@ function BattleSkillEntity:getMoveType()
return self.skillInfo.skill_position
end
function BattleSkillEntity:getRandomNormalAttackName()
if self.normalSkillNameList == nil then
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)
else
local temp = self.normalSkillNameList[#self.normalSkillNameList]
self.normalSkillNameList[#self.normalSkillNameList] = self.normalSkillNameList[self.normalSkillNameIndex]
self.normalSkillNameList[self.normalSkillNameIndex] = temp
self.normalSkillNameIndex = math.random(1, #self.normalSkillNameList - 1)
end
return self.normalSkillNameList[self.normalSkillNameIndex]
end
function BattleSkillEntity:getSkillAttackName()
return self.skillInfo.name_act
end

View File

@ -14,9 +14,17 @@ end
function BattleUnitEntity:initSkill()
self.activeSkills = {}
if self.unitData.normalSkill then
self.normalSkill = BattleSkillEntity:create(self.unitData.normalSkill, GConst.BattleConst.SKILL_TYPE_NORMAL, self)
if self.unitData.normalSkills then
self.normalSkills = {}
for k, v in ipairs(self.unitData.normalSkills) do
local skill = BattleSkillEntity:create(v, GConst.BattleConst.SKILL_TYPE_NORMAL, self)
table.insert(self.normalSkills, skill)
end
self.normalSkillCount = #self.normalSkills
else
self.normalSkillCount = 0
end
self.normalSkill = nil
if self.unitData.assistingSkill then
self.assistingSkill = BattleSkillEntity:create(self.unitData.assistingSkill, GConst.BattleConst.SKILL_TYPE_ASSISTING, self)
end
@ -99,7 +107,22 @@ function BattleUnitEntity:getIsMainUnit()
return self.isMainUnit
end
function BattleUnitEntity:getNormalSkill()
function BattleUnitEntity:getNormalSkill(reRandom)
if self.normalSkills == nil then
return nil
end
if not reRandom then
return self.normalSkill
end
if self.normalSkillIndex == nil then
self.normalSkillIndex = math.random(1, #self.normalSkills)
else
local temp = self.normalSkills[#self.normalSkills]
self.normalSkills[#self.normalSkills] = self.normalSkills[self.normalSkillIndex]
self.normalSkills[self.normalSkillIndex] = temp
self.normalSkillIndex = math.random(1, #self.normalSkills - 1)
end
self.normalSkill = self.normalSkills[self.normalSkillIndex]
return self.normalSkill
end
@ -124,18 +147,7 @@ function BattleUnitEntity:getActiveSkill(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
return self.normalSkillCount
end
function BattleUnitEntity:getPassiveSkills()