private void FindEyeTarget(List <PoolObjHandle <ActorRoot> > _srcList, int _count)
 {
     _srcList.Sort(delegate(PoolObjHandle <ActorRoot> a, PoolObjHandle <ActorRoot> b)
     {
         EyeWrapper eyeWrapper  = (EyeWrapper)a.get_handle().ActorControl;
         EyeWrapper eyeWrapper2 = (EyeWrapper)b.get_handle().ActorControl;
         int lifeTime           = eyeWrapper.LifeTime;
         int lifeTime2          = eyeWrapper2.LifeTime;
         int targetHpRate       = HitTriggerDurationContext.GetTargetHpRate(a);
         int targetHpRate2      = HitTriggerDurationContext.GetTargetHpRate(b);
         if (targetHpRate < targetHpRate2)
         {
             return(-1);
         }
         if (targetHpRate > targetHpRate2)
         {
             return(1);
         }
         if (lifeTime > lifeTime2)
         {
             return(-1);
         }
         if (lifeTime < lifeTime2)
         {
             return(1);
         }
         return(0);
     });
     for (int i = 0; i < _count; i++)
     {
         this.triggerPriority.Add(_srcList.get_Item(i));
     }
 }
Example #2
0
        private void CreateEye()
        {
            if ((this.actorRoot != 0) && this.bEyeObj)
            {
                this.actorRoot.handle.ObjLinker.CanMovable = false;
                Singleton <GameObjMgr> .instance.AddActor(this.actorRoot);

                EyeWrapper actorControl = this.actorRoot.handle.ActorControl as EyeWrapper;
                if (actorControl != null)
                {
                    actorControl.LifeTime = this.EyeLifeTime;
                }
                if (this.actorRoot.handle.HorizonMarker != null)
                {
                    this.actorRoot.handle.HorizonMarker.SightRadius = this.sightRadius;
                }
                if (this.actorRoot.handle.SMNode != null)
                {
                    VCollisionSphere sphere = new VCollisionSphere();
                    sphere.Born((ActorRoot)this.actorRoot);
                    sphere.Pos    = VInt3.zero;
                    sphere.Radius = 500;
                    sphere.dirty  = true;
                    sphere.ConditionalUpdateShape();
                    this.actorRoot.handle.SMNode.Attach();
                }
            }
        }
        private void CreateEye()
        {
            if (this.actorRoot && this.bEyeObj)
            {
                this.actorRoot.get_handle().ObjLinker.CanMovable = false;
                Singleton <GameObjMgr> .get_instance().AddActor(this.actorRoot);

                EyeWrapper eyeWrapper = this.actorRoot.get_handle().ActorControl as EyeWrapper;
                if (eyeWrapper != null)
                {
                    eyeWrapper.LifeTime = this.EyeLifeTime;
                }
                if (this.actorRoot.get_handle().HorizonMarker != null)
                {
                    this.actorRoot.get_handle().HorizonMarker.SightRadius = this.sightRadius;
                }
                if (this.actorRoot.get_handle().SMNode != null)
                {
                    VCollisionSphere vCollisionSphere = new VCollisionSphere();
                    vCollisionSphere.Born(this.actorRoot);
                    vCollisionSphere.Pos    = VInt3.zero;
                    vCollisionSphere.Radius = 500;
                    vCollisionSphere.dirty  = true;
                    vCollisionSphere.ConditionalUpdateShape();
                    this.actorRoot.get_handle().SMNode.Attach();
                }
            }
        }
        private void CreateEye(SkillUseContext skillContext)
        {
            if (this.actorRoot && this.bEyeObj)
            {
                this.actorRoot.handle.ObjLinker.CanMovable = false;
                Singleton <GameObjMgr> .instance.AddActor(this.actorRoot);

                EyeWrapper eyeWrapper = this.actorRoot.handle.ActorControl as EyeWrapper;
                if (eyeWrapper != null)
                {
                    int num = 0;
                    if (skillContext.Originator)
                    {
                        SkillSlot skillSlot = skillContext.Originator.handle.SkillControl.GetSkillSlot(skillContext.SlotType);
                        if (skillSlot != null)
                        {
                            int skillLevel = skillSlot.GetSkillLevel();
                            num = Mathf.Max(skillLevel - 1, 0);
                        }
                    }
                    int num2 = this.EyeLifeTime;
                    num2 += this.EyeLiftTimeGrowth * num;
                    if (num2 < 0)
                    {
                        num2 = 0;
                    }
                    eyeWrapper.LifeTime = num2;
                    eyeWrapper.SetPerishTime(this.EyePerishAdvTime);
                    if (this.actorRoot.handle.HorizonMarker != null)
                    {
                        int num3 = this.sightRadius;
                        num3 += this.SightRadiusGrowth * num;
                        if (num3 < 0)
                        {
                            num3 = 0;
                        }
                        this.actorRoot.handle.HorizonMarker.SightRadius = num3;
                    }
                    if (this.actorRoot.handle.SMNode != null)
                    {
                        VCollisionSphere vCollisionSphere = new VCollisionSphere();
                        vCollisionSphere.Born(this.actorRoot);
                        vCollisionSphere.Pos    = VInt3.zero;
                        vCollisionSphere.Radius = 500;
                        vCollisionSphere.dirty  = true;
                        vCollisionSphere.ConditionalUpdateShape();
                        this.actorRoot.handle.SMNode.Attach();
                    }
                }
            }
        }