|
@@ -200,29 +200,22 @@ namespace XmdsCommonServer.Plugin.Scene
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- #region 安全区域检测. 宠物不会是目标
|
|
|
- if (expectTarget == SkillTemplate.CastTarget.Enemy)
|
|
|
- {
|
|
|
- XmdsVirtual dpPlayer = dp as XmdsVirtual_Player;
|
|
|
- if (dpPlayer != null)
|
|
|
- {
|
|
|
- XmdsVirtual spPlayer = sp as XmdsVirtual_Player;
|
|
|
- if (spPlayer == null && sp is XmdsVirtual_Pet)
|
|
|
- {
|
|
|
- spPlayer = (sp as XmdsVirtual_Pet).GetMaster();
|
|
|
- }
|
|
|
- if (spPlayer != null && (spPlayer.IsInSafeArea || dpPlayer.IsInSafeArea))
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- #endregion
|
|
|
|
|
|
- #region 中立单位检测.
|
|
|
+ #region 安全区域检测. 宠物不会是目标
|
|
|
+ if (expectTarget == SkillTemplate.CastTarget.Enemy && target.IsPlayerUnit && src.IsPlayerUnit)
|
|
|
+ {
|
|
|
+ if (target.Virtual.IsInSafeArea() || src.Virtual.IsInSafeArea())
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 中立单位检测.
|
|
|
|
|
|
- if (target.Force == 0) //0代表绝对中立.不能被攻击.
|
|
|
+ if (target.Force == 0) //0代表绝对中立.不能被攻击.
|
|
|
{
|
|
|
return false;
|
|
|
}
|