refactor the skill system to adhere to the lore handbook
This commit is contained in:
@@ -1,20 +1,29 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NightclubArcadia.Skills
|
||||
{
|
||||
public enum DcBand
|
||||
{
|
||||
Trivial = 5,
|
||||
Easy = 8,
|
||||
Standard = 11,
|
||||
Trivial = 8,
|
||||
Routine = 11,
|
||||
Hard = 14,
|
||||
Formidable = 17,
|
||||
Legendary = 20,
|
||||
Specialist = 17,
|
||||
BuildDefining = 20,
|
||||
}
|
||||
|
||||
public static class DcBands
|
||||
{
|
||||
static readonly int[] BandValues =
|
||||
{
|
||||
(int)DcBand.Trivial,
|
||||
(int)DcBand.Routine,
|
||||
(int)DcBand.Hard,
|
||||
(int)DcBand.Specialist,
|
||||
(int)DcBand.BuildDefining,
|
||||
};
|
||||
|
||||
public static bool TryParse(string input, out int dc)
|
||||
{
|
||||
dc = 0;
|
||||
@@ -28,6 +37,13 @@ namespace NightclubArcadia.Skills
|
||||
if (int.TryParse(input, NumberStyles.Integer, CultureInfo.InvariantCulture, out var numeric))
|
||||
{
|
||||
dc = numeric;
|
||||
if (!IsBandValue(numeric))
|
||||
{
|
||||
Debug.LogWarning(
|
||||
$"[DcBands] DC {numeric} is not a named band " +
|
||||
$"(8 / 11 / 14 / 17 / 20). Prefer band names.");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -39,5 +55,18 @@ namespace NightclubArcadia.Skills
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool IsBandValue(int dc)
|
||||
{
|
||||
for (var i = 0; i < BandValues.Length; i++)
|
||||
{
|
||||
if (BandValues[i] == dc)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user