修改skillcast
parent
8c0dd3a9b0
commit
705b651886
|
@ -83,25 +83,53 @@ function SkillCaster:OnSkillCast(skill)
|
||||||
end
|
end
|
||||||
self.owner.GameObject:SetActive(false)
|
self.owner.GameObject:SetActive(false)
|
||||||
local targets = skill:GetDirectTargets()
|
local targets = skill:GetDirectTargets()
|
||||||
for _, target in ipairs(targets) do
|
LogError( tostring(self:GetMovePosition(skill)))
|
||||||
local t= self.owner.RootPanel.GetRoleView(target)
|
if #targets >0 then
|
||||||
local posx=0
|
local postion= self:GetMovePosition(skill)
|
||||||
local posy=0
|
local posx=0
|
||||||
if displaceoffset and #displaceoffset>0 then
|
local posy=0
|
||||||
if displaceoffset[1] and type(displaceoffset[1]) ~="userdata" then
|
if displaceoffset and #displaceoffset>0 then
|
||||||
posx=displaceoffset[1]
|
if displaceoffset[1] and type(displaceoffset[1]) ~="userdata" then
|
||||||
end
|
posx=displaceoffset[1]
|
||||||
if displaceoffset[2] and type(displaceoffset[2]) ~="userdata" then
|
end
|
||||||
posy=displaceoffset[2]
|
if displaceoffset[2] and type(displaceoffset[2]) ~="userdata" then
|
||||||
end
|
posy=displaceoffset[2]
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
LogError(tostring(postion))
|
||||||
|
LogError(tostring(Vector3.New(postion.x-(self.owner.camp==0 and posx or(-posx)),postion.y+posy,postion.z)))
|
||||||
|
self.owner.RoleLiveGO.transform:DOLocalMove(Vector3.New(postion.x-(self.owner.camp==0 and posx or(-posx)),postion.y+posy,postion.z), combat.AttackDisplaceTime/1000, false):OnComplete(function ()
|
||||||
|
if self.owner.OnSkillPlay then
|
||||||
|
self.owner:OnSkillPlay(localtype,combat)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
for _, target in ipairs(targets) do
|
||||||
|
local t= self.owner.RootPanel.GetRoleView(target)
|
||||||
|
local posx=0
|
||||||
|
local posy=0
|
||||||
|
if displaceoffset and #displaceoffset>0 then
|
||||||
|
if displaceoffset[1] and type(displaceoffset[1]) ~="userdata" then
|
||||||
|
posx=displaceoffset[1]
|
||||||
|
end
|
||||||
|
if displaceoffset[2] and type(displaceoffset[2]) ~="userdata" then
|
||||||
|
posy=displaceoffset[2]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
self.owner.RoleLiveGO.transform:DOMove(Vector3.New(t.GameObject.transform.position.x-(self.owner.camp==0 and posx or(-posx)),t.GameObject.transform.position.y+posy,t.GameObject.transform.position.z), combat.AttackDisplaceTime/1000, false):OnComplete(function ()
|
--LogError("技能位移Id"..combat.Id.."开始时间"..os.date())
|
||||||
if self.owner.OnSkillPlay then
|
self.owner.RoleLiveGO.transform:DOMove(Vector3.New(t.GameObject.transform.position.x-(self.owner.camp==0 and displaceoffset[1] or(-displaceoffset[1])),t.GameObject.transform.position.y+displaceoffset[2],t.GameObject.transform.position.z), combat.AttackDisplaceTime/1000, false):OnComplete(function ()
|
||||||
self.owner:OnSkillPlay(localtype,combat)
|
if self.owner.OnSkillPlay then
|
||||||
end
|
self.owner:OnSkillPlay(localtype,combat)
|
||||||
end)
|
--LogError("技能位移Id"..combat.Id.."结束时间"..os.date())
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
else
|
else
|
||||||
if self.owner.OnSkillPlay then
|
if self.owner.OnSkillPlay then
|
||||||
self.owner:OnSkillPlay(localtype,combat)
|
self.owner:OnSkillPlay(localtype,combat)
|
||||||
|
@ -109,36 +137,36 @@ function SkillCaster:OnSkillCast(skill)
|
||||||
end
|
end
|
||||||
-- 播放
|
-- 播放
|
||||||
-- 这里相当于技能前摇,等待立绘播放到需要释放关键帧的时间时继续释放技能(人物前摇特效)
|
-- 这里相当于技能前摇,等待立绘播放到需要释放关键帧的时间时继续释放技能(人物前摇特效)
|
||||||
if combat.AttackDisplacement ==1 then
|
-- if combat.AttackDisplacement ==1 then
|
||||||
local displaceoffset={[1]=0.4,[2]=-0.2}
|
-- local displaceoffset={[1]=0.4,[2]=-0.2}
|
||||||
-- if skill.type==2 and self.owner.superSkillAttackDisplaceoffset then
|
-- -- if skill.type==2 and self.owner.superSkillAttackDisplaceoffset then
|
||||||
-- displaceoffset=self.owner.superSkillAttackDisplaceoffset
|
-- -- displaceoffset=self.owner.superSkillAttackDisplaceoffset
|
||||||
-- elseif self.owner.SkillAttackDisplaceoffset then
|
-- -- elseif self.owner.SkillAttackDisplaceoffset then
|
||||||
-- displaceoffset=self.owner.SkillAttackDisplaceoffset
|
-- -- displaceoffset=self.owner.SkillAttackDisplaceoffset
|
||||||
-- end
|
-- -- end
|
||||||
if skill.AttackDisplaceOffset then
|
-- if skill.AttackDisplaceOffset then
|
||||||
if skill.AttackDisplaceOffset and #skill.AttackDisplaceOffset>0 and type(skill.AttackDisplaceOffset[1]) ~="userdata" and type(skill.AttackDisplaceOffset[2]) ~="userdata" then
|
-- if skill.AttackDisplaceOffset and #skill.AttackDisplaceOffset>0 and type(skill.AttackDisplaceOffset[1]) ~="userdata" and type(skill.AttackDisplaceOffset[2]) ~="userdata" then
|
||||||
displaceoffset=skill.AttackDisplaceOffset
|
-- displaceoffset=skill.AttackDisplaceOffset
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
self.owner.GameObject:SetActive(false)
|
-- self.owner.GameObject:SetActive(false)
|
||||||
local targets = skill:GetDirectTargets()
|
-- local targets = skill:GetDirectTargets()
|
||||||
for _, target in ipairs(targets) do
|
-- for _, target in ipairs(targets) do
|
||||||
|
|
||||||
local t= self.owner.RootPanel.GetRoleView(target)
|
-- local t= self.owner.RootPanel.GetRoleView(target)
|
||||||
--LogError("技能位移Id"..combat.Id.."开始时间"..os.date())
|
-- --LogError("技能位移Id"..combat.Id.."开始时间"..os.date())
|
||||||
self.owner.RoleLiveGO.transform:DOMove(Vector3.New(t.GameObject.transform.position.x-(self.owner.camp==0 and displaceoffset[1] or(-displaceoffset[1])),t.GameObject.transform.position.y+displaceoffset[2],t.GameObject.transform.position.z), combat.AttackDisplaceTime/1000, false):OnComplete(function ()
|
-- self.owner.RoleLiveGO.transform:DOMove(Vector3.New(t.GameObject.transform.position.x-(self.owner.camp==0 and displaceoffset[1] or(-displaceoffset[1])),t.GameObject.transform.position.y+displaceoffset[2],t.GameObject.transform.position.z), combat.AttackDisplaceTime/1000, false):OnComplete(function ()
|
||||||
if self.owner.OnSkillPlay then
|
-- if self.owner.OnSkillPlay then
|
||||||
self.owner:OnSkillPlay(localtype,combat)
|
-- self.owner:OnSkillPlay(localtype,combat)
|
||||||
--LogError("技能位移Id"..combat.Id.."结束时间"..os.date())
|
-- --LogError("技能位移Id"..combat.Id.."结束时间"..os.date())
|
||||||
end
|
-- end
|
||||||
end)
|
-- end)
|
||||||
end
|
-- end
|
||||||
else
|
-- else
|
||||||
if self.owner.OnSkillPlay then
|
-- if self.owner.OnSkillPlay then
|
||||||
self.owner:OnSkillPlay(localtype,combat)
|
-- self.owner:OnSkillPlay(localtype,combat)
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
if self.owner.role.type == BattleUnitType.Role then
|
if self.owner.role.type == BattleUnitType.Role then
|
||||||
if combat.BeforeEffectDelay then
|
if combat.BeforeEffectDelay then
|
||||||
self.owner:DelayFunc(combat.BeforeEffectDelay/1000, function()
|
self.owner:DelayFunc(combat.BeforeEffectDelay/1000, function()
|
||||||
|
@ -319,6 +347,22 @@ local FullEffectPosition = {
|
||||||
Enemy_COL_2 = Vector3.New(0, 0, 0),
|
Enemy_COL_2 = Vector3.New(0, 0, 0),
|
||||||
Enemy_COL_3 = Vector3.New(50, 0, 0),
|
Enemy_COL_3 = Vector3.New(50, 0, 0),
|
||||||
}
|
}
|
||||||
|
local MoveMentPosition = {
|
||||||
|
My_All = Vector3.New(-300, 0, 0),
|
||||||
|
My_Front = Vector3.New(-120, 0, 0),
|
||||||
|
My_Behind = Vector3.New(20, 0, 0),
|
||||||
|
My_COL_1 = Vector3.New(-300, -566, 0),
|
||||||
|
My_COL_2 = Vector3.New(0, -566, 0),
|
||||||
|
My_COL_3 = Vector3.New(300, -566, 0),
|
||||||
|
|
||||||
|
|
||||||
|
Enemy_All = Vector3.New(50, 0, 0), --全部
|
||||||
|
Enemy_Front = Vector3.New(0, 0, 0),--前面一列
|
||||||
|
Enemy_Behind = Vector3.New(990,-551 , 0), --后面一列
|
||||||
|
Enemy_COL_1 = Vector3.New(990, 916, 0),--第一行
|
||||||
|
Enemy_COL_2 = Vector3.New(990, 378, 0),--第二行
|
||||||
|
Enemy_COL_3 = Vector3.New(990, -250, 0),--第三行
|
||||||
|
}
|
||||||
function SkillCaster:GetEffectSPostion(skill)
|
function SkillCaster:GetEffectSPostion(skill)
|
||||||
local chooseId = skill:GetDirectChooseId()
|
local chooseId = skill:GetDirectChooseId()
|
||||||
local chooseLimit = math.floor(chooseId / 10000) % 10
|
local chooseLimit = math.floor(chooseId / 10000) % 10
|
||||||
|
@ -334,7 +378,7 @@ function SkillCaster:GetEffectSPostion(skill)
|
||||||
end
|
end
|
||||||
return FullEffectPosition.My_All
|
return FullEffectPosition.My_All
|
||||||
end
|
end
|
||||||
function SkillCaster:GetEffectPosition(skill)
|
function SkillCaster:GetMovePosition(skill)
|
||||||
local chooseId = skill:GetDirectChooseId()
|
local chooseId = skill:GetDirectChooseId()
|
||||||
local chooseLimit = math.floor(chooseId / 10000) % 10
|
local chooseLimit = math.floor(chooseId / 10000) % 10
|
||||||
local targets = skill:GetDirectTargets()
|
local targets = skill:GetDirectTargets()
|
||||||
|
@ -344,18 +388,18 @@ function SkillCaster:GetEffectPosition(skill)
|
||||||
|
|
||||||
|
|
||||||
if chooseLimit == 0 or chooseLimit == 4 or chooseLimit == 5 then
|
if chooseLimit == 0 or chooseLimit == 4 or chooseLimit == 5 then
|
||||||
return targetCamp == 0 and FullEffectPosition.My_All or FullEffectPosition.Enemy_All
|
return targetCamp == 0 and MoveMentPosition.My_All or MoveMentPosition.Enemy_All
|
||||||
elseif chooseLimit == 1 or chooseLimit == 2 then --前排,后排
|
elseif chooseLimit == 1 or chooseLimit == 2 then --前排,后排
|
||||||
if targetCamp == 0 then
|
if targetCamp == 0 then
|
||||||
return targetPos <= 3 and FullEffectPosition.My_Front or FullEffectPosition.My_Behind
|
return targetPos <= 3 and MoveMentPosition.My_Front or MoveMentPosition.My_Behind
|
||||||
else
|
else
|
||||||
return targetPos <= 3 and FullEffectPosition.Enemy_Front or FullEffectPosition.Enemy_Behind
|
return targetPos <= 3 and MoveMentPosition.Enemy_Front or MoveMentPosition.Enemy_Behind
|
||||||
end
|
end
|
||||||
elseif chooseLimit == 3 then --队列
|
elseif chooseLimit == 3 then --队列
|
||||||
local col = (targetPos-1) % 3 + 1
|
local col = (targetPos-1) % 3 + 1
|
||||||
return targetCamp == 0 and FullEffectPosition["My_COL_"..col] or FullEffectPosition["Enemy_COL_"..col]
|
return targetCamp == 0 and MoveMentPosition["My_COL_"..col] or MoveMentPosition["Enemy_COL_"..col]
|
||||||
end
|
end
|
||||||
return FullEffectPosition.My_All
|
return MoveMentPosition.My_All
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 检测特效旋转
|
-- 检测特效旋转
|
||||||
|
|
Loading…
Reference in New Issue