修复一些报错
This commit is contained in:
parent
b33b241e53
commit
dd6e751174
@ -53,54 +53,55 @@ local buff = {
|
||||
["v_buf"]="atkp_add"
|
||||
},
|
||||
[7]={
|
||||
["name"]="healp",
|
||||
["buff_type"]=5,
|
||||
["decr"]=3,
|
||||
["is_percent"]=2,
|
||||
["v_buf"]="healp",
|
||||
["fx_get"]={
|
||||
2001
|
||||
}
|
||||
},
|
||||
[8]={
|
||||
["name"]="wavehealp",
|
||||
["buff_type"]=5,
|
||||
["decr"]=3,
|
||||
["is_percent"]=2,
|
||||
["v_buf"]="healp"
|
||||
},
|
||||
[9]={
|
||||
[8]={
|
||||
["name"]="atkp_add_connect",
|
||||
["buff_type"]=1,
|
||||
["is_percent"]=2,
|
||||
["v_buf"]="atkp_add"
|
||||
},
|
||||
[10]={
|
||||
[9]={
|
||||
["name"]="spd_dec",
|
||||
["buff_type"]=8,
|
||||
["is_percent"]=2,
|
||||
["v_buf"]="spd_dec"
|
||||
},
|
||||
[11]={
|
||||
[10]={
|
||||
["name"]="block",
|
||||
["buff_type"]=1,
|
||||
["decr"]=1,
|
||||
["is_percent"]=2,
|
||||
["v_buf"]="block"
|
||||
},
|
||||
[12]={
|
||||
[11]={
|
||||
["name"]="hit_block",
|
||||
["buff_type"]=1,
|
||||
["decr"]=1,
|
||||
["is_percent"]=2,
|
||||
["v_buf"]="block"
|
||||
},
|
||||
[13]={
|
||||
["name"]="hit_healp",
|
||||
[12]={
|
||||
["name"]="heal",
|
||||
["buff_type"]=5,
|
||||
["decr"]=3,
|
||||
["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 = {
|
||||
@ -111,13 +112,13 @@ local keys = {
|
||||
["shield"]=buff[4],
|
||||
["atkp_add"]=buff[5],
|
||||
["atkp_add_defenderhp"]=buff[6],
|
||||
["healp"]=buff[7],
|
||||
["wavehealp"]=buff[8],
|
||||
["atkp_add_connect"]=buff[9],
|
||||
["spd_dec"]=buff[10],
|
||||
["block"]=buff[11],
|
||||
["hit_block"]=buff[12],
|
||||
["hit_healp"]=buff[13]
|
||||
["wavehealp"]=buff[7],
|
||||
["atkp_add_connect"]=buff[8],
|
||||
["spd_dec"]=buff[9],
|
||||
["block"]=buff[10],
|
||||
["hit_block"]=buff[11],
|
||||
["heal"]=buff[12],
|
||||
["hit_heal"]=buff[13]
|
||||
}
|
||||
}
|
||||
local config = {
|
||||
|
||||
@ -36,7 +36,7 @@ local hero = {
|
||||
["atk_13"]=220,
|
||||
["atk_14"]=230,
|
||||
["atk_15"]=240,
|
||||
["model_id"]="p00001",
|
||||
["model_id"]="p0001",
|
||||
["icon"]="1"
|
||||
},
|
||||
[22001]={
|
||||
@ -76,7 +76,7 @@ local hero = {
|
||||
["atk_13"]=220,
|
||||
["atk_14"]=230,
|
||||
["atk_15"]=240,
|
||||
["model_id"]="p00002",
|
||||
["model_id"]="p0002",
|
||||
["icon"]="2"
|
||||
},
|
||||
[23001]={
|
||||
@ -116,7 +116,7 @@ local hero = {
|
||||
["atk_13"]=330,
|
||||
["atk_14"]=345,
|
||||
["atk_15"]=360,
|
||||
["model_id"]="p00006",
|
||||
["model_id"]="p0006",
|
||||
["icon"]="6"
|
||||
},
|
||||
[32001]={
|
||||
@ -156,7 +156,7 @@ local hero = {
|
||||
["atk_13"]=220,
|
||||
["atk_14"]=230,
|
||||
["atk_15"]=240,
|
||||
["model_id"]="p00003",
|
||||
["model_id"]="p0003",
|
||||
["icon"]="3"
|
||||
},
|
||||
[33001]={
|
||||
@ -196,7 +196,7 @@ local hero = {
|
||||
["atk_13"]=330,
|
||||
["atk_14"]=345,
|
||||
["atk_15"]=360,
|
||||
["model_id"]="p00007",
|
||||
["model_id"]="p0007",
|
||||
["icon"]="7"
|
||||
},
|
||||
[42001]={
|
||||
@ -236,7 +236,7 @@ local hero = {
|
||||
["atk_13"]=220,
|
||||
["atk_14"]=230,
|
||||
["atk_15"]=240,
|
||||
["model_id"]="p00004",
|
||||
["model_id"]="p0004",
|
||||
["icon"]="4"
|
||||
},
|
||||
[43001]={
|
||||
@ -276,7 +276,7 @@ local hero = {
|
||||
["atk_13"]=330,
|
||||
["atk_14"]=345,
|
||||
["atk_15"]=360,
|
||||
["model_id"]="p00008",
|
||||
["model_id"]="p0008",
|
||||
["icon"]="8"
|
||||
},
|
||||
[52001]={
|
||||
@ -316,7 +316,7 @@ local hero = {
|
||||
["atk_13"]=220,
|
||||
["atk_14"]=230,
|
||||
["atk_15"]=240,
|
||||
["model_id"]="p00005",
|
||||
["model_id"]="p0005",
|
||||
["icon"]="5"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
local skill_hero = {
|
||||
[10]={
|
||||
["energy"]=3,
|
||||
["energy"]=10,
|
||||
["position"]=3,
|
||||
["method"]=2,
|
||||
["skill_type"]=1,
|
||||
@ -18,7 +18,7 @@ local skill_hero = {
|
||||
["battle_icon"]=1
|
||||
},
|
||||
[20]={
|
||||
["energy"]=3,
|
||||
["energy"]=10,
|
||||
["position"]=2,
|
||||
["method"]=2,
|
||||
["skill_type"]=0,
|
||||
@ -35,7 +35,7 @@ local skill_hero = {
|
||||
["battle_icon"]=2
|
||||
},
|
||||
[21]={
|
||||
["energy"]=3,
|
||||
["energy"]=10,
|
||||
["position"]=2,
|
||||
["method"]=1,
|
||||
["skill_type"]=2,
|
||||
@ -70,7 +70,7 @@ local skill_hero = {
|
||||
["battle_icon"]=2
|
||||
},
|
||||
[30]={
|
||||
["energy"]=3,
|
||||
["energy"]=10,
|
||||
["position"]=4,
|
||||
["method"]=2,
|
||||
["skill_type"]=1,
|
||||
@ -84,7 +84,7 @@ local skill_hero = {
|
||||
["battle_icon"]=3
|
||||
},
|
||||
[40]={
|
||||
["energy"]=3,
|
||||
["energy"]=10,
|
||||
["position"]=5,
|
||||
["method"]=2,
|
||||
["skill_type"]=0,
|
||||
@ -101,7 +101,7 @@ local skill_hero = {
|
||||
["battle_icon"]=4
|
||||
},
|
||||
[50]={
|
||||
["energy"]=3,
|
||||
["energy"]=10,
|
||||
["position"]=1,
|
||||
["method"]=2,
|
||||
["skill_type"]=1,
|
||||
@ -119,13 +119,13 @@ local skill_hero = {
|
||||
["battle_icon"]=5
|
||||
},
|
||||
[60]={
|
||||
["energy"]=3,
|
||||
["energy"]=10,
|
||||
["position"]=3,
|
||||
["method"]=2,
|
||||
["skill_type"]=0,
|
||||
["effect"]={
|
||||
{
|
||||
["type"]="healp",
|
||||
["type"]="heal",
|
||||
["num"]=2000,
|
||||
["ratio"]=10000,
|
||||
["round"]=1
|
||||
@ -136,7 +136,7 @@ local skill_hero = {
|
||||
["battle_icon"]=6
|
||||
},
|
||||
[70]={
|
||||
["energy"]=3,
|
||||
["energy"]=10,
|
||||
["position"]=2,
|
||||
["method"]=2,
|
||||
["skill_type"]=0,
|
||||
@ -153,7 +153,7 @@ local skill_hero = {
|
||||
["battle_icon"]=7
|
||||
},
|
||||
[71]={
|
||||
["energy"]=3,
|
||||
["energy"]=10,
|
||||
["position"]=2,
|
||||
["method"]=1,
|
||||
["skill_type"]=2,
|
||||
@ -189,7 +189,7 @@ local skill_hero = {
|
||||
["battle_icon"]=7
|
||||
},
|
||||
[72]={
|
||||
["energy"]=3,
|
||||
["energy"]=10,
|
||||
["position"]=2,
|
||||
["method"]=1,
|
||||
["skill_type"]=2,
|
||||
@ -232,7 +232,7 @@ local skill_hero = {
|
||||
["battle_icon"]=7
|
||||
},
|
||||
[80]={
|
||||
["energy"]=3,
|
||||
["energy"]=10,
|
||||
["position"]=4,
|
||||
["method"]=2,
|
||||
["skill_type"]=0,
|
||||
@ -254,7 +254,7 @@ local skill_hero = {
|
||||
["battle_icon"]=8
|
||||
},
|
||||
[81]={
|
||||
["energy"]=3,
|
||||
["energy"]=10,
|
||||
["position"]=4,
|
||||
["method"]=2,
|
||||
["skill_type"]=1,
|
||||
|
||||
@ -933,8 +933,8 @@ local skill_rogue = {
|
||||
},
|
||||
["effect"]={
|
||||
{
|
||||
["type"]="hit_healp",
|
||||
["num"]=200,
|
||||
["type"]="hit_heal",
|
||||
["num"]=500,
|
||||
["ratio"]=10000,
|
||||
["round"]=1
|
||||
}
|
||||
|
||||
@ -15,6 +15,7 @@ BattleConst.SIDE_ATK = 1
|
||||
BattleConst.SIDE_DEF = 2
|
||||
BattleConst.SKILL_TYPE_ACTIVE = 1
|
||||
BattleConst.SKILL_SELECT_COUNT = 3
|
||||
BattleConst.DEFAULT_FACTOR = 10000
|
||||
|
||||
-- 为方便存储,这里使用字符串
|
||||
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()
|
||||
end
|
||||
|
||||
function BattleUnitComp:init()
|
||||
self:_initBase()
|
||||
function BattleUnitComp:initPosition()
|
||||
self.baseObject:setLocalPosition(0, 0, 0)
|
||||
end
|
||||
|
||||
function BattleUnitComp:_initBase()
|
||||
@ -16,21 +16,30 @@ function BattleUnitComp:_initBase()
|
||||
self.isDead = false
|
||||
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)
|
||||
if self.isClear then
|
||||
return
|
||||
end
|
||||
if self.isDead then
|
||||
self:updateDead(dt)
|
||||
return
|
||||
end
|
||||
if self.currState == UNIT_STATE.IDLE then
|
||||
self:updateIdle(dt)
|
||||
return
|
||||
end
|
||||
if self.currState == UNIT_STATE.ATTACK then
|
||||
self:updateAttack(dt)
|
||||
end
|
||||
-- if self.isClear then
|
||||
-- return
|
||||
-- end
|
||||
-- if self.isDead then
|
||||
-- self:updateDead(dt)
|
||||
-- return
|
||||
-- end
|
||||
-- if self.currState == UNIT_STATE.IDLE then
|
||||
-- self:updateIdle(dt)
|
||||
-- return
|
||||
-- end
|
||||
-- if self.currState == UNIT_STATE.ATTACK then
|
||||
-- self:updateAttack(dt)
|
||||
-- end
|
||||
end
|
||||
|
||||
return BattleUnitComp
|
||||
@ -129,7 +129,7 @@ function BattleController:initAllUnits(callback)
|
||||
local members = atkTeam:getAllMembers()
|
||||
for k, v in pairs(members) do
|
||||
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)
|
||||
heroComp:initWithEntity(modelId, v, self)
|
||||
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 ATTR_TYPE = GConst.ATTR_TYPE
|
||||
local DEFAULT_FACTOR = GConst.DEFAULT_FACTOR
|
||||
local DEFAULT_FACTOR = BattleConst.DEFAULT_FACTOR
|
||||
|
||||
function BattleData:init(board, skillIds, skillPool)
|
||||
self:clear()
|
||||
|
||||
@ -6,7 +6,7 @@ function BattleUnitEntity:ctor()
|
||||
end
|
||||
|
||||
function BattleUnitEntity:init(unitData, side, team)
|
||||
self.data = unitData
|
||||
self.unitData = unitData
|
||||
self.side = side
|
||||
self.team = team
|
||||
self:initAttr()
|
||||
@ -39,4 +39,8 @@ function BattleUnitEntity:getModelId()
|
||||
return self.unitData.modelId
|
||||
end
|
||||
|
||||
function BattleUnitEntity:getMatchType()
|
||||
return self.unitData.matchType
|
||||
end
|
||||
|
||||
return BattleUnitEntity
|
||||
Loading…
x
Reference in New Issue
Block a user