Esempio n. 1
0
 public void SetCurrentEnemy(EnemyAttr attr)
 {
     if (attr != null)
     {
         currentSlider.maxValue = attr.GetMaxHP();
         currentSlider.value    = attr.GetNowHP();
         if (currentSlider.value == 0)
         {
             IUserInterfaceManager.GetInstance().CloseUI(typeof(BloodUIConfig));
         }
         return;
     }
     Debug.LogError("EnemyAttr异常!!!");
 }
Esempio n. 2
0
        public override int GetAtkPlusValue(ICharacterAttr CharacterAttr)
        {
            EnemyAttr theEnemyAttr = CharacterAttr as EnemyAttr;

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

            int RandValue = UnityEngine.Random.Range(0, 100);

            if (theEnemyAttr.GetCritRate() >= RandValue)
            {
                theEnemyAttr.CutdownCritRate();
                return(theEnemyAttr.GetMaxHP() * 5);
            }

            return(0);
        }
Esempio n. 3
0
    // 攻擊加乘
    public override int GetAtkPlusValue(ICharacterAttr CharacterAttr)
    {
        // 是否為敵方數值
        EnemyAttr theEnemyAttr = CharacterAttr as EnemyAttr;

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

        // 依爆擊機率回傳攻擊加乘值
        int RandValue = UnityEngine.Random.Range(0, 100);

        if (theEnemyAttr.GetCritRate() >= RandValue)
        {
            theEnemyAttr.CutdownCritRate();                 // 減少爆擊機率
            return(theEnemyAttr.GetMaxHP() * 5);            // 血量的5倍值
        }
        return(0);
    }
Esempio n. 4
0
    //攻击加成
    public override int GetAtkPlusValue(ICharacterAttr CharacterAttr)
    {
        //是否为敌方属性
        EnemyAttr theEnemyAttr = CharacterAttr as EnemyAttr;

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

        //按爆率返回攻击加成值
        int RandValue = UnityEngine.Random.Range(0, 100);

        if (theEnemyAttr.GetCritRate() >= RandValue)
        {
            theEnemyAttr.CutdownCritRate();      //减少暴击概率
            return(theEnemyAttr.GetMaxHP() * 5); //血量的5倍值
        }
        return(0);
    }