Exemplo n.º 1
0
        public override List <ActorObj> CalculationHit(SkillData skilldata, GTargetInfo targetInfo)
        {
            float minDis = skilldata.MSV_AreaParam1 / 10.0f;
            float maxDis = skilldata.MSV_AreaParam2 / 10.0f;
            float w      = skilldata.MSV_AreaParam3 / 10.0f;

            Vector3 pos    = skilldata.IsAreaUseTarPos() ? targetInfo.m_vTarPos : targetInfo.m_vSrcPos;
            Vector3 dir    = targetInfo.m_vAimDir;
            Vector3 center = pos + dir * ((minDis + maxDis) / 2);

            SRect sRect = new SRect(center, maxDis - minDis, w);

            List <ActorObj> pActorList = ActorMgr.GetAllActor();

            if (pActorList.Count <= 0)
            {
                return(null);
            }
            List <ActorObj> list = new List <ActorObj>();

            foreach (ActorObj actor in pActorList)
            {
                if (actor == m_pLocalPlayer)
                {
                    continue;
                }
                ActorObj obj = (ActorObj)actor;
                if (obj.CollisionCom == null)
                {
                    continue;
                }
                for (int i = 0; i < obj.CollisionCom.GetShapeCount(); i++)
                {
                    SShapeData shp = obj.CollisionCom.GetShape(i);
                    if (shp != null)
                    {
                        SSphere sTarSphere = new SSphere(shp.Pos, shp.r);
                        if (GCollider.RectCollideCheck(sRect, sTarSphere, dir))
                        {
                            list.Add(actor);
                            break;
                        }
                    }
                }
            }
            return(list);
        }
Exemplo n.º 2
0
        public override List <ActorObj> CalculationHit(SkillData skilldata, GTargetInfo targetInfo)
        {
            float r   = skilldata.MSV_AreaParam1 / 10.0f;
            float dis = skilldata.MSV_AreaParam2 / 10.0f;

            Vector3 pos = skilldata.IsAreaUseTarPos() ? targetInfo.m_vTarPos : targetInfo.m_vSrcPos;
            Vector3 dir = targetInfo.m_vAimDir;

            Vector3 spPos   = pos + dir * dis;
            SSphere sSphere = new SSphere(spPos, r);

            List <ActorObj> pActorList = ActorMgr.GetAllActor();

            if (pActorList.Count <= 0)
            {
                return(null);
            }
            List <ActorObj> list = new List <ActorObj>();

            foreach (ActorObj actor in pActorList)
            {
                if (actor == m_pLocalPlayer)
                {
                    continue;
                }
                if (actor.CollisionCom == null)
                {
                    continue;
                }
                for (int i = 0; i < actor.CollisionCom.GetShapeCount(); i++)
                {
                    SShapeData shp = actor.CollisionCom.GetShape(i);
                    if (shp != null)
                    {
                        SSphere sTarSphere = new SSphere(shp.Pos, shp.r);
                        if (GCollider.SphereCollideCheck(sSphere, sTarSphere, dir))
                        {
                            list.Add(actor);
                            break;
                        }
                    }
                }
            }
            return(list);
        }
Exemplo n.º 3
0
        public override List <ActorObj> CalculationHit(SkillData skilldata, GTargetInfo targetInfo)
        {
            ActorObj act = ActorMgr.GetByServerID(targetInfo.m_nTargetID) as ActorObj;

            if (act == null)
            {
                return(null);
            }
            float dis = Vector3.Distance(targetInfo.m_vSrcPos, act.GetPos());

            if (dis > skilldata.MSV_Range)
            {
                return(null);
            }
            if (!GCollider.SingletonCollideCheck())
            {
                return(null);
            }
            List <ActorObj> list = new List <ActorObj>();

            list.Add(act);
            return(list);
        }
Exemplo n.º 4
0
 public virtual List <ActorObj> CalculationHit(SkillData skilldata, GTargetInfo targetInfo)
 {
     return(null);
 }
Exemplo n.º 5
0
 public virtual List <ActorObj> GetTargetList(SkillData pSkillData, ActorObj pCaster, GTargetInfo sTarInfo, List <int> vExcludeList)
 {
     return(null);
 }