From f497a63e7345914ccbcec84bf8629212730ff63f Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Sat, 27 Mar 2021 20:22:14 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=88=98=E6=96=97]=3D=3D=3D=3D=3D=3D=3D=3D=3D?= =?UTF-8?q?=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=E6=94=BE=E9=80=90=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=A1=A8=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Battle/Logic/Buff/Exile.lua | 8 ++----- .../Battle/Logic/Misc/BattleDefine.lua | 2 ++ .../Modules/Battle/View/Unit/EnemyView.lua | 21 ++++++++++++++++--- .../Modules/Battle/View/Unit/PlayerView.lua | 14 +++++++++++-- 4 files changed, 34 insertions(+), 11 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Exile.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Exile.lua index 683029149d..fe99750bca 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Exile.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Exile.lua @@ -11,12 +11,10 @@ end --初始化后调用一次 function Exile:OnStart() self.target.isExile = true - self.ownPassiveList = self.target.passiveList - self.target.passiveList=nil if self.caster.exileTargets then table.insert(self.caster.exileTargets,self.target) end - -- self.target.Event:SetIsTrigger(false) + self.target.Event:DispatchEvent(BattleEventName.RoleBeExile, self) end --间隔N帧触发,返回true时表示继续触发,返回false立刻触发OnEnd @@ -26,14 +24,12 @@ end --效果结束时调用一次 function Exile:OnEnd() - LogError("放逐结束") self.target.isExile = false - --self.target.Event:SetIsTrigger(true) + self.target.Event:DispatchEvent(BattleEventName.RoleExileEnd, self) end --只有当cover字段为true时触发,返回true则被新效果覆盖 function Exile:OnCover(newBuff) - return true end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleDefine.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleDefine.lua index d748317693..88cbd27985 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleDefine.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleDefine.lua @@ -164,6 +164,8 @@ BattleEventName = { RecordBuff = indexAdd(), -- buff RecordSecKill = indexAdd(), -- 斩杀 DisposeRoleCtrl_noheal = indexAdd(),--处理角色禁疗 + RoleBeExile = indexAdd(),--角色被放逐 + RoleExileEnd = indexAdd(),--角色放逐结束 } BattleMaxFrame = 1000000 diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua index 470f30a48a..32849f5d4a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua @@ -133,7 +133,8 @@ function EnemyView:onCreate(go, role, position, root) role.Event:AddEvent(BattleEventName.BeSeckill, self.onBeSecKill, self) role.Event:AddEvent(BattleEventName.ShildTrigger, self.OnShieldTrigger, self) role.Event:AddEvent(BattleEventName.ShowHintText,self.OnShowHintText,self) - + role.Event:AddEvent(BattleEventName.RoleBeExile,self.OnRoleExile,self) + role.Event:AddEvent(BattleEventName.RoleExileEnd,self.OnRoleExileEnd,self) if IsOpenBattleDebug then local URoleProperty = go:GetComponent(typeof(RoleProperty)) @@ -146,6 +147,7 @@ function EnemyView:onCreate(go, role, position, root) self.URoleProperty:AddProperty(name, value) end) end + end -- @@ -227,7 +229,16 @@ function EnemyView:Update() end end - +--角色被放逐 +function EnemyView:OnRoleExile(role) + local color = Color.New(1,1,1,0.4) + Util.SetColor(self.RoleLiveGOGraphic, color) +end +--角色放逐结束 +function EnemyView:OnRoleExileEnd(role) + local color = Color.New(1, 1, 1, 1) + Util.SetColor(self.RoleLiveGOGraphic, color) +end -- 缩放 function EnemyView:DoScale(scale, dur, func) @@ -276,7 +287,11 @@ function EnemyView:SetHighLight(isLight, eScale, dur, func) end self.hlTween3 = DoTween.To(DG.Tweening.Core.DOGetter_float( function () return sc end), DG.Tweening.Core.DOSetter_float(function (progress) - local color = Color.New(progress, progress, progress, 1) + local aaa=1 + if self.role.isExile then + aaa=0.4 + end + local color = Color.New(progress, progress, progress,aaa) Util.SetColor(self.GameObject, color) Util.SetColor(self.RoleLiveGOGraphic, color) end), ec, dur):SetEase(Ease.Linear) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua index c53639b279..4150eabf57 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua @@ -155,7 +155,8 @@ function PlayerView:onCreate(go, role, position, root) role.Event:AddEvent(BattleEventName.BeSeckill, self.onBeSecKill, self) role.Event:AddEvent(BattleEventName.ShildTrigger, self.OnShieldTrigger, self) role.Event:AddEvent(BattleEventName.ShowHintText,self.OnShowHintText,self) - + role.Event:AddEvent(BattleEventName.RoleBeExile,self.OnRoleExile,self) + role.Event:AddEvent(BattleEventName.RoleExileEnd,self.OnRoleExileEnd,self) if IsOpenBattleDebug then local URoleProperty = go:GetComponent(typeof(RoleProperty)) if not URoleProperty then @@ -270,7 +271,16 @@ function PlayerView:DoScale(scale, dur, func) end) end - +--角色被放逐 +function PlayerView:OnRoleExile(role) + local color = Color.New(1, 1, 1, 0.4) + Util.SetColor(self.liveRender, color) +end +--角色放逐结束 +function PlayerView:OnRoleExileEnd(role) + local color = Color.New(1, 1, 1, 1) + Util.SetColor(self.liveRender, color) +end -- 设置高亮 function PlayerView:SetHighLight(isLight, eScale, dur, func) -- 设置变灰