Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AdjustSpecialSpawnRulesForVisuals()

void Terraria.GameContent.Bestiary.UnlockableNPCEntryIcon.AdjustSpecialSpawnRulesForVisuals ( EntryIconDrawSettings settings)
inlineprivate

Definition at line 125 of file UnlockableNPCEntryIcon.cs.

126 {
127 if (NPCID.Sets.SpecialSpawningRules.TryGetValue(_npcNetId, out var value) && value == 0)
128 {
129 Point point = (_npcCache.position - _npcCache.rotation.ToRotationVector2() * -1600f).ToTileCoordinates();
130 _npcCache.ai[0] = point.X;
131 _npcCache.ai[1] = point.Y;
132 }
133 switch (_npcNetId)
134 {
135 case 244:
137 break;
138 case 356:
139 _npcCache.ai[2] = 1f;
140 break;
141 case 330:
142 case 372:
143 case 586:
144 case 587:
145 case 619:
146 case 620:
147 _npcCache.alpha = 0;
148 break;
149 case 299:
150 case 538:
151 case 539:
152 case 639:
153 case 640:
154 case 641:
155 case 642:
156 case 643:
157 case 644:
158 case 645:
159 if (settings.IsPortrait && _npcCache.frame.Y == 0)
160 {
161 _npcCache.frame.Y = _npcCache.frame.Height;
162 }
163 break;
164 case 636:
165 _npcCache.Opacity = 1f;
166 if ((_npcCache.localAI[0] += 1f) >= 44f)
167 {
168 _npcCache.localAI[0] = 0f;
169 }
170 break;
171 case 656:
172 _npcCache.townNpcVariationIndex = 1;
173 break;
174 case 670:
175 _npcCache.townNpcVariationIndex = 0;
176 break;
177 }
178 }
static Dictionary< int, int > SpecialSpawningRules
Definition NPCID.cs:96
float[] localAI
Definition NPC.cs:449
void AI_001_SetRainbowSlimeColor()
Definition NPC.cs:54011
float[] ai
Definition NPC.cs:447
float rotation
Definition NPC.cs:501
Rectangle frame
Definition NPC.cs:485

References Terraria.GameContent.Bestiary.UnlockableNPCEntryIcon._npcCache, Terraria.GameContent.Bestiary.UnlockableNPCEntryIcon._npcNetId, Terraria.NPC.ai, Terraria.NPC.AI_001_SetRainbowSlimeColor(), Terraria.NPC.frame, Microsoft.Xna.Framework.Rectangle.Height, Terraria.GameContent.Bestiary.EntryIconDrawSettings.IsPortrait, Terraria.NPC.localAI, Terraria.NPC.rotation, Terraria.ID.NPCID.Sets.SpecialSpawningRules, Microsoft.Xna.Framework.Point.X, Microsoft.Xna.Framework.Point.Y, and Microsoft.Xna.Framework.Rectangle.Y.

Referenced by Terraria.GameContent.Bestiary.UnlockableNPCEntryIcon.Update().