【战斗】灵兽技能前摇特效播放位置调整,灵兽技能条件添加类型3,修复灵兽立绘不会回收的问题

dev_chengFeng
gaoxin 2020-11-02 11:54:48 +08:00
parent 4cb30990e1
commit 9b65cbba0f
8 changed files with 111 additions and 34 deletions

View File

@ -31044,7 +31044,7 @@ RectTransform:
m_GameObject: {fileID: -4972557976968538313}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.88, y: 0.88, z: 0.88}
m_LocalScale: {x: 0.8, y: 0.8, z: 0.88}
m_Children: []
m_Father: {fileID: 692595718783767060}
m_RootOrder: 4
@ -31424,7 +31424,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: -55, y: 1070}
m_AnchoredPosition: {x: -55, y: 869.7999}
m_SizeDelta: {x: 80, y: 80}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3965231938052073796
@ -42523,7 +42523,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: -55, y: 1186.9001}
m_AnchoredPosition: {x: -55, y: 986.7001}
m_SizeDelta: {x: 80, y: 80}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &-5903772607965869559
@ -42672,7 +42672,7 @@ RectTransform:
m_GameObject: {fileID: -95478003423446612}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.88, y: 0.88, z: 0.88}
m_LocalScale: {x: 0.8, y: 0.8, z: 0.88}
m_Children: []
m_Father: {fileID: -7942002335202367750}
m_RootOrder: 1
@ -96988,7 +96988,7 @@ RectTransform:
m_GameObject: {fileID: 5551026719691139111}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.88, y: 0.88, z: 0.88}
m_LocalScale: {x: 0.8, y: 0.8, z: 0.88}
m_Children: []
m_Father: {fileID: 3994331577905171257}
m_RootOrder: 1
@ -102684,8 +102684,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: -55, y: 951.2001}
m_SizeDelta: {x: 80, y: 80}
m_AnchoredPosition: {x: -55, y: 751}
m_SizeDelta: {x: 85, y: 85}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6670039054794519703
CanvasRenderer:
@ -120989,6 +120989,32 @@ PrefabInstance:
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 2781097023052378972, guid: 9c72861411653334d98f12e4dbdf4ded,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 351
objectReference: {fileID: 0}
- target: {fileID: 2781097023052378972, guid: 9c72861411653334d98f12e4dbdf4ded,
type: 3}
propertyPath: m_SizeDelta.x
value: 484
objectReference: {fileID: 0}
- target: {fileID: 2781097023052378972, guid: 9c72861411653334d98f12e4dbdf4ded,
type: 3}
propertyPath: m_SizeDelta.y
value: 636
objectReference: {fileID: 0}
- target: {fileID: 2781097023052378979, guid: 9c72861411653334d98f12e4dbdf4ded,
type: 3}
propertyPath: m_Color.a
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2781097023052378979, guid: 9c72861411653334d98f12e4dbdf4ded,
type: 3}
propertyPath: m_Sprite
value:
objectReference: {fileID: 21300000, guid: 939310282ce1c2a4d9202a787f0f8407,
type: 3}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 9c72861411653334d98f12e4dbdf4ded, type: 3}
--- !u!224 &2781097022139180250 stripped
@ -121129,6 +121155,27 @@ PrefabInstance:
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4451514803643556220, guid: de916f6aab438ee4e811cad74ed73a7d,
type: 3}
propertyPath: m_SizeDelta.x
value: 484
objectReference: {fileID: 0}
- target: {fileID: 4451514803643556220, guid: de916f6aab438ee4e811cad74ed73a7d,
type: 3}
propertyPath: m_SizeDelta.y
value: 636
objectReference: {fileID: 0}
- target: {fileID: 4451514803643556223, guid: de916f6aab438ee4e811cad74ed73a7d,
type: 3}
propertyPath: m_Color.a
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4451514803643556223, guid: de916f6aab438ee4e811cad74ed73a7d,
type: 3}
propertyPath: m_Sprite
value:
objectReference: {fileID: 21300000, guid: 939310282ce1c2a4d9202a787f0f8407,
type: 3}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: de916f6aab438ee4e811cad74ed73a7d, type: 3}
--- !u!224 &4451514803276425241 stripped

View File

@ -405,7 +405,6 @@ end
-- 战斗结束
function BattleLogic.BattleEnd(result)
--
LogError("战斗结束")
BattleLogic.Event:DispatchEvent(BattleEventName.BeforeBattleEnd, result)
--
BattleLogic.IsEnd = true

View File

