예제 #1
0
        public void Init(ActorObj attackObj, int skillID)
        {
            m_skillID = skillID;
            m_actor   = attackObj;
            m_attachEfxObjectlist.Clear();
            m_skillDesc = m_actor.GetCurSkillDesc(m_skillID);
            LuaTable skill_action = CoreEntry.gSkillMgr.GetSkillActon(m_skillID);

            if (skill_action != null)
            {
                Invoke("HideSkillScope", skill_action.Get <float>("skillEfxLength"));
            }
        }
예제 #2
0
        public void Init(ActorObj attackObj, ActorObj beHitObj, int skillID, bool onlyShowSkillScope = false)
        {
            //-------------------Init---------------------
            m_actor     = null;
            m_skillDesc = null;

            //技能释放结束时间
            m_overTime = 0;

            m_strActionName    = "";   //动作名
            m_speed            = 1.0f; //动作播放速度
            m_startPlayTimeSet = 0;    //动作开始播放时间

            m_actionEfx = null;

            //m_RemainEfx = null;

            m_attachEfxObjectlist.Clear();
            m_skillCellObjectlist.Clear();
            attachingBulletList.Clear();
            m_prepareKeepTime = 0;
            m_bIsAoe          = true;
            //----------------------------------------------

            m_skillID  = skillID;
            m_actor    = attackObj;
            m_hitActor = beHitObj;

            m_skillDesc   = m_actor.GetCurSkillDesc(m_skillID);
            m_skilleffect = null;
            if (null != m_skillDesc && m_skillDesc.Get <int>("e_type_1") != (int)SkillEffectType.CUSTOM)
            {
                m_skilleffect = ConfigManager.Instance.Skill.GetEffectConfig(m_skillDesc.Get <int>("effect_1"));
            }

            m_startPlayTimeSet = m_actor.m_actionStartPlayTime;

            m_onlyShowSkillScope          = onlyShowSkillScope;
            shouldUpdatePositionToCastObj = true;

            SubSkill = false;

            //防止出现普攻打击频率出错的问题
            canMove    = false;
            canBeBroke = true;
            IsOver     = false;

            //跟技能释放者同步位置
            Syncm_transform();
        }
예제 #3
0
        public behaviac.EBTStatus SetAttackTarget(ActorType aimActorType, int nSkillID)
        {
            StartAttackTimer = 0;

            if (nSkillID == 0)
            {
                return(behaviac.EBTStatus.BT_FAILURE);
            }

            if (m_AttackObj == null)
            {
                return(behaviac.EBTStatus.BT_SUCCESS);
            }

            //m_actor.SkillIDWillToDo = nSkillID;


            //增加个判断,判断是选择友方还是敌方。
            LuaTable skillDesc = m_actor.GetCurSkillDesc(nSkillID);

            if (skillDesc == null)
            {
                return(behaviac.EBTStatus.BT_FAILURE);
            }


            //判断是否要切换目标
            bool bChangeTarget = false;


            //如果为魅惑则强制切换目标
            if (m_actor.m_bCharmState)
            {
                bChangeTarget = true;
            }

            //如果目标隐身则强制切换目标
            if (m_AttackObj.IsInStealthState(m_actor))
            {
                bChangeTarget = true;
            }

            if (bChangeTarget)
            {
                m_AttackObj = m_actor.GetSelTarget();
            }

            //如果存在攻击目标
            if (m_AttackObj != null)
            {
                //目标死亡
                if (m_AttackObj.IsDeath())
                {
                    m_actor.SelectTarget(null);
                    return(behaviac.EBTStatus.BT_FAILURE);
                }
                return(behaviac.EBTStatus.BT_SUCCESS);
            }

            return(behaviac.EBTStatus.BT_SUCCESS);
        }