修复一些报错
This commit is contained in:
parent
b33b241e53
commit
dd6e751174
@ -53,54 +53,55 @@ local buff = {
|
|||||||
["v_buf"]="atkp_add"
|
["v_buf"]="atkp_add"
|
||||||
},
|
},
|
||||||
[7]={
|
[7]={
|
||||||
["name"]="healp",
|
|
||||||
["buff_type"]=5,
|
|
||||||
["decr"]=3,
|
|
||||||
["is_percent"]=2,
|
|
||||||
["v_buf"]="healp",
|
|
||||||
["fx_get"]={
|
|
||||||
2001
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[8]={
|
|
||||||
["name"]="wavehealp",
|
["name"]="wavehealp",
|
||||||
["buff_type"]=5,
|
["buff_type"]=5,
|
||||||
["decr"]=3,
|
["decr"]=3,
|
||||||
["is_percent"]=2,
|
["is_percent"]=2,
|
||||||
["v_buf"]="healp"
|
["v_buf"]="healp"
|
||||||
},
|
},
|
||||||
[9]={
|
[8]={
|
||||||
["name"]="atkp_add_connect",
|
["name"]="atkp_add_connect",
|
||||||
["buff_type"]=1,
|
["buff_type"]=1,
|
||||||
["is_percent"]=2,
|
["is_percent"]=2,
|
||||||
["v_buf"]="atkp_add"
|
["v_buf"]="atkp_add"
|
||||||
},
|
},
|
||||||
[10]={
|
[9]={
|
||||||
["name"]="spd_dec",
|
["name"]="spd_dec",
|
||||||
["buff_type"]=8,
|
["buff_type"]=8,
|
||||||
["is_percent"]=2,
|
["is_percent"]=2,
|
||||||
["v_buf"]="spd_dec"
|
["v_buf"]="spd_dec"
|
||||||
},
|
},
|
||||||
[11]={
|
[10]={
|
||||||
["name"]="block",
|
["name"]="block",
|
||||||
["buff_type"]=1,
|
["buff_type"]=1,
|
||||||
["decr"]=1,
|
["decr"]=1,
|
||||||
["is_percent"]=2,
|
["is_percent"]=2,
|
||||||
["v_buf"]="block"
|
["v_buf"]="block"
|
||||||
},
|
},
|
||||||
[12]={
|
[11]={
|
||||||
["name"]="hit_block",
|
["name"]="hit_block",
|
||||||
["buff_type"]=1,
|
["buff_type"]=1,
|
||||||
["decr"]=1,
|
["decr"]=1,
|
||||||
["is_percent"]=2,
|
["is_percent"]=2,
|
||||||
["v_buf"]="block"
|
["v_buf"]="block"
|
||||||
},
|
},
|
||||||
[13]={
|
[12]={
|
||||||
["name"]="hit_healp",
|
["name"]="heal",
|
||||||
["buff_type"]=5,
|
["buff_type"]=5,
|
||||||
["decr"]=3,
|
["decr"]=3,
|
||||||
["is_percent"]=2,
|
["is_percent"]=2,
|
||||||
["v_buf"]="healp"
|
["v_buf"]="heal",
|
||||||
|
["formula"]=8,
|
||||||
|
["fx_get"]={
|
||||||
|
2001
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[13]={
|
||||||
|
["name"]="hit_heal",
|
||||||
|
["buff_type"]=5,
|
||||||
|
["decr"]=3,
|
||||||
|
["is_percent"]=2,
|
||||||
|
["v_buf"]="heal"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
local keys = {
|
local keys = {
|
||||||
@ -111,13 +112,13 @@ local keys = {
|
|||||||
["shield"]=buff[4],
|
["shield"]=buff[4],
|
||||||
["atkp_add"]=buff[5],
|
["atkp_add"]=buff[5],
|
||||||
["atkp_add_defenderhp"]=buff[6],
|
["atkp_add_defenderhp"]=buff[6],
|
||||||
["healp"]=buff[7],
|
["wavehealp"]=buff[7],
|
||||||
["wavehealp"]=buff[8],
|
["atkp_add_connect"]=buff[8],
|
||||||
["atkp_add_connect"]=buff[9],
|
["spd_dec"]=buff[9],
|
||||||
["spd_dec"]=buff[10],
|
["block"]=buff[10],
|
||||||
["block"]=buff[11],
|
["hit_block"]=buff[11],
|
||||||
["hit_block"]=buff[12],
|
["heal"]=buff[12],
|
||||||
["hit_healp"]=buff[13]
|
["hit_heal"]=buff[13]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
local config = {
|
local config = {
|
||||||
|
|||||||
@ -36,7 +36,7 @@ local hero = {
|
|||||||
["atk_13"]=220,
|
["atk_13"]=220,
|
||||||
["atk_14"]=230,
|
["atk_14"]=230,
|
||||||
["atk_15"]=240,
|
["atk_15"]=240,
|
||||||
["model_id"]="p00001",
|
["model_id"]="p0001",
|
||||||
["icon"]="1"
|
["icon"]="1"
|
||||||
},
|
},
|
||||||
[22001]={
|
[22001]={
|
||||||
@ -76,7 +76,7 @@ local hero = {
|
|||||||
["atk_13"]=220,
|
["atk_13"]=220,
|
||||||
["atk_14"]=230,
|
["atk_14"]=230,
|
||||||
["atk_15"]=240,
|
["atk_15"]=240,
|
||||||
["model_id"]="p00002",
|
["model_id"]="p0002",
|
||||||
["icon"]="2"
|
["icon"]="2"
|
||||||
},
|
},
|
||||||
[23001]={
|
[23001]={
|
||||||
@ -116,7 +116,7 @@ local hero = {
|
|||||||
["atk_13"]=330,
|
["atk_13"]=330,
|
||||||
["atk_14"]=345,
|
["atk_14"]=345,
|
||||||
["atk_15"]=360,
|
["atk_15"]=360,
|
||||||
["model_id"]="p00006",
|
["model_id"]="p0006",
|
||||||
["icon"]="6"
|
["icon"]="6"
|
||||||
},
|
},
|
||||||
[32001]={
|
[32001]={
|
||||||
@ -156,7 +156,7 @@ local hero = {
|
|||||||
["atk_13"]=220,
|
["atk_13"]=220,
|
||||||
["atk_14"]=230,
|
["atk_14"]=230,
|
||||||
["atk_15"]=240,
|
["atk_15"]=240,
|
||||||
["model_id"]="p00003",
|
["model_id"]="p0003",
|
||||||
["icon"]="3"
|
["icon"]="3"
|
||||||
},
|
},
|
||||||
[33001]={
|
[33001]={
|
||||||
@ -196,7 +196,7 @@ local hero = {
|
|||||||
["atk_13"]=330,
|
["atk_13"]=330,
|
||||||
["atk_14"]=345,
|
["atk_14"]=345,
|
||||||
["atk_15"]=360,
|
["atk_15"]=360,
|
||||||
["model_id"]="p00007",
|
["model_id"]="p0007",
|
||||||
["icon"]="7"
|
["icon"]="7"
|
||||||
},
|
},
|
||||||
[42001]={
|
[42001]={
|
||||||
@ -236,7 +236,7 @@ local hero = {
|
|||||||
["atk_13"]=220,
|
["atk_13"]=220,
|
||||||
["atk_14"]=230,
|
["atk_14"]=230,
|
||||||
["atk_15"]=240,
|
["atk_15"]=240,
|
||||||
["model_id"]="p00004",
|
["model_id"]="p0004",
|
||||||
["icon"]="4"
|
["icon"]="4"
|
||||||
},
|
},
|
||||||
[43001]={
|
[43001]={
|
||||||
@ -276,7 +276,7 @@ local hero = {
|
|||||||
["atk_13"]=330,
|
["atk_13"]=330,
|
||||||
["atk_14"]=345,
|
["atk_14"]=345,
|
||||||
["atk_15"]=360,
|
["atk_15"]=360,
|
||||||
["model_id"]="p00008",
|
["model_id"]="p0008",
|
||||||
["icon"]="8"
|
["icon"]="8"
|
||||||
},
|
},
|
||||||
[52001]={
|
[52001]={
|
||||||
@ -316,7 +316,7 @@ local hero = {
|
|||||||
["atk_13"]=220,
|
["atk_13"]=220,
|
||||||
["atk_14"]=230,
|
["atk_14"]=230,
|
||||||
["atk_15"]=240,
|
["atk_15"]=240,
|
||||||
["model_id"]="p00005",
|
["model_id"]="p0005",
|
||||||
["icon"]="5"
|
["icon"]="5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
local skill_hero = {
|
local skill_hero = {
|
||||||
[10]={
|
[10]={
|
||||||
["energy"]=3,
|
["energy"]=10,
|
||||||
["position"]=3,
|
["position"]=3,
|
||||||
["method"]=2,
|
["method"]=2,
|
||||||
["skill_type"]=1,
|
["skill_type"]=1,
|
||||||
@ -18,7 +18,7 @@ local skill_hero = {
|
|||||||
["battle_icon"]=1
|
["battle_icon"]=1
|
||||||
},
|
},
|
||||||
[20]={
|
[20]={
|
||||||
["energy"]=3,
|
["energy"]=10,
|
||||||
["position"]=2,
|
["position"]=2,
|
||||||
["method"]=2,
|
["method"]=2,
|
||||||
["skill_type"]=0,
|
["skill_type"]=0,
|
||||||
@ -35,7 +35,7 @@ local skill_hero = {
|
|||||||
["battle_icon"]=2
|
["battle_icon"]=2
|
||||||
},
|
},
|
||||||
[21]={
|
[21]={
|
||||||
["energy"]=3,
|
["energy"]=10,
|
||||||
["position"]=2,
|
["position"]=2,
|
||||||
["method"]=1,
|
["method"]=1,
|
||||||
["skill_type"]=2,
|
["skill_type"]=2,
|
||||||
@ -70,7 +70,7 @@ local skill_hero = {
|
|||||||
["battle_icon"]=2
|
["battle_icon"]=2
|
||||||
},
|
},
|
||||||
[30]={
|
[30]={
|
||||||
["energy"]=3,
|
["energy"]=10,
|
||||||
["position"]=4,
|
["position"]=4,
|
||||||
["method"]=2,
|
["method"]=2,
|
||||||
["skill_type"]=1,
|
["skill_type"]=1,
|
||||||
@ -84,7 +84,7 @@ local skill_hero = {
|
|||||||
["battle_icon"]=3
|
["battle_icon"]=3
|
||||||
},
|
},
|
||||||
[40]={
|
[40]={
|
||||||
["energy"]=3,
|
["energy"]=10,
|
||||||
["position"]=5,
|
["position"]=5,
|
||||||
["method"]=2,
|
["method"]=2,
|
||||||
["skill_type"]=0,
|
["skill_type"]=0,
|
||||||
@ -101,7 +101,7 @@ local skill_hero = {
|
|||||||
["battle_icon"]=4
|
["battle_icon"]=4
|
||||||
},
|
},
|
||||||
[50]={
|
[50]={
|
||||||
["energy"]=3,
|
["energy"]=10,
|
||||||
["position"]=1,
|
["position"]=1,
|
||||||
["method"]=2,
|
["method"]=2,
|
||||||
["skill_type"]=1,
|
["skill_type"]=1,
|
||||||
@ -119,13 +119,13 @@ local skill_hero = {
|
|||||||
["battle_icon"]=5
|
["battle_icon"]=5
|
||||||
},
|
},
|
||||||
[60]={
|
[60]={
|
||||||
["energy"]=3,
|
["energy"]=10,
|
||||||
["position"]=3,
|
["position"]=3,
|
||||||
["method"]=2,
|
["method"]=2,
|
||||||
["skill_type"]=0,
|
["skill_type"]=0,
|
||||||
["effect"]={
|
["effect"]={
|
||||||
{
|
{
|
||||||
["type"]="healp",
|
["type"]="heal",
|
||||||
["num"]=2000,
|
["num"]=2000,
|
||||||
["ratio"]=10000,
|
["ratio"]=10000,
|
||||||
["round"]=1
|
["round"]=1
|
||||||
@ -136,7 +136,7 @@ local skill_hero = {
|
|||||||
["battle_icon"]=6
|
["battle_icon"]=6
|
||||||
},
|
},
|
||||||
[70]={
|
[70]={
|
||||||
["energy"]=3,
|
["energy"]=10,
|
||||||
["position"]=2,
|
["position"]=2,
|
||||||
["method"]=2,
|
["method"]=2,
|
||||||
["skill_type"]=0,
|
["skill_type"]=0,
|
||||||
@ -153,7 +153,7 @@ local skill_hero = {
|
|||||||
["battle_icon"]=7
|
["battle_icon"]=7
|
||||||
},
|
},
|
||||||
[71]={
|
[71]={
|
||||||
["energy"]=3,
|
["energy"]=10,
|
||||||
["position"]=2,
|
["position"]=2,
|
||||||
["method"]=1,
|
["method"]=1,
|
||||||
["skill_type"]=2,
|
["skill_type"]=2,
|
||||||
@ -189,7 +189,7 @@ local skill_hero = {
|
|||||||
["battle_icon"]=7
|
["battle_icon"]=7
|
||||||
},
|
},
|
||||||
[72]={
|
[72]={
|
||||||
["energy"]=3,
|
["energy"]=10,
|
||||||
["position"]=2,
|
["position"]=2,
|
||||||
["method"]=1,
|
["method"]=1,
|
||||||
["skill_type"]=2,
|
["skill_type"]=2,
|
||||||
@ -232,7 +232,7 @@ local skill_hero = {
|
|||||||
["battle_icon"]=7
|
["battle_icon"]=7
|
||||||
},
|
},
|
||||||
[80]={
|
[80]={
|
||||||
["energy"]=3,
|
["energy"]=10,
|
||||||
["position"]=4,
|
["position"]=4,
|
||||||
["method"]=2,
|
["method"]=2,
|
||||||
["skill_type"]=0,
|
["skill_type"]=0,
|
||||||
@ -254,7 +254,7 @@ local skill_hero = {
|
|||||||
["battle_icon"]=8
|
["battle_icon"]=8
|
||||||
},
|
},
|
||||||
[81]={
|
[81]={
|
||||||
["energy"]=3,
|
["energy"]=10,
|
||||||
["position"]=4,
|
["position"]=4,
|
||||||
["method"]=2,
|
["method"]=2,
|
||||||
["skill_type"]=1,
|
["skill_type"]=1,
|
||||||
|
|||||||
@ -933,8 +933,8 @@ local skill_rogue = {
|
|||||||
},
|
},
|
||||||
["effect"]={
|
["effect"]={
|
||||||
{
|
{
|
||||||
["type"]="hit_healp",
|
["type"]="hit_heal",
|
||||||
["num"]=200,
|
["num"]=500,
|
||||||
["ratio"]=10000,
|
["ratio"]=10000,
|
||||||
["round"]=1
|
["round"]=1
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,6 +15,7 @@ BattleConst.SIDE_ATK = 1
|
|||||||
BattleConst.SIDE_DEF = 2
|
BattleConst.SIDE_DEF = 2
|
||||||
BattleConst.SKILL_TYPE_ACTIVE = 1
|
BattleConst.SKILL_TYPE_ACTIVE = 1
|
||||||
BattleConst.SKILL_SELECT_COUNT = 3
|
BattleConst.SKILL_SELECT_COUNT = 3
|
||||||
|
BattleConst.DEFAULT_FACTOR = 10000
|
||||||
|
|
||||||
-- 为方便存储,这里使用字符串
|
-- 为方便存储,这里使用字符串
|
||||||
BattleConst.BATTLE_TYPE = {
|
BattleConst.BATTLE_TYPE = {
|
||||||
|
|||||||
21
lua/app/module/battle/component/battle_hero_comp.lua
Normal file
21
lua/app/module/battle/component/battle_hero_comp.lua
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
local BattleConst = require "app/module/battle/battle_const"
|
||||||
|
local BattleUnitComp = require "app/module/battle/component/battle_unit_comp"
|
||||||
|
|
||||||
|
local BattleHeroComp = class("BattleHeroComp", BattleUnitComp)
|
||||||
|
|
||||||
|
local UNIT_STATE = BattleConst.UNIT_STATE
|
||||||
|
|
||||||
|
function BattleHeroComp:init()
|
||||||
|
self.battleMgr = CS.BF.BFMain.Instance.BattleMgr
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleHeroComp:initBase()
|
||||||
|
self.isDead = false
|
||||||
|
self.currState = UNIT_STATE.INIT
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleHeroComp:initPosition()
|
||||||
|
self.baseObject:setLocalPosition(0, 0, 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
return BattleHeroComp
|
||||||
10
lua/app/module/battle/component/battle_hero_comp.lua.meta
Normal file
10
lua/app/module/battle/component/battle_hero_comp.lua.meta
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2de8b968215b6754d98014fe8d8feedf
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||||
@ -7,8 +7,8 @@ local UNIT_STATE = BattleConst.UNIT_STATE
|
|||||||
function BattleUnitComp:ctor()
|
function BattleUnitComp:ctor()
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleUnitComp:init()
|
function BattleUnitComp:initPosition()
|
||||||
self:_initBase()
|
self.baseObject:setLocalPosition(0, 0, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleUnitComp:_initBase()
|
function BattleUnitComp:_initBase()
|
||||||
@ -16,21 +16,30 @@ function BattleUnitComp:_initBase()
|
|||||||
self.isDead = false
|
self.isDead = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleUnitComp:initWithEntity(modelId, entity, battleController, target)
|
||||||
|
self.modelId = modelId
|
||||||
|
self.unitEntity = entity
|
||||||
|
self.battleController = battleController
|
||||||
|
self.target = target
|
||||||
|
self:_initBase()
|
||||||
|
self:initPosition()
|
||||||
|
end
|
||||||
|
|
||||||
function BattleUnitComp:tick(dt)
|
function BattleUnitComp:tick(dt)
|
||||||
if self.isClear then
|
-- if self.isClear then
|
||||||
return
|
-- return
|
||||||
end
|
-- end
|
||||||
if self.isDead then
|
-- if self.isDead then
|
||||||
self:updateDead(dt)
|
-- self:updateDead(dt)
|
||||||
return
|
-- return
|
||||||
end
|
-- end
|
||||||
if self.currState == UNIT_STATE.IDLE then
|
-- if self.currState == UNIT_STATE.IDLE then
|
||||||
self:updateIdle(dt)
|
-- self:updateIdle(dt)
|
||||||
return
|
-- return
|
||||||
end
|
-- end
|
||||||
if self.currState == UNIT_STATE.ATTACK then
|
-- if self.currState == UNIT_STATE.ATTACK then
|
||||||
self:updateAttack(dt)
|
-- self:updateAttack(dt)
|
||||||
end
|
-- end
|
||||||
end
|
end
|
||||||
|
|
||||||
return BattleUnitComp
|
return BattleUnitComp
|
||||||
@ -129,7 +129,7 @@ function BattleController:initAllUnits(callback)
|
|||||||
local members = atkTeam:getAllMembers()
|
local members = atkTeam:getAllMembers()
|
||||||
for k, v in pairs(members) do
|
for k, v in pairs(members) do
|
||||||
local modelId = v:getModelId()
|
local modelId = v:getModelId()
|
||||||
BattleHelper:loadBattleHero(modelId, self.battleUI:getBattleNode(), function(spineObject)
|
BattleHelper:loadBattleHeroModel(modelId, self.battleUI:getBattleNode(), function(spineObject)
|
||||||
local heroComp = spineObject:addLuaComponent(BattleConst.TYPEOF_LUA_COMP.BATTLE_HERO_COMPONENT)
|
local heroComp = spineObject:addLuaComponent(BattleConst.TYPEOF_LUA_COMP.BATTLE_HERO_COMPONENT)
|
||||||
heroComp:initWithEntity(modelId, v, self)
|
heroComp:initWithEntity(modelId, v, self)
|
||||||
self.atkUnits[v:getMatchType()] = heroComp
|
self.atkUnits[v:getMatchType()] = heroComp
|
||||||
|
|||||||
@ -8,7 +8,7 @@ local BATTLE_GRID_ENTITY = require "app/userdata/battle/battle_grid_entity"
|
|||||||
local BATTLE_BOARD_SKILL_ENTITY = require "app/userdata/battle/skill/battle_borad_skill_entity"
|
local BATTLE_BOARD_SKILL_ENTITY = require "app/userdata/battle/skill/battle_borad_skill_entity"
|
||||||
|
|
||||||
local ATTR_TYPE = GConst.ATTR_TYPE
|
local ATTR_TYPE = GConst.ATTR_TYPE
|
||||||
local DEFAULT_FACTOR = GConst.DEFAULT_FACTOR
|
local DEFAULT_FACTOR = BattleConst.DEFAULT_FACTOR
|
||||||
|
|
||||||
function BattleData:init(board, skillIds, skillPool)
|
function BattleData:init(board, skillIds, skillPool)
|
||||||
self:clear()
|
self:clear()
|
||||||
|
|||||||
@ -6,7 +6,7 @@ function BattleUnitEntity:ctor()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BattleUnitEntity:init(unitData, side, team)
|
function BattleUnitEntity:init(unitData, side, team)
|
||||||
self.data = unitData
|
self.unitData = unitData
|
||||||
self.side = side
|
self.side = side
|
||||||
self.team = team
|
self.team = team
|
||||||
self:initAttr()
|
self:initAttr()
|
||||||
@ -39,4 +39,8 @@ function BattleUnitEntity:getModelId()
|
|||||||
return self.unitData.modelId
|
return self.unitData.modelId
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleUnitEntity:getMatchType()
|
||||||
|
return self.unitData.matchType
|
||||||
|
end
|
||||||
|
|
||||||
return BattleUnitEntity
|
return BattleUnitEntity
|
||||||
Loading…
x
Reference in New Issue
Block a user