Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
GoldCritterUICollectionInfoProvider.cs
Go to the documentation of this file.
1using Terraria.ID;
2
4
6{
7 private string[] _normalCritterPersistentId;
8
10
11 public GoldCritterUICollectionInfoProvider(int[] normalCritterPersistentId, string goldCritterPersistentId)
12 {
13 _normalCritterPersistentId = new string[normalCritterPersistentId.Length];
14 for (int i = 0; i < normalCritterPersistentId.Length; i++)
15 {
17 }
18 _goldCritterPersistentId = goldCritterPersistentId;
19 }
20
22 {
24 BestiaryEntryUnlockState bestiaryEntryUnlockState = BestiaryEntryUnlockState.NotKnownAtAll_0;
25 if (unlockStateForCritter > bestiaryEntryUnlockState)
26 {
27 bestiaryEntryUnlockState = unlockStateForCritter;
28 }
29 string[] normalCritterPersistentId = _normalCritterPersistentId;
30 foreach (string persistentId in normalCritterPersistentId)
31 {
32 BestiaryEntryUnlockState unlockStateForCritter2 = GetUnlockStateForCritter(persistentId);
33 if (unlockStateForCritter2 > bestiaryEntryUnlockState)
34 {
35 bestiaryEntryUnlockState = unlockStateForCritter2;
36 }
37 }
38 BestiaryUICollectionInfo bestiaryUICollectionInfo = default(BestiaryUICollectionInfo);
39 bestiaryUICollectionInfo.UnlockState = bestiaryEntryUnlockState;
40 BestiaryUICollectionInfo result = bestiaryUICollectionInfo;
41 if (bestiaryEntryUnlockState == BestiaryEntryUnlockState.NotKnownAtAll_0)
42 {
43 return result;
44 }
46 {
47 bestiaryUICollectionInfo = default(BestiaryUICollectionInfo);
48 bestiaryUICollectionInfo.UnlockState = BestiaryEntryUnlockState.NotKnownAtAll_0;
49 return bestiaryUICollectionInfo;
50 }
51 return result;
52 }
53
55 {
56 for (int i = 0; i < NPCID.Sets.GoldCrittersCollection.Count; i++)
57 {
59 string persistentId = ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[key];
60 if (GetUnlockStateForCritter(persistentId) > BestiaryEntryUnlockState.NotKnownAtAll_0)
61 {
62 return true;
63 }
64 }
65 return false;
66 }
67
69 {
70 if (!Main.BestiaryTracker.Sights.GetWasNearbyBefore(persistentId))
71 {
72 return BestiaryEntryUnlockState.NotKnownAtAll_0;
73 }
74 return BestiaryEntryUnlockState.CanShowDropsWithDropRates_4;
75 }
76}
GoldCritterUICollectionInfoProvider(int[] normalCritterPersistentId, string goldCritterPersistentId)
static Dictionary< int, string > NpcBestiaryCreditIdsByNpcNetIds
static List< int > GoldCrittersCollection
Definition NPCID.cs:4105
static BestiaryUnlocksTracker BestiaryTracker
Definition Main.cs:1868