Ejemplo n.º 1
0
 static public int get_Targets(IntPtr l)
 {
     try {
         GameFramework.Skill.Trigers.TargetManager self = (GameFramework.Skill.Trigers.TargetManager)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.Targets);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 2
0
 static public int constructor(IntPtr l)
 {
     try {
         GameFramework.Skill.Trigers.TargetManager o;
         o = new GameFramework.Skill.Trigers.TargetManager();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 3
0
 static public int Add(IntPtr l)
 {
     try {
         GameFramework.Skill.Trigers.TargetManager self = (GameFramework.Skill.Trigers.TargetManager)checkSelf(l);
         System.Int32 a1;
         checkType(l, 2, out a1);
         self.Add(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
        public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime)
        {
            GfxSkillSenderInfo senderObj = sender as GfxSkillSenderInfo;
            if (null == senderObj) return false;
            Scene scene = senderObj.Scene;
            EntityInfo obj = senderObj.GfxObj;
            if (null == obj) {
                return false;
            }
            if (curSectionTime < StartTime) {
                return true;
            }
            if (m_IsExecuted && curSectionTime > (StartTime + m_RemainTime)) {
                return false;
            }

            Vector3 pos = obj.GetMovementStateInfo().GetPosition3D();
            EntityInfo target = senderObj.TargetGfxObj;
            if (!m_IsExecuted && (null == target || !string.IsNullOrEmpty(m_SelectTargetType))) {
                if (string.IsNullOrEmpty(m_SelectTargetType)) {
                    int targetType = scene.EntityController.GetTargetType(senderObj.ActorId, senderObj.ConfigData, senderObj.Seq);
                    if (targetType == (int)SkillTargetType.Friend || targetType == (int)SkillTargetType.RandFriend)
                        m_RealSelectTargetType = "randfriend";
                    else
                        m_RealSelectTargetType = "randenemy";
                }
                TargetManager mgr = instance.CustomDatas.GetData<TargetManager>();
                if (null == mgr) {
                    mgr = new TargetManager();
                    instance.CustomDatas.AddData(mgr);
                }
                int targetId = scene.EntityController.SelectTargetForSkill(m_RealSelectTargetType, senderObj.ActorId, senderObj.ConfigData, senderObj.Seq, mgr.Targets);
                if (targetId > 0) {
                    mgr.Add(targetId);
                    target = scene.EntityController.GetGameObject(targetId);
                    senderObj.TargetActorId = targetId;
                    senderObj.TargetGfxObj = target;
                }
            }
            if (null != target) {
                m_IsExecuted = true;
                if (!m_IsHaveRotateSpeed || m_RotateSpeed.Y == 0) {
                    TriggerUtil.Lookat(scene, obj, target.GetMovementStateInfo().GetPosition3D());
                } else {
                    float maxRotateDelta = m_RotateSpeed.Y * TriggerUtil.ConvertToSecond(delta);
                    TriggerUtil.Lookat(scene, obj, target.GetMovementStateInfo().GetPosition3D(), maxRotateDelta);
                }
            }
            return true;
        }
 public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime)
 {
     GfxSkillSenderInfo senderObj = sender as GfxSkillSenderInfo;
     if (null == senderObj) return false;
     Scene scene = senderObj.Scene;
     EntityInfo obj = senderObj.GfxObj;
     if (obj == null) {
         return false;
     }
     if (curSectionTime < StartTime) {
         return true;
     }
     Vector3 pos = obj.GetMovementStateInfo().GetPosition3D();
     TargetManager mgr = instance.CustomDatas.GetData<TargetManager>();
     if (null == mgr) {
         mgr = new TargetManager();
         instance.CustomDatas.AddData(mgr);
     }
     int targetId = scene.EntityController.SelectTargetForSkill(m_Type, senderObj.ActorId, senderObj.ConfigData, senderObj.Seq, mgr.Targets);
     if (targetId > 0) {
         mgr.Add(targetId);
         EntityInfo target = scene.EntityController.GetGameObject(targetId);
         senderObj.TargetActorId = targetId;
         senderObj.TargetGfxObj = target;
     }
     return false;
 }
 public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime)
 {
     GfxSkillSenderInfo senderObj = sender as GfxSkillSenderInfo;
     if (null == senderObj) return false;
     m_Myself = senderObj.GfxObj;
     if (null == m_Myself) {
         return false;
     }
     if (curSectionTime < StartTime) {
         return true;
     }
     if (m_IsExecuted && curSectionTime > (StartTime + m_RemainTime)) {
         return false;
     }
     Vector3 pos = m_Myself.transform.position;
     m_Target = senderObj.TargetGfxObj;
     if (!m_IsExecuted && (null == m_Target && !string.IsNullOrEmpty(m_SelectTargetType))) {
         TargetManager mgr = instance.CustomDatas.GetData<TargetManager>();
         if (null == mgr) {
             mgr = new TargetManager();
             instance.CustomDatas.AddData(mgr);
         }
         int targetId = EntityController.Instance.SelectTargetForSkill(m_SelectTargetType, senderObj.ActorId, senderObj.ConfigData, senderObj.Seq, mgr.Targets);
         if (targetId > 0) {
             mgr.Add(targetId);
             m_Target = EntityController.Instance.GetGameObject(targetId);
             senderObj.TargetActorId = targetId;
             senderObj.TargetGfxObj = m_Target;
         }
     }
     if (null != m_Target) {
         m_IsExecuted = true;
         if (!m_IsHaveRotateSpeed || m_RotateSpeed.y == 0) {
             TriggerUtil.Lookat(m_Myself, m_Target.transform.position);
         } else {
             float maxRotateDelta = m_RotateSpeed.y * TriggerUtil.ConvertToSecond(delta);
             TriggerUtil.Lookat(m_Myself, m_Target.transform.position, maxRotateDelta);
         }
     }
     return true;
 }
Ejemplo n.º 7
0
        public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime)
        {
            GfxSkillSenderInfo senderObj = sender as GfxSkillSenderInfo;

            if (null == senderObj)
            {
                return(false);
            }
            Scene      scene = senderObj.Scene;
            EntityInfo obj   = senderObj.GfxObj;

            if (null == obj)
            {
                return(false);
            }
            if (curSectionTime < StartTime)
            {
                return(true);
            }
            if (m_IsExecuted && curSectionTime > (StartTime + m_RemainTime))
            {
                return(false);
            }

            Vector3    pos    = obj.GetMovementStateInfo().GetPosition3D();
            EntityInfo target = senderObj.TargetGfxObj;

            if (!m_IsExecuted && (null == target || !string.IsNullOrEmpty(m_SelectTargetType)))
            {
                if (string.IsNullOrEmpty(m_SelectTargetType))
                {
                    int targetType = scene.EntityController.GetTargetType(senderObj.ActorId, senderObj.ConfigData, senderObj.Seq);
                    if (targetType == (int)SkillTargetType.Friend || targetType == (int)SkillTargetType.RandFriend)
                    {
                        m_RealSelectTargetType = "randfriend";
                    }
                    else
                    {
                        m_RealSelectTargetType = "randenemy";
                    }
                }
                TargetManager mgr = instance.CustomDatas.GetData <TargetManager>();
                if (null == mgr)
                {
                    mgr = new TargetManager();
                    instance.CustomDatas.AddData(mgr);
                }
                int targetId = scene.EntityController.SelectTargetForSkill(m_RealSelectTargetType, senderObj.ActorId, senderObj.ConfigData, senderObj.Seq, mgr.Targets);
                if (targetId > 0)
                {
                    mgr.Add(targetId);
                    target = scene.EntityController.GetGameObject(targetId);
                    senderObj.TargetActorId = targetId;
                    senderObj.TargetGfxObj  = target;
                }
            }
            if (null != target)
            {
                m_IsExecuted = true;
                if (!m_IsHaveRotateSpeed || m_RotateSpeed.Y == 0)
                {
                    TriggerUtil.Lookat(scene, obj, target.GetMovementStateInfo().GetPosition3D());
                }
                else
                {
                    float maxRotateDelta = m_RotateSpeed.Y * TriggerUtil.ConvertToSecond(delta);
                    TriggerUtil.Lookat(scene, obj, target.GetMovementStateInfo().GetPosition3D(), maxRotateDelta);
                }
            }
            return(true);
        }