@ -32,6 +32,20 @@ local _ConditionConfig = {
return BattleUtil.CompareValue(curRound, comValue, comType)
end,
[3] = function(skill, condition) --2:回合数 【比较类型】 N 且 概率为 N
local conId = condition[1]
local comType = condition[2]
local comValue = condition[3]
local rand = condition[3]
-- 获取当前回合
local curRound = BattleLogic.GetCurRound()
local isRoundOk = BattleUtil.CompareValue(curRound, comValue, comType)
-- 判断概率
local r = Random.Range01()
local isRandomOk = r <= rand/10000
return isRoundOk and isRandomOk
end,
[4] = function(skill, condition) --4:行动单位的职业设定 【比较类型】 N
local conId = condition[1]
local comType = condition[2]
@ -39,7 +53,7 @@ local _ConditionConfig = {
-- 当前释放技能的单位的职业
local professionId = skill.owner.professionId
return professionId == comValue
end
end,
}
-- 条件检测

View File

@ -68,7 +68,7 @@ function Skill:Cast(func)
BattleLogic.Event:DispatchEvent(BattleEventName.SkillCast, self)
-- 只对效果1的目标发送事件效果1是技能的直接伤害目标
self.effectCaster:ForeachTargets(function(role)
role.Event:DispatchEvent(BattleEventName.BeSkillCastEnd, self)
role.Event:DispatchEvent(BattleEventName.BeSkillCast, self)
end)
--技能的施法时间计算根据当前目标id关联的持续时间取其中时间最长的一个
local duration = self.hitTime + self.continueTime

View File

@ -17,7 +17,6 @@ end
--
function this.AddMonsterSkill(skill)
LogPink("灵兽技能加入"..skill.id)
if skill.type == BattleSkillType.Monster then
table.insert(this.MonsterSkillList, skill)
end

View File

@ -199,6 +199,12 @@ function this:OnSortingOrderChange(battleSorting)
for _, v in pairs(tbRoleDispose) do
v:OnSortingOrderChange(battleSorting)
end
for _, v in pairs(tbMonster) do
v:OnSortingOrderChange(battleSorting)
end
for _, v in pairs(tbMonsterDispose) do
v:OnSortingOrderChange(battleSorting)
end
end
@ -876,6 +882,10 @@ function this:OnClose()
v:Dispose()
end
tbRoleDispose = {}
for _, v in pairs(tbMonsterDispose) do
v:Dispose()
end
tbMonsterDispose = {}
for k, v in pairs(delayRecycleList) do
for i=1, #v do

View File

@ -53,12 +53,15 @@ function MonsterView:onCreate(go, role, position, root)
-- casting技能立绘
self.RoleLiveGO2 = poolManager:LoadLive(self.livePath, self.skillCastRoot.gameObject.transform.parent, Vector3.one, Vector3.zero)
self.RoleLiveGO2.transform:SetParent(self.skillCastRoot.gameObject.transform)
self.RoleLiveGO2:GetComponent("RectTransform").anchoredPosition = Vector2.New(self.outOffset[1], self.outOffset[2])
local offset = self.camp == 0 and self.offset or self.outOffset
self.RoleLiveGO2:GetComponent("RectTransform").anchoredPosition = Vector2.New(offset[1], offset[2])
if self.camp==1 then
self.RoleLiveGO2.transform.rotation=Vector3.New(0,180,0)
end
self.RoleLiveGO2.transform.localScale = Vector3.one * self.enemy_liveScale --* 2
local scale = self.camp == 0 and self.play_liveScale or self.enemy_liveScale
self.RoleLiveGO2.transform.localScale = Vector3.one * scale --* 2
self.RoleLiveGO2:SetActive(false)
self.RoleLiveGOGraphic2 = self.RoleLiveGO2:GetComponent("SkeletonGraphic")
self.RoleLiveGOTran2 = self.RoleLiveGO2:GetComponent("RectTransform")
@ -153,17 +156,10 @@ end
function MonsterView:onDispose()
self.GameObject.transform.parent.localScale = Vector3.one
self.BuffCtrl:Dispose()
--
Util.SetSpineGray(self.RoleLiveGOGraphic, false)
Util.SetSpineGray(self.RoleLiveGOGraphic2, false)
Util.SetColor(self.RoleLiveGOGraphic, Color.New(1, 1, 1, 1))
Util.SetColor(self.RoleLiveGOGraphic2, Color.New(1, 1, 1, 1))
self.RoleLiveGOGraphic.freeze = false
self.RoleLiveGOGraphic2.freeze = false
-- poolManager:UnLoadLive(self.livePath, self.RoleLiveGO)
poolManager:UnLoadLive(self.livePath, self.RoleLiveGO2)
-- 回收本节点
BattlePool.RecycleItem(self.GameObject, BATTLE_POOL_TYPE.ENEMY_ROLE)

View File

@ -51,8 +51,10 @@ function SkillCaster:OnSkillCast(skill)
self.owner:OnSkillPlay()
end
-- 播放
-- 这里相当于技能前摇,等待立绘播放到需要释放关键帧的时间时继续释放技能
self:CheckSkillForoleEffect(combat, skill)
-- 这里相当于技能前摇,等待立绘播放到需要释放关键帧的时间时继续释放技能(人物前摇特效)
if self.owner.role.type == BattleUnitType.Role then
self:CheckSkillForoleEffect(combat, skill)
end
self.owner:DelayFunc(self.actionTime, function()
self:CheckFullSceenSkill(combat, skill)
-- 继续战斗放在特效加载之后,避免特效加载时间对战斗时间得影响
@ -79,7 +81,7 @@ function SkillCaster:OnSkillCast(skill)
if combat.VerticalDrawing == 1 then
_PlaySkill()
elseif combat.VerticalDrawing == 2 then
self:PlaySkillCastingEffect(combat, function()
self:PlaySkillCastingEffect(combat, skill, function()
_PlaySkill()
end)
end
@ -90,7 +92,7 @@ end
function SkillCaster:PlaySkillCastingEffect(combat, func)
function SkillCaster:PlaySkillCastingEffect(combat, skill, func)
-- 播放casting
self.castingEfectNode:SetActive(false)
self.castingEfectNode:SetActive(true)
@ -108,6 +110,10 @@ function SkillCaster:PlaySkillCastingEffect(combat, func)
SoundManager.PlaySound(combat.SkillNameVoice)
end
-- 这里相当于技能前摇,等待立绘播放到需要释放关键帧的时间时继续释放技能(灵兽前摇特效)
if self.owner.role.type == BattleUnitType.Monster then
self:CheckSkillForoleEffect(combat, skill)
end
-- 调用上层接口
if self.owner.OnSkillCastingStart then
self.owner:OnSkillCastingStart()
@ -154,9 +160,9 @@ function SkillCaster:GetEffectSPostion(skill)
if chooseLimit == 3 then
local col = (targetPos-1) % 3 + 1
return self.camp == 0 and FullEffectPosition["My_COL_"..col] or FullEffectPosition["Enemy_COL_"..col]
return self.owner.camp == 0 and FullEffectPosition["My_COL_"..col] or FullEffectPosition["Enemy_COL_"..col]
else
return self.camp == 0 and FullEffectPosition.My_All or FullEffectPosition.Enemy_All
return self.owner.camp == 0 and FullEffectPosition.My_All or FullEffectPosition.Enemy_All
end
end
@ -193,8 +199,8 @@ function SkillCaster:CheckRotate(go, orientation)
local isR = orientation[1] and orientation[1][1] or 0
local rt = orientation[2]
rt = rt and Vector3.New(rt[1], rt[2], rt[3]) or Vector3.zero
if (self.camp == 0 and isR == 1)
or (self.camp == 1 and isR == 2) then
if (self.owner.camp == 0 and isR == 1)
or (self.owner.camp == 1 and isR == 2) then
go.transform.localRotation = rt
return true
end
@ -332,12 +338,18 @@ function SkillCaster:CheckSkillForoleEffect(combat, skill)
-- 挂在人身上,以人物中心为原点
if combat.BeforeEffectType == 1 then
local sortingOrder
if self.camp == 0 then
sortingOrder = self.owner.GameObject:GetComponent("Canvas").sortingOrder
if self.owner.role.type == BattleUnitType.Role then
local sortingOrder
if self.owner.cam == 0 then
sortingOrder = self.owner.GameObject:GetComponent("Canvas").sortingOrder
end
go = BattleManager.LoadAsset(path, sortingOrder)
go.transform:SetParent(self.owner.GameObject.transform)
elseif self.owner.role.type == BattleUnitType.Monster then
go = BattleManager.LoadAsset(path)
go.transform:SetParent(self.owner.RoleLiveGO2.gameObject.transform)
end
go = BattleManager.LoadAsset(path, sortingOrder)
go.transform:SetParent(self.owner.GameObject.transform)
-- 屏幕中心
elseif combat.BeforeEffectType == 2 then
local sortingOrder = self.effectRoot:GetComponent("Canvas").sortingOrder