Exemplo n.º 1
0
    int GetAttributeByName(PlayerStatsByClassEnum attributeName)
    {
        PlayerStatsCurve   statsCurve         = new PlayerStatsCurve();
        PlayerStatsByClass playerStatsByClass = playerStatsByClasses[playerClass];

        statsCurve = playerStatsCurves[0];

        switch (attributeName)
        {
        case PlayerStatsByClassEnum.dexterity:
            statsCurve = playerStatsCurves[playerStatsByClass.dexterity];
            break;

        case PlayerStatsByClassEnum.vitality:
            statsCurve = playerStatsCurves[playerStatsByClass.vitality];
            break;

        case PlayerStatsByClassEnum.strength:
            statsCurve = playerStatsCurves[playerStatsByClass.strength];
            break;

        case PlayerStatsByClassEnum.intelligence:
            statsCurve = playerStatsCurves[playerStatsByClass.intelligence];
            break;

        default:
            statsCurve = playerStatsCurves[playerStatsByClass.intelligence];
            break;
        }

        return(GetAttributeOnCurveByLevel(playerLevel, statsCurve));
    }
Exemplo n.º 2
0
    int GetAttributeOnCurveByLevel(int level, PlayerStatsCurve statsCurve)
    {
        float stat = (statsCurve.baseMultiplier * Mathf.Pow(statsCurve.classMultiplier, statsCurve.levelMultiplier * level)) + statsCurve.classBase;

        return(Mathf.FloorToInt(stat));
    }