Exemplo n.º 1
0
    /// <summary>
    /// 释放技能主逻辑
    /// </summary>
    protected override bool ReleaseSkill(ref List <Life> RoleList, ref int nAttackIndex)
    {
        bool IsRelease = false;

        if (RoleList.Count > 0)
        {
            IsRelease = true;
            {
                Life    w       = RoleList[0];
                Vector3 posSrc  = m_goPao.transform.position;
                Vector3 posRole = new Vector3(w.GetPos().x, w.GetPos().y, w.GetPos().z);
                float   fgreed  = NdUtil.V2toAngle(posSrc, posRole, Vector3.right);
                if (fgreed < 0f || fgreed > 270)
                {
                    fgreed = 0f;
                }
                else if (fgreed > 180f)
                {
                    fgreed = 180f;
                }
                m_vDirGreed = new Vector3(0, -fgreed, 0);
                bool          InterruptSkill = false;
                GridActionCmd action         = null;
                if (w is Role)
                {
                    action = (w as Role).CurrentAction;
                }
                SkillReleaseInfo Info = m_Skill.SkillRelease(this, w, action, m_Skill.PropSkillInfo);
                w.ApplyDamage(Info, m_thisT);
            }
        }
        return(IsRelease);
    }
Exemplo n.º 2
0
    /// <summary>
    /// 释放技能主逻辑
    /// </summary>
    protected override bool ReleaseSkill(ref List <Life> RoleList, ref int nAttackIndex)
    {
        bool IsRelease = false;

        if (RoleList.Count > 0)
        {
            IsRelease = true;
            SetAnimator(Build_AnimatorState.Trigger30000);
            //foreach(Life w in RoleList)
            {
                Life    w       = RoleList[0];
                Vector3 posSrc  = Pao.transform.position;
                Vector3 posRole = new Vector3(w.GetPos().x, w.GetPos().y, w.GetPos().z);
                float   fgreed  = NdUtil.V2toAngle(posSrc, posRole, Vector3.right);
                m_vDirGreed = new Vector3(fgreed, 90f, 0);
                bool          InterruptSkill = false;
                GridActionCmd action         = null;
                if (w is Role)
                {
                    action = (w as Role).CurrentAction;
                }
                SkillReleaseInfo Info = m_Skill.SkillRelease(this, w, action, m_Skill.PropSkillInfo);
                w.ApplyDamage(Info, m_thisT);
            }
            m_bAttack     = true;
            m_fAttackTime = Time.time;
            ActiveEffect1915011(true);
        }
        return(IsRelease);
    }
Exemplo n.º 3
0
    /// <summary>
    /// 释放技能主逻辑
    /// </summary>
    protected override bool ReleaseSkill(ref List <Life> RoleList, ref int nAttackIndex)
    {
        bool IsRelease = false;

        m_AttackRoleList.Clear();
        m_SkillReleaseInfoList.Clear();
        if (RoleList.Count > 0)
        {
            if (nAttackIndex == 0)
            {
                IsRelease      = true;
                m_fAttackTimer = Time.time;
                Vector3 posSrc  = m_goEffectLeft1905021_03.transform.position;
                Vector3 posRole = new Vector3(RoleList[0].GetPos().x, RoleList[0].GetPos().y + 1.5f, RoleList[0].GetPos().z);
                float   fRate   = Vector2.Distance(posSrc, posRole) / 3.8f;
                m_goEffectLeft1905021_03.transform.localScale = new Vector3(fRate, 1.0f, 1.0f);
                float fAngle = NdUtil.V2toAngle(posSrc, posRole, Vector2.right);
                m_goEffectLeft1905021_03.transform.rotation = Quaternion.Euler(new Vector3(0, 180f, fAngle));

                posSrc = m_goEffectRight1905021_03.transform.position;
                fRate  = Vector2.Distance(posSrc, posRole) / 3.8f;
                m_goEffectRight1905021_03.transform.localScale = new Vector3(fRate, 1.0f, 1.0f);
                fAngle = NdUtil.V2toAngle(posSrc, posRole, Vector2.right);
                m_goEffectRight1905021_03.transform.rotation = Quaternion.Euler(new Vector3(0, 180f, fAngle));


                foreach (Life w in RoleList)
                {
                    IsRelease = true;
                    GridActionCmd action = null;
                    if (w is Role)
                    {
                        action = (w as Role).CurrentAction;
                    }
                    SkillReleaseInfo Info = m_Skill.SkillRelease(this, w, action, m_Skill.PropSkillInfo);
                    m_SkillReleaseInfoList.Add(Info);
                    m_AttackRoleList.Add(w);
                }
                m_bAttack = true;
            }
            int nRoleCount = m_AttackRoleList.Count;
            for (int nCnt = 0; nCnt < nRoleCount; nCnt++)
            {
                Life w = m_AttackRoleList[nCnt];

                if (!w.InBoat || w.isDead)
                {
                    continue;
                }
                SkillReleaseInfo info  = m_SkillReleaseInfoList[nCnt];
                BuildSkill       rs    = m_Skill as BuildSkill;
                float            power = rs.PropSkillInfo.GetAttackPower(nAttackIndex + 1);
                info.m_Damage    = (int)(info.m_Damage * power);
                info.mOwnerLevel = m_Attr.Level;
                w.ApplyDamage(info, m_thisT);
            }
            if (nRoleCount > 0)
            {
                SoundPlay.Play("Trap/trap_electricshock", false, false);
            }
        }
        return(IsRelease);
    }