-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRarities.cs
104 lines (103 loc) · 2.85 KB
/
Rarities.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Origins {
public class CursedRarity : ModRarity {
public static string RarityName => "Cursed";
public static int ID { get; private set; }
public static Color Color => new Color(0.65f, 0f, 0.65f, Main.mouseTextColor / 255f).MultiplyRGBA(Main.MouseTextColorReal);
public override Color RarityColor => Color;//new Color(136, 22, 156);
public override void SetStaticDefaults() {
ID = Type;
}
public override int GetPrefixedRarity(int offset, float valueMult) {
return ID;
}
}
public class AltCyanRarity : ModRarity {
public static string RarityName => "Not Quite Cyan";
public static int ID { get; private set; }
public override Color RarityColor => new Color(43, 145, 255);
public override void SetStaticDefaults() {
ID = Type;
}
public override int GetPrefixedRarity(int offset, float valueMult) {
if (offset == 0) {
if (valueMult >= 1.2) {
offset += 2;
} else if (valueMult >= 1.05) {
offset++;
} else if (valueMult <= 0.8) {
offset -= 2;
} else if (valueMult <= 0.95) {
offset--;
}
}
return offset == 0 ? Type : ItemRarityID.Cyan + offset;
}
}
//interesting ship
public class ButterscotchRarity : ModRarity {
public static string RarityName => "Butterscotch";
public static int ID { get; private set; }
public override Color RarityColor => new Color(226, 182, 65);
public override void SetStaticDefaults() {
ID = Type;
}
public override int GetPrefixedRarity(int offset, float valueMult) {
switch (offset) {
case 0:
return ID;
case 1:
return CrimsonRarity.ID;
case 2:
return RoyalBlueRarity.ID;
default:
return ItemRarityID.Count + offset;
}
}
}
public class CrimsonRarity : ModRarity {
public static string RarityName => "Crimson";
public static int ID { get; private set; }
public override Color RarityColor => new Color(164, 29, 7);
public override void SetStaticDefaults() {
ID = Type;
}
public override int GetPrefixedRarity(int offset, float valueMult) {
switch (offset) {
case -1:
return ButterscotchRarity.ID;
case 0:
return ID;
case 1:
return RoyalBlueRarity.ID;
case 2:
return RoyalBlueRarity.ID;
default:
return ItemRarityID.Count + offset;
}
}
}
public class RoyalBlueRarity : ModRarity {
public static string RarityName => "Royal Blue";
public static int ID { get; private set; }
public override Color RarityColor => new Color(12, 42, 165);
public override void SetStaticDefaults() {
ID = Type;
}
public override int GetPrefixedRarity(int offset, float valueMult) {
switch (offset) {
case -2:
return ButterscotchRarity.ID;
case -1:
return CrimsonRarity.ID;
case 0:
return ID;
default:
return ItemRarityID.Count + offset;
}
}
}
}