|
@@ -74,6 +74,9 @@ namespace XmdsCommonServer.Plugin
|
|
//释放卡牌技能监听
|
|
//释放卡牌技能监听
|
|
readonly private List<OnTriggerCardSkillEvent> mTriggerCardSkillList = new List<OnTriggerCardSkillEvent>();
|
|
readonly private List<OnTriggerCardSkillEvent> mTriggerCardSkillList = new List<OnTriggerCardSkillEvent>();
|
|
|
|
|
|
|
|
+ //击杀其他单位监听
|
|
|
|
+ readonly private List<OnKillOtherUnitEvent> mKillOtherList = new List<OnKillOtherUnitEvent>();
|
|
|
|
+
|
|
|
|
|
|
private HashMap<int, IHandle> mHandleMap = new HashMap<int, IHandle>();
|
|
private HashMap<int, IHandle> mHandleMap = new HashMap<int, IHandle>();
|
|
private int mHandleUUID = 0;
|
|
private int mHandleUUID = 0;
|
|
@@ -327,6 +330,18 @@ namespace XmdsCommonServer.Plugin
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ class OnKillOtherUnitEvent : IHandle
|
|
|
|
+ {
|
|
|
|
+ public readonly int maType;
|
|
|
|
+ public readonly IOnKillOtherUnitEvent m_hand;
|
|
|
|
+
|
|
|
|
+ public OnKillOtherUnitEvent(IOnKillOtherUnitEvent handler, GameSkill info, int type) : base(info, false)
|
|
|
|
+ {
|
|
|
|
+ this.m_hand = handler;
|
|
|
|
+ this.maType = type;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
#region 事件监听.
|
|
#region 事件监听.
|
|
|
|
|
|
public delegate void OnHealEvent(XmdsVirtual attacker, XmdsVirtual hitter, int value, ref AtkResult result);
|
|
public delegate void OnHealEvent(XmdsVirtual attacker, XmdsVirtual hitter, int value, ref AtkResult result);
|
|
@@ -1046,6 +1061,32 @@ namespace XmdsCommonServer.Plugin
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public int RegistKillOtherEvent(IOnKillOtherUnitEvent call, GameSkill info, int monsterType)
|
|
|
|
+ {
|
|
|
|
+ OnKillOtherUnitEvent handle = new OnKillOtherUnitEvent(call, info, monsterType);
|
|
|
|
+ int ret = HandleUUIDCreate();
|
|
|
|
+ mKillOtherList.Add(handle);
|
|
|
|
+ mHandleMap.Add(ret, handle);
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public bool UnRegistKillOtherEvent(int handleUUID)
|
|
|
|
+ {
|
|
|
|
+ bool ret = false;
|
|
|
|
+ IHandle handle = null;
|
|
|
|
+
|
|
|
|
+ if (mHandleMap.TryGetValue(handleUUID, out handle))
|
|
|
|
+ {
|
|
|
|
+ if (handle != null && handle is OnKillOtherUnitEvent)
|
|
|
|
+ {
|
|
|
|
+ ret = mKillOtherList.Remove(handle as OnKillOtherUnitEvent);
|
|
|
|
+ mHandleMap.Remove(handleUUID);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
|
|
+
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
@@ -1570,6 +1611,24 @@ namespace XmdsCommonServer.Plugin
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /** 分发释放卡牌技能事件 */
|
|
|
|
+ public bool DispatchKillOtherEvent(IVirtualUnit attacker, IVirtualUnit deader)
|
|
|
|
+ {
|
|
|
|
+ for (int i = mKillOtherList.Count - 1; i >= 0; --i)
|
|
|
|
+ {
|
|
|
|
+ OnKillOtherUnitEvent hitend = mKillOtherList[i];
|
|
|
|
+ if (deader.GetMaType() >= hitend.maType)
|
|
|
|
+ {
|
|
|
|
+ if (!hitend.m_hand.Invoke(attacker as XmdsVirtual, deader as XmdsVirtual, hitend.m_skill))
|
|
|
|
+ {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
public void SetSkillActive(int skillTemplateID, bool active, bool pause_on_deactive = false)
|
|
public void SetSkillActive(int skillTemplateID, bool active, bool pause_on_deactive = false)
|
|
{
|
|
{
|
|
if (this.mSkillHelper != null && this.mSkillHelper.mActiveSkills != null)
|
|
if (this.mSkillHelper != null && this.mSkillHelper.mActiveSkills != null)
|
|
@@ -1679,6 +1738,7 @@ namespace XmdsCommonServer.Plugin
|
|
this.mReduceMPList.Clear();
|
|
this.mReduceMPList.Clear();
|
|
this.mTriggerCardSkillList.Clear();
|
|
this.mTriggerCardSkillList.Clear();
|
|
this.mShareMasterDmgList.Clear();
|
|
this.mShareMasterDmgList.Clear();
|
|
|
|
+ this.mKillOtherList.Clear();
|
|
|
|
|
|
mHandleUUID = 0;
|
|
mHandleUUID = 0;
|
|
}
|
|
}
|
|
@@ -1803,6 +1863,10 @@ namespace XmdsCommonServer.Plugin
|
|
{
|
|
{
|
|
result = UnRegistShareMasterDmgEvent(uuid);
|
|
result = UnRegistShareMasterDmgEvent(uuid);
|
|
}
|
|
}
|
|
|
|
+ else if (handle is OnKillOtherUnitEvent)
|
|
|
|
+ {
|
|
|
|
+ result = UnRegistKillOtherEvent(uuid);
|
|
|
|
+ }
|
|
else
|
|
else
|
|
{
|
|
{
|
|
log.Error("RemoveEventByUUID not process type: " + handle);
|
|
log.Error("RemoveEventByUUID not process type: " + handle);
|