示例#1
0
    static public int GetPhyAttack(int id, int level, int yellowPoint = 1)
    {
        HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(id);

        if (null == info)
        {
            return(0);
        }

        RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(info.Rarity);

        if (rarityInfo == null)
        {
            return(0);
        }

        QualityInfo qualityInfo = GameTable.qualityRelativeAsset.LookUp(info.Quality);

        if (qualityInfo == null)
        {
            return(0);
        }

        CardTypeInfo cardTypeInfo = GameTable.cardTypeVariationAsset.LookUp((int)info.AttrTypeID);

        if (cardTypeInfo == null)
        {
            return(0);
        }

        LevelUpInfo levelUpInfo = GameTable.LevelUpTableAsset.LookUp(level);

        if (levelUpInfo == null)
        {
            return(0);
        }
        CardLevelInfo cardLevelInfo = GameTable.cardLevelVariationAsset.LookUp((int)info.levelTypeID);

        if (cardLevelInfo == null)
        {
            return(0);
        }

        YellowPointInfo yellowPointInfo = GameTable.yellowPointParamAsset.LookUp(yellowPoint);

        if (yellowPointInfo == null)
        {
            return(0);
        }

        //Debug.Log("(" + info.FPhyAttack + "+" + cardTypeInfo.m_phyAtt + ") * (1 +" + cardLevelInfo.m_phyAttParam + "*" + level + "+" + yellowPointInfo.m_phyAttParam + ")*(" + rarityInfo.m_mainAttrMutiply +"+"+ qualityInfo.m_mainAttrMutiply+")");
        // 计算物理攻击力
        float attack = (info.FPhyAttack + cardTypeInfo.m_phyAtt) * (1 + cardLevelInfo.m_phyAttParam * level + yellowPointInfo.m_phyAttParam) * (rarityInfo.m_mainAttrMutiply + qualityInfo.m_mainAttrMutiply);

        return((int)attack);
    }
示例#2
0
    // 获得当前物理防御力
    static public int GetPhyDefend(int id, int level, int yellowPoint = 1)
    {
        HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(id);

        if (null == info)
        {
            return(0);
        }

        RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(info.Rarity);

        if (rarityInfo == null)
        {
            return(0);
        }

        QualityInfo qualityInfo = GameTable.qualityRelativeAsset.LookUp(info.Quality);

        if (qualityInfo == null)
        {
            return(0);
        }

        CardTypeInfo cardTypeInfo = GameTable.cardTypeVariationAsset.LookUp((int)info.AttrTypeID);

        if (cardTypeInfo == null)
        {
            return(0);
        }

        LevelUpInfo levelUpInfo = GameTable.LevelUpTableAsset.LookUp(level);

        if (levelUpInfo == null)
        {
            return(0);
        }

        CardLevelInfo cardLevelInfo = GameTable.cardLevelVariationAsset.LookUp((int)info.levelTypeID);

        if (cardLevelInfo == null)
        {
            return(0);
        }

        YellowPointInfo yellowPointInfo = GameTable.yellowPointParamAsset.LookUp(yellowPoint);

        if (yellowPointInfo == null)
        {
            return(0);
        }

        // 获得当前魔法 防御力
        float attack = (info.FPhyDefend + cardTypeInfo.m_phyDef) * (1 + cardLevelInfo.m_phyDefParam * level + yellowPointInfo.m_phyDefParam) * (rarityInfo.m_mainAttrMutiply + qualityInfo.m_mainAttrMutiply);

        return((int)attack);
    }
    public YellowPointInfo LookUp(int id)
    {
        YellowPointInfo info = null;

        if (m_map.TryGetValue(id, out info))
        {
            return(info);
        }
        return(null);
    }
