Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ShimmerTransforms.cs
Go to the documentation of this file.
1using Terraria.ID;
2
4
5public static class ShimmerTransforms
6{
7 public static class RecipeSets
8 {
9 public static bool[] PostSkeletron;
10
11 public static bool[] PostGolem;
12 }
13
14 public static int GetDecraftingRecipeIndex(int type)
15 {
16 int num = ItemID.Sets.IsCrafted[type];
17 if (num < 0)
18 {
19 return -1;
20 }
22 {
23 return ItemID.Sets.IsCraftedCrimson[type];
24 }
26 {
27 return ItemID.Sets.IsCraftedCorruption[type];
28 }
29 return num;
30 }
31
32 public static bool IsItemTransformLocked(int type)
33 {
34 int decraftingRecipeIndex = GetDecraftingRecipeIndex(type);
35 if (decraftingRecipeIndex < 0)
36 {
37 return false;
38 }
39 if (!NPC.downedBoss3 && RecipeSets.PostSkeletron[decraftingRecipeIndex])
40 {
41 return true;
42 }
43 if (!NPC.downedGolemBoss && RecipeSets.PostGolem[decraftingRecipeIndex])
44 {
45 return true;
46 }
47 return false;
48 }
49
50 public static void UpdateRecipeSets()
51 {
52 RecipeSets.PostSkeletron = Utils.MapArray(Main.recipe, (Recipe r) => r.ContainsIngredient(154));
53 RecipeSets.PostGolem = Utils.MapArray(Main.recipe, (Recipe r) => r.ContainsIngredient(1101));
54 }
55}
static int[] IsCraftedCrimson
Definition ItemID.cs:215
static int[] IsCraftedCorruption
Definition ItemID.cs:217
static int[] IsCrafted
Definition ItemID.cs:213
static Recipe[] recipe
Definition Main.cs:1791
static bool downedGolemBoss
Definition NPC.cs:365
static bool downedBoss3
Definition NPC.cs:349
bool ContainsIngredient(int itemType)
Definition Recipe.cs:15792
static bool crimson
Definition WorldGen.cs:932