Esempio n. 1
0
    private bool CanCreateSkill(int skillID)
    {
        SkillBase.SLog("CanCreateSkill");

        SkillSystemGrow skillGrow = m_CfgSkillProxy.GetSkillGrow(skillID);

        if (skillGrow.ByteBuffer == null)
        {
            SkillBase.SLog("没有这个技能");
            Debug.LogError("没有这个技能: " + skillID);
            return(false);
        }

        if (m_Property.IsMain() && m_Property.GetCurrentState().GetMainState() == EnumMainState.Cruise)
        {
            SkillBase.SLog("巡航模式不能放技能");
            Debug.Log("巡航模式不能放技能");
            return(false);
        }

        if (m_SkillProxy.IsOnCD(skillID) || m_SkillProxy.IsOnTriggerCD(skillID))
        {
            SkillBase.SLog("IsOnCD");
            return(false);
        }

        return(true);
    }
Esempio n. 2
0
    // FIXME 技能. 预计SkillVO这里做一个池子. 消除GC
    //static PlayerSkillVO s_SkillVOTemplate;
    static public PlayerSkillVO CreateSkillVO(int skillID)
    {
        CfgSkillSystemProxy cfgSkillProxy = GameFacade.Instance.RetrieveProxy(ProxyName.CfgSkillSystemProxy) as CfgSkillSystemProxy;

        SkillSystemGrow skillGrow = cfgSkillProxy.GetSkillGrow(skillID);

        if (skillGrow.ByteBuffer == null)
        {
            Debug.LogErrorFormat("找不到SkillGrow. SkillID: {0}", skillID);
            return(null);
        }

        SkillSystemPath skillPath = cfgSkillProxy.GetSkillPath(skillGrow.PathID);

        if (skillPath.ByteBuffer == null)
        {
            Debug.LogErrorFormat("找不到SkillPath. PathID: {0}", skillGrow.PathID);
            return(null);
        }

        List <SkillSystemFx> skillFxList = cfgSkillProxy.GetSkillFxList(skillGrow.PathID);

        for (int iEffect = 0; iEffect < skillFxList.Count; iEffect++)
        {
            if (skillFxList[iEffect].ByteBuffer == null)
            {
                Debug.LogErrorFormat("找不到skillFxList. PathID: {0}", skillGrow.PathID);
                return(null);
            }
        }

        List <SkillSystemEffect> skillEffectList = cfgSkillProxy.GetSkillEffectList(skillID);

        for (int iEffect = 0; iEffect < skillFxList.Count; iEffect++)
        {
            if (skillEffectList[iEffect].ByteBuffer == null)
            {
                Debug.LogErrorFormat("找不到skillEffectList. skillID: {0}", skillID);
                return(null);
            }
        }

        return(new PlayerSkillVO(skillID));
    }
Esempio n. 3
0
    /// <summary>
    /// 技能释放完成后开始CD
    /// </summary>
    /// <param name="skillID"></param>
    public void StartCD(int skillID)
    {
        Debug.Assert(m_SkillIDToSkill.ContainsKey(skillID));
        if (!m_SkillIDToSkill.ContainsKey(skillID))
        {
            return;
        }

        // 开始公共CD
        SkillSystemGrow skillGrowVO = m_CfgSkillProxy.GetSkillGrow(skillID);

        if (m_SkillTypeToGlobalCDEndTime[GetSkillType(skillID)] < Time.time + skillGrowVO.GlobalCd / 1000.0f)
        {
            m_SkillTypeToGlobalCDEndTime[GetSkillType(skillID)] = Time.time + skillGrowVO.GlobalCd / 1000.0f;
        }

        // 开始技能本身的CD
        m_SkillIDToSkill[skillID].StartCD();
    }
Esempio n. 4
0
    private PlayerSkillVO(int id)
    {
        m_CfgSkillProxy = GameFacade.Instance.RetrieveProxy(ProxyName.CfgSkillSystemProxy) as CfgSkillSystemProxy;

        m_TemplateID = id;
        skillGrow    = m_CfgSkillProxy.GetSkillGrow(m_TemplateID);
        if (skillGrow.ByteBuffer != null)
        {
            m_SkillPath        = m_CfgSkillProxy.GetSkillPath(skillGrow.PathID);
            m_SkillFxList      = m_CfgSkillProxy.GetSkillFxList(skillGrow.PathID);
            m_SkillEffectList  = m_CfgSkillProxy.GetSkillEffectList(m_TemplateID);
            m_CDEndTime        = Time.time;
            m_TriggerCDEndTime = Time.time;

            m_IsValid = true;
        }
        else
        {
            m_IsValid = false;
            Debug.LogErrorFormat("技能不存在, 请查Skill_system_grow表. ID: {0}", id);
        }
    }