Пример #1
0
    /// <summary>
    /// 主角正在释放武器技能
    /// </summary>
    /// <returns></returns>
    public bool IsMainPlayerUsingWeaponSkill()
    {
        SpacecraftEntity mainPlayer = m_GameplayProxy.GetEntityById <SpacecraftEntity>(m_GameplayProxy.GetMainPlayerUID());

        if (mainPlayer == null)
        {
            return(false);
        }

        int skillID = mainPlayer.GetCurrSkillId();

        if (skillID > 0 && m_CfgSkillProxy.IsWeaponSkill(skillID) &&
            (mainPlayer.GetCurrentSkillState() == SkillState.Channelling ||
             mainPlayer.GetCurrentSkillState() == SkillState.ManualChannelling ||
             mainPlayer.GetCurrentSkillState() == SkillState.AutoChannelling ||
             mainPlayer.GetCurrentSkillState() == SkillState.RapidFire))
        {
            return(true);
        }

        if (mainPlayer.IsReleasingTriggerSkill() &&
            mainPlayer.GetTriggerSkillID() > 0 &&
            m_CfgSkillProxy.IsWeaponSkill(mainPlayer.GetTriggerSkillID()))
        {
            return(true);
        }

        return(false);
    }