-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathFasterGamesDifficulty.cs
53 lines (48 loc) · 2.06 KB
/
FasterGamesDifficulty.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System.Reflection;
using RoR2;
using UnityEngine;
using static FasterGames.FasterGames;
namespace FasterGames
{
public static class FasterGamesDifficulty
{
public static DifficultyIndex AddDifficulty(float scalingPercentage)
{
DifficultyDef FasterDifficulty = CreateDifficultyDef(scalingPercentage);
Sprite diffIcon = MainAssets.LoadAsset<Sprite>("Assets/icons/FasterDifficultyIcon_V2.png");
return R2API.DifficultyAPI.AddDifficulty(FasterDifficulty, diffIcon);
}
private static DifficultyDef CreateDifficultyDef(float scalingPercentage)
{
return new DifficultyDef(
(scalingPercentage - 1) * 5, //0 is Normal mode. 2.5f is 50% which is monsoon
"Faster",
"",
GenerateDifficultyDescription(scalingPercentage),
GetDifficultyColor(),
"Faster",
true
);
}
private static Color GetDifficultyColor()
{
return new Color(0.875f, 0.875f, 0.14f);
}
private static string GenerateDifficultyDescription(float scalingPercentage)
{
string desc = "Games go 3x faster. For those who love the game, but not how long it takes.\n<style=cStack>";
desc = string.Join("\n",
desc,
$"> Difficulty Scaling: <style=cDeath>+{(scalingPercentage - 1) * 100}%</style>\n",
"<style=cIsHealing>+</style> Exp Rate",
"<style=cIsHealing>+</style> Money on Kill",
"<style=cIsHealing>+</style> Base Move Speed",
"<style=cIsHealing>+</style> Interactable Spawn Rate",
"<style=cIsHealing>+</style> Max items from Chance Shrine\n",
"> Reduces Teleporter Charge Time",
"> Spammable Printers and Chance Shrines</style>",
"\nThese values can be changed in the mod config.");
return desc;
}
}
}