示例#4
0
    static public int GetHp(int id, int level, int yellowPoint = 1)
    {
        HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(id);

        if (null == info)
        {
            return(0);
        }

        RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(info.Rarity);

        if (rarityInfo == null)
        {
            return(0);
        }

        QualityInfo qualityInfo = GameTable.qualityRelativeAsset.LookUp(info.Quality);

        if (qualityInfo == null)
        {
            return(0);
        }

        CardTypeInfo cardTypeInfo = GameTable.cardTypeVariationAsset.LookUp((int)info.AttrTypeID);

        if (cardTypeInfo == null)
        {
            return(0);
        }

        CardLevelInfo cardLevelInfo = GameTable.cardLevelVariationAsset.LookUp((int)info.levelTypeID);

        if (cardLevelInfo == null)
        {
            return(0);
        }

        YellowPointInfo yellowPointInfo = GameTable.yellowPointParamAsset.LookUp(yellowPoint);

        if (yellowPointInfo == null)
        {
            return(0);
        }

        float maxLevelAttrParam = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enMaxLevelAttrParam).FloatTypeValue;

        float hp = (info.FHPMax + cardTypeInfo.m_hp) * (1 + cardLevelInfo.m_hpParam * level + yellowPointInfo.m_hpParam) * (rarityInfo.m_mainAttrMutiply + qualityInfo.m_mainAttrMutiply);

        return((int)hp);
    }
    public void Load(byte[] bytes)
    {
        m_map = new Dictionary <int, YellowPointInfo>();
        BinaryHelper helper = new BinaryHelper(bytes);

        int sceneCount = helper.ReadInt();

        for (int index = 0; index < sceneCount; ++index)
        {
            YellowPointInfo info = new YellowPointInfo();
            info.Load(helper);
            m_map.Add(info.m_id, info);
        }
    }
示例#6
0
    public void UpdateAddSkillLevel()
    {
        int levelUpPoint = m_mainPlayer.Props.GetProperty_Int32(ENProperty.LevelUpPoint);
        //判断黄点是否达到满级
        MainPlayer      mainPlayer     = ActorManager.Singleton.MainActor;
        int             yellowPoint    = mainPlayer.Props.GetProperty_Int32(ENProperty.YellowPointLevel);
        YellowPointInfo nextYellowInfo = GameTable.yellowPointParamAsset.LookUp((yellowPoint + 1));

        //如果为空则达到最大黄点等级
        if (null == nextYellowInfo)
        {
            if (null != m_yellowPointLabel)
            {
                m_yellowPointLabel.text = "LV.MAX";
            }
        }
        else
        {
            if (null != m_yellowPointLabel)
            {
                m_yellowPointLabel.text = "LV." + yellowPoint;
            }
        }
        if (levelUpPoint > 0 && null != nextYellowInfo)
        {
            m_addActorLevel.gameObject.SetActive(true);
        }
        else
        {
            m_addActorLevel.gameObject.SetActive(false);
        }


        int skillLeveLIndex = 1;

        for (int i = 0; i < MaxSkillNumber; ++i)
        {
            GameObject skill = m_sameInfoList[i].m_objSkill;
            if (!skill.activeSelf)
            {
                continue;
            }
            UISkillCD            uiSkillCD = m_sameInfoList[i].m_uiSkillCD;
            Actor.ActorSkillInfo info      = m_mainPlayer.SkillBag.Find(item => item.SkillTableInfo.ID == uiSkillCD.SkillID);
            if (info == null)
            {
                Debug.LogWarning("skill table is null, index:" + i);
                continue;
            }

            UILabel skillLabel = FindChildComponent <UILabel>("SkillLevel", skill);
            if (null != skillLabel)
            {
                if (info.SkillLevel >= info.SkillTableInfo.MaxLevel)
                {
                    skillLabel.text = "LV.MAX";
                }
                else
                {
                    skillLabel.text = "LV." + info.SkillLevel;
                }
            }
            //技能升级按钮
            UIButton addLevel = FindChildComponent <UIButton>("AddLevel" + skillLeveLIndex, skill);
            if (null != addLevel)
            {
                if (levelUpPoint > 0 && info.SkillLevel < info.SkillTableInfo.MaxLevel)
                {
                    addLevel.gameObject.SetActive(true);
                }
                else
                {
                    addLevel.gameObject.SetActive(false);
                }
            }
            ++skillLeveLIndex;
        }
    }