/// <summary> /// 大火圈攻击 /// </summary> /// <param name="nPower">伤害值</param> /// <param name="nX">坐标X</param> /// <param name="nY">坐标Y</param> /// <param name="nRage">攻击范围</param> /// <returns></returns> internal bool MagBigExplosion(int nPower, int nX, int nY, int nRage) { bool result = false; List <TBaseObject> BaseObjectList = new List <TBaseObject>(); this.m_btDirection = M2Share.GetNextDirection(this.m_nCurrX, this.m_nCurrY, this.m_TargetCret.m_nCurrX, this.m_TargetCret.m_nCurrY);// 调整火龙的方向 try { BaseObjectList = this.GetMapBaseObjects(this.m_PEnvir, nX, nY, nRage); foreach (var TargeTBaseObject in BaseObjectList) { if (TargeTBaseObject != null) { if (TargeTBaseObject.m_boDeath || (TargeTBaseObject.m_boGhost)) { continue; } if (this.IsProperTarget(TargeTBaseObject)) { this.SetTargetCreat(TargeTBaseObject); TargeTBaseObject.SendMsg(this, Grobal2.RM_MAGSTRUCK, 0, nPower, 0, 0, ""); result = true; } } } } finally { Dispose(BaseObjectList); } return(result); }
/// <summary> /// 小火圈攻击 /// </summary> /// <param name="nPower"></param> /// <param name="nX"></param> /// <param name="nY"></param> /// <param name="nRage"></param> /// <returns></returns> private bool MagBigExplosion(int nPower, int nX, int nY, int nRage) { bool result; List <TBaseObject> BaseObjectList; TBaseObject TargeTBaseObject; TFireBurnEvent FireBurnEvent; result = false; BaseObjectList = new List <TBaseObject>(); try { FireBurnEvent = new TFireBurnEvent(this, nX, nY, Grobal2.ET_FIREDRAGON, 4000, 0);// 客户端显示小火圈效果 M2Share.g_EventManager.AddEvent(FireBurnEvent); this.GetMapBaseObjects(this.m_PEnvir, nX, nY, nRage, BaseObjectList); if (BaseObjectList.Count > 0) { for (int I = 0; I < BaseObjectList.Count; I++) { TargeTBaseObject = BaseObjectList[I]; if (TargeTBaseObject != null) { if (TargeTBaseObject.m_boDeath || (TargeTBaseObject.m_boGhost)) { continue; } if (this.IsProperTarget(TargeTBaseObject)) { this.SetTargetCreat(TargeTBaseObject); TargeTBaseObject.SendMsg(this, Grobal2.RM_MAGSTRUCK, 0, nPower, 0, 0, ""); result = true; } } } } } finally { Dispose(BaseObjectList); } return(result); }
// 大火圈攻击 private bool MagBigExplosion(int nPower, int nX, int nY, int nRage) { bool result; List <TBaseObject> BaseObjectList; TBaseObject TargeTBaseObject; result = false; this.m_btDirection = M2Share.GetNextDirection(this.m_nCurrX, this.m_nCurrY, this.m_TargetCret.m_nCurrX, this.m_TargetCret.m_nCurrY);// 调整火龙的方向 BaseObjectList = new List <TBaseObject>(); try { this.GetMapBaseObjects(this.m_PEnvir, nX, nY, nRage, BaseObjectList); if (BaseObjectList.Count > 0) { for (int I = 0; I < BaseObjectList.Count; I++) { TargeTBaseObject = BaseObjectList[I]; if (TargeTBaseObject != null) { if (TargeTBaseObject.m_boDeath || (TargeTBaseObject.m_boGhost)) { continue; } if (this.IsProperTarget(TargeTBaseObject)) { this.SetTargetCreat(TargeTBaseObject); TargeTBaseObject.SendMsg(this, Grobal2.RM_MAGSTRUCK, 0, nPower, 0, 0, ""); result = true; } } } } } finally { Dispose(BaseObjectList); } return(result); }
// 喷出蜘蛛网 被蜘蛛网包围,只能走动,不能跑动 private void SpiderMagicAttack(int nPower, int nX, int nY, int nRage) { List <TBaseObject> BaseObjectList; TBaseObject TargeTBaseObject; BaseObjectList = new List <TBaseObject>(); try { BaseObjectList = GetMapBaseObjects(m_PEnvir, nX, nY, nRage); if (BaseObjectList.Count > 0) { for (int I = 0; I < BaseObjectList.Count; I++) { TargeTBaseObject = BaseObjectList[I]; if (IsProperTarget(TargeTBaseObject)) { if (TargeTBaseObject.m_btRaceServer == Grobal2.RC_HEROOBJECT) { // 英雄锁定后,不打锁定怪 if (!((THeroObject)(TargeTBaseObject)).m_boTarget) { TargeTBaseObject.SetTargetCreat(this); } } else { TargeTBaseObject.SetTargetCreat(this); } TargeTBaseObject.SendMsg(this, Grobal2.RM_MAGSTRUCK, 0, nPower, 0, 0, ""); TargeTBaseObject.MakeSpiderMag(7);// 中蛛网,不能跑动 //改变角色状态 } } } } finally { // BaseObjectList.Free; } }
public unsafe override void Run() { IList <TPlayObject> BaseObjectList; TBaseObject TargeTBaseObject; int nSePwr; int nPwr; if ((HUtil32.GetTickCount() - m_dwRunTick) > 3000) { m_dwRunTick = HUtil32.GetTickCount(); BaseObjectList = new List <TPlayObject>(); try { if (this.m_Envir != null) { this.m_Envir.GeTBaseObjects(this.m_nX, this.m_nY, true, BaseObjectList); if (BaseObjectList.Count > 0) { for (int I = 0; I < BaseObjectList.Count; I++) { TargeTBaseObject = BaseObjectList[I]; nSePwr = this.m_nDamage; if ((TargeTBaseObject != null) && (this.m_OwnBaseObject != null)) { if ((!this.m_OwnBaseObject.m_boRobotObject)) { if ((this.m_OwnBaseObject.IsProperTarget(TargeTBaseObject))) { if ((m_nType == Grobal2.ET_FIRE)) // 英雄火墙 { if ((this.m_OwnBaseObject.m_btRaceServer == Grobal2.RC_HEROOBJECT)) { this.m_OwnBaseObject.m_ExpHitter = TargeTBaseObject; } if (((this.m_OwnBaseObject.m_btRaceServer == Grobal2.RC_PLAYOBJECT) || (this.m_OwnBaseObject.m_btRaceServer == Grobal2.RC_HEROOBJECT)) && boReadSkill) { nPwr = 0; if (TargeTBaseObject.m_btRaceServer == Grobal2.RC_PLAYOBJECT) { nPwr = M2Share.MagicManager.GetNGPow(TargeTBaseObject, ((TPlayObject)(TargeTBaseObject)).m_MagicSkill_213, nTwoPwr);// 静之火墙 } else if (TargeTBaseObject.m_btRaceServer == Grobal2.RC_HEROOBJECT) { nPwr = M2Share.MagicManager.GetNGPow(TargeTBaseObject, ((THeroObject)(TargeTBaseObject)).m_MagicSkill_213, nTwoPwr);// 静之火墙 } nSePwr = nSePwr - nPwr; if (nSePwr < 0) { nSePwr = 0; } } } TargeTBaseObject.SendMsg(this.m_OwnBaseObject, Grobal2.RM_MAGSTRUCK_MINE, 0, nSePwr, 0, 0, ""); } } } } } } } finally { Dispose(BaseObjectList); } } base.Run(); }