Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CreativeItemSacrificesCatalog.cs
Go to the documentation of this file.
1using System;
4using Terraria.ID;
5
7
9{
11
13
15
16 public void Initialize()
17 {
19 string[] array = Regex.Split(Utils.ReadEmbeddedResource("Terraria.GameContent.Creative.Content.Sacrifices.tsv"), "\r\n|\r|\n");
20 int key = default(int);
21 foreach (string text in array)
22 {
23 if (text.StartsWith("//"))
24 {
25 continue;
26 }
27 string[] array2 = text.Split('\t');
28 if (array2.Length >= 3 && ItemID.Search.TryGetId(array2[0], ref key))
29 {
30 int value = 0;
31 bool flag = false;
32 string text2 = array2[1].ToLower();
33 switch (text2)
34 {
35 case "":
36 case "a":
37 value = 50;
38 break;
39 case "b":
40 value = 25;
41 break;
42 case "c":
43 value = 5;
44 break;
45 case "d":
46 value = 1;
47 break;
48 case "e":
49 flag = true;
50 break;
51 case "f":
52 value = 2;
53 break;
54 case "g":
55 value = 3;
56 break;
57 case "h":
58 value = 10;
59 break;
60 case "i":
61 value = 15;
62 break;
63 case "j":
64 value = 30;
65 break;
66 case "k":
67 value = 99;
68 break;
69 case "l":
70 value = 100;
71 break;
72 case "m":
73 value = 200;
74 break;
75 case "n":
76 value = 20;
77 break;
78 case "o":
79 value = 400;
80 break;
81 default:
82 throw new Exception("There is no category for this item: " + array2[0] + ", category: " + text2);
83 }
84 if (!flag)
85 {
87 }
88 }
89 }
90 }
91
93 {
95 {
96 itemId = value;
97 }
99 }
100}
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
static string[] Split(string input, string pattern)
Definition Regex.cs:656
bool TryGetSacrificeCountCapToUnlockInfiniteItems(int itemId, out int amountNeeded)
static Dictionary< int, int > CreativeResearchItemPersistentIdOverride
static readonly IdDictionary Search
Definition ItemID.cs:12140
static string ReadEmbeddedResource(string path)
Definition Utils.cs:1957