XmdsServerScene.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683
  1. using CommonAI.Zone.Instance;
  2. using CommonAI.Zone.ZoneEditor;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using XmdsCommon.Plugin;
  8. using CommonAI.Zone;
  9. using CommonAI.Zone.Attributes;
  10. using CommonAI.Zone.Helper;
  11. using XmdsCommonServer.Plugin.Units;
  12. using XmdsCommonServer.Plugin.Quest;
  13. using XmdsCommon.EditorData;
  14. using CommonLang;
  15. using CommonLang.Vector;
  16. using CommonAI.RTS.Manhattan;
  17. using XmdsCommon.Message;
  18. using CommonAI.Data;
  19. using CommonAI.ZoneServer.JSGModule;
  20. namespace XmdsCommonServer.Plugin.Scene
  21. {
  22. /// <summary>
  23. /// Xmds场景
  24. /// </summary>
  25. public class XmdsServerScene : EditorScene
  26. {
  27. /// <summary>
  28. /// 遍历单位
  29. /// </summary>
  30. /// <param name="obj"></param>
  31. /// <param name="cancel">设置为True,立即停止遍历</param>
  32. public delegate void ObjectForEachAction<T>(T obj, ref bool cancel) where T : class;
  33. private HashMap<int, List<ZoneRegion>> mRebirthRegionMap = new HashMap<int, List<ZoneRegion>>();
  34. public XmdsServerScene(TemplateManager templates, InstanceZoneListener listener, SceneData data, GSCreateAreaData gsData, string bindGameSrvId, int spaceDiv = 11)
  35. : this(templates, listener, data, gsData, spaceDiv, DateTime.Now.Millisecond, bindGameSrvId)
  36. { }
  37. protected XmdsServerScene(TemplateManager templates, InstanceZoneListener listener, SceneData data, GSCreateAreaData gsData, int spaceDiv, int rarndomSeed, string bindGameSrvId)
  38. : base(templates, listener, data, gsData, spaceDiv, rarndomSeed)
  39. {
  40. this.OnQuestAccepted += XmdsServerScene_OnQuestAccepted;
  41. this.OnQuestDropped += XmdsServerScene_OnQuestDropped;
  42. this.OnQuestCommitted += XmdsServerScene_OnQuestCommitted;
  43. this.OnQuestStatusChanged += XmdsServerScene_OnQuestStatusChanged;
  44. this.OnPlayerReady += XmdsServerScene_OnPlayerReady;
  45. //设置山大王信息
  46. this.mKingID = XmdsDataMgr.GetInstance().GetMapKingID(this.GetSceneID());
  47. this.mBindGameSrvId = bindGameSrvId;
  48. }
  49. protected override void InitTerrain(SceneData data, int spaceDiv, out ZoneManhattanMap terrain_data, out AstarManhattan path_finder, out ManhattanMapAreaGenerator area_gen)
  50. {
  51. //if ((data.Properties as XmdsSceneProperties).ServerSceneData.UsespaceDiv) { spaceDiv = 11; }
  52. //else { spaceDiv = 0; }
  53. base.InitTerrain(data, spaceDiv, out terrain_data, out path_finder, out area_gen);
  54. }
  55. // private static int GetSpaceDiv(SceneData data)
  56. // {
  57. // if ((data.Properties as XmdsSceneProperties).ServerSceneData.UsespaceDiv) { return 11; }
  58. // else { return 0; }
  59. // }
  60. //---------------------------------------------------------------------------------------------------------------------
  61. #region _任务相关_
  62. private void XmdsServerScene_OnPlayerReady(InstancePlayer player)
  63. {
  64. XmdsInstancePlayer p = player as XmdsInstancePlayer;
  65. var list = p.GetQuests();
  66. foreach (var q in list)
  67. {
  68. QuestScriptManager.CreateQuestScript(q.QuestID, p);
  69. }
  70. }
  71. private void XmdsServerScene_OnQuestStatusChanged(InstancePlayer player, string quest, string key, string value)
  72. {
  73. if (key == XmdsQuestData.Attribute_InitOK)
  74. {
  75. QuestScriptManager.CreateQuestScript(quest, player as XmdsInstancePlayer);
  76. }
  77. else
  78. {
  79. QuestScriptManager.QuestStatusChanged(quest, player as XmdsInstancePlayer, key, value);
  80. }
  81. }
  82. private void XmdsServerScene_OnQuestAccepted(InstancePlayer player, string quest)
  83. {
  84. //此时没有属性,CreateQuestScript放在INIT_OK
  85. //QuestScriptManager.CreateQuestScript(quest, player as XmdsInstancePlayer);
  86. }
  87. private void XmdsServerScene_OnQuestCommitted(InstancePlayer player, string quest)
  88. {
  89. QuestScriptManager.ClearQuestScript(quest, player as XmdsInstancePlayer);
  90. }
  91. private void XmdsServerScene_OnQuestDropped(InstancePlayer player, string quest)
  92. {
  93. QuestScriptManager.ClearQuestScript(quest, player as XmdsInstancePlayer);
  94. }
  95. #endregion
  96. //---------------------------------------------------------------------------------------------------------------------
  97. #region _AOI_相关_
  98. public override bool IsTeammates(InstanceUnit src, InstanceUnit dst)
  99. {
  100. if (src != null && dst != null)
  101. {
  102. var s_v = src.Virtual as XmdsVirtual;
  103. var d_v = dst.Virtual as XmdsVirtual;
  104. return d_v.IsTeamMember(s_v.GetPlayerUUID());
  105. }
  106. return false;
  107. }
  108. public override bool IsVisibleAOI(InstanceZoneObject src, InstanceZoneObject dst)
  109. {
  110. if (src is XmdsInstancePlayer)
  111. {
  112. XmdsInstancePlayer player = src as XmdsInstancePlayer;
  113. if (!player.IsPlayerReady())
  114. {
  115. return false;
  116. }
  117. String bindPlayerId = dst.GetBindPlayerId();
  118. if(bindPlayerId != null && bindPlayerId != player.PlayerUUID)
  119. {
  120. return false;
  121. }
  122. }
  123. if (src.AoiStatus == dst.AoiStatus)
  124. {
  125. var dstUnit = dst as InstanceUnit;
  126. if (dstUnit == null)
  127. {
  128. return true;
  129. }
  130. //if(dstUnit.IsPet)
  131. //{
  132. // InstancePet dstPet = dst as InstancePet;
  133. // if(dstPet != null && dstPet.Master != null && dstPet.Master.AoiStatus != src.AoiStatus)
  134. // {
  135. // return false;
  136. // }
  137. //}
  138. if (dstUnit.IsVisible)
  139. {
  140. return true;
  141. }
  142. if (IsTeammates(src as InstanceUnit, dstUnit))
  143. {
  144. return (dstUnit.Virtual as XmdsVirtual).TeamMemberVisible;
  145. }
  146. return false;
  147. }
  148. //else
  149. //{
  150. // InstancePet dstPet = dst as InstancePet;
  151. // if (dstPet != null && dstPet.Master != null && dstPet.Master == src)
  152. // {
  153. // return true;
  154. // }
  155. //}
  156. return base.IsVisibleAOI(src, dst);
  157. }
  158. #endregion
  159. #region Attack.
  160. public override bool IsAttackable(InstanceUnit src, InstanceUnit target, SkillTemplate.CastTarget expectTarget, AttackReason reason, ITemplateData weapon)
  161. {
  162. // 宠物也能被攻击
  163. //if (target is InstancePet)
  164. //{
  165. // return false;
  166. //}
  167. var sp = (src.Virtual as XmdsVirtual);
  168. if (sp == null)
  169. {
  170. Log.Error("IsAttackable src or src.Virtual is null");
  171. return false;
  172. }
  173. var dp = (target.Virtual as XmdsVirtual);
  174. if (dp == null)
  175. {
  176. Log.Error("IsAttackable target or target.Virtual is null");
  177. return false;
  178. }
  179. #region 安全区域检测. 宠物不会是目标
  180. if (expectTarget == SkillTemplate.CastTarget.Enemy && target.IsPlayerUnit && src.IsPlayerUnit)
  181. {
  182. if (target.Virtual.IsInSafeArea() || src.Virtual.IsInSafeArea())
  183. {
  184. return false;
  185. }
  186. }
  187. #endregion
  188. #region 中立单位检测.
  189. if (target.Force == 0) //0代表绝对中立.不能被攻击.
  190. {
  191. return false;
  192. }
  193. #endregion
  194. #region 无敌单位.
  195. if (target.IsInvincible && expectTarget == SkillTemplate.CastTarget.Enemy)
  196. {
  197. return false;
  198. }
  199. //追杀怪只能追杀目标
  200. if (!String.IsNullOrEmpty(src.GetAttackPlayer()))
  201. {
  202. if(target.PlayerUUID == null || target.PlayerUUID != src.GetAttackPlayer())
  203. {
  204. return false;
  205. }
  206. }
  207. if (src != target && (!src.IsPlayerUnit || !JSGModule.IsExpectValidForPet(expectTarget)))
  208. {
  209. // 宠物攻击的时候
  210. if (src.IsPet)
  211. {
  212. // 目标是宠物或者非主人
  213. if (target.IsPet || (target.IsPlayer && src.Virtual.GetMasterID() != target.ID))
  214. {
  215. return false;
  216. }
  217. }
  218. // 宠物被攻击的时候
  219. else if (target.IsPet)
  220. {
  221. // 攻击者是宠物或者非主人
  222. //if (src.IsPet || (src.IsPlayer && target.Virtual.GetMasterID() != src.ID))
  223. {
  224. return false;
  225. }
  226. }
  227. }
  228. //被追杀人和怪 可攻击追杀怪
  229. if(!String.IsNullOrEmpty(target.GetAttackPlayer()) && src.PlayerUUID != target.GetAttackPlayer())
  230. {
  231. if (src.IsPet && src.Virtual.GetMasterUnit() != null)
  232. {
  233. if (src.Virtual.GetMasterUnit().PlayerUUID != target.GetAttackPlayer())
  234. {
  235. return false;
  236. }
  237. }
  238. else
  239. {
  240. return false;
  241. }
  242. }
  243. #endregion
  244. #region 隐形对攻击的影响.
  245. //单位隐形时,需要判断搜索方是否为其队友,如果是则无视隐形,否按照攻击逻辑判断.
  246. //if(target.IsDead)
  247. //if (target.IsVisible == false)
  248. // {
  249. // if ((reason == AttackReason.Tracing || reason == AttackReason.Look) &&
  250. // expectTarget == SkillTemplate.CastTarget.Enemy)
  251. // {
  252. // bool attackAble = false;
  253. // var zv = ((target as InstanceUnit).Virtual as XmdsVirtual);
  254. // if (zv.TeamMemberVisible)
  255. // {
  256. // //不是队友看不到单位,搜索时不可见.
  257. // var uuid = ((target as InstanceUnit).Virtual as XmdsVirtual).GetPlayerUUID();
  258. // attackAble = !((src as InstanceUnit).Virtual as XmdsVirtual).IsTeamMember(uuid);
  259. // }
  260. // return attackAble;
  261. // }
  262. // }
  263. #endregion
  264. #region 位面检测.
  265. //隐身状态下,同位面,不可见,但可以被攻击.
  266. if (reason != AttackReason.Attack && !IsVisibleAOI(src, target))//AOI相关.不在同位面.
  267. {
  268. //非攻击性质才算AOI.
  269. return false;
  270. }
  271. #endregion
  272. #region PK等级保护.
  273. if (((target.Virtual) as XmdsVirtual).IsAttackable(src.Virtual as XmdsVirtual) == false)
  274. {
  275. return false;
  276. }
  277. #endregion
  278. #region 技能目标单位类型状态检测.
  279. //攻击作用单位类型.
  280. var unit_type = XmdsSkillProperties.TargetUnitType.ALL;
  281. if (weapon is SkillTemplate && reason == AttackReason.Attack)
  282. {
  283. unit_type = ((weapon as SkillTemplate).Properties as XmdsSkillProperties).NeedTargetType;
  284. }
  285. else if (weapon is SpellTemplate && reason == AttackReason.Attack)
  286. {
  287. unit_type = ((weapon as SpellTemplate).Properties as XmdsSpellProperties).NeedTargetType;
  288. }
  289. switch (unit_type)
  290. {
  291. case XmdsSkillProperties.TargetUnitType.Monster:
  292. if (!(dp is XmdsVirtual_Monster))
  293. {
  294. return false;
  295. }
  296. break;
  297. case XmdsSkillProperties.TargetUnitType.Player:
  298. if (!(dp is XmdsVirtual_Player))
  299. {
  300. return false;
  301. }
  302. break;
  303. case XmdsSkillProperties.TargetUnitType.ExcpetPlayer:
  304. if ((dp is XmdsVirtual_Player))
  305. {
  306. return false;
  307. }
  308. break;
  309. }
  310. bool onlyForDead = false;
  311. //对死人.
  312. if (src.CurrentState != null)
  313. {
  314. InstanceUnit.State s = src.CurrentState;
  315. InstanceUnit.StateSkill ss = s as InstanceUnit.StateSkill;
  316. if (ss != null)
  317. {
  318. if ((ss.SkillData.Properties as XmdsSkillProperties).TargetType == XmdsSkillProperties.XmdsSkillTargetType.AllianceDead)
  319. {
  320. //只对死亡单位有效.
  321. onlyForDead = true;
  322. }
  323. }
  324. }
  325. if (!target.IsActive)
  326. {
  327. if (onlyForDead)
  328. {
  329. /*
  330. switch(expectTarget)
  331. {
  332. case SkillTemplate.CastTarget.Alias:
  333. case SkillTemplate.CastTarget.AlliesExcludeSelf:
  334. return (src.Virtual as XmdsVirtual).IsTeamMember((target.Virtual as XmdsVirtual).GetPlayerUUID());
  335. }
  336. */
  337. //只要是玩家,不管敌友,都可以复活.
  338. return (target is XmdsInstancePlayer);
  339. }
  340. return false;
  341. }
  342. else
  343. {
  344. //对活人.
  345. if (onlyForDead == false)
  346. {
  347. switch (expectTarget)
  348. {
  349. case SkillTemplate.CastTarget.Enemy:
  350. //不是自己人.
  351. return !(src.Virtual as XmdsVirtual).IsAllies((target.Virtual as XmdsVirtual), expectTarget, reason);
  352. case SkillTemplate.CastTarget.PetForMaster:
  353. //if (src.Virtual is XmdsVirtual_Pet)
  354. //{
  355. // if ((src.Virtual as XmdsVirtual_Pet).IsMaster((target.Virtual as XmdsVirtual)))
  356. // return true;
  357. //}
  358. if(src is InstancePet)
  359. {
  360. InstancePet pet = src as InstancePet;
  361. if(pet != null && pet.Master == target)
  362. {
  363. return true;
  364. }
  365. }
  366. return false;
  367. case SkillTemplate.CastTarget.EveryOne:
  368. return JudgeEveryOneAttackable(src, target, expectTarget);
  369. case SkillTemplate.CastTarget.Alias:
  370. case SkillTemplate.CastTarget.AlliesExcludeSelf:
  371. // 可能存在即使队友,又是敌人的,所以如果是敌人就不认队友了,你tmd和我为敌,我就不给你加血
  372. if (!(src.Virtual as XmdsVirtual).IsAllies((target.Virtual as XmdsVirtual), expectTarget, reason))
  373. return false;
  374. if (src == target) { return false; }
  375. return (src.Virtual as XmdsVirtual).IsTeamMember(target);
  376. case SkillTemplate.CastTarget.AlliesIncludeSelf:
  377. // 可能存在即使队友,又是敌人的,所以如果是敌人就不认队友了,你tmd和我为敌,我就不给你加血
  378. if (!(src.Virtual as XmdsVirtual).IsAllies((target.Virtual as XmdsVirtual), expectTarget, reason))
  379. return false;
  380. return (src.Virtual as XmdsVirtual).IsTeamMember(target);
  381. //return (src.Virtual as XmdsVirtual).IsTeamMember((target.Virtual as XmdsVirtual).GetPlayerUUID());
  382. case SkillTemplate.CastTarget.EveryOneExcludeSelf:
  383. return JudgeEveryOneAttackable(src, target, expectTarget);
  384. case SkillTemplate.CastTarget.Self:
  385. return src == target;
  386. case SkillTemplate.CastTarget.EnemyAndSelf:
  387. return src == target || !(src.Virtual as XmdsVirtual).IsAllies((target.Virtual as XmdsVirtual), expectTarget, reason);
  388. case SkillTemplate.CastTarget.NA:
  389. default:
  390. return false;
  391. }
  392. }
  393. return false;
  394. }
  395. #endregion
  396. }
  397. /** 判断所有人类型可攻击模式 */
  398. private bool JudgeEveryOneAttackable(InstanceUnit src, InstanceUnit target, SkillTemplate.CastTarget expectTarget)
  399. {
  400. //if (SkillTemplate.CastTarget.EveryOne == expectTarget)
  401. //{
  402. // return (!target.IsInvincible);
  403. //}
  404. //else if (SkillTemplate.CastTarget.EveryOneExcludeSelf == expectTarget)
  405. //{
  406. // return (src != target) && (!target.IsInvincible);
  407. //}
  408. if (SkillTemplate.CastTarget.EveryOneExcludeSelf == expectTarget && src == target)
  409. {
  410. return false;
  411. }
  412. switch (src.Virtual.GetCurPKMode())
  413. {
  414. case PKMode.Peace://和平模式使用默认出生的force.
  415. if (src.Virtual.GetForceID() == target.Virtual.GetForceID())
  416. {
  417. return src.Virtual.IsAllies(target.Virtual, true, true);
  418. }
  419. return true;
  420. case PKMode.force://阵营模式使用Camp.
  421. if (src.Virtual.GetForceID() == target.Virtual.GetForceID())
  422. {
  423. return false;
  424. }
  425. return !src.Virtual.IsAllies(target.Virtual, true, true);
  426. case PKMode.Guild:
  427. if (src.Virtual.IsGuildMember(target.Virtual.GetGuildID()))
  428. {
  429. return false;
  430. }
  431. return !src.Virtual.IsAllies(target.Virtual, true, true);
  432. case PKMode.Team:
  433. return !src.Virtual.IsAllies(target.Virtual, true, true);
  434. case PKMode.All:
  435. return !(src == target);
  436. case PKMode.Justice:
  437. if (target.Virtual.GetCurPKLevel() == PKLevel.White)
  438. {
  439. return false;
  440. }
  441. return !src.Virtual.IsAllies(target.Virtual, true, true); ;
  442. case PKMode.Server:
  443. if (src.Virtual.IsServerMember(target.Virtual.GetServerID()))
  444. {
  445. return false;
  446. }
  447. return !src.Virtual.IsAllies(target.Virtual, true, true); ;
  448. }
  449. return false;
  450. }
  451. #endregion
  452. #region Region相关.
  453. protected override void InitEditRegion(RegionData rdata)
  454. {
  455. base.InitEditRegion(rdata);
  456. //单位复活点.
  457. ZoneRegion flag = getFlag(rdata.Name) as ZoneRegion;
  458. if (flag != null && rdata.Abilities != null)
  459. {
  460. List<ZoneRegion> temp = null;
  461. foreach (AbilityData td in rdata.Abilities)
  462. {
  463. if (td is XmdsRebirthAbility)
  464. {
  465. XmdsRebirthAbility zra = td as XmdsRebirthAbility;
  466. if (mRebirthRegionMap.TryGetValue(zra.START_Force, out temp))
  467. {
  468. temp.Add(flag);
  469. }
  470. else
  471. {
  472. temp = new List<ZoneRegion>();
  473. temp.Add(flag);
  474. mRebirthRegionMap.Add(zra.START_Force, temp);
  475. }
  476. }
  477. }
  478. }
  479. }
  480. /// <summary>
  481. /// 遍历所有复活点
  482. /// </summary>
  483. /// <param name="force"></param>
  484. /// <param name="action"></param>
  485. public void ForEachRebirthRegion(int force, Action<ZoneRegion> action)
  486. {
  487. List<ZoneRegion> temp = null;
  488. if (mRebirthRegionMap.TryGetValue(force, out temp))
  489. {
  490. for (int i = temp.Count - 1; i >= 0; --i)
  491. {
  492. var rg = temp[i];
  493. action(rg);
  494. }
  495. }
  496. }
  497. /// <summary>
  498. /// 获得最近的复活点
  499. /// </summary>
  500. /// <param name="x"></param>
  501. /// <param name="y"></param>
  502. /// <param name="regionForce"></param>
  503. /// <returns></returns>
  504. public ZoneRegion GetNearestRebirthRegion(float x, float y, int regionForce)
  505. {
  506. using (var list = ListObjectPool<ZoneRegion>.AllocAutoRelease())
  507. {
  508. ZoneRegion ret = null;
  509. float min_value = float.MaxValue;
  510. float len;
  511. this.ForEachRebirthRegion(regionForce, (rg) =>
  512. {
  513. if (rg.Enable)
  514. {
  515. len = MathVector.getDistanceSquare(x, y, rg.X, rg.Y);
  516. if (len < min_value)
  517. {
  518. min_value = len;
  519. ret = rg;
  520. }
  521. }
  522. });
  523. return ret;
  524. }
  525. }
  526. /// <summary>
  527. /// 获得该地图随机的复活点
  528. /// </summary>
  529. /// <param name="regionForce"></param>
  530. /// <returns></returns>
  531. public ZoneRegion GetRandomRebirthRegion(int regionForce)
  532. {
  533. using (var list = ListObjectPool<ZoneRegion>.AllocAutoRelease())
  534. {
  535. ZoneRegion ret = null;
  536. List<ZoneRegion> temp = null;
  537. mRebirthRegionMap.TryGetValue(regionForce, out temp);
  538. //不知道阵营的情况下,用这个逻辑
  539. if(temp == null)
  540. {
  541. mRebirthRegionMap.TryGetValue(-1, out temp);
  542. }
  543. if (temp != null)
  544. {
  545. int num = RandomN.Next(0, temp.Count);
  546. if (num > temp.Count)
  547. {
  548. num = temp.Count - 1;
  549. }
  550. return temp[num];
  551. }
  552. return ret;
  553. }
  554. }
  555. /// <summary>
  556. /// 获得场景下对应阵营的出生点.
  557. /// </summary>
  558. /// <param name="startForce"></param>
  559. /// <returns></returns>
  560. public List<ZoneRegion> GetRebirthRegions(byte startForce)
  561. {
  562. List<ZoneRegion> ret = null;
  563. if (mRebirthRegionMap != null)
  564. {
  565. mRebirthRegionMap.TryGetValue(startForce, out ret);
  566. }
  567. return ret;
  568. }
  569. #endregion
  570. #region Events
  571. internal void callback_OnCombatStateChange(InstanceUnit unit, BattleStatus status)
  572. {
  573. if (mOnCombatStateChange != null)
  574. {
  575. mOnCombatStateChange.Invoke(unit, status);
  576. }
  577. }
  578. public delegate void CombatStateChangeHandler(InstanceUnit unit, BattleStatus status);
  579. [EventTriggerDescAttribute("单位战斗状态改变")]
  580. public event CombatStateChangeHandler OnCombatStateChange { add { mOnCombatStateChange += value; } remove { mOnCombatStateChange -= value; } }
  581. private CombatStateChangeHandler mOnCombatStateChange;
  582. protected override void ClearEvents()
  583. {
  584. mOnCombatStateChange = null;
  585. base.ClearEvents();
  586. }
  587. #endregion
  588. }
  589. }