Ejemplo n.º 1
0
 public static float GetSkillUpExpressValue(string formula, int heroLevel, int skillLevel, float force, float magic, float soul, float X)
 {
     formula = formula.Replace("Magic", magic.ToString());
     formula = formula.Replace("SkillLv", skillLevel.ToString());
     formula = formula.Replace("Soul", soul.ToString());
     formula = formula.Replace("HeroLv", heroLevel.ToString());
     formula = formula.Replace("Force", force.ToString());
     formula = formula.Replace("X", X.ToString());
     return(FormulaManager.Arithmetic(formula));
 }
Ejemplo n.º 2
0
        //小怪普攻公式
        public static float MonsterNormalHurt(CharData charData, CharData aimCharData)
        {
            string f = _dicMath["MonsterNormalHurt"];

            f = f.Replace("Atk", charData.CurAttack.ToString());
            f = f.Replace("Aim_Def", aimCharData.CurDefence.ToString());
            float ret = FormulaManager.Arithmetic(f);

            ret *= charData.m_fAtkX;
            return(ret);
        }
Ejemplo n.º 3
0
        public void SetLevel(int level)
        {
            HeroLevel = level;
            _charHandler.m_CharData.CurAttack  = _charHandler.m_CharData.OriAtk * HeroLevel;
            _charHandler.m_CharData.CurDefence = _charHandler.m_CharData.OriDef * HeroLevel;
            _charHandler.m_CharData.MaxHP      = _charHandler.m_CharData.OriHP * HeroLevel;

            string f = ConfigData.GetValue("HeroLevelUp_Client", HeroIndex.ToString(), "CoinFormula").Replace("Lv", level.ToString());

            NeedCoin = Mathf.FloorToInt(FormulaManager.Arithmetic(f));
            SetBtnState();
        }
Ejemplo n.º 4
0
        public static float ExcuteFormula(string formula, string formulaMax, CharHandler charHandler, CharHandler aimCharHandler)
        {
            if (null == formula || string.Empty == formula)
            {
                return(0.0f);
            }

            string f;
            float  hurt = CheckNumber(formula);

            if (-1.0f == hurt)
            {
                f    = _ExcuteFormula(formula, charHandler, aimCharHandler);
                hurt = FormulaManager.Arithmetic(f);
            }

            if (null == formulaMax || string.Empty == formulaMax)
            {
                return(hurt);
            }

            f = _ExcuteFormula(formulaMax, charHandler, aimCharHandler);
            return(Mathf.Min(hurt, FormulaManager.Arithmetic(f)));
        }
Ejemplo n.º 5
0
        public static int BattleHeroLevelUpCoin(int index, int level)
        {
            string f = ConfigData.GetValue("HeroLevelUp_Client", index.ToString(), "CoinFormula").Replace("Lv", level.ToString());

            return(Mathf.FloorToInt(FormulaManager.Arithmetic(f)));
        }