Exemplo n.º 1
0
 //protected override void OnEnable()
 //{
 //    base.OnEnable();
 //    var v = new LevelUPInfo();
 //    v.startLevel = 9;
 //    v.endLevel = 10;
 //    v.startExp = 90;
 //    v.endExp = 50;
 //    v.abilityData = new List<LevelUPInfo.AbilityData>();
 //    LevelUPInfo.AbilityData ad = new LevelUPInfo.AbilityData(new int[] {1000,1000,102,120,102,102,120,903,120,432 },new int[] { 10,1,0,1,1,0,1,1,1});
 //    v.abilityData.Add(ad);
 //    Show(v);
 //}
 public void Show(LevelUPInfo _info)
 {
     base.Show();
     info     = _info;
     tLV.text = info.startExp.ToString();
     StartCoroutine(BarFadeAdd());
 }
Exemplo n.º 2
0
    public static LevelUPInfo GetAttackExp(CharacterLogic logic, int defenderCareerRank, int defenderLevel, bool isEnemyDead, int damage, bool isCritical)
    {
        int         attackerLevel  = logic.GetLevel();
        int         attackerExp    = logic.GetExp();
        int         careerRankDiff = 0;
        LevelUPInfo r         = new LevelUPInfo();
        int         levelDiff = attackerLevel - defenderLevel;
        int         exp       = careerRankDiff * 20 + levelDiff + 10;

        exp = Mathf.Max(exp, 2);
        if (isEnemyDead)
        {
            exp *= 3;
        }
        else
        {
            if (isCritical)
            {
                exp *= 2;
            }
        }
        exp        = Mathf.Min(100, exp);
        r.startExp = attackerExp;
        int finalExp = r.startExp + exp;

        r.endExp     = finalExp % 100;
        r.startLevel = attackerLevel;
        r.endLevel   = attackerLevel + finalExp / 100;
        if (r.endLevel > r.startExp)
        {
            CharacterAttribute add = GetGrow(logic.GetAttributeGrow());

            r.abilityData = new List <LevelUPInfo.AbilityData>();
            LevelUPInfo.AbilityData d = new LevelUPInfo.AbilityData(logic.GetAttribute().Array, add.Array);
            r.abilityData.Add(d);
        }
        return(r);
    }