Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
TownNPCProfiles.cs
Go to the documentation of this file.
2
4
5public class TownNPCProfiles
6{
7 private const string DefaultNPCFileFolderPath = "Images/TownNPCs/";
8
9 private const string ShimmeredNPCFileFolderPath = "Images/TownNPCs/Shimmered/";
10
11 private static readonly int[] CatHeadIDs = new int[6] { 27, 28, 29, 30, 31, 32 };
12
13 private static readonly int[] DogHeadIDs = new int[6] { 33, 34, 35, 36, 37, 38 };
14
15 private static readonly int[] BunnyHeadIDs = new int[6] { 39, 40, 41, 42, 43, 44 };
16
17 private static readonly int[] SlimeHeadIDs = new int[8] { 46, 47, 48, 49, 50, 51, 52, 53 };
18
20 {
21 {
22 22,
24 },
25 {
26 20,
28 },
29 {
30 19,
32 },
33 {
34 107,
35 LegacyWithSimpleShimmer("GoblinTinkerer", 9, 75, uniquePartyTexture: false, uniquePartyTextureShimmered: false)
36 },
37 {
38 160,
40 },
41 {
42 208,
44 },
45 {
46 228,
48 },
49 {
50 550,
52 },
53 {
54 369,
56 },
57 {
58 54,
60 },
61 {
62 209,
63 LegacyWithSimpleShimmer("Cyborg", 16, 58)
64 },
65 {
66 38,
67 LegacyWithSimpleShimmer("Demolitionist", 4, 59)
68 },
69 {
70 207,
71 LegacyWithSimpleShimmer("DyeTrader", 14, 60)
72 },
73 {
74 588,
76 },
77 {
78 124,
79 LegacyWithSimpleShimmer("Mechanic", 8, 62)
80 },
81 {
82 17,
83 LegacyWithSimpleShimmer("Merchant", 2, 63)
84 },
85 {
86 18,
87 LegacyWithSimpleShimmer("Nurse", 3, 64)
88 },
89 {
90 227,
92 },
93 {
94 229,
95 LegacyWithSimpleShimmer("Pirate", 19, 66)
96 },
97 {
98 142,
99 LegacyWithSimpleShimmer("Santa", 11, 67)
100 },
101 {
102 178,
104 },
105 {
106 353,
107 LegacyWithSimpleShimmer("Stylist", 20, 69)
108 },
109 {
110 441,
111 LegacyWithSimpleShimmer("TaxCollector", 23, 70)
112 },
113 {
114 108,
115 LegacyWithSimpleShimmer("Wizard", 10, 71)
116 },
117 {
118 663,
119 LegacyWithSimpleShimmer("Princess", 45, 54)
120 },
121 {
122 633,
124 },
125 {
126 37,
128 },
129 {
130 453,
131 LegacyWithSimpleShimmer("SkeletonMerchant", -1, -1)
132 },
133 {
134 368,
135 LegacyWithSimpleShimmer("TravelingMerchant", 21, 80)
136 },
137 {
138 637,
139 new Profiles.VariantNPCProfile("Images/TownNPCs/Cat", "Cat", CatHeadIDs, "Siamese", "Black", "OrangeTabby", "RussianBlue", "Silver", "White")
140 },
141 {
142 638,
143 new Profiles.VariantNPCProfile("Images/TownNPCs/Dog", "Dog", DogHeadIDs, "Labrador", "PitBull", "Beagle", "Corgi", "Dalmation", "Husky")
144 },
145 {
146 656,
147 new Profiles.VariantNPCProfile("Images/TownNPCs/Bunny", "Bunny", BunnyHeadIDs, "White", "Angora", "Dutch", "Flemish", "Lop", "Silver")
148 },
149 {
150 670,
151 new Profiles.LegacyNPCProfile("Images/TownNPCs/SlimeBlue", 46, includeDefault: true, uniquePartyTexture: false)
152 },
153 {
154 678,
155 new Profiles.LegacyNPCProfile("Images/TownNPCs/SlimeGreen", 47)
156 },
157 {
158 679,
159 new Profiles.LegacyNPCProfile("Images/TownNPCs/SlimeOld", 48)
160 },
161 {
162 680,
163 new Profiles.LegacyNPCProfile("Images/TownNPCs/SlimePurple", 49)
164 },
165 {
166 681,
167 new Profiles.LegacyNPCProfile("Images/TownNPCs/SlimeRainbow", 50)
168 },
169 {
170 682,
171 new Profiles.LegacyNPCProfile("Images/TownNPCs/SlimeRed", 51)
172 },
173 {
174 683,
175 new Profiles.LegacyNPCProfile("Images/TownNPCs/SlimeYellow", 52)
176 },
177 {
178 684,
179 new Profiles.LegacyNPCProfile("Images/TownNPCs/SlimeCopper", 53)
180 }
181 };
182
184
189
194
199
200 public static int GetHeadIndexSafe(NPC npc)
201 {
202 if (Instance.GetProfile(npc.type, out var profile))
203 {
204 return profile.GetHeadTextureIndex(npc);
205 }
206 return NPC.TypeToDefaultHeadIndex(npc.type);
207 }
208}
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
bool GetProfile(int npcId, out ITownNPCProfile profile)
Dictionary< int, ITownNPCProfile > _townNPCProfiles
static ITownNPCProfile TransformableWithSimpleShimmer(string subPath, int headIdNormal, int headIdShimmered, bool uniqueCreditTexture=true, bool uniqueCreditTextureShimmered=true)
static ITownNPCProfile LegacyWithSimpleShimmer(string subPath, int headIdNormal, int headIdShimmered, bool uniquePartyTexture=true, bool uniquePartyTextureShimmered=true)
static int TypeToDefaultHeadIndex(int type)
Definition NPC.cs:1651
int type
Definition NPC.cs:445