Beispiel #1
0
    /// <summary>
    /// 受英雄嘲讽值影响
    /// </summary>
    /// <param name="heros">当前的英雄们</param>
    /// <returns></returns>
    public int TauntFunction()
    {
        float[] allTs = new float[Remaining_SRL.Count];
        float   maxT  = 0;

        for (int i = 0; i < allTs.Length; i++)
        {
            allTs[i] = Remaining_SRL[i].HeroProperty._role.taunt;
            allTs[i] = Mathf.Max(0.5f, allTs[i]);
            float f = allTs[i];
            if (Remaining_SRL[i].HeroProperty._hero._heroJob
                == _currentBattleUnit.EnemyProperty.AttackPreferenceInJob)
            {
                allTs[i] += f / 2;
            }
            if (Remaining_SRL[i].HeroProperty._hero._heroRace
                == _currentBattleUnit.EnemyProperty.AttackPreferenceInRace)
            {
                allTs[i] += f / 2;
            }
            maxT = Mathf.Max(maxT, allTs[i]);
        }
        if (_currentBattleUnit.EnemyProperty.CunningAttack)
        {
            for (int i = 0; i < allTs.Length; i++)
            {
                allTs[i] = Mathf.Max(maxT - allTs[i], 0.5f);
            }
        }
        int _rand = RandomIntger.StandardReturn(allTs);

        return(_rand);
    }
Beispiel #2
0
    public GDEItemData oneDropReward()
    {
        float[]       all   = new float[] { normalRate, rareRate, epicRate, legendRate };
        int           final = RandomIntger.StandardReturn(all);
        GDEItemData   drop  = new GDEItemData(GDEItemKeys.Item_MaterialEmpty);
        List <string> list  = allProbablyDropIds_normal;

        if (final == 0)//normal
        {
            list = allProbablyDropIds_normal;
        }
        else if (final == 1)//rare
        {
            list = allProbablyDropIds_rare;
        }
        else if (final == 2)//epic
        {
            list = allProbablyDropIds_epic;
        }
        else if (final == 3)//legend
        {
            list = allProbablyDropIds_legend;
        }
        int flag = UnityEngine.Random.Range(0, list.Count);

        drop.id = list[flag];
        //int stockKind = drop.id % 1000000;
        int weight = SDDataManager.Instance.getMaterialWeightById(list[flag]);

        if (weight <= 1)
        {
            drop.num = 1;
        }
        else
        {
            drop.num = UnityEngine.Random.Range(1, weight + 1);
        }
        return(drop);
    }