Merge branch 'dev' of http://git.juzugame.com/b6-client/b6-lua into dev
# Conflicts: # lua/app/config/tutorial.lua
This commit is contained in:
commit
5dc6d24503
@ -1,34 +1,6 @@
|
||||
local chapter_board = {
|
||||
[1]={
|
||||
["board"]={
|
||||
{
|
||||
1,
|
||||
0
|
||||
},
|
||||
{
|
||||
1,
|
||||
0
|
||||
},
|
||||
{
|
||||
0,
|
||||
3
|
||||
},
|
||||
{
|
||||
0,
|
||||
2
|
||||
},
|
||||
{
|
||||
0,
|
||||
2
|
||||
},
|
||||
{
|
||||
1,
|
||||
0
|
||||
},
|
||||
{
|
||||
1,
|
||||
0
|
||||
},
|
||||
{
|
||||
1,
|
||||
0
|
||||
@ -43,36 +15,36 @@ local chapter_board = {
|
||||
},
|
||||
{
|
||||
0,
|
||||
3
|
||||
},
|
||||
{
|
||||
0,
|
||||
3
|
||||
},
|
||||
{
|
||||
1,
|
||||
0
|
||||
},
|
||||
{
|
||||
1,
|
||||
0
|
||||
},
|
||||
{
|
||||
1,
|
||||
0
|
||||
},
|
||||
{
|
||||
1,
|
||||
0
|
||||
},
|
||||
{
|
||||
0,
|
||||
3
|
||||
2
|
||||
},
|
||||
{
|
||||
0,
|
||||
2
|
||||
},
|
||||
{
|
||||
1,
|
||||
0
|
||||
},
|
||||
{
|
||||
1,
|
||||
0
|
||||
},
|
||||
{
|
||||
1,
|
||||
0
|
||||
},
|
||||
{
|
||||
1,
|
||||
0
|
||||
},
|
||||
{
|
||||
0,
|
||||
3
|
||||
},
|
||||
{
|
||||
0,
|
||||
4
|
||||
},
|
||||
{
|
||||
0,
|
||||
4
|
||||
@ -121,6 +93,34 @@ local chapter_board = {
|
||||
1,
|
||||
0
|
||||
},
|
||||
{
|
||||
0,
|
||||
3
|
||||
},
|
||||
{
|
||||
0,
|
||||
2
|
||||
},
|
||||
{
|
||||
0,
|
||||
4
|
||||
},
|
||||
{
|
||||
1,
|
||||
0
|
||||
},
|
||||
{
|
||||
1,
|
||||
0
|
||||
},
|
||||
{
|
||||
1,
|
||||
0
|
||||
},
|
||||
{
|
||||
1,
|
||||
0
|
||||
},
|
||||
{
|
||||
1,
|
||||
0
|
||||
@ -210,6 +210,7 @@ local chapter_board = {
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2
|
||||
}
|
||||
},
|
||||
|
||||
@ -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
|
||||
@ -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
@ -4,7 +4,7 @@ local tutorial = {
|
||||
["type"]=6,
|
||||
["finish"]=4,
|
||||
["target_element"]={
|
||||
33,
|
||||
13,
|
||||
24,
|
||||
25
|
||||
},
|
||||
@ -26,21 +26,28 @@ local tutorial = {
|
||||
},
|
||||
[10030]={
|
||||
["next_id"]=10040,
|
||||
["type"]=5,
|
||||
["finish"]=2,
|
||||
["finish_parameter"]=1
|
||||
["type"]=2,
|
||||
["target_name"]="battle_skill_select_ui(Clone)/skill_node/skill_select_cell_1",
|
||||
["arrow_offset"]={
|
||||
0,
|
||||
0
|
||||
},
|
||||
["show_mask"]=1,
|
||||
["square_size"]={
|
||||
500,
|
||||
250
|
||||
}
|
||||
},
|
||||
[10040]={
|
||||
["next_id"]=10050,
|
||||
["type"]=6,
|
||||
["finish"]=4,
|
||||
["target_element"]={
|
||||
33,
|
||||
23,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
24,
|
||||
25,
|
||||
35
|
||||
34,
|
||||
44
|
||||
},
|
||||
["arrow_offset"]={
|
||||
0,
|
||||
@ -53,13 +60,30 @@ local tutorial = {
|
||||
["finish"]=3
|
||||
},
|
||||
[10060]={
|
||||
["next_id"]=10070,
|
||||
["type"]=6,
|
||||
["finish"]=4,
|
||||
["target_element"]={
|
||||
23,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
25
|
||||
24,
|
||||
34
|
||||
},
|
||||
["arrow_offset"]={
|
||||
0,
|
||||
0
|
||||
}
|
||||
},
|
||||
[10070]={
|
||||
["type"]=6,
|
||||
["finish"]=4,
|
||||
["target_element"]={
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
24,
|
||||
34
|
||||
},
|
||||
["arrow_offset"]={
|
||||
0,
|
||||
@ -182,9 +206,170 @@ local tutorial = {
|
||||
0,
|
||||
0
|
||||
}
|
||||
},
|
||||
[30000]={
|
||||
["next_id"]=30010,
|
||||
["type"]=2,
|
||||
["target_name"]="main_ui(Clone)/sub_ui_node/main_comp/chapter/progress_bg/box_1",
|
||||
["arrow_offset"]={
|
||||
0,
|
||||
0
|
||||
},
|
||||
["show_mask"]=2,
|
||||
["circle_r"]=100,
|
||||
["circle_offset"]={
|
||||
0,
|
||||
0
|
||||
}
|
||||
},
|
||||
[30010]={
|
||||
["next_id"]=30020,
|
||||
["type"]=4,
|
||||
["finish"]=1,
|
||||
["finish_parameter"]=2
|
||||
},
|
||||
[30020]={
|
||||
["next_id"]=30030,
|
||||
["type"]=5,
|
||||
["finish"]=2,
|
||||
["finish_parameter"]=2
|
||||
},
|
||||
[30030]={
|
||||
["next_id"]=30040,
|
||||
["type"]=2,
|
||||
["target_name"]="main_ui(Clone)/sub_ui_node/main_comp/hero_bg/hero_cell_2",
|
||||
["arrow_offset"]={
|
||||
0,
|
||||
0
|
||||
},
|
||||
["show_mask"]=1,
|
||||
["square_size"]={
|
||||
100,
|
||||
300
|
||||
},
|
||||
["square_offset"]={
|
||||
0,
|
||||
0
|
||||
}
|
||||
},
|
||||
[30040]={
|
||||
["type"]=2,
|
||||
["target_name"]="hero_detail_ui(Clone)/bg/up_btn",
|
||||
["arrow_offset"]={
|
||||
0,
|
||||
0
|
||||
},
|
||||
["show_mask"]=1,
|
||||
["square_size"]={
|
||||
200,
|
||||
100
|
||||
},
|
||||
["square_offset"]={
|
||||
0,
|
||||
0
|
||||
}
|
||||
},
|
||||
[40000]={
|
||||
["next_id"]=40010,
|
||||
["type"]=2,
|
||||
["target_name"]="main_ui(Clone)/sub_ui_node/main_comp/chapter/progress_bg/box_2",
|
||||
["arrow_offset"]={
|
||||
0,
|
||||
0
|
||||
},
|
||||
["show_mask"]=2,
|
||||
["circle_r"]=100,
|
||||
["circle_offset"]={
|
||||
0,
|
||||
0
|
||||
}
|
||||
},
|
||||
[40010]={
|
||||
["next_id"]=40020,
|
||||
["type"]=4,
|
||||
["finish"]=1,
|
||||
["finish_parameter"]=2
|
||||
},
|
||||
[40020]={
|
||||
["next_id"]=40030,
|
||||
["type"]=5,
|
||||
["finish"]=2,
|
||||
["finish_parameter"]=2
|
||||
},
|
||||
[40030]={
|
||||
["next_id"]=40040,
|
||||
["type"]=2,
|
||||
["target_name"]="main_ui(Clone)/sub_ui_node/hero_ui/scrollrect/viewport/content/scroll_cell_1/prop_node/hero_cell_5",
|
||||
["arrow_offset"]={
|
||||
0,
|
||||
0
|
||||
},
|
||||
["show_mask"]=1,
|
||||
["square_size"]={
|
||||
100,
|
||||
300
|
||||
},
|
||||
["square_offset"]={
|
||||
0,
|
||||
0
|
||||
}
|
||||
},
|
||||
[40040]={
|
||||
["next_id"]=40050,
|
||||
["type"]=2,
|
||||
["target_name"]="hero_detail_ui(Clone)/bg/up_btn",
|
||||
["arrow_offset"]={
|
||||
0,
|
||||
0
|
||||
},
|
||||
["show_mask"]=1,
|
||||
["square_size"]={
|
||||
200,
|
||||
100
|
||||
},
|
||||
["square_offset"]={
|
||||
0,
|
||||
0
|
||||
}
|
||||
},
|
||||
[40050]={
|
||||
["next_id"]=40060,
|
||||
["type"]=2,
|
||||
["target_name"]="hero_detail_ui(Clone)/bg/back_btn",
|
||||
["arrow_offset"]={
|
||||
0,
|
||||
0
|
||||
},
|
||||
["show_mask"]=1
|
||||
},
|
||||
[40060]={
|
||||
["next_id"]=40070,
|
||||
["type"]=2,
|
||||
["target_name"]="main_ui(Clone)/sub_ui_node/hero_ui/scrollrect/viewport/content/scroll_cell_1/prop_node/hero_cell_5",
|
||||
["arrow_offset"]={
|
||||
0,
|
||||
0
|
||||
},
|
||||
["show_mask"]=1,
|
||||
["square_size"]={
|
||||
100,
|
||||
300
|
||||
},
|
||||
["square_offset"]={
|
||||
0,
|
||||
0
|
||||
}
|
||||
},
|
||||
[40070]={
|
||||
["type"]=2,
|
||||
["target_name"]="main_ui(Clone)/sub_ui_node/hero_ui/scrollrect/viewport/content/large_hero_cell/hero_bg/use_btn",
|
||||
["arrow_offset"]={
|
||||
0,
|
||||
0
|
||||
}
|
||||
}
|
||||
}
|
||||
local config = {
|
||||
data=tutorial,count=16
|
||||
data=tutorial,count=30
|
||||
}
|
||||
return config
|
||||
@ -8,10 +8,12 @@ local tutorial_start = {
|
||||
["uires_path"]="Assets/prefabs/ui/main_city/main_ui.prefab"
|
||||
},
|
||||
[3]={
|
||||
["start_id"]=30000
|
||||
["start_id"]=30000,
|
||||
["uires_path"]="Assets/prefabs/ui/main_city/main_ui.prefab"
|
||||
},
|
||||
[4]={
|
||||
["start_id"]=40000
|
||||
["start_id"]=40000,
|
||||
["uires_path"]="Assets/prefabs/ui/main_city/main_ui.prefab"
|
||||
}
|
||||
}
|
||||
local config = {
|
||||
|
||||
@ -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)
|
||||
@ -1272,15 +1272,11 @@ function BattleUnitComp:getEffectAndPlay(skill, fxInfo)
|
||||
end
|
||||
effectObj:setLocalScale(fxScale, fxScale, fxScale)
|
||||
end
|
||||
-- if fxInfo.is_floor then
|
||||
-- effectObj:setSortingOrder(0, 0)
|
||||
-- else
|
||||
-- effectObj:changeSortingOrderToFudge(BattleConst.BATTLE_BASE_ORDER, BattleConst.FX_SORTING_FUDGE_COEFFICIENT)
|
||||
-- end
|
||||
local baseOrder = BattleHelper:getBaseOrder()
|
||||
effectObj:setSortingOrder(baseOrder, 10)
|
||||
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)
|
||||
|
||||
@ -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()
|
||||
@ -256,6 +256,7 @@ function BattleController:prepareFight()
|
||||
self:initAtkUnits(onPreloadFinished)
|
||||
self:initDefUnits(onPreloadFinished)
|
||||
end)
|
||||
BattleHelper:setBaseOrder(self.battleUI:getUIOrder())
|
||||
self:loadOtherRes(onPreloadFinished)
|
||||
end
|
||||
|
||||
|
||||
@ -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 = {}
|
||||
|
||||
@ -16,6 +17,15 @@ function BattleHelper:init()
|
||||
self.effectPools = BattlePool:getEffectPool()
|
||||
self.effectMap = {}
|
||||
self.seed = tonumber(tostring(os.time()):reverse():sub(1,6))
|
||||
self.baseOrder = 0
|
||||
end
|
||||
|
||||
function BattleHelper:setBaseOrder(baseOrder)
|
||||
self.baseOrder = baseOrder
|
||||
end
|
||||
|
||||
function BattleHelper:getBaseOrder()
|
||||
return self.baseOrder
|
||||
end
|
||||
|
||||
function BattleHelper:getFxConfig()
|
||||
@ -100,14 +110,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 +145,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 +230,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
